Do-it-yourself kitchen timer with a digital keyboard. Economical kitchen timer on ATtiny2313

In the culinary arts, timing is just as important as recipe accuracy. This timer is designed specifically for use in the kitchen, it is very easy to use and allows you to turn the knobs of the two biscuit switches to set any time delay from one minute to 99 minutes, in steps per minute. The end of the set time interval is indicated by a tonal, sufficiently loud sound signal, which sounds for one minute (if not turned off earlier).

The timer is not intended for controlling electrical appliances, its task is to inform the chef that the cooking time has expired.

The schematic diagram is shown in the figure above. Only three microcircuits-counters of the K176 series. D1 is a clock microcircuit, in this case it generates minute pulses and a pulse signal with a frequency of 1024 Hz, which serves for sound indication. D1 contains two counters, the first lower one generates, along with other signals, pulses with a frequency of 1 Hz, and the second upper one contains a divider of these pulses by 60, so at pin 10 of D1 pulses with a repetition rate of one minute are obtained.

Pulses with a frequency of 1 Hz, in addition, are fed to a transistor switch VT1, in the collector circuit of which an LED is turned on, blinking during the timer with a period of one second.

Minute impulses with pin. 10 D1 goes to a two-digit decimal counter on two identical chips D2 and D3. The time is set using switches S1 and S2, with S1 setting the units of minutes, and S2 - tens. For example, if you need 63 minutes, set S1 to position "3", and S2 to position "6".

The sound-emitting device consists of a transistor VT2, a miniature speaker B1 and a logic element "3rd" on a resistor R6 and diodes VD2-VD4. While at the set outputs of the counters there are logical zeros (or one of them is zero) at least one of the diodes VD2 and VD4 receives a logical zero through the switch S1 or S2. In this case, the diode is open and zero is also set at the junction of R6 and R7. As soon as the set time has elapsed, both diodes receive units and they close. As a result, a high level voltage is supplied to the VT2 base through R6-R7.

And in order to receive a tone signal, this voltage is interrupted at a frequency of 1024 Hz by means of the VD3 diode, to the cathode of which this frequency comes from pin 11 of D1. The timer is set to zero at the moment the power is turned on using the capacitor C5, the charging current of which sets all four counters to zero states.

Structurally, the timer is made in a small plastic box for various trifles, the knobs of two biscuit switches are brought out on the cover and circular scales of tens and units of minutes are drawn. The speaker is also attached to this cover. Switch SB1 toggle switch. The timer is powered by two 4.5 V flat batteries connected in series.

It is possible to install a standard connector and power the timer from a network adapter for portable audio equipment of 9 V. During the setup process, you may have to choose the ratio of resistors R7 and R8 so that the speaker does not sound until the set time.

Any electrodynamic or electromagnetic low-power sound emitter is suitable as a speaker, for example, an electromagnetic capsule from a telephone set, a speaker from a radio receiver, etc. Chips K176IE8 can be replaced with K561IE8. KT315 transistors - any corresponding power and structure. Diodes KD521 any low-power pulse or rectifier, and even better if germanium type D9. LED is also of any visible spectrum.

Kitchen timer circuit board view

My son's grandmother will have a birthday soon. Since I carried him away with microcontrollers, I got the idea to donate some kind of device, naturally, on a microcontroller and made by hand. Like all grandmothers, our grandmother is not an advanced user of any devices, and, in principle, she has nothing special from electronics. So, you can make any, not very complicated device.

When we come to visit her, we are always greeted by a rich table with a large number of dishes. Therefore, we immediately decided to make a device that is useful in the kitchen. Together we often play various board games - lotto, various dice games. This means that our device should help here as well.

After thinking a little, the son decided to do advanced kitchen timer... I helped him a little with the diagram. The main functions of our gift:

  • Timer mode up to 3 hours
  • Stopwatch mode
  • Loud signal
  • Compact size
  • "Eternal" batteries - rechargeable batteries, charging like a phone, micro usb
  • And of course games - a cube (random number from 1 to 6), loto, bomb (very fun game)

We select components

As an indicator, we chose a three-digit LED indicator with a common anode - it has only 11 pins, which is very convenient. It is not difficult to buy, and in principle, quite economical in energy consumption (but certainly not LCD).

Microcontroller - STM8S003F3P6 - we have already worked with it, so everything is familiar. ST-link is already there.

The charge microcircuit and the entire harness of the MK, like a bicycle computer.

As a buzzer, very compact and loud HC0903A buzzer

Battery - LIR2032. Only 45 mAh, but this is enough for 40 hours of continuous timer operation. We decided to abandon the quartz resonator (conclusions are needed), we do not need special accuracy, and the STM8 also has a fairly accurate internal oscillator. Charge IC - TP4056.

Management - 2 tact buttons. The device is in sleep mode all the time, consumption is less than 5 μA, it can sleep for a long time. The protection board for the battery was not made, especially not needed. MK has a lower limit of 3V, so it will not sag much. When you turn on the music, the indicator turns on (current surge), and if the battery is dead, the MK will reboot and go into sleep mode, which is a signal to charge. It is charged with a current of 100 mA for about 40 minutes, which, in principle, is very fast. The scheme and program can be downloaded on github, link at the end.

The son decided to make the body himself from a mounting box 40 x 16 mm. Painted with acrylics, cut out a piece from a DVD disc as glass. It turned out very nicely.

The son did the board tracing himself in Kicad. He invented the arrangement of the components. The buttons are on the sides of the indicator, the buzzer is at the bottom, the battery is on it. Everything came in tightly, nothing dangles anywhere. The board is double-sided. Made of 0.8mm thick single-sided fiberglass using cold toner transfer method. The two halves of the board were connected and fixed with jumpers. From connectors - micro usb, power and programming.

Program

This indicator has a common anode; therefore, only one discharge can be output at a time. To output three digits simultaneously, dynamic indication is required.

This is done very simply programmatically. The timer is activated, and at regular intervals, with a high frequency, for example, every 300 μs, we will output one digit in a circle - 1-2-3-1-2-3. We will be shown that the numbers glow at the same time, like in a movie. If you additionally add more empty digits, you can control the brightness. That is, there will be such a scheme for displaying information - 1-2-3-empty-empty-empty-empty-1-2-3-empty-empty ... Brightness control is needed in order to reduce power consumption. Thus, for example, without the use of brightness, one discharge consumes 24 mA, and with the use it can be reduced to 1-2 mA. At the same time, the numbers are still clearly and far visible. The son played with the frequency, brightness, when everything stopped flickering, he liked it. It turned out that programming this type of indicator is quite easy and convenient.
The second difficult moment is to come up with a simple, as they say, intuitive interface, when we have 3 indicator digits and 2 buttons. But I think he succeeded.

Came up with buttons like this:

  • Right button - long press, change modes, there are three of them - Timer, Stopwatch, Games
  • Right button - single press, change of sub-mode. For a timer, this is a choice of preset times, for a stopwatch, a choice of a regular stopwatch and with confirmation, for a game, respectively. Various games
  • Left button - single press - start / stop or move in the game, long press - setting mode, programming
With an indicator like this:
  • When a timer is selected, a certain number from the preset settings is immediately displayed (for example, 5,15,30 minutes), they can be reprogrammed, stored in ROM
  • When the stopwatch is selected - then 000
  • When the games are L - lotto, 6 - bomb, C - die.
  • The numbers are displayed cleverly on the indicator, since there are only three digits, then we display the maximum number of significant elements. For example, the timer is 200 minutes 30 seconds - then we output 200., if the timer is 10min 15s, then we output 10.1, if 1 minute 25s, then 1.25. At the same time, in order to understand that the timer or stopwatch is running, the dot blinks in time to seconds.
  • When the stopwatch is stopped, for example, for 10 minutes 25 seconds, then we show alternately 10. and 25, once a second, to see the seconds too.
The program turned out to be not so simple, my son wrote it for almost 3 weeks during school time, with a little help from me. There are a lot of conditions, different flags - start, stop, work with memory, etc. But he was very pleased with the result.

Tests

The first tests took place at school. Instead of a cube, fortune-telling on grades. The whole class wondered. Then the bomb is a super game. The device guesses a random time from 5 to 20 seconds and starts ticking every second. You pass it in a circle. When the timer reaches zero - an explosion signal. The one who has the device in his hands lost.

The first tests of the stopwatch and timer went off with a bang. Spotted different time, checked against the exact clock, the error is 1-2 seconds per hour. We worked out the sound of the signal.

Presenting a gift

The birthday has come. The grandmother went through the training quickly and was very happy. Everyone experienced Lotto, fully automated. Every 5 seconds the device beeps and gives out a new number from the ones remaining in the bag. Everyone plays, drives the device! Who did not have time, he was late.

Outcome

So, the device turned out to be just great. The practice of programming is very interesting. If you are also interested in microcontrollers, then you can make yourself (or as a gift) the same and program it. You will definitely learn:
  • make payments
  • solder smd components
  • program STM8
  • work with batteries
  • handle buttons
  • make different sounds
  • work with timers and handle temporary events
  • fight energy consumption
A schematic and a board in Kicad format is posted on github. An initial project for STM8 has been posted, the most difficult thing there is dynamic indication, microcontroller initialization, complex button processing - short, double, long press. I suggest writing the rest of the program yourself, it's so interesting!

Introducing a very practical timekeeper for home and kitchen. The project was developed due to the fact that although there are many different timers in different devices (watches, smartphones, etc.), they are all not convenient to use in a kitchen or workshop. Management should be simplified as much as possible - no unnecessary buttons that do not immediately remember which one is responsible for what.

Schematic diagram of a timer with an encoder


Scheme for a kitchen timer with an ATtiny 2313 microcontroller

Once upon a time there were mechanical timers on the market - they were really easy to use. So it was decided to combine this simplicity with a modern base. This is how this timer with a regulator - encoder appeared. In it, as in the mechanical prototype, you can increase and decrease the countdown time. The basis is the ATtiny 2313 microcontroller. Here's to it.


Timer seal drawing

How the device works

The increase / decrease in time occurs in steps at once for several seconds. In addition, time can be paused.

The last 5 minutes are signaled by short double peaks every minute. And for the last 15 seconds, it beeps every second.

The ability to turn off the current tweeter signal is carried out by pressing the encoder or turning its knob in any direction.


Side view

In order to make the control as simple as possible for the user, the countdown timer does not have any other superfluous functions.


Detail side view

And instead of recognizing time steps for 15, 30, 60 seconds, it would be better to determine the speed of rotation of the encoder knob and change the time on this basis. Slow rotation - counts individual seconds, fast rotation - steps of several minutes.


Ready-made homemade LED timer

The case ... It never came to him 🙁 The timer has been used for a long time in a half-open form: 3 finger batteries on the bottom, a three-digit LED indicator in front, and a time control knob above.

Timer video

Here is a video demonstrating the operation of the device in various modes, as well as a mechanical stopwatch nearby for comparison.

Smart indicator

We will make our own indicator, arbitrary shape from smd LEDs. Compact - minimum size 20x20 mm with a thickness of only 2 mm. Low power consumption - 1-10 mA in operation, 5 μA in sleep mode. Independent one-wire control of each LED. Brightness control - over 100 brightness levels. Up to 100 LEDs in the indicator, with an arbitrary position on the board. Possible designs - two scales of 8 LEDs and 4 service LEDs; indication of cardinal points - 8 LEDs in a circle and 4 service ones; clock - 12 LEDs in a circle; matrix of 8x8 LEDs.


Li-ion battery discharge controller

This mini device is necessary to protect li-ion batteries from deep discharge. The circuit automatically disconnects the battery when the voltage on it drops below 2.9V. Very low current consumption of only 500 nA. The maximum consumer current is 2A. Reliably protects your battery from overdischarge. The board size is only 10x6 mm.


UV Index and Temperature Meter

Gathered at the sea? Take this device with you. With it, you will never burn and will tan correctly - accurate measurement of the instantaneous and accumulated UV Index. You will know whether the sea has warmed up - accurate measurement of the water temperature using a K type thermocouple. How hot it is outside - measuring the air temperature. It will also be useful to you in the country - the correct preparation of the barbecue. Miniature size 35x45x18, built-in battery, as well as a lot of other useful functions.


Course overview

Once you have come to this page, you still do not have enough experience to make complex devices on microcontrollers. We invite you to take the course of a young soldier and expand the horizons of your knowledge in microelectronics. All you need to do is make all the devices offered here and master all the theory associated with them. At the end of the course, you will be able to design devices of medium complexity on your own, program various microcontrollers, understand what modules various devices consist of, and what you need to develop your device.

In this article, we will consider in detail all the key points of the course, justify the order of the devices, explain why they should be done exactly this way and why they all need to be done.

Dwelcome to the fascinating worldmicroelectronics!

The first issue of the radio magazine came out in 1924. Even then, there was an interest in the manufacture of electronic devices at home. With the help of a soldering iron, wires, and later on textolite, it was possible to make a full-fledged complex device. It was very difficult, only a few understood in this area.

Now almost every student can independently make printed circuit boards of excellent quality at home. Assemble on them a modern device that is not inferior in functions to those sold on the market. All this became possible thanks to the advent of computers and the development of the Internet. Almost every device in our time is made on. They allow you to breathe life into the device, solve complex problems through programming, receive and display various data.

Can be done on the basis of microcontrollers? How to make

Sometimes you just need to set the time interval, without much microscopic accuracy. For example, for cooking, where an error of a few seconds in half an hour, the hour does not play an important role. Based on these considerations, an internal RC oscillator is selected as the clock generator. The stability of which depends on the temperature and changes in the supply voltage, since the microcontroller remains operational at a voltage of 1.8-5.5 V. As a power source, I used a 3-volt battery (or 2 cells of 1.5 V each).

The task was to simplify the design as much as possible with a minimum of external parts and controls and indicators (as simple as possible). The program is written in assembler in AVR Studio.

There are a couple of buttons to control the timer modes. The first "SET" is for setting the time interval, the second is "RESET" for resetting at any time if you need to "replay" the situation and set another time interval. As well as a sound buzzer, as a sound indication of the status of the timer in different periods of operation.

The timer is made with a minimum 5-minute discrete interval, you can dial as many such intervals (up to 255) if you hold the button down.

Schematic diagram of the kitchen timer:

After releasing the button, the timer starts and the countdown starts, the timer's feature is sound indication (eyes and hands do not participate in control, but only hearing), when set, it “beeps” as many times as you need to dial 5-minute intervals. For example: you need an interval of 30 minutes, which means you need to press the "SET" button and hold it down, dial "pillings" 6 times and release the button. From the moment the "SET" button is released, the LED indicator lights up, indicating that the timer has started, and goes out only after the end of the entire cycle, also from the moment of starting the countdown starts, the buzzer "beeps" after the next discrete 5-minute interval so many times how many of them are left before the end of the full cycle of the timer. And when the whole cycle has been completed, at the end of the cycle a long "beeping" signal sounds for about 10 seconds, announcing the end.

After that, the timer goes into standby mode by switching to the power-down power-saving mode by the sleep command, where the current consumption will be less than a microampere in the program, the internal RC-generator whose clock frequency is 128/8 kHz.