» Electronics »Timer on the atmega8 microcontroller

Timer on the microcontroller atmega8


I want to offer the masters for consideration and possible repetition, a very simple scheme, a very good timer. With convenient menu navigation, with a liquid crystal LCD display, with a real-time clock, with the smallest possible number of parts, and with all this, you can program as many as one hundred time intervals during the day.

Compact size


Timer Check Video


The heart of this timer is the very popular and no longer expensive Atmega8 microcontroller. You can say that for the firmware we need a programmer which is not, but this is not so, for Atmega firmware it’s enough just five short 10-15 cm. Of wires connected through 150-200 Ohm resistors. directly to the LPT port according to this scheme.
Timer on the microcontroller atmega8

For this reason, these microcontrollers have become the most popular with ham enthusiasts.

In this figure you see: The pinout diagram of the MK legs for connection and firmware.


Point 1. We will prepare everything necessary for the manufacture of a timer.

The most mandatory radio components of the circuit, the rest can usually be found at home, the smallest microcircuit is the DS1307.


We will need such radio elements:

• Integrated watch DS1307
• LCD liquid crystal display
• Stabilizer 7805
• 500-1000 MF - 16 volts.
• Relay or electronic key (depending on the load that you plan to connect).
• resistance 5,1kom - 3 pcs., Variable resistor (according to LCD display manual).
• Quartz time 32768 Hz.
• Buttons without fixing - 4 pcs.
• 3 volt tablet battery.
• Textolite for the board.
• Small transformer ~ 220v. -> ~ 6-12v.
• Unpacking box for the housing.
+ For the programmer: resistors 150-200 Ohms. - 4 pcs., LPT port connector (for convenience, not required).

Required tools for each amateur radio:
• Soldering iron for soldering microcircuits, soldering iron for soldering passive radio components and wires.
• Tester for ringing tracks and checking radio components.
• Tin, rosin.
+ Laser printer (for making a circuit board or other method).

Point 2. Let's start manufacturing.

We will do the timer according to this main scheme.

As you can see, there is no diagram of the power supply unit and the output executive device, this is because maybe you decide to use a remote stabilized power supply, and it is also not known what load you plan to connect, therefore, everyone should choose the executive device for their own technical requirements.

Personally, I used my BP timer and actuator on a transistor and relay.

But you may want to use triacs, thyristors and triacs as an actuator; options for such circuitry are shown below.


They are more compact (without a radiator), but less powerful than a simple relay.

In accordance with the main circuit diagram + PSU + IU and analysis of the mounting dimensions of your box for the case, as well as the dimensions of the selected radio elements, we design the shape, size and pattern of the tracks on the board. For this, it is convenient to use the Sprint Layout program.

For my device, I got such a simple board.

The resulting pattern can be transferred using a special marker or using the LUT technology (using a laser printer and iron) on a copper layer of textolite. If you have a Brother laser printer (like mine), then it is better to abandon the idea with LUT right away, because of the refractory toner ~ 400C used in it instead of the usual ~ 200С, by the way, I used to stupidly buy this printer specifically for LUT :(. , therefore, as a result, my board is drawn with a marker.
The pattern applied to copper is etched in a bath with ferric chloride or any other special solution.

We solder the parts to the finished board according to the scheme, we pay special attention to when mounting and soldering the microcircuit of the clock and the quartz element. The length of the tracks between them should be minimal, but it is better to use micro quartz from a watch and solder it directly to the legs of the MC watch. We fill all the free space next to the MS of the watch and quartz with the body pads (GND). A battery is needed to maintain the watch in working condition while disconnecting from the mains. If for some reason you did not install this battery, then put the plus wire on the case, otherwise the watch just won’t work.

We flash the microcontroller with the programmer or with the help of 5 wires.

*Firmware* multitimer100.rar [5.35 Kb] (downloads: 1466)

The author of the firmware is especially for convenience (for which I thank him) and did not change the factory fuses, which greatly facilitates, without troubles, the firmware for a beginner radio amateur. If MK has not been used yet, a new one from the store, then just fill in the firmware and that's it, but if there are already changes in the fuses, you need to set them like CKSEL = 0001. Everything else is simple and needs no explanation.

Item 3. Assembly.

For the case, it is very convenient to use plastic junction boxes, they come in different sizes and shapes.


We fix the LCD screen into the cover cut by the knife with the help of hot glue from the gun.


Cut the protruding glue.

We place all the nodes inside the case, constantly checking how the lid closes, if necessary we transfer or bend the interfering ones. Everything is fixed on hot glue.



We supply power to the assembled circuit, such an image should appear, the clock starts from zero.

The menu is controlled by four buttons.

The menu consists of three items, CLOCK - setting the clock, TIME - setting timers and RESET - resetting all set timers.

First we go (*) to the clock menu and set the exact time.

Hint for the control buttons in the bottom line of the display, each menu is different, so there is no need to describe the buttons.

Now everything is ready to correctly set the temporary timer entries, after pressing the trellis, the program is written to the permanent memory of the MK.

In the video at the beginning of the article you can see more about the menu.

I use this timer to water hydroponics.
6.3
6.5
3.8

Add a comment

    • smilesmilesxaxaokdontknowyahoonea
      bossscratchfoolyesyes-yesaggressivesecret
      sorrydancedance2dance3pardonhelpdrinks
      stopfriendsgoodgoodgoodwhistleswoontongue
      smokeclappingcraydeclarederisivedon-t_mentiondownload
      heatirefullaugh1mdameetingmoskingnegative
      not_ipopcornpunishreadscarescaressearch
      tauntthank_youthisto_clueumnikacuteagree
      badbeeeblack_eyeblum3blushboastboredom
      censoredpleasantrysecret2threatenvictoryyusun_bespectacled
      shokrespektlolprevedwelcomekrutoyya_za
      ya_dobryihelperne_huliganne_othodifludbanclose
6 comments
Repeated this timer, everything functions perfectly. The only thing I’ll supplement is, if you are sewing a “pony-prog” controller, then open the firmware file via the “open device file” only in this case the firmware will be written as it should. If you open the firmware via the "open program memory flash", there will be rectangles on the screen. This is a trifle, but it can confuse even an experienced one :) All success in creativity.
Hello. Great project. Can I add days of the week to the firmware to program every day of the week. Thank you
And so I won the cause of the rattling of button contacts. Not programmatically, since there is no source.
The reason was the nutrition of this design. I used a small-sized Chinese switching power supply on 12V, and it very much gives interference and they are the reason for the poor operation of the buttons.
I made a power supply unit according to an analog circuit on a simple transformer of the "myrra" type 12V 1.5VA. There are such transformers small-sized for printed circuit boards.
The result, the design nevertheless went into action, and my perseverance and patience was rewarded.
Once again, Thanks to the author and this site! drinks
I would very much like to put a signet on this page in the Lay of this timer, but not how. Since there is no such option.
Write .... I will share, I do not mind.
I did not get the problem with the buttons fixed. And shunted capacitors 100n and stuff, everything is useless.
Put the design on the shelf. And it’s a pity to disassemble and I’m sorry for my work, and I killed time.
The author of this design is silent as a fish on ice.
Thanks for the great device! The only device that fit in all respects.
The only future who will collect.
When assembling this design, it was difficult to launch the watch on the DS1307 (SOIC8). The clock did not want to start at any time. It was decided that the 4.7k suspenders were replaced by 10k.
The only one I have not yet solved the problem with the bounce of contacts.
When entering the menu, clicks "fly over" randomly.
Can I put the LCD indicator WH2002A?

We advise you to read:

Hand it for the smartphone ...