Introduction: Chromatic Temperature Display - Arduino Controlled RGB LED Infinity Mirror
This project was loosely inspired by this, a weather station display whose color is based on the outdoor temperature. I had a roommate in college who had one of these and it was very useful, in Pittsburgh especially, to just glance at the color and know how many or few layers to put on before going outside.
I was looking for a cool way to achieve the visual temperature display that would also be a fun and possibly challenging project. I decided on making an RGB LED Infinity Mirror controlled with Arduino.
To start, I began with looking through instructables and I found two that served my purposes pretty well. The first was for a project that used temperature sensors and a transmitter/receiver combo to display temperature to an LCD screen. The second was a video on constructing an infinity mirror.
This project will use a transmitter and a temperature sensor to send the outside temperature to a receiver connected to a strip of LEDs inside. The LEDs will be arranged in an infinity mirror for an attractive and useful light display.
Step 1: Materials
- RGB LED strip - The length and number of LEDs can be specific to your project. I already had a 2 meter strip of these from Adafruit that I bought out of curiosity and hadn’t found a use for yet.
- Microcontrollers (2) - I used the Arduino Uno. I did not have an Arduino before this project, so I bought two of this which include a lot of materials that are useful for general electrical projects. Used in this project and included in this kit are: Jumper wires, a Breadboard, an Arduino and Breadboard holder, 330 Ohm Resistors, and an Arduino to USB cable.
- Female 2.1 mm Barrel Jack to Power/Ground - I used these.
- Hookup Wire - I used solid core copper wire for circuit connections.
- 1000 uF Capacitor - This was recommended for the LED strip that I purchased. See the Adafruit Uberguide.
- RF 433 MHz Module - I used these.
- Temperature Sensor - I purchased this DS18B20 sensor. This sensor requires a 4.7 KOhm resistor between data and the microcontroller.
- Power Supply - See steps 2&3 for power supply selection.
Materials: Building the Infinity Mirror
- Shadowbox (Black) - You can make a shadowbox by cutting cardboard (or other material) and fashioning it into a frame. I chose to buy a shadowbox at Michaels for around $12.99 on sale. This shadowbox has a glass front (necessary for the infinity mirror) and spacing inserts so the depth of the box is adjustable.
- Mirror - The mirror should be the size for your frame. If you are making a frame, any mirror size/shape will be do-able.
- Glass/Plexiglass/Acrylic - The frame will need a clear front face. Many store bought frames or shadowboxes come with glass. A good alternative is clear acrylic that you can cut with a jigsaw or lasercutter if available to you. The size and shape should match the frame and the mirror you are using.
- Window Tint (preferably mirrored) - The window tint goes on the glass face, facing inward. A mirrored tint should provide more of the infinity effect than regular window tint.
- Soldering Iron and Solder Wire
- Wire Cutters/Strippers
- Philips Screwdriver - For attachments to Arduino Breadboard holder
**All images used in the Materials section have related links in the part descriptions.
Step 2: Transmitter Circuit
Transmitter - The transmitter I used has 3 pins. The leftmost is PWR, middle is DATA, and rightmost is GND (make sure you check this on your own model). The data wire is connected at the middle pin and routes to pin 12 on the Arduino.
Temperature Sensor - The DS18B20 sensor has three pins. The leftmost is PWR, middle is DATA, and rightmost is GND (make sure you check this on your own model also). The data pin is in line with a 4.7k ohm resistor and a route to power. The data runs from the sensor to the Arduino (pin 7).
Arduino - The Arduino has power routing from the Vin pin to the breadboard and ground routed to the breadboard.
Power - Pictured is my circuit without the power supply. You can use any 5V power supply of your choosing. I used a battery pack so that this circuit could be housed outside without dependency on an outlet.
Step 3: Receiver Circuit With LED Strip
Receiver - The receiver I used has 4 pins. The leftmost is PWR, the center 2 are DATA, and rightmost is GND (make sure you check this on your own model). The data wire is connected at the 2nd or 3rd pin and routes to pin 11 on the Arduino.
Adafruit Neopixel Strip - The Adafruit strip comes with a weatherproof casing and some test wires. Since the LEDs will be inside a frame, I began with removing the weatherproof casing and the pre-soldered wires. I braided a set of PWR, DATA, GND solid core copper wires for stability and soldered them to the first Neopixel. (Tip: Place some solder on the pads of the first Neopixel to tin them first, then solder the wires onto the pads. Secure the connection with hot glue or electrical tape.)
Connect the LED power and ground to the circuit. The data should have a resistor of 300-500 ohm between the Arduino (Pin 6) and the LED strip. I used a 330 ohm resistor.
Arduino - The Arduino has power routing from the Vin pin to the breadboard and ground routed to the breadboard. Make sure that the Arduino and the LED strip have a common ground (grounded on the same side of the breadboard), otherwise you will get some erratic colors and flashing.
Power - Pictured is my circuit without the power supply. The strip requires a large capacitor (1000 uF) between the power source and the power input. Based on the number of LEDs in the strip, you will want either a 5V 2A power source (<50 LEDs), or a 5V 10A switching power source. My project used 71 LEDs so I used this power supply with this adaptor.
Step 4: Test Transmitter/Receiver
When testing your transmitter and receiver, switch your power pin in the Arduino from Vin to 5V on each circuit. Disconnect the external power supply and use the USB to 2.1mm cord to power the board.
Download the necessary libraries and upload the transmitter-test and receiver-test code (download below) to the related boards. When you are in the Receiver port, open up the Serial monitor and you should see "Message: Hello World!" printed. If you do not see the message, double check your wiring and your power. Once you see that the modules are working, return the power to its original setup.
- Download the RadioHead Library
- Install the RadioHead library into your Arduino IDE
- Restart your Arduino IDE
Step 5: Test the LEDs
Download Files: Download the attached files and libraries.
Upload the code titled "SingleColorTest" to the board with the LEDs.
- Edit Line: Adafruit_NeoPixel strip = Adafruit_NeoPixel(number_of_LEDs, PIN, NEO_GRB + NEO_KHZ800);
Where number_of_LEDs is the number of LEDs you are using.
- Edit Line: strip.setPixelColor(i, strip.Color(R, G, B));
Where R, G, B are the concentrations of Red, Green, and Blue (Value: 0 - 255). Use this code to test various colors with combinations of RGB. The image shown with green LEDs is what the SingleColorTest shows without edits.
Once you've tested your LEDS, upload the code titled "Transmitter" to the transmitter circuit Arduino, and upload the code titled "Receiver" to the receiver circuit Arduino.
Step 6: Build the Infinity Mirror
How an Infinity Mirror Works
An infinity mirror has three main components: a standard mirror, an LED strip, and a one-way mirror. The way we achieve the one-way mirror is by applying mirror tint onto a piece of glass or acrylic. The mirror tint faces towards the standard mirror and the LED strip is sandwiched in between.
The way the illusion works is that the full light of the LED is reflected off of the standard mirror, but not 100% of the light escapes through the tinted glass; some light gets reflected back towards the mirror. This process goes on, bouncing the light back and forth, giving the illusion of an infinite tunnel!
Apply Mirror Tint
- Clean both sides of glass thoroughly with Windex.
- Spray the glass with soapy water.
- Peel the backing off of the mirror tint and spray the sticky side of the tint with soapy water.
- Apply the sticky side of the tint to the soapy side of the glass.
- Push out any bubbles with a credit card or squeegee.
- Let dry for about an hour.
- Insert glass into the frame with the tint side facing inward.
Secure LED Strip
- The shadowbox I used had plastic spacers included. I used one of these spacers to act as a frame for the LEDs.
- Secure LED strip to the interior of the frame or to a plastic spacer so that they will hold a shape. I used twist ties to secure the LED strip. You can also use glue for a more permanent fixture.
- Insert LED strip into the frame and route the wires out a corner. (Alternatively, you can drill a hole in the side of the frame and route the wires out that way.)
- Clean the mirror thoroughly with Windex.
- Insert the mirror behind the LEDs, facing the tinted side of the glass.
- If there is room for a back panel, insert and secure the panel. In my case, the mirror took up the space, so I secured the mirror directly into the frame.
Step 7: Display!!
Connect the power to both circuits and house the Transmitter circuit outside. I 3D-printed a simple box to hold the circuit, microcontroller, and power supply and placed it on my apartment patio.
Display your temperature gradient infinity mirror!
We have a be nice policy.
Please be positive and constructive.