Kitchen daily timer pic diagram. Competition for the best design on microcontrollers. Video of timer operation

The timer on ATmega8 is simple, small circuit, based on a clock quartz

Description of control.

If there are less than ten hours left in work, the leading zero is removed; if there is less than an hour left, MM:SS is displayed on the indicator; when setting the timer, the time format is HH:MM.
When less than 20 seconds remain, pulses with a period of 0.5 s are sent to the signal pin (PC4).
pressing the SW4 button while the timer is running stops counting completely, subsequent presses in turn restore the previous setting or reset the timer

If jumper Jmp1 is closed, then when power appears, the timer continues counting. If it is open, then the countdown does not proceed while there is no power (pause). With backup power, there is no indication. The dot near the hour unit blinks.
When you press the RESET button, the timer turns off the load, stops and resets to zero, and pressing it again restores the previous setting. The dot flashes only when counting is in progress.

indicator points:

Do not blink: timer has stopped
- the middle one is flashing - the timer has started

Indicators OA.

Author of the project VasylYE you can find it herehttp://elektron.ucoz.ru/forum/

I propose to repeat a simple scheme of a household (kitchen) timer for 99 minutes of my own design. The idea was to make it easy to use, so that literally any (stupid) housewife could use it without any problems. Simply dial 2 digits for the minutes and press the "Start" button. If necessary, you can set the seconds. There is also a hidden “service menu”, where several features are “hidden” - display of forward/downward time countdown when the timer is running and several various options light and sound effects at the end of the countdown. Another feature of the timer (though only at the controller programming level) is the ability to select an option for controlling the RC5 leg - the appearance of “1” on it either during the counting of time, or after the end of the counting. This leg can be used, for example, to control the load or in any way you wish. In my version, I turned on an additional sound amplifier at the end of the count.

At the beginning I developed the "design" of the scoreboard. The timer uses a 2-digit indicator with a colon on the left, and 6 LEDs are located around it. When counting down time, they show tens of seconds, and when the counting ends, they depict a running fire. The colon also serves as a visual mode control. When setting the time in minutes mode, it is off, and in seconds mode it is on. When the timer is started, the countdown begins. If the time is less than one minute, the indicator shows seconds and the colon is constantly lit. When more than a minute has passed, the minutes are displayed on the indicator, and the colon begins to blink. Tens of seconds, as I wrote above, are shown by the LEDs. Now, when reading this text, it seems that everything is too complicated, but in reality everything is very simple and logical.

Since I intended to build this timer directly into the wall, I supplied it with power from the network with a real switch. No sleep or standby modes! I don't like them. Only complete shutdown! The power supply is the simplest switching one, similar to a Chinese charger. I didn’t strive for particular accuracy, since for preparing all kinds of culinary products, accuracy even plus/minus a couple of minutes is not so critical. And I didn’t have a standard stopwatch either. By eye, when setting the maximum interval to 99 minutes, there was practically no difference compared to the “reference” clock. Well, maybe there was about half a second there, but it’s difficult to track it by eye. So if you are satisfied with everything, you can start replicating the device. Here is his diagram:

During the MK firmware update, jumpers JP1 and JP2 are removed. To save space, keys VT5, VT6, VT9 and VT10 are not shown in the diagram. The indicator was taken from an old computer case. It uses the left 1 as a colon. Only during final assembly these segments need to be painted over a little to make 2 dots (I simply covered the unnecessary areas with black electrical tape). Another feature of this indicator is that the segments of this left unit are connected in series within the indicator and are displayed as an H segment (comma) from the second digit. Therefore, note that the value of R22 is less than that of the resistors for other segments. In general, you can simply use a regular 2-digit indicator and 2 series-connected LEDs for the colon. I took this indicator simply because I already had it. Just in case, I'll give you the pinout.

Setting the time is as follows. By default (when turned on), the timer is in minutes input mode, and the colon is disabled. Use the number buttons to dial in the required minutes and press the “Start” button (S12 according to the diagram). The entered numbers shift to the left as you press, which numbers on the indicator are lit - so many minutes in this moment and installed. For example, if the indicator lights up 23 (23 minutes are set), but you need to set 6 minutes, then simply press “0” and “6”. If you need to set the seconds, press the “Sec” button (S10 according to the diagram), and the colon lights up. We set how many seconds we need in the same way as minutes. If the dialed number is longer than 59 seconds, the highest digit begins to blink, symbolizing an error, and is reset to 0. The timer can be started from either the minutes or seconds mode. After starting the timer, you can stop it ahead of schedule by pressing the "Start" button again.

On schematic diagram On the left you can see the X3 connector with the inscription "Out". This is the same output for controlling something that I wrote about at the beginning. In the initial state there is "0". At the programming stage of the MK, you can set when level “1” will appear there - during the time countdown or at the end of the countdown and before the timer returns to its original position. This is set in the EEPROM data memory, in cell at address 0x2105 (square 1 in the figure). By writing the value 0x01 there, the output will be logical "1" while the timer is running. By writing 0x00 - after the end of the countdown. Here is a screenshot of the program when programming the MK.

At address 0x2107 (square 2) is the value of the correction number when counting time (lag - decrease, hurry - increase). It is advisable to change the number within small limits and it is better not to touch it unless absolutely necessary. Do not put numbers equal to 0 and 0FFh. At address 0x2109 (square 3) there is a number that determines how many minutes the sound signal will sound at the end of the countdown, if the timer is not reset to its original state by pressing the button.

As I wrote above, you can, for example, connect a load control unit to the “Out” output according to this scheme.

If the load is not very powerful (several tens of watts), the thyristor does not even need to be placed on the radiator. During the experiments, I connected a 25W incandescent lamp and all the parts were as cold as a corpse.

Since I didn’t need to control anything, and the timer was intended to count time when cooking, I connected an additional “amplifier” with a piezo speaker from the phone to this output to increase the volume of the signal when the timer was triggered. It turned out quite loud, and the signal can be heard in any corner of the apartment.

Those. the "Out" output turned on the power to the "amplifier", and the sound signal itself was taken from the output of the PIC for the small speaker. It turned out that when you press the buttons to set the time, only the small speaker beeps, and when the timer goes off, both speakers beep at once. This additional amplifier is assembled on a separate board.

The timer itself is assembled on a two-sided printed circuit board, drawn in . The archive is attached at the end of the article. The board is wired for PIC in a TSSOP package with a pitch of 0.65mm.

Photo of the board in the process of assembly/debugging.

To power the timer, I used a simple switching power supply, assembled according to this circuit (I took the circuit itself ready-made somewhere on the Internet). There is no point in writing about it in detail here, because this is a topic for a separate article about switching power supplies. I will only provide data on the winding of the transformer. The frame itself of a suitable size is taken from energy saving lamp or from a burnt Chinese power supply unit. It can also be torn out from the duty circuit of a computer power supply or from a monitor, but they will be slightly larger in size. To easily disassemble the frame and core of transformers, I dip them in boiling water for 3-4 minutes and then carefully, without much effort, disassemble them. Next, we remove all the old windings and wind new ones. Windings: 1-2 - 600 turns with a diameter of 0.08 - 0.1 mm; 3-4 - 23 turns with a diameter of 0.3 - 0.55 mm; 5-6 - 10 turns with a diameter of 0.08 - 0.1 mm. Winding 1-2 wound in bulk, the rest turn to turn. All windings must be well insulated from each other. When winding, observe the direction and beginning of the winding at points. Two halves W-shaped cores joined through an insulating gasket (air gap ~ 0.1 mm).

But you can do it easier by taking any ready-made Chinese power supply with an output voltage of 8-9 volts.

A few photos of the case being made (small workshop). Particular attention was paid to the design of the display.

Well, the finished device is assembled.

And finally, about the “service menu”, which was mentioned at the beginning of the text. If you enter “1”, “1”, “1”, “1”, “1” and “Start” from the seconds setting mode, then using the “1” and “2” buttons you can select a forward or backward countdown. The indicator will display " Cu" (Count Up) or " Cd" (Count down). Exit the menu and save the settings in EEPROM with the "Start" button.

If you type the sequence “2”, “2”, “2”, “2”, “2” (also from the seconds setting mode) and “Start” - using the buttons “1” - “4” you can select one of four options sound signal when the timer fires. The indicator will show " A1" -"A4" (Alarm). Exit with saving settings in EEPROM using the "Start" button.

By typing “3”, “3”, “3”, “3”, “3” and “Start” using the “1” - “4” buttons, you can select one of four options for “running fire” of circular LEDs when the timer is triggered. The indicator will show " E1" -"E4".

By typing “4”, “4”, “4”, “4”, “4” and “Start” using the “1” - “4” buttons, you can select one of four options for blinking seven-segment indicators when the timer is triggered. The indicator will show " L1" -"L4".

The archive contains timer and power supply boards (if anyone needs them) and controller firmware. The fuses are already specified in the firmware, nothing needs to be changed. On the timer board there are several 0.1 µF ceramic capacitors for power supply, not shown in the circuit diagram. There are also a couple of parts designated FB (ferrite bead) - these are simply so-called ferrite beads used as jumpers.

List of radioelements

Designation Type Denomination Quantity NoteShopMy notepad
IC1 MK PIC 8-bit

PIC16F636

1 To notepad
IC2 Encoder, decoder

SN74LS155A

1 To notepad
IC3 Shift RegisterK561IR21 To notepad
IC4 Linear regulator

L78L05

1 To notepad
VT1-VT3, VT13 Bipolar transistor

KT3107BM

4 To notepad
VT4-VT12 Bipolar transistor

KT3102BM

29 To notepad
D1-D4 Rectifier diode

1N4148

4 To notepad
Q1 Quartz resonator20 MHz1 To notepad
C1, C2, C4 220 µF3 To notepad
C3, C5, C8 Electrolytic capacitor100 µF3 To notepad
C6, C7 Capacitor22 pF2 To notepad
C9 Capacitor0.1 µF1 To notepad
R1-R3 Resistor

1 kOhm

3 To notepad
R4-R6 Resistor

680 Ohm

3

I wanted to do it for all occasions, different time intervals at the discretion of the user. This is the option. There are only two control buttons, and one jumper switch (jumper), two LEDs displaying the installation and operation modes of the timer, as well as sound control is carried out by a piezoceramic emitter (if unnecessary, you can not connect it, controlling the process by blinking LED D2).

One button (according to scheme S1) is “SET” for setting all modes (we will do everything with one button, why do we need a bunch of different knobs and switches?), and the second button (according to scheme S2) is “RESET”, which will allow you to stop the timer at at any moment, bringing it to its initial state and turning off the relay.

Work algorithm

The timer time interval is formed by multiplying two numbers: the first number (multiplicand) is the dialed interval in minutes from 1 to 255, and the second number (multiplier), which, when multiplied by the first number you dialed, will form the specified timer time.

EXAMPLE

Let's say we need to dial 1 hour = 60 minutes, given that the minimum discrete time interval of the timer = 1 minute, we can form this interval in several ways, for example, the first number = 10 minute intervals, we dial the first number while holding the button pressed so that (the LED blinks 10 times , or the buzzer of the piezo emitter “beeped”. Having dialed the required number, release the button, after which the timer will repeat the number you dialed (by flashing the LED and “blinking” the piezo emitter) the dialed number of times, when D2 goes out, after which the second LED D1 begins to blink intermittently. This means that the set of the first number has been accepted, but the installation has not yet been completed, we must continue the installation (at this moment, when D1 is flashing, you can close the contacts of jumper S3 and leave them in the closed position, with this action we will write our settings into the non-volatile memory of the microcontroller EEPROM , which will be stored there until another time interval is recorded instead of the previous one. This is convenient if you need one time interval that you use constantly. While the jumper (jumper S3) is closed, the timer will only output this time interval that you recorded (so as not dial again each time) and will be saved in memory when the device is completely de-energized.

The second number you need to choose is the multiplier (typed after the first). To form an hour, it must then be equal to 6 (10 minutes x 6 = 60 = 1 hour).

The dialing procedure is the same as when setting the first number, by holding the button pressed and counting six flashes in time with the flashing LED D2. After which, release the button, immediately following to confirm that the number has been accepted, the indication D2 will blink and beep again 6 times, then the D1 LED will again begin to flash intermittently. This means that the second number has been accepted and the timer is ready to start.

START

To start the timer, you need to press the “SET” button the next 3rd time, holding it down for about a second, D2 will immediately blink (sound) last time to remind you, the number of intervals you have dialed and then the relay turns on and the indication mode D1 goes from flashing to a constantly lit state until the end of the cycle, D2, after the next dialed interval, will flash and beep with a buzzer.

How many times is there left until the end of the total time interval you have collected? After each (typed in the example) 10 minutes that have passed, the LED will blink as many times as there are 10 minute intervals left out of 6 in descending order (5 times then 4 then 3..2..1 and finish). At the end of the entire one-hour cycle, the relay will turn off the load. LED D1 will go out, and D2 and the buzzer will still remain on for about 8 seconds, indicating that the cycle is complete.

There are a lot of options for setting an hourly interval in the timer. For example, dial, the first number is minute = 1, and the second = 60. Then every minute the LED will blink as many times as there are minutes left until the end, or you can make the first number = 6 minutes, and the second = 10, the rest by analogy with the above examples.

This is such a universal option for different tastes, that’s why it’s called “UNIVERSAL”. In fact, you program the timer yourself at your discretion, with the desired option and display frequency.

If, using a timer, you need to dial different intervals each time, then you do not need to close jumper S3. And if you need a timer for one constant time interval, then it is advisable to enter these parameters once, writing them into the EEPROM memory of the microcontroller, which you will program yourself by doing it this way.

It is necessary to set (close the jumper jumper S3) ONLY during the period after dialing the first or second number, when D1 is flashing (neither earlier nor later), and after that leaving it closed constantly, during further operation, after that, each time the timer starts, pressing the “SET” button will immediately turn on the relay, and the buzzer and D2 will remind you with an indication of how many time periods you have left until the end when the relay turns off.

Details

I tried maximum simplicity, a minimum of details and settings, the result was: a pair of LEDs, a buzzer-piezo emitter, a transistor control relay, a 12-volt relay that will turn on the load, a 7805 stabilizer chip, an ATtiny 13 processor (with any letters of this series), yes and that's all, perhaps.

The circuit will be powered from a 12 V source. I’m running it on a breadboard, everything works perfectly so far. If you want to make the buzzer sound louder, you should add amplifier stage on a transistor, similar to the circuit in the previous article “kitchen timer”.

Microcontroller Programming

ATTENTION!!!
Very important point, I used the smallest clock frequency of the internal oscillator in the microcontroller, which is 128 kHz / 8 = 16 kHz. This is set by fuses during programming (I attach a photo, where you need to check which boxes).

Why did you choose this frequency? Yes, I wanted to))) and rewrite the program for a different clock frequency, then it was a failure. And there’s no reason, everything works. It suits me. It’s up to you to decide whether to repeat this design yourself or not.

So, when using a programmer with ISP mode (such as STK 200, etc.), which are most often used for programming AVR microcontrollers.

Your microcontroller will be programmed with my firmware ONCE!!! It will be possible to reprogram it again only by using parallel high-voltage programming or by returning, overwriting, the factory settings (I warn you in advance!).

You can return the factory settings using a programmer with H/V mode capability. (high voltage programming). I use a programmer with this mode in STK 500. But if you are sure that you will make this timer, then the first time the firmware will be “uploaded” from any programmer, and there will be no problems.

In the future, I plan to post an article with a diagram of the ATtiny13 “reanimator” device, just for such cases. Which will allow you to decide this problem, rewriting the original factory settings into the “locked” microcontroller again without involving programmers with parallel high-voltage programming mode.

FIRMWARE

I'm posting 2 firmwares. Both work, but for different purposes. One for filling in Proteus, (TIMER_PROTEUS.hex). Another (TIMER_UNIVERSAL.hex) for programming a real microcontroller with a programmer. The difference between them is small, there will simply be an error in the accuracy of the timer if you upload the wrong firmware.

I am posting the model in Proteus and the firmware for uploading to the project. Where in real time the device emits the operation of a timer in the same way as it would look in a real device. In Proteus you can clearly see how the first cell with address 0x00 for the first number and address 0x01 for the multiplier number will be programmed into EEPROM.

Perhaps, before you start assembling the device, it’s worth “playing” with a virtual model of this “Universal Timer” in Proteus to understand how this timer works (the sound from the buzzer is also emitted, you can listen to it from the sound card through the speakers).

In the previous article, I wrote that this is the latest development of such a device using seven-segment LED indicators, but it turned out that I was in a hurry. The fact is that this design uses only 40% of the microcontroller’s memory, and there is still one unused pin of the microcontroller port (except for the RESET pin). Therefore, it was decided to correct this injustice in relation to the MK and add another load control channel. After the work has been done, the MK memory is used by 99% and all the MK pins are used. Full name of the modified design:
“A two-channel thermometer, a two-channel thermostat (thermostat) with the ability to operate by time, a single-channel real-time timer on an ATmega8 microcontroller and DS18B20 temperature sensors”

Description and characteristics of a two-channel thermometer, thermostat (thermostat), single-channel real-time timer
on ATmega8 and DS18B20

Since this design “emerged” from the previous one - and is described in detail (all characteristics of thermometers and thermostats, operating modes, response to errors - remained unchanged), I will only focus on the innovation - the real-time timer.

Real time timer

Introduced into the design real time timer, which allows you to manage your third load in real time for 24 hours and allows you to set two time intervals for load control during the day. The timer also allows you to set one time interval for load control during the day for each temperature control (thermal control) channel.
What do I mean by real time timer. Essentially, this is an internal clock with a resolution of 10 minutes. When setting up the device for the first time, the real current time accurate to 10 minutes, and then the timer counts down 24 hour intervals in 10 minute increments like an ordinary clock.

The discreteness of counting time intervals of 10 minutes was adopted for two reasons:
— convenience of displaying information on a three-digit indicator, for example 22 hours 40 minutes — 22.4
- load control with an accuracy of 10 minutes is quite sufficient for most tasks (in reality the accuracy is 5 minutes - if you need to turn on the load at 7 hours 35 minutes, you can set either 7.4 or 7.3)

The introduction of a timer slightly changed the algorithm for working with the device (I will talk about the algorithm of operation below). Now by pressing the “Select” button you can get to two menus:
— menu for setting temperature limits for thermostats and time intervals for thermostat operation, time intervals for load control using a timer
— menu for correcting the clock rate and setting the current time.
Since the MK operates from an internal RC oscillator (8 MHz), which is not stable and depends on both the temperature of the MK and the supply voltage, the clock rate correction function allows you to adjust the clock rate accuracy for specific conditions. And the current time setting function allows you to set the current real time during initial setup or refine it if it differs greatly from real time.
The timer indications are not displayed when the device is operating; you can find out “what time it is” only when you enter the mode for setting the current time.

Timer control of loads is not carried out (disabled) if the on and off times are set to zero. In principle, loads are not controlled by a timer if the on and off times are equal.

When you enter the clock correction menu and set the current time, the timer stops. Therefore, when correcting the clock rate, it is necessary to set the current time before exiting the menu.

Scheme of a three-channel thermometer, thermostat, timer on ATmega8

The device circuit was created in the program and, in principle, does not differ from the circuit of a two-channel thermostat (a third load control channel was added and, for variety, the load control circuits were changed):


Since the circuit uses “output” parts, for the convenience of placing the structure in a suitable housing, the circuit is divided into two parts:
— Display block — indicators and buttons
— Control unit — everything else
It would be necessary to include LEDs in the display block that signal that the channels are on, but this can be done independently when laying out the board (add three pairs of contact pads for the LEDs and connect them to the wire control unit).

Device design

Device base- ATmega8 microcontroller with a clock frequency of 8 MHz from a built-in oscillator with an internal RC circuit.
To adjust the frequency of the internal oscillator, when programming the MK, it is necessary to write the value of the calibration cell for a clock frequency of 8 MHz into the EEPROM memory at address zero. The default HEX file of the EEPROM memory below contains the number $В1 (В1) - the average value of the calibration cells of 5 tested microcontrollers.
In addition, for proper operation real-time timer, and it works by interruptions from the timer/counter T1 when the counting register and the OCR1A comparison register are equal; when programming the EEPROM memory, following the value of the calibration cell, the number 33050 (1A81) is written, which is programmed into the OCR1A comparison register. When the timer progress is corrected, the value of this number also changes.

Indication current temperatures and values ​​in the installation mode are displayed on two three-digit seven-segment indicators with a “common cathode” switching circuit.

Sensors DS18B20 are connected to the device via 3-pin pin strips DS1 and DS2, the numbering of the pins of which corresponds to the numbering of the sensor pins.

Bit management carried out by low-power bipolar transistors NPN type.

Entering the menu, setting values, the launch of single heating (cooling) modes is carried out by three DTS-type tact buttons:
— S1 — “Selection”
— S2 — » + »
— S3 — » — »


— for temperature control channels — through optosimistors MOS3063 and triacs VT139-800E according to the standard switching circuit, which allows you to control loads with a power of up to 3.5 kW (if the load power is more than 300-400 W, triacs must be installed on radiators)
- for the channel from the timer - through a miniature mechanical relay with a coil supply voltage of 5 Volts, which allows, depending on the relay used, to control a load of up to 2 - 2.5 kW

I draw your attention to the connection mains voltage 220 volts to the device and turning on the load - it must be connected as in the diagram, taking into account the “phase” and “zero” of the mains voltage.

Device power carried out from any source direct current voltage 7-25 Volts. The circuit can also be powered from unnecessary charger from cell phone with an output voltage of 5 +-0.5 Volts. In this case, it is possible to exclude the 7805 stabilizer and capacitors C4, C5 from the circuit. The average current consumption of the device is 40 milliamps.

If you need to organize backup power (for uninterrupted operation of the timer), you can use, for example, the following scheme:

Details used in the design:

Control of a three-channel thermometer, thermostat, thermostat, timer

1. Enter the menu

The device has two menus.
When you “shortly” press the “Select” button, the inscription “ON—-OFF” is displayed on the indicators, we enter the menu:
— setting temperature limits for thermostat operation and time intervals for thermostat operation, time intervals for load control using a timer
When you “long” press the “Select” button, the inscription “ON—-OFF” is replaced by the inscription “Cor—-USt”; you must release the button and enter the menu:
— correction of the clock rate and setting the current time

Please note that when entering the menu (long or short press of the “Select” button), all load control channels are disabled.

2. Menu “Corrections of progress and setting the current time” (long press the “Select” button)

After entering the menu, we immediately find ourselves in the clock correction mode:
"Cor—-00"
By pressing the “Select” button again, we switch to the mode for setting the current time:
"USt—-00.0"
In the current time setting mode, we look at our most accurate watch and use the “+” and “-” buttons to set the nearest time with an accuracy of 10 minutes.
For example, the current time is 20 hours 37 minutes, set the indicator to “20.4” (20 hours 40 minutes) and exactly at 20.40, by pressing the “Select” button we exit the menu. That's it, the real time is set, the clock is started.
You can adjust the clock rate from +50 units to -50 units. The initial value is “00” (“00” always appears when entering this mode)
Changing the setting by one increases the clock rate (+1) or decreases (-1) by approximately 4 seconds per 24 hours.
The accuracy of the clock can be checked on the load control channel using a timer without a connected load by lighting the LED.
For example, at 21.00 we set the current time, set the load to turn on at 8.50, and turn off at 9.00. In the morning we measured the load switch-off time. Let's say the load turned off at 8 hours 59 minutes 20 seconds. This means the timer is 40 seconds behind in 12 hours. In 24 hours the lag will be 80 seconds. Divide 80 seconds by 4 = 20. In the correction mode, set the reading to 20, then go to the current time setting mode, set the nearest current time, for example 9.1, and at 9 hours 10 minutes, by pressing the “Select” button, we exit to the operating mode.

Please note that in the absence of a backup power source, in the event of a “loss” of mains voltage, the clock is reset to zero and the current time must be set again.

3. Menu for setting temperature and time intervals for thermostats

Let me remind you of the operating modes of the thermostatting (thermal control) channels:
— thermostatting mode — maintaining a certain temperature
— thermal control mode — maintaining the temperature within certain limits
— single heating (cooling) mode
All these modes are described in detail in the article, where detailed instructions and the capabilities of each mode.
With the introduction of a real-time timer into the design, it became possible for each channel to set one time interval for the channel to operate during the day. To do this, additional lines for turning on and off channels have been added to the menu.
For example, we need the 1st temperature control channel to work only at night from 23.00 to 6.30. To do this, in the 1st menu (short press the “Select” button):
— after setting the upper and lower temperature limits, two more lines will appear: “t.On——00.0” and “t.OF——00.0” (the same will happen for the second channel)
— use the “+” and “-” buttons to set: “t.On——23.0” and “t.OF——06.3”
Now, at 23.00 the 1st channel will start working in the specified mode, and at 6.30 the channel will be turned off, and so on every day.
Single heating/cooling mode. If the time interval is not selected (the on/off time is set to “0”), then these modes are launched manually by pressing the corresponding button. This mode can also work over time.
Let’s say we need to heat the water in the tank to 45 degrees on the 2nd temperature control channel in the morning, by 7.00, taking into account that the water in the tank heats up to this temperature in 25 minutes:
— set “2.On——00” and “2.OF——45”
— set “t.On——06.3” and “t.OF” leave the default “t.OF——00.0”
Now, channel 2 will automatically start at 6.30 minutes, and when the water temperature reaches 45 degrees it will turn off.
When using the single heating/cooling mode together with a timer, it is still possible to manually start the mode, but it should be taken into account that during the time period “t.OF—-t.On” (for the previous example - from 24.00 to 6.30) manual mode is not possible . Therefore, in order to start the mode manually at any time, it is necessary to set “t.OF” 10 minutes less than “t.On”.

4. Menu for setting time intervals for the timer

Real time timer allows you to set two time intervals during the day to control the load using a timer.
To do this, four additional lines have been added to the menu:
— t1.1 — switching time for the first time interval
— t1.0 — shutdown time for the first time interval
— t2.1 — switching time for the second time interval
— t2.0 — shutdown time for the second time interval
Time intervals must not overlap.
Let's say we need to turn on the lighting in the yard twice a day: from 21.00 to 0.30 and from 5.30 to 7.00
Install:
— t1.1 — 21.0
— t1.0 — 00.3
— t2.1 — 05.3
— t2.0 — 07.0
Now the timer load will be turned on at 21.00 and 5.30, and turned off at 0.30 and 7.00

Second PCB option:

Option to set FUSE bits:

(22.2 KiB, 2,016 hits)

The electronic timer is designed for programmatic control of household appliances, lighting and other devices. The timer can be used for aquarium and other equipment. Using a timer will save energy without reducing the level of comfort.

Option 1

This device includes three timers. Timer 1.1 and timer 1.2 each allow you to set the time for turning on and off the load that is connected to the KV1 relay. Timer 2.1 and timer 2.2 also allow you to set the time to turn on and off the load, which is connected to the common relay KV2. Timer 3 is a reverse timer that controls the load via KV3.

This device uses a PIC16F628A microcontroller. Elements C1, C2, ZQ1 are external frequency-setting elements of the internal clock generator. To display information, the HG1 indicator with the KS0066 controller is used. The indicator can display two lines of sixteen characters each. Adjustment resistor R4 can be used to adjust the image contrast. Using SB1-SB5, you can control operating and display modes, as well as set the timer. Through pins 1,17,18 of the microcontroller, transistors VT1-VT3 and then relays KV1-KV3 are controlled, which turn on or off the load. When using a relay with a coil current of more than 100 mA, the KT315V transistors should be replaced with transistors with a maximum permissible collector current, which are greater than the relay coil current.

Current time display mode.




Timer display mode 1.1.

If the on time is set equal to the off time, it is considered not used.

The purpose of the keys and their controls are the same as in the current time mode.

Timers 1.2, 2.1 and 2.2 are similar in indication and control to timer 1.1.

Timer 3 display mode

Timer 3 is a countdown timer.

To enter the timer 3 setting mode, you must press and hold the SB5 button until a flashing cursor appears. In the setting mode, the cursor is moved using the SB3 and SB4 buttons, and the values ​​are changed using the SB1 and SB2 buttons. When counting down time, you can stop timer 3 by pressing SB5. After pressing SB5 again, the timer will continue counting and when its value is zero, the load will turn off.

Switching between display modes is carried out using the SB1 and SB2 buttons.

Microcontroller configuration bits.

Option 2

Current time display mode

Purpose of control keys in this mode:
SB5 - enter/exit current time setting mode.
SB3, SB4 – move the cursor left or right during setup.
SB1, SB2 – decrease or increase time values ​​when setting.

Timer display mode


List of radioelements

Designation Type Denomination Quantity NoteShopMy notepad
DD1 MK PIC 8-bit

PIC16F628A

1 To notepad
HG1 LCD 16x2BC1602B21 To notepad
ZQ1 Quartz resonator4 MHz1 To notepad
VD1-VD3 Diode

KD105B

3 To notepad
VT1-VT3 Bipolar transistor

KT315V

3 To notepad
C1, C2 Capacitor15...30 pF2 To notepad
R1, R3, R5 Resistor

1 kOhm

3 To notepad
R2, R6 Resistor


If you find an error, please select a piece of text and press Ctrl+Enter.