Hello! Welcome to Embedic!
This website uses cookies. By using this site, you consent to the use of cookies. For more information, please take a look at our Privacy Policy.
Home > Embedded Events > Electronic kitchen timer based on 8-bit STM8S103F3P6 microcontroller and encoder

Electronic kitchen timer based on 8-bit STM8S103F3P6 microcontroller and encoder

Date: 10-08-2021 ClickCount: 127

The kitchen timer is designed to count down the set time and emit initial and end sound signals at the end of the countdown signal. The time is set by an incremental encoder. The time is displayed on a 2-digit 7-segment display with OA. The timer is powered by 3 AA batteries with a total supply voltage of 4.5 V. When not in operation, the timer is in sleep mode and consumes only a few microamps. In operation, it draws approximately 2-10 mA depending on the set brightness and the section lit.



-Installation step/timing setting via encoder: 1 sec-1 min.

-Display brightness setting: automatic darkening after 10 seconds, manual mode from 1 to 30.

-Set first pre-sound signal: Off. /from 1 min. Up to 9 minutes.

-Setting the number of signals at the end of the countdown: Off. /from 1 to 99.

-Sets the frequency of the sound. Signal: 1 to 4 kHz (optional).

-Set the time before the automatic shutdown on inactivity: 10 to 99 seconds.

-Saves all settings in the non-volatile EEPROM.



-Accuracy: 1 second.

-Range: 1 second to 99 seconds / 1 minute to 99 minutes.

-Resolution: 1 sec. / 1 min.

-Time setting steps: 1 sec. / 1 min.

-Indication: 2-digit 7-segment recorder with OA.

-Sound signal: Switchable. 2 preliminary and end of period account setting times. 10 seconds before the end of the count, imitating the tick-tock sound.

-Control: Minimum and simple on the encoder.

-Counting time can be adjusted in "real time" during the counting process.

-Control modes: start, pause - stop.

-Power control every time it is turned on.

-Power supply: 3 AA batteries. 4.5 V, current consumption during operation 2 ... 10 mA, depending on the brightness, in sleep mode does not exceed 10 ... 20 μA.

-Compact design and simple circuitry.



Like any other electronic device, the kitchen timer has passed the prototyping and debugging phase of the program code. Everything is soldered on the prototype board and interconnected by wires. Heart and brain :) at this stage is a debug board based on an 8-bit STM8S103F3P6 microcontroller purchased from Aliexpress.





Printed circuit board.

After hardware testing of everything, I started developing the printed circuit board. The printed circuit board was designed using the CAD version 15 of Altium Designer.

Printed circuit board.

Printed circuit board.

Assembly form.


Assembly form.

Assembly form.

Assembly form.

Hardware description.

The heart of the timer is the STM8S103F3P6 microcontroller in a TSSOP-20 package. Initially, the microcontroller's clock was adjusted using the built-in oscillator, but during testing, significant time drift was noted. This could be avoided by using an external crystal of 4 MHz.


The voltage level on the battery during the test was controlled by a comparator on the LM393, the output of which was connected to the PD2 port. The reference voltage of the comparator is implemented on the TL431. During the test, power is supplied to the circuit via a key on the VT2 IRLML6402 field controller.


To connect the indicator, a shift register on the DD2 74HC595 was used.



Attention! The resistor R3 must be blinked with a soldered resistor because it is connected to the SWIM port and prevents the programmer from detecting the microcontroller. I blink in the STVP-ST Visual Programmer. Immediately after loading the firmware on the OPTION BYTE tab, you need to configure AFR0 as an alternative function by selecting Port PC6 TIM1_CH1 and Port PC7 TIM1_CH2 and loading them into the MC. Disconnect the programmer and do not forget to solder resistor R3 to the board. More detailed information about the process of loading the software into the microcontroller will be presented in a separate article. Once the software is downloaded, the timer is ready to run.



Once the firmware is complete, the timer will use the default settings, to change them you will need to go into MENU. in the off state, press and hold the encoder button for at least 1 second until a short beep sounds and the letter M, then set the desired settings in order according to the instructions for the menu items. The current MENU item is shown on the display for 1 second, then you can change it yourself by turning the encoder knob left or right to go to the next menu item by pressing the encoder button briefly.


Р1- Countdown timer. 0- Countdown in minutes, 1 - Countdown in seconds. By default, 0 is the countdown (in minutes).


P2- Display brightness. 0- Auto mode that gets darker after 10 seconds. Constant brightness level from 1 to 30, where 1 - minimum brightness and 30 - maximum brightness. Default value is 0-Auto mode.


P3- Time in minutes for the first pre-sound signal. 0-Disable (there will be no preliminary signal). 1-9 times (in minutes). For example, do you want the first beep to sound 2 minutes before the end of the count? No problem. To do this, turn the encoder knob left or right to select the number 2. The beep will only sound if the set timer counts down longer than the time set in this MENU item. By default, the first beep will sound 2 minutes before the end of the countdown. In addition, the same audible signal will sound again 1 minute before the end of the countdown.


Р4- Number of sound signals at the end of the countdown. 0 - Disables all sound signals, including the initial sound signal. Mute mode. Number of beeps from 1 to 99. The duration of the sound signal is 1 s and the pause time is 1 s. The default value is 5 signals.


P5- Frequency of the sound signal. 1 to 4 kHz. default value is 1 kHz. attention! This option is available only when the firmware is used for passive transmitters (no built-in generator). If an active buzzer (with built-in generator) is used, this item is used to set the time before the automatic shutdown.


P6- Time (in seconds) for automatic shutdown. 10 to 99 seconds. By default, it automatically shuts off after 10 seconds of inactivity. If the firmware is used with an active buzzer, this menu item is executed in P5. Press the encoder button again to save the settings, the display will show the inscription SP Save parameter and the timer will restart after 1 second and apply the new MENU settings. All settings are stored in non-volatile EEPROM memory.


If there is no action for a period of time in MENU mode, the timer goes into sleep mode. In order to roll back to the default settings in the off state, press and hold the encoder button for at least 2 seconds until the dF default symbols appear on the display, they will show for 2 seconds and then the timer will restart.

 MENU mode,


To turn the timer on, press the encoder button briefly. A welcome sound will be made with a dash animation on the 7-segment display. Next, tb will appear, which means to perform a battery test, or if the battery is discharged, Lb, short for the word Low Battery and the timer will go into sleep mode. The battery will need to be replaced for future use.


If all is well, the timer goes into time setting mode, the number 0 lights up on the far right and the encoder knob is turned left and right to set the desired countdown time. By the way, you can change the countdown time at any time. To start counting, press the encoder button briefly. A short beep will sound and the rightmost digit will start flashing. If set to auto-dim, the display will go dark after 5 seconds.


In addition, depending on the MENU setting, if the first preliminary audible signal is active, it will sound at the set time and the same signal will sound exactly 1 minute before the end of the countdown. A short beep will sound 10 seconds before the end of the countdown and a long beep will sound when the time expires and the timer will automatically turn off after the specified time set in the P5 / P6 MENU item, depending on the firmware used. When there is less than 1 minute remaining, the display will show seconds in 2 digits.


If you have started the timer but you need to change the countdown time, simply turn the encoder knob to the left or right while setting the seconds to zero.


If the timer is running and you need to pause the timer, press the encoder button briefly while the digit in the number will flash. To continue, press the encoder button briefly and a short beep will sound and the timer will continue to count down.


To stop the timer, press and hold the encoder button until a short beep sounds and the time is reset. The timer will then automatically turn off.


  • TI's new Sitara™ AM2x family redefines MCUs with 10x more processing power than exist...
  • Smart Thermometer with ESP-01F and Web Socket

Hot Products

  • PIC16LF628A-I/ML

    Manufacturer: Microchip


    Product Categories: 8bit MCU



  • DSPIC33EP32MC502-I/SS

    Manufacturer: Microchip


    Product Categories: 16bit MCU



  • ADSP-BF516KSWZ-4F4

    Manufacturer: Analog Devices

    IC DSP 16/32B 400MHZ 176LQFP

    Product Categories: DSP



  • TMS320C6472EZTZ6

    Manufacturer: Texas Instruments


    Product Categories: DSP



Customer Comments

  • Looking forward to your comment

  • Comment

    Verification Code * 

Compare products

Compare Empty