Picture of Arduino-controlled RGB LED Infinity Mirror
Update 11/22/2013: Thanks to everyone who voted for this project in the Microcontroller Contest! It was one of three first-prize winners.

Update 9/17/2013: Thanks to everyone who voted for this project in the Arduino contest (I was one of ten "second prize" winners)! If you want to try this project with an addressable LED strip instead of an analog strip, check out the Rainbow Jar project (also an Arduino contest winner).

This is my take on a combination of two classic projects: RGB LED control with an Arduino, and an Infinity Mirror. It's an RGB LED infinity mirror that lets you toggle between an adjustable-speed color-fade mode and a direct-control mode where you individually set the red, green, and blue LED brightness levels. The primary inspiration for this particular project comes from this infinity mirror Instructable and Adafruit's RGB LED Strip tutorial, but there are many more quality resources out there on both projects.

I've done my best to gear this project towards newbies by providing an exact list of materials I used and the exact procedure that I followed. One recurring theme I've noticed in comment sections for other infinity mirrors is a lack of links to specific parts (e.g. exactly what type of LEDs or LED strips were used, what power supply, where to buy the mirrors, the enclosure...). Clearly, if you know what you're doing and want to spend more (or less) money to design a slightly different mirror, you can adjust your materials as needed, use a different Arduino board, etc. You can skip the Arduino entirely and make a pretty simple, cheap infinity mirror if you want (just search Instructables for "infinity mirror" and you'll find a few), or go crazy and spend hundreds if not thousands of dollars (search YouTube for "infinity mirror table" and you'll get the idea).

So, on to the materials list. Remember that this is an exact list of parts that I used, but I gradually cobbled together the supplies for this project over a long period of time. I didn't sit down, compare vendors (e.g. Adafruit vs. Sparkfun) and find the absolute cheapest way to build this. So, feel free to shop around to bring down the cost (and post links in the comments if you find a better/cheaper version of a certain part!). Quantities are just 1 (one) unless otherwise noted, prices are rounded to the nearest dollar as of September 2013.

Materials: Electronics

  • Arduino UNO R3 with mini breadboard and jumper wires. I have the Getting Started with Arduino Kit from Maker Shed ($65).
  • (Optional): Arduino/breadboard holder. The Maker Shed kit didn't come with one - I 3D printed this cool minimalist design I found on Thingiverse.
  • 1 meter RGB LED strip ($25). This is an analog strip, which means you can only control the color of the whole strip at once. SparkFun also carries a digital RGB LED strip which has individually addressable LEDs (if you wanted to send pulses of light down the strip one LED at a time, or have some other pattern), but it's more expensive ($45) and you'll need completely different Arduino code. Both strips can be cut to length to fit your mirror.
  • Four 10K potentiometers ($1 each).
  • Three N-channel MOSFETs ($1 each).
  • SPDT power switch ($1.50).
  • 22 AWG hookup wire (black), 100 feet ($8). This is only required if you pref to color-code your V+ and ground connections with red and black respectively. Otherwise you can just use the multi-colored jumper wires that come with most Arduino kits. 100 feet is also WAY more than you'll need for this project, but you can never have too much hookup wire! You can get a smaller 25' roll from SparkFun.
  • 22 AWG hookup wire (red), 100 feet ($8). Same note as above, with smaller roll here.
  • Barrel jack breadboard adapter ($1).
  • 12V/5A DC power supply ($25). This is a big place to potentially save money. The RGB LED strip I used requires 12V, and according to the datasheet, draws 60mA for every 3-LED segment (the smallest unit the strip can be cut into). So at 60 LEDs for the whole strip, that's an absolute maximum of 1.2A at full brightness. I had a 12V charger laying around from some old long-forgotten device, but it was only rated at 0.5A and couldn't light the whole strip. So, I went ahead and bought a beefy supply because I figured it would be useful for future projects anyway. Adafruit and SparkFun both carry smaller, cheaper 12V supplies (1A and 600mA respectively) that might suit your needs just fine depending on the size of your mirror and how many LEDs it will use. You could also scavenge something like an old laptop charger, but be sure to check the output voltage and current specs (usually printed on the label).
Materials: Building the Mirror

Important: there are three main parts that need to fit together to build this: the regular mirror, the frame, and the one-way mirror. First, it's easiest if you can find a cardboard/paper mache lid and a regular mirror that will fit snugly inside it  - the parts I bought didn't fit together perfectly, so I had to use a workaround (see Step 6). Second, cutting acrylic can be a pain depending on the tools you have available, so plan accordingly (see Steps 9 and 10). There's also an important consideration regarding the LED strip, which can't be cut to any length - it has to be cut in multiples of 3-LED segments, which are just shy of 2" long - so you want the inside perimeter of your mirror frame to be a multiple of that length. So, I'll link to the parts I used to build my mirror, but you can still follow these directions to build a mirror of a different size or shape.

  • 9" diameter circular mirror. I bought this kit of 7 mirrors ($14) with the intent of also making some smaller infinity mirrors. 
  • Kit of 8", 9", and 10" diameter round paper mache boxes ($9). Important - I bought these hoping that the 9" diameter mirror would fit snugly inside either the 9" lid or the box itself (and because I couldn't find individual boxes for sale on Amazon). It didn't. The 9" lid was just too small, and the 10" box was too big. So, I made it work by cutting out the top of the 9" lid, and just using the rim. This will make sense if you skip ahead and look at the pictures in Step 6. Point being, ideally you should use a mirror that fits snugly inside a paper mache lid or box.
  • 1/8" thick 12"x12" sheet of clear cast acrylic (plexiglass). Available on Amazon ($8) and McMaster-Carr ($9). Acrylic is super easy to cut if you have access to a laser cutter. I don't, so I tried using a jigsaw (Step 9) and a score-and-snap method (Step 10). Both worked reasonably well but resulted in some jagged edges, and in hindsight would have worked much better for a rectangular mirror instead of a round one. If you want to build a slightly smaller mirror, McMaster sells pre-cut 6" diameter circles. I didn't shop around much for larger pre-cut circles but you might be able to find them.
  • Mirrored window tint. I ordered this stuff from Amazon ($27) but you can easily find this in hardware stores. Probably hard to find in small quantities, so plan on having plenty left over.
  • Black paint. I picked up a can of generic black spray paint ($3) at A.C. Moore.
  • Optional: if you want to get really fancy, you might be able to order a custom-sized one way mirror, instead of putting mirrored window tint onto a piece of plexiglass. This will probably give you a higher optical quality in your final product, but I didn't look into it.

  • Soldering iron. I have this variable temperature one from SparkFun ($45). You might be able to get away without one, depending on how your LED strip arrives. The SparkFun product page says "You will need to solder on your own wires.", but my strip arrived with all four wires already soldered on. Even so, pushing the ends of the (stranded) wires into a breadboard can be a pain, so I recommend soldering on small segments of solid-core wire to make that easier.
  • Lead-free solder ($8).
  • Wire strippers ($5), if you don't already have a pair that can strip 22 AWG. Again, you can squeeze by without these if necessary, but I'm betting most people reading this have wire strippers.
  • Mini needle nose pliers ($2) if, like me, you're clumsy and hate handling tiny breadboard components with your fingers.
  • Power drill (see Step 6 - you can probably just get away with a sharp knife)
  • Super glue
  • Electrical tape
Got all that? Time to start building!
Remove these adsRemove these ads by Signing Up
1-40 of 77Next »

does the gap between the LED and real mirror/fake mirror matter , how much is your gap ?

Ben Finio (author)  renad.samaan18 days ago

That gap will determine the distance between the reflections. Closer together, the reflections will appear closer together. I think the gap in mine is a little less than an inch.

So if the gap between mirror and fake mirror is bigger that means that the ''tunel'' of light created will be bigger/longer??

Ben Finio (author)  bieniekmario18.16 days ago

I think so but there could be some limits to that...for example, you're increasing the surface area of the interior wall, so there's more area for light to get absorbed instead of bounced back and forth, possibly making the reflections dimmer. The best way to find out would be to start building a mirror, but don't permanently attach the "lid" yet - hold it at different distances away from the back and see how the image changes.

Thank u for the answer. But I have one more question. I want to build inside my mirror another mirror/shape like on the foto. So I need 2 LED strips. I bought 2LED strips with adapter but my questions is how connect the 2 strips to one adapter. Can I do this anyway?????

renad.samaan made it!18 days ago
Thank you very much!!?
Suepac712 months ago

that depth of field is INSAAAAAAAANE.....! it.

Im using the Adafruit neopixel led strip , will i need to use a completely different code as it is digital ?
Ben Finio (author)  mohammedmemon 3 months ago

Yes, you'll need to use different code AND a different circuit - but Adafruit has great guides on how to set everything up:

Thanks Ben, will I still be able to use the potentiometers?
Ben Finio (author)  mohammedmemon 3 months ago

Sorry, I should have clarified. The circuit to POWER the neopixels is different. You should check Adafruit's tutorials to be sure, but I don't think you need the MOSFETs at all - they just take a 12V supply line (I think).

You can still use the potentiometers as INPUTS to your Arduino to control what the neopixels do (but you will need to figure out the code). It might also help to check out this project, or other Instructables that use addressable LED strips:

goldenshuttle3 months ago

Ben, I raise my hat to you, as this is one the most well written instructable I came across. Keep posting please.

Ben Finio (author)  goldenshuttle3 months ago

Thank you!

This is an excellent instructable. I saw one for an infinity mirror but it didn't explain very well so I looked around and your's is the most explanatory where I could actually see what was happening. I am definitely going to build one. I won't be using an arduino, probably just some LED chistmas lights but this was very helpful with how it actually works and how to make an infinity mirror.
Ben Finio (author)  JavaProgrammer3 months ago

Thank you! Honestly that was part of my motivation for writing it originally. I saw a lot of cool infinity mirror builds (especially on YouTube, people go crazy and make whole desks/coffee tables/bar tops) but very few that actually provided a complete materials list, build instructions, and explanation of how they work. They work just fine with Christmas lights, and there are also RGB LED strips with remote controls you can buy so you don't need an Arduino:

Glad you found it helpful!

Thanks, I might get those.
keerthana4565 months ago
Can we use regular glass instead of plexiglass?
Ben Finio (author)  keerthana4565 months ago

Yes, regular glass will work fine, it's just harder to cut at home.

hftounia7 months ago


N-Channel MOSFET 60V 50A


N-Channel MOSFET 60V 30A


Ben Finio (author)  hftounia7 months ago

No, the LEDs shouldn't draw anywhere near 30 amps to begin with, so a MOSFET that is rated for 50 amps shouldn't be a problem.

What you care about is the gate threshold voltage though, which might be different. Do you have a link to the exact part you're considering?

Yes i considering for this

Ben Finio (author)  hftounia6 months ago

*and sorry for the long delay, I was on vacation for two weeks.

Ben Finio (author)  hftounia6 months ago

According to the data sheet for that part, the gate threshold voltage has a typical range of 2-4V. Since the Arduino operates at 5V, you should be fine.

hftounia hftounia7 months ago

I bought this leds

hftounia7 months ago

Yes i considering for this

HamiltonT7 months ago

Hey, this was really helpful. I reorganized some of the code into specific functions that are called by the loop and used a function that cycles through the colors a little more smoothly, I think. In the code below, I also make use of potentiometer 4 to give additional functionality of blinking, strobing, or constant on when the switch is in the other state.

// Arduino code to control and RGB LED strip
// Uses a toggle switch to switch between color-fade mode
// and individual RGB control mode
// adapted from

const int RED = 9; // define digital output pins for individual red,
const int GREEN = 10; //green and blue channels
const int BLUE = 11;

const int POT1 = 0; // define analog input pins for three potentiometers
const int POT2 = 1;
const int POT3 = 2;
const int POT4 = 3;

const int BUTTON = 2; // define digital input pin for the switch

int val = 0; // stores the state of the switch input pin

int FADESPEED = 0; // initiate fade speed set by potentiometer

int r = 0; // initialize the red, green and blue values

int g = 0;

int b = 0;

void setup(){
pinMode(RED, OUTPUT); // define digital pins as outputs and inputs as needed
pinMode(BLUE, OUTPUT);

void loop()
val = digitalRead(BUTTON); // read the input value from the toggle switch

if (val == HIGH)
//slowfade(); //I left the code in, but the program isn't using this
FADESPEED = analogRead(POT4);


void slowfade()
// code for RGB color fade
FADESPEED = analogRead(POT4)/10; // set the fade speed by reading analog input from 4th potentiometer
// analogRead will output a number between 0 and 1023, and "delay"
// is in milliseconds, so the biggest delay you'll get here is about
// 1/10 of a second. Divide by a different number to change the max
// fade time.
// fade from blue to violet
for (r = 0; r < 256; r++)
analogWrite(RED, r);
FADESPEED = analogRead(POT4)/10; // check the fade speed continuously, otherwise
// it won't update until it's gone through a complete cycle.
// Probably not the most efficient way to do this...

// fade from violet to red
for (b = 255; b > 0; b--)
analogWrite(BLUE, b);
FADESPEED = analogRead(POT4)/10;

// fade from red to yellow
for (g = 0; g < 256; g++)
analogWrite(GREEN, g);
FADESPEED = analogRead(POT4)/10;

// fade from yellow to green
for (r = 255; r > 0; r--)
analogWrite(RED, r);
FADESPEED = analogRead(POT4)/10;

// fade from green to teal
for (b = 0; b < 256; b++)
analogWrite(BLUE, b);
FADESPEED = analogRead(POT4)/10;
// fade from teal to blue
for (g = 255; g > 0; g--)
analogWrite(GREEN, g);
FADESPEED = analogRead(POT4)/10;

void potcontrol()
// code for individual RGB control with potentiometers
r = analogRead(POT3)/4; // read values from the 3 potentiometers and divide by 4 to set brightness
g = analogRead(POT2)/4; // note that analog read is 10-bit (0-1023), analog write is an 8-bit PWM
b = analogRead(POT1)/4; // signal so you need to divide this value by 4.

if (FADESPEED < 10) //when potentiometer reads very low value or 0, it goes into "constant on"
analogWrite(RED, r); // write analog values to red, green and blue output pins
analogWrite(GREEN, g);
analogWrite(BLUE, b);

analogWrite(RED, r); // write analog values to red, green and blue output pins
analogWrite(GREEN, g);
analogWrite(BLUE, b);


analogWrite(RED, LOW); // write analog values to red, green and blue output pins
analogWrite(GREEN, LOW);
analogWrite(BLUE, LOW);


void showSpectrum()
int x; // define an integer variable called "x"

for (x = 0; x < 768; x++)

FADESPEED = analogRead(POT4)/10;
showRGB(x); // Call RGBspectrum() with our new x
delay(FADESPEED); // Delay for 10 ms (1/100th of a second)

// showRGB()

// This function translates a number between 0 and 767 into a
// specific color on the RGB LED. If you have this number count
// through the whole range (0 to 767), the LED will smoothly
// change color through the entire spectrum.

// The "base" numbers are:
// 0 = pure red
// 255 = pure green
// 511 = pure blue
// 767 = pure red (again)

// Numbers between the above colors will create blends. For
// example, 640 is midway between 512 (pure blue) and 767
// (pure red). It will give you a 50/50 mix of blue and red,
// resulting in purple.

// If you count up from 0 to 767 and pass that number to this
// function, the LED will smoothly fade between all the colors.
// (Because it starts and ends on pure red, you can start over
// at 0 without any break in the spectrum).

void showRGB(int color)
int redIntensity;
int greenIntensity;
int blueIntensity;

// Here we'll use an "if / else" statement to determine which
// of the three (R,G,B) zones x falls into. Each of these zones
// spans 255 because analogWrite() wants a number from 0 to 255.

// In each of these zones, we'll calculate the brightness
// for each of the red, green, and blue LEDs within the RGB LED.

if (color <= 255) // zone 1
redIntensity = 255 - color; // red goes from on to off
greenIntensity = color; // green goes from off to on
blueIntensity = 0; // blue is always off
else if (color <= 511) // zone 2
redIntensity = 0; // red is always off
greenIntensity = 255 - (color - 256); // green on to off
blueIntensity = (color - 256); // blue off to on
else // color >= 512 // zone 3
redIntensity = (color - 512); // red off to on
greenIntensity = 0; // green is always off
blueIntensity = 255 - (color - 512); // blue on to off

// Now that the brightness values have been set, command the LED
// to those values

analogWrite(RED, redIntensity);
analogWrite(BLUE, blueIntensity);
analogWrite(GREEN, greenIntensity);

Ben Finio (author)  HamiltonT7 months ago

Nice, thank you!

dushu made it!8 months ago
petrichw10 months ago


I wanted to customize this into a 3D triangle. Could I program one Arduino with the two extra infinity mirrors I will make?

Ben Finio (author)  petrichw10 months ago

It depends which Arduino board you use and whether you want to control the colors of the three mirrors independently or not. You need 3 PWM outputs per mirror for independent control. The Arduino UNO only has 6, but the Arduino Mega has 15.

An alternative (and I've never done this myself, so can't provide great directions) is to look into "shift registers". This page says you can "control an almost endless amount of LEDs with only 4 pins", but I'm not sure if that works for PWM control or if it's just on/off:

Hawkens11 months ago

You can purchase mine by clicking the link below, while in the same time help me finish the larger project, and make the infinity mirrors available world-wide.

sturney1411 months ago

i copied and pasted the code exactly how you have it. I have also checked all my wiring a hundred times. For some reason I can't switch between the modes, when i plug it in it just stays on fade mode. please email me at if you have any suggestions

Ben Finio (author)  sturney1411 months ago
If you're using my code exactly, I think it will need to cycle between one complete fade cycle before it can switch. Are you trying to switch it immediately? Unfortunately, unless there's an error in my code or wiring diagram that no one else has caught yet, I'm not sure what to suggest :-(.

How long is one complete fade cycle? And theres definitely nothing wrong with the wiring it works perfectly. Its really cool actually! :) it just doesn't switch to the single control mode. only the fade mode works.

Ben Finio (author)  sturney1411 months ago

The fade speed is controlled by the 4th potentiometer (POT4 in the Arduino code). If you have it cranked all the way up, I think it's pretty slow, possibly a couple minutes. If you crank it all the way down it's really fast. So, try turning the potentiometer all the way in one direction before you run the code, then try again with it turned all the way in the other direction.

The non-ghetto way to do it is to use interrupts - see Antbert's comment and code below.

I know that much and its completed about 9000 fade cycles know but it still wont let me switch modes. Is there something i need to code?

Ben Finio (author)  sturney1411 months ago

Unless the toggle switch is wired wrong so that input pin is always reading HIGH for some reason, then I don't know what could be wrong. From step 4, the code looks something like this (just typing pseudocode here):

val = digitalRead(BUTTON);

if (val == HIGH)

{code to do color fade}


{code for individual control}

So, once it completes a single loop, it should read the toggle switch again and execute the proper code depending on whether the switch is high or low.

You could try some other debugging step, like hooking a multimeter up to that input pin to read the voltage, to make sure that it's actually toggling between high and low when you flip the switch. If it's toggling between 0V and 5V, then the problem must be in the code somehow and not in the hardware.

KingtarLED1 year ago

Its a nice project.I'm wondering whats the chip of the led strips ?

By the way,we're manufacturer of digital rgb strips in China.

We found the WS2801 individual addressable strip is widely used by Arduino controlled.our

joshdeg1 year ago
Awesome Instructable! I am using the controller portion of this to power 70 ft of RGB LEDs for a custom home theater. Just a side note, when using a heat sink make sure it is not grounded and the MOSFETs drain flanges (top metal part with the hole) aren't connected. I would suggest using separate heat sinks for each of the MOSFETs if you do decide you need them.
Antbert1 year ago

Hello. Great tutorial and the result looks brilliant! I'm making this too, and I wrote some code using an interrupt that allows you to switch between various sequences (mine is an automatic fade, and a pot-controlled colour one). I notice you said you couldn't get it to switch until the end of the loop but the interrupt deals with this quite nicely. I uploaded it in pastebin anyway for reference:

1-40 of 77Next »