Simple 60 LED Ring Clock, Tinkercad Design, 3D Printed, WiFi NTP Connected, Tasmota Firmware
by NeilP43 in Circuits > Clocks
3382 Views, 24 Favorites, 0 Comments
Simple 60 LED Ring Clock, Tinkercad Design, 3D Printed, WiFi NTP Connected, Tasmota Firmware
Welcome to this Instructable for a very simple, 3D printed LED clock designed with Tinkercad and using just two other components - a pre-made 60x LED ring with programmable WS2812 RGB LEDs, and a low cost WiFi connected NodeMCU ESP8266 based microcontroller board.
This instructable walks you through the Tinkercad design process including the new Codeblocks feature to easily design the clock face with very accurate second/minute markers. The clock face is 3D printed and there's minimal soldering required to put it together.
Why Wifi connected? It connects to the internet with Network Time Protocol (NTP), always shows the correct time, and updates automatically when the clocks change in spring and autumn/fall. The Open Source Tasmota firmware is loaded onto the microcontroller is configured easilly to clock mode. The RGB LEDs can be programmed to any colour, and the sizes of the second/minute/hour markers can be adjusted. You can also use the WiFi control to change the brightness or turn it on and off with Alexa or other home assistant, no coding required.
Read on to find out how to build your own below.
Supplies
Parts List:
- 3D Printed clock face
- See .stl file attached - printed at a fast 0.3mm layer height with 10% infill
- 60 LED PCB ring - around £10 / USD$15
- includes WS2812 LEDs - these are easy to find on eBay, delivered as 4x quarter rings you solder together
- Microcontroller - around £5 / USD$7.50
- NodeMCU V3 ESP8266 ESP-12E CH340 Lua IOT Wireless Wifi Module
- Note - other ESP8266 microcontrollers could be used with Tasmota if you prefer.
- Micro USB cable for power and programming
- Short wires to connect MCU to LED ring
Downloads
Tinkercad Codeblocks Design for Second and Hour Markers
Video: Fast forward to the Codeblocks chapter: https://youtu.be/mRnswHJogKI?t=74
Tinkercad Codeblocks is used to create the second and hour hand markers which are perfectly shaped wedges laid in a ring. See screenshots and link to codeblocks code for details. Explore the Tinkercad Codeblocks code for yourself:
In summary the steps are:
- Create a new object SecondMarker wedge from a central cube, two 'hole' cubes each rotated 3 degrees and subtracted from the original cube
- Create a new object HourMarker in the same way but taller
- Use 'Count With' loops to copy and rotate the markers into a ring
- note - it wasn't possible to generate all 60 seconds as this exceeded the 200 primitive limit in codeblocks (note to Tinkercad developers, please increase this limit!)
- Export as STL to use in step 2.
Optional:
- Use Codeblocks to create a model of the LED ring itself to model how it all fits together.
- https://www.tinkercad.com/codeblocks/fM6AM2CTPCm
Downloads
Tinkercad Clockface Design
Tinkercad makes it easy to design the clock face, see video walk through https://youtu.be/mRnswHJogKI?t=200 and highlights below:
- Clock face is a simple cylinder
- Second & Hour marker STL file is imported
- A duplicate is made with Ctrl+D and rotated 180 degrees to give 60 seconds
- Second and Hour Markers are switched to hole, raised up by 0.2mm and then grouped with the clockface to create the cutouts. 0.2mm is the thickness of 1 layer on the 3D printer.
- A further ring is added to space the clock away from the wall and allow the light to shine onto the wall behind
- Wall mount is added to top so it can hang on a screw or nail
- Mounting points are added for the MCU aligning with the curcuit boards mounting holes
- Cutouts are added for power cable and LED signal wires
Double check the placement of the LED ring to ensure the LEDs line up and there is space for wiring etc.
Once the design is complete, export the STL for 3D printing.
Downloads
3D Print
Load the STL from the previous step into your favourite slicer - see video https://youtu.be/mRnswHJogKI?t=723
I've used basic settings:
- White PLA to ensure the light can pass through
- Fast, 0.3mm layer height
- A single layer thick for the semi-transparent Second and Hour markers
- 10% infill
You can use more advanced settings that may give a better result, for example concentric pattern on layer 1 will produce a circular fill instead of diagonal lines.
Downloads
Solder the LED Ring, MCU and Put It All Together
There's minimal soldering required on this design. You might start the prototyping with connecting wires that plug straight into the pins of the MCU while programming and setting up.
To reduce the size on the final clock, I cutoff the pins and soldered the wires directly to the MCU pads.
Connections:
- Solder the 4 parts of the LED ring to form a full circle.
- I placed these on a level surface and used blutak or tape to hold the pieces in place while soldering. To connect the ring pieces I used a single core wire, you can also use header pins.
- 5v to 5v all the way around
- GND to GND all the way around
- DIN to DOUT for three of the four connections (leave the final DIN for data from the MCU
- Solder wires from the MCU to the LED ring
- D5 data pin from MCU to DIN (Data In) on LED ring
- GND to GND
- 5V to 5V
Hold off on gluing it all together until the firmware is downloaded and running.
Download the Firmware to NodeMCU and Configure
Tasmota Firmware Intro
I found a really great piece of software called Tasmota which is commonly used to flash Sonoff smart switches, but can also be configured for other uses including this LED clock application. It's free and GNU open source license, easy to download and configure. The WiFi connection allows easy configuration, automatic time setting, automatic clock change in spring and autumn/fall, and easy dimming.
Loading the firmware and configuring literally takes just a few minutes - see the video! https://youtu.be/mRnswHJogKI?t=871
Find out more about Tasmota on Github: https://tasmota.github.io/docs/
Download the Tasmota Firmware with Web Installer
To download the firmware, connect a USB cable and try the online download tool:
You will likely need to hold the 'flash' button while plugging in the USB cable and pressing connect on the web interface to put it into programming mode. If it doesn't work first time, try again, holding the flash button, and possibly try another USB port.
- Note - be sure to use the "Tasmota (english)" default if you want English.
- Alternative downloader - try Tasmotizer tool: GitHub - tasmota/tasmotizer: ESP... The time has come to... Tasmotize!
Assuming the download went to plan it will guide you through WiFi setup, and then connect to the configuration panel.
Configure the interfaces
The key settings you'll need: (see screenshots)
- Configuration tab: (see screenshots)
- Configure Module:
- Module type => Generic (18) -- This lets us use an pins on the ESP8266
- The hit save, configure module again:
- D5 GPIO14 => WS2812 -- This is the smart LED output for the LED ring
- D0 GPIO16 => Led_i -- This is an inverted (active low) onboard status LED
- Configure Wifi:
- Add a second WiFi network if needed based on where the clock will be placed
- Configure Other:
- Device Name: 'LED CLOCK' -- choose any name you like!
- Emulation:
- Belkin Wemo -- This allows smart home devices, e.g. Alexa, to see it as a switch to turn on and off with audio commands.
- Console:
When you click the console button it will show status information like this:
00:00:00.001 HDW: ESP8266EX
00:00:00.050 CFG: Loaded from flash at F6, Count 46
00:00:00.055 QPC: Count 1
00:00:00.079 Project tasmota - LED CLOCK Version 12.4.0(tasmota)-2_7_4_9(2023-02-18T16:07:38)
00:00:00.523 WIF: Connecting to AP1 nn4 Channel 11 BSSId 40:0D:10:AD:66:09 in mode 11n as tasmota-0B7F8E-8078...
00:00:01.757 WIF: Connected
00:00:02.014 HTP: Web server active on tasmota-0B7F8E-8078 with IP address 192.168.0.133
00:00:02.016 UPP: Multicast (re)joined
22:13:03.011 RSL: INFO1 = {"Info1":{"Module":"Generic","Version":"12.4.0(tasmota)","FallbackTopic":"cmnd/DVES_0B7F8E_fb/","GroupTopic":"cmnd/tasmotas/"}}
22:13:03.016 RSL: INFO2 = {"Info2":{"WebServerMode":"Admin","Hostname":"tasmota-0B7F8E-8078","IPAddress":"192.168.0.133"}}
22:13:03.026 RSL: INFO3 = {"Info3":{"RestartReason":"External System","BootCount":10}}
22:13:03.033 RSL: RESULT = {"POWER":"ON"}
22:13:03.037 RSL: POWER = ON
22:13:06.455 QPC: Reset
22:13:07.420 RSL: STATE = {"Time":"2023-02-19T22:13:07","Uptime":"0T00:00:09","UptimeSec":9,"Heap":26,"SleepMode":"Dynamic","Sleep":10,"LoadAvg":62,"MqttCount":0,"POWER":"ON","Dimmer":62,"Color":"8C9E3E","HSBColor":"71,61,62","Channel":[55,62,24],"Scheme":5,"Width":1,"Fade":"ON","Speed":1,"LedTable":"ON","Wifi":{"AP":1,"SSId":"nn4","BSSId":"40:0D:10:AD:66:09","Channel":11,"Mode":"11n","RSSI":92,"Signal":-54,"LinkCount":1,"Downtime":"0T00:00:03"}}
22:14:23.106 UPP: Multicast (re)joined
This console is where we setup the LED clock settings. Make a note of the IP address - with this you can connect to the web control interface from any device (phone, laptop etc) on your network.
Copy and paste these commands directly into the console window one by one. Scheme 5 is the LED clock mode, and pixels 60 tells it how many LEDs. Find out more about light commands here:
status 7
pixels 60
scheme 5
fade on
ledstate 6
Set width of seconds (1), minutes (3), hours (3)
width2 1
width3 3
width4 3
set color of seconds (white), minutes (green), hours (blue) using 6 digit #HEX RGB
color3 #ffffff
color4 #00ff00
color5 #0000ff
Set the spring forward DST (Daylight Savings Time) and fall back STD (Standard Time) swtichover dates. The settings below are for the UK. Find out more about timezone setting at the bottom of this section:
Timezone 99
TimeDST 0, 0, 3, 1, 1, 60
TimeSTD 0, 0, 10, 1, 1, 0
Hit restart and the LED ring should now be working as a clock! If it's not working, check through the steps above, the connection is secure and that the LED strip is powered by VIN (5v!) and NOT 3V3 (these are 5V LEDs!).
Finishing Touches & Enjoy Your New Clock!
Once it's all working you can use hot glue to hold the LED ring and NodeMCU in place - https://youtu.be/mRnswHJogKI?t=1481
Note - you can revisit the web configuration page to change brightness, colours etc whenever you like.
Enjoy your new custom LED clock!
Let me know if you have any comments or questions, or if you build your own!