Introduction: Arduino-Programmable LED Infinity Mirror
Are you tired of looking at room elements that appear to have finite depth?
Maybe you should consider building your own Arduino-Programmable LED Infinity Mirror!
This optical illusion is an eye-catcher and offers lots of room for customization and cool programming. Additionally, at the end plans are included for a potential Arduino-Programmable LED Infinity Cube!!
Let's get started!
Step 1: Total Materials
The construction of a 5 inch by 5 inch Programmable LED infinity mirror requires the following materials:
- 5 inch x 5 inch x 1/8 inch Fully Reflective Acrylic Sheet
- 5 inch x 5 inch x 1/8 inch Two-Way Mirrored Acrylic Sheet
- 5 inch x 10 inch x 1/4 inch Uncoated Acrylic Sheet
- 24 x RGB Common Anode LEDs
- 6 x 74HC595N Shift Registers
- 6 x 16 Pin DIP Sockets
- 36 x 220 Ohm 1/4 Watt Resistors
24 Gauge Wires, Multiple Colors
4 inch x 4 inch Perforated PC Board
Spool of Copper Wire (for the +5 Volt rails)
1/16 inch Heat Shrink Tubing
- Acrylic Cement
- Black Spraypaint
In addition, we found the following tools indispensable.
- Soldering Iron (Fine Tip)
- Roll of Solder
- Needle-nose Pliers
- Wire Strippers
- Heat Fan
Below you can find information on where to look to cheaply get these materials!
TAP Plastics sells all the types of acrylic sheets that are required for this project, with customizable sizes. A useful thing to know is that it costs the same amount of money to order acrylic of dimensions 5 inch x 10 inch x 1/8 inch than it costs for an order of dimensions 5 inch x 5 inch x 1/8 inch (10$). So you might as well build two mirrors!
The cheapest LED's we could find were found here:
When deciding whether to use frosted or transparent, keep in mind that the infinity mirror's depth is a function of the intensity of the LED. For this reason we chose to use transparent LED's, so as to maximize the infinity effect. It is pertinent to point out though that as an RGB LED is literally three LED's in one, from certain angles one might be able to distinguish single red, green or blue LEDs through the transparent cap even though all three are on. This is because the LED's are squeezed in next to each other onto the same small head, and so are not truly a white light source. Thus, if your aim is to have soft, uniform rows that are a little shallower than they would be with transparent, the frosted LED's are for you.
While in principle it does not matter whether these are bought as common anode (common lead connected to positive voltage) or common cathode (common lead connected to ground), and it is possible to customize the program and circuit diagram for either type, this project explicitly outlines how to wire up a mirror using Common Anode RGB LEDs. In the other configuration, our perforated board would need to wire up all of the common leads to ground, and so would have a different design. Whatever you choose, make sure to use appropriate wiring later on!
74HC595N Shift Registers
If you have never worked with shift registers before, it is highly recommended to skim through the following Arduino Tutorial for some background: http://www.arduino.cc/en/Tutorial/ShiftOut.
As explained in the tutorial, the shift registers are used to expand the outputs of one Arduino so that you can control many LEDs from the limited amount of digital ports on the board. The 74HC595N is a type of shift register that has an extra feature that not all shift registers have. This is a so-called storage register, and it is an intermediate stage that stores an incoming signal (in the form of a byte) and will only process the signal on command from the microcontroller. This command is sent by the Arduino to the 595's latch pin. set the voltages at its output pins to high or low based on the positions of 0s or 1s within the byte. Whether a 0 or a 1 means a HIGH or LOW signal on that shift register's output pin can all be customized from the Arduino's end later.
For now, the most important part is that you familiarize yourself with the function of a shift register. The wiring and how to program them will all be covered later.
24 Gauge Wires, Multiple Colors
In this case, the gauge of the wires matters less than the fact that you have at least 4 colors available to you. If you do not have at least 4, wiring up the appropriate Red/Green/Blue inputs to your perforated board and trying to troubleshoot your mirror later on will prove nearly impossible and very frustrating. Save yourself the headache and look for different colors of insulation!
4-5/16 inch x 3-1/8 inch Perforated PC Board
These are a dime a dozen, and can be found cheaply anywhere from your local hardware store to online here: http://www.parts-express.com/perforated-pc-board-4...
These perforated boards can be thought of as customizable breadboards. They are plastic boards with a tight array of holes. While on one side all that you will see is plastic, on the other there are traces of solderable copper around each hole individually. By connecting the bottom copper traces of each holes with solder or stripped wires, you can connect the components poking out the top effectively and rigidly.
The rest of the materials need not be explained, as they are marketed as what their title is and there are no special considerations to be had.
Onwards and Upwards!
Step 2: Soldering Wires Onto the LEDs
The purpose of this step is to extend the output/inputs of the LED so that they can reach around the mirror to a common circuit board. We found it helpful to color-code the wires to each lead and common anode; that is, we used red wire for the Red lead, orange wire for Ground, green wire for the Green lead, and brown wire for the Blue lead (we didn’t have blue wire). As you will see, soldering consists of two connections: one physical, and one electronic.
- Plug in your soldering iron!
- Cut 24 10-inch strips of each color wire and strip the end (no more than a half-inch required). It is helpful to organize the wire bundles in the order you’ll be using them in. Since we soldered from Red to Blue in the aforementioned order, our wire bundles were also ordered from Red to Blue as mentioned above.
- Take the Red lead and bend it away from the other leads.
- Cut the lead to about half its original length.
- Bend the lead on itself, so that it looks like a hook.
- Slide the red wire into this hook (about halfway), bend it on itself, and pinch the lead closed. This is the physical connection.
- Clamp the bulb of the LED with one alligator clip and the wire with another; adjust so that the lead and wire are aligned.
- Take your soldering iron, heat up the joint, and apply solder to the connection. Don’t be scared to apply but be wary of putting too much as it will make it hard to add the plastic heat shrink afterwards. One good way of checking your solder is by moving the LED-wire connection after the solder has cooled down. If it wiggles, you haven’t applied enough solder, but if it acts as a single unit then you’ve done it right.
- Bend your soldered connection back to its original position.
- Repeat steps 3 through 9 but for the Ground, Green, and Blue leads.
- Cut 4 segments of the heat shrink and slide one over each soldered connection.
- Using a heating fan, shrink that plastic onto your wire.
Voila, you’ve successfully wired up one LED! Repeat another 23 times.
Step 3: Prep the Acrylic
After finishing up the LED's, your next step is to cut the acrylic to size. While access to a machine shop will speed up these steps, handheld power tools can of course also be used. The accompanying pictures, however, resulted from using the former.
If you ordered Mirrored Acrylic sheets that already came in 5 inch by 5 inch dimensions, you can ignore this next paragraph and skip to cutting the acrylic sides of the infinity mirror.
The fastest way to work with the acrylic is cut it using a bandsaw and drill the necessary holes using a mill. While handheld power tools would get the job done, access to a machine shop greatly increases the chance of a nicely-manufactured product. The first step was to cut both types of the mirrored acrylic sheets into 5 inch by 5 inch squares. The mirror will only be a nice and neat product if the dimensions are almost exactly the same, and so cut carefully! Keep in mind that the blade of the bandsaw will take away more material than a pencil's marking would suggest.
Uncoated Acrylic Sides
With the front and back mirrors at the right size, you can move on to cutting the acrylic sides from the 5 inch x 5 inch x 1/4 inch sheet. The dimensions, shown in an image above, are specifically for the 1/4 inch depth of the sides. It is easiest to cut your sheet in half to make two 5 inch x 2.5 inch x 1/4 inch sheets, and then to reduce the size of one of these sheets to 4.5 inch x 2.5 inch x 1/4 inch. Then, you will need to cut two 1/2 inch wide strips from both of these batches to use for the sides of the mirror.
Having two 5 inch x 1/2 inch x 1/4 inch and two 4.5 inch x 1/2 inch x 1/4 inch strips, you can move on to drilling the holes shown in the image above. They are designed to be evenly spaced in the visible part of the sides; in other words, they are evenly spaced in the center 4.5 inches of each strip. These will be the entry holes for the LEDs later on. As seen on the schematic above, each side will have 6 holes of 1/4-inch diameter.
As the acrylic sides are clear, the next step is to spraypaint the sides black. This coating will prevent both external light from entering and internal light from the LED's from reflecting, and is crucial for your final product. There aren't any special instructions on how to spraypaint these, and it doesn't even matter what the finish is as these sides will not be visible.
Step 4: Glue the Mirror Together
You have all the materials! Let’s build the infinity mirror!
- Take one fully reflective acrylic and one two-way mirrored acrylic and sand the borders of one surface each (no more than a 1/4-inch: the thickness of your acrylic with holes). This is because acrylic cement won't bond to the reflective coating on the acrylic
- Take a 5-inch drilled acrylic strip and apply acrylic cement (here onward referred to simply as glue) to the bottom of it. Apply the strip to one border of your fully reflective acrylic.
- Do the same for your 4.5-inch strips and apply to either side of the first 5-inch strip. Finish by gluing the remaining 5-inch strip opposite the first one.
- Take 6 LEDs and insert the through the holes of one strip, such that the bulb but not the leads of each LED protrude through the hole. We found the LEDs were more stable if we spread the wires before insertion.
- Apply glue to the row of LEDs; make sure it connects the LED to the acrylic and not just to itself.
- Repeat row by row for the remaining three sides. We recommend you allow some time for this to settle (e.g. 30 minutes) before the next step just so you don’t mess up the arrangement of LEDs.
- Apply glue to the top of all 4 strips and apply the two-way mirrored acrylic sandpapered-side down.
And there you have it!
Step 5: Wire It Up
Now that you have assembled the mirror, you can begin soldering your perforated board. For this step you will specifically need these materials:
6 x Shift Registers
6 x 16 Pin DIP Socket
36 x 220 Ohm Resistor
24 Gauge Wire, Multiple Colors
Having gathered these materials, take a look at your perforated board. In the schematic shown above, you should be able to identify the Arduino on the right, the 595 shift registers in a vertical line to the left, and the resistors leading off to the common anode RGB LEDs being connecting in parallel on the left. Make sure to pay attention to the order of the Red, Green and Blue inputs of each side of the mirror. As you can make out, the layout is so that on two opposing sides, the lower left would follow the upper right.
Note that there will be two such patterns, as the schematic only shows the LEDs of one side. This is because if there were two, the wiring diagram would no longer be easy to follow.
Having familiarized yourself with the layout, prepare to solder!
An important step before soldering these connections is to mentally plan out your board ahead of time. Many headaches can be avoided in this way by simply imagining where all the LED wires will be connected to resistors leading back to the shift registers in the right order. Having gathered these and prepared your work station, you will need to solder the following components, listed here in an order that would be relatively easy to solder.
16 Pin DIP Sockets
The purpose of this step is to solder the sockets that the shift registers will plug into. Soldering the shift registers would damage the internal electronics, and so to be safe it is good to solder these sockets independently. The layout of the sockets will affect how spaced out the LED connections you have to make to the resistors will be; if you stack them too close together, the resistors will be too cramped to provide comfortable soldering.
It is worth it to put quite a bit of solder onto the protrusion out of the copper side of the perforated board. This needs to be a solid connection, or you will experience annoying symptoms later on.
These should be placed with a row in between each resistor. This is for later soldering of the LEDs, as there will be a lot of solder going in a small area, and you want to minimize the risk of accidentally shorting something out. Furthermore, a good rule of thumb for soldering these is to push them in as far as they can go, and then to solder them in place. After having done this, you can move on to bending the long protruding lead of each resistor closest to the socket over onto the corresponding DIP Socket's pin. Then, you can simply heat up the solder at the pin with your iron, which should flow over and around the resistor's lead. In this way, you will neatly connect all the resistors on the top by soldering the copper bottom.
When you are completely done with each of these connections, make sure to use wire cutters to clip the long ends away. If you don't, they will get in the way and make the perforated board more inaccessible than it has to be.
Daisy-Chaining the DIP Sockets
As the DIP Socket's pins will match the 595's pins, the next step will be to connect the pins of the sockets that will need to be daisy-chained together for the 595's to work. As can be seen on the schematic, each pair of two sides will have three shift registers daisy-chained together. "Daisy-chaining" is just what it is called when you connect the shift registers so that you can talk to all of them by talking to one. This is done in two steps:
1) Connecting all of the latch pins and all of the clock pins in parallel with each other. When you are looking at the board from the top, solder-free side, this translates into connecting the fifth pin from the top left of each socket together (on the shift register diagram pin 12), and then connecting the sixth pin from the top left of each socket together (on the shift register diagram pin 11). You can do this by cutting appropriate size wires, stripping their ends, and then poking the ends through the holes right above two pins that need to be connected. It is best to first solder each of the wires into place using the copper traces around their holes and then to worry about bending over the stripped wire onto the corresponding pin. Be careful when you are doing this step, as the space is tight and it is possible to use too much solder!
2) Connecting the output pin of each shift register/socket with the data pin of the shift register/socket that is next in line. Once again looking from the top, this translates into connecting the top right pin of each socket (on the shift register diagram pin 8) with the data pin of the socket immediately neighboring it (on the shift register diagram pin 14). Don't connect these in parallel! It is crucial that these are linked together output->data, as the shift register's internal logic will eventually pass on signals to the next shift register in line. If they are connected out of order or otherwise improperly, the LEDs will not be connected in order and programming them will need to take that into consideration
Connecting Power to Your Circuit
The final step before finally bringing in all the wires is to add the ground and +5V connections to your circuit in order to power all of the components. This is going to require the following steps:
1) Connecting all of the leads that need +5 Volts in parallel. This can be done by adding +5 Volt rails to the edges of the perforated board above the sockets. The rails will consist of stripped wires soldered onto the back of the board, as can be seen in the pictures. Soldering these on is made a lot easier with something to hold the wire in place as you solder it in place, such as a paperclip. Also, keep in mind that all of the common anodes of the LEDs will need to connect to these rails as well. Be sure to leave enough space to accomodate this!
The leads of the socket that will need to be connected to these +5 Volts will be top left (on the shift register diagram pin 16) and the second from the top right (on the shift register diagram pin 9). In the pictures, for our mirrors you should be able to see wires that connect the socket's pins to the rail, which is laid a slight distance away from the row of sockets. This is a neat way to connect all the +5 Volts together. It will be most convenient to additionally wire the two +5 Volt rails together, and to add a long wire leading off to your power source from this grid of +5 Volts. In the pictures, this is seen as the brown wire hanging off of the board.
2) Adding the Ground connections to the appropriate pins of the socket in order to further comply with the power needs of the shift registers. There are two grounds per shift register. One of them is the fourth from the top left (on the shift register diagram pin 13) and the other is the bottom right pin (on the shift register diagram pin 7). These can all be connected in parallel and lead to a central hub of ground on the board, as can be seen in one of the pictures. Pooling all of the connections leading to ground at some area on your board, like your +5 Volt connection, will enable you to add a wire leading off the perforated board to your power supply. In the pictures, this is seen as the green wire hanging off of the board.
The way that each LED connection needs to be wired up is shown explicitly in the above schematic. The LEDs in this configuration are connected so that one row mirrors the other It is also pretty easy to figure it out yourself as you go, knowing the pattern that you want to follow. The best way to approach these LED connections is to try to claim what space you can on your perforated board and then to solder the two leads of the LEDs together in a clump along with one end of the resistor. Once again, make sure to use ample solder. Much like soldering the resistors to the DIP Socket's pin, you have the option of once again folding over the long lead of the resistor over the LED stripped wires poking out of the holes, or you could have the LED stripped wires folded over to touch the resistor's lead. Whichever works best for you!
After you have finished connecting the RGB wires in appropriate order to the resistors, the next step is to solder all of the remaining loose,common anodes of each RGB LED to the +5V rails of the board.
Soldering on the Arduino Leads
The final step in soldering your circuit board is to attach the wires that will connect to your arduino. This concretely means that, like the loose wires attached to the +5 Volt rails and Ground connections, you will have three wires hanging off the board for each daisy-chain of three shift registers. Thus, in total, you will have 8 wires that aren't connected to anything hanging off the board (1 +5 Volt, 1 ground, 2 x (3 inputs per daisy-chain)). On whichever your first shift register in line is, you will need to connect one wire to the free data pin (on the shift register diagram pin 14), one to the latch pin (on the shift register diagram pin 12) and one to the clock pin (on the shift register diagram pin 11).
That finishes up the wiring. If you're past this step, you're almost done!
Step 6: Arduino Programming
Now that everything is wired up right, you can try to turn on the mirror!
First, take your shift registers and stick them into their sockets. Make sure the orientation is right, in that the resistors attach to the Parallel-Out Pins of the shift register. If you stick them in the wrong way, there's a chance that they will overheat due to the power going into the wrong inputs of the shift register.
Next, attach your +5 Volt Power Supply to the +5 Volt and Ground lead hanging off the board and power up the shift registers.
Referring back to the last schematic, first try plugging in the wires coming from one daisy-chain into the Arduino in the following order:
Data to pin 11
Latch to pin 8
Clock to pin 12
Once you have succesfully connected these, try loading the program above named PrettyLights2 into your LED infinity mirror. This program simply gives "random" colors that should be the same for all 4 sides.
In this step, it is important to move slow. During our project of building multiple mirrors, we learned how easy it is to blow components by simply being careless during troubleshooting. Always double-check what you are about to supply power to, and never carelessly play with wires with the power on. Watching an infinite row of LEDs die in front of you is not pleasant this shortly after gluing them in place.
If some of the lights don't turn on evenly, you can take the ground lead coming from your power supply and touch the resistor lead closest to each shift register in order to see if the corresponding pair of Red, Green or Blue LEDs turns on in the mirror. If you touch the lead on the wrong side of the resistor, you will blow that color LED! Be very careful as you are testing LEDs!
More troubleshooting tips:
1) If two adjacent RGB LEDs don't turn on, then it is probably an issue with the shift register controlling those two. To see if it is a connection problem, try switching the faulty one with one that is working. Does a different pair of LEDs now not light up? This would indicate that the shift register is busted. If not, double-checking the connections leading to the socket responsible for the faulty lights and making sure that it is powered right will surely fix the problem.
2) If one RGB LED doesn't turn on while the other one does, it is most likely a problem with that RGB's common anode connection to the +5 Volts. If this looks ok, it is most likely blown out, either during manufacturing or transportation.
Good luck in making everything turn on and work!
Two opposing sides should mirror each other exactly, and with the program above, all four should all be twinkling in RGB colors, doing the same thing. What else can you program? Try it out!
Step 7: Future: Arduino-Programmable LED Infinity Cube?
Why stop at one mirror?
With this modular design, anything is possible!
The sky is the limit, and just to get you started on the infinity creations, why not build 5 mirrors and try to stick all the mirrors together to make an infinity cube?
The first, and most time-consuming, thing you’re going to do is make 4 more infinity mirrors. The idea is to have the 4 sides and top of the cube, and leave the bottom open to draw the wires, circuit boards and Arduinos.
We will piece the boards together by gluing cut wood to the backs of the mirrors such that (1) they piece together, and (2) there remains space between mirrors to draw in the wires. You can see the pieces we used in the picture, where the top piece is for the top mirror, and the two lowers ones were for adjoining sides (two more are needed for the remaining two side mirrors). Our cutouts measured 5.5x6 inches (except for the top, which measured 6x6) to fit our 5x5 mirrors.
*This is where we are with the project now, so the following are intended steps*
Glue the four sides together, and make sure all LED wires go into the center through the gap between adjacent pieces of wood. Try making as much space on the top, as the next step is adding the top mirror, and there isn't much option as to where those wires and circuit board can go.
Once all this is done, draw out your power wires and input/output wires for the Arduino, plug them in, upload the program, and you're done!
Feel free to experiment with programs; you can potentially program it so that lights seem to run around the cube, or make it a 60 second timer that leads to a spectacular light show once a minute has passed. The options are only limited by your imagination, so just have fun with it!
We have a be nice policy.
Please be positive and constructive.