Tooth brushing timer

Good day, Habr!



This article is for those who do not have all the brushes in the bathroom with a timer, and who do not want to use an hourglass.

We have two daughters. Each time they enter the bathroom to brush their teeth, they ask to be spotted for two minutes (out of four children's brushes, only one has a timer for brushing your teeth). To make the process more interesting, and we did not have to remind the children to leave the bathroom four times a day, I decided to figure out a timer. The hourglass fell away immediately - it’s somehow not sporty.


Fig. 1. Timer circuit

The timer circuit is very simple and is shown in Fig. 1. The mechanical buttons are not very suitable for the bathroom, as from pressing with wet hands they can fail (I will varnish the board), so it was decided to make the button touch. I previously used the TTP223 chip, and I installed it accordingly, but now it will work as a reset for the microcontroller. I thought that since the timer is turned off almost all the time (if you do not take into account that children will constantly poke into it, going to wash their hands), then you can use standby mode, and when you press the button, just reset the MK.

The microcontroller used the one that was available - STM32F031G4. The small UFQFPN-28 is very convenient for miniature crafts. Specially did not add a tweeter (to save battery) and buck-boost, so that the dimensions were minimal.


Fig. 2. Printed circuit board top

On the circuit board, I made only ten vias, and, so as not to be an eyesore, eight of them were located on the LED platforms. I also really wanted to stick a fingerprint picture somewhere.


Fig. 3. Printed circuit board bottom I

tried to make the circuit board as small as possible, because I don’t know yet whether I’ll print the case or just stick the double-sided tape to the tile or mirror on the battery compartment.


Fig. 4. The board with the bottom components. The

firmware is also quite simple (generated in CubeMX for IAR). Blink diodes at startup and extinguish, then light at intervals of 30 seconds one at a time and blink again before bedtime.

For standby, only a couple of lines are used:

DBGMCU->CR |= DBGMCU_CR_DBG_STANDBY;  

HAL_PWR_EnterSTANDBYMode();

After falling asleep, the SWD falls off, but since I have a sensor on the reset, we just press the touch and flash it.

LEDs use Chinese with ali. With a multimeter (UNI-T UT70A) it turned out to measure something like this:

  • 1 LED - 3.2mA;
  • 2 LEDs - 3.4mA;
  • 3 LEDs - 3.6mA;
  • 4 LEDs - 3.8mA;
  • In standby mode 8uA.

I think to play with the frequency of STM, and in the mode of operation to make it minimal.

I hope the children will be delighted)

PS: The


children are delighted!

Thank you for the attention!

All Articles