Jump to main content

Use an Arduino™ to Control a Color-Changing Infinity Mirror

550 reviews


Areas of Science
Time Required
Long (2-4 weeks)
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
An Arduino kit is available from our partner Home Science Tools. LED strip must be purchased separately.
High ($100 - $150)
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.


Ben Finio, PhD, Science Buddies

  • Arduino is a registered trademark of Arduino and its partners.
Rings of light in six different colors seem to repeat forever in a circular infinity mirror
*Note: For this science project you will need to develop your own experimental procedure. Use the information in the summary tab as a starting place. If you would like to discuss your ideas or need help troubleshooting, use the Ask An Expert forum. Our Experts won't do the work for you, but they will make suggestions and offer guidance if you come to them with specific questions.

If you want a Project Idea with full instructions, please pick one without an asterisk (*) at the end of the title.


This 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?
Rings of light in six different colors seem to repeat forever in a circular infinity mirror
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.

A red, green and blue circle evenly overlap and mix in color in the sections where they overlap
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.

Four graphs of example duty cycles that can control the brightness of an LED strip
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:


icon scientific method

Ask an Expert

Do you have specific questions about your science project? 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.


If you like this project, you might enjoy exploring these related careers:

Career Profile
Are 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
Career Profile
Just 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
Career Profile
Computers 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

Contact Us

If you have purchased a kit for this project from Science Buddies, we are pleased to answer your questions.

In your email, please follow these instructions:
  1. What is your Science Buddies kit order number?
  2. Please describe how you need help as thoroughly as possible:


    Good Question I'm trying to do Experimental Procedure step #5, "Scrape the insulation from the wire. . ." How do I know when I've scraped enough?
    Good Question I'm at Experimental Procedure step #7, "Move the magnet back and forth . . ." and the LED is not lighting up.
    Bad Question I don't understand the instructions. Help!
    Good Question I am purchasing my materials. Can I substitute a 1N34 diode for the 1N25 diode called for in the material list?
    Bad Question Can I use a different part?

Contact Us

News Feed on This Topic

, ,

Cite This Page

General 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.

MLA Style

Science Buddies Staff. "Use an Arduino™ to Control a Color-Changing Infinity Mirror." Science Buddies, 6 Dec. 2023, https://www.sciencebuddies.org/science-fair-projects/project-ideas/CompSci_p050/computer-science/color-changing-infinity-mirror-arduino. Accessed 27 Feb. 2024.

APA Style

Science Buddies Staff. (2023, December 6). Use an Arduino™ to Control a Color-Changing Infinity Mirror. Retrieved from https://www.sciencebuddies.org/science-fair-projects/project-ideas/CompSci_p050/computer-science/color-changing-infinity-mirror-arduino

Last edit date: 2023-12-06
Free science fair projects.