ATOM-Clock
Clock build with a M5-ATOM "lite" or "Matrix" and two concentric LED-Rings . Time is synced with an Internet-NTP-Server
This clock shows the time on two concentric LED rings of 60 +24 NeoPixel LEDs. The inner ring shows the hours, the outer ring shows minutes and seconds. It is controlled by an ESP32 which synchronizes the time online with an NTP server. The design is very interesting because the company M5 recently offers two ESP32Pico modules (ATOM-lite and ATOM-Matrix) with extremely small dimensions (24mm*24mm*10mm and 14mm). The small size of the ATOM modules allows extremely small setups, but still allows an easy setup by using the Grove port or the two female connectors on the bottom side.
The selected module is supplied by a small switching converter with 12-24V >> 4V8. This makes it possible to work with very thin lead wires before converting to the required module voltage of max 4.8V. At the higher supply voltages of 12 to 24V, the input currents of the circuit are proportionally lower.
ATTENTION: The 4.8V module voltage results because the data signals of the neopixels must have at least 70% of the supply voltage of the pixels. Otherwise errors will occur during data transmission. The ESP32 works with 3V3 in the module. Therefore 3.3V/7*10=4.71V .
The pin headers for holding and connecting the ATOM module are glued to the switching controller board
The module is located in the middle of the two rings. The LED rings are supplied with voltage and data signals via the radial wires. The data lines and the long external power supply line are made of VERO thread wire, which is hardly visible but still very stable.
The programming is based on a micropython script. It first registers the module in the WLAN, then synchronizes the time with an NTP server and controls in an endless loop the 60+24 neopixel LEDs on the two rings, which are all serially connected in one line to GPIO21. Additionally the only front LED of the ATOM lite or the 5*5 front LEDs of the ATOM matrix are controlled via GPIO27.
With the switch (GPIO39) on the front of the ATOM, you can switch between the CLOCK mode and a demo mode, which lets the clock run extremely fast
Videos:
https://vimeo.com/412331418
https://vimeo.com/412365473
The selected module is supplied by a small switching converter with 12-24V >> 4V8. This makes it possible to work with very thin lead wires before converting to the required module voltage of max 4.8V. At the higher supply voltages of 12 to 24V, the input currents of the circuit are proportionally lower.
ATTENTION: The 4.8V module voltage results because the data signals of the neopixels must have at least 70% of the supply voltage of the pixels. Otherwise errors will occur during data transmission. The ESP32 works with 3V3 in the module. Therefore 3.3V/7*10=4.71V .
The pin headers for holding and connecting the ATOM module are glued to the switching controller board
The module is located in the middle of the two rings. The LED rings are supplied with voltage and data signals via the radial wires. The data lines and the long external power supply line are made of VERO thread wire, which is hardly visible but still very stable.
The programming is based on a micropython script. It first registers the module in the WLAN, then synchronizes the time with an NTP server and controls in an endless loop the 60+24 neopixel LEDs on the two rings, which are all serially connected in one line to GPIO21. Additionally the only front LED of the ATOM lite or the 5*5 front LEDs of the ATOM matrix are controlled via GPIO27.
With the switch (GPIO39) on the front of the ATOM, you can switch between the CLOCK mode and a demo mode, which lets the clock run extremely fast
Videos:
https://vimeo.com/412331418
https://vimeo.com/412365473
import time from machine import Pin from neopixel import NeoPixel #WLAN credentials SSID = 'WLAN1_2.4GHz' PASSWD = 'xyz' #color for second-hand RS=0 GS=20 BS=0 #color for minute-hand RM=60 GM=50 BM=0 #color for hour-hand RH=60 GH=50 BH=0 #color for background RB=0 GB=0 BB=0 #color for markers Rmark=6 Gmark=6 Bmark=6 BUTTON = Pin(39,Pin.IN) #27= internal Neopixel # seta a single Pixel on ATOM # and a smily on ATOM-Matrix pin = Pin(27,Pin.OUT) np = NeoPixel(pin, 25) for i in (0,4,12,15,19,21,22,23): np[i] = (int(RM/2),int(GM/2),int(BM/2)) np.write() #time.sleep(2) #26 = groveport pin3 #pin = Pin(26,Pin.OUT) #21 = ATOM-Rueckseite pin = Pin(21,Pin.OUT) np = NeoPixel(pin, 85) for i in range(0,83): np[i] = (85-i,i-80,1) np.write() import network wlan = network.WLAN(network.STA_IF) wlan.active(True) wlan.connect(SSID, PASSWD) while not wlan.isconnected(): time.sleep(1) print("WLAN-login ...") print('WLAN:', wlan.ifconfig()) from machine import RTC rtc = RTC() t_old = rtc.datetime() #rtc.datetime((2017, 8, 23, 1, 12, 48, 0, 0)) # set a specific date and time import ntptime ntptime.settime() # set the rtc datetime from the remote server def my_show_neo(t): ########################## # correct hh for TZ Berlin, but no DST possible hh = ( t[4]+2 ) % 24 mm = t[5] ss = t[6] print(hh,":",mm,":",ss," BUTTON:",BUTTON.value()) # Clear all NeoPixel for i in range(0,84): np[i] = (RB,GB,BB) # Marker for hours on outer ring for i in range(0,60,5): if (i % 15 == 0): np[i] = (Rmark,Gmark,Bmark) else: np[i] = (int(Rmark/2),int(Gmark/2),int(Bmark/2)) # Marker for hours on inner ring for i in range(60,85,2): if (i % 6 == 0): np[i] = (Rmark,Gmark,Bmark) else: np[i] = (int(Rmark/2),int(Gmark/2),int(Bmark/2)) # set actual hour-LED on inner ring (in three steps depending on minutes) if mm > 40: hhh = 2 elif mm > 20: hhh = 1 else: hhh = 0 np[((hh % 12) *2) + 60 + hhh] = (RH,GH,BH) # set actual minute on outer ring np[mm] = (RH,GH,BH) # set second on outer ring np[ss] = (RS,GS,BS) # Now show the new pixel pattern np.write() return ################################################# print('Current date and timne: ',rtc.datetime()) # get the date and time in UTC # MAIN_LOOP TOGGLED_by_BUTTON = 1 xs=0 xm=10 xh=8 while True: if not BUTTON.value(): TOGGLED_by_BUTTON = 1-TOGGLED_by_BUTTON time.sleep(2) if TOGGLED_by_BUTTON: # --------------------- normalCLOCK-MODUS------------ t = rtc.datetime() if t[6] == t_old[6]: time.sleep(0.1) else: my_show_neo(t) t_old = t else: # ---- DEMO-MODUS with fast running minutes and hours xs += 60 if (xs >59): xs = 0 xm += 1 if (xm >59): xm = 0 xh +=1 if (xh >24): xh =0 t = (0,0,0,0,xh,xm,xs) my_show_neo(t) print ("DEMO:",t) #END ###########################################################
Discussion (0 commentaire(s))