Use an Arduino™ to Control a Color-Changing Infinity Mirror *
|Areas of Science||
|Time Required||Long (2-4 weeks)|
|Prerequisites||Previous experience with electronics and an Arduino microcontroller is recommended. If not, you may need to complete some basic Arduino tutorials before attempting this project.|
|Material Availability||This project requires an Arduino microcontroller, circuit components, and materials to build the mirror. See the Materials list for more information.|
|Cost||High ($100 - $150)|
|Safety||Short circuits can damage your Arduino or other electronic components. Always be careful when working with electronic circuits.
Cutting plexiglass can create jagged edges or small shards of material. Always wear protective eyewear when cutting plexiglass.
AbstractThis project is a follow-up to the Science Buddies project Explore Optical Illusions: Build an Infinity Mirror, which shows you how to build a basic infinity mirror using light emitting diodes (LEDs) and arts and crafts materials. What if you wanted to build an infinity mirror that could change colors, like the one in Figure 1?
Figure 1. A color-changing infinity mirror.
You can do this by using special RGB (red, green, and blue) LEDs. Just like the pixels on a TV or computer monitor, an RGB LED actually contains three distinct color LEDs that can be controlled individually. Adjusting the relative brightness of the three base colors enables you to create a huge combination of other colors. Figure 2 shows the basic color combinations.
- Note: Additive color mixing, which is what occurs when you add two or more different colors of light, is different from subtractive color mixing, which is what happens when you mix two or more different paints or pigments. Can you look up the difference between the two terms, and explain which one is used in this project?
Figure 2. Additive color mixing: Red and green are combined to make yellow; red and blue are combined to make magenta; and blue and green are combined to make cyan. All three colors are combined to make white, and the absence of any color leaves black. (Image credit: Wikimedia Commons user Quark67, 2006)
So, how do you control the individual brightness of the red, green, and blue LEDs? Engineers and hobbyists commonly do this using pulse-width modulation or PWM. Pulse-width modulation essentially means that you flick the LED on and off very fast, much faster than the human eye can see. Varying the width of the "pulse" relative to the on-off period is called the duty cycle. A duty cycle of 0% means the LED is never on, and will appear dark. A duty cycle of 100% means the LED is always on, and will appear at full brightness. A duty cycle of 50% means the LED is on half the time and off half the time — so it will light up, but not as bright as a 100% duty cycle. Figure 3 shows graphs of voltage vs. time for different duty cycles.
Figure 3. Graphs of voltage versus time for different duty cycles. The greater the duty cycle, the brighter an LED will appear. These graphs are just for illustration purposes, so the axes do not have specific units. For example, if an LED is on for 1/100th of a second and off for 1/100th of a second, or on for one second and off for one second, in both cases the LED has a 50% duty cycle.
How would you go about using pulse-width modulation to control the brightness of three different LEDs? You have probably guessed that manually flicking three switches on and off as fast as you can is not going to work. This is where a microcontroller comes in handy. You can program a microcontroller, like the popular Arduino™, to electronically control LEDs using pulse-width modulation. Can you build your own infinity mirror with RGB LEDs that are controlled by a microcontroller, like the one in Figure 1?
Because this is an abbreviated project idea, Science Buddies will not provide an exact list of materials or a procedure you can follow to build a specific type of mirror. Instead, you will have to do some of your own background research and figure out how to use an Arduino and build an infinity mirror. The references in the Bibliography can help you get started, but how exactly you design, build, and control your mirror is up to you. The possibilities are nearly endless for the sensors and control mechanisms you can use with an Arduino. Here are just a few ideas you can try:
- Use individual control knobs to manually adjust the three LED colors (as the first reference in the Bibliography does).
- Make the LEDs react to sound from an audio source, like an MP3 player or a microphone (search the Web for something along the lines of "sound activated LED" and you will find many good tutorials).
- Control the color of the LEDs with a distance sensor that measures how far a person looking at the LEDs is standing in front of the mirror.
- Make a temperature-controlled infinity mirror using a temperature sensor.
- Use a light sensor to automatically turn the LEDs on when the room is dark and turn them off when the room is bright.
- Make the LEDs change color based on the time of day.
- Use a digital LED strip (also referred to as an addressable LED strip), where the color of each RGB LED can be controlled individually (the mirror in Figure 1 uses an analog LED strip, where each RGB LED must be the same color).
Ben Finio, PhD, Science Buddies
- Arduino is a registered trademark of Arduino and its partners.
Cite This PageGeneral citation information is provided here. Be sure to check the formatting, including capitalization, for the method you are using and update your citation, as needed.
Last edit date: 2017-07-28
- Finio, B. (2013, September 1). Arduino-controlled RGB LED infinity mirror. Instructables.com. Retrieved June 13, 2014, from http://www.instructables.com/id/Arduino-controlled-RGB-LED-Infinity-Mirror/
- Eglowstein, H. (2014, March 11). Getting started with Arduino. Science Buddies. Retrieved June 13, 2014, from http://www.sciencebuddies.org/science-fair-projects/project_ideas/Robotics_Arduino.shtml
News Feed on This Topic
Ask an ExpertThe Ask an Expert Forum is intended to be a place where students can go to find answers to science questions that they have been unable to find using other resources. If you have specific questions about your science fair project or science fair, our team of volunteer scientists can help. Our Experts won't do the work for you, but they will make suggestions, offer guidance, and help you troubleshoot.
Ask an Expert
If you like this project, you might enjoy exploring these related careers:
Computer Software EngineerAre you interested in developing cool video game software for computers? Would you like to learn how to make software run faster and more reliably on different kinds of computers and operating systems? Do you like to apply your computer science skills to solve problems? If so, then you might be interested in the career of a computer software engineer. Read more
Electrical & Electronics EngineerJust as a potter forms clay, or a steel worker molds molten steel, electrical and electronics engineers gather and shape electricity and use it to make products that transmit power or transmit information. Electrical and electronics engineers may specialize in one of the millions of products that make or use electricity, like cell phones, electric motors, microwaves, medical instruments, airline navigation system, or handheld games. Read more
Computer ProgrammerComputers are essential tools in the modern world, handling everything from traffic control, car welding, movie animation, shipping, aircraft design, and social networking to book publishing, business management, music mixing, health care, agriculture, and online shopping. Computer programmers are the people who write the instructions that tell computers what to do. Read more
News Feed on This Topic
Looking for more science fun?
Try one of our science activities for quick, anytime science explorations. The perfect thing to liven up a rainy day, school vacation, or moment of boredom.Find an Activity
Explore Our Science Videos
Make Your Own Lava Lamp
Walking Water Experiment
Paper Rockets - STEM Activity