loading

Ever since my addressable RGB LED strips (WS2812B) came from Aliexpress, I've been fascinated with LED projects. Following up on my success with my Charlieplexed LED clock, I wanted to create something with more Jazz..

While browsing google images, I came across an instructable for an Arduino Infinity Mirror and the brain cells started working in overdrive. Why shouldn't I make an infinity mirror, that's also a clock !!

Features:

  1. Works like a clock - the colours of the hands are user-programmable over bluetooth
  2. Has an IR sensor to sense if someone is coming near the mirror. Switches off the LEDs, so that this can be used as a normal mirror :-)
  3. Shows a rainbow effect every 15 minutes (time is user adjustable)
  4. Has a touch button to toggle between clock and rainbow effects
  5. Switches to night mode between midnight and 7:00 AM - can be changed in the code.
  6. Can be programmed over bluetooth - so you do not need to take it off the wall if you need to update the code

World Maker Faire New York 2015

Step 1: Electronics

  1. A Standalone Arduino: http://dushyant.ahuja.ws/2013/10/standalone-arduin... OR Arduino mini pro: http://www.aliexpress.com/item/10Pcs-Lot-Pro-Mini-...
  2. RTC Module – DS1302: http://fabtolab.com/DS1302-RTC-module?search=rtc
  3. LM2596 Step Down Adjustable Power Supply Module 1.3V-35V: http://cgi.ebay.in/ws/eBayISAPI.dll?ViewItem&item=...
  4. 1m 60LEDs/M Addressable RGB LED Strip (WS2812B): http://www.aliexpress.com/item/1M-WS2812-WS2812B-6...
  5. HC-05 Bluetooth module: http://www.aliexpress.com/item/RS232-TTL-LC-05-Wir...
  6. IR Proximity Sensor: http://www.instructables.com/id/Simple-IR-proximit...4 IR LEDs; 1 IR LED detector: http://www.evelta.com/industrial-control/sensors/5...
  7. Touch Pad: http://www.aliexpress.com/item/Touch-Pad-Brick-Sen...
  8. 9V – 2A Adapter
  9. CP2102 USB-to-TTL (the RST pin on the CP2102 is not for resetting the arduino – you have to solder a wire to the DTR pad on the PCB – which sends a reset signal to program the arduino. This has to be connected to the DTR pin on the Arduino
<p>Just realised, the set_time doesn't function correctly, please replace with the following:</p><p>void set_time(){</p><p> DateTime now = rtc.now();</p><p> Serial.println(&quot;IN SETTIME&quot;);</p><p> uint8_t hr = (uint8_t)atoi(sCmd.next());</p><p> uint8_t minu = (uint8_t)atoi(sCmd.next());</p><p> uint8_t sec = (uint8_t)atoi(sCmd.next());</p><p> rtc.adjust(DateTime(now.year(),now.month(),now.day(),hr,minu,sec));</p><p>}</p><p>Format for setting time TIME h m s</p><p>e.g. TIME 10 12 00</p>
<p>i changed a code but it doesnt make the Leds ON.I wanna make only a clock Led without others function like bluetooth.Only with Leds and this code it doesnt work.May be you know the solution</p>
<p>Try the new code at the github - I have removed the functions for the button and the IR Sensor.</p>
<p>I tried the new code and could not get anything to work. Here is a picture of the libraries I have imported. Please help me understand what I am doing wrong</p>
<p>You need FastLED 3.1</p>
<p>I have uploaded the &quot;new code&quot; and cannot get anything to work. The only thing that happens is the first light on the LED strip turns on. Nothing else happens. Please help!!</p>
Should have mentioned - the new code is updated for fastled v3.1 - please download that. Also, try to compile with arduino ide 1.0.6 Did you check the data pin in the new code ?
<p>Hi, I did download the new library FastLed 3.1.</p><p>I checked all of my connections and believe they are all in the correct positions. I have one light that turns on, the first light. It is changing colors every few minutes. I have the LED strip connected to LM2596, Ground to common, Data to D5.</p><p>Touch Sensor to D2</p><p>RTC Module - DAT to A4 and CLK to A5.</p><p>No bluetooth or IR Sensor.</p><p>Do not know how to change a data pin in the programming.</p>
<p>I also connected LM2596 to a 9V battery pack.</p>
<p>I think this might be the problem - a 9V battery may not be able to provide enough current. This clock needs 2-3A at the minimum.</p>
<p>Hi! So I have tried a new ordeal. I connected a 9V battery pack with a 5V 1000 MA converter. Is this still not enough power?</p>
what would you suggest to power these LEDs then?
<p>9V 3A power supply. Be sure to tie together the grounds of both the power supplies.</p>
<p>I checked the data pin and changed the data pin to 8. I now have the first LED is blue, second is white, then third is green. Everything else is off. Not sure what else to do!</p>
I did. still nothing.
<p>Also - did you connect the ground of the Uno and the 2596 together?</p>
<p>You can change the data pin by modifying this line in the code:</p><p>#define DATA_PIN 8</p>
<p>I've had the clock running for nearly nine months and it started getting stuck erratically. The clock would run for a few hours and then stop - the LEDs would get stuck. I tried everything to troubleshoot them - going so far as to replace all the components (except the LED strips one by one). But to no avail. Long story short - I have narrowed down to the following:</p><p>1. The first LED in the code remains ON at full brightness at all times</p><p>2. This caused the first LED to overheat and stop transmitting data</p><p>3. The solution is to change the white colour to (50,50,50)</p><p>It's working now - but will update if there are any issues.</p>
<p>Why would this happen ?</p>
<p>Dushyantahuja: I keep getting this error &quot;error: 'BLEND' was not declared in this scope&quot; Making blend &quot;NOBLEND&quot; makes the code do very strange things. Please advise.</p>
<p>chriskinda: Not sure if your still having problems however I was able to fix this by changing BLEND to LINEARBLEND. Hope this helps</p>
<p>Are you using the code from Github? Was your only modification &quot;LINEARBLEND&quot;?</p>
<p>error: 'BLEND' was not declared in this scope</p>
<p>chriskinda: Not sure if your still having problems however I was able to fix this by changing BLEND to LINEARBLEND. Hope this helps</p>
<p>I keep getting this error and I have all the libraries installed. Please advise.</p>
what should I change in the code if I use a 30led per metre led strip . please help<br>
<p>anybody intrested in code let me know</p>
<p>upgraded mine this festive season here is the result. omitted ir sensor.</p><p>https://www.youtube.com/watch?v=WAE0rmlefag</p>
<p>Hey - this is really cool! I'm trying to make it, but I'm running into trouble with the electronics. I've got the basic setup (no switch or prox sensor) and when I program my pro-mini, I get the rainbow effect twice, but then the LEDs go dark and stay dark. I figured maybe the time needs to be programmed, but I can't seem to send commands over serial/ usb. The serial monitor says rainbow every now and then, but no LEDs light up.</p><p>I also tried connecting over bluetooth, but my bluetooth module disconnects from my computer... still trying to figure out what's wrong there.</p>
<p>Are you using the new code from the Github with the latest FastLED 3.1 library?</p>
<p>I am! I still have the problem where I get the cool rainbow effect on the led strip, but then everything goes dark. Any ideas?</p><p>I've gotten the bluetooth working (turns out HC-06 has some slightly different commands - baud rate is set with AT+BAUD7 for 57600, AT+BAUD8 for 115200). I found I also need to use 57600 for the pro mini instead of the 115200.</p>
<p>Great instructable! I found using a mirror and frame from a local bargain shop easier as I then only required a piece of glass to be cut. Of course measurements were then off however I modified the code to use 53 lights instead of 60 (280mm mirror and who's counting anyway?). Just a note, you mention buying a rtc1302 in your list of items however you've used a rtc1307 in your code. This might cause a little confusion as the libs are different for those units as is the code.</p>
<p>the RTCLib library works seemlessly with both. So there is no change required. </p>
<p>hmm strange. oh well, I guess the errors I was recieving from RTClib were user error.</p>
<p>Good afternoon. made by your program mirror, it's amazing !!!</p><p>But I want to know where &quot;SWITCHPIN 2&quot; in the program, he announced only at the beginning, where there is no longer found. You cut the program?</p>
<p>This was being used for the touch sensor. I have since removed the touch sensor and hence it is no longer in the code</p>
<p>hi i'm having problems as i'm only getting one blue light turning on. im using a arduino uno ,i have check the circuit and that seems to be ok .has anyone got any ideas how to fix this problem </p>
<p>hi I'm having problems with the code as its saying that the code has a fatal error: RTClib.h: No such file or directory compilation terminated.</p><p>Error compiling.</p>
<p>You need to install the following libraries:</p><ul> <br><li>RTCLib Arduino Library: <a href="https://github.com/adafruit/RTClib" rel="nofollow">https://github.com/adafruit/RTClib</a><li>FastLED Arduino Library v2.1: <a href="http://fastled.io/" rel="nofollow">http://fastled.io/</a><a href="https://github.com/FastLED/FastLED/releases/tag/archive%2FFastLED2.1" rel="nofollow">https://github.com/FastLED/FastLED/releases/tag/ar...</a> (have linked to the v2.1 of the library as I'm not sure if any code changes are required to support v3.0)<li>SerialCommand Arduino Library:<a href="https://github.com/scogswell/ArduinoSerialCommand" rel="nofollow">https://github.com/scogswell/ArduinoSerialCommand...</a><li>TimerOne Arduino Library: <a href="https://code.google.com/p/arduino-timerone/" rel="nofollow">https://code.google.com/p/arduino-timerone/</a></ul>
<p>I am trying to make the clock without the IR Sensor. I know to do this I must remove part of the code, but which part should I remove? Could you upload the code without IR Sensor incorporated?</p><p>Thank You</p>
<p>Look at the latest code at Github</p>
<p>The code work but the LED off.May be you know the problem</p>
<p>with other codes LEDs works normal(so it doesnt problem with LEDs)</p>
<p>Did you check the version of FastLED? Have you connected the correct pin to the data line (5) ? Is your RTC working fine?</p>
I'm having a problem with the rtc. I bought a ds1302. but the schematics show a DS1307. help?<br><br>Also, the arduino uno offers ports for SDA and SCL. Do I still plug into A4 and A5?
<p>DS1302 and 1307 - both should work. The SDA and SCL are actually A4 and A5 - so you can connect to any one</p>
<p>I finally got that working! But now I am having a few problems with the Diagram. What are JP1 and IC1? Can you add an image of what your final circuit looked like?</p>
<p>hi i was wondering what the jp1 was in the drawing of the schematics? also im using a Arduino uno and was wondering if i am able to leave out the circuits at pb6-pb7 and pc6 as they are only needed for a stand alone arduino? </p>
<p>The JP1, circuits at PB6, PB7 and PC6 are required only for the standalone - they are not required if you're using an Uno</p>

About This Instructable

118,142views

1,092favorites

More by dushyantahuja:Programming the Electrodragon IoT Relay Wifi Calendar The Ultimate Child Tracker 
Add instructable to: