Bringing maker education and computational thinking to the classroom.
Activity Name: Color Magic: Make a Color-Changing LightGrade Level:
6 (Could work for 7 & 8)
Two 45-minute sessions
science & technology
Light shows can be dramatic and beautiful. But even the most complex color-changing light show has at its heart basic rules about current. Students will use a physical model to experiment with resistance and current to create the colors of the rainbow and then take that knowledge digital as they program a micro:bit microcontroller to create their own mini light show.
light, color, circuit, RGB, LED, current, resistance, diode, conductive dough (Play-Doh)
Students will need to know that mixing colors of light is different from mixing paint colors. Many students learn in elementary school that the three primary paint (pigment) colors are red, blue, and yellow. Combinations of these pigment colors create the secondary colors purple, green, and orange.
Mixing colors of light is different. The three primary colors of light are red, green, and blue (the RGB of an RGB LED). For light, red + green = yellow, green + blue = cyan, and blue + red = magenta/violet. The difference between pigment color mixing and light color mixing is reviewed on the worksheet for Day 1.
Students should have basic knowledge of programming the micro:bit, such as completing the “Nametag” and “Rock, Paper, Scissors” activities at makecode.microbit.org. If they have not already used pins 0, 1, and 2 in previous projects, they will need instruction on where to find the pin commands in the programming environment.
After this activity, students should be able to:
Each group needs:
The first day of this activity uses Play-Doh and the gator:starter board to explore how changing the resistance to the legs of an RGB LED changes the color of light it produces. After exploring the basic concepts, students will create a micro:bit program that digitally changes the amount of current supplied to each LED leg in order to change the color of light produced. Remind students that light colors combine differently than paint colors.
Before the Activity
Note: You can use alligator clips with clips at either end for everything, but the pins make it less likely that the students will connect the battery pack directly to the board. The battery should only be connected to the board at GROUND. The positive connection for the battery should only be to the Play-Doh. The battery pack supplies more voltage than a micro:bit will. This is necessary because of the increased resistance of the Play-Doh.
Introduction / Motivation
Have you ever seen lights that change color? Was it in a toy, a string of lights, or maybe at an amusement park? Color-changing lights can be very beautiful and can seem complicated to make. You can use a single LED to make all the colors of the rainbow just by changing how much electrical current flows to it. (Teacher dims the room lights and demonstrates the micro:bit color-changing LED program. A thin piece of white paper in front of the LED will diffuse the color a bit to show the blended color better. This is especially helpful when showing this onscreen using a document camera.)
It looks like we’d need a computer to make the colors change, but for one LED, we only need some Play-Doh and a battery! Once we figure out how it all works, we can use the micro:bit microcontroller to get a bit more fancy, but it’s easier to figure out what’s happening if we first experiment on a model made of simpler materials.
Color-changing LEDs are called RGB LEDs. RGB stands for red, green, and blue -- the primary colors of light. RGB LEDs have four legs, one for each of these colors, and one for ground. If you only send electricity to the red leg, then the LED lights up red. If you send some electricity to the red leg and some to the green leg, then the LED lights up yellow. Remember, mixing light colors is not the same as mixing paint colors.
You’re going to build a color-changing light using an RGB LED, a battery, and Play-Doh for wires. (Display the basic Play-doh setup with a document camera or by having students gather around a table.) Depending on where we connect these wires to the battery, we can change the resistance of each leg. If the electricity has to travel farther to get to an LED leg, then that color will get less power.
With the Students:
Before the Activity
We were able to change the color of an RGB LED by changing the resistance in a circuit made with Play-Doh, but we can’t wire up a light display with Play-Doh. We can’t control hundreds of lights by moving our electrical connections around, but we can change the color of our LED by turning the amount of electricity supplied to an LED pin into a number. We can program it using a microcontroller.
Today, we are going to program a micro:bit microcontroller to change our LED’s color. This is the same type of technology and programming that is behind beautiful art installations like this one.
You’ll experiment in groups of two to discover the settings for different colors and then program a short light show.
With the Students: