Do-it-yourself
http://www.EFymag.com ElEctronics For you | July 2017 123
Fig. 3: Actual-size PCB layout of the countdown timer
Fig. 4: Components layout for the PCB
Parts List
Semiconductors:
IC1 - ATmega8A microcontroller
T1, T2 - BC547 npn transistor
LED1 - 5mm LED
D1 - 1N4007 rectifier diode
Resistors (all 1/4-watt, ±5% carbon):
R1-R7 - 10-kilo-ohm
R8, R9, R15 - 1-kilo-ohm
R10, R12 - 3.3-kilo-ohm
R11, R13 - 4.7-kilo-ohm
R14 - 1.5-kilo-ohm
Capacitors:
C1, C4, C5 - 0.1μF ceramic disk
C2, C3 - 22pF ceramic disk
Miscellaneous:
CON1, CON2,
CON5, CON6 - 2-pin terminal connector
CON3 - 2-pin berg strip male connector
CON4 - 6-pin berg strip male connector
XTAL1 - 3.6864MHz crystal oscillator
PZ1 - Piezobuzzer
S1-S7 - Tactile switch
LCD1 - 16×2 LCD module
RL1 - 12V, 1C/O relay
- 5V DC regulated power supply
SJ1 - Shorting jumper - 12V DC regulated power supply
- 28-pin IC socket
the input switches (S3 through
S6) are enabled for countdown
timer settings.
When start switch (S2) is
pressed, relay RL1 energises and the
countdown starts. The timer stops
automatically when the countdown
reaches 000 or stop button (S1) is
pressed. The status of countdown is
shown on LCD1. A beep is gener-
ated by the piezobuzzer when
the countdown reaches below ten
seconds and stops when the count-
down reaches 000. Jumper J1 can
be disconnected if the buzzer is not
required. The power supply to relay
RL1 depends on the coil voltage
of the relay (like 5V, 6V or 12V).
Here, we used 12V DC at CON1 for
the relay.
In stopped or setting mode, LED1
blinks every ten seconds. When start
(S2) button is pressed, LED1 blinks
every second.
Software
The software is written in ‘C’ lan-
guage and compiled using an AVR
Studio 4 software. You can use any
suitable software to burn the hex code
into the microcontroller through ISP
port. At EFY Lab, we used ProgISP
programmer for the purpose.
Before programming, set fuse bits
for the 3.6864MHz crystal option as
shown in Fig. 2.
Construction and testing
An actual-size, PCB layout for the
countdown timer is shown in Fig. 3
and its components layout in Fig. 4.
After assembling the circuit, enclose it
in a suitable box.
Insert the programmed MCU in
the IC socket on the PCB. Connect
an electrical load (say, 100W bulb)
across CON6, and 230V AC mains
across CON5.
Now, power on the circuit by
connecting a 5V DC supply at CON2.
LED1 will glow and the buzzer will
sound for about one second, followed
by display of ‘countdown timer’ mes-
sage on LCD. The system is now ready
to use, waiting for the user input.
The source code of
this project is
included in this
month’s EFY DVD and
is also available for free
download at source.
efymag.com
efy Note
Fayaz Hassan is a manager
at Visakhapatnam Steel
Plant, Andhra Pradesh. His
interests include MCU projects,
mechatronics and robotics