What to expect
In this activity, we will continue exploring solar circuits by using solar cells to make music! We will do this in several different ways. First we will use the solar cells to provide power to a pre-programmed speaker in the solar classroom kit. Then, we will create a simple micro:bit program to detect the voltage from the solar cell and play a note corresponding to the solar cell’s voltage. When combined, they can play a horrible-sounding duet!
Connections
The last activity explored the differences between connecting solar cells in series and parallel, and we measured the resulting voltage and current output. Then we used the solar cells to create solar spinner art. This week, we will continue making new and different solar circuits, and we will use them to make music.
Part 1. Solar-Powered Music Speaker
Materials
Halogen light lamp, or, outdoor sunshine if it’s a sunny day
From the classroom solar kit:
2 mini solar cells
1 music speaker (it looks like a gold-colored, credit card-size paper with a circuit and quarter-size speaker taped to it)
Instructions
In groups of 2-3 people, collect the materials needed for the solar-powered music speaker. This is the same kind of speaker that could be found inside a birthday greeting card.
Figure 1. Solar-powered music speaker
The music speaker is designed to be powered by approximately 1.0 Volts, but it doesn’t have to be exact. Design a solar cell circuit that powers the music speaker. Hint: we saw last week that each solar cell produces around 0.5 - 0.6 Volts, and we saw that voltages add together when the solar cells are connected in series. Your design might look something like Figure 1.
Depending on how bright your environment is, the music speaker might start playing music immediately when it’s connected.
If you are using the halogen lamp as a light source, try moving the lamp closer or farther from the solar cells. If you are using outdoor sunshine, try partially shading one of the solar cells with your hand. Also, try changing the angle of the solar cell (horizontal, vertical, or in-between). What happens? These variations are caused by variations in the voltage produced by the solar cells.
Part 2. Singing Solar Micro:bit
Materials
Halogen light lamp, or, outdoor sunshine if it’s a sunny day
1 micro:bit with battery pack and USB cable
Computer to program the micro:bit
From the classroom solar kit:
1 mini solar cell
Instructions
In groups of 2-3 people, collect the materials needed for the singing solar micro:bit. The goal of this project is to make the micro:bit “sing” a different note depending on the output voltage of the solar cell that will be connected to the micro:bit.
Create a new micro:bit code by going to https://makecode.microbit.org/, click on New Project, and name your project “Singing micro:bit”, or something similar.
We will design our code so that when Button A is pressed, the micro:bit plays a fixed note. This will be useful to “test” that the code downloaded to the micro:bit successfully and is functioning properly. When Button B is pressed, the micro:bit will play a note based on the input voltage from the solar cell.
Figure 2. Code for the Singing Solar Micro:bit
4. Create a code like the code shown in Figure 2. Remember, in MakeCode, the blocks are color-coded. The bright red-colored blocks in Figure 2 are from the Music menu, the turquoise blocks are from the Logic menu, the bright purple blocks are from the Input menu, the dark red blocks are from the Pins menu, and the dark purple blocks are from the Math menu. If you can’t find a block in the menu, you can search for it at the top of the list of menus. Also, remember that if you right-click on any block, you can select Help for more information about that block.
How does this code work?
The dark red “read pin” block tells the micro:bit to read the voltage on Pin P1, which is the pin we will connect to the positive side of the solar cell. The dark purple “map” block transforms the input voltage value into a frequency (pitch) value that will be played by the micro:bit’s built-in speaker. The bright red blocks tell the micro:bit what frequency to play and the volume to play it at. The bright purple blocks are logic instructions, telling the micro:bit when to play each note.
5. If you are having trouble creating the code in Figure 2, ask your friends or your teacher for help. If you are still stuck, you can access the fully-completed code here: https://makecode.microbit.org/_0JM07K0Xi4r3
6. Download the code to your micro:bit by plugging in your micro:bit to your computer with the USB cable, and then press the purple “Download” button at the bottom left corner of the MakeCode screen. If the code does not automatically download to the micro:bit, drag the file that you just downloaded from the Downloads folder onto the micro:bit device. It will take a few seconds to copy the code onto the micro:bit.
7. Test the code by pressing button A on the micro:bit. If it plays a note, then it is working properly. If it doesn’t, check your code and then re-download it.
8. Disconnect the micro:bit from the USB cable, and connect it to the battery pack.
Figure 3. Circuit connections for the Singing Solar Micro:bit
9. Finally, attach the black alligator clip from a solar cell to the connection on the micro:bit labeled GND, and attach the red alligator clip from the solar cell to the connection on the micro:bit labeled “1”. Your circuit should look like Figure 3.
10. Press button B to hear the note that the micro:bit produces based on the input voltage of the solar cell. If you are using the halogen lamp as a light source, try moving the lamp closer or farther from the solar cell. If you are using outdoor sunshine, try partially shading the solar cell with your hand. Also, try changing the angle of the solar cell (horizontal, vertical, or in-between). What happens? The variations in pitch are caused by variations in the voltage produced by the solar cell.
11. Can you make the micro:bit play a simple tune by changing the light input to the solar cell? Have your friends guess what tune you are trying to play.
Extensions
If you have time: there are several other noise-making devices in the solar classroom kit that you can power with solar cells and use to annoy your teacher! For example, the kit contains a small buzzer and a radio. You can power these devices with solar cells, but you’ll need to apply close to the correct voltage.
Buzzer:
The buzzer is designed for an input voltage of 3 Volts. Remember that each mini solar cell produces about 0.5 - 0.6 Volts, and voltages add together when they are in series. What happens when the input voltage is slightly more or slightly less than 3 Volts? Don’t worry; you won’t damage the buzzer if the input voltage is slightly more or less than 3 Volts.
Radio:
The radio is intended to be powered by two AA batteries connected in series. A typical AA battery is about 1.5 Volts, which means that the radio is also designed for an input voltage of 3 Volts. Can you power it with solar cells?
Think about it
In this activity, we experimented with powering different devices with solar cells, and we used the solar cell’s voltage as an input to the micro:bit device, which the micro:bit can then use to create an output (e.g. sound).
What happens to voltage when solar cells are connected in series?
How and why did the output of the music speakers change when it was exposed to more or less light?
Was there anything about this activity that surprised you?
Feedback link: Click this link to provide feedback on this activity.
Next Time
Next week we will begin a new unit. In Unit 2 we will use the micro:bit to create some interesting games and applications like a wire loop game, using different kinds of electric motors, controlling RGB LED lights, and finally you will create your very own “smart model party house."