Introduction: Easy - Infinity Mirror Clock
I've had a love-love relation with clocks and LEDs. Over the years, I've made quite a few clocks, but keep coming back to the Infinity Mirror Clock that I first made a few years back. However, with each iteration, the results have become better and easier to use. This latest iteration has the following features:
- The electronics are really simple now:
- One ESP8266 module (Wemos D1 Mini)
- WS2812B LED Strip with 60 LEDs - you can use different densities, and those would impact the overall size of the clock
- Open Source - source code available on GitHub and can be modified as required
- Over-the-air updates
- Has a web interface to change colors, time zones (if wanted) and other settings
- Has a night mode - to either dim the lights or switch them off completely
- Uses WiFi to get your time zone and time - so your clock is always synced and shows the correct time
- Easy to set up the wifi
- Uses off-the-shelf photo frames to get a great finish
- The inner portion can be made using 3D printing, laser cutting, or at a stretch even using a simple saw - since this portion is hidden, it doesn't need to be very finished
Supplies
Electronic Hardware:
As mentioned previously, the electronic portion of this clock is very simple:
- Wemos D1 Mini (or other ESP8266 module): https://www.aliexpress.com/wholesale?SearchText=w...
- WS2812B LEDs: https://www.aliexpress.com/wholesale?SearchText=W...
- USB Cable: https://www.aliexpress.com/wholesale?SearchText=U...
- USB Charger (2Amp): https://www.aliexpress.com/wholesale?SearchText=U...
Options for internal structure include
- 3D Printing (STL and editable model available)
- Laser-cut MDF (SVG files included)
- Plywood / MDF / Cardboard - the inner circle needs to be cut with some accuracy - so you need some way to do that
- Convex Mirror (optional, but recommended)
The frame:
- I'm partial to Ikea frames - but you can use any that are available in the size you decide
- One-way mirror film https://www.aliexpress.com/wholesale?catId=0&Sear... - you can also buy this from auto accessories vendors or window manufacturers
- Mirror / Mirror Tile so that it fits in the chosen frame
Step 1: What Is an Infinity Mirror
An infinity mirror is a set of parallel reflecting surfaces (one reflecting partially) with lights inside. The two mirrors create an effect where the lights vanish off to infinity due to multiple internal reflections.
The effect is made more interesting (at least I think so) by adding a convex mirror in the center.
More details at https://en.wikipedia.org/wiki/Infinity_mirror
Step 2: Choosing the Frame Size
As mentioned in the introduction, the size of the clock is dependant on the LED strip that you buy - and you need to find a frame based on that size. You get four kinds of LED strips easily:
- 30 LEDs / m - this would result in an inner size of 650mm x 650mm
- 60 LEDs / m - this would result in an inner size of 320mm x 320mm
- 100 LEDs / m - this would result in an inner size of 200mm x 200mm
- 144 LEDs / m - this would result in an inner size of 135mm x 135mm
The frame you need to choose would have to be larger than the size of the inner circle - for example, for a clock with 60 LEDs / m - I would suggest using a frame of size 500mm x 500mm
Step 3: Programming the ESP8266
I chose the Wemos D1 Mini, as it can be simply programmed using the USB port on the microcontroller. I would suggest using PlatformIO, but you can use the Arduino IDE as well. If you've never done this before, there are a few steps that need to be followed before you can program the ESP8266
PlatformIO
- Download and install Microsoft's free IDE - VSCode: https://code.visualstudio.com/download
- Open VSCode Extension Manager
- Search for official PlatformIO IDE extension
- Install PlatformIO IDE.
- Open PlatformIO home and click on Platforms
- Seach for Espressif 8266 and download the platform
Arduino IDE
- Download and install the Arduino IDE: https://www.arduino.cc/en/Main/Software
- Open the IDE and go to Tools -> Boards -> Boards Manager...
- Search for ESP8266 and click install
The Code
The source code for the project can be downloaded from github (for the latest version): https://github.com/dushyantahuja/SmallInfinityMirr...
Click on "Clone or Download" and then "Download Zip" (see image for reference) and extract it.
You can now open this in PlatformIO or Arduino. PlatformIO will download the required libraries automatically, however you will have to download these manually if you're using the Arduino IDE:
- IPGeolocation
- FastLED
- NTPClient
- Time<
- ArduinoJSON
- ESPAsyncTCP
- ESP Async WebServer@1.2.2 - make sure you download version 1.2.2 - the newer version seems to error out while compiling - and I haven't really looked into it
- ESPAsyncWifiManager
IP Geolocation
The clock is designed to locate your time zone using your IP address (geolocation). To use this feature, you need to register at https://ipgeolocation.io/signup.html and create an API Key. Then replace the Xs in Line 21 to the API Key that you have generated
String IPGeoKey = "XXXXXXXXXXXXXXXXX";
In case, you do not want to use geolocation, or if you want to set the clock to a different time zone, you will have to make the following modifications to the code:
Comment out lines 20 and 21
#include <ipgeolocation.h> String IPGeoKey = "XXXXXXXXXXXXXXXXX";
Comment out lines 102 to 105
IPGeolocation IPG(IPGeoKey); IPGeo I; IPG.updateStatus(&I); timeClient.setTimeOffset(I.offset*3600);
Modify line 40 to set your time zone
NTPClient timeClient(ntpUDP, "europe.pool.ntp.org", 0, 360000);
The third parameter (0 in the line above) is the timezone offset in seconds. So if the offset is one hour, put in 3600 instead of zero. Please note, in case there you will need to change this for daylight savings, or if you move to a different timezone.
Uploading the Code
- Make sure you have the correct USB driver (the Wemos D1 mini has a CH340g chipset for the USB interface)
- Attach the Wemos D1 mini using the USB cable
- Open the downloaded project and
- On platform IO: click on Upload and then Upload File System Image
- On Arduino IDE: click on Upload and then Tools -> ESP8266 Sketch Data Upload
Step 4: Electronics
As mentioned previously, the electronic portion of this clock is very simple:
- Wemos D1 Mini (or other ESP8266 module): https://www.aliexpress.com/wholesale?SearchText=w...
- WS2812B LEDs: https://www.aliexpress.com/wholesale?SearchText=W...
- USB Cable: https://www.aliexpress.com/wholesale?SearchText=U...
- USB Charger (2Amp): https://www.aliexpress.com/wholesale?SearchText=U...
You need to connect them as follows:
- Cut the male end of the USB Cable and solder the red wire to the 5V pin
- Solder the black wire to the pin marked G
- Solder the red wire from the WS2812B strip to the 5V pin
- Solder the black wire from the WS2812B strip to the G pin
- Solder the Green wire (Data In) from the WS2812B strip to the pin marked D2
Check that the code runs by powering on the Wemos D1 Mini - in a couple of seconds the LED strip should show a dim rainbow, and the module should create a Wifi Hotspot called "SmallInfinityMirror" - more on that later
Step 5: Internal Structure
Structure for LEDs
The internal structure provides a perfect circle for the LED strips - it is sized so that 60 LEDs fit in a complete circle - one for each minute in the hour. You can create the internal structure using a variety of methods:
- 3D Printing
- See attached STL for a 200mm x 200mm Frame, and 144 LEDs per m. You can edit the model as it is available on OnShape: https://cad.onshape.com/documents/285a54a423c2c37...
- There's another STL for a 200mm x 300mm Frame (with a larger border) for 100 LEDs per m. You can edit the model on OnShape: https://cad.onshape.com/documents/1770328a4013b96...
- I've also attached one STL for a 230mm x 230mm Frame, and 144 LEDs per m. You can edit the model as it is available on OnShape: https://cad.onshape.com/documents/05e09c03eebbaed...
- Laser Cutting
- See attached SVGs for 200mm x 200mm Frames using 100 LEDs per m. You need to cut the pieces using 6mm MDF or Ply and then glue them together
- Plywood / MDF - You can manually cut a piece of >12mm Plywood / MDF so that the outside dimensions fit the chosen frame, and the inside circle based on the LED strip chosen:
- 144 LEDs per m: 134.5mm diameter
- 100 LEDs per m: 192mm diameter
- 60 LEDs per m: 318.5mm diameter
- 30 LEDs per m: 637mm diameter
- This circle needs to be accurate so that the LED strip fills the whole circle and there are no gaps or overlaps.
- You need some space for the wires and the microcontroller - so those will also need to be cut - see attached photo with dimensions for a 60 LEDs per m strip and a 600mm x 600mm frame for the basic structure - this can be resized to match what the equipment you have on hand
Fixing the LEDs
With the internal structure facing towards you, start sticking the LED strip from the top going towards the right. This is very important because if you stick them the wrong way around, the clock will work backwards and the code will have to be modified to make the clock work correctly. I have done this, so let me know if you get it wrong and I can provide links to the modified code.
- Put a small piece of electrician's tape on the contacts at the top to ensure the LED strip doesn't short with itself when you stick the whole thing.
- You can use a thin double-sided tape to ensure the LEDs stick well.
- Place the Wemos D1 Mini in the small are made for this.
Cardstock/Mountboard
In addition to the above, you need to cut a piece of cardstock/mountboard with the following dimensions:
- Outside dimensions to fit inside the chosen frame
- A circle in the center to match the inside diameter of the structure above - you can use the actual structure to mark the circle and then cut it. Alternatively, you can use a laser cutter, or 3D printer to generate this layer
Step 6: Assembling the Clock
Depending on what you have used to create the frame, the actual process would be slightly different for each of you, but the gist of the process is as follows:
- Open the frame, and take out the front glass. Stick the One-Way mirror film to the inside of the glass
- Place the glass back in the frame
- Place the piece of cardstock/mountboard behind the glass
- Stick the convex mirror to the flat mirror
- Stick the mirror to the Internal Structure
- Place the Internal Structure created in the previous step behind the cardstock/mountboard
- Cut a small hole in the back of the frame for the wires and close the frame
One-Way mirror film
This part requires a lot of patience as any defects while applying this would be visible in the final product. I would suggest you view a couple of videos on youtube before you apply the film for the first time. One I liked was
Use a lot of soapy water, so that the film floats on the water before you press it down.
You can use acrylic/glass one-way mirrors as well - these are more expensive than the film, but provide a better result in the end.
Step 7: Set-Up
Setting up the WiFi
As the clock uses the internet to get the timezone and the time, you need to setup the microcontroller so that it can connect to your wifi router. When you switch on the microcontroller for the first time, it switches on all the LEDs to a dim rainbow and sets up a WiFi access point called SmallInfinityMirror.
- Use your phone or laptop to connect to this access point
- In most cases, the device should automatically open a registration page, if not go to 192.168.4.1 in your browser
- Click on Configure WiFi
- Choose your home WiFi and enter the password
Once you save, the clock should restart and connect to your WiFi.
Clock Settings
This is an optional piece and requires you to connect to the device via the router. You need to find the IP address of the device from your router. I will leave that to you, as each router has a different interface.
Once you find the IP address, put that in your web browser, and you should see the home page. The clock configuration page allows you to change the following settings:
- Daytime Brightness
- Nighttime Brightness
- Time to Switch on
- Time to Switch off
- Effects Every n minutes
The Choose Colors page allows you to change the colors of the various clock features.
The Load New Firmware page allows you to upload new firmware and web pages.
Step 8: Final Result
I've made multiple versions in the last few months - see attached photos. Hang the clock somewhere prominent and connect it to the 5V adapter.
The clock has been designed to show the hour hand using one color, and a running pattern that increases as the minutes go by. See attached photos.
Step 9: Acknowledgements
I could not have completed this project without all the works by other authors, most notable among them being:
- Daniel Garcia & Mark Kriegsman who developed FastLED; without this library, the clock is simply impossible to build
- Jason Coon for his ESP8266 FastLED Webserver code
- Andreas Spiess for his fantastic Youtube channel and explaining how to build a webserver on the ESP8266
- Alan Steremberg for the amazing ESP Async set of libraries
And many more, for the amazing work they've done with the platform.

Participated in the
Make it Glow Contest
20 Comments
Question 1 year ago
Hello there and greetings from the US!
awsome project whichi just found on instructables.
I am trying to open the project file in Visual Studio, but frankly do not know which file has to be opened. Can you please send me a hint. thank you so much \
Question 2 years ago
hello. very nice looking project. i am willing to try it myself.
the link for the board you provide is giving me an "not found" error, i wonder if this one would work
https://www.aliexpress.com/item/1005001436547177.h...
rgb strips, 3m with 60 leds/m, which radius should i be using? or would it look good as a square?
https://www.aliexpress.com/item/4000791144003.html...
if price isn't much different ordering through amazon, i might take it from amazon as its fewer days waiting for it (aliexpress orders takes about 3 weeks to arrive my place, sometimes more, and 2 occasions they got lost, so i prefer a more local shop).
Thanks in advance for any help.
Answer 2 years ago
I would suggest you use the Wemos D1 Mini, and not the Wemos D1 Uno - you can buy these from Amazon, or Aliexpress (whatever you prefer).
For 60 LEDs/m - you will need to have a diameter of 318.5mm - see step 5 above. You would just need 1m. Not sure how it would look as a square - but you can try it out, and let us know.
3 years ago on Step 9
Hi, awesome tutorial, but I am running into issues with the code. This is my first attempt at a project like this, so I am very confused! I keep getting errors like this when I build:
.pio\libdeps\d1_mini\ESP Async WebServer_ID306\src\WebHandlers.cpp: In member function 'AsyncStaticWebHandler& AsyncStaticWebHandler::setLastModified(tm*)':
.pio\libdeps\d1_mini\ESP Async WebServer_ID306\src\WebHandlers.cpp:67:64:
error: 'strftime' was not declared in this scope
strftime (result,30,"%a, %d %b %Y %H:%M:%S %Z", last_modified);
There is the same message for "gmtime" and "time" (ie, not declared in scope).
Any help here would be amazing, as I am very keen to get this project off the ground :)
Thanks again!
Reply 3 years ago
I have the same problem, couldn't figure out how to resolve it. Shame because I also like this instructable.
Reply 2 years ago
Can you please try the updated code on Github - I think the library versions that you're using may be incompatible.
https://github.com/dushyantahuja/SmallInfinityMirror
Reply 2 years ago
Can you please try the updated code on Github - I think the library versions that you're using may be incompatible.
https://github.com/dushyantahuja/SmallInfinityMirror
3 years ago
Very nice, but no pics or description of the placement of the convex mirror?? Beyond, "stick it in the middle" I mean. What kind of adhesive did you use? What size convex mirror? Where can we get one? I can easily imagine this going from and excellent project to looking awful if the convex mirror was off center - or worse, if whatever it was 'stuck' with degraded and it slowly slid down. Some more detail here would be nice.
Reply 2 years ago
I used a blind spot mirror used for cars - https://www.amazon.co.uk/gp/product/B0777FXZY2/ref...
No specific glue, just used the 3M tape that came with it.
Question 3 years ago
Hi, very nice project indeed and I'm wishing to replicate it but am having problems with the code. I usually use the Arduino IDE but decided to give VS a go, I cannot find the code to comment out the IPGeolocation. Hoping you can help.
Regards Geoff
Answer 2 years ago
Apologies - haven't been on instructables for a long time. If you see the latest code on github, I have commented out IPGeolocation. You just need to setup the timezone on line 46
https://github.com/dushyantahuja/SmallInfinityMirror/blob/rc4-autoupdate/src/main.cpp
3 years ago
Very cool looking clock buddy. Do you feel the frame is too big for the clock diameter.
Reply 3 years ago
The size of the frame is entirely up to you. I liked the larger one, as it makes a statement.
3 years ago
Hi, really love the look of this clock. Unfortunately I keep getting "strftime was not declared in this scope", gmtime was not declared in this scope" and "time was not declared in this scope". I had a look online, apparently there's some problem with the Time_ID44 lib and case sensitivity. How did you get around this problem? I'm a total newbie to coding so any help would be greatly appreciated.
Reply 3 years ago
Sorry - didn't see this earlier. I did not get any problems compiling the code. Have you installed PlatformIO correctly? Maybe try to delete the Time library and reinstall.
Reply 3 years ago
Thanks, I'll give that a go this week.
3 years ago
Very well made! I definitively like your detailed description including lots of pictures and the useful hints. Using NTP and a web-interface for settings is way better than something which needs physical interaction (like buttons for example). Web-IF looks almost like Tasmota GUI (even setup & initial IP is the same) so I guess it would be possible to add full Tasmota functionalities to the code/clock. This way it would be possible to integrate it into Home-Automation platforms like OpenHab. Maybe in a future version if you continue building clocks ;)
However, its one of the most beautiful clocks I've had seen so far. Thx for sharing!
Reply 3 years ago
Thanks a lot. I did have a version that used MQTT; but for most people, that's not feasible, as you need to have a separate MQTT server.
3 years ago
This came out so cool!
Reply 3 years ago
Thanks :-)