This project has been in the works for about 2 years. I've worked on and off, learning as I go. I think I would consider it one of my first real projects, and from the beginning I had a decent idea of what I wanted. I started this project in the summer of 2022, starting with code from this instructable: https://www.instructables.com/Desktop-Ring-Clock/ . Using a microcontroller called an ESP32 and an addressable LED strip, I was able to put this project together.
Andrei Urdei's approach to a light clock.
This design is very neat and unique, but I wanted to do my own take on this. I removed the sections of the code that were for controlling both strips, and combined it to be 1 strip. For my design, I wanted only one LED ring. I also wanted different light modes, so I implemented a simple button function using one of the ESP32 pins as a capacitive button. The sketch that I used implemented a simple time server connection using the WIFI function of the ESP32. Once I had that working, I had much more ambitious plans for my program: I wanted to implement a web interface to control settings on the clock, and if the clock wasn't able to establish a connection, set the time from your device. Between the beginning of this project and this ambitious plan, I took a C++ class in college and my programming became much cleaner and more efficient. That class allowed me to implement all those features I wanted easily. Before I go over the code, I would like to cover the case design, which some aspect of I am very proud of.
I designed the case ring in OnShape, which I got comfortable with in a highschool engineering class. I wanted the design to hold the led strip, and using the plastic slope, diffuse the light and reflect it forward. The parametric nature of OnShape helped a lot, as I made frequent adjustments as I tested different slopes and tolerances. My original design for this ring was a lot slimmer, but I needed more space for the integrated controller board holder (my favorite part of this design!)
This feature is one of the coolest parts of this project. I was able to find a 3D model of my particular ESP32, the Wemos D1 Mini. Using this 3D model and some of my own measurements, I made a cutout for the board. After making this cutout, I realized that the reset button would be blocked by this placement. I decided to make a slot that holds one side in and the other side can clip in. Behind the board, I designed a small button that slots in and can be pressed from outside of the clock.
In it current state, the programming allows the ESP32 to both connect to the local WIFI, and host a server page on that network. This allows the clock to update its time every second to prevent getting out of sync. On start-up, the clock displays the last 3 digits of its IP address so you can connect to the settings page. The values set in the settings page are saved to the flash inside, so after a restart settings are maintained. The page can read and show the current values being used.
The web interface is very simple and not super usable. It's more of a proof-of-concept, and I would love to learn how to make a web interface beautiful and functional. My case design wasn't quite the right size, so the LED strip didn't fit quite right. I hope to improve this in future revisions. My current prototype is also missing a level shifter, so there are sometimes lighting errors. I can fix this with a diode and use the first LED as a level shifter, or simple design a PCB to hold the controller with a level shifter.
I would like to add more customizable settings to the page, such as time zone selection, night dimming toggle and on/off times, more clock faces, clock hand color selection, toggle for the seconds hand, a deep-sleep mode where the ESP32 goes to sleep and only turns on each minute to update the LEDs, and RGBW (Red, Green, Blue, and White) LED support.
My next plans for this project are an infinity mirror ring! Using RGBW LEDs will allow the minute ticks to be seen even when the hands are over them by mixing the color with the white. I look forward to seeing this effect, and it might make the clock more readable.
I had some spare time, so I designed a quick PCB (printed circuit board) to test the viability of this idea:
This PCB uses some cool side-facing RGBW LEDs and integrates an ESP32-S3. This design isn't super practical, and an oversight in the design has some of the vias in pads, which usually calls for a very expensive process that I don't know enough about to avoid, where they fill the vias. With some rerouting and splitting the ring into 4+ pieces, it may be a more viable idea. One thing that is missing from this design is a level-shifter to convert the 3.3V from the ESP32 into 5V for the LEDs. Not having this can cause issues in the LEDs not picking up their data properly. When I improve this PCB for manufacturing I will make sure to add this for perfect stability.
After some rearranging and splitting the board into 4 quarters, here are the final designs:
This design is currently set up where you order 1 control board and 3 of the LED-only boards and solder them together at the end to end to form a circle. I designed is this way to save on manufacturing costs. I'm still new to PCB cost management, so I'm not sure exactly how to improve the efficiency of my design. Using extra-small parts like 0201 SMD parts seems to make it harder to find parts in stock for the place I usually look to get quotes from, JLCPCB.
The controller board - has an integrated ESP32-S3, and is powered by the USB-C port
The LED only board - These connect to the controller board to complete the ring, or can be used separately to make a disconnected LED ring.
If I ever come back to this design, I would like to make a few changes. First, I would find a more intuitive LED arrangement to allow for a simpler time programming, and wire the LEDs on the control board so that all are connected (in the design above, only the LEDs to the right of the ESP32 are controlled, the rest would be controlled by the counter-clockwise LEDs going around through the LED-only boards) This would allow testing of all the LEDs separately. I would also change the microcontroller to the ESP32-C3, which is much smaller and cheaper. The main reason I went with the ESP32-S3 is because I expected that my code for the clock would require the dual-core function of the more expensive chip, but it turned out that I did not need this. Saving money and space on the board would greatly improve the cost effectiveness, and I could make space for 0603 parts to save assembly costs.