Search This Blog

Monday, March 8, 2021

STM8 Timer V2

 Go to Timer V1

Timer V2

There were a few changes to the V1 design.

  • Supercap backup power

  • Connectors for LED/sensor and Servo connector

  • Switcher module

  • LCD and buttons I/O changes. LCD backlight on/off control by ambient light

  • I2C connector

  • expansion connector for nRF24 (no firmware support)

Supercap backup power

Supercap backup

The backup circuit is similar to the one I have been using in my digital clocks.  I added the option of using a constant current source for charging the low ESR supercap. The resistor is simpler and have one less diode drop.

Servo connector

It turns out that the water pump I originally used wasn't reliable, so I have been using a servo driven valve.  I had to rerouted the control line for power supply the servo.  

Switcher module

5V supply

A DC-DC converter module is used for converting the 12V to 5V for the timer and servo.  I used a 10K resistor to set the output of the KIS-3R33 module to 5V.  Other modules can be used.

I am using power supply grade Tantalum capacitors as they take up less heights and offers a longer lifetime than electrolytic capacitors. The DC-DC module operates at 340kHz which helps to reduce the capacitance.

LCD and buttons I/O changes

I have decided to use time delay instead of polling for Busy Flag for the LCD.  This frees up 1 GPIO pin and simplifies the sharing of the LCD I/O signals for multiple functions.

Buttons

In the V1 design, an ADC channel is used for sensing the buttons.  The LCD data lines now are used for polling the buttons.

nRF24 module

Also new in this version is a connector for a nRF24 module.  The module uses SPI which shares the same data lines with the LCD. 

Timer with the nRF24 module

A bottom entry connector is used for flush mounting the nRF24 module.


github: https://github.com/FPGA-Computer/Timer

STM8 LED Clock - Part 3

Go to Part2

My old alarm clock retrofitted with a STM8

This design is very similar to my other digital clock in Part 1. This one uses larger common anode displays and requires higher currents (50mA vs 20mA). Each of the common anode digits is driven by a PNP transistor as they require more current than what the STM8 can source.

Display

The driver and display are constructed on a protoboard using point to point wiring. I change their duty cycle via TIM4->ARR on the fly to balance the brightness for the last 2 digits.

STM8 breakout PCB + display drivers

The alarm clock is power from a small 12VCT transformer.  I have decided not to use the AC frequency for timing as the short term accuracy is worse than a calibrated crystal.

Supercap backup

A low ESR SuperCap is used to kept the time for a few minutes during a power failure or when I move the clock to a different AC outlet.  The STM8 I use isn't a low power part. It draws around 2mA just to keep the RTC alive.
Piezo driver

The alarm is a 1kHz tone from the Beeper peripheral with a simple circuit for driving the piezo buzzer.


Alarm clock assemblies