The STM32F103C8T6 main controller
detects button press status, communicates with the DS3231 via I2C to obtain time information, and generates two PWM channels to control LED brightness. When not in use, it enters a stop mode.
Of the six buttons, four control two LEDs with different color temperatures (brightness +, brightness -), one displays the time, and the other acts as a master switch for
the digital tube display .
Because driving the digital tube is quite power-intensive, the time display is set to turn on for 2 seconds when needed (when a button is pressed), and then turn off.
The LGS63032 boost LED constant current driver has
LED color temperatures of 4000K and 6000K, and a forward current of 60mA.
The maximum LED current is adjusted via an external sampling resistor; for details, please refer to the LGS63032 datasheet.
The
DS3231 is an I2C real-time clock (RTC) with a built-in temperature-compensated crystal oscillator (TCXO). When the module's power is interrupted, the device is powered by a CR2032 battery and maintains accurate time. The long-term accuracy of this device is improved by including a crystal oscillator. The DS3231 can track seconds, minutes, hours, days, dates, months, and years. This example only reads minutes + hours.
## The side-mounted buttons are really hard to press, they hurt my hand, and there are too many buttons, making it look clunky... Can't they make it a little more sophisticated? Coincidentally, I recently discovered a driver chip called JL7010S, which has touch control, brightness memory, and dual-channel LED control functions. Having it can greatly simplify the peripheral circuit and bring a better user experience. Forget about the ubiquitous C8T6; everyone should go look at the dual-color temperature stepless dimming lamp - JLCPCB EDA open-source hardware platform (oshwhub.com)
finished product showcase
, and
you're not allowed to stay up all night anymore!