Professional Documents
Culture Documents
ElectronicProjectsVol26 PDF
ElectronicProjectsVol26 PDF
Electronics
Projects VOLume
26
A Compilation of 21 tested Electronic Construction Projects and 71 Circuit Ideas for Electronics Professionals and Enthusiasts
216 Pages
6 Microcontroller-Based Projects
6 Microcontroller-Based Projects
Electronics Projects
Vol. 26
EFY Enterprises Pvt Ltd
First Published in this Edition, November 2013
ISBN 978-81-88152-26-1
The Group also publishes directories and books, and organises several
leading technology events. Its web-portals, which include electronicsforu.
com, efytimes.com, eleb2b.com, linuxforu.com, electronicsb2b.com,
investinelectronics.in and electronicsofthings.com have become leaders
in their respective categories. The EFY Expo India, EFY Awards, Open
Source India, Electronics Rocks and ELCINA-EFY Awards are some of
the annual events organised by the group.
Foreword
This volume of Electronics Projects is the twenty sixth in the series
published by EFY Enterprises Pvt Ltd. It is a compilation of 21 con-
struction projects and 71 circuit ideas published in Electronics For You
magazine during 2005.
I
Semiconductors:
n most applications, a microcon- hex file code can be burnt into the IC1 - 7805, 5V regulator
troller can satisfy all the system microcontroller using any commonly IC2 - AT89S8252 microcontroller
IC3 - 74LS244 octal line driver
requirements with no additional available programmer or kit. IC4 - ULN2803 octal transistor
integrated circuits. Due to their low IC AT89S8252 is a low-power, array
cost and a high degree of flexibility, high-performance CMOS 8-bit micro- DIS1-DIS6 - LTS543 commoncathode
7-segment display
microcontrollers are finding way into controller. It is manufactured using LED1 - Red LED
many applications that were previ- Atmels high-density non-volatile
Resistors (all -watt, 5% carbon):
ously accomplished by mechanical memory technology and is compatible R1 - 1-kilo-ohm
means or combinational logic. One with the industry-standard 80C51 in- R2 - 10-kilo-ohm
such application is a real-time clock. struction set and pin-out. The powerful R3-R11 - 100-ohm
Heres a real-time clock using At- AT89S8252 microcontroller provides a Capacitors:
C1 - 100F, 25V electrolytic
mel AT89S8252. The software for the highly flexible and cost-effective solu- C2 - 0.1F ceramic
microcontroller is written in Bascom51 tion to many embedded control appli- C3, C4 - 22pF ceramic
cations. Its main features are: C5 - 10F, 10V electrolytic
1. Compatibility with MCS-51 Miscellaneous:
products XTAL - 6MHz crystal
S1-S6 - Push-to-on switch
2. 8kB in-system reprogrammable
downloadable Flash memory with SPI
serial interface for program download- channel
ing and 12. SPI serial interface
3. 2kB EEPROM with endurance of 13. Low-power idle and power-
100,000 write/erase cycles down modes
4. 4V6V operating range 14. Interrupt recovery from power-
5. Fully static operation: 0 Hz to down
24 Mhz 15. Programmable watchdog timer
6. Three-level program memory 16. Dual data pointer
lock 17. Power-off flag
7. 2568-bit internal RAM Fig. 1 shows the pin assignments of
8. 32 programmable I/O lines AT89S8252.
9. Three 16-bit timer/counters Fig. 2 shows the block diagram of
Fig. 1: Pin assignments of AT89S8252 10. Nine interrupt sources the real-time clock using AT89S8252
11. Programmable UART serial microcontroller and a few exter-
nal components to
display the time in
HH.MM.SS format
on six 7-segment dis-
plays. Switches S2, S3,
S4 and S5 are used for
hour increment, hour
decrement, minute
increment and minute
decrement, respec-
tively, while switch
S6 is used for reset-
ting the clock display
Fig. 2: Block diagram of real-time clock using AT89S8252 microcontroller to all zeroes.
Ciruit discription
Fig. 3 shows the circuit of the real-time
clock built around AT89S8252 micro-
controller (IC2). The power supply
from the 9V battery is down converted
and regulated by IC 7805 (IC1) to pro-
vide regulated 5V to the circuit. Glow-
ing of LED1 indicates that power to the
circuit is switched on. Resistor R1 acts
as the current limiter.
Switch S1 is used to manually
reset the microcontroller, while the
power-on reset signal for the mi-
crocontroller is derived from the
combination of capacitor C5 and
resistor R2. EA/Vpp pin (pin 31) of
the microcontroller is connected to
Vcc to enable internal program ex-
ecution. Pins 19 and 18 are input and
output pins of the built-in inverting
amplifier, respectively, which can
be configured for use as an on-chip
oscillator. A 6MHz crystal is used to
generate the clock frequency for the
microcontroller.
AT89S8252 has four bidirectional
8-bit ports, of which only three ports
Fig. 3: Circuit of the real-time clock built around AT89S8252 microcontroller
Software
The software for the real-time clock
is written in Bascom51 version. Those
who have knowledge of Basic, Basic-A,
GW-Basic or QBasic language (used to
run on the good old 286 and 386 PCs
with DOS 2.x to 6.2) can understand
the program easily. The demo version
of Bascom-8051 is available on Website
www.mcselec.com/ download_8051.
Fig. 5: Component layout for the PCB htm.
Fig. 6 shows the flow-chart of
line driver IC 74LS244 (IC3). pins of IC3 via resistors R5 through the program. Step-wise explanation
Segments a through g of 7-seg- R11, respectively. IC3 acts as an octal of how the program works is given
ment displays DIS1 through DIS6 are buffer between the microcontroller below:
joined and connected to the output and the displays to increase the cur- 1. Define the port pins and where
EFYclk11.bas
-------------------------------------------------------------- dp= p0.7 As Byte
EFYclk.bas 18-10-04 Dim Red As Byte , Green As Byte
REAL TIME CLOCK DISPLAY ON six 7-SEG Dim Count As Byte , X As Byte , Segment As Byte
DISPLAYS 88 88 88 Dim Number As Byte , Digit_select As Byte
BY k.s.sankar www.mostek.biz for EFY hh mm ss port-2 (green) p2.0 /1 : 2/3 : 4/5 Dim Del As Byte , Diagdelay As Byte
written using BASCOM-51 from MSC electron- 12 34 56 digit number Dim Large As Word
ics Netherlands
-------------------------------------------------------------- yellow port-1 set switches Del = 1
P1.0=H+ P1.1=H- delay variable in milliseconds
P1.2=M+ P1.3=M- all ports 0
Connect common cathode LED displays as P1.4= 00 00 00 ( reset to 00 00 00) P0 = 0
following : red
port-0 (red) -------------------------------------------------------------- P1 = 255
a = P0.0 $regfile = 89s8252.dat yellow all high for sw inputs
b = P0.1 $crystal = 6000000 P2 = 0
c = P0.2 6 mhz crstal green
d = P0.3 P3 = 0
e = P0.4 Dim Once_a_sec As Bit blue not used
f = P0.5 Dim Clock_word As Word
g = P0.6 Dim Hours As Byte , Minutes As Byte , Seconds Config Debounce = 30
M
IC1 - AT90S8515 AVR micro-
icrocontrollers are being EEPROM. The stored message can be controller
extensively used in many displayed on the dot-matrix display IC2-IC6 - ULN2803A Darlington
array LED driver
industrial and household just by clicking the scud button on the IC7 - MAX232 RS-232 serial
applications. Here, weve used an terminal program while it is connected interface
AVR microcontroller (AT90S8515) to the PC. T1-T7 - SK100B pnp transistor
from Atmel Corp. for controlling four 5. Any message entered from the Resistors (all -watt, 5% carbon):
R1 - 220-ohm
5x7 dot-matrix displays. The micro- PCs keyboard gets stored in the EE- R2-R8 - 1-kilo-ohm
controller is based on true reduced PROM of the AVR and can be scrolled R9-R15 - 220-ohm
instruction set computer (RISC) ar- at any time without the use of a PC, i.e. R16 - 620-ohm
chitecture. Any message entered by you just need to switch on the embed- Capacitors:
C1 - 100F, 16V electrolytic
the user through the keyboard of a PC ded system.
capacitor
C2, C3 - 22pF ceramic capacitor
C4 - 0.1F ceramic capacitor
C5-C9 - 1F, 16V electrolytic
capacitor
Miscellaneous:
XTAL - 8MHz crystal
DIS1-DIS4 - 57 dot-matrix (column
common cathode) display
LED1 - Red power indicator
S1 - SPST on/off switch
S2, S3 - Tactile switch
Circuit description
Fig. 1: Block diagram of standalone scrolling display using AT90S8515 AVR Fig. 2 shows the circuit of AVR
AT90S8515-based scrolling display
scrolls elegantly through the displays 6. RXD and TXD pins of the mi- system.
even after disconnection of the circuit crocontroller are used to communi- AT90S8515 AVR microcontroller.
from the PC. cate with the PC through MAX-232 AT90S8515 is a 40-pin, 8-bit microcon-
This display can be used in public IC and TX and RX pins of COM port. troller from Atmel. It has 512 bytes of
places such as railway stations and All the four ports (ports A, B, C and SRAM, 512 bytes of EEPROM and 8kB
restaurants to convey messages to D) of the AVR are programmed as Flash with 32 programmable input/
the public. The microcontroller is in- output ports. output (I/O) lines. AVR microcon-
terfaced to the PC keyboard through Fig. 1 shows the block diagram trollers are in-system programmable
its serial port. The embedded system of the AT90S8515-based standalone through RS-232C serial port (COM
software is written in C. scrolling display system. It consists of port) of the PC. The programmable
The circuit has the following fea- an AVR microcontroller, row display Flash memory and EEPROM of the
tures: drivers, column display drivers, four AVR can be programmed using a
1. It accepts any message entered 5x7 dot-matrix displays and power simple software and just four wires
through the keyboard of the PC for supply section. The AVR compiler, in- from parallel port of the PC to your
display. system programmer (ISP) and terminal target board containing AVR. Easy
2. User interface is provided program are installed in the computer. in-circuit programmability combined
through the PCs RS-232 serial port The display control program, written with Flash memory makes it easy to
(COM port). in C using AVR C compiler, is loaded update the code during development.
3. The circuit derives power from into the microcontroller by using paral- Since we require a minimum of 27
230V AC mains, which is converted lelport pins of the PC. output pins (20 columns and 7 rows),
Construction
The circuit can be constructed on any
general-purpose PCB. A 3-core serial ca-
ble is used for communication with the
PCs keyboard. The 9-pin male connec-
tor is soldered on the PCB to interface
with the cable. 5V DC regulated power
supply is required for the circuit as well
as programming the circuit, which can
be constructed on a separate PCB.
An actual-size, solder-side com-
bined PCB layout for the display
and interface circuits (Figs 2 and 3)
is shown in Fig. 7 and its component
layout in Fig. 8.
Testing procedure
After having mounted all the compo-
nents, except AVR on the PCB, you
have to perform the initial test (option-
al) to check the connections of the 5x7
dot-matrix displays. The check.c pro-
gram given below can be programmed
into the AVR for this checking. The
various steps involved are:
1. Download the AvrEdit3.5
Fig. 8: Component layout for the PCB software and Atmel AVR ISP and
scrolld.c
// Code for AVR PROJECT of Scrolling Dis- j++; int x = (curr_col<5)? curr_col: curr_col%5 ;
play if ( curr_col==20) if( (x!=0&&(x+offset)%5==0) ||(offset==0 && (
#include <eeprom.h> { curr_col==5 || curr_col==10 ||curr_col==15 ||
// Offset b/w 0 and 4 curr_col=0; curr_col==20)))
#include <io.h> if( offset ==0) i++;//char shift
#include <progmem.h> { if(i==count ) i=0;
#include<interrupt.h> if( i>=3) i=i-3; }
#include<sig-avr.h> else i=i+count-3; if(i==count)//added now
#include<ina90.h> //offset++; i=0;
//offset is the beginnig pointer } TCNT0 = 230;
// global varables else }
int curr_col,i=0,j=0,offset=0,temp=0,q=1; if(offset==4 && j== 2000)
unsigned char str[100], str1[100]; {i=temp+1; typedef unsigned char u08;
int count=0, address,x,x1 ; temp=i; u08 __attribute__ ((progmem)) leds[]={
void EEWRITE( int address,char value); } 0xe0, 0xd7, 0xb7, 0xd7, 0xe0,
void EEREAD( int address,char *val); else 0x80, 0xb6, 0xb6, 0xb6, 0xc9, //b
void setcol(int col); { i--; 0xc1, 0xbe ,0xbe, 0xbe, 0xdd, //c
SIGNAL(SIG_OUTPUT_COMPARE1A) k = 20 - offset; 0x80, 0xbe ,0xbe, 0xbe, 0xc1, //d
{q=0;} while( k>=5){ k=k-5; i--; if(i<0) i=i+count; } 0x80, 0xb6, 0xb6, 0xb6, 0xbe, //e
SIGNAL(SIG_OVERFLOW0) } 0x80, 0xb7, 0xb7, 0xb7, 0xbf, //f
{ } 0xc1, 0xbe, 0xba, 0xba, 0xd9, //g
int k; 0x80, 0xf7, 0xf7, 0xf7, 0x80, //h
setcol(-1); else 0xbe, 0xbe, 0x80, 0xbe, 0xbe, //i
curr_col++; {
check.c
// Program for checking Dot matrix Display // DDRA=0xFF; PORTD=0XFF;
#include<io.h> DDRB=0xFF; PORTC=0X00;
#include<sig-avr.h> DDRC=0XFF; for(; ;)
#include<ina90.h> DDRD=0xFF; {
int main(void) PORTA=0XFF; }
{ PORTB=0XFF; }
T
Semiconductors:
IC1 - AT89C51 microcontroller
hese days most audio systems 6. Settings displayed on two 7-seg- IC2, IC3 - CD4543 7-segment decoder/
come with remote controllers. ment light-emitting diode (LED) dis- driver
IC4 - TDA7439 audio processor
However, no such facility is plays and eight individual LEDs IC5 - MC24C02 I2C EEPROM
IC6 - KA2281 2-channel level
provided for normal audio amplifiers. 7. Stereo VU level indication on 10- meter driver
Such audio controllers are not available LED bar display IC7 - TSOP1238 IR receiver
module
even in kit form. This article presents 8. Full-function keys on-board for IC8 - 7809 9V regulator
IC9 - 7805 5V regulator
an infrared (IR) remote-controlled audio amplifier control IC10 - LM317 variable regulator
digital audio processor. It is based on a 9. All settings stored on the EE- T1 - BC558 pnp transistor
T2, T3, T5 - BC547 npn transistor
microcontroller and can be used with PROM T4 - BD139 pnp transistor
BR1 - W04M bridge rectifier
any NEC-compatible full-function IR 10. Standby mode for amplifier D1-D6 - 1N4004 rectifier diode
remote control. power control DIS1, DIS2 - LTS543 7-segment display
DIS3 - 10-LED bargraph display
This audio processor has enhanced LED1-LED8 - Red LED
features and can be easily customised Circuit description LED9 - Green LED
Resistors (all -watt, 5% carbon):
to meet individual requirements as it Fig. 1 shows the block diagram of R1 - 8.2-kilo-ohm
is programmable. Its main features are: the remote-controlled digital audio R2-R24,
R40-R49 - 1-kilo-ohm
1. Full remote control using any processor. The system comprises At- R25, R28,
R50, R53 - 10-kilo-ohm
NEC-compatible IR remote control mels AT89C51 microcontroller (IC1), R26, R29,
handset TDA7439 audio processor from SGS- R30, R34 - 2.7-kilo-ohm
R27 - 100-ohm
2. Provision for four stereo input Thomson (IC4) and I2C bus compat- R31, R35 - 5.6-kilo-ohm
R32, R33 - 4.7-kilo-ohm
channels and one stereo output ible MC24C02 EEPROM (IC5). The R36-R39 - 22-kilo-ohm
3. Individual gain control for each microcontroller chip is programmed R51 - 220-kilo-ohm
R52 - 2.2-kilo-ohm
input channel to handle different to control all the digital processes of Capacitors:
sources the system. The audio processor con- C1, C2 - 33pF ceramic disk
C3, C10 - 10F, 16V electrolytic
4. Bass, midrange, treble, mute and trols all the audio amplifier functions C4-C6,
attenuation control and is compatible with I2C bus. All the C39-C41 - 100nF ceramic disk
C7 - 4.7F, 16V electrolytic
5. 80-step control for volume and commands from the remote control are C8, C9 - 2.2F, 16V electrolytic
C11, C20 - 5.6nF polyester
received through the C12, C19 - 18nF polyester
IR sensor. The audio C13, C18 - 22nF polyester
C14, C17 - 100nF polyester
amplifier can also be C21-C28 - 0.47F polyester
C29-C32 - 4.7F, 25V electrolytic
controlled using the C33, C34 - 10F, 25V electrolytic
on-board keys. C35 - 1000F, 25V electrolytic
C36 - 4700F, 25V electrolytic
Microcontroller. C37, C38 - 0.33F ceramic disk
C42 - 470F, 25V electrolytic
The function of the
Miscellaneous:
microcontroller is to X1 - 230V AC primary to 12V, 1A
receive commands secondary transformer
RL1 - 9V, 160, 2 C/O relay
(through port P3.2) Xtal - 12MHz crystal
S1- S7 - Push-to-on switch
from the remote S8 - On/Off switch
handset, program Remote - Creatives remote (NEC-
compatible format)
audio controls as per
the commands and the value of a parameter continuously
update the EEPROM. until he is satisfied.
A delay in updating The 40-pin AT89C51 microcontroller
the EEPROM is de- has four 8-bit input/output (I/O) ports.
liberately provided Port 0 is used for indicating
because normally the through LEDs the various functions
Fig. 1: Block diagram of the remote-controlled digital audio processor listener will change selected via the remote/on-board keys.
Port 1 drives the 7-segment display as 2568-bit that can retain data for can control volume, treble, bass, at-
using 7-segment latch/decoder/driver more than ten years. Various param- tenuation, gain and other functions
IC CD4543. eters can be stored in it. of each channel separately. All these
Port 2 is pulled up via resistor To obviate the loss of latest set- parameters are programmed by the
network RNW1 and used for manual tings in the case of power failure, the microcontroller using SCL and SDA
key control. microcontroller stores all the audio lines, which it shares with the memory
Pins P3.0 and P3.1 of the microcon- settings of the user in the EEPROM. IC and the audio processor.
troller are used as serial data (SDA) The memory ensures that the micro- Data transmission from the micro-
and serial clock (SCL) lines for the I2C controller will read the last saved set- controller to the audio processor (IC
bus for communicating with the audio tings from the EEPROM when power TDA7439) and the memory (MC24C02)
processor (TDA7439) and EEPROM resumes. Using SCL and SDA lines, and vice versa takes place through the
(MC24C02). These two lines are con- the microcontroller can read and write two-wire I2C-bus interface consisting
nected to pull-up resistors, which are data for all the parameters. of SDA and SCL, which are connected
required for I2C bus devices. P3.2 re- For more details on I2C bus and to P3.0 (RXD) and P3.1 (TXD) of the
ceives the remote commands through memory interface, please refer to the microcontroller, respectively. Here,
the IR receiver module. Pin P3.4 is MC24C02 datasheet. Audio parameters the microcontroller unit acts as the
used for flashing LED9 whenever a can be set using the remote control master and the audio processor and
remote command is received or any handset or the on-board keys as per the memory act as slave devices. Any
key is pressed. the details given under the remote of these three devices can act as the
The microcontroller also checks the control section. transmitter or the receiver under the
functioning of the memory (MC24C02) Audio processor. IC TDA7439 is a control of the master.
and the audio processor (TDA7439). If single-chip I2C-bus compatible audio Some of the conditions to commu-
it is not communicating with these two controller that is used to control all the nicate through the I2C bus are:
ICs on the I2C bus, it flashes the vol- functions of the audio amplifier. The 1. Data validity: The data on the
ume level on the 7-segment displays. output from any (up to four) stereo SDA line must be stable during the
Memory. IC MC24C02 is an I2C-bus preamplifier is fed to the audio pro- high period of the clock. The high and
compatible 2k-bit EEPROM organised cessor (TDA7439). The microcontroller low states of the data line can change
Software
The software was assembled using
Metalinks ASM51 assembler, which
is freely available for download. The
source code has been extensively com-
mented for easier understanding. It
can be divided into the following seg-
ments in the order of listing:
1. Variable and constant definitions
2. Delay routines
3. IR decoding routines
4. Keyboard routines
5. TDA7439 communication
6. MC24C02 communication
7. I2C bus routines
8. Display routines
9. IR and key command processing
10. Timer 1 interrupt handler
11. Main program
On reset, the microcontroller ex-
ecutes the main program as follows:
1. Initialise the microcontrollers
registers and random-access memory
(RAM) locations.
2. Read Standby and Mute sta-
tus from the EEPROM and initialise
TDA7439 accordingly.
3. Read various audio parameters
from the EEPROM and initialise the
audio processor.
4. Initialise the display and LED
port.
5. Loop infinitely as follows, wait-
ing for events:
Enable the interrupts.
Check the monitor input for AC
power-off. If the power goes off, jump
to the power-off sequence routine.
Else, if a new key is pressed,
call the DO_KEY routine to process
the key. For this, check whether the
NEW_KEY bit is set. This bit is cleared
Fig. 5: Component layout for the PCB of Fig. 4 after the command is processed.
Else, if a new IR command is
vide 3V regulated supply by adjusting Walkman. received, call the DO_COM routine
preset VR1. Capacitors C39, C40 and As capacitors above 10 F are con- to process the remote command. For
C41 bypass any ripple in the regulated nected to the outputs of regulator ICs, this, check whether the NEW_COM
outputs. This supply is not used in the diodes D3 through D5 provide protec- (new IR command available) bit is set.
circuit. However, the readers can use tion to the regulator ICs, respectively, This bit is cleared after the command
the same for powering devices like a in case their inputs short to ground. is processed.
H
ere is a Windows-based pro- at pins 2 through 9. These data lines used for controlling the devices or ap-
gram developed in Microsoft are the primary means of sending pliances. The interface circuit requires
Visual Basic programming information out of the port. Pins regulated 6V DC to drive the loads.
language for controlling eight devices 18 through 25 of the connector are Eight MCT2E opto-osolator ICs are
through the PCs parallel port or Line grounded. used to prevent damage to the parallel
Printer Port (LPT). The program ac- Control lines of the parallel port port from short-circuit that may occur
cepts the input in decimal number are used to provide control signals across the interface circuit. Darlington
and outputs in binary form across the such as form feed and initialise to array IC ULN2803 is used to drive the
data pins of the PCs parallel port for the printer. relays for controlling the devices.
controlling the connected devices/ The five status lines are the only in- Fig. 2 shows the circuit for device
appliances. put lines of the standard parallel port. control using the PCs parallel port
These allow the printer to send signals programmed in Visual Basic. To get the
PCs parallel port such as error, paper out and busy power supply for the circuit, 230V AC
The standard parallel port comprises to the PC. mains is stepped down by transformer
four control lines, five status lines X1, rectified by bridge rectifier R3151
and eight data lines (refer to the table). Circuit description and filtered by capacitor C1 (1000F,
It is found on the back of the PC as Fig. 1 shows the block diagram for 25V). The filtered output is fed to
a D-type 25-pin female connector. device control through the PCs paral- input pin 1 of regulator IC 7806. The
regulated 6V DC is used to power the
interface circuit comprising ICs MCT2E
(IC2 through IC9) and ULN2803 (IC1).
Optocoupler MCT2E can be replaced
with 4N35.
LED1 through LED8 connected
across data output pins 2 through 9,
respectively, are used to indicate the
Parts List
Fig. 1: Block diagram of device control through PCs parallel port using Visual Basic Semiconductors:
IC1 - ULN2803 relay driver
IC2-IC9 - MCT2E optocoupler
IC10 - 7806 voltage regulator
Parallel-Port Pin Details BR1 - 1A bridge rectifier
Pin number Traditional use Port name Read/Write Port address Port bit Resistors (all -watt, 5% carbon):
R1-R16 - 220-ohm resistor
2-4 Data out Data port W Base D0-D2
Capacitors:
5-9 Data out W Base D3-D7 C1 - 1000F, 25V electrolytic
1 Strobe Control port R/W Base+2 C0 capacitor
14 Auto feed R/W Base+2 C1 C2 - 0.1F ceramic type
capacitor
16 Initialise R/W Base+2 C2
Miscellaneous:
17 Select input R/W Base+2 C3 X1 - 230V AC primary to 0-9V,
15 Error Status port R Base+1 S3 250mA secondary trans-
former
13 Select R Base+1 S4
S1 - On/Off switch
12 Paper end R Base+1 S5 RL1-RL8 - 6V, 100-ohm, 1C/O relay
10 ACK R Base+1 S6 - 25-pin, D-type parallel-port
11 Busy R Base+1 S7 male connector
Software
program
Before going into de-
tails of the program,
let us figure out some
limitations of Visual
Basic programming
for interfacing the
circuit. Visual Basic
cannot directly ac-
cess the computer
hardware to control
the external world.
All the hardware
requests must go
through the sup-
ported file format of
Windows operating
system.
So the best way
to manipulate the
parallel port is the
printer object. The
printer object allows
Fig. 2: Circuit for device control through PCs parallel port using Visual Basic
text and graphics to
be printed on the
printer through the
parallel port of the
PC. While all is well
with this option, it
is useless when you
want a direct con-
trol of the hardware.
In order to control
the port directly, we
must use something
external to our pro-
gram. A dynamic
link library (DLL)
file called WIN95IO.
DLL is used for that
purpose.
The WIN95IO.
DLL file is meant
for a 32-bit machine,
status of the loads. Glowing of any of relays. Since IC ULN2803 has an inter- supported by Visual Basic Versions
these LEDs indicates that the device nal freewheeling diode to quench the 4, 5 and 6. No matter which version
connected to that specific output line inductive kick, no external freewheel- you are using, the DLL file must be
is on. ing diodes are required across the in the Windows\system directory of
IC ULN2803 (Fig. 3) is a Darlington relay coils. The devices are connected your machine. The interface control
array relay driver that can drive eight through the relay contacts to mains. software program can be developed
A
n auto-changeover on mains by the user.
failure (AMF) system compris- System features 5. For indicating the mode of op-
ing mains and standby sources 1. The original configuration/operation eration, selected source of supply, low-
of power supply continuously moni- of the DG set as also its control panel battery condition, etc, status-indication
tors the incoming mains and in case is not disturbed. That means manual LEDs have been provided on the logic
of its interruption, starts the standby start/stop operation of the DG set and control panel.
diesel generator (DG) set, monitors its its control panel functions of monitor- 6. A buzzer warns the operator of
output and then transfers the load to ing its 3-phase output are still avail- low-battery state and over-cranking
the DG set. able. attempts. It can be reset/disabled by
Here is a construction project 2. Before changeover either to the the operator. However, the low-battery
that utilises off-the-shelf readily DG set or to mains, the selected source indication LED will remain lit as long
available switchgear and integrates is checked for single-phasing, phase as the battery voltage remains low.
it with the indigenously designed reversal, and under- and over-voltage 7. When manual mode is selected,
logic control circuitry to automatically conditions. If the conditions are not ful- the DG set can be electrically started
start the standby supply source filled, changeover to the faulty source from the logic panel itself via push-
on failure of the mains 3-phase is inhibited. buttons. Latching relays ensure that
supply and stop the DG set on 3. Suitable delays have been pro- either the start or the stop operation is
resumption of mains. This system vided in start and stop control of the performed at a time.
costs about 40 per cent less than DG set. 8. Use of the industrial change-
over switchgear ensures
preferential selection of
mains, in case both the DG
set supply and mains are
available. Mechanical inter-
locking and tripping before
selection arrangements en-
sure that the two sources are
never paralleled.
9. The system is capable
of flawless operation under
potentially noisy (electrical)
environments due to the use
of a hardware debounce and
feedback circuitry.
10. The logic panel has
been designed using discrete
ICs, relays and other passive/
active devices. Hence under-
standing the logic is easy and
the changes required to meet
the peculiarities of the indi-
vidual standby supply source
can be easily implemented.
Fig. 1: Line/block diagram of the manual changeover system that existed before changeover to AMF 11. The logic circuit con-
relays/coils operate off 230V AC. For 230V AC between the affected termi- achieved manually by pressing Trip
transfer of load onto mains or standby nals AT1 and AT2, or BT1 and BT2, button momentarily.
side, 230V AC is applied between will energise trip coil TC to bring the Caution. Before the emergency op-
terminals A1and A2, or B1 and B2, switch to neutral position. eration, isolate the load from the ATS.
respectively. For tripping of mains or 3. TC: Trip coil, when energised, Integrated ATS operation. The
standby, the 230V AC is applied be- trips the switch to neutral position. Havells ATS now comes as an in-
tween terminals AT1 and AT2, or BT1 4. SC: Selective coil, when energised, tegrated unit. A line diagram of the
and BT2, respectively. disengages the main mechanism and integrated unit is shown in Fig. 8.
Function of some of the relays for prevents closing towards the mains Apart from the components shown in
operation of the ATS has already been supply side by pulling limit switches Fig. 7(b), it comprises selector switch,
given under the description of its con- marked LS (Fig. 7) towards B1 and B2 pushbuttons, indicator lamps and re-
tact mechanism. However, operation of contacts. SC coil is used along with lays including timers.
all contacts/relays (coils) used within closing coil C to close towards the The mode-selector switch is a
the ATS, as shown in Fig. 7(b), is sum- standby side. 3-way, double-changeover switch. The
marised below: Emergency operation of ATS. In an three poles in the circuit are marked as
1. Auxiliary contacts AX and BX: emergency, the ATS can be operated SS1, SS2 and SS3. The auto position is
When ATS switch is in off (tripped/ manually, as an off-load switch only, marked A, while manual position is
neutral) state, auxiliary mechanical as follows: marked M. Pushbutton switches PB1,
contacts AX and BX are in closed state. 1. Closing onto mains supply: A PB2 and PB3 are used for selection of
When the ATS energises via closing manual handle rotates the operating mains and standby (DG set) supplies
coil C towards mains or standby side shaft by 45 in anticlockwise direc- and tripping of the selected source
by operation of selective coil SC, in tion to achieve closure under off-load (mains/standby), respectively, in
association with closing relay C, the conditions. manual mode of operation. Pushbutton
respective auxiliary contacts break and 2. Closing onto standby supply: PB3 has two mechanically interlinked
the supply to closing coil is cut off. Closure onto the standby supply side sections as shown in the figure. The
2. ATS1 and ATS2, and BTS1 and is achieved when Selective mode controlling voltage is derived from Red
BTS2: These two pairs of mechani- (through selective command hole) is phase and Neutral of the respective
cal contacts for mains and standby continuously pressed and the manual supply sources connected to the circuit
sources, respectively, close when the handle rotates the operating shaft by via fuses rated at 6 amperes each.
respective supply has been switched 45 in anticlockwise direction. The ATS operates in auto and
on via the ATS. The application of 3. Tripping: Tripping can be manual modes as follows:
Modifications
in DG set
Fig. 10 shows the
modified wiring dia-
gram of the standby
DG set.
For automating the
start, stop and run
operations of the DG
set, we need to sense
its present operational Fig. 9: Havells integrated ATS showing modifications
status. Two signals
are used for knowing the status of the was attached to the lever (used for seven lines carrying sense signals are
DG set. These are 230V AC alternator manually stopping the engine) using a routed from the ATS cubicle to the
output (across R-phase and Neutral) thin wire rope, similar to the one used logic control panel. Fig. 11 shows the
and dynamo-induced voltage of about in scooters for clutch/gear operation. interconnection diagram. The arrows
+14.5V DC. Both these voltages become As the solenoid arm had no tension, a indicate the direction of signals.
available after the DG set is running. spring of suitable tension and length It is desirable that each wire-end
(Note: For +14.5V to be available, +12V was used so that it returned to its origi- bears proper marking, so that after a
from the DG set battery needs to be nal position along with the stop lever disconnection for any fault rectification,
extended to On terminal of the key- once the solenoid was de-energised. the wires are connected back to their
operated start switch.) A relay in the The battery supply and IND ter- original points. For this purpose, num-
logic panel was used to extend the +12V minal of the dynamo are extended to bered plastic ferrules are available from
supply to Run terminal. the indigenously designed logic control electrical switchgear dealers, which can
For starting the DG set, we have to panel via TB1, while for energising the be inserted in the cable ends to mark
switch +12V to the solenoid (forming stop and start relays, and for extend- the wire numbers. The wiring conven-
inbuilt part of the starter) of the starter ing +12V to Run terminal, pin 5 of tions proposed in Fig. 11 can be used
using a relay with contact rating in ex- TB1 is used. The AC sample (R-phase for identification. Use of multicolour
cess of 20 amperes. Also, for stopping and neutral) from the DG set alternator leads (with resistor-type colour code)
the DG set, we use a similar relay for is extended to the logic control panel can further eliminate the risk of wrong
energising a solenoid puller. via pins 1 and 2 of TB2. connections during/after any servicing.
The solenoid puller (purchased A total of eight lines carrying DC
from the local market in Delhi) was and AC power, and sense and control Logic control panel
secured to rails on which the DG set signals are routed from the DG set to A summary of signals carried from/to
rests. Its free-moving central rod end the logic control panel, and another the logic control panel tag blocks (TBs)
viscosity of lube oil is high, which puts a panel performs quite a few additional and around 2.5V across capacitor C36
higher load on the starter and as such the functions as well, which will become after bridge rectifier BR1.
starter may not be able to start the engine clear when we go through its circuit Considering a voltage drop of 1.25V
at first attempt. Under these circum- details. The schematic diagram of the across the LED of the optocoupler,
stances, it is advisable to start the engine logic control circuit is shown in Fig. 12. resistor R36 (120 ohms) is used to limit
manually (after switching off the logic The connections to/from the DG set the current to about 10 mA through
control panel), two/three times so that are terminated on TB-1 (shown split in the optocoupler LED. The collector of
the starter is able to function smoothly in two sections) and TB-2, while TB-3 is the optocoupler is in low state with the
auto position, in one attempt itself. used for terminating connections to/ engine/alternator running.
If the engine fails to start in the from the ATS cubicle. The description The output of the alternator serves
first attempt (of 12 seconds), it waits of the signals on these TBs is given in as one of the two inputs to NAND
for 70 seconds before making the next the table. The ground (battery nega- gate IC2B, and is also used for energis-
attempt. This period is essential for tive) connection from pin 1 of TB-1 is ing Run relay RL1 via NAND gate
the battery to accumulate charge for extended to the modified ATS circuit IC2D (wired as an inverter) and driver
subsequent cranking attempts. The via pin 2 of TB-3. This ground connec- ULN2004A (IC8).
maximum number of cranking attempts tion is returned via other pins of TB-2 On energisation, RL1 contacts
can be preset (between two and five) by to indicate the state of mode switch and extend +12V to on contact of the key-
the operator. A higher number of crank- mains and standby supply sources. The switch via pin 5 of TB-1. As a result,
ing attempts indicates that the high- status is displayed through LEDs (LED1 the hour meter of the DG set starts
viscosity lube oil has been used, the through LED6). Three of these six signals running and also the dynamo output
battery terminals/leads to the starter (auto mode on, mains on and mains becomes available for charging the
need cleaning/tightening, the starter off) are used for logic control. battery of the DG set. The dynamo IND
pinion is not meshing properly with the Detection of the DG set engine terminal brought to pin 3 of TB-1 goes
engine flywheel gear, or the starter itself status. For detecting the on/running high (about +14.5V). The output from
needs servicing. If the engine fails to status of the DG set, initially the AC pin 3 of TB-1 is inverted by NAND
start within the preset attempts, audio- output from its alternator is monitored gate IC2A and extended to NAND gate
visual warning is activated. by the circuit built around MCT2E IC2B, which acts as a NOR gate (nega-
optocoupler (IC15). The value of re- tive logic). Thus when the engine is
Logic control circuit sistors R38 (33 kilo-ohms, 0.5W) and running, output pin 4 of IC2B is high.
Apart from implementing the above- R39 (390 ohms, 0.25W) is selected to Else, it is low.
mentioned logic, the logic control develop around 3.8V peak across R39 Two alternate signals have been
to pin 6 of IC3B, while pin 5 also goes voltage developed across zener ZD2. the engine picks up speed.
high since, with the DG set in off condi- The output of the comparator is high as Start-control relay energises via the
tion, pin 9 of quad NOR gate goes high long as the battery voltage exceeds 10V. de-energised contacts of stop-control
and its output pin 13 goes low. The same When the battery voltage falls be- relay RL3. Similarly, energisation of
output after inversion by NAND gate low 10V, the comparator output goes stop-control relay RL3 is possible via
IC3A is applied to pin 5 of IC3B. As a low to light LED7. Switch S6 is nor- the de-energised contacts of relay RL2.
result, the output of IC3B goes low to mally kept closed. As a result, when This provides a safety against any
reset O2 output of CD4044 and engine the battery voltage goes below 10V, erroneous pressing of a button while
stop control signal comes to an end. the output of NAND gate IC3D goes the automatic mode is in operation,
Battery-low warning circuit. When high to sound piezobuzzer BZ1 via and avoids simultaneous operation of
the battery voltage falls below 10V, the ULN2004A and diode D15, which acts start and stop solenoids.
auto start/stop circuit may not func- as an OR gate here. (In case you need The rest of start/stop opera-
tion satisfactorily. It is a sure indica- to activate a high-power siren, in place tion is similar to that of the automatic
tion of one or more of the following of the buzzer, you can use a 12V relay operation, with the exception of timer
conditions: to connect supply to the siren.) Once relay RL4, which is bypassed during
1. Charging circuit is non-functional. the operator has taken cognizance the manual stop operation. (Caution:
2. The battery is not holding charge of the warning, he may turn off the Dont release Stop pushbutton until
due to sulphation or the electrolyte buzzer using buzzer defeat switch S6. the engine comes to a dead stop. Else,
needs to be topped up. Manual start/stop operation. Push- the engine will tend to restart because
3. Dynamo pulley belt is slipping. button switches S4 and S5 in conjunction of its flywheel inertia.)
4. The battery has some load when with relays RL2 (start control) and RL3 Reset start tactile switch S1 has
the engine/dynamo is not on. (stop control) are used to manually con- been provided for resetting the start
The warning circuit comprises trol the DG set when the mode switch operation prematurely during circuit
comparator IC14A (LM239), which in the ATS is kept in manual mode. testing. For detecting the manual-to-
compares a 50 per cent sample of the For starting the DG set, start button auto mode transition at the ATS, tran-
battery voltage against the 5V reference is kept pressed and released as soon as sition-detection mono IC13 has been
used, which provides a reset pulse for remaining external control signals, a via TB-2 are concerned, we are merely
start and stop latches of CD4044 (IC4). 0.25-sq.mm flexible wiring will suffice. carrying negative DC supply via its
Cartridge fuse holder for fuse F1 and pin 2 for return via other pins of TB-2.
PCB and assembly toggle switch S7 may also be mounted Hence there is no danger unless you
A single-side, actual-size PCB for the on the rear panel, close to TB1. mix up the wires with 415/230 AC
logic circuit (Fig. 12) is shown in Fig. Mount all the relays (RL1 through voltages present in the ATS cubicle.
14 and its component layout in Fig. RL4) horizontally on the chassis of the
15. The front panel of the proposed panel. DC supply (12V) to the relay Things to remember
enclosure for the logic control PCB contacts is provided directly from TB-1 1. Many a times, the power supply
including all the components (to be terminals using 0.5mm2 flexible wires. (mains 3-phase) maintenance person-
mounted externally on its chassis) is Mark all the external wires using fer- nel inadvertently interchange the
shown in Fig. 16. rules as shown in the interconnection phases during reconnection after ser-
All the status LEDs, buzzer and diagram. vicing. The resulting phase reversal
switches shown in Fig. 12 (except can have very serious repercussions in
tactile switch S1) are mounted on the Testing organisations employing 3-phase mo-
front panel. Suitable Bergstick connec- Test each part of the circuit elaborately tor operated machinery due to reverse
tors (male/females) should be used by making use of the status-indication rotation of the motors.
for extending the connections for the lamps and logic explained for various The Minilec phase-reversal preven-
LEDs, switches and the buzzer. For parts of the circuit without extending tion relay (VMR D2) installed in the ATS
the purpose, SIP connectors have been connections from TB-1 terminals 4, 5 cubicle senses this reversal and trips to
provided on the PCB. and 6 to the DG set. Use 12V lamps (of prevent the control voltage (red phase)
All the cable entries to various TBs 2 to 3 watts) or even LEDs connected from exercising automatic changeover
should be made from the rear. Use a to these terminals for testing the circuit control. Tripping is indicated by an LED
1-sq.mm flexible conductor wire for operation before connecting them to on the VMR D2 relay.
supplying the DC voltage from the DG the corresponding terminals of the DG Tripping can also be caused by sin-
set to the logic control panel. For the set. As far as connections to the ATS gle-phasing or under-/over-voltage of
C
Semiconductors:
ontrolling electronic devices IC1 - 7805C 5V regulator of IC2 is fed to the next flip-flop IC in-
from a PC is fun. Here is a IC2-IC8 - 74174 hex D-type flip-flop put as well as LED. Data line D6 is fed
D1-D4 - 1N4007 rectifier diode
scrolling message display that to IC8, while data line D7 is connected
LED1-LED42 - Red LED
makes use of the PCs parallel port. to the clock inputs of IC2 through IC8.
Resistors (all -watt, 5% carbon):
The message typed from the key- Clock pins of all the flip-flop ICs are
R1- R42 - 150-ohm
board of the PC is displayed on the connected together. Master reset pin 1
Capacitors:
light-emitting diodes arranged as 57 of all the flip-flops is connected to Vcc.
C1 - 470F, 16V electrolytic
dot-matrix display in moving message Miscellaneous: Pins 18 through 25 of the parallel port
format. X1 - 230V AC primary to 7.5V, are grounded. As data present on lines
LED-based scrolling message 1A secondary transformer D0 through D6 shifts from the first
displays are increasingly being used stage to the next stage, and so on, the
at railway stations, public places, three ports, namely, data port, status message appears as scrolling on the
colleges, universities, hospitals, port and control port. Here, only data dot-matrix LED display.
general stores, etc for disseminating port is used for this scrolling message The present circuit supports a
information. However, most displays display. display made of 42 LEDs comprising
lack in storage capacity and cannot Pins 2 through 9 form the 8-bit seven rows and six columns. Up to 30
display a large number of characters data output port. This is purely a such units can be added with no change
at a time. write-only port, which means it can in the circuit. However, to add these
This PC-based LED scrolling only output data. The base address of units, you need to amplify the clock
message display has the following the first parallel port (LPT1) is 378H pulse output. Note that each character
features: or 888 (decimal). is displayed in a matrix of 5 columns
1. The message to be displayed is Parallel-input parallel-output and 7 rows (explained later), hence the
stored in a file and the message length (PIPO) registers are used to shift the sixth-column LEDs form part of the next
to be displayed is limited only by free signal from right to left. The clock character (column 1).
memory space on the hard disk of the pulse and code signal are generated Fig. 2 shows the power sup-
computer. by the computer program and output ply circuit. The AC mains is
2. The number of characters dis- from the parallel port (base address stepped down by transformer X1
played at a time can be as high as 30. 0378). Theoretically, we can add infi- to deliver a secondary output of
3. The message stored in the file nite number of PIPO registers but the 7.5V AC at 1A. The transformer
can be changed using any text editor maximum number of registers is actu- output is rectified by a full-wave
including Notepad. ally limited to the current triggering bridge rectifier comprising diodes
4. The running speed of the mes- value of the clock pulse. To add a large D1 through D4, filtered by capacitor
sage displayed can be increased or number of PIPO registers, amplify the C1, then regulated by IC 7805C (IC1) to
decreased by pressing a few keys. clock pulse prior to connecting it to the provide regulated 5V DC to the circuit.
Here, the circuit is designed for PIPO ICs. An actual-size, single-side PCB for
displaying English characters on a 35 the circuits in Figs 1 and 2 is shown
(57) LED dot-matrix display. Circuit description in Fig. 5 and its component layout in
The PCs parallel port (LPT port) Fig. 1 shows the circuit for the scroll- Fig. 6.
is used to output the display code and ing message display. IC 74174 has been EFY note. Commercially 75 dot-
the clock signal for the scrolling mes- used as PIPO register, which compris- matrix displays with discrete LEDs
sage display. es high-speed, hex D-type flip-flops. It may not be easily available in the mar-
The parallel port is terminated into is used as a 6-bit edge-triggered stor- ket, therefore a perforated board with
a 25-pin D-type female connector at age register. The data on the inputs of holes for the LED leads may be used.
the back of the PC. IBM PCs usually the flip-flop is transferred for storage The layout of such a board is shown in
come with one or two LPT ports. Each during high-to-low transition of clock. Fig. 7. The holes are used for passing
parallel port is actually made up of Data lines D0 through D5 of the paral- the LED leads.
Fig. 5: Actual-size, single-side PCB for the LED-based scrolling message display including power supply
SCroll.c
/************************************ DELAY-=1; case g:
SCROLLING MESSAGE DISPLAY } case G:
DEVELOPED BY : SURESH KUMAR if(DELAY<0) str1[0]=0x3A;str1[1]=0x49;s
FINAL YEAR, IITT COLLEGE OF ENGINEER- { tr1[2]=0x41; str1[3]=0x41;str1[4]=0x3E;
ING, PUNJAB DELAY=0; break;
THANX TO ALL TEACHERS AND MY PAR- } case h:
ENTS printf(\nSCROLLING case H:
**********************************/ MESSAGE DISPLAY : Speed Increased); str1[0]=0x7F;str1[1]=0x08;st
#include<stdio.h> break; r1[2]=0x08; str1[3]=0x08;str1[4]=0x7F;
#include<dos.h> case d: break;
#include<conio.h> case D: case i:
#include<process.h> DELAY+=10; case I:
unsigned char str1[5],str2[13],str[5]; printf(\nSCROLLING str1[0]=0x41;str1[1]=0x41;st
int DELAY=100; MESSAGE DISPLAY : Speed Decreased); r1[2]=0x7F; str1[3]=0x41;str1[4]=0x41;
void setcode(); break; break;
void sendcode(); case r: case j:
void getcode(char); case R: case J:
void main() rewind(fp); str1[0]=0x7F;str1[1]=0x41;st
{ printf(\nSCROLLING r1[2]=0x41; str1[3]=0x41;str1[4]=0x21;
FILE *fp; MESSAGE DISPLAY : Started from Begining); break;
char line[150],ch; break; case k:
clrscr(); case 27: case K:
fp=fopen(message.txt,r); clrscr(); str1[0]=0x41;str1[1]=0x22;st
if(fp==NULL) printf(\nSCROLLING r1[2]=0x14; str1[3]=0x08;str1[4]=0x7F;
{ MESSAGE DISPLAY : Exiting ); break;
fp=fopen(message. fclose(fp); case l:
txt,w); delay(1000); case L:
if(fp==NULL) printf(. ); str1[0]=0x40;str1[1]=0x40;st
{ delay(200); r1[2]=0x40; str1[3]=0x40;str1[4]=0x7F;
printf(\n\ printf(. ); break;
nCANT CREATE MESSAGE.TXT CREATE A FILE delay(200); case m:
UNDER NAME MESSAGE.TXT YOURSELF); printf(. ); case M:
exit(0); delay(200); str1[0]=0x7F;str1[1]=0x02;st
} printf(. ); r1[2]=0x04; str1[3]=0x02;str1[4]=0x7F;
fputs( Welcome! You are delay(200); break;
watching running led display... ,fp); exit(0); case n:
fclose(fp); } case N:
fp=fopen(message. goto startagain; str1[0]=0x7F;str1[1]=0x08;st
txt,r); } r1[2]=0x04; str1[3]=0x02;str1[4]=0x7F;
if(fp==NULL) void getcode(char ch) break;
{ { case o:
printf(\ switch(ch) case O:
nCANT FIND OR OPEN \message.txt\); { str1[0]=0x3E;str1[1]=0x41;st
exit(0); case a: r1[2]=0x41; str1[3]=0x41;str1[4]=0x3E;
} case A: break;
} str1[0]=0x7c;str1[1]=0x12; st case p:
clrscr(); r1[2]=0x11;str1[3]=0x12;str1[4]=0x7c; case P:
startagain: break; str1[0]=0x06;str1[1]=0x09; st
while(!kbhit()) case b: r1[2]=0x09;str1[3]=0x09;str1[4]=0x7F;
{ case B: break;
ch=fgetc(fp); str1[0]=0x36;str1[1]=0x49; st case q:
if(ch==EOF) r1[2]=0x49;str1[3]=0x49;str1[4]=0x7F; case Q:
{ break; str1[0]=0x3E;str1[1]=0x61; st
rewind(fp); case c: r1[2]=0x51;str1[3]=0x41;str1[4]=0x3E;
continue; case C: break;
} str1[0]=0x22;str1[1]=0x41; st case r:
printf(\nSCROLLING r1[2]=0x41;str1[3]=0x41;str1[4]=0x3C; case R:
MESSAGE DISPLAY : Sending \%c\,ch); break; str1[0]=0x46;str1[1]=0x29; st
getcode(ch); case d: r1[2]=0x19;str1[3]=0x09;str1[4]=0x7F;
setcode(); case D: break;
sendcode(); str1[0]=0x1C;str1[1]=0x22;s case s:
} tr1[2]=0x41; str1[3]=0x41;str1[4]=0x7F; case S:
ch=getch(); break; str1[0]=0x32;str1[1]=0x49; st
switch(ch) case e: r1[2]=0x49;str1[3]=0x49;str1[4]=0x26;
{ case E: break;
case i: str1[0]=0x41;str1[1]=0x41;st case t:
case I: r1[2]=0x49; str1[3]=0x49;str1[4]=0x7F; case T:
if(DELAY>10) break; str1[0]=0x01;str1[1]=0x01; st
{ case f: r1[2]=0x7F;str1[3]=0x01;str1[4]=0x01;
DELAY-=5; case F: break;
} str1[0]=0x01;str1[1]=0x01;st case u:
else r1[2]=0x09; str1[3]=0x09;str1[4]=0x7F; case U:
{ break; str1[0]=0x3F;str1[1]=0x40; st
E
Semiconductors:
lectromechanical energy meters salient features are: IC1 - ADE7757 metering IC
have been the standard for me- 1. It can read up to 999,999 units IC2, IC5 - 7805 5V regulator
tering the electricity since bill- (kWh) with a resolution of 0.01 unit. IC3, IC4 - MCT2E optocoupler
IC6, IC7 - MM74926 7-segment driver
ing began. But these are now being 2. It is designed for nominal 230V T1-T8 - BC548 npn transistor
gradually replaced by digital signal AC, 45-65 Hz and maximum line cur- D1-D3 - 1N4007 rectifier diode
processor (DSP)-based energy meters, rent of 30 amps. (The metering IC can ZD1 - 15V, 1W zener diode
BR1 - W04M bridge rectifier
or kilowatt-hour (kWh) meters. be used with a maximum current of
DIS1- DIS8 - LTS543 common cathode,
More accurate energy measure- 120 amps.) 7-segment display
ment and additional features are in 3. The dynamic range is 400 (i.e., 75 LED1 - Red LED
fact accelerating the adoption of DSP- mA to 30A). Resistors (all -watt, 5% carbon, unless
based meters. Their additional features 4. The meter count is 100 impulses/ mentioned otherwise):
include power quality monitoring, re- kWh, i.e., 100 impulses will be required R1, R3, R7,
R8 - 500-ohm
cording of current/voltage peaks and to register one unit. R2 - 6.2-kilo-ohm
voltage sags, registering of digitised 5. The accuracy level is better R4 - 470-ohm
waveforms for analysis, and monitor- than Class 2 defined in international R5, R6 - 680-ohm
ing of active and reactive power and standard IEC1036 (1996-09). The maxi- R9 - 350-micro-ohm (shunt)
R10 - 1.8-mega-ohm
power factor information. mum error limit for various current R11 - 2.2-kilo-ohm
Some metering chips have a se- values as per this standard is shown R13 - 470-ohm, 1W
rial port interface (SPI) that can be in Table I. R14 - 1-kilo-ohm
used for establishing communication R12, R15- R28 - 220-ohm
with a microcontroller-based mobile IC ADE7757 VR1 - 470-kilo-ohm trimpot
Capacitors:
gadget to control the functionality of Fig. 1 shows the functional block
C1, C3, C7,
the metering chip, perform calibration diagram of metering IC ADE7757. It is C8-C10 - 0.1F ceramic disk
and transfer the recorded data. Analog available in 16-lead SOIC narrow-body C2, C6 - 10F, 25V electrolytic
Devices offers an extensive range of package. In our PCB layout, it is to be C4, C5, C11,
C12 - 0.068F ceramic disk
metering ICs to serve various needs. soldered on the conductor side of the C13 - 0.47F, 630V polyester
Heres an energy meter using Ana- PCB. The IC has an on-chip oscillator, C14 - 470F, 35V electrolytic
log Devices ADE7757 chip for single- so it requires no external crystal or C15 - 1000F, 16V electrolytic
phase, 2-wire (phase and neutral) sys- resonator, thus reducing the overall Miscellaneous:
L1, L2 - Ferrite bead inductor
tems used in households. IC ADE7757 cost of building a watt-hour meter. It Battery - 4.5V rechargeable battery
is a low-cost, single-chip solution for operates off a 5V power supply. X1 - 230V AC primary to 7.5V,
electrical energy measurement. In operation, the chip directly 500mA secondary trans-
interfaces with former
a shunt resis-
tor (used as the current channel) is used for current
current sensor) sensing and channel V2 (also called
and AC ana- voltage channel) is used for voltage
logue voltage sensing.
sensing input. The differential output from the
It has two ana- current-sensing resistor is connected
logue input between V1P and V1N inputs, while the
channels des- differential output signal proportional
ignated as V1 to the AC line voltage, obtained through
and V2, respec- a resistor divider, is connected between
tively. Channel pins V2P and V2N.
Fig. 1: Functional block diagram of IC ADE7757 V1 (also called IC ADE7757 also has a reference
The circuit
By following the
aforementioned de-
sign principles, we
arrive at the energy meter circuit shown multiplexing circuit has its own free-
Soldering of SMT ICs
in Fig. 6. IC ADE7757 (IC1) is at the running oscillator, it does not require
Apply flux to the pads where the IC is to be
heart of the energy meter. It directly soldered.
external clock. The counter advances
interfaces with the shunt resistor and Add a small amount of solder to one of the on the negative edge of the clock pulse.
operates off the AC input. The only ana- corner pin pads. The high input at the latch-enable pin
Line up the IC with the pads on the PCB.
logue circuitry used in IC ADE7757 is displays the counter outputs.
Double check the IC orientation.
in the sigma-delta ADCs and reference Melt the solder with your iron and move
IC6 drives the first four 7-segment
circuit. All the other signal processing is the IC into position with tweezers. Let the displays (DIS1 through DIS4), while
carried out in digital domain. solder solidify. IC7 drives the remaining four displays
Solder the diagonally opposite pin. Check
The power supply for IC ADE7757 (DIS5 through DIS8). IC6 is cascaded
under magnification that all pins line up with
is derived directly from mains using their respective pads. to IC7 by connecting the Carry output
the capacitor divider network compris- Solder the rest of the pins and check under of IC6 to the clock input of IC7.
ing C13 and C14. Most of the voltage magnification. Transistors T1 through T8 drive the
Note. Special techniques may be needed for
is dropped across C13 (0.47F poly- respective digit displays DIS1 through
some packages.
ester capacitor rated for 630V), while DIS8.
resistor R13 (470-ohm, 1W) is used as Since F1 output comprises 100
a current limiter. The
output across C14 is
limited to 15V DC,
which serves as an in-
put to regulator 7805
(IC2). The regulated
5V is fed to IC1 at its
VDD pin 1. In this ap-
plication, the phase
line is connected to
AGND (pin 6) and
DGND (pin 13) and
hence to the common
terminal of regulator
IC2.
Two MM74926
ICs (IC6 and IC7) are
cascaded to act as an
8-digit ripple counter,
in conjunction with
eight 7-segment dis-
plays (DIS-1 through
DIS-8), which require
additional 5V reg-
ulated and isolated
supply (to avoid ex-
tension of live mains Fig. 7: Actual-size, single-side PCB layout for the energy meter using ADE7757
to the counter sec-
tion). A conventional 5V regulator using diode D2 in series with the com- pulses for each energy unit (kWh), a
circuit incorporating a bridge rectifier mon terminal of regulator 7805 (IC5). decimal point is permanently placed
(BR1), smoothing capacitor (C15) and The F1 output of IC1 is coupled between DIS2 and DIS3. Thus the dis-
regulator IC 7805 (IC5) has been used to 8-digit ripple counter IC MM74926 play can show up to 999999.99 units
for the purpose. A 4.5V rechargeable via optocoupler IC3, while LED1 in- and then restart from 000000.00.
battery is used to provide back-up so dicates that IC1 is working. CMOS IC The meter and the PCB layout
that the counter does not reset when MM74926 consists of a 4-digit counter, must be designed such that the con-
mains fails. Diode D3 prevents battery internal output latch, npn output ducted/radiated electromagnetic
discharge through the regulator during source drivers for the 7-segment dis- disturbances and the electrostatic
mains interruption. The voltage drop play and internal multiplexing circuit- discharge do not damage the meter or
across diode D3 is compensated by ry with four multiplexed outputs. As disturb its working. Other disturbanc-
I
Semiconductors:
ndia is the worlds largest market your bike. IC1, IC2 - NE555 timer
IC3 - CD4027 dual J-K flip-flop
for two-wheelers. Newer models Whenever you leave the bike,
IC4 - 7805, 5V regulator
with improved fuel efficiency and switch on the security circuit by IC5 - CD4081 quad two-input
power ratings keep hitting the market pressing the transmitter switch while AND gate
IC6 - CD4071 quad two-input
off and on. Sadly, the security aspect directing the transmitter towards the
OR gate
of two-wheelers remains neglected. sensor module such that the trans- T1 - BC558 pnp transistor
This fallibility inspired us to devise mitted IR rays fall on it directly. The T2, T3, T5 - BC547 npn transistor
T4 - TIP122 npn transistor
a foolproof yet cost-effective security received signal activates the security
D1-D7 - 1N4001
system to safeguard bikes against theft. circuit to blow the horn when subse- IR LED1 - Infrared LED
Any attempt to move the bike or force quently someone tries to steal your IRX1 - TSOP1738 IR receiver
module
the ignition key to start the bike will set bike by moving the bike or by using a
off the bikes horn. duplicate key. The turbulence-sensing Resistors (all -watt, 5% carbon, unless
stated otherwise):
mechanism detects manhandling of the R1, R3, R8,
The concept bike to trigger the alarm. R10, R18 - 1-kilo-ohm
The two-wheeler security system (Fig. When you return back, switch off R2 - 1.2-kilo-ohm
R4 - 27-ohm, 0.5W
1) comprises a handheld infrared (IR) the sensor mechanism before starting R5, R11 - 100-ohm
transmitter, IR receiver/sensor, switch- the bike. Else, you may be caught off R6, R13 - 10-kilo-ohm
ing circuit, power supply, turbulence guard as this again will trigger the R7 - 220-kilo-ohm
R9, R12 - 470-ohm
detection unit, alarm and ignition alarm. R14-R16 - 22-kilo-ohm
switch. You have to keep the handheld In case the transmitter unit is not R17 - 100-kilo-ohm
working or you Capacitors:
have misplaced C1, C2, C6 - 0.01F ceramic disk
C3 - 100F, 25V electrolytic
it, you can still C4 - 1F, 25V electrolytic
activate the secu- C5 - 10F, 25V electrolytic
rity circuit sim- C7 - 0.1F ceramic disk
C8 - 100F, 25V electrolytic
ply by flipping
its switch S3 to on Miscellaneous:
S1 - Push-to-on switch
position.
S2 - Motor bike switch
S3 - On/off-switch
Circuit LS1 - 12V horn
description E1-E3 - Thin steel rod
- Plastic bottle
Transmitter cir- - 9V battery
Fig. 1: Block diagram of the two-wheeler security system RL1 - 12V, 285-ohm, 1C/O relay
cuit. The trans-
mitter circuit
(Fig. 2) works off a 9V battery. It is IR LED1. Make sure that IR LED1
built around timer IC NE555, which is is properly oriented towards the IR
wired in astable multivibrator mode sensor module of the receiver circuit.
to generate around 38kHz frequency. Its transmission wavelength of 900
The timer output is amplified by pnp to 1100 nm (near-IR range) lies in the
transistor BC558 to drive the IR LED peak receptivity range of TSOP1738
(LED1). Resistor R4 limits the current receiver module.
flowing through LED1. Receiver circuit. The receiver cir-
When you press switch S1 momen- cuit (Fig. 3) comprises power supply,
tarily, the astable multivibrator starts sensor module, switching, turbulence
oscillating and the 38kHz frequency detection and alarm sections.
Fig. 2: Transmitter circuit generated is transmitted through Power supply. The receiver cir-
Demerits
1. Two logic gates of
CD4081 and three logic
gates of 4071 are left un-
utilised.
2. TSOP1738 may get
triggered by a TV re-
mote.
3. Short range of the
Fig. 6: Component layout for the PCB transmitter (4 to 5 me-
tres).
the horn blows until capacitor C1 dis- Alarm. The alarm section com-
charges below the threshold level of prises a high-current gain Darlington Precautions
CMOS gate via resistor R13. pair of transistors pumping current 1. Make sure that electrode E1 is al-
The basic aim of the turbulence into the bikes horn. The emitter of ways dipped into the water.
detection module is to activate the horn transistor T4 is directly connected to 2. Hang the two electrodes (E2 and
when the bike is moved or ignition the positive terminal of 12V horn. A E3) to rest just above the water level
key is forced to start the bike. This is heat-sink is used to dissipate the ex- so that they easily get shorted by the
achieved by using two-input OR gate cessive heat generated by npn power shaking water when the bike is moved.
N3 (IC CD4071), which is connected to: transistor TIP122. 3. Make sure the bikes battery is
1. The output of AND gate N2, fully charged.
which is virtually the output of the Fabrication 4. Keep the circuit protected from
turbulence detection module Assemble the transmitter and receiver water and high temperature.
2. A lead from the on terminal of circuits on separate general-purpose
the bike key PCBs as you have to carry the trans- Other applications
When either or both the inputs mitter unit with you and install the 1. Turbulence detection.
of N3 are high, its output goes high receiver unit in the bike. The lid of the 2. The circuit can be modified to
to provide sufficient current to drive water-filled plastic bottle should be function as an overflow indicator in
the Darlington pair transistors of the tight enough so that the water does water tanks.
warning-indication section and the not leak out. 3. The receiver unit itself can be
horn blows. Fig. 4 shows pin configurations of used as an infrared toggle switch.
T
Semiconductors:
his medium-power inverter is transformer primary is connected to IC1 7805 5V regulator
IC2 LM555 timer
capable of generating approxi- the positive terminal of the car battery
IC3 7473 dual J-K flip-flop
mately 300VA power. You can through high-currrent carrying wires. IC4 LM358 dual operational
power the inverter from your car bat- Capacitor C1 functions as a reservoir amplifier
tery to generate 50Hz AC supply. The capacitor. T1, T2 BD139 npn transistor
T3-T8 IRFZ44 power MOSFET
inverter provides enough back-up Low-battery indicator. For long D1, D2 - 1N4148 diode
power to light up up to three 100W life of the battery, it should not be al- LED1, LED2 5mm red LED
bulbs for up to two hours, provided lowed to discharge to a voltage below LED3 5mm green LED
ZD1, ZD2 - 5.1V zener diode
the car battery is fully charged. 10V. Even a single event of deep dis-
Fig. 1 shows the block diagram charge can reduce the charge-holding Resistors (all -watt, 5% carbon, unless
mentioned otherwise):
of the medium-power inverter. The capacity of the battery permanently. R1-R3, R5, R6
power house comprises car battery, For audio-visual indication of the R9-R12 1-kilo-ohm
power supply, oscillator-cum-divider, low-battery level, a dual operational R4 - 1-ohm, 0.5W
R7 - 220-ohm
driver, inverter transformer, power amplifier IC LM358 has been used. A R8 - 15-kilo-ohm
amplifier, buzzer and battery-level fixed reference voltage of 5.1V is ap- VR1 - 470-kilo-ohm preset
indicator sections. To keep the plied to its positive input, while the Capacitors:
C1, C3 0.1F ceramic disk
C2 1000F, 35V electrolytic
C4 100F, 25V electrolytic
C5 0.47F ceramic disk
C6 0.01F ceramic disk
Miscellaneous:
S1 On/off switch
PZ1 Piezobuzzer
X1 12V-0-12V primary to
Fig. 1: Block diagram of medium-power inverter 300VA inverter transformer
- Crocodile clips (red and
black)
cost low, the charger circuit has sensing voltage is applied to its nega- - Multistrand high-current
not been included here. The car tive input. Set preset VR1 such that the carrying wires
battery can be charged through the piezobuzzer sounds when the on-load
car battery charger circuit whenever battery voltage falls below 10V DC. with 50% duty cycle. When the invert-
it discharges. When the battery voltage drops er is switched on using switch S1, IC2
below 10V, the sense input voltage starts producing 100 Hz, while the J-K
The circuit drops below 5.1V and output pin 1 of flip-flop produces 50 Hz at its output
Connect the car battery to the circuit IC4 goes high to sound the buzzer and pins 8 and 9. The output of timer IC2
using crocodile clips. The red clip light up LED2. can be checked using the oscilloscope
should be connected to the positive Oscillator-cum-divider. The os- at test point (TP).
terminal of the battery and the black cillator-cum-divider section is built Driver circuit. The flip-flop output
clip should be connected to the nega- around timer IC LM555 (IC2) and is fed to MOSFET driver transistors
tive terminal of the battery. If croco- dual J-K flip-flop 7473 (IC3). Only one T1 and T2 via a diode-resistor combi-
dile clips are connected to the wrong flip-flop of the dual JK flip-flop is used nation. At any instant, if the voltage
terminals of the battery, LED1 glows here. of pin 8 of IC3 is +5V, the voltage at
to alert you. Timer LM555 is wired as an astable its pin 9 will be 0V, and vice versa.
Now flip switch S1 towards on multivibrator, whose time period is Therefore when transistor T1 conducts,
position to enable the circuit. LED3 decided by resistors R7 and R8 and transistor T2 is cut off, and vice versa.
glows to indicate power-on and 12V capacitor C5. It produces 100 Hz at Whenever output pin 8 of IC3 goes
DC reaches regulator IC 7805 (IC1). output pin 3, which is given to pin 5 high, npn transistor T1 conducts and
The regulated output is fed to the os- of the J-K flip-flop to produce 50 Hz the corresponding set of MOSFETs (T3
Fabrication
You can assemble the
circuit on any gen-
eral-purpose PCB.
However, an actual-
size, single-side PCB
Fig. 2: Circuit of medium-power inverter
A
programmable timer finds nu- generating an interrupt every second to Port B (PB0 through PB3) outputs
merous applications in the in- of the microcontroller.
dustry for efficient operation of Multiplexing of
machines in the desired sequence and displays reduces not
for precise time durations. Such timers only the number of
form part and parcel of all program- input/output (I/O)
mable logic controllers (PLCs), which lines required but
control the switching on and switching also the mean current
off functions of appliances like fans/ required for operat-
blowers, heaters and airconditioners, Fig. 1: Block diagram of programmable timer ing the display units.
as desired. Whenever some data
Heres an AVR AT90S4433 micro- and controlling the LED display, etc. is to be displayed, it is first latched on
controller-based programmable timer The circuit uses four 7-segment dis- Port D and then that particular display
that can switch on/off an appliance plays (DIS1 through DIS4). During unit is enabled by switching on the
after a certain time. This time can normal operation of the timer, DIS1 respective controlling transistor via
be set through the pushbuttons pro- and DIS2 display hours, while DIS3 Port B. The data is displayed without
vided in the circuit. After the set time and DIS4 display minutes. However, flickering with the help of the software.
elapses, the microcontroller-based logic during setting/programming opera- The SIGNAL(SIG_OVERFLOW0) inter-
generates the desired on/off signal tion of the timers, they display certain rupt service routine (ISR) is used to
to activate/deactivate the appliance. alphanumeric characters as stated control the display units in different
With this timer, you can program time earlier. The seven segments and the operational modes of the timer.
periods from one minute to 99 hours decimal point of all the displays are For manual setting and control
and 59 minutes. wired in parallel and fed via port D of the timer, three dual-function
The circuit uses four 7-segment (PD0 through PD7) outputs, while pushbutton switches S1 through S3
displays for displaying the time dur- labeled as Mode/End, On/Minute
ing normal operation of the timer and Parts List and Off/Hour, respectively, have been
certain alphanumeric characters during Semiconductors: provided. Their functions have been
IC1 - AT90S4433 AVR
setting/programming of the timers. microcontroller explained under the software subhead-
These operations have been covered in T1-T5 - BC548 npn transistor ing. The pushbuttons are interfaced to
the software part and the accompany- D1 - 1N4007 rectifier diode the microcontroller via Port C. Their
DIS1-DIS4 - LTS542 common-anode,
ing flow-charts. After the programmer 7-segment display status is repeatedly checked by the
has been set and is running, it can be LED1 - Red LED getKeyStatus() routine, which returns
immediately reset through switch S1 Resistors (all -watt, 5% carbon, unless information about the pushbutton
(Mode/End) in the case of an emer- stated otherwise): pressed and then an appropriate ac-
R1-R8, R14 - 220-ohm
gency. R9-R12 - 1-kilo-ohm tion is initiated by the software. The
The circuit uses the internal timer R13 - 10-kilo-ohm pushbutton functionality is dual in
of AT90S4433 microcontroller for R15-R17 - 150-ohm nature, i.e., each button will perform a
R18-R21 - 4.7-kilo-ohm
generating an interrupt every second, different function in a different mode
which, in turn, is used for computing Capacitors: of timer operation.
C1, C2 - 27pF ceramic disk
the on/off time period. C3 - 0.1F ceramic disk For activating/deactivating an
C4 - 47F, 16V electrolytic appliance, an output interface signal
The hardware Miscellaneous: marked DEVICE_CTRL (in Fig. 2)
Fig. 1 shows the block diagram of the XTAL - 4.000 MHz crystal is available from Port B (PB4). The
programmable timer, while the circuit RL1 - 5V, 150, 1C/O relay software will control the logic of this
S1-S3 - Push-to-on switch
is shown in Fig. 2. Here AT90S4433 signal to switch on or switch off an
appliance through energisation or from www.avrfreaks.net/AVRGCC refreshed with the respective data fast
de-energisation of relay RL1 via relay for Windows OS and from ftp:// enough so that a flicker-free display
driver transistor T5. gatekeeper.dec.com/pub/GNU/ is achieved, and for this reason, timer
The ports are configured as follows: for Linux OS free of cost), along with 0 is preloaded with an appropriate
1. Port-B: It is configured in out- AVR STUDIO version 3.0, is used for value. In this ISR, the operation status
put mode and used for activating/ programming (in C language syn- is checked by checking the value of
deactivating an external appliance tax), debugging and generating the DISPLAY_MODE and then the desired
and controlling the transistors of the compatible hex code for AT90S4433 data is latched to Port D. After the ISR
display units. microcontroller. completes its operation, timer 0 is once
2. Port-C: It is configured in input The software uses both the 8- and again loaded with the desired refresh
mode and used for interfacing the 16-bit internal timers of the microcon- value (REFRESH_VAL).
pushbutton switches. troller. The 8-bit timer (timer 0) is used The particular display unit that is
3. Port D: It is configured in output for displaying the information without to be made active with the desired data
mode. All the segments of the display flickering and the 16-bit timer (timer will depend upon the value of the DIS-
units are interfaced to this port. 1) is used for generating an interrupt PLAY_ON variable. The two left-most
every second, which is used for com- display units are used for displaying
The software puting the elapsed time during both the hours, while the remaining two
Two separate software are provided. The the on and off periods of the cycle. display units are used for displaying
first software (labeled Timer-A) provides The SIGNAL (SIG_OVERFLOW0) minutes (in countdown mode of opera-
cyclic on/off functionality, while the sec- ISR of timer 0 is used for flicker-free tion). This functionality is achieved by
ond software (labeled Timer-B) provides display of the information. Timer-0 is the showNormalDisplay() subroutine.
switch-on functionality after a preset initially configured to operate in timer In countdown mode, the displayed
elapsed time. The following explanation mode with prescaling factor of 256 information changes in last 60 min-
relates to Timer-A, however the setting and preloaded with a desired value. utes of the operation. Now the two
and operation of Timer-B have been Whenever timer 0 overflows, its ISR left-most display units are used to
briefly explained later in the article. is initiated to latch the desired display display minutes and the two right-
The desired functionality is data on Port D and also switch on the most display units are used to display
achieved by controlling the hardware corresponding transistor of that par- seconds. This is achieved with the help
through software. The AVR-GCC 3.2 ticular display unit. of the showLast60MinutesDisplay()
software (which can be downloaded All the display units have to be subroutine.
F
or hand coding of AT89C51 address pins (A0 through A11) of the IC2 CD4040 12-bit binary
counter
microcontroller, here is a simple microcontroller. The outputs of IC2 IC4 7812 12V regulator
programmer to program binary are also connected to LED1 through IC5 7805 5V regulator
data into the microcontroller. It doesnt LED12 via current-limiting resistors IC6 AT89C51 microcontroller
T1-T3 BC548 npn transistor
require use of a computer and all the R4 through R15, respectively. LED1 D1-D4 1N4007 rectifier diode
control signals and data are entered through LED12 indicate address loca- D5 1N4148 switching diode
manually. The programmer can erase, tion for the microcontroller IC. Switch LED1-LED12,
LED22-LED29 Red LED
read and write data into the flash S2 is used to reset the counter (IC2).
LED13-LED20 Green LED
memory of the microcontroller. It can Port 0 receives code bytes dur- LED21 Yellow LED
also read the signature byte of the mi- ing flash programming and outputs Resistors (all -watt, 5% carbon, unless
crocontroller. them during program verification. mentioned otherwise):
Port-0 pins 39 down to 32 are used as R1-R3,
Circuit description data pins for the microcontroller, and R31-R33 10-kilo-ohm
R4-R23 RNW1, RNW2, RNW3
Fig. 1 shows the circuit of the manual connected to pins 1 through 8 of DIP R35-R42 220-ohm
programmer. It uses timer NE555 (IC1) switch SW1 as well as LED13 through R24, R26 1-kilo-ohm
wired as a monostable to increment the LED20 via current-limiting resistors R27, R29 2.7-kilo-ohm
R28 15-kilo-ohm
address location one by one in conjunc- R16 through R23. The LEDs indicate R30 100-ohm
tion with counter CD4040. data at/for the addressed location of R34 4.7-kilo-ohm
When switch S1 is pressed, IC1 the microcontroller. Port pins 16, 17, 27 R25 12-kilo-ohm
RNW4 4.7-kilo-ohm8 (SIP9)
generates a clock pulse, which is given and 28 are controlled by slide switches
to clock pin 10 of 12-bit binary coun- S6, S7, S8 and S9, respectively, as per Capacitors:
C1 0.47F, 16V electrolytic
ter CD4040 (IC2). The 12-bit counter the table given below. C2, C8 0.01F ceramic disk
is used for generating the 12-bit Programming pulse (ALE/PROG) C3, C4, C12,
binary address for AT89C51 micro- and programming voltage (EA/Vpp) C13 33pF ceramic disk
C5, C9, C10 0.1F ceramic disk
controller IC. The microcontroller to are derived with the help of IC3 and
C6 10F, 16V electrolytic
be programmed is inserted into the transistors T1 through T3. Timer IC3 C7 1F, 16V electrolytic
ZIF socket for programming, reading generates and determines the pro- C11 1000F, 35V electrolytic
and erasing. During flash program- gramming and erasing pulse time. It Miscellaneous:
ming and verification, port 1 receives is configured as a monostable whose X1 230V AC to 15V, 300mA
secondary transformer
low-order address bytes, while port 2 time period is decided by resistor R24
XTAL 4MHz crystal
receives high-order address bits and and capacitors C6 and C7. Capacitors S1-S3 Push-to-on switch
some control signals. C6 and C7 are selected by slide switch S4-S9 Slide switch
Q0 through Q11 outputs of IC2 are S4 for programming and erasing, SW1 8-way DIP switch
40-pin ZIF socket
75
of the programming/erasing pulse.
IC3 also determines the time period
for application of the programming/
erasing voltage (12V) to the micro-
controller. When its output goes high,
npn transistor T2 conducts and its col-
lector goes low. As a result, transistor
T3 is cut off and its collector voltage
rises to around 12V. Slide switch S5
is used for selecting 12V or 5V as
required.
The AC mains is stepped down by
transformer X1 to deliver a second-
ary output of 15V at 300 mA. The
transformer output is rectified by a
full-wave bridge rectifier comprising
diodes D1 through D4, filtered by
capacitor C11, and regulated by IC4
and IC5 to provide regulated 12V and
5V supplies, respectively. Capacitors
C9 and C10 bypass any ripple in the
regulated outputs.
Programming
The AT89C51 microcontroller is pro-
grammed byte by byte. Before pro-
gramming, the flash memory must be
Fig. 2: Actual-size, single-side PCB layout for manual AT89C51 programmer of Fig. 1
erased completely and control signals
should be set according to the table for
erasing, programming and reading the
microcontroller as follows.
Chip erase. Move slide switch
S4 towards Erase position. The high
output at pin 3 of IC3 provides a low
pulse of around 10 milliseconds (ms)
available at pin 30 of the microcon-
troller (ALE/PROG). Now move slide
switch S5 towards Prog/Erase posi-
tion for programming voltage (12V).
The entire flash array can be erased
electrically by setting pins 28, 16 and
17 to low level using switches S9, S6
and S7, respectively, and pin 27 at
high level using switch S8. Insert the
microcontroller into the ZIF socket
and press switch S3 (LED21 glows to
indicate application of the program-
ming pulse) to erase the flash array
(reset to all 1s).
Write code. Press switch S2 to reset
the address counter to address 0000H.
In this state, LED1 through LED12 are
off. Move slide switch S4 towards Prog
position and switch S5 towards Prog/
Fig. 3: Component layout for the PCB in Fig. 2 Erase position. Make control signal
Construction
A single-side PCB layout for the manu-
al programmer (Fig. 1) is shown in Fig.
Fig. 5: Actual-size, single-side PCB layout for Fig. 6: Component layout for the PCB in Fig. 5 2 and its component layout in Fig. 3.
the ring counter
Signature bytes can be read using the Sample program
pins 28, 16 and 17 high using switches same procedure as used for normal To test the working of the programmer
S9, S6 and S7, respectively, and pin verification of locations 030H, 031H kit, heres a program (RING.LST) for
27 low using switch S8. Set the code and 032H, except that all the control a continuously running ring counter:
data using DIP switch SW1. The data pins (pins 27, 28, 16 and 17) must be The circuit of the ring counter is
(D0 through D7) being set is indicated pulled low using switches S8, S9, S6 shown in Fig. 4. Its PCB layout is shown
by LED13 through LED20. Program and S7, respectively. The values re- in Fig. 5 and component layout in Fig. 6.
the code data by pressing switch S3. turned would be: Download source code: http://
(LED21 glows to indicate application (030H) = 1EH indicates manufac- www.efymag.com/admin/issuepdf/
of the programming pulse.) tured by Atmel Manual%2089c51%20Programmer.
For programming the next data, (031H) = 51H indicates 89C51 zip
C
ontrolling electrical devices dress of the first parallel port (LPT1) ing the PCs parallel port to the devices
from a PC is great fun. Here is 378 (hex) or 888 (decimal). The data to be controlled. The parallel port out-
is a Windows-based program port of the parallel port can be accessed puts the control signals generated by
written in C language for controlling at its base address. The status port can the software. The control signals are
up to eight devices from the PCs par- be accessed at base address + 1, i.e., not continuous but a single clock pulse.
allel port termed as printer port (LPT). 0379 hex (or 889 decimal). The control For every on or off control, only a
The program accepts the input in deci- port can be accessed at base address single clock pulse is sent from the par-
mal numbers and outputs at the data + 2, i.e., 037A hex (or 890 decimal). allel port to the circuit.
output pins of the PCs parallel port In case you are using LPT2 port, then Data pins D0 through D7 of the
for controlling the connected devices. substitute the base address of LPT2 as parallel port are connected to pin 1
of optocouplers IC5 through IC12 via
PCs parallel port Parts List resistors R1 through R8, respectively.
The parallel port is made up of three Semiconductor: Optocouplers ensure complete isola-
IC1-IC4 - CD4013 D-type flip-flop
ports, namely, data port, status port IC5-IC12 - MCT2E optocoupler tion of the parallel ports data pins
and control port. It is found on the IC13 - 7805 5V regulator from the relay driver circuit.
back of the PC as a D-type, 25-pin T1-T8 - BC548 npn transistor Each optocoupler consists of an
D1-D8 - 1N4007 rectifier diode
female connector. Here, we are con- BR1 - 1A, bridge rectifier
infrared light-emitting diode (LED)
cerned only with data lines D0 through and an npn phototransistor. When a
Resistors (all -watt, 5% carbon, unless
D7 terminated at pins 2 through 9. stated otherwise): high going pulse is available on the
The data port is a write-only port, R1-R8 - 100-ohm data pin, the internal LED drives
which means it can be used only to R9-R17 - 10-kilo-ohm the phototransistor of optocoupler
output data. Pins 18 through 25 of the Capacitors: MCT2E and it provides a clock pulse
connector are grounded. Control port C1 - 1000F, 25V electrolytic to the corresponding flip-flop (IC
C2 - 0.1F ceramic
is read/write capable, which means CD4013) section.
Miscellaneous:
it can be used both for outputting and IC CD4013 is a dual D-type flip-
RL1-RL8 - 5V, 100-ohm, 1C/O relay
inputting some data to/from the ex- S1 - Push-to-on switch flop with independent set, clear and
ternal hardware. Status port is a read- X1 - 230V AC primary to 9V, clock inputs and a single output. It
only port, which means it can be used 250mA secondary trans- accepts data when its clock pin is low
former
only to read data from the external and transfers it to the output on the
- 25-pin D-type parallel-port
hardware. male connector positive-going edge of the clock. The
Table below shows pin details of high Q output of the flip-flop drives
the corresponding transistor to ener-
gise the relay and switch on/off the
Pin Details of the Parallel Port device.
Pin number Traditional use Port name Read/Write Port address Port bit The flip-flops are set up for toggle
2-4 Data out Data port W Base D0-D2 mode by connecting their D inputs to
5-9 Data out W Base D3-D7 Q outputs. Set inputs of all the flip-
1 Strobe Control port R/W Base+2 C0 flops are grounded. Switch S1 is used
14 Auto feed R/W Base+2 C1 to reset the flip-flops manually.
16 Initialise R/W Base+2 C2 Fig. 2 shows the circuit of the pow-
17 Select input R/W Base+2 C3 er supply. The AC mains is stepped
15 Error Status port R Base+1 S3 down by transformer X1 to deliver
13 Select R Base+1 S4 secondary output of 9V at 250 mA. The
12 Paper end R Base+1 S5 transformer output is rectified by full-
10 ACK R Base+1 S6 wave bridge rectifier BR1, filtered by
11 Busy R Base+1 S7 capacitor C1 and regulated by IC13 to
Fig. 4: Combined actual-size, single-side PCB layout for computerised Fig. 5: Component layout for the PCB
electrical equipment control and power supply circuits
control.c
/*COMPUTERISED ELECTRICAL EQUIPMENT CON- tone(); printf(\n\n\n\nPress any key);
TROL*/ outportb(p,16); getch();
#include<stdio.h> delay(500); outportb(p,0);exit(0);
#include<conio.h> outportb(p,0); }
#include<dos.h> break;
void main() case E:
{ case 6: if((a|b|c|d|e|f|g|h)==1)
void tone(void); f=!f; {
int p=0x0378; tone(); clrscr();
char ex[23]={Created by V.MARIYAPPAN}; outportb(p,32); textcolor(10);gotoxy(20,12);
int j; delay(500); cprintf(PLEASE SHUT DOWN ALL THE EQUIP-
char ex1[34]={For Further Details & Improvements}; outportb(p,0); MENTS);
int k; break; sound(200);
char ex2[40]={Contact: Email-marietech2003@yahoo. delay(500);
co.in}; case 7: nosound();
int l; g=!g; delay(3000);
char ex3[23]={Programming Language: C}; tone(); break;
int m; outportb(p,64); }
int u[10]; delay(500); else
int i; outportb(p,0); {
static a,b,c,d,e,f,g,h; break; clrscr();
char no; for(j=0;j<23;j++)
clrscr(); case 8: {
textcolor(15);gotoxy(20,6); h=!h; textcolor(10);gotoxy(20+j,12);
cprintf(COMPUTERISED ELECTRICAL EQUIPMENT tone(); cprintf(%c,ex[j]);
CONTROL); outportb(p,128); sound(2500+j);
textcolor(11);gotoxy(20,7); delay(500); delay(30);
cprintf(-----------------------------------------); outportb(p,0); nosound();
textcolor(11);gotoxy(10,10); break; }
cprintf(EQUIPMENT NO: 1 2 3 4 5 6 7 for(m=0;m<23;m++)
8); case e: {
textcolor(11);gotoxy(10,12); if((a|b|c|d|e|f|g|h)==1) textcolor(10);gotoxy(20+m,13);
cprintf(STATUS: %d %d %d %d %d %d { cprintf(%c,ex3[m]);
%d %d,a,b,c,d,e,f,g,h); clrscr(); sound(3500+m);
textcolor(10);gotoxy(9,16); textcolor(10);gotoxy(20,12); delay(30);
cprintf(FOR ON AND OFF AN EQUIPMENT PRESS cprintf(PLEASE SHUT DOWN ALL THE EQUIP- nosound();
CORRESPONDING EQUIP.NO.); MENTS); }
textcolor(11);gotoxy(28,18); sound(200); for(k=0;k<34;k++)
cprintf(STATUS 0=OFF STATUS 1=ON); delay(500); {
textcolor(12);gotoxy(32,20); nosound(); textcolor(10);gotoxy(20+k,14);
cprintf(FOR EXIT PRESS E\n); delay(3000); cprintf(%c,ex1[k]);
no=getch(); break; sound(3000+k);
switch(no) } delay(30);
{ else nosound();
case 1: { }
a=!a; clrscr(); for(l=0;l<40;l++)
tone(); for(j=0;j<23;j++) {
outportb(p,1); { textcolor(10);gotoxy(20+l,15);
delay(500); textcolor(10);gotoxy(20+j,12); cprintf(%c,ex2[l]);
outportb(p,0); cprintf(%c,ex[j]); sound(3500+l);
break; sound(3000+j); delay(30);
delay(30); nosound();
case 2: nosound(); }
b=!b; } printf(\n\n\n\nPress any key);
tone(); for(m=0;m<23;m++) getch();
outportb(p,2); { outportb(p,0);exit(0);
delay(500); textcolor(10);gotoxy(20+m,13);
outportb(p,0); cprintf(%c,ex3[m]); }
break; sound(1800+m); default:
delay(30); clrscr();
case 3: nosound(); sound(500);
c=!c; } delay(100);
tone(); for(k=0;k<34;k++) nosound();
outportb(p,4); { textcolor(11);gotoxy(30,12);
delay(500); textcolor(10);gotoxy(20+k,14); cprintf(INVALID KEY PRESSED);
outportb(p,0); cprintf(%c,ex1[k]); textcolor(11);gotoxy(33,14);
break; sound(2000+k); cprintf(WAIT 2 SECONDS);
delay(30); delay(3000);
case 4: nosound(); break;
d=!d; } }
tone(); for(l=0;l<40;l++) main();
outportb(p,8); { }
delay(500); textcolor(10);gotoxy(20+l,15); void tone(void)
outportb(p,0); cprintf(%c,ex2[l]); {
break; sound(2500+l); sound(1000);
delay(30); delay(100);
case 5: nosound(); nosound();
e=!e; } }
H
Semiconductors:
ere is a stepper motor system permanent magnet rotor teeth try to IC1 - TSOP1738 IR receiver
module
wherein the direction of ro- align up with the stator teeth. IC2 - CD4013 dual D-type flip-
tation of the stepper motor The coils are arranged around the flop
(in clockwise and anticlockwise direc- circumference of the stator in such a way IC3, IC8 - NE555 timer
IC4 - CD4029 up/down
tions) can be controlled remotely. Be- that if they are driven with square waves counter
sides, the speed can also be controlled which have a quadrature phase relation- IC5 - CD4028 BCD-to-decimal
locally. ship between them, the motor will rotate. decoder
IC6 - ULN2803 Darlington pair
A transition of either square wave causes driver
Stepper motor basics the rotor to move by a small angular IC7 - CD40106 NOT gate
A stepper motor converts electrical step, hence the name stepper motor. IC9 - 7805C 5V regulator
T1 - BC547 npn transistor
pulses into specific rotational move- The size of this angular step is de- D1-D10 - 1N4148 switching diode
ments. The movement created by each pendent on the teeth arrangement of BR1 - 500mA bridge rectifier
pulse is precise and repeatable. the motor, but a common value is 1.8 LED1 - Red LED
LED2 - Green LED
Stepper motors have teeth on both degrees, or 200 steps per revolution. - IR LED
the rotor and the stator. Torque is Speed control is achieved by sim-
Resistors (all -watt, 5% carbon):
ply varying R1, R6, R7, R10 - 330-ohm
the frequency R2 - 1-kilo-ohm
R3-R5 - 10-kilo-ohm
of the square
R8 - 3.3-kilo-ohm
waves. R9 - 5.6-kilo-ohm
R11 - 12-ohm
System VR1 - 100-kilo-ohm preset
overview VR2 - 4.7-kilo-ohm preset
Capacitors:
Fig. 1 shows C1 - 1F, 16V electrolytic
the block dia- C2-C4 - 0.01F ceramic disk
gram of the IR C5 - 1000F, 16V electrolytic
C6 - 0.1F ceramic disk
remote control
Fig. 1: Block diagram of IR remote control system for stepper motor system for the Miscellaneous:
X1 - 230V AC primary to 3V-
stepper motor. 0-3V, 350mA secondary
The pulse generator provides clock transformer
pulse to the up/down counter. The S1, S2 - Push-to-on switch
Battery - 6V battery
four parallel BCD outputs of the - Stepper motor
counter are converted into one-of-
ten active-high outputs by the BCD-
to-decimal decoder. The decoded circuit of the IR transmitter. The
outputs are fed to the stepper motor transmitter circuit, powered by a 6V
driver to drive the stepper motor. battery, is built around timer NE555
The 38kHz infrared signal (IC8), which is wired as an astable
transmitted by the IR transmitter multivibrator having a frequency of
is received by the IR receiver to around 38 kHz.
control the direction of rotation The frequency of the astable is de-
of the stepper motor. The pulse cided by resistor R10, preset VR2 and
generator can control the speed of capacitor C3. Preset VR2 is used to set
the motor. the frequency to 38 kHz. The output
of IC8 is fed to an infrared LED via
Circuit description current-limiting resistor R11. When
Fig. 2: IR transmitter IR transmitter. Fig. 2 shows the switch S3 is pressed, the IR LED trans-
T
his digital stopwatch can count nary coded decimal (BCD) up-/down- combinations of stages 1 through 4,
up to 99.9 seconds with a reso- counter IC 4510B, BCD-to-7 segment 16 and 17 to set or reset the individual
lution of 0.1 second (or in steps latch/decoder/driver IC 4511B and stages.
of 0.1 second) or up to 999 seconds common-cathode display IC LTS543. IC MM5369 advances by one count
with a resolution of 1 second. This Fig. 2 shows internal connections on the positive transition of each clock
has been made possible by employing and block diagram of IC MM5369, pulse. Two buffered outputs are avail-
clock frequency options of 10 Hz and 1 which is commonly used for gen- able: the crystal frequency for tuning
Hz, respectively. erating clock pulses in digital time- purposes and the 17th-stage output.
The stopwatch can be used to ac- pieces. The MM5369 is a CMOS IC The IC is available in an 8-lead as well
curately measure short time intervals. with 17 binary divider stages that as 14-lead dual-in-line epoxy package
It is portable and operates off four 1.5V can be used to generate a precise and features:
rechargeable Ni-Cd cells. reference from commonly available 1. Crystal oscillator
high-frequency quartz crystals of 2. High speed (4 MHz at 10V Vdd)
Circuit description 3. Wide supply
Fig. 1 shows the block diagram of the range of 3V to 15V
digital stopwatch. It comprises clock 4. Low power
generator IC MM5369, quad 2-input 5. Fully static
operation
Parts List
6. Low current
Semiconductor:
IC1 - MM5369 17-stage Fig. 3 shows
oscillator/divider the circuit of the
IC2 - CD4011B quad 2-input
digital stopwatch.
NAND gate
IC3, IC4 - CD4018B presettable IC MM5369 (IC1)
divide-by-n counter along with resistor
IC5, IC6, IC7 - CD4510B BCD up-/down- Fig. 1: Block diagram of digital stop watch R1, capacitors C1
counter
IC8, IC9,
IC10 - CD4511B BCD-to-7
segment latch/decoder/
driver
DIS1-DIS3 - LTS543 common-cathode,
7-segment display
LED1 - Red LED
Resistors (all -watt, 5% carbon):
R1 - 2.2-mega-ohm
R2, R27 - 1-kilo-ohm
R3, R4 - 22-kilo-ohm
R5-R25 - 330-ohm
R26, R28 - 680-ohm
Capacitors:
C1, C2 - 33pF ceramic disk
C3 - 0.0022F ceramic disk
Miscellaneous:
XTAL - 3.579545MHz crystal
S1-S3 - Miniature pushbutton
microswitches
S4 - SPDT switch
S5, S6 - On/off switch
- 14- and 16-pin IC bases
- Nickel-cadmium cells
1.5V (4 Nos)
- Multistrand wires
- Solder metal
- Suitable mounting
cabinet
Fig. 2: Internal connections and block diagram of IC MM5369
Construction
A single-side, actual-size PCB for the
digital stopwatch is shown in Fig. 5
and its component layout in Fig. 6. The
proposed display panel box is shown
in Fig. 7. All the 7-segment displays,
LED1 and switches are mounted on the
Fig. 6: Components layout for the PCB front panel.
M
ost optical interruption of the IR beam falling on the sensor, receiver-cum-counter stages. Capacitor
counters make use of a light the triggering circuit activates to trig- C5 bypasses any ripple in the regulated
bulb with light-dependent ger the monostable multi-
resistor (LDR) or ordinary phototrans- vibrator. The output of the
istor as the sensor. These interruption monostable advances the
counters work satisfactorily in dark- count of the 4-digit coun-
ness only and cannot be used outdoors ter-cum-display driver to
because of the chances of false count- display the count on 7-seg-
ing due to light sensed from other light ment, common-cathode
sources like sun, light bulb, etc. displays.
The interruption counter described
here uses an infrared (IR) sensor that Circuit description
can sense a particular modulated The infrared interruption
frequency of infrared beam. A small counter circuit consists of
transmitter circuit employing an IR power supply, transmitter
LED is used to emit modulated IR and infrared interruption Fig. 3: IR transmitter circuit
signals. counter stages.
Parts List
The block diagram of the infrared Power supply. Fig. 2 shows the
Semiconductors:
interruption counter providing an power supply circuit. The AC mains
IC1 - 7805 5V regulator
overview of the system is shown in Fig. is stepped down by transformer X1 to IC2, IC3 - NE555 timer
1. The astable multivibrator produces deliver secondary output of 9V at 500 IC4 - 74C926 display driver
36kHz frequency and npn transistor mA. The transformer output is rectified IR LED1 - IR transmitting LED
BC547 drives the IR LED to transmit by a full-wave bridge rectifier compris- IRX1 - TSOP1736 IR receiver
T1-T7 - BC547 npn transistor
the modulated infrared signal. The ing diodes D1 through D4, filtered by D1-D4 - 1N4007 rectifier diode
transmitted IR signal continuously falls capacitors C3 and C4, and regulated by D5 - 1N4148 switching diode
Resistors (all -watt, 5% carbon):
R1-R2 - 1-kilo-ohm
R3-R4 - 47-ohm
R5 - 2.2-kilo-ohm
R6, R8, R22 - 10-kilo-ohm
R7, R9, R10 - 100-kilo-ohm
R11-R17 - 1-kilo-ohm
R18-R21 - 1.5-kilo-ohm
VR1 - 4.7-kilo-ohm
Fig. 1: Block diagram of infrared interruption counter Capacitors:
C1, C2 - 0.22F ceramic disk
C3 - 1000F, 25V electrolytic
C4, C5,
C10, C11 - 0.1F ceramic disk
C6, C7, C12 - 0.01F ceramic disk
C9 - 47F, 16V electrolytic
Miscellaneous:
X1 - 230V AC primary to
0-9V, 500mA secondary
transformer
S1 - Push-to-on switch
- IC bases
- Wires
Fig. 2: Power supply circuit
the multivibrator. It can count up to output pulse from monostable IC3, 6) is shown in Fig. 9 with its components
9999. The counter can be reset to generated during an interruption, layout in Fig. 10.
zero at any time by pressing the reset will activate transistor T7 to drive the For easy servicing, use IC bases
microswitch. piezobuzzer for duration of the mono- to mount the ICs on the PCB. After
Thus the display, at any time, stable pulse. assembling the PCB, place it near the
shows the count of interruption of entry gate. Use long wires for connec-
the IR beam since the last reset. The Construction tions to the IR transmitter LED and IR
interruption counter can be employed An actual-size, single-side PCB layout receiver TSOP1736 so that these can be
as visitor counter or object counter in for the IR transmitter (Fig. 3) is shown taken out of the PCB and mounted on
industrial applications. in Fig. 7 and its components layout in the opposite pillars of the entry gate.
You can add a beeper circuit, as Fig. 8, while the combined PCB layout The transmitter should be oriented such
shown in Fig. 6, to provide an audible for the interruption counter (Fig. 4), that the transmitted IR ray directly falls
indication of each interruption. The power supply (Fig. 2) and beeper (Fig. on the receiver module.
W
hen recording sound from The two internal amplifiers share a
several orchestral instru- common bias network and power sup- Parts List
ments being played by dif- ply. The IC has short-circuit protection
Semiconductor:
ferent musicians using a single mi- and wide common-mode and differen- IC1 - 7812 +12V DC regulator
crophone, the only way to adjust the tial voltage ranges. IC2 - 7912 12V DC regulator
sound balance is to change the posi- In this application, +12V and IC3 - 747 dual operational
amplifier
tion of the musicians relative to the 12V regulated DC supplies are used IC4 - TDA1524A stereo tone
microphone. When recording direct to for operation of IC 747. The micro- controller
stereo master tape, its crucial to make phone output signals M1 through IC5 - LM386 low-power audio
sure that all the voices and instruments M4, after their individual level ad- amplifier
D1-D4 - 1N4001 rectifier diode
sound right before you hit the record justments, are mixed and applied LED1, LED2 - 5mm light-emitting diode
button. across the differential input terminals
Resistors (all -watt, 5% carbon):
Here is an eight-input audio mixer (pins 1 and 2). Similarly, micro- R1-R8, R18,
circuit with bass, treble, volume and phone outputs M5 through M8 are R19 - 1-kilo-ohm
balance controls, which you can use applied across the differential in- R9-R11, R14 - 10-kilo-ohm
to balance sounds from all the sources put terminals (pins 7 and 6) of the R12, R15 - 33-kilo-ohm
R13, R16 - 4.7-kilo-ohm
until you have the desired mix. For second amplifier inside op-amp R17 - 2.2-kilo-ohm
capturing the sound from various IC 747 after their individual level ad- R20 - 10-ohm
sources, the audio mixer employs up justments. VR1-VR8,
to eight microphones. For level adjustment, logarithmic VR15 - 10-kilo-ohm log potmeter
VR9, VR10 - 10-mega-ohm linear
variable resistors VR1 through VR4 potmeter
Circuit description and VR5 through VR8, respectively, VR11-VR14 - 47-kilo-ohm linear
Fig. 1 shows the block diagram of are employed while feeding the potmeter
the audio mixing system along with output from respective microphones Capacitors:
the audio power amplifier, while the to the input of the two amplifiers C1-C8,
circuit of the audio mixer along with inside IC 747. The outputs of the C22-C25,
C31, C33-C35,
tone controller is shown in Fig. 2. The two amplifiers taken from pins 12 C38 - 0.1F ceramic disk
power supply and audio power ampli- and 10, respectively, are combined at C9-C12, C41 - 10F, 25V electrolytic
fier circuits are shown in Figs 3 and 4, the junction of resistors R9 and R10 C13, C14 - 15nF ceramic disk
C15, C39 - 100F, 25V electrolytic
respectively. before feeding to the next stage (tone
C16, C19, C20,
Here, dual operational amplifier controller) via capacitor C12 (10 F). C21 - 2.2F, 25V electrolytic
C17, C18 - 56nF ceramic disk
C26-C29 - 47nF ceramic disk
C36 - 220F, 25V electrolytic
C37 - 3.3F, 25V electrolytic
C30, C32 - 1000F, 25V electrolytic
C40 - 33nF ceramic disk
Miscellaneous:
X1 - 230V AC primary to
12V-0-12V, 1A secondary
transformer
S1-S3 - SPST on/off switch
Loud-
speaker - 8, 1W loudspeaker
M1-M8, J1 - Audio input jack
RCA1,
RCA2 - Audio output RCA
connector
Fig. 1: Block diagram of the audio mixer with bass, treble, volume and balance controls
Fig. 5: Combined actual-size, single-side PCB for audio mixer and power Fig. 6: Components layout for the PCB in Fig. 5
supply circuits
The low-power audio amplifier em- are provided for setting the gainex- purpose PCB. Mount IC bases on the
ploying IC LM386 (IC5) shown in Fig. ternally to any value between 20 and PCB. There is no soldering method that
4 can output a maximum audio power 200by using an appropriate combi- is ideal for all IC packages. The use of
T
IC1 - CXA1619S FM receiver
he tuning of a frequency- IC2 - 7806 +6V regulator
modulated (FM) receiver to IC3 - CD40106 hex inverter
IC4 - LM386 audio power
an FM radio station frequency amplifier
involves a lot of hissing noise in T1 - BC548 npn transistor
BR1 - 1A bridge rectifier
between the stations, which is very D1 - 1N4148 switching diode
irritating for the operator and as D2- D4 - 1N4001 rectifier diode
such undesirable. Resistors (all -watt, 5% carbon):
Fig. 2: Internal circuit schematic around
Digital FM receivers are free pin 20 of CXA1619S R1 - 150-ohm
R2, R3 - 330-ohm
from this problem, because in them the R4 - 100-kilo-ohm
output is automatically clipped during frequency. In other words, this circuit R5 - 1-kilo-ohm
off-station gaps. However, digital FM mutes the output from an analogue R6 - 33-kilo-ohm
R7 - 68-kilo-ohm
receivers are comparatively much cost- FM receiver when its tuner circuit is R8 - 4.7-kilo-ohm
lier than their analogue counterparts. sweeping in between FM stations. R9 - 4.7-ohm
Analogue FM receivers employ Capacitors:
an LC tuning system that generates Circuit description C1 - 4.7F, 16V electolytic
C2, C8, C9 - 22pF ceramic disk
hiss noise at the output, which re- The FM muting circuit has been config- C3 - 0.047F ceramic disk
mains unclipped during off-station ured around a Sony CXA1619S AM/ C4 - 47nF ceramic disk
tuning. However, when the received FM receiver chip, which is available C5, C6 - 10F, 16V electolytic
C7 - 3.3pF ceramic disk
signal level is adequate (i.e., when the in a 30-pin PDIP package. Sony FM C10, C11 - 0.02F ceramic disk
receiver frequency is very close to an receiver chips are known for their su- C12 - 100F, 25V electolytic
C13, C15, C17 - 0.1F ceramic disk
FM transmitting station frequency), perior features and cost-effectiveness. C14 - 1000F, 16V electolytic
the limiter circuit preceding the ratio The functional block diagram of the C16 - 0.04F ceramic disk
detector circuit in an analogue FM re- chip is shown in Fig. 1. C18 - 1000F, 35V electolytic
VC1, VC2 - 77pF trimmer
ceiver will clip/limit any noise riding A complete circuit of the FM re-
Miscellaneous:
the FM carrier. ceiver including the muting circuit X1 - 230V AC to 6V-0-6V,
The simple FM muting circuit de- and power supply is shown in Fig. 500mA secondary
scribed here eliminates this hissing 3. Most of the FM kits available in transformer
RL1 - 5V, 500-ohm, open-type
noise from the output of an analogue the market also make use of Sony reed relay (PLA make)
FM receiver circuit when it is not reso- CXA1619S, which is a complete AM/ S1 - On/Off switch
CR1 - 10.7MHz, 2-pin ceramic
nating to any FM transmiting stations FM receiver IC with very few external resonator
CR2 - 10.7MHz, 3-pin ceramic
resonator
LS1 - 8-ohm, 1W loudspeaker
- Headphone
- Battery 1.5V4
J1 - Shorting jumper
Fig. 3: Complete circuit of the FM receiver including the muting circuit and power supply
However, when the receiver is
tuned to an FM station, its output
pin 20, as also input pin 1 of the CMOS
inverter gate, go low. As a result, the
output of the inverter gate goes high
to energise the relay via transistor T1.
The audio output from CXA1619S,
available at its pin 28, is passed via
100F capacitor C12 and the contacts
of reed relay to either the headphones
or the AF amplifier circuit only when
the relay is energised, which happens
only when the receiver is tuned to the
carrier frequency of an FM station.
Thus the annoying noise output of
the receiver during off station tun-
ing is not heard in the headphones or
the loudspeaker. In other words, the
circuit configured around the CMOS
inverter gate acts to mute the noise
output when the receiver is not tuned
to any FM transmitting station.
Power supply. The supply voltage
for inverter gate N1 (IC3), transistor T1 portable applications, four 1.5V cells use either a 75cm telescopic antenna or
and the FM receiver chip/kit has been may be used. Diode D3 in the power simply a wire of similar length.
derived from the output of IC 7806 so supply circuit ensures that when mains
that a regulated voltage is maintained is available, the battery output remains Circuit operation
across the entire circuit. Alternatively, isolated/not used. When no FM station is being received,
in the event of mains failure, and for Antenna. For antenna, you may diode D1 does not conduct and as
such, pin 1 of inverter gate N1 is held circuit needs no adjustments as the Construction
high while the output at pin 2 of the inverter gate has been kept biased to An actual-size, single-side PCB layout for
inverter remains low. Thus transistor 2/Vcc, and when a station is being the noise muting circuit for FM receiver
T1 does not conduct and relay RL1 re- tuned into the output at pin 20 of is shown in Fig. 4 and its component
mains cut off. So, whether the load is a CXA1619S starts falling, and when layout in Fig. 5. Provision for a jumper
headphone or an audio power amplifier the input of the CMOS gate goes be- has been made in the PCB so that either
stage driving a loudspeaker as shown low Vcc the logic state of the CMOS a headphone or AF amplifier circuit with
in Fig. 3, no audio will be heard in the changes abruptly and the FM station speaker may be used as desired.
headphones/speaker. In other words, can be heard via headphones or speak- This PCB can be fitted with a Phil-
when the receiver is not tuned to an FM er of the power amplifier. ips make miniature gang condenser or
stations frequency, the audio output In case the receiver circuit uses equivalent for VC1 and VC2. For power
from CXA1619S is muted. only a headphone as load, you can do on/off switch S1 and volume control
This muting circuit may be incor- away with the audio power amplifier VR1, a switch-cum-volume control is
porated into any readily available FM circuit including the loudspeaker. Pot- used in the PCB. The terminals of this
receiver kit as long as the FM receiver meter VR1 serves as volume control switch-cum-volume control need to be
chip used in the kit has a metering pin for the headphones or the AF power directly soldered over the corresponding
for connecting an LED. The muting amplifier, whichever is in use. pads on the PCB.
T
his stepper motor controller is Stepper motors of various ratings/ heat-sinks. Pin details of BD139 and
perhaps the cheapest, smallest specifications are available in the mar- regulator IC 7805 are shown in Fig. 2.
and simplest. A pair of H-bridg- ket for different applications. Here, the The bases of all the eight transistors are
es with a software program written stepper motor is taken from an 8.9cm connected to data pins (D0 through D7)
in C++ is used to control the bipolar (3.5-inch) floppy drive. Its a bipolar of the 25-pin, D-type male connector
stepper motor with a step resolution of stepper motor rated at 5V through 1-kilo-ohm current
18 degree per pulse. DC with step resolution of limiting resistors R1 through
The controller is a combination 18o per pulse. The motor R8.
of driver and switching circuits. has two coils inside and The bases of transistors
The driver is the actual circuit that four terminals (colour- T1 and T4 are connected to
drives the stepper motor and the coded, but not always) for parallel-port pins 2 (D0) and
switching circuit decides how the mo- external connections. Step- Fig. 2: Pin details of 3 (D1) through resistors R1
tor should be driven. So, it is basically per motors rated at 5V and BD139 transistor and and R2, respectively, and the
regulator IC 7805
the switching circuit that controls the up to 1 ampere of current bases of transistors T2 and T3
motor. The transistors (T1 through and different step size (e.g., are connected to parallel-port
T8) act as switches. The switching of 1.8 per pulse) may also be used with pins 4 (D2) and 5 (D3) through resis-
these transistors is controlled by the this circuit and control software. tors R3 and R4, respectively. The red
software via data pins D0 through D7. and orange terminals of the first coil
You can control three parameters of Circuit description (COIL1) are connected to the first H-
the stepper motor: speed, direction and H-Bridge driver. H-Bridge is a stan- bridge section as shown in Fig. 1.
number of steps. To vary the speed of dard, well-known circuit widely used The bases of transistors T5 and
the motor, you have to vary the pulse as stepper motor driver. It is a bridge T8 are connected to pins 6 (D4) and
repetition frequency (PRF). To change connection of four transistors (see Fig. 7 (D5) through resistors R5 and R6,
the direction of the motor, you have to 1). Because there are two coils in the respectively, and the bases of transis-
change the sequence of pulses applied bipolar stepper motor, two H-bridge tors T6 and T7 are connected to pins
to its coils. By limiting the number of circuits, one for each coil, have been 8 (D6) and 9 (D7) through resistors
applied pulses, you can restrict the used. One H-bridge is formed by tran- R7 and R8, respectively. The yellow
motor to complete the desired number sistors T1 through T4 and the other and green terminals of the second
of steps. bridge is formed by transistors T5 coil (COIL2) are connected to the
second H-bridge section
as shown in Fig. 1.
Power supply. The
power supply section is
shown in Fig. 3. It consists
of a 230V AC to 9V AC,
1A secondary transformer
(X1), filter, bridge recti-
fiers and 5V DC regulator
7805 (IC1). The regulated
5V DC is connected to
the H-bridge circuits. The
circuit ground is shorted
to pins 18 through 25 of
the D-type parallel-port
connector. When switch
Fig. 1: Circuit of PC-based stepper motor controller S1 is closed, LED1 glows
Operation
Specific sequence of pulses are given
to the red and orange terminals of
COIL1 and yellow and green terminals
of COIL2 to rotate the motor either in
clockwise or anticlockwise direction as
explained in the following paragraph.
Fig. 3: Power supply for the circuit
Direction control. In Tables I and
II, 0 indicates low logic and 1 indi- terminals should be high, while orange
cates high logic. We know that the cur- Table I and yellow terminals should be low.
rent flows from high to low. Changing Pulse Sequence to Rotate To achieve this, transistors T1, T4, T5
the direction of rotation is nothing but the Motor Clockwise and T8 should conduct. For this, hex
changing the direction of current that Data bit D7 D6 D5 D4 D3 D2 D1 D0 data word will be 33 (0011 0011).
flows through the coils. Port pin 9 8 7 6 5 4 3 2 In the next phase, red and yellow
Speed control. To vary the speed, Phase 1 1 1 0 0 1 1 0 0 terminals should be low, while orange
you have to vary the pulse repetition Phase 2 0 0 1 1 1 1 0 0 and green terminals should be high. To
frequency (PRF). The PRF of 20 Hz Phase 3 0 0 1 1 0 0 1 1 achieve this, transistors T1, T4, T6 and
means 20 pulses will be given to the Phase 4 1 1 0 0 0 0 1 1 T7 should conduct. For the purpose,
stepper motor in one second. Since 1= High, 0 = low hex data word C3 (1100 0011) has to
the step resolution of the motor is 18o/ be output from the LPT port.
pulse, the motor will rotate 20x18o = Table II Thus the data sequence to be fed to
360o (one complete revolution) in one Pulse Sequence to Rotate the port for clockwise rotation of the
second. So the speed of the motor is the Motor Anti-clockwise motor is CC-3C-33-C3.
one revolution per second (RPS) or Anticlockwise rotation. To rotate
Data bit D7 D6 D5 D4 D3 D2 D1 D0
60 RPM. Now if you increase the PRF Port pin 9 8 7 6 5 4 3 2 the motor in anti-clockwise direction,
from 20 Hz to 40 Hz, the RPS will also the sequence of hex data to be output
Phase 1 1 1 0 0 1 1 0 0
double to 2 RPS (120 RPM). from the LPT port will be CC-C3-33-
Phase 2 1 1 0 0 0 0 1 1
Number of rotations. The step reso- 3C.
Phase 3 0 0 1 1 0 0 1 1
lution of 18/pulse means if you apply Phase 4 0 0 1 1 1 1 0 0
only one pulse, the motor will rotate by The software
1= High, 0 = low
18. If you apply 10 pulses sequentially, All the controlling actions are per-
the motor will rotate 180o (half of a tables. The current will flow into/out formed by the software program. The
revolution). So if you limit the number of the coils through the four terminals program is written in C++ language
of pulses applied to the motor, you can of the motor (red, orange, green and and compiled in Turbo C++ Version
stop it at any angular position (multi- yellow). 3. The complete software program
ple of 18) after completing the desired Clockwise rotation. In the first (STEPCNT.CPP) is given at the end
number of full revolutions. Thus if you phase, orange and green terminals of this article along with necessary
apply only 25 pulses, the motor will should be high and red and yellow comments. You require the egavga.bgi
complete one full revolution and rotate terminals should be low. To achieve graphic file to be in the same directory
further by 90 ( revolution) and stop. this, out of the eight transistors, four as the application program to run the
H-bridge. The transistors in the transistors (T2, T3, T6 and T7) should program. The output of the program is
circuit act as switches. When high logic conduct. For this, you have to output shown in Fig. 4.
(3.49V) is applied to any data pin of hex data word CC (1100 1100) from The main functions of the software
the port, the transistor connected to it the LPT port. are:
conducts and acts as a closed switch, In the second phase, red and yel- 1. Change the direction of rotation
allowing the current to pass through it. low terminals should be high, while of the stepper motor by switching the
When low logic (0.09V) is applied, the orange and green terminals should be eight transistors in proper manner.
transistor stops conducting and acts as low. To achieve this, only transistors 2. Vary the RPM of the stepper mo-
an open switch, so the current cannot T2, T3, T5 and T8 should conduct. For tor accurately.
pass through it. this, you have to output hex data word 3. Stop the motor at a given angular
The pulse sequences to be given 3C (0011 1100) from the LPT port. position after the desired number of
to switch the transistors are shown in In the next phase, red and green complete rotations
Stepcnt.cpp
#include<graphics.h> driver = DETECT; rotations = 1
#include<conio.h> int initmouse(); // to load mouse driver float r=1,n=5;
#include<dos.h> int resmptr(int p,int q,int r,int s); //restric mouse initgraph(&driver, &mode, C:\\tc\\bgi); //initial-
#include<process.h> pointer within boundry ize graphics mode
#include<iostream.h> int showmptr(); // shows mouse pointer outport(0x0378,0x00); // clear parallel port
union REGS i,o; int getmpos(int *t,int *u, int *v); // captures the cur- if(initmouse() == 0)
void main() rent position of mouse pointer { // load mouse driver if not
{ int text(int e,int f); // changes the size and color closegraph(); // exit the
int driver,mode,x,y,but; //intialitions of all vari- of text program
ables and functions float s1,d=50,s=60; // default RPM=60 and no. of restorecrtmode();
S
IC1 - NE555 timer
tarters for 3-phase squirrel-cage windings is 1/ 3 of line-to-line sup- T1 - BC557 pnp transistor
induction motors often use star- ply voltage and so the current flowing T2 - BC547 npn transistor
to-delta converters. The stator through each winding is also reduced D1- D16 - 1N4007 rectifier diode
D17 - 1N4148 switching diode
coils of the motor are connected in star by this factor. Compared to delta con- LED1 - Green LED
configuration at the time of power-on nection, the resultant current flowing LED2 - Red LED
and switched to delta configuration from the supply, as also the torque, Resistors (all -watt, 5% carbon):
when the motor reaches 3/4th of its is reduced by a factor of 1/3 in star R1 - 56-kilo-ohm
R2-R5 - 1-kilo-ohm
full speed, after the stator coils have configuration. The relevant equations VR1 - 470-kilo-ohm preset
developed sufficient back electromag- for star and delta connections are given Capacitors:
netic force (emf). in the box. C1 - 1000F, 25V electrolytic
The starter circuit presented here As soon as the moment of inertia C2, C3 - 10F, 25V electrolytic
C4 - 470F, 25V electrolytic
offers two main advantages: single- is overcome, and sufficient back emf C5 - 0.01F ceramic disk
phase prevention and automatic star- is induced in the stator windings, the Miscellaneous:
to-delta conversion. It can be used only star connection is opened and the ends X1-X3 - 230V AC primary to
12V, 300mA secondary
with those motors which are rated for of the windings are connected to the transformer
connection in delta configuration at the 3-phase supply in a fashion to create a RL1, Rl2 - 12V, 200-ohm, 1c/o
given line voltage and which have both delta connection. relay
RL3, RL4 - 12V, 250-ohm, 3c/o, 30A
ends of each of the three stator wind- relay
ings available individually. Induction motor basics
At start, the line voltage is applied The AC induction motor, also called field produced by the AC line current
to one end of each of the three wind- the squirrel cage motor, comprises a in the stator induces a current in the ro-
ings, with the other ends bridged simple cage-like rotor and a stator con- tor, which interacts with the field and
together, effectively connecting the taining three windings. The changing causes the motor to rotate.
The base speed of the AC motor
is determined by the number of poles
built into the stator windings and the
frequency of the AC input voltage. A
load on the motor causes the motor to
slip in proportion to the load.
Circuit description
Fig. 1 shows the circuit of the automatic
star-to-delta converter comprising a
single-phase preventer and a timer.
Three single-phase transformers
are used to step-down the 3-phase sup-
ply separately. Phases R, Y and B are
stepped down by transformers X1, X2
and X3 to deliver the secondary output
of 12V at 300 mA. The transformer out-
put is rectified by a full-wave rectifier
and filtered by a capacitor.
The three 12V DC supplies drive
relays RL1, RL2 and RL3, respectively.
When all the three phases are present,
the 12V DC supply derived from the R
T
he AVR 8535 microcontroller 8. Reset is possible through the
and its new version ATme- software, and a watchdog is provided.
ga8535 are versatile, high- Power-down or sleep modes are avail-
performance but low-cost chips. This able.
article series covers typical applications 9. An additional serial interface,
of this processor illustrating its power known as the SPI bus, with three wires:
and cost-effectiveness in an embedded data (2) and clock (1). These pins can
system. be used for programming or loading
The AVR family comprises several the code from a PC through the printer
chips, all with almost the same instruc- port or serial port. For programming
tion set. Of them, the 90S8515, 90S8535 the internal flash memory locations,
and ATmega8535 chips are low-cost and just 5V supply is enough.
readily available with the complete set of 10. Two PWM output pins, which
port pins. The Atmega8535-16 is more are useful for power control applica-
powerful and available for around Rs tions.
250. Capable of running at 16 MHz and 11. Several timers as in other mem-
achieving almost 16 million instructions Fig. 1: Pin configuration of ATmega8535 bers of the 8051 family, but with much
per second (MIPS), it is one of the fastest better time resolution.
devices available in the market today. 12. Additional
Using ATmega8535, you can build features like input
a microcontroller-based project with capture and output
following features: compare.
1. Four ports, of which one of them Here, we shall
has eight analogue-to-digital converter delve into the chips
(ADC) channels operations with typi-
2. ADC conversion time is as little cal programs and cir-
as 60 microseconds. Imagine adding cuits. All the develop-
an external ADC to 8051 or any other ment tools including
microcontroller chipthat would have C compiler are avail-
taken the cost to over four digits. And able for free from the
mind you, it is a 10-bit ADC, not just Internet.
8-bit. Fig. 2: A simple LED display circuit using ATmega8535 The features of
3. If an 8MHz crystal is connected, ATmega8535 make it
each instruction executes in 1/8th of receive terminals much like the 8051 the right candidate for various embed-
a microsecond. The 89C51 at 12MHz family, but it can support even higher ded control applications. Even a digital
clock had its internal division by baud rates. filter can be implemented on the de-
twelve, so it ran at just one microsec- 5. It has quite a few internal regis- vice, provided you are fully conversant
ond. Thus, ATmega8535 chip is eight ters, RAM, EEPROM and CODE mem- with its hardware and software fea-
times faster with an 8MHz crystal. ory (flash memory in excess of 4kB). tures. You can download the databook
However, you can also use a higher- 6. The instruction set is versatile, of ATmega8535 from the ATMEL.com
frequency crystal. The chip is basically complete with several arithmetic, logic Website to understand its features and
a RISC processor that executes most and transfer instructions and related work out simple applications.
instructions in one clock cycle itself. jump instructions, etc. The sample programs given here
4. The chip has RS-232 transmit and 7. An analogue comparator pin, can be used to yield a powerful con-
Fig. 9: Actual-size, single-side PCB layout for message display on LCD Fig. 10: Component layout for the PCB in Fig. 9
Once a program has been written Upon Dos prompt, enter copy program. The .asm is not to be typed.
using any editor, wordpad or notepad, con avr.bat. In the following line, type In our LED.asm program, we have
it is assembled using the avrasm.exe Avrasm -i %1.asm %1.lst %1.hex. included the m8535def.inc file. This
AVR assembler, available on the down- Pressing F6 key in the following line file is required along with the avrasm.
load link given at the end of this article. displays Control-Z. Now pressing the exe cross-assembler. For other AVR
Of course, the AVRSTUDIO 4.0 inte- Enter key displays 1 file copied. processors like 90S8515, 90S8535 and
grated development environment (IDE) Now the avr.bat file has been pre- at-Tiny 26, the files to be included are
is more versatile and user-friendly soft- pared. This simple batch file is invoked 8515def.inc, 8535def.inc and tn26def.
ware for development, but the avrasm. to assemble this (or any) program inc, respectively.
exe assembler is simpler and direct. by typing Avr LED upon the DOS The next task is to burn the code
Simply typing avrasm -i LED. prompt and pressing the Enter key. into the chip. Note that a chip previ-
asm LED.lst LED.hex under the DOS This assembles the program, and ously programmed or erased is auto-
prompt makes the cross-assembler forms both the list file (that contains matically erased when a new program
generate code for the LED.hex file and the code-cum-Assembly listing) and is burnt into it using the device pro-
also provide a text file giving both the the hex file (the actual Intel-format hex grammer as described below.
code and the program together in LED. file for use by the programmer).
lst. Thus, you get the LED.lst listing file Likewise, any other assembly pro- The AVR device
and the LED.hex Intel hex code file. gram xxx.asm can be coded into the hex programmer
Alternatively, you can prepare a file by simply typing avr xxx on DOS The AT-PROG programmer software
batch file as follows: prompt. xxx denotes the name of the is used for programming ATmega8535.
Architecture of
ATmega8535
Pin configuration of ATmega8535 was
shown in Fig. 1 of Part 1. The device
has ports for input/output, interrupts,
serial communication and various oth-
ers functions. There are a total of 32
pins, which are arranged as A, B, C Fig. 11: Circuit diagarm of real-time clock
and D ports for various functions as
shown in Table I. Programming the on-chip structions are built into the AT-PROG
A crystal of maximum 16MHz code/program memory program (explained in Part I), which is
or 8MHz frequency can be con- The on-chip flash memory is run on the host PC.
nected across pins 12 and 13 of AT- programmed by pulling up the reset Selection of clock. There are some
mega8535 or its low-voltage version pin and sending data through pins additional fuse bits, which can be
ATmega8535(L), respectively. Pin 9 6 (MOSI) and 7 (MISO), and pin 8 programmed for some extra op-
serves as the active-low reset pin. (SCK), which is used for clocking the erational functions. Note that the
The non-volatile program and data the code data into the flash memory. AVR device, as shipped, is preset to
memories built into ATmega8535 are: This is accomplished by the host work at 1 MHz with its internal oscil-
1. 8 kB of self-programmable flash computer by sending appropriate lator. If you want to use an external
for storing the software code of the ap- instructions and the code bytes; data crystal, say, of 8MHz frequency, you
plication program. verification is done by reading the have to exercise this option by pro-
2. 512 bytes of SRAM, which is a flash memory and comparing it with gramming the fuse bits accordingly. A
read/write memory. the original code data. Writing the lock fuse bit is just like a flash code memo-
3. 512 bytes of EEPROM for storing bits to prevent reading of the code in ry location.
the data. Unlike the flash memory, it the chip is accomplished through the The CKSEL fuse bits can be pro-
can be accessed in a program for writ- instructions and the relevant data. grammed to select the desired crystal.
ing and reading. For using the AVR device, these in- The device clocking options are select-
able by Flash Fuse bits as shown in
Table I Table II. The clock from the selected
Port Description source is input to the AVR clock gen-
Port description Pin Nos. Usage erator and routed to the appropriate
Port A (PA0-PA7) 40 to 33 Bidirectional I/O pins with 20mA sink capability and active modules.
internal pull-ups; alternately used as ADC input as well as data Since the default oscillator is
lines to external RAM 1MHz, unless we set the CKSEL bits
Port B (PB0-PB7) 1 to 8 Input or output port, also used for additional functions as T0, to an appropriate value, the external
T1, AIN0, AIN1, SS, MOSI, MISO and SCK pins
crystal on pins 12 and 13 will not func-
Port C (PC0-PC7) 22 to 29 Used for address output if external RAM is attached; four pins
are alternately used as SCL, SDA for I2C, TOSC1 and TOSC2,
tion for ATmega8535.
respectively Programming the fuse bits. The
Port D (PD0-PD7) 14 to 21 Bidirectional, as for port A. Also serve as pins for serial fuse bit programming option is avail-
communication, interrupts 0 and 1, and PWM 1 and 2 output able on the screen when the AT-PROG
comparison, etc. is run on the PC. When this option is
Table III
Some Registers in the I/O Space of ATmega8535
DDRB data direction reg. of port B $37 DDRA $3A DDRC $34 DDRD $31 UDR Uart data reg. $2C
PINB input reg. of port B $36 PINA $39 PINC $33 PIND $30 UCSR Uart control reg. A=$2B B=$2A
PORTB output reg. port B $38 PORTA#3B PORTC $35 PORTD$32 UBRR Uart baud rate reg.
ADMUX adc channel sel. $27 ADCSRA ADC control/ ADCH adc value ADCL: adc value low- ACSR analogue comparator control/
status register* $26 high reg. $25 byte reg. $24 status reg. ($28)
*ADC in ATmega8535 is named ADCSRA
8535clk.asm
; Things to learn here: internally itself brlt SecRet ; jump if less than 60
; - Timer in interrupt mode rcall init_lcd ;initialise LCD module ldi mp,256-$60 ; Load mp to add sec to zero
; - Interrupts, Interrupt-vector ldi R16,$80 add sec,mp ; Add mp to reset sec to zero
; - BCD-arithmetic rcall cmd rcall incmin
.LIST ; Software-Counter-Register reset to zero SecRet:
.NOLIST ldi mp,0 ; z1 cannot be set to a constant ret ; return to the main program loop
.INCLUDE m8535def.inc value, so we set mp incmin: ;subroutine for minutes incrementing
;device =ATMEga8535 mov z1,mp ; to zero and copy that to R0=z1 sec ; Setze Carry-Flag for adding an additional
.LIST mov sec,mp ; and set the seconds to zero one to the seconds
; Universal register definition mov min,mp ;and minutes also ldi mp,6 ; provoke overflow of the lower nibble
.DEF mp = R16 ldi mp,$12 by adding 6
.DEF result=R18 mov hour,mp adc min,mp ; add 6 + 1 (Carry)
; Counter for timer timeouts, MSB timer driven ; Prescaler of the counter/timer = 64, that is 1 brhs Chk60_m ; if overflow of the lower nibble
by software MHz/64 = 15625 Hz = $3D09 occurred go to 60 check
.DEF z1 = R0 ldi mp,0x03 ;Initiate Timer/Counter 0 Prescaler sub min,mp ; subtract the additional 6 as no
; Working register for the Interrupt-Service- as /64 overflow occurred
Routine out TCCR0,mp ; to Timer 0 Control Register Chk60_m:
; Note that any registers used during an inter- ; enable interrupts for timer 0 ldi mp,$60 ; 60 minutes already reached?
rupt, including the status-register with all the ldi mp,$01 ; set Bit 0 but for 8515 this was bit 1! cp min,mp
flags must either be reserved for that purpose out TIMSK,mp ; in the Timer Interupt Mask brlt minRet ; jump if less than 60
; or they have to be reset to their initial Register ldi mp,256-$60 ; Load mp to add min to zero
; value at the end of the service routine! Oth- ; enable all interrupts generally add min,mp ; Add mp to reset min to zero
erwise sei ; enable all interrupts by setting the flag in RCALL INCHOUR
; nearly unpredictable results will occur. the status-register minRet:
.DEF ri = R1 ; The 8-bit counter overflows from time to time ret ; return to the main program loop
; Register for counting the seconds as packed and the interrupt service INCHOUR:
BCD ; routine increments a counter in a register. The sec
.DEF sec = R2 main program loop reads this ldi mp,6
.DEF min = R3 ; counter register and waits until it reaches 3D adc hour,mp
.DEF hour=R4 hex. Then the timer is read until brhs chk12hour
.DEF count=R5 ; it reaches 09 (one second = 15625 (dec)= sub hour,mp
.DEF count1= R6 3D09(hex) timer pulses). The timer chk12hour:
.CSEG ; and the register are then set to zero and one ldi mp,$13
.ORG $0000 second is incremented. The seconds cp hour,mp
; Reset- and Interrupt-vectors ; are handled as packed BCD-digits (one digit = brlt houret
rjmp Start ; Reset-vector four bits, one byte represents ldi mp,256-$12
.org ovf0Addr ; two digits). The seconds are refreshed. The add hour,mp
rjmp tc0i seconds houret: ret
; Reset-vector to address 0000 ; are displayed on the LCD module, as well. lookupdate:
.org $30 ldi mp,0x31 ;just show a 1 to begin with k2: sbic pinc,0
start: rjmp main rcall lcdwr ret ;if key is not closed, return
; Be sure that the jump loop: ;if closed, wait for key-debounce and
; to the interrupt service routine tc0i is exactly ldi mp,$3D ; compare value for register counter check again
at the adress ovf0,otherwise the interrupt fails. loop1: rcall lookupdate ; check if user adjusts rcall delay1
; The following sequence takes place : If the time- Inc count1
timer overflows minutes ldi mp,80
; (transition from 255 to 0) the program run is rcall lookupdatehr ; check if user adjusts time- cp count1,mp
interrupted, the current address in the program hours brlt dd
counter cp z1,mp ; compare with the register RCALL incmin
; is pushed to the stack, the instruction at ad- brlt loop1 ; z1 < mp, wait Ldi mp,0
dress ovf0 loop2: Mov count1,mp
; is executed (the jump instruction). After fin- in mp,TCNT0 ; read LSB in the hardware dd: rcall display
ishing execution of the interrupt service routine counter ret
; the program counter value is restored from the cpi mp,$09 ; compare with the target value lookupdatehr:
; stack and program execution proceeds from brlt loop2 ; TCNT0 < 09, wait k3: sbic pinc,1
that point. ldi mp,0 ; set register zero and ... ret ;if key is not closed, return
tc0i: out TCNT0,mp ; reset hardware-counter LSB ;if closed, wait for key-debounce and check
in ri,SREG ; save the content of the flag mov z1,mp ; and software-counter MSB again
register rcall IncSec ; call the subroutine to increment rcall delay1
inc z1 ; increment the software counter the seconds inc count
out SREG,ri ; restore the initial value of rcall Display ; call subroutine to display the ldi mp,80
the flag register seconds cp count, mp
reti ; Return from interrupt rjmp loop ; once again the same brlt dd
.org $50 ; subroutine increment second counter RCALL inchour
; The main program starts here ; in BCD-arithmetic! Lower nibble = Bit 0..3, up- Ldi mp,0
main: per nibble = 4..7 mov count, mp
ldi mp,LOW(RAMEND) ;Initiate Stackpointer IncSec: rjmp dd
out SPL,mp ; for the use by interrupts and sec ; Set Carry-Flag for adding an additional one ; subroutine for displaying the time on the LCD
subroutines to the seconds Display: push r16
ldi mp,HIGH(RAMEND) ldi mp,6 ; povoke overflow of the lower nibble ldi r16,$80
out SPH,mp ; Port b (pin 1-8) output-port, by adding 6 rcall cmd
port c all output except bit 0,1 adc sec,mp ; add 6 + 1 (Carry) pop r16
ldi mp,0xFF ; all bits are output brhs Chk60 ; if overflow of the lower nibble mov r16,hour
out DDRb,mp ; to data direction register occurred go to 60 check andi r16,0xf0
ldi mp,0xFc ;bits 0,1 input; pin22 for minutes sub sec,mp ; subtract the additional 6 as no ror r16
set; pin23 hour set; overflow occurred ror r16
out DDRC,mp Chk60: ror r16
LDI MP,03 ldi mp,$60 ; 60 seconds already reached? ror r16
OUT PORTC,MP ;pull up port C bits 0- 1 cp sec,mp ori r16,0x30
lets now examine the use of inbuilt Principle of pulse-width modula- When the number stored in the
functions of AVR ATmega8535 (such as tion. To generate different analogue output-compare register (OCR) match-
output compare, ADC and UART) for levels, the duty cycle and thereby the es the loaded count value, pin 19 (out-
various applications. pulse-width of the digital signal (base put-compare action pin) becomes high
frequency) is changed. If a high ana- or low, as programmed. For example,
PWM operation of logue level is needed, the pulse width if the OCR is loaded with a value of
ATmega8535 is increased and vice versa (see Figs 15 l00, the logic state of OCR pin will be:
When the AVR is configured for pulse- and 16).
width modulated (PWM) operation, A digital pulse train with a constant Count value OCR pin
the PWM outputs become available at period (fixed base frequency) is used 0 to 100 Low logic
output-compare pins 18 (OC1A) and as the basis. The base frequency, which 100 to 255 High logic
19 (OC1B) of ATmega8535. PWM, in can be programmed suitably, should 255 to 100 High logic
conjunction with an analogue filter, be much higher than the frequency of 100 to 0 Low logic
can be used to generate analogue the output analogue signal obtained
output signals and thus it serves as a after filtering out the base frequency Thus, for the total time taken to
digital-to-analogue converter. component. For example, to generate count 2552=510 clock ticks, the output
a sinewave signal of low fre- pin (pin 19) will be high for (2155)/
quency (say, 10 Hz, as used (2256) or 60.5 per cent of the total tri-
for drives or controls), the angular wave time of one PWM pulse
base frequency of rectangular (or the PWM pulse will have a duty
pulses (with varying duty cycle of 60.5 per cent). Thus, effectively
cycle) may be of the order of 1 the voltage transmitted in this period is
kHz or more. 60.5 per cent of the maximum, because
Pulse generation method. the pulse is high only for this period
Fig. 15: Variation of pulse width (constant period) with time of a
typical PWM wave
The scheme for pulse gen- of time.
eration is as follows: Timer/ The following program (avrsine.
counter 1 is used to count asm) will generate a 1Hz sine wave
clock ticks. If 8-bit PWM (after filtering) on pin 19 using PWM:
is selected, after the timer
counts up to 255, its count AVRSINE.ASM
;
is decremented with each ; File: avrsine.asm
clock tick. Thus, the number ; Description: Example of how to use the fast PWM
; of the Avr to generate sine-wave signal. The PWM
increases up to 255 and then ; output requires filtering to shape the sine wave
; form.
Fig. 16: View of filtered low-frequency sine wave and unfiltered
decreases, resembling a trian- ;
.include m8535def.inc
PWM output on an oscilloscope gular pattern.
tion details, see Table 85 of the ADC output on the LCD nop
nop
sbi portc,4 ;chip select high
ATmega8535(L) datasheet.) The following program (adc_lcd. busy1:lds R16,pinb
rol R16
Bit 5 (ADLAR, or AD left adjust asm) takes the ADC data, converts brcs busy1
cbi portc,4
result) affects selection of results in the 10-bit data into five decimal digits ret
ADCH and ADCL registers. If this bit and then shows it continuously on the init_lcd: ;initialise LCD
ldi R16,$38
is made 0, the ADCL contains the LCD screen: rcall cmd
rcall delay1
least eight bits and the ADCH con- rcall delay1
ldi R16,$0e
tains the remaining two high-order ADC_LCD.ASM rcall cmd
; ************************************************* rcall delay1
bits in its D1:D0 bit positions. When ; *This program uses channel -0 ADC of ATmega8535 ldi R16,6
the ADLAR bit is set to 1, the ADCH ; It reads the ADC and outputs the five-digit
; number on LCD.
rcall cmd
ldi r16,1
contains the most significant eight ; Program authored by Prof. K. Padmanabhan rcall cmd
; ************************************************* rcall delay1
bits, while the ADCL contains the least .NOLIST ret
.INCLUDE m8535def.inc delay1:clr result
two significant bits in bit positions ;device =ATMega8535 loop22:ldi R16,$f0
.LIST loop2:inc R16
7 and 6.
brne loop2 .def tBCD1 =r14 out SPH, R16; Initialize high byte of stack
inc result ;BCD value digits 3 and 2 pointer to end of internal RAM
brne loop22 .def tBCD2 =r15 ldi rmpr,0b00000001;TIMER 0 INTERRUPT ENABLE
ret ;BCD value digit 4 out TIMSK,rmpr
lcddisp: push r16 .def fbinL =r16 ldi rmpr,05 ; So, we get once 1x10^6/1024=1000 Hz
ldi r16,128 ;cursor to left end ;binary value Low byte out TCCR0,rmpr ;prescalar 1024 so that timer
rcall cmd .def fbinH =r17 interrupt occurs at 1KHz rate
pop r16 ;binary value High byte ldi r16,$c0 ;c0 for int. ref, e0 with adch
rcall binbcd .def cnt16a =r18 alone used.
mov r16,r15 ;loop counter out admux,r16 ;channel 0 is selected
andi r16,0x0f .def tmp16a =r19 ldi r16,0b11000101 ;prescale /32 (1x32=33 usec)
ori r16,0x30 ;temporary value ;adc enable,adc start,adc freerun,adcflag,adcno int,
rcall lcdwr ; 1 bin2BCD16: adcprescale/32
mov r16,r14 ldi cnt16a,16 ;Init loop counter out adcsra,r16
andi r16,0b11110000 clr tBCD2 ldi r16,0
ror r16 ;clear result (3 bytes) out sfior,r16 ;write 0-0-0 to bits d7-d5 for
ror r16 clr tBCD1 free run
ror r16 clr tBCD0 adc
ror r16 clr ZH here1:in r16,adcsra
ori r16,0x30 ;clear ZH (not needed for AT90Sxx0x) andi r16,0b01000000
rcall lcdwr ;2 bBCDx_1:lsl fbinL ;shift input value breq here1 ;value got
mov r16,r14 rol fbinH ldi R16,255
andi r16,0x0f ;through all bytes out ddrb,R16 ; port b is all bits output
ori r16,0x30 rol tBCD0 ; out ddrc,R16 ; so is port c
rcall lcdwr ;3 rol tBCD1 ldi r16,0
mov r16,r13 rol tBCD2 out ddra,r16 ;port a input
andi r16,0b11110000 dec cnt16a init: sei ;enable global interrupt
ror r16 ;decrement loop counter LCD: rcall init_lcd
ror r16 brne bBCDx_2 ;if counter not zero ldi R16,$80
ror r16 ret ; return rcall cmd
ror r16 here3:in r16,adcsra
ori r16,0x30 bBCDx_2:ldi r30,AtBCD2+1 andi r16,0b01000000
rcall lcdwr ;4 ;Z points to result MSB + 1 brne here3 ;value got
mov r16,r13 bBCDx_3: ld tmp16a,-Z ;get (Z) with in r16,adcl
andi r16,0x0f pre-decrement in r17,adch
ori r16,0x30 subi tmp16a,-$03 ;add 0x03 rcall lcddisp
rcall lcdwr ;5 sbrc tmp16a,3 ;if bit 3 not idle: ldi r16,(1<<SE)
ret clear out mcucr,r16
binbcd: st Z,tmp16a ;store back sleep
;* bin2BCD16 - 16-bit Binary to BCD conversion ld tmp16a,Z ;get (Z) rjmp idle
;* converts 16-bit number (fbinH:fbinL) to a 5-digit subi tmp16a,-$30 ;add 0x30 restrt:ldi r16,$80 ;point to first cursor
;* packed BCD number represented by 3 bytes sbrc tmp16a,7 ;if bit 7 not rcall cmd ; command to lcd to position cursor
(tBCD2:tBCD1:tBCD0). clear rcall delay1
;* MSD of 5-digit number is placed in lowermost st Z,tmp16a ;store back ldi r16,0b11000101 ;prescale /32 (4.43/32=138
nibble of tBCD2. cpi ZL,AtBCD0 ;done all three? usec)=7.2Khz
;* Number of words :25 brne bBCDx_3 ;loop again if ;adc enable,adc start,adc freerun,adcflag,adcno int,
;* Number of cycles :751/768 (Min/Max) not adcprescale/32
;* Low registers used :3 (tBCD0,tBCD1,tBCD2) rjmp bBCDx_1 out adcsra,r16
;* High registers used :4(fbinL,fbinH,cnt16a,tmp16a) here4: in r16,adcsra
;* Pointers used :Z ; Main program routine starts here andi r16,0b01000000
Subroutine register variables Start:ldi R16,low(RAMEND);Load low byte address brne here4 ;value got
.equ AtBCD0 =13 of end of RAM into register R16 in r16,adcl
;address of tBCD0 out SPL,R16; Initialize stack in r17,adch
.equ AtBCD2 =15 pointer to end of internal RAM sbi adcsra,6 ;restart adc
;address of tBCD1 ldi R16,high(RAMEND);Load hh: rcall lcddisp
.def tBCD0 =r13 high byte address of end of RJMP restrt ; Test of the serial interface
;BCD value digits 1 and 0 RAM into register R16
W
IC1-IC5 - NE555 timer
hile driving on highways, checker. It has been designed assuming IC6- IC9 - CD4026 decade
motorists should not exceed that the maximum permissible speed counter/7-segment
decoder
the maximum speed limit for highways is either 40 kmph or 60 IC10 - CD4011 NAND gate
permitted for their vehicle. However, kmph as per the traffic rule. IC11 - 7812 12V regulator
D1, D2 - 1N4148 switching diode
accidents keep occurring due to speed The circuit is built around five D3-D6 - 1N4007 rectifier diode
violations since the drivers tend to ig- NE555 timer ICs (IC1 through LED1 - Green LED
LED2, LED3 - Red LED
nore their speedometers. IC5), four CD4026 counter ICs (IC6 DIS1-DIS4 - LTS543 common-cath-
This speed checker will come through IC9) and four 7-segment ode, 7-segment display
handy for the highway traffic police displays (DIS1 through DIS4). IC1 Resistors (all -watt, 5% carbon):
R1, R4 - 100-kilo-ohm
as it will not only provide a digital through IC3 function as monostables, R2, R5, R6,
display in accordance with a vehicles with IC1 serving as count-start mono, R8, R10,
R11, R14 - 10-kilo-ohm
speed but also sound an alarm if the IC2 as count-stop mono and IC3 as R3, R7, R13,
vehicle exceeds the permissible R16-R19 - 470-ohm
R9 - 470-kilo-ohm
speed for the highway. R12, R15 - 1-kilo-ohm
The system basically com- VR1, VR2 - 100-kilo-ohm preset
VR3 - 20-kilo-ohm preset
prises two laser transmitter-LDR
Capacitors:
sensor pairs, which are installed C1 - 100F, 25V electrolytic
on the highway 100 metres apart, C2, C4, C6,
C8, C11 - 0.01F ceramic disk
with the transmitter and the LDR C3, C13, C15 - 0.1F ceramic disk
sensor of each pair on the oppo- C5 - 10F, 25V electrolytic
C7 - 0.47F, 25V electrolytic
site sides of the road. The installa- C9 - 0.2F ceramic disk
tion of lasers and LDRs is shown C10 - 1F, 25V electrolytic
C12 - 47F, 25V electrolytic
in Fig. 1. The system displays the C14 - 1000F, 35V electrolytic
time taken by the vehicle in cross- Miscellaneous:
ing this 100m distance from one Fig. 1: Installation of lasers and LDRs on highway X1 - 230V AC primary to
pair to the other with a resolution 0-15V, 500mA secondary
transformer
of 0.01 second, from which the speed of speed-limit detector mono, controlled PZ1 - Piezobuzzer
the vehicle can be calculated as follows: by IC1 and IC2 outputs. Bistable set- LDR1, LDR2 - LDR
S1, S2 - Push-to-on switch
Distance reset IC4 is also controlled by the S3 - On/Off switch
Speed (kmph) = outputs of IC1 and IC2 and it (IC4), in - Pointed laser light
Time
turn, controls switching on/off of the
0.1 km 100Hz (period = 0.01 second) astable keeps falling on the LDR sensor con-
=
(Reading0.01)/3600 timer IC5. tinuously and thus the LDR offers a
or, The time period of timer NE555 (IC1) low resistance and pin 2 of IC1 is high.
36000
Reading (on display) = count-start monostable multivibrator is Whenever light falling on the LDR is
Speed
adjusted using preset VR1 or VR2 and interrupted by any vehicle, the LDR
As per the above equation, for a capacitor C1. For 40kmph limit the time resistance goes high and hence pin 2 of
speed of 40 kmph the display will read period is set for 9 seconds using preset IC1 goes low to trigger the monostable.
900 (or 9 seconds), and for a speed of VR1, while for 60kmph limit the time As a result, output pin 3 goes high for
60 kmph the display will read 600 (or 6 period is set for 6 seconds using preset the preset period (9 or 6 seconds) and
seconds). Note that the LSB of the dis- VR2. Slide switch S1 is used to select LED1 glows to indicate it. Reset pin 4
play equals 0.01 second and each suc- the time period as per the speed limit is controlled by the output of NAND
ceeding digit is ten times the preceding (40 kmph and 60 kmph, respectively). gate N3 at power-on or whenever reset
digit. You can similarly calculate the The junction of LDR1 and resistor R1 is switch S2 is pushed.
other readings (or time). coupled to pin 2 of IC1. For IC2, the monostable is triggered
Normally, light from the laser in the same way as IC1 when the vehicle
Fig. 4: Actual-size, single-side PCB layout for the speed checker Fig. 5: Component layout for the PCB
intersects the laser beam incident on Resistor R9 and capacitor C5 decide the DIS1 display. The counter advances by
LDR2 to generate a small pulse for stop- time period for which the piezobuzzer one count at the positive clock signal
ping the count and for use in the speed sounds. transition.
detection. LED2 glows for the duration The output of IC1 triggers the The carry-out (Cout) signal from
for which pin 3 of IC2 is high. bistable (IC4) through gate N2 at the CD4026 provides one clock after every
The outputs of IC1 and IC2 are fed leading edge of the count-start pulse. ten clock inputs to clock the succeed-
to input pins 2 and 1 of NAND gate When pin 2 of IC4 goes low, the high ing decade counter in a multidecade
N1, respectively. When the outputs of output at its pin 3 enables astable clock counting chain. This is achieved by
IC1 and IC2 go high simultaneously generator IC5. Since the count-stop connecting pin 5 of each CD4026 to pin
(meaning that the vehicle has crossed pulse output of IC2 is connected to pin 1 of the next CD4026.
the preset speed limit), output pin 3 of 6 of IC4 via diode D1, it resets clock A high reset signal clears the de-
gate N1 goes low to trigger monostable generator IC5. IC5 can also be reset via cade counter to its zero count. Pressing
timer IC3. The output of IC3 is used for diode D2 at power-on as well as when switch S2 provides a reset signal to pin
driving piezobuzzer PZ1, which alerts reset switch S2 is pressed. 15 of all CD4026 ICs and also IC1 and
the operator of speed-limit violation. IC5 is configured as an astable IC4. Capacitor C12 and resistor R14
I
n the output stages of most broad- activated. without overheating is obtained.
cast receivers and some amplifiers, Connect the low audio signal from You can also replace these transistors
there is a limit up to which maxi- the stereo system at input terminals with another pair of suitable high-
mum power can be developed with- A and B of the audio amplifier and power transistors.
out distortion. In the widely accepted provide mains AC to activate the cir- For driving transistors T2 and T3,
output circuit, two output transistors cuit. During the first half cycle of an a 9V audio driver transformer having
are connected in series between the AF cycle, transistor T2 conducts and six leads is used. It is readily available
positive and ground and biasing is ad- the current flows from positive rail to in the market and reasonably matches
justed so that each transistor gets half ground rail (centre tap of transformer the output and input impedances of
the supply voltage. X1) via the loudspeaker coil (connected the preceeding and succeeding stages.
The circuit presented here is a between the emitter of transistor T2 To test the quality of the audio
simple audio amplifier for a personal and ground) in one direction. While output, connect the stereos outputs
stereo system. In this, supply voltage in the second half cycle, transistor T3 to the respective terminals A and B.
to each transistor can be enhanced to conducts and the current flows from Now increase the volume level of
produce a larger output. The audio ground rail to negative rail via the the stereo slowly. If you get a
driver transformer drives the transis- loudspeaker coil (connected between high-level, high-quality sound across
tors adequately. ground and the collector of transistor loudspeaker L1, the amplifier is
A 9V-0-9V, 300mA transformer T3) in a direction opposite to the previ- working well. If the sound quality is
has been used in the set-up. Out of ous flow. not good, decrease the volume level
the four diodes (D1 through D4), two Transistors T2 and T3 of the until the audio amplifier gives good
are used for developing the posi- pushpull audio amplifier should results.
tive voltage rail (+9V) and the other be matched correctly. If these transis- Note that this audio amplifier
two are used for developing the tors get heated, change the bleeding works well for low-level audio
negative voltage rail (9V). In the resistor pairs (R3 and R4 for transis- signals.
T
his infrared object counter can receiver circuit (see Fig. 2) is powered er can be assembled on any general-
be installed at the entry gate to by a 5V regulated power supply built purpose PCB. Place the transmitter and
count the total number of people around transformer X1, bridge recti- the receiver around one metre apart.
entering any venue. For example, it can fier comprising diodes D1 through D4 For calibration, press switches S1
be used at the railway stations or bus and regulator IC2. It uses an infrared and S2 followed by on key of the
stands to count the people arriving per receiver (IR) module (RX1), optocoupler calculator. Now press 1 and + keys
day or week. (IC3) and a simple calculator. sequentially to get 1 on the screen of
The counter uses an infrared When switch S1 is in on position, the calculator. Then, place a piece of
transmitter-receiver pair and a simple, the transmitter circuit activates to cardboard between the transmitter and
low-cost calculator. It works even in the produce a square wave at its output the receiver to interrupt the IR rays two
pin 3. The two infrared LEDs (IR times. If the calculator counts 2, the
LED1 and IR LED2) connected at counter is working properly for that
its output transmit modulated IR range. Repeat this procedure for higher
beams at the same frequency (38 ranges as well. If there is any problem,
kHz). The oscillator frequency can adjust VR1.
be adjusted using preset VR1. For installation, switch off the
In the receiver circuit, IR re- transmitter, receiver and calculator,
ceiver module TSOP1738, which and mount the transmitter and the
is commonly used in colour tele- receiver on the opposite pillars of the
Fig. 1: Transmitter circuit visions for sensing the IR signals main entry gate such that they are
presence of normal light. The maximum transmitted from the TV remote, is properly orientated towards each
detection range is about 10 metres. That used as the sensor. other. Mount the calculator where you
means the transmitter and the receiver The IR beams transmitted by IR can read it easily. Connect pins 4 and 5
are to be installed (at the opposite pil- LED1 and LED2 fall on infrared re- of IC3 across = key connections on the
lars of the gate) not more than 10 metres ceiver module IR RX1 of the receiver PCB of the calculator.
apart. No focusing lens is required. If an circuit to produce a low output at its Now switch on the transmitter and
8-digit calculator is used the counter can pin 2. This keeps transistor T1 in non- the receiver by pressing switches S1
count up to 99,999,999 easily, and if a conduction mode. and S2, respectively. Thereafter, switch
10-digit calculator is used the counter Now when anyone enters through on the calculator and press 1 followed
can count up to 9,999,999,999. the gate to interrupt the IR beam, the IR by + key of the calculator to initialise
Powered by a 9V battery, the trans- receiver module produces a high output it. Now your counter is ready to count.
mitter circuit (see Fig. 1) comprises IC pulse at its pin 3. As a result, transis- The calculator reads 1 after one
555 (IC1), which is wired as an astable tor T1 conducts to activate IC3 and its interruption, 2 after second interrup-
multivibrator with a centre frequency internal transistor shorts key = of the tion and so on.
L
aser torch-based burglar alarms ceiver units, which are to be mounted built around timer 7555 (IC1) produces
normally work in darkness only. on the opposite pillars of the entry gate. 5.25kHz frequency. CMOS version
But this long-range photoelectric Whenever anyone enters to interrupt of timer 7555 is used for low-voltage
alarm can work reliably in daytime the transmitted laser beam falling on operation. The body of the laser torch
also to warn you against intruders in the receiver, the buzzer in the receiver is connected to the emitter of npn tran-
circuit sounds an alarm. sistor T1 and the spring-loaded lead
The range of this burglar protruding from inside the torch is
alarm is around 30 me- connected to the ground.
tres, which means you can The receiver circuit is powered by
place the transmitter and 12V DC. It uses photoDarlington 2N5777
the receiver up to 30 metres (T2) to sense the laser beam transmitted
apart. Since the laser torch from the laser torch. The output beam
can transmit light up to a signals from photoDarlington are given
distance of 500 metres, this to the two-stage amplifier followed by
range can be increased by switching circuit, etc. As long as the
orienting the phototransistor laser beam falls on photoDarlington
sensor properly. To avoid T2, relay RL1 remains un-energised and
false triggering by sunlight, the buzzer does not sound. Also, LED1
mount the phototransistor doesnt glow.
sensor such that it doesnt When anyone interrupts the
Fig. 1: Circuit of laser torch based transmitter directly face sunlight. laser beam falling on photoDarling-
ton T2, npn transistor T6 stops
conducting and npn transistor T7
is driven into conduction. As a
result, LED1 glows and relay RL1
energises to sound the buzzer
for a few seconds (determined
by the values of resistor R15 and
capacitor C10). At the same time,
the large indication load (230V AC
alarm for louder sounds or any
other device for momentary indi-
cation) also gets activated as it is
connected to 230V AC mains via
normally opened (N/O) contact of
Fig. 2: Receiver circuit
relay RL1.
T
his music-operated lighting ef- lighting effect generator circuit. You The circuit is powered by regu-
fect generator comprises five just need to place the gadget near the lated 9V DC. The AC mains is stepped
sets of 60W bulbs that are ar- speakers of the music system. down by transformer X1 to deliver a
ranged in zig-zag fashion. The bulb Fig. 1 shows the complete circuit secondary output of 12V AC at 250
sets glow one after another depending of the musical light chaser, while mA. The transformer output is recti-
on the intensity of the audio signal. Fig. 2 shows pin configurations of 9V fied by a full-wave rectifier compris-
Q
uite often, we forget to turn the electric iron, kitchen timer or other RL1 energised via transistor T1. At the
off the soldering iron. This re- appliances. same time, capacitor C3 charges and
sults in not only a smoking At the heart of the circuit is a mo- AC supply is provided to switch on
oxidised iron but also waste nostable multivibrator built around the soldering iron via normally opened
of electricity. To solve this problem, timer IC 555. When the circuit is in (N/O) contacts of relay RL1.
The soldering iron
remains on for the
time period prede-
termined by resistor
R1 and capacitor C2.
Here, this time is set
for 18 minutes. Flash-
ing of LED1 indicates
the heating progress
of the soldering iron.
When the predeter-
mined time is over,
relay RL1 de-ener-
gises to turn off the
soldering iron and
the buzzer sounds
until capacitor C3 gets
discharged.
For switching on
heres a circuit that automatically sleep mode, to switch on the solder- the circuit, use either a bell push
switches off the soldering iron after a ing iron, you should push switch S1 switch or a similar switch with ap-
predetermined time. The circuit draws momentarily. The multivibrator gets propriate current carrying capacity.
T
his circuit uses an erasable pro- IC 555 (IC1) is wired as an astable The high logic at any data pin
grammable read-only memory multivibrator, whose oscillation fre- causes the corresponding LED to glow.
(EPROM) to display various quency can be varied using preset VR1. When the data at address location 00H
light patterns on LEDs. Since bicolour The output of IC1 clocks 12-stage bi- is addressed, the red LED of LED1
LEDs (comprising green and red LEDs) nary counter IC CD4040 (IC2), which, glows. The data byte 44H at address
have been used, display is possible in in turn, provides address data to location 09H causes both the green
and red LEDs of LED2 to glow (refer
the table).
The binary outputs of IC2 compris-
ing Q0, Q1, Q2, Q5, Q6, Q7, Q8 and Q9
have been connected to address pins
A0 through A7 of EPROM IC3 (2716).
Q3 and Q4 outputs of IC2 have not
been used. This causes each display
pattern to be repeated eight times be-
fore the next pattern is displayed. You
can adjust the number of times a dis-
play pattern repeats by changing the
output lines of IC2 connected to the
EPROMs address pins A0 through A7.
T
his charger for series-connected of transistor T1. Transistor T1 is driven ing. As the voltage per cell increases
4-cell AA batteries automatically by pnp transistor T2, which, in turn, is beyond 1.3V, the voltage drop across
disconnects from mains to stop driven by pnp transistor T3. Resistor R4 resistor R4 starts decreasing. When
charging when the batteries are fully (10-ohm, 0.5W) is connected between it falls below 650 mV, transistor T3
charged. It can be used to charge par- the emitter and base of transistor T3. cuts off to drive transistor T2 and, in
tially discharged cells as well. When a current of over 65 mA turn, cuts off transistor T3. As a result,
The circuit is simple and can be flows through the 12V line, it causes a relay RL1 de-energises to cut off the
divided into AC-to-DC converter, relay voltage drop of about 650 mV across charger and red LED1 turns off.
driver and charging sections. resistor R4 to drive transistor T3 and You may determine the charging
In the AC-to-DC converter section, cut off transistor T2. This, in turn, turns voltage depending on the NiCd cell
transformer X1 steps down mains 230V transistor T1 on to energise relay specifications by the manufacturer.
AC to 9V AC at 750 mA, which is recti- RL1. Now even if the pushbutton is Here, weve set the charging voltage
fied by a full-wave rectifier comprising released, mains is still available to the at 7.35V for four 1.5V cells. Nowadays,
diodes D1 through D4 and filtered by primary of the transformer through its 700mAH cells are available in the mar-
capacitor C1. Regulator IC LM317 (IC1) normally open (N/O) contacts. ket, which can be charged at 70 mA for
provides the required 12V DC charg- In the charging section, regulator 10 hours. The open-circuit voltage is
ing voltage. When you press switch S1 IC1 is biased to give about 7.35V. Pre- about 1.3V.
momentarily, the charger starts operat- set VR1 is used for adjusting the bias The shut-off voltage point is deter-
ing and the power-on LED1 glows to voltage. Diode D6 connected between mined by charging the four cells fully (at
indicate that the charger is on. the output of IC1 and battery limits the 70 mA for 14 hours). After measuring the
The relay driver section uses pnp output voltage to about 6.7V, which is output voltage, add the diode drop (about
transistors T1, T2 and T3 (each BC558) used for charging the battery. 0.65V) and bias LM317 accordingly.
S
mall-size AA cells and button age obtained from the battery under V) is connected to the test terminals, the
cells used in electronic devices test, while its inverting input pin 2 is output of IC1 goes low to switch off
providing a terminal voltage of provided with a reference voltage of transistor T1. This allows transistor T2
1.5V are normally rated at 500 mAh. 1.4V derived by resistor R4 and series to forward bias by taking bias voltage
As the cells discharge, their internal combination of diodes D1 and D2. through resistor R5 and the red LED
impedance increases to form a poten- Resistors R1 and R2 provide a loading within bicolour LED1 glows.
tial divider along with
the load and the battery
terminal voltage reduces.
This, in turn, reduces the
performance of the gad-
get and we are forced to
replace the battery with
a new one. But the same
battery can be used again
in some other application
that requires less current.
Heres a simple tester
for quick checking of
discharged pencells and
button cells before throw-
ing them away. The tester detects the of 10 mA and 100 mA, respectively, for Slide switch S2 is used to check
holding charge of the battery and the checking the charge capacity. whether the battery is holding suf-
terminal voltage to indicate whether When a new battery is connected to ficient current to drive a load of 10
the battery is suitable for a particular the test terminals, the non-inverting input mA or 100 mA. If the discharged bat-
gadget or not. of IC1 gets 1.5V, which exceeds the voltage tery holds more than 100mA current,
A 9V battery can power the circuit of the inverting input and the output of the green LED within bicolour LED1
with sufficient voltage and current. IC1 goes high. This high output provides glows, indicating that the battery can
When you close switch S1, it provides forward bias to transistor T1 through be used again in a low-drain circuit.
stable 6V DC to the circuit. resistor R4 and it conducts to light up the The circuit can be easily con-
The circuit uses op-amp CA3140 green half of the bicolour LED (LED1). structed on a perforated board using
(IC1) as a voltage comparator. It can Simultaneously, the base of transistor T2 readily available components. Enclose
sense even a slight voltage variation is pulled down and it turns off and the red it in a small case with probes or battery
between its inverting and non-invert- half of bicolour LED1 remains off. holder for testing.
A
flashing LED at the doorstep by the LED is a small fraction
of your garage or home will of the normal value.
trick the thieves into believing Capacitor C2 charges
that a sophisticated security gadget through resistor R2 and diode
is installed. The circuit is nothing but D1. When the voltage across
a low-current drain flasher. It uses a C2 reaches two-third of the
single CMOS timer that is configured supply voltage, threshold pin 7
as a free running oscillator using a few of IC1 switches on as a current
additional components. As the LED sink. The capacitor discharges
flashes very briefly, the average cur- through LED1 into pin 7
rent through the LED is around 150 A rapidly. Diode 1N4148 (D1)
with a high peak value, which is suf- is constantly charged through resistor provides the one-way charging path
ficient for normal viewing. This makes R1. As capacitor C1 delivers power to for capacitor C2 via resistor R2. LED1
it a real miser. IC1, it saves the battery from drain. illuminates briefly for a while with the
The 9V battery source is connected Most LEDs consume a current of 20 accumulated charges in C2. Again, the
via on/off switch S1 to the circuit. mA, which in many instances is higher charging cycle repeats. This way, LED
When switch S1 is closed, the IC re- than the power consumed by the rest of continues flashing. A 9V PP3 battery
ceives power from capacitor C1, which the circuit. This is undesirable if the de- can perfectly handle this job.
T
imers are very useful both for
industrial applications and
household appliances. Here is
a PC-based timer that can be used for
controlling the appliances for up to
18 hours. For control, the timer uses a
simple program and interface circuit.
It is very cost-effective and efficient for
those who have a PC at workplace or
home. The tolerance is 1 second.
The circuit for interfacing the PCs
parallel port with the load is very
simple. It uses only one IC MCT2E,
which isolates the PC and the relay required timing, press any key from it can hold 2161=65,535 seconds or 18
driver circuits. The IC prevents the PC the keyboard. hours at the maximum. The sleep()
from any short circuit that may occur Suppose you input the total duration function in the program is used to hold
in the relay driver circuit or appliance. as x minutes, of which on and off the appliance in on or off condition
The glowing of LED1 indicates that durations are y and z minutes, respec- for the on and off periods as entered
the appliance is turned on. Transistor tively. The program will repeat the on-off by the user against prompts. The
BC548 is used as the relay driver. cycle for x/(y+z) number of times. After sound() function is used to give a beep
The program code is written in C completion of the total time, to repeat the during on condition of the appliance.
language and compiled using Turbo cycle, you will have to reset the time in the EFY note. The source code and
C compiler. When the program is run, program to activate the circuit. executable file of this program can
it prompts the user to input the time The program uses two bytes for be downloaded from: http://www.
duration in seconds or minutes to con- storing integer type data. So when input efymag.com/admin/issuepdf/pc%20
trol the appliance. After entering the is given in terms of seconds or minutes, Based%20Timer.zip
Timer.c
#include <stdio.h> gotoxy(1,5); minutes): );
#include <conio.h> printf(How do you want to enter the time dura- scanf(%d,&c);
#include <dos.h> tion ?); a=a*60;
#include <stdlib.h> printf(\n\n\n1.Enter time duration in minutes b=b*60;
void main() (press m)); c=c*60;
{ printf(\n\n2.Enter time duration in seconds printf(Press any key to start the program);
int PORT=0x0378,a,b,c,d=0; (press s)\n); getch();
clrscr(); gotoxy(1,15); do
_setcursortype(_NOCURSOR); switch(getch()) {
gotoxy(1,15); { outportb(PORT,1);
textcolor(2); case m: printf(\nYour circuit is on);
printf(This is the Program to use PC Parallel { sound(330);
port as Timer for external circuits); printf(Enter the total time duration (in min- sleep(b);
gotoxy(1,17); utes): ); nosound();
printf(\nWith this program you can time the scanf(%d,&a); outportb(PORT,0);
circuits for precision upto a second\n); printf(Enter the time to keep the circuit on (in printf(\nYour circuit is off);
printf(\nPress any key to continue....\n); minutes): ); sleep(c);
getch(); scanf(%d,&b); d=d+b+c;
clrscr(); printf(Enter the time to switch off the circuit (in }
A
tmels AVR microcontroller the PC. affect the operation of the target system.
chips are in-system program- 4. RST (Reset): Reset (low pulse) When the AVRs ISP mode is se-
mable (ISP), i.e. these can be generated by the program. The AVR is lected, the lower half of IC 74LS244
programmed directly in the target cir- programmed while in reset state. is enabled, pulling the target sys-
cuit. A special programmer software is Heres a dongle circuit for in- tems Reset line low. Once the target
used to download the program from system programming of Atmels AVR system is in Reset mode, the SCK,
the PC into the AVRs flash memory. chip AT90S8515 using such software MISO and MOSI lines are no longer
Atmel offers a software package called packages as Atmel ISP 2.65 and Pony- loaded by the peripheral circuitry,
the Atmel AVR ISP that allows pro- Prog2000. Though not exactly the same, if any, on the target system. Now,
gramming of the AVR microcontrollers a similar dongle circuit can be found it is safe to enable the upper half of
in the circuit using a simple dongle. A at the Website www.iready.org/proj- 74LS244, driving the MOSI, LED and
dongle is nothing but an adaptor cable ects/uinternet/ispdongle.pdf. SCK lines of the dongle. The RST pin
that connects the PCs parallel port The PCs parallel-port pins 4 and becomes high after the AVR is pro-
with the ISP pins of the AVR chip for 5 drive buffer IC 74LS244 by enabling grammed. Glowing of LED2 indicates
programming. its pins 19 and 1, respectively. A low that the AVR is in programming mode.
For programming, the four lines pulse on these pins will allow the pass- There are two standard connectors
required from the AVR chip to the ISP ing of the serial clock and data during for in-system programming of Atmel
adaptor (dongle) are: programming. MOSI, LED, SCK and AVR microcontroller. One is the 10-pin
1. MOSI (Master Out, Slave In): RST outputs are buffered from the par- header (dual-in-line (DIL) connector))
Data being transmitted to the AVR allel ports pins 7, 8, 6 and 9, respec- used on the Atmel STK kits. The other
being programmed is sent on this pin tively. The MISO input from the AVR is a 6-pin header (DIL connector) used
2. MISO (Master In, Slave Out): is fed into pin 10 of the parallel port. in Atmel ISPs. The two loop-back
Data received from the AVR being IC 74LS244 (IC1) acts as a buffer as connections, pin 2-to-pin 12 and pin
programmed is sent on this pin well as an isolator circuit when the AVR is 3-to-pin 11 of the parallel port, are
H
eres a digital frequency com- and DIS2). The astable free-running os- charging and low during discharging
parator for oscillators that in- cillators built around the timers are the of capacitor C1.
dicates the result through a frequency sources for the correspond- The other oscillator (IC5) works
7-segment display and a light-emitting ing counters. similarly. The oscillator frequency can
diode (LED). When the frequency When power supply to the circuit be varied by the potentiometer (VR1 or
count of an oscillator is below 8, the is switched on, timing capacitor C1 VR2). Output pins (pin 3) of the oscilla-
corresponding LED remains turned starts charging through resistor R1 tors (IC1 and IC5) are connected to the
off. As soon as the count reaches 8, and potmeter VR1. When the ca- respective decade counters (IC2 and
the LED turns on and the 7-segment pacitor voltage reaches 2/3Vcc, the IC6) through the DPDT switch.
display shows 8. internal comparator of IC1 triggers IC2 and IC6 count the initial eight
This demo circuit uses two NE555 the flip-flop and the capacitor starts cycles. IC 74LS90 is a 4-bit ripple
timers configured as astable free- discharging towards ground though decade counter. It consists of a divide-
running oscillators, whose frequencies VR1. When the capacitor voltage by-two section and a divide-by-five
are to be compared. reaches 1/3Vcc, the lower comparator section counter. Each section has a
The circuit of the digital frequency of IC1 is triggered and the capacitor separate clock input. The input of
comparator portion comprises two starts charging again. The charge- the divide-by-five section (CP1) is
74LS90 decade counter ICs (IC2 and discharge cycle repeats. That means, externally connected to the P output
IC6), two 74LS47 7-segment display the capacitor charges and discharges (pin 12) of the divide-by-two section
driver ICs (IC3 and IC7), 74LS74 set/ periodically between two-third and (CP0). When the divide-by-two sec-
T
he programmer devices re- a 50ms pulse, which is given to the pro- of the ZIF SOCKET by using jumper
quired for programming the gram pin 18 of the ZIF SOCKET through J1. The programming voltage required
electrically programmable read- switch S2. EPROM is inserted into the for an EPROM is sometimes written on
only memories (EPROMs) are general- ZIF SOCKET for programming. LED1 its body. The address and data for the
ly expensive. Here is a low-cost circuit glows to indicate the application of the EPROM (ZIF SOCKET) are set by using
to program binary data into 2716 and programming pulse to the EPROM. DIP switches SW1 and SW2, respec-
2732 EPROMs. Before applying the programming pulse tively, whose pins are initially pulled
The circuit uses timer NE555 (IC2) to the EPROM, select the programming high via 10-kilo-ohm resistors.
H
ere is a low-cost and sim-
ple wireless stepper motor
controller using infrared
signals. Using this circuit you can
control the stepper motor from a
distance of up to four metres.
The circuit comprises transmit-
ter and receiver sections. The com-
munication between the transmitter
and receiver sections is achieved
through infrared signals.
In the transmitter section, timer
NE555 ICs (IC1 and IC2) are config-
ured as astable multivibrators with
frequencies of around 1 Hz and 38
kHz, respectively. The output of IC1
is given to reset pin 4 of IC2, so the
38kHz carrier signal is modulated by
1Hz modulating signal. The modu-
lated signal from pin 3 of IC2 is trans- Fig. 2: Infrared receiver and stepper motor driver circuit
mitted by the infrared LED. Resistor
R5 limits the current through the IR LED. of the receiver section and its output gets shifted to the second flip-flop.
The transmitted signal is sensed at pin 3 is used as clocks for dual flip- Thus on reception of every clock pulse,
by IR receiver module TSOP1738 (IC6) flop 74LS74 ICs (IC3 and IC4), which the high output keeps shifting in a ring
are configured as a fashion.
ring counter. The outputs of flip-flops are amplified
When the power by the Darlington transistor array inside
is switched on, the ULN2003 (IC5) and connected to the step-
first flip-flop is set per motor windings marked A through
and its Q1 output D. The common point of the windings is
goes high, while connected to +12V DC supply.
the other three flip- To stop the motor, the flip-flops
flops are reset and can be reset manually by pressing
their outputs go reset switch S1. On releasing the reset
low. On receiving switch, the stepper motor again starts
the first clock pulse, moving. If any interruption occurs be-
the high output of tween the transmitter and the receiver,
Fig. 1: Infrared transmitter the first flip-flop the motor stops.
Y
ou can use this simple and reli- opening switch S2.
able security system as a watch- The circuit works off a 9V regu-
dog by installing the sensing lated power supply. However, battery
loops around your building. You have back-up is recommended. A common-
to stretch the loop wires two feet above cathode, 7-segment display (LTS543) is
the ground to sense the unauthorised used for displaying whether the loops
entry into your premises. are intact or not.
Wire loops 1, 2 and 4 are connected If loop 1 is broken, the display will
to the A, B and C inputs of 7-segment show 1. If two or all the three loops
decoder 4511 (IC1), respectively, while are broken, the display will show the
Fig. 2: The proposed wiring diagram of loops
the D input of IC1 is grounded perma- sum of the respective broken loop
nently. The loops are also connected to numbers. For example, if loops 1 and transistor T1 in cut-off position and the
a dual 3-input NOR gate and inverter 4 are broken, the display will show piezobuzzer does not sound.
CD4000 (IC2) to activate the alarm. 5(1+4). When any loop is broken, the
Fig. 1 shows the circuit of the digi- When all the three loops are intact, output of NOR gate N1 goes low,
tal security system, while Fig. 2 shows the display will show 0. All the three while the output of gate N2 goes high.
the proposed wiring diagram for the inputs of gate N1 remain low to give Transistor T1 conducts and the buzzer
loops around the premises. Before a high output. This high output is fur- sounds to alert you. You can mute the
using this security system, make sure ther given to gate N2 and, as a result, buzzer by switching off power to the
that loops shown in Fig. 2 are con- its output remains low. This keeps circuit through switch S1.
N
owadays, high-power light- need to remove
emitting diodes (LEDs) the LED section
LXHLMW1C are available in from the circuit
the market. These white LEDs contain and connect the
indium-gallium-nitrogen (InGaN). switching sec-
The LEDs emitting capacity is 20 can- tion to the de-
dela (Cd). We can use these LEDs for sired system. So
automatic garden lighting and wide the system will
voltage operation by applying differ- now automati-
ent voltages. cally switch on in
Fig. 1 shows the circuit for auto- the evening and
matic garden lighting. Switch S1 con- Fig. 1: Circuit for automatic garden lighting switch off in the
nects 12V to the circuit built around morning.
transistors T1 and T2. Light-dependent Fig. 2 shows a wide-
resistor LDR1 is used to sense the light voltage operation circuit.
intensity and preset VR1 is used to Here, the high-power LED61
adjust the threshold of light. The resis- (LXHLMW1C) gives a power
tance of LDR remains low in daylight equivalent of 20 Cd. This
and high at night (in darkness). LED has a metallic back for
In the morning, light falls on LDR1 mounting on a heat-sink. Its
and transistors T1 and T2 are cut-off. rated maximum input DC
As a result, 12V supply is not avail- voltage and current are 3.6V
able to the LEDs. In the evening, when Fig. 2: Circuit for wide-voltage operation and 350 mA, respectively.
no light falls on LDR1, transistors T1 Regulator IC LM317 (IC1)
and T2 conduct to provide 12V to provides a constant voltage of 4.7V.
the LEDs. This turns on all the LEDs Resistors R3 and R4 limit the current
(LED1 through LED60). The on/off through the LED. The LED is very
switching level can be adjusted by sensitive to voltage inputs. In the 2.5V-
220-kilo-ohm preset according to the 3.5V region, each millivolt variation
intensity of the light. changes the current through the LED
The emitting capacity of LEDs logarithmically. Transistors BC549
(UW-510CWH) used here is 8 Cd. Since Fig. 3: Pin configuration and D882 (T3 and T4) and resistor R6
a total of 60 of these LEDs have been provide a constant current to LED61.
used, this unit will provide luminous The entire circuit, except LDR1, can The unit gives a constant lighting for
intensity equivalent of 480 Cd. The be assembled on any general-purpose voltages ranging from 7V to 25V.
LEDs are arranged in twenty rows, PCB. House the PCB in a box and, us- Fig. 3 shows pin configuration of
with each row having three LEDs ing two long wires, mount LDR1 at a regulator LM317 and transistors D882
in series. The input voltage is ap- place where light falls on it directly. and BC549. Use heat-sinks in regula-
proximately 12V and all the LEDs are Now place the unit in your garden. tor LM317 and transistor D882 before
spaced 1 to 1.5 cm apart. You can use the switching section soldering them onto the PCB.
S
ometimes we forget to switch off ing function of the SCR keeps the relay monostable output goes high to switch
the bathroom light and it re- energised until the power to the circuit on the white LEDs (LED3 and LED4).
mains on unnoticed for long peri- is switched off using switch S1. When Resistor R9 limits the current through
ods. This circuit solves the problem of the relay energises, its normally closed the LEDs to a safe level. Diode D7 is
electricity wastage by switching off the (N/C) contacts break and light turns forward biased to give full voltage to
lamp automatically after 30 minutes off. LED1 indicates that the oscillator the monostable when power fails.
once it is switched on. The back-up is working. The power supply for the circuit
LED lamp provided in the circuit turns The back-up white-LED lamp com- is derived from a 15V AC, 250mA
on for three minutes when mains fails. prising LED3 and LED4 gives ample transformer. The secondary output
This is helpful especially when you are light in the event of mains failure. It is is rectified by a full-wave rectifier
taking a shower at night. powered by a 9V rechargeable battery, comprising diodes D1 through D4.
The circuit is built around binary which is charged at around 200mA cur- Capacitor C1 smoothes the resulting
counter CD4060 (IC2), which has a built- rent via diode D6 and resistor R7 when DC. Regulator IC 7812 (IC1) and ca-
in oscillator and 14 cascaded bistable the circuit is switched on. pacitors C4 and C5 provide stabilised
multivibrators. The oscillator generates The back-up lamp circuit is built 12V for the circuit.
clock pulses based on the values of resis- around timer NE555 (IC3) designed as Assemble the circuit on a Vero
tors R3 and R4 and capacitor C3. a monostable. The output of IC3 goes board and enclose it in a watertight
For the given values, Q11 output of high for three minutes based on the plastic case. Connect the bathroom lamp
IC2 goes high after 30 minutes of power- values of preset VR1 and capacitor C9. (either 25-watt bulb or 11-watt CFL
on. Resistor R2 resets the IC for proper When the circuit is switched on, IC3 gets tube) to the circuit via N/C contacts of
operation. The output of IC2 is fed to the power supply via diode D6 and its trig- the relay, so that it turns on when switch
gate of the SCR via resistor R6 and LED2, ger pin 2 remains high due to resistor S1 is pressed. For easy access, fix switch
which function as a voltage dropper as R8. As a result, its output remains low S1 along with the neon indicator outside
well as output status indicator. as long as mains is present. the bathroom.
N
eed to connect more than one AV signal, press switch S1 twice. In in figure) glows to indicate this.
audio-video (AV) source to the same way, you can select the other Similarly, pressing switch S1 thrice
your colour television? Dont two signals. makes the Q3 output of IC1 high. Con-
worry, heres an AV input expander Momentarily pressing of switch S1 sequently, 2C/O relay RL3 (not shown
for your TV. It is inexpensive and easy once results in clocking of the decade in the figure) energises and the televi-
to construct. counter and relay driver transistor T1 sion inputs are connected to the third
The working of the circuit is simple conducts to energise relay RL1. Now AV signal source. LED5 (not shown
in the figure) glows to
indicate this.
Again, pressing
switch S1 four times
makes the Q4 output of
IC1 high. Consequently,
2C/O relay RL4 ener-
gises and the TV in-
puts are connected to the
fourth AV signal source
(marked as Video-in 4
and Audio-in 4). LED6
glows to indicate this.
Further pressing of
switch S1 resets the de-
cade counter and LED2
glows again. Thereafter,
and straightforward. Whenever 12V normally opened (N/O) contacts of the cycle repeats. The circuit is wired
DC is applied to the circuit, power-on two-changeover relay RL1 connect the for four-input selection, therefore the
LED1 glows. Now reset the decade television sets inputs to the first AV Q5 output of IC1 is connected to reset
counter by momentarily pressing signal (marked as Video-In 1 and Au- pin 15 of IC1.
switch S2 to make Q0 output of IC1 dio-in 1). LED3 glows to indicate this. Enclose the assembled PCB along
high. LED2 glows to indicate that the When you press switch S1 twice, the with the relays in a cabinet with the
circuit is ready to work. Q2 output of IC1 goes high. Consequent- input/output sockets and indicators
Switch S1 is used for selecting a ly, 2C/O relay RL2 (not shown in the cir- mounted on the body of the cabinet.
particular audio-video (AV) signal. cuit) energises and television inputs are
C
ertain industrial controls re-
quire accurate switching opera-
tions. For example, in case of a
foot-switch for precise drilling work,
even a small error in switching may
cause considerable loss. This low-cost
but accurate foot-operated switch can
prevent that.
IC NE555 is wired in one-shot
mode. Its output pin 3 goes high only
when both switches S1 and S2 are
pressed simultaneously. You can release
any one of the switches without chang-
ing the output state. When you release
Fig. 1: Circuit of the foot-switch
both the switches, the output goes low.
The switches are placed under a no effect on the state of the flip-flop.
foot paddle as shown in Fig. 2. LED1 is Releasing both the switches brings
used as a warning indicator. If either S1 the input level with respect to ground
or S2 gets pressed erroneously, LED1 below the low trigger level, and thus it
blinks to warn the operator. The opera- resets the output.
tor can then withdraw his foot in case Use of the voltage divider results in
of a mistake or depress the other switch stable operation over the entire permis-
also to trigger the circuit. LED1 is to be Fig. 2: Foot paddle switch sible supply voltage range. The R-C cir-
mounted on the operators desk. cuit at pin 4 provides power-on reset.
The circuit operation is simple. the state of the internal flip-flop of When only S1 is pressed, R3 (1 kilo-
Resistors R2, R3 and R4 form a IC NE555. Pressing the two switches ohm) is less than R5 (1.5 kilo-ohms) and
voltage divider. IC NE555 has two simultaneously sets the flip-flop IC1 is not triggered. However, transistor
comparators, a flip-flop and power and the output of NE555 goes high. T1 (BC548) gets forward biased and
output section built into it. Pressing Transistor T2 energises relay RL1 for LED1 glows. When both S1 and S2 are
either S1 or S2 puts the input volt- driving the load. pressed, the effective resistance between
age between the upper comparator Releasing any of the switches +Vcc and pin 2 of IC1 is about 500
(2/3Vcc) and the lower comparator brings the comparator voltage back to ohms, which is less than R5 (1.5 kilo-
(1/3Vcc). Thus, it has no effect on the initial level inside NE555 and it has ohms), and IC NE555 gets triggered.
U
sing this circuit, you can con- Closing switch S5 provides power to press switch S3 after pressing switch
trol the rotation of a DC the circuit. Now, when you press switch S1, pin 3 of IC3 goes high, while its pin
micromotor simply by pressing S1 momentarily, pin 10 of IC3 goes high, 4 goes low. The motor now starts rotat-
two push-to-on switches momentarily. while its pin 11 goes low. Since pin 10 ing in the forward direction. However,
The circuit is built around two of IC3 is connected to reset pin 4 of IC1 if you press switch S4 after pressing
NE555 ICs (IC1 and IC2) and a quad- and IC2, the high output at pin 10 of switch S1, the motor will rotate in re-
NAND IC CD4011 (comprising NAND IC3 will enable IC1 and IC2 simultane- verse direction.
gates N1 through N4). The NE555 ICs ously. When switch S2 is pressed, pin Note. The complete kit of
(IC1 and IC2) are configured as invert- 10 of IC3 goes low, while its pin 11 goes this circuit can be obtained from
ing buffers. IC CD4011 (IC3) NAND high. The low logic at pin 10 disables KitsnSpares, 303, Website: www.
gates are configured as bistable flip- both IC1 and IC2. kitsnspares.com; E-mail: info@kitsns-
flop. The DC motor to be controlled is Switches S3 and S4 are used for for- pares.com.
M
any a times equipment at very high resistance in darkness, i.e., rectified by a bridge rectifier
workstations remain when no light falls on it. Therefore comprising diodes D1 through D4,
switched on unnoticed. In when power fails, transistor T1 gets re- filtered by capacitor C5 and regulated
this situation, these may get dam- verse biased to drive transistor T2 and by IC 7812 (IC3) to provide regulated
aged due to overheat-
ing. Here is an add-on
device for the work-
bench power supply
that reminds you of the
power-on status of the
connected devices every
hour or so by sounding
a buzzer for around
20 seconds. It also has
a white LED that pro-
vides good enough light
to locate objects when
mains fails.
Fig. 1 shows the cir-
cuit of power-on re-
minder with LED lamp.
Here, IC NE555 (IC1) Fig. 1: Circuit of power-on reminder with LED lamp
is wired as an astable
multivibrator, whose time period is set the white LED
to around six minutes using resistors (LED2) glows.
R1 and R2, preset VR1 and capacitor The lamp circuit
C1 for sounding the buzzer every hour. is powered by a
The output of IC1 is fed to the clock 9V rechargeable
input of IC CD4017 (IC2). Capacitor C3 battery, which is
and resistor R3 provide power-on-reset charged via re-
pulse to IC2. sistor R5 when
When power to the circuit is mains is present.
switched on, pin 3 of IC2 goes high. Af- Thus in darkness,
ter around one hour, its output pin 11 the LED remains Fig. 2: Power supply circuit
(Q9) goes high and the buzzer sounds. on.
This cycle repeats until the power to Fig. 2 shows the power supply 12V to the circuit. Capacitor C6
the circuit is switched off. circuit. The AC mains is stepped bypasses any ripple in the regulated
The automatic lamp is built around down by transformer X1 to deliver output.
T
his circuit counts mains supply
interruptions (up to 9) and shows
the number on a 7-segment dis-
play. It is highly useful for automobile
battery chargers. Based on the number of
mains interruptions, the user can extend
the charging time for lead-acid batteries.
Fig. 1 shows the circuit of the inter-
ruption counter with indicator. A 9V
(PP3 or 6F22) battery powers the entire
circuit. Fig. 2 shows the block diagram
of the mains interruption counter cir-
cuit along with the battery charger and
lead-acid battery as used in automobile
battery charger shops. Fig. 1: Circuit of mains interruption counter with indicator
H
ere is a simple low-power in-
verter that converts 12V DC
into 230-250V AC. It can be
used to power very light loads like
window chargers and night lamps, or
simply give shock to keep the intrud-
ers away. The circuit is built around
just two ICs, namely, IC CD4047 and
IC ULN2004.
IC CD4047 (IC1) is a monostable/
astable multivibrator. It is wired in
astable mode and produces symmetri-
cal pulses of 50 to 400 Hz, which are
given to IC2 via resistors R1 and R2.
IC ULN2004 (IC2) is a popular R3 and R4. Resistors R3 and R4 are used to limit
7-channel Darlington array IC. Here, Transformer X1 (9V-0-9V, 500mA the output current from the ULN to
the three Darlington stages are secondary) is an ordinary step-down safe values. The 230-250V AC output
paralleled to amplify the frequencies transformer that is used here for the is available across the high-imped-
received from IC1. The output of IC2 reverse function, i.e., step up. That ance winding of the transformers
is fed to transformer X1 via resistors means it produces a high voltage. primary windings.
H
ide this solar-powered circuit panel is exposed to light. Transistors
suitably and see the reaction T1 and T2 form a relaxation oscillator.
of your friends to the chirpy When C1 charges to 0.6V, transistor T1
sound produced by it every few min- conducts and the charge built up in C2
utes. In all probability, it will coax is discharged through the piezobuzzer
them to find out where the sound is to produce a short beep.
coming from. While testing the circuit, the value
The circuit runs off a miniature of resistor R1 can be reduced to, say, 1
solar power panel, which can be taken kilo-ohm. Use a good-quality buzzer
out from an old calculator such as can work properly from a panel as to ensure that the sound produced is
Citizen CT-500. A panel giving 1.5V to small as 3 cm2. loud enough.
2.5V is required. Note that the circuit If a digital voltmeter is connected
C
onnect this circuit to any of (IC1). Pin 8 of IC1 is grounded, pin 16 1N4007 (D1) acts as a freewheeling
your home appliances (lamp, is connected to Vcc and pin 3 is con- diode. The appliance to be controlled is
fan, radio, etc) to make the nected to LED1 (red), which glows to connected between the pole of the relay
appliance turn on/off from a TV, VCD indicate that the appliance is off. and neutral terminal of mains. It gets
or DVD remote control. The circuit can The output of IC1 is taken from its connected to live terminal of AC mains
be activated from up to 10 metres. pin 2. LED2 (green) connected to pin 2 via normally opened (N/O) contact
The 38kHz infrared (IR) rays is used to indicate the on state of the ap- when the relay energises.
generated by the re-
mote control are re-
ceived by IR receiver
module TSOP1738 of
the circuit. Pin 1 of
TSOP1738 is connected
to ground, pin 2 is con-
nected to the power
supply through resis-
tor R5 and the output
is taken from pin 3.
The output signal is
amplified by transistor
T1 (BC558).
H
ere is a fully automatic
mock alarm to ward
off any intruder to
your house. The alarm be-
comes active at sunset and
remains on till morning. The
flashing light-emit ting diodes
(LEDs) and beeps from the
unit simulate the functioning
of a sophisticated alarm sys-
tem. Besides, the circuit turns
on and off a lamp regularly
at an interval of 30 minutes
throughout the night. It also
has a call bell facility.
The circuit is built around
CMOS IC CD4060B (IC1),
which has an internal oscillator
and a 14-stage binary divider
to provide a long delay with-
out using a high-value resistor
and capacitor.
Press switch S2 to provide oscillating. The O3 output (pin 7) of IC1 a positive trigger from the positive rail
9V power supply to the circuit. During goes high every five seconds to light (reduced by zener diode to 3.3V) via
daytime, light-dependent resistor LDR1 up the LEDs (LED1 and LED2) and resistor R10 and IC2 starts producing a
offers little resistance and transistor T1 activate the buzzer. Resistor R8 limits melody. Resistor R10 limits the current
conducts. This drives transistor T2 into the tone produced from the buzzer. to the trigger pin of IC2 and resistor
the cut-off mode, as its base is pulled to At the same time, O13 output of R12 prevents any false triggering.
ground via transistor T1. Reset pin 12 of IC1 (pin 3) goes high every 30 minutes Zener diode ZD1 provides the 3.3V
IC1 remains high as long as transistor to forward bias transistor T3 to ener- required for IC 4822.
T2 is cut off. This keeps the oscillator of gise relay RL1 and lamp L1 connected The circuit works off 9V regulated
IC1 (comprising resistors R5 and R6 and to the normally opened (N/O) contacts power supply. Assemble the circuit on
capacitor C1) disabled and its outputs of relay RL1 glows. This cycle repeats any general-purpose PCB and enclose
remain low. The sensitivity of LDR1 can till morning. it in a waterproof plastic box with
be adjusted using preset VR1. The call bell is built around IC 4822 holes for mounting LEDs on the rear
When the sunlight decreases in (IC2). Its inbuilt musical tone generator and the LDR on the top of the box.
the evening, the resistance of LDR1 generates different tones at each trig- Place the LDR such that sunlight falls
increases to cut off transistor T1. This ger. The frequency of the tone can be on it directly. Mount the unit on the
drives transistor T2 into conduction controlled through external compo- pillar of the entrance gate. To avoid
mode and its collector voltage goes nents R11 and C2. The output at pin unnecessary illumination of the LDR,
low. At the same time, reset pin 12 11 of IC2 is amplified by transistor T4. install lamp L1 away from the unit
of IC1 goes low to enable the oscil- When push-to-on switch S1 is in the porch of the house. Keep the
lator of IC1 and the oscillator starts pressed once, trigger pin 4 of IC2 gets speaker inside the room.
T
his high-intensity, energy-effi- power).
cient, long-lasting and durable The forward-
lamp can withstand input volt- conduction volt-
age fluctuation of up to 25 per cent age drop required
without change in the light output. for the LED chain
The lamp consumes only 0.5W power (LED1 through
compared to conventional 15W lamps, LED7) is provided
significantly reducing the energy by C1 alone. C1 dis-
costs, and can be used as night lamp, Fig. 1: Circuit diagram of power-saver LED lamps charges through R1
path lamp or mandir lamp. Also, it immediately after
has a life of 100,000 hours (11 years the circuit is disconnected from mains,
of continuous use) against 1000 which prevents a fatal shock due to any
hours for conventional lamps, thus voltage remaining on the input termi-
requiring no replacement for a long nals. The AC mains voltage is rectified
time, once fitted. by diodes D1 through D4 and filtered
At the heart of this lamp are seven by capacitor C2. Resistor R2 acts as a
light-emitting diodes (LEDs). Unlike bleeder.
ordinary incandescent lamps, LEDs You can make lamps in
dont have a filament that can burn other colours as well by simply
out and are illuminated solely by the disconnecting all the red LEDs (LED1
movement of electrons in a semicon- Fig. 2: Proposed enclosure for the lamp through LED7) between points A and
ductor material. So they last much B and instead connecting yellow LEDs
longer. Small size and use of plastic directly to light generation, which cuts for yellow lamp, blue LEDs for blue
material make them more durable. down the electricity bill considerably. lamp, green LEDs for green lamp and
But the main advantage of LEDs is Fig. 1 shows the circuit for red white LEDs for white lamp, as desired.
efficiency. In traditional incandescent LED-based lamp. The LEDs (LED1 Capacitor C1 should be rated for
lamps, light is produced by heating through LED7) are powered from at least 440V AC, while mains applica-
the tungsten filament. This results in mains without the use of a transformer. tions also require use of an X2-class ca-
wastage of energy, as a huge portion Here, capacitor C1 is used as the AC pacitor. The circuit may be assembled
of the available electricity isnt used voltage dropperthe well-known on a circular PCB and housed in a
for producing the visible light. LEDs transformerless solution. It results in bulb-shaped enclosure as shown in Fig.
generate little heat. A much higher the advantages of a smaller size of 2. Mount capacitors C1 and C2 on the
percentage of the electrical power goes the circuit and no heat generation (as track side of the PCB to save space.
W
henever AC mains supply
fails, this circuit alerts you
by sounding an alarm. It also
provides a backup light to help you
find your way to the torch or the gen-
erator key in the dark.
The circuit is powered directly
by a 9V PP3/6F22 compact battery.
Pressing of switch S1 provides the
9V power supply to the circuit. A red
LED (LED2), in conjunction with zener
diode ZD1 (6V), is used to indicate the
battery power level. Resistor R9 limits
the operating current (and hence the
brightness) of LED2.
When the battery voltage is 9V,
LED2 glows with full intensity. As the
battery voltage goes below 8V, the inten-
sity of LED2 decreases and it glows very CD4538 (IC2) is used here. goes low and pnp transistor T2 gets
dimly. LED2 goes off when the battery When mains goes off, IC2 is trig- forward biased to light up the white
voltage goes below 7.5V. gered after a short duration deter- LED (LED1). Light provided by this
Initially, in standby state, both the mined by components C1, R4 and back-up LED is sufficient to search the
LEDs are off and the buzzer does not C3. Output pin 10 of IC2 goes high to torch or generator key.
sound. The 230V AC mains is directly forward bias relay driver transistor T1 During the mono time-out pe-
fed to mains-voltage detection opto- via resistor R7. Relay RL1 energises to riod, the circuit can be switched off by
coupler IC MCT2E (IC1) via resistors activate the piezobuzzer via its N/O opening switch S1. The on period of
R1, R2 and R3, bridge rectifier BR1 contact for the time-out period of the the monostable multivibrator may be
and capacitor C1. Illumination of the monostable multivibrator (approxi- changed by changing the value of resis-
LED inside optocoupler IC1 activates mately 17 minutes). At the same time, tor R5 or capacitor C2.
its internal phototransistor and clock the N/C contact removes the positive If mains doesnt resume when
input pin 12 of IC2 (connected to 9V supply to resistor R4. The time-out pe- the on period of the monostable
via N/C contact of relay RL1) is pulled riod of the monostable multivibrator is lapses, the timer is retriggered after a
low. Note that only one monostable determined by R5 and C2. short delay determined by resistor R4
of dual-monostable multivibrator IC Simultaneously, output pin 9 of IC2 and C3.
T
his inexpensive, fully transis- Transistor T5 supplies sufficient gate by using resistor R14, diode D1 and
torised switch is very sensitive voltage to the triac to drive the 230V zener diode ZD1. The circuit can be as-
to sound signals and turns on lamp. sembled on any general-purpose PCB.
a lamp when you clap within 1.5
metres of the switch. One of its
interesting applications is in dis-
cotheques, where lights could be
turned on or off in sync with the
music beats or clapping.
The condenser microphone
senses the sound and converts
it into electrical variations. The
electrical signals are amplified
by the two-stage direct-coupled
(DC) amplifier formed by tran-
sistors T1 and T2 and fed to the
switching circuit. The switching
circuit comprises transistors T3,
T
his single-IC TV pattern genera- The circuit uses hex Schmitt in- width and the number of lines using
tor is useful for fault finding in verter IC CD40106 (IC1). NOT gate N1 potmeter VR5.
TV sets. You can correct the generates horizontally synchronised If you dont have an oscilloscope,
alignment of the timing circuits of the (Hsync) pulses for the PAL video set presets VR1 and VR2 to 150k and
TV set with the help of this circuit. The signal. Presets VR1 and VR2 are used 22k, respectively, to get the required
vertical stripes (bars) produced by the to control the on and off time dura- on and off periods for the oscilla-
pattern generator on the TV screen tions of the oscillator, respectively. For tor and see the vertical line pattern
help you align the vertical scanning PAL, you need to adjust VR2 for off on the TV.
synchronisation circuit of the receiver. duration of 4.7 s, while VR1 needs The audio frequency oscillator
To test the TV set, you need to con- to be adjusted for on duration of is built around NOT gate N6. Its
nect the video and audio outputs of around 60 s. oscillation frequency is decided by
the circuit to the respective inputs of If vertical lines appear on the TV resistor R6 and capacitor C5. Con-
the TV set one by one. If the video sec- screen on connecting the video output nect the audio output of the circuit
tion of the TV set is working the circuit of the circuit to the video input of the to the audio input of the TV. If you
generates vertical white lines on the TV, the video section of the TV set is hear sound from the TVs speakers,
TV screen, and if the audio section is working. You can control the starting the audio section of the TV set is
working you hear sound from the TVs position of the lines using potmeter working.
R
echargeable torches dont tors provides a discharge path for the recharge will give a continuous op-
come without problems. You capacitors after the battery is charged. erational time of approximately 2.5
need to replace the bulbs and The red LED1 indicates that the circuit hours. Recharge the battery to full
charge the batteries frequently. The is active for charging. capacity immediately after use to en-
average incandescent light-emitting The torch uses three NiMH re- sure its reliability and durability. The
diode (LED) based torch, for instance, chargeable button cells, each of charging current is around 25 mA.
A voltage booster cir-
cuit is required for power-
ing the white LEDs (LED2
through LED4). An invert-
er circuit is used to achieve
voltage boosting. Winding
details of the inverter trans-
former using an insulated
ferrite toroidal core is given
in the schematic. The num-
ber of 35 SWG wire turns
in the primary and second-
ary coils (NP and NS) are 30
and 3, respectively. If the
Fig. 1: Circuit diagram of rechargeable torch
inverter does not oscillate,
swap the polarity of either
consumes around 2 watts. Heres a (but not both) the primary or the
rechargeable white LED-based torch secondary winding. A reference
that consumes just 300 mW and has voltage from resistor R5 provides
60 per cent longer service life than an a reflected biasing to the transistor,
average incandescent torch. and keeps the output constant and
Fig. 1 shows the circuit of the re- regulated.
chargeable white LED-based torch. The suggested enclosure for the
The reactive impedance of capaci- torch is shown in Fig. 2.
tors C1 through C3 (rated for 250V Fig. 2: Suggested enclosure for the torch
C
ontrol your home appliances connected to the clock input of divide- 1 though 4, respectively. Freewheel-
without getting out of your by-16 IC 74LS93. ing diodes D1 through D4 connected
bed. You just have to clap The outputs of IC2 are fed to npn across the relays protect the transistors
in the vicinity of the microphone transistors T2, T3, T4 and T5 via 100- from the back electromagnetic field
used in this circuit, which you can (e.m.f.) produced by the relays.
keep by the bedside. You can switch Output of 74LS93 The output states of IC 74LS93 (Q0
on/off up to four different electrical Number of claps Q0 Q1 Q2 Q3 through Q3) for different numbers of
equipment (TV, fan, light, etc) in 16 0 0 0 0 0 claps are shown in the table.
1 1 0 0 0
different ways. The circuit is powered from regu-
2 0 1 0 0
This circuit is built around timer IC 3 1 1 0 0 lated 5V DC. For testing the circuit,
555 (IC1), CMOS IC 74LS93 (IC2) and 4 0 0 1 0 disconnect the resistors from the out-
5 1 0 1 0
five BC547 npn transistors (T1, T2, T3, 6 0 1 1 0
puts of IC2 and connect four LEDs in
T4 and T5). Transistor T1 is used as the 7 1 1 1 0 series with 220-ohm resistors between
preamplifier and the rest are used for 8 1 0 0 1 the outputs and ground. Now switch
9 1 0 0 1
driving the relays. 10 0 1 0 1 on the power supply and clap near
A small condenser microphone 11 1 1 0 1 the microphone. You can see the four
is connected at the base of transistor 12 0 0 1 1 LEDs glowing in the manner shown in
13 1 0 1 1
T1, which is biased from resistor R1 14 0 1 1 1 the table. A reset push switch is pro-
(10 kilo-ohms). The clapping sound is 15 1 1 1 1 vided to switch off all the on devices.
Note:1. 1 indicates high logic.0 indicates low logic.
converted into electrical energy by the 2. At high logic, the corresponding transistor conducts
Now you can connect the desired
microphone and amplified by transis- to energise the corresponding relays and activate the appliances to the relays and control
load.
tor T1. The transistor output is fed to them with your claps.
D. Mohan Kumar by monitoring the brake switch and ments R7 and C4 make the output high
reminds you of the condition of the for one second to activate the buzzer
D
o you want to get an early brake every time the brake is applied. and LED2. Usually, the trigger pin of
warning of brake failure The circuit uses an op-amp IC IC3 is high due to R6 and the buzzer
while driving? Here is a brake CA3140 (IC2) as voltage comparator and LED2 remain off.
failure indicator circuit that constantly and timer NE555 (IC3) in monostable When the brake pedal is pressed,
monitors the condition of the brake configuration for alarm. Voltage com- pin 2 of IC2 gets a higher voltage from
and gives an audio-visual indication. parator IC2 senses the voltage level the brake switch and its output goes
low to switch off
the red LED. The
low output of
IC2 gives a short
negative pulse to
the monostable
through C2 to trig-
ger it. This acti-
vates the buzzer
and LED2 to indi-
cate that the brake
system is working.
When there is pres-
sure drop in the
brake system due
When the brake is applied, the green across the brake switch. Its non-invert- to leakage, LED1 remains on and the
LED blinks and the piezobuzzer beeps ing input (pin 3) gets half the supply buzzer does not sound when the brake
for around one second if the brake voltage through potential divider re- is applied.
system is intact. If the brake fails, the sistors R3 and R4 of 10 kilo-ohms each. The circuit can be assembled on
red LED glows and the buzzer stops The inverting input (pin 2) of IC2 is any general-purpose PCB or perfo-
beeping. connected to the brake switch through rated board. Connect point A to that
The circuit will work only in ve- diode D1, IC 7812 (IC1) and resistor R2. terminal of the brake switch which
hicles with negative grounding. It also It receives a higher voltage when the goes to the brake lamps. The circuit can
gives an indication of brake switch brake is applied. be powered from the vehicles battery.
failure. Normally, when the brake is not The circuit requires well-regulated
In hydraulic brake systems of ve- applied, the output of IC2 remains power supply to avoid unwanted
hicles, a brake switch is mounted on high and the red LED (LED1) glows. triggering while the battery is charg-
the brake cylinder to operate the rear The output of IC2 is fed to trigger pin ing from the dynamo. IC4, C6 and C7
brake lamps. The brake switch is fluid- 2 of the monostable through coupling provide regulated 12V to the circuit.
operated and doesnt function if the capacitor C2. Resistor R1 is used for The power supply should be taken
fluid pressure drops due to leakage. the input stability of IC2. IC1 and C1 from the ignition switch and the cir-
The fluid leakage cannot be detected provide a ripple-free regulated supply cuit ground should be clamped to the
easily unless there is a severe pressure to the inverting input of IC2. vehicles body. A bicolour LED can
drop in the brake pedal. This circuit IC3 is wired as a monostable to give be used in place of LED1 and LED2
senses the chance of a brake failure pulse output of one second. Timing ele- if desired.
T
his smart charger automati- Normally, the full charge potential potmeter VR2. The output of transistor
cally switches off when your of an Ni-Cd cell is 1.2V. Trigger the T1 is inverted twice by npn transistors
re-chargeable batteries reach the bistable by pressing switch S1 and T2 and T3.
full charge. adjust potmeter VR1 for 60mA current Thus when the batteries are fully
The circuit comprises a bistable through the ammeter. charged to 31.2V=3.6V, a voltage
multivibrator wired around timer Now remove the ammeter and con- higher than this makes transistor T1
IC 555. The bistable output is fed nect a jumper wire between its points to conduct. Transistor T2 also con-
to an ammeter (via diode D1) a and b. Connect the positive output ducts and transistor T3 goes off. The
and potmeter VR1 before it goes to terminal of the batteries to the emitter threshold level of timer 555 reaches
6V, which is more than
2/3V CC = 2/36=4V, to
turn off the timer.
During charging, the
threshold level of the timer
is held low. The green LED
(LED1) glows during charg-
ing of the batteries and goes
off at the attainment of full
charge.
Note that this cir-
cuit can be used only for
1.2V, 600mAH Ni-Cd re-
chargeable batteries that
require 60 mA of current for
15 hours to charge fully.
T
his door-opening alarm alerts you closed. A separate unit incorporating When the door is closed, the reed
of intruders. You can use it for up the power supply, three LEDs and a switch terminals are shorted and the
to three doors. buzzer is to be kept by your side inside alarm does not sound.
You simply need to fit a small unit your room. A three-core ribbon cable When door 1 is opened by someone,
including reed switch on each door- from this unit goes to each door unit. transistors in the corresponding door
frame and fix a magnet on the mov- One core goes to the positive terminal, unit conduct and the buzzer sounds.
LED1 glows to indicate opening of door
1. Due to diode latching ac-
tion, the alarm will sound
continuously even after the
door is closed. It can be
stopped only by pressing the
reset switch of the door unit.
Regulated 9V to 12V DC
for operating the circuit is
derived from AC mains and
fed to the three units mount-
ed on the doors. Battery-
backup is also provided.
When all the three doors are
simultaneously opened, all
the three LEDs will glow.
This arrangement can
be extended for more
doors by increasing the
number of door units con-
nected to the audio-visual
indication unit.
P
rotect your home appliances this circuit, only two outputs of the IC supply, while its contacts are used for
from voltage spikes with this (Q5 and Q14) have been used. Q5 is switching on the appliances.
simple time delay circuit. connected to an LED (LED1) and Q14 Whenever power to the appliances is
At the heart of the circuit is IC is used to trigger the gate of the SCR switched on or resumes after mains failure,
CD4060, which consists of two in- through D4 as well as reset the counter. the oscillator starts oscillating and LED1 blinks.
verter gates for clock generation and The anode of the SCR is connected This continues for three minutes. After that,
a 14-bit binary ripple counter. Here to +9V and the cathode is connected Q14 output of IC CD4060 goes high to trigger
the gate of the SCR
through D4. At this
moment, the voltage
is available at the cath-
ode of the SCR, which
energises the relay coil
to activate the appli-
ance and LED2 glows.
Switch S1 is used for
quick start without
waiting for delay.
W
hite LEDs are replacing the ited power from
conventional incandescent the dynamo/
and fluorescent bulbs due battery. At low
to their high power efficiency and low revolutions,
operating voltage. These can be utilised headlight dims
optimally for emergency lamp and because of the
vehicle turning indication. The circuits increase in load.
for the purpose are given here. The white LED-
Fig. 1 shows the circuit of a white- Fig. 1: White LED based emergency lamp based turning
LED based emergency lamp. You can indicator circuit
also use arrays of white LEDs as day- draws a fraction of the
time running lamps in automobiles. power drawn by con-
In the emergency lamp, seven 1.2V ventional bulbs, and
AA-size Ni-Cd cells giving 8.4V have may last longer than
been used as the power source. The the vehicle itself.
brightness is controlled by duty-cycle The circuit com-
variation of an astable multivibrator prises two identical
working at 1 kHz. The astable multivi- sections for left and
brator is built around IC1. Its output is right turn indications.
connected to LED-driver transistor T1. The right turn indi-
Fig. 2: Battery charger
Up to six branches of white LEDs cator circuit is built
can be connected in parallel, with each
branch containing two LEDs in series
(only three branches are used here).
Depending on the application, differ-
ent combinations of battery voltages
and the number of LEDs in series can
be made such as to keep the resistive
losses low.
The charger circuit for a Ni-Cd bat-
tery is shown in Fig. 2. When the battery
voltage is less than 9.8V, charging takes
place since the voltage at the emitter of
transistor T2 (VE) is 9.8V. The value of
resistor R8 is chosen such that the bat-
tery charges at a rate of 70 mA per hour. Fig. 3: Turning indicator
The full charge voltage of the battery is
9.8V. When the battery reaches full volt- spective points of the battery charger around transistors T3 through T5 and
age, the current reduces to approach the circuit. Now your emergency lamp is white/yellow LEDs (LED8 through
tickle charge value of few milliamperes. ready to work. LED13). Similarly, the left turn indica-
Assemble both the circuits shown To use the emergency lamp, switch tor circuit is built around transistors
in Figs 1 and 2 on a general-purpose on the circuit using switch S1. All the T4, T6 and T7 and white/yellow LEDs
PCB. LEDs can also be mounted on LEDs (LED1 through LED6) will glow (LED15 through LED20). Transistor T4
the reflector of a lamp. After assem- to provide sufficient light. and the piezobuzzer are common for
bling, connect points A and GND of Turning indicator shown in Fig. 3 is both-side indicators.
the emergency lamp circuit to the re- another application of the LEDs. It can When you slide switch S2 towards
F
or car protection, custom-made to the car (parked outside your home) current is not high, the battery will
units are available but they are and connect one wire-end to the cover last long.
costly. and the other to the ground, with both As long as the two wires remain
Heres a circuit to protect car ste- wire-ends shorted by some weight shorted, transistor T1 remains cut
reo, etc from pilferage that costs less such as a brick. So outwardly the off. When shorting is removed, tran-
and requires no adjustments in the car mechanism is not visible. sistor T1 gets forward biased and
its collector
voltage drops
to trigger
IC2 and the
piezobuzzer
starts sounding.
If mains
fails, the bat-
tery-takeover
indicator
(shown in Fig.
2 and connected
to points A, B
and C in Fig.
Fig. 1: Circuit of car protection unit with alarm 1) immediately
gets triggered at
If someone tries to remove the pin 2 of IC3. Its high output activates
cover, the alarm of the circuit starts the battery-operation alarm for a couple
sounding to alert you. The alarm of seconds. IC1 draws power from the
can be switched off by resetting it battery to activate the protection unit.
using switch S1. After setting up the unit properly
The car protection circuit com- and shorting both the wires, press
prises two timer ICs: one for the test switch S2. If there is no fault
alarm circuit (see IC2 in Fig.1) in the circuit, the alarm will sound.
and the other to indicate that Now release test switch S2 and mo-
the battery has taken over as the mentarily press reset switch S1 to
power source (see IC3 in Fig. 2). switch off the alarm.
Fig. 2: Battery takeover indicator
D
og trainers use a whistle to call can be generated. Whistle effec-
dogs. But why blow that irri- tiveness depends on the speaker
tating, loud whistle when used. Use of a low-wattage
the dog can hear a sound inaudible tweeter is recommended. (Dont
to the humans? We the humans can use an ultrasonic transducer,
hear up to 20 kHz, but dogs can hear because it is designed for 40 kHz
ultrasound (sound ranging between only.)
20 and 30 kHz) also. The circuit works off 9V. For
Heres a circuit that generates call your pets by generating ultrasonic portability, use a 9V PP3 battery
21 to 22 kHz (frequencies just above sound. and house the unit inside a pocket ra-
the audible range), so it can be used to IC 555 is used as an oscillator. By dio cabinet.
T
his smart cellphone holder disable the visual
makes sure that you dont for- indicator (LED2).
get to carry your mobile phone. If youve forgot-
Fitted in the car, it keeps searching for ten to carry your
the mobile phone within the holder cellphone, LED2
using infrared (IR) rays and alerts you fitted in the cell-
through a flashing LED when it doesnt phone holder will
find one. You can attach the circuit to stop flashing to in-
your existing cellphone holder or, with dicate that the mo-
a little skill, construct one as per your bile phone is not in
requirement. the cell holder of
The circuit, wired around IC the case. Resistor
LM555 (IC1), derives power from the R1 limits the current
12V DC automobile battery. Diode D1 flowing through IR
is an accidental wrong-polarity input LED1 and resistor
guard. Resistor R7 limits the inrush R6 limits the oper-
Fig. 1: Circuit of smart cellphone holder
current to IC1. ating current and
When power is applied to the cir- hence luminance of
cuit, the low-frequency astable multi- LED2. Variable resistor VR1 deter-
vibrator built around IC1 is activated mines the detection sensitivity of
and LED2 at its output pin 3 flashes phototransistor T1. The blinking
briefly. rate of LED2 can be changed by
When ignition switch S2 is flipped changing the value of capacitor C1
to on position, the +12V DC from (or R3-R4 resistor combination).
the cars battery disables the astable Fig. 2: Pin configurations Fig. 3: Proposed Pin configurations of BC547
multivibrator via diode D2 and LED2 of BC547 and 2N5777 cellphone holder and phototransistor 2N5777, and
turns off. the proposed cellphone holder
When the ignition is turned off and phone holder is empty, IR rays from are shown in Figs 2 and 3, respec-
the mobile phone is in its holder, LED2 IR LED1 fall on phototransistor T1 tively.
again starts blinking. In case the cell- and it conducts to pull the base of LED
T
his simple and easy-to-use operation. The output is a pulse train The pulse width in the monoshot
gadget not only tests the IC 555 with the high time period determined mode is given by:
timer in all its basic configura- by the series combination of resistors 1.1total charging resistance
tions but also tests the functionality of R8, potentiometer VR2, resistor R9 and charging capacitance
each pin of the timer. Once a timer is capacitor C4, whereas the low time This expression is valid when there
declared fit by this gadget, it will func- period is determined by resistor R9 is no external resistor connected at pin
tion satisfactorily in whatever mode or and capacitor C4. 5. The pulse width can be reduced by
configuration you may try it. The reset terminal of timer IC connecting an external resistor.
The two basic configurations in (pin 4) should be tied to Vcc normally. The high and low time periods in
which a timer IC 555 can be used are More precisely, the voltage at pin 4 the astable mode are:
the astable and the monostable modes should be greater than 0.8V. A volt- High time period = 0.69charging
of operation. age less than that resets the output. resistancecharging capacitance
When the DPDT switch (S2) is Whether you have connected the timer Low time period = 0.69discharge
in position 1-1, the timer under test in the monoshot or astable mode of resistancecapacitance
automatically gets wired as a mono- operation, the output goes low the Again the expressions are true with
stable multivibrator. In this case, the moment you bring the reset terminal no external resistor at pin 5. The high
monoshot can be triggered by the mi- below 0.8V. time period can be made to decrease
croswitch (S1). The debouncing circuit The control terminal (pin 5) can by connecting an external resistor be-
constituted by the two NAND gates of be used to change the high time tween pin 5 and ground.
IC1 (N1 and N2) produces a clean rect- (on time) of the output pulse train The circuit can thus be used to
angular pulse when the microswitch is in the astable mode and the output check:
pressed. Resistor R3, capacitor C1 and pulse width in the monoshot mode 1. The timer IC in astable configu-
diode D1 ensure that the trigger termi- by applying an external voltage. This ration.
nal of timer IC 555 (pin 2 is the trigger external voltage basically changes 2. The timer IC in monostable con-
terminal) gets the desired positive-to- the reference voltage levels of the figuration.
ground trigger pulse. This differentia- comparators inside the IC. The levels 3. The capability of the reset termi-
tor circuit also ensures that the width are set by three identical resistors of nal to override all functions and rest
of the trigger pulse is less than the usually 5 kilo-ohms inside the IC con- the output to low.
expected monoshot output pulse. nected from Vcc to ground, at 2/3Vcc 4. The function of the control
The monoshot output pulse width for pin 5 and 1/3Vcc for pin 2. These terminal to change the on or the
is a function of the series combination levels can be changed by connecting high time of the output waveform
of resistor R8 and potentiometer VR2, an external resistor between pin 5 in astable mode of operation and the
and capacitor C4. When DPDT switch and ground. Resistor R10 and poten- output pulse width in monostable
H
ere is a simple circuit for moni- veloped across the meter and activates The output of IC2 is used to power
toring the fuel level in ve- the beeper when the fuel tank is almost the astable circuit consisting of timer
hicles. It gives an audiovisual empty. Its point A is connected to the 555 (IC3) via diode D2. Oscillations
indication when the fuel level drops input terminal of the fuel meter and of IC3 are controlled by R6, R7, VR2
alarmingly below the reserve level, point B is connected to the body of the and C4. With the given values, the on
helping you to avoid running out of vehicle. and off time periods are 27 and 18
petrol on the way. The circuit consists of an op-amp seconds, respectively. The pulses from
Nowadays vehicles come with a IC CA3140 (IC1), two 555 timer ICs IC3 are given to the clock input (pin 14)
dash-mounted fuel gauge meter that (IC2 and IC3) and decade counter of decade counter CD4017 (IC4) and its
indicates the fuel levels on an analogue CD4017 (IC4). outputs go high one by one.
display. The reserve level is indicated Op-amp IC CA3140 is wired as a When the circuit is switched on,
by a red marking in some vehicles, voltage comparator. Its inverting input LED1 and LED2 glow if your ve-
but the needle movement through the (pin 2) receives a reference voltage con- hicle has sufficient petrol in the tank.
red marking may be confusing and trolled through VR1. The non-inverting When the fuel goes below the reserve
not precise. This circuit monitors the input (pin 3) receives a variable voltage level, the output of IC1 goes low, LED1
fuel tank below the reserve level and tapped from the input terminal of the turns off and a negative triggering
warns through LED indicators and fuel meter through resistor R1. pulse is received at pin 2 of IC2. The
audible beeps when the danger level is When the voltage at pin 3 is higher output of IC2 goes high for around
approaching. than at pin 2, the output of IC1 goes four minutes and during this time
The fuel sensor system consists high and the green LED (LED1) glows. period, clock pin 14 of IC4 receives
of a tank-mounted float sensor and a This condition is maintained until the the clock pulse (low to high) from the
current meter (fuel meter), which are voltage at pin 3 drops below that at output of IC3.
connected in series. The float-driven pin 2. When this happens, the output For the first clock pulse, Q0 output
sensor attached to an internal rheostat of IC1 swings from high to low, send- of IC4 goes high and the green LED
offers high resistance when the tank ing a low pulse to the trigger pin of the (LED2) glows for around 50 seconds.
is empty. When the tank is full, the monostable (usually held high by R3) On receiving the second clock pulse,
resistance decreases, allowing more via C1. The monostable triggers and its Q1 goes high to light up the yellow
current to pass through the meter to output goes high for a predetermined LED (LED3) and sound the buzzer for
T
he range of this FM transmitter amplifier that boosts signals from the tive receiver. VC1 is
is around 100 metres at 9V DC oscillator. Use of the additional RF ampli- a frequency-adjust-
supply. fier increases the range of the transmitter. ing trimpot. VC2
The circuit comprises three stages. The Coil L1 comprises four turns of 20SWG should be adjusted
first stage is a microphone preamplifier enamelled copper wire wound to 1.5cm for the maximum
Fig. 2: Pin
built around BC548 transistor. The next length of a 4mm dia. air core. Coil L2 com- configurations of range. The transmit-
stage is a VHF oscillator wired around prises six turns of 20SWG enamelled copper transistors BC548 and ter unit is powered
C2570
another BC548. (BC series transistors are wire wound on a 4mm dia. air core. by a 9V PP3 battery.
generally used in low-frequency stages. Use a 75cm long wire as the antenna.
H
ere is a low-cost teleconferencing secondary side, a small circuit is used tor to DC and as high impedance for
system that lets you talk to two for DC holding. This circuit is built audio signals. The high impedance of
persons at a time in any part of the around transistor T1 (BC547), resistors the circuit is provided by condenser
world over two telephone lines. The circuit R2 and R3 (15 kilo-ohms and 100 ohms, C3, which prevents any audio signal
makes use of a coupling transformer and respectively), condenser C3 (22F, 63V) from appearing at the base of T1.
some passive components. and two LEDs as indicators for both the Thus any audio voltage appearing
The circuit is connected between the primary and secondary sides. It provides across telephone line No. 2 will not
two telephone lines. It works like this: proper DC characteristic to hold second cause a corresponding current in the
When X calls A on the first telephone telephone line in operation even though transistor.
line, A puts this call on hold, di-
als Y on the other telephone line
(which is free) and keeps this call
too on hold, and slides switches
S1 and S2 to on position. Now
X, A and Y can talk to one
another simultaneously over the
two telephone lines.
Both the primary and sec-
ondary coils of the coupling
M
easure AC mains voltage First, remove the old knob and fix a der of 1 per
without using a multi- circular white paper around the shaft. cent 5 volts.
meter. All you need to do is to Now put back a skirted knob with a The diameter
slightly modify the light dimmer fitted at the cursor as close to the paper as possible of the knob of
base of a table lamp for use as a voltmeter. and mark two extremities of the pot on potmeter and
When the dimmer is turned anticlockwise to the paper as CW and ACW (see Fig. 2). Fig. 2: AC volts scale marking
fineness of
a point where the filament glow is just vis- Switch on the lamp via a variac and cursor can be
feed 50 volts. Rotate the potmeter knob of help in getting better
anticlockwise until the filament glow is accuracy and tolerance.
just visible and mark that point against An ordinary fan
the cursor as 50V. Keep on increasing regulator can be used
the voltage to 100, 150, 180, 200 and with a lamp of 40,
220 using the variac and calibrating 60 or 100 watts and
the scale for all the voltages. Now a calibrated accord-
voltage scale is created. The only snag ingly. The minimum
Fig. 3: Pin
is that the voltage is increasing in anti- configuration of measurable voltage
clockwise direction, which should not BT134 is naturally limited to
be a problem. The scale will not how- the one required for
ever be linear unlike the one shown just visible condition. With R1 open
in the sketch. Accuracy will depend circuited the maximum scale voltage
Fig. 1: Light dimmer
on the calibration standard used and will be around 220 volts.
U
sing this charger, you can SCR2 conducts to pull
safely charge up to two pieces down the gate of SCR1.
of Ni-Cd cells or Ni-MH cells. This state is indicated
The circuit is compact, inexpensive and by LED2. Now remove
easy-to-use. the cells from the char-
The 230V AC mains is down- ger. Normally, Ni-Cd
converted to 12V AC (at 500 mA) by cell with a rating of 500
step-down transformer X1, converted mAH will take around
into pulsating DC voltage by diodes 2.5 hours to reach full
D1 and D2, and fed to the battery charge, while the charg-
charger terminals via current-limiting ing time for Ni-MH cell with a rating output terminals, which should be
resistor R1 and silicon-controlled rec- of 1500 mAH will be around 7 hours. around 5V DC. Now insert the two
tifier SCR1. Charging time may vary depending on cells into the holder and connect it
SCR1 is at the heart of the charger. the settings of the charger and input sup- to the charger output terminals for
Normally, it conducts due to the gate ply line conditions. charging. LED1 instantly lights up
biasing voltage available through resis- After construction, a minor ad- to indicate the charging process. If
tor R2 and diode D3, and the battery is justment is required for ensuring LED1 glows dimly, readjust VR1 for
in charging mode, which is indicated by proper performance: Power on the proper glowing of LED1. Now the
LED1. Resistor R2 limits the charging circuit without cells and adjust circuit is ready for use.
current to a safe value. Charging current VR1 such that LED2 lights up. Now Use of a small heat-sink is recom-
of this circuit is about 250 mA. measure voltage across the charger mended for SCR1.
T
his timer circuit for gey-ser
sounds an alarm after the
set timing of 22 minutes
when the water is heated up.
The circuit comprises a timer IC
555 wired as an astable multivibra-
tor with adjustable time period of
15 seconds. The astable output after
inversion by an inverter drives de-
cade counters IC3 and IC4 (each IC
7490) connected in cascade. The de-
cade counters output is connected
to decoders IC5 and IC6 (each IC
7442), respectively. The decoder
outputs (Q8 outputs of IC5 and IC6)
are fed to inverters and the inverter
outputs, in turn, are fed to an AND
gate. The AND output is connected
to the reset pin of the astable multi-
vibrator built around another timer
IC 555 to sound the alarm. Now
you can turn off the geyser.
A green LED (LED1) has been
used as the power supply indicator. switched on simultaneously. puts of IC5 and IC6 using dip switches
Switch on the timer and the gey- After the siren sounds, if required, (S3 and S4) while keeping in mind IC5
ser at the same time. When the alarm we can increase the time by another outputs (Q0 through Q9) are spaced
sounds, it means that the water in the 22 minutes for geyser by resetting the 15 seconds apart and IC6 outputs are
geyser has heated up and can be used. circuit by pushing reset switches S1 spaced 150 seconds (2.5 minutes) apart.
You can assemble the timer circuit and S2 momentarily. Caution. Please note that the
on a general-purpose PCB and install If you want to change the preset timer circuit has no connection with the
it near your bathroom so that both time of the geyser, the same can be eas- geyser circuit. The geyser works off 220V
the timer circuit and the geyser can be ily done by combining appropriate out- AC, while the timer works off 5V DC.
T
his simple circuit lets you scan a ances like fans, mixers, refrigera-
220V live wire. The clock input tors, etc. It can be easily assembled
of the IC is connected to a wire, on any general-purpose board or
which acts as the sensor. Here, we have the discrete components can be
used 10cm length of 22SWG wire as directly soldered on the IC.
the sensor. A 9V PP3 battery powers
When you hold the sensor (metal- the circuit. If you use a mains
lic conductor or copper wire) close adaptor, make sure that it is well
to the live wire, electric field from regulated and isolated; otherwise,
mains activates the circuit. As the even the stray electric field from
input impedance of the CMOS IC drives the LED. Flashing of the LED mains transformer will clock the circuit.
is high, the electric field induced in (LED2) indicates the presence of Caution. Use insulated wire as sen-
the sensor is sufficient to clock it. The mains, while LED1 indicates that the sor to avoid risk of exposure to live AC
output obtained at pin 11 of CD4017 scanner is active. mains.
T
his doorbell circuit can also
give identification of the visitor
to your home in your absence.
When youre home, you can use it
simply as a normal doorbell.
The circuit (see Fig. 1) comprises a
monostable built around timer IC 555
(IC1), relay driver transistor BC548
Fig. 3: Suggested LED display to be kept near
(T1), inverter section built around Fig. 2: Switch panel to be mounted on the gate the owners desk
IC 7404 (IC2), latching section built
around IC 555 (IC3) and LED display S2. The output of IC3 at its pin 3 is fed reset switch S3 once. When somebody
driver transistor BC548 (T2). to LED1 (visitor-out indicator) and visits your home and presses doorbell
The monostable output drives the LED2 through LED16 via LED driver switch S1, it will trigger the monostable
relay through transistor amplifier T1. transistor T2. (IC1) and also energise the relay to ring
The normally-opened (N/O) contact The switch panel shown in Fig. the bell. The monostable output through
of the relay connects an electric bell 2 is to be mounted on the entry gate inverter N1 will enable the latching cir-
with mains supply as shown in Fig. 1. or door, while the LED display panel cuit and LED1 will glow continuously
The output of the monostable also goes shown in Fig. 3 is to be kept inside the to indicate that youre out of the house.
to inverter N1, which, in turn, enables house near the owners desk. The message Please indicate the
the latching circuit built around IC3 in Before you leave your house, slide first letter of your name (single alphabet
conjunction with DPDT slide switch switch S2 (Out) to on position and press in English only) by flipping switches S4
through S18 to
on position,
as required, is
written just be-
low LED1 indi-
cator as shown
in Fig. 2.
Suppose the
visitors name is
Tina Chopra. As
the initial alpha-
bet of her first
name is T, she
has to flip the
topmost-row
and middle-col-
umn switches
towards on
position. The
position of the
switches for
this example is
shown in Fig. 2.
When you
return home,
just flip switch
S19 to on po-
Fig. 1: Circuit diagram of doorbell-cum-visitor indicator sition to check
T
o switch on the mains voltage, ler and uses an electronic circuit that triac. The load can be
either a mechanical switch or a behaves like a normal switch. A flat switched on/off by
relay offers a simple solution. pushbutton control provides an aes- simply pushing the
However, the relay and its associated thetic look to your switch panel. pushbutton switch
components occupy a lot of space and The switching circuit comprises an for a brief period.
cannot be accommodated in a standard optocoupler circuit that receives input Every time the switch
Fig. 2: Pin
switch box. The smart switch circuit, from a bistable switch formed by a cou- configuration of
receives a push, the
triac BT136 optocoupler toggles
the triac. A special ze-
ro-crossing detector in the optocoupler
supresses radio interference, unlike the
arbitrary phase switching.
Since mains is not isolated, use
a good-quality pushbutton switch
with proper insulation to avoid lethal
shock. Make sure that the triac can
handle the current you are going to
draw through it. If required, several
pushbuttons can be wired in parallel
to allow toggling of the triac from dif-
Fig. 1: Circuit of the smart switch ferent locations.
T
his stress monitor lets you across the touch pads. in the input.
assess your emotional pain. If The circuit comprises signal am- Here, weve used only five LEDs
the stress is very high, it gives plifier and analogue display sections. connected at pins 14 through 18 of IC1.
visual indication through a light-emit- Voltage variations from the sens- LED1 glows when input pin 5 of IC1
ting diode (LED) display along with ing pads are amplified by transistor receives 150 mV. LED5 glows when
a warning beep. The gadget is small BC548 (T1), which is configured as a the voltage rises to 650 mV and LED5
enough to be worn around the wrist. common-emitter amplifier. The base flashes and piezobuzzer PZ1 beeps
The gadget is based on the prin- of T1 is connected to one of the touch when the stress level is high.
ciple that the resistance of the skin var- pads through resistor R1 and to the Resistors R4 and R5 and capacitor
ies in accordance with your emotional ground rail through potmeter VR1. By C2 form the flashing elements. Resis-
states. If the stress level is high the skin varying VR1, the sensitivity of T1 can tor R3 maintains the LED current at
offers less resistance, and if the body is be adjusted to the desired level. Diode around 20 mA. Capacitor C3 should
relaxed the skin resistance is high. The D1 maintains proper biasing of T1 and be placed close to pin 3 for proper
low resistance of the skin during high capacitor C1 keeps the voltage from functioning of the IC. Zener diode
stress is due to an increase in the blood the emitter of T1 steady. ZD1 in series with resistor R6 provides
supply to the skin. This increases the The amplified signal from tran- regulated 5V to the circuit.
permeability of the skin and hence the sistor T1 is given to the input of The circuit can be assembled on
conductivity for electric current. IC LM3915 (IC1) through VR2. IC a small piece of perforated board.
Use transparent
3mm LEDs and a
small piezobuzzer
for audio-visual
indications. En-
close the circuit in
a small plastic case
with touch pads
on the back side.
Fig. 2: Display panel
Two self-locking
straps can
be used to
tie the unit
around
your wrist.
After
Fig. 3: Self-locking straps tying th e
Fig. 1: Circuit of the stress meter unit around
your wrist (with touch pads in contact
This property of the skin is used LM3915 is a monolithic integrated with the skin), slowly vary VR1 until
here to measure the stress level. The circuit that senses analogue voltage LED1 glows (assuming that you are in
touch pads of the stress meter sense levels at its pin 5 and displays them relaxed state). Adjust VR2 if the sensi-
the voltage variations across the touch through LEDs providing a logarithmic tivity of IC1 is very high. The gadget is
pads and convey the same to the cir- analogue display. It can drive up to now ready for use.
T
his circuit gives audio-visual in- T1 starts conducting and bicolour the following relationship:
dication of the failure and re- LED1 glows in red colour. Due to T = 1.1R5C3.
sumption of mains power. The non-availability of Vcc voltage at pin This positive output is present at
circuit is built around dual timer IC 14 of IC2, its output pin 9 remains low pin 5 of IC2. Since IC2 is a dual-timer
LM556. When mains is present the bi- and transistor T3 does not conduct. IC, its first output is directly fed to re-
colour LED glows in green colour, and However, capacitor C7 (4700F) holds set pin 10 of second section. Therefore
when mains fails it turns red. adequate charge and hence transis- the second timer of IC2 starts oscillat-
The AC mains is stepped down tor T4 conducts and piezobuzzer PZ1 ing. Its frequency of oscillations (F0)
by transformer X1 to deliver the sec- sounds continuously for around eleven is determined by resistors R6 and R11
ondary output of 12V at 250 mA. The seconds until capacitor C7 discharges and capacitor C6 as follows:
transformer output is rectified by a completely. F0=1.4/(R6+2R11)C6.
full-wave bridge rectifier comprising When power resumes, bicolour IC LM556 outputs frequencies
diodes D1 through D4, filtered by LED1 glows in green colour and the in the form of pulses at its pin 9.
capacitor C1 and regulated by IC 7809 buzzer beeps for around 14 seconds. These pulses are coupled to npn
(IC1) to give regulated 9V DC to oper- Dual timer IC LM556 (IC2) sections transistor T3, which conducts and
ate the circuit. have been used here in monostable and cuts off depending on the output at
9V battery and pnp transistor T1 astable modes, respectively. pin 9 of IC2. Red LED2 is connected
have been used here as the power In the monostable section, loca- to pin 9 via current-limiting resis-
source for red light indication of the tion of the external timing capacitor tor R7 (270-ohm) to indicate power
absence of power. Transistor T1 can be determines whether a positive or resumption.
made to conduct or cut-off easily by negative output pulse is gener- The collector output of transistor
varying preset VR1. ated. Diode D7 ensures that even a T3 is directly fed to the base of pnp
Initially, when mains is present, momentary power loss will cause transistor T4, due to which base bias-
pnp transistor T1 is in cut-off state and a pulse to be generated when the ing of T4 varies and the buzzer beeps
therefore bicolour LED1 glows in green power resumes. With capacitor C3 for around 14 seconds.
I
f some intruder tries to open the and mount the same on the door as
door of your house, this circuit shown in Fig. 3. Now mount a piece
sounds an alarm to alert you of mirror on the doorframe such that
against the attempted intrusion. it is exactly aligned with the unit. Pin
The circuit (Fig. 1) uses readily configurations of IC UM3561 and tran-
available, low-cost components. For sistors 2N5777 and BC547 are shown
compactness, an alkaline 12V battery is in Fig. 2.
used for powering the unit. Input DC Initially, when the door is closed,
supply is further regulated to a steady the infrared (IR) beam transmitted
DC voltage of 5V by 3-pin regulator IC by IR LED1 is reflected (by the mir-
7805 (IC2). ror) back to phototransistor 2N5777 Fig. 3: Back view of the door assembly
A
n absolute necessity of every Initially, when the circuit is pow-
electronics lab is a workbench ered, silicon-controlled rectifier SCR1
power supply. The power is off. Relay RL1 energises through Fig. 2: Reed relay with coil winding
supply should be regulated and pro- the polyfuse and the load is con-
tected against short circuit. nected through the normally opened
Most power-supply protection cir- (N/O) contact of the relay. When the
Reed Relay Winding Details
current drawn
for Different Load Currents
by the load in- Current (amperes) Turns SWG
c re as e s ab o v e 10 5 13
5 10 16
a certain level 2.5 20 18
(which depends 1.25 4 21
on the number
of turns in the cates that the power supply is work-
winding on reed ing normally. LED1 indicates that the
relay, see Fig. 2 power supply unit is under the protec-
and the accompa- tion mode and the buzzer sounds to
nying table), the warn the user.
contacts of reed The turns of reed relay wind-
relay RL2 close ing are based on the current drawn
to trigger SCR1. through the load, so refer to the table
Fig. 1: Electronic fuse As a result, relay for winding details for your load cur-
RL1 de-energises rent requirements. At EFY, testing
cuits use a low-value, high-wattage re- and the load gets disconnected. The was done for approximately 1.85A
sistor connected in series with the load polyfuse remains in high-resistance AC load current at 230V AC mains
for current sensing. The voltage drop state until SCR1 is turned off. and accordingly 16 turns of 22SWG
across the sensor resistor is weighed The circuit can be reset either by copper-enamelled wire were wound
to activate the protection circuit. The switching off the power supply or by on the reed relay.
given circuit is based on a polyfuse pushing reset switch S1. LED2 indi-
T
he digital dice presented here resistor R3, which are connected such a NOR gate (with A+BC output) to
acts just like a normal dice. It that they generate an AND logic. perform this function.
has six faces (refer Fig. 2) like From the table it can be noticed that LED2 and LED5 glow only at the first
the normal dice and uses four different at the sixth count, the counter outputs and fifth counts. In other words, they
logic gate combinations to bring out the A and B hold logic 1 simultaneously glow only when the complement of B
six faces of the dice. for the first time, so by ANDing A and and C outputs goes high. This function
At the heart of the circuit is a B outputs you can give logic 1 to the can be obtained by using two NAND
14-stage ripple-carry binary counter reset terminal of the counter at the sixth gates such that their output corresponds
IC CD4060BC (IC1) with built-in os- count, thereby resetting the counter. to the Boolean expression BC or B+C ac-
cillator. The logic section is designed LED2 and LED5 always glow at cording to De Morgans theorem.
around CMOS quad 2-input NOR gate the same count, as do LED1 and LED6, LED7 glows at even counts like 0,
IC CD4001BC (IC2) and quad 2-input and LED3 and LED4. Using
NAND gate IC CD4011BC (IC3). The these three pairs of LEDs
display section is formed by a group of and LED7, four logical com-
seven LEDs. binations have been made in
The circuit is divided into three sec- the circuit. LED1 and LED6
tions: counter, logic and display. glow at all counts, except
The counter section is built around 0 and 1. Further, it can be
binary counter IC CD4060BC (IC1). The noticed that they glow when
counter frequency (f) is decided by the A or B is high, hence a
in-built oscillator formed by resistor R1 NOR gate whose output is
and capacitor C1 as follows: A+B according to Boolean
f=1/2.2R1C1. algebra will perform the job Fig. 2: Different faces of dice
Here, the frequency is fixed at around of operating these LEDs.
2056 Hz. LED3 and LED4 glow at all counts, 2 and 4. In other words, it glows when
Only the first three outputs of the except for the first three counts, i.e., the C output is low. This function can
counter (designated as A, B and C, they glow when either A, or B and C be achieved easily by inverting the C
respectively) have been used in the cir- are high. This logic function can be output twice using the remaining two
cuit. The counter is designed to reset at obtained by using an OR gate and an NAND gates. The output will also be
the sixth count (110) as only six counts AND gate, but since we are using only buffered by these two inverter gates.
T
his antitheft device for bicycles kept on when you are using this bi- input terminals and the internal LED of
is inexpensive and can be con- cycle guard. When it is flipped towards 4-pin DIP AC input isolator optocou-
structed easily using a few on position, the circuit gets power pler IC3 (PS2505-1 or PC814) glows.
components. from the miniature 12V battery. Now As a result, the internal transistor of
At the heart of the circuit is a wheel LED1 lights up and resistor R4 limits IC3 conducts and pin 2 of IC1 is pulled
rotation detector, realised using a DC the LED current. Next, the monostable low by the optocoupler and the mo-
micro motor. For the purpose, you can built around IC1, which is CMOS ver- nostable built around IC1 is triggered.
use the micromotor (spindle motor) of sion of timer LMC555, is powered The output at pin 3 of IC1 now
a discarded local CD deck mechanism. through a low-current, fixed-voltage drives piezobuzzer-driver transistor
With a little skill and patience, you can regulator IC2 (78L05). T1 via resistor R3 and the buzzer starts
easily attach a small metallic pulley Initially, when the bicycle is stand- sounding to alert you. In this circuit,
covered with a rubber washer to the ing still, the monostable output at pin the buzzer remains on for around two
motor spindle. Thereafter, fix the unit 3 of IC1 is low and the circuit is in idle minutes. You can change this time by
in the back wheel of the cycle, like the state. In the event of a theft attempt, changing the values of resistor R2 and
capacitor C1.
Zener diodes ZD1 and ZD2
(each 5.1V) act as a protector
for optocoupler IC3. The costly
GP12V/27A battery is used here
due to its compact size and reli-
ability. 12V active buzzers with
high-pitched tone output may be
used with this circuit. These are
readily available in the market.
Note. The specific optocoupler
is used here deliberately, instead
of a bridge rectifier, to increase
the circuits detection sensitivity.
Never replace the same with a DC
optocoupler.
I
n water-level controllers or tanks, fore the probes last longer. up in the tank, it receives 1kHz signal
a DC current is passed through the The block diagram for the liquid- from IC1 via the probes immersed in
metallic probes fitted in the water level alarm is shown in Fig. 1. The water and conducts during the nega-
tank to sense the water level. This causes signal generator sends the generated tive half cycle of 1kHz signals. Due to
electrolysis and corrosion of probes, signal to the first metallic probe. The the presence of capacitor C7 (2.2F),
inhibiting the conduction of current and second metallic probe is connected npn transistor T2 continues to get base
degrading its performance. As a conse- to the sensing circuit followed by the bias and conducts to provide 3.3V DC
quence, probes have to be replaced regu- alarm circuit. to melody generator IC UM66 (IC2).
larly to maintain proper current flow. The complete circuit for the liquid- Pin configuration of IC UM66 is shown
The liquid-level alarm given here level alarm is shown in Fig. 2. The in Fig. 3. Preset VR1 acts as the output
overcomes this problem. A 1kHz AC astable multibrator built around IC loudness controller. It can
555 (IC1) generates be varied to set the alarm
1kHz square wave sound from the speaker at
signal, which is fed the desired level.
to one of the probes The circuit works off
via a DC blocking 12V unregulated power
capacitor. Fig. 3: Pin and can be used to detect
configuration
Fig. 1: Block diagram of liquid level alarm When the water of UM66 any conductive liquid.
R
emote controllers for various The circuit consists of a timer IC Initially, to switch on mains supply
audio/video systems are usu- NE555, a decade counter IC HCF4017, for the audio/video system and the
ally provided with a power three BC548 transistors, an infrared (IR) circuit itself, pushbutton switch S1 is
on/off or standby-mode selector sensor IC TSOP1738 and a few discrete pressed momentarily.
button. But turning the system off from components. Transformer X1, diodes Normally, the output of IR receiver
the remote handset actually does not D1 and D2, and capacitor C1 form module IC3 is high when it is not being
cut off the whole system from mains. power supply for the circuit. Zener activated by a remote, and the relay
Some circuitry inside the system con- diode ZD1 provides regulated voltage energises to close the N/O contact and
tinues to get power from mains even to IR sensor TSOP1738 (IC3). place a short across switch S1. This cir-
when the power is turned off using the Timer IC NE555 (IC1) is configured cuit and the load continue to get power
remote handset. One needs to turn off as an astable multivibrator that produces through the N/O contact of relay RL1
the mechanical switch provided on the a clock pulse every two seconds. The even when pushbutton S1 is released.
systems front panel or wall outlet in clock pulse is fed to decade counter IC At the same time, the output of IC2
order to turn off the entire system. HCF4017 (IC2), whose Q7 output is in- starts scrolling around its output pins,
Also, accessories like TV boost- verted by transistor T1 and applied to the i.e., pins 5 and 6 go high and low al-
ers, stabilisers and additional ampli- base of transistor T2 to drive the relay. ternately for the clock pulses received.
speaker systems cannot be turned off The output of sensor IC3 is used When Q6 output goes high the warning
from the remote handset. And it is very to drive transistor T3 and activate the LED (yellow) glows, and when Q7 out-
annoying to get out of bed to switch off relay via transistor T2. put goes high the off LED (red) glows.
mains after watching some programme The outputs of transistors T1 and Yellow LED (LED1) indicates that
on TV or listening to music. T3 are ORed and the resultant is ap- its time to switch off the audio or
The circuit given here can discon- plied to transistor T2. Thus if any one video system.
nect the entire system along with the or both the inputs connected to the base The entire system can be turned
accessories, including the circuit itself, of transistor T2 are high, relay RL1 en- off by pressing any key on the hand-
U
sing this simple circuit and a counter ICs 74LS90, decoder/driver ICs IC 74LS90 is a 4-bit ripple decade
known-value zener diode, you 74LS47 and 7-segment common-anode counter. When the output of IC3 is 10
can find the breakdown volt- displays LTS542 is shown in Fig. 2. (1001), it provides clock at pin 14 of IC4
age value of any zener diode. The cir- Decade counters IC3 and IC4 count the (via AND gate N1) for further counting.
cuit is divided into two
sections: zener evalu-
ator and display unit.
Regulated 12V and 5V
are required to power
the zener evaluator sec-
tion, while the display
section works off only
5V. Connect +5V, point
A and ground of the ze-
ner evaluator section to
the respective terminals
of the display section.
The zener evaluator
circuit (Fig. 1) comprises
a linear ramp genera-
tor built around timer Fig. 1: Circuit diagram of zener evaluator section
NE555 and an astable
multivibrator built around another
NE555. The resistor of the monostable is
replaced with a constant-current source
formed by transistor T1. Capacitor C2 is
charged linearly by the constant-current
source formed by transistor T1.
The time period T of the linear
ramp generated by IC1 at its pin 6
across capacitor C2 is given by:
(2/3)VCCR5 (R6+VR2)C2
T= .......Eq. (1)
R6VCCVBE (R6+VR2)
T
R-C Combinations
his CFL circuit uses only two to 35 kHz. To vary the frequency, you
R1 C1 F
semiconductor devices and can change the value of resistor R1
20k 1 kpF 25 kHz
few passive components, which in the R-C oscillator (see the table).
15k 1 kpF 35 kHz
oscillations.
The n-channel enhancement-mode
MOSFET IRFZ44 (T1) is readily avail-
able in the market. Transformer X1 is
built around an EE-type, 25137mm
ferrite core. Use good insulation be-
tween the primary and secondary
windings. After winding the transform-
er coils, put some insulating sheet or
paper at the edges (tips) of the EE-cores
as shown in Fig. 2. This insulation gap
between the two cores helps to achieve
maximum brightness with minimum
current drain.
Fig. 1: Circuit of MOSFET-based CFL High-tension (HT) coupling capacitor
C4 limits the current
keeps the cost low and simplfies the to the lamp. Capaci-
circuit. Low power consumption is its tor C2 between drain
another advantage. and ground clips any
The circuit works off a 12V, 7AH ripple voltage to give
battery and is built around CMOS a linear waveform.
hex-inverter IC CD4069 (IC1). Using The performance
CMOS IC, the power consumption of of this CFL depends
the main stage (oscillator) is limited to on the type of the
a few microwatts. The IC is configured CFL, EE core, oscil-
as an R-C oscillator with four of its lation frequency,
gates connected in parallel to enhance ferrite core gap, etc.
its output drive capability. Its high Never use a Schmitt
output can drive TTL loads. inverter (40106) for
Gates N1 and N2 form an Fig. 2: EE ferrite dimensions this circuit. Use a
R-C oscillator and the remaining four base for the IC and
gates (N3 through N6) are connected For R1 (15 kilo-ohms) and C1 (0.001 handle the MOSFET carefully. Before
in parallel to provide a high output F) used in this circuit, the selected soldering the MOSFET, make sure
current to the MOSFET switch. The frequency is 35 kHz. that the R-C oscillator is oscillating
R-C oscillator has only two external Resistor R1 connected between properly. Connect the MOSFET only
components and its output frequency pins 1 and 2 of gate N1 provides a if the oscillations are proper. In case
(f) can be roughly calculated using the negative DC feedback and biases the you dont use an IC base, make sure
following equation: inverter to a linear region where it the soldering iron is earthed properly
0.5 works as an amplifier. Capacitor C1 while soldering the IC.
f = R1C1 connected between pins 1 and 4 of IC1 Lab Note. A Philips 9W CFL was
provides a positive feedback to enable used for testing the circuit.
A
t the heart of this heat-sensi- IC2, the voltage presented to this pin is any ripple that passes through the posi-
tive switch is IC LM35 (IC1), linearly variable. This voltage is used tive supply rail to avoid errors in the
which is a linear temperature as the reference level for the compara- circuit operation.
sensor and linear temperature-to-volt- tor against the output supplied by IC1. By adjusting potmeter VR1 and
age converter circuit. So if the non-inverting input of thereby varying the reference volt-
The converter provides accurately IC2 receives a voltage lower than age level at the inverting input pin
linear and directly proportional output the set level, its output goes low (ap- of IC1, the temperature threshold
signal in millivolts over the tempera- proximately 650 mV). This low level is at which energisation of the relay is
ture range of 0C to 155C. It develops applied to the input of the load-relay required can be set. As this setting is
an output voltage of 10 mV per degree driver comprising npn transistors T1 linear, the knob of potmeter VR1 can
centigrade change in the ambient tem- and T2. The low level presented at the be provided with a linear dial caliber-
perature. Therefore the output voltage base of transistor T1 keeps it non-con- ated in degrees centigrade. Therefore
varies from 0 mV at 0C to 1V at 100C ductive. Since T2 receives the forward any temperature level can be selected
and any voltage measurement circuit bias voltage via the emitter of T1, it is and constantly monitored for external
connected across the output pins can also kept non-conductive. Hence, relay actions like turning on a room heater
read the temperature directly. RL1 is in de-energised state, keeping in winter or a room cooler in summer.
The input and ground pins of this mains supply to the load off as long The circuit can also be used to activate
heat-to-voltage converter IC are con- as the temperature at the sensor is low. emergency fire extinguishers, if posi-
nected across the regulated power Conversely, if the non-inverting tioned at the probable fire accident site.
supply rails and decoupled by R1 and input receives a voltage higher than The circuit can be modified to oper-
C1. Its temperature-tracking output the set level, its output goes high (ap- ate any electrical appliance. In that case,
is applied to the non-inverting input proximately 2200 mV) and the load is relay RL1 must be a heavy-duty type
(pin 3) of the comparator built around turned on. This happens when IC1 is with appropriately rated contacts to
IC2. The inverting input (pin 2) of IC2 at a higher temperature and its output match the power demands of the load
is connected across the positive sup- voltage is also higher than the set level to be operated.
ply rails via a voltage divider network at the inverting input of IC2. So the
Y
ou can test both npn and pnp Switch S3 npn transistor LED1 LED2
transistors using this circuit. Kept pressed Good Flickers Flickers
The circuit indicates whether Pressed momentarily to Collector-emitter Glows Doesnt glow
the transistor is good, open or shorted trigger IC2 short
through two light-emitting diodes Pressed momentarily to Collector-emitter Remains off for two Glows for the set time
(LEDs). trigger IC2 open seconds, then glows (say, two seconds)
and then turns off
The circuit comprises two NE555
Switch S3 pnp transistor LED1 LED2
timer ICs: one (IC1) is wired in the Kept pressed Good Flickers Flickers
astable mode and the other (IC2) in the Pressed momentarily to Collector-emitter Remains off for two Glows for the set time
monostable mode. The time period of trigger IC2 short seconds, then glows (say, two seconds),
the astable multivibrator is around 0.5 then turns off
second. Its output goes to the base of Pressed momentarily to Collector-emitter Glows Remains off
trigger IC2 open
the npn/pnp transistor under test via
time period of
the monostable mul-
tivibrator is around
two seconds.
To test a transis-
tor, insert it at the
appropriate place
shown within dot-
ted lines and slide
switch S2 towards
the transistor type
(npn or pnp) being
tested. From glowing
of LED1 and LED2
on triggering of the
DPDT switch S2. pnp transistor can be tested. The collec- monostable via switch S3, you can
Switch S2 selects the npn/pnp tor of npn or pnp transistor goes to reset infer whether the transistor is good,
transistor you are going to test, which pin 4 of the monostable (IC2). Switch S3 short or open-circuited, as shown in
means that at a time only an npn or a is used to trigger the monostable. The the table.
W
ater is a vital but scarce at B point. Connect +B, B and When water in the tank touches the
natural resource. To prevent GND terminals of the power supply metal plate sensors, it extends ground
water wastage, this water- unit to the respective terminals of the to pin 2 of IC1. Now pin 3 of IC1 is at
tank overflow indicator comes in handy. water-tank overflow indicator circuit. a higher potential than pin 2. The high
It gives audio as well visual alarm when- The circuit is built around op-amp output of the op-amp generates 3.1V
ever the water tank overflows. LM741 (IC1), which is used as a com- across zener diode ZD1. Melody gen-
Fig. 1 shows the water-tank over- parator. The pin configuration of melody erator IC2 produces a melody, which
Fig. 1: Circuit of the water-tank overflow audio-visual indicator Fig. 2: Power supply circuit
flow indicator circuit and Fig. 2 shows generator IC1(UM66) is shown in Fig. 3. drives the transistor to
the power supply circuit. When water in the tank is below the light up LED1 and sound
In the power supply unit, mains metal plate sensors, inverting pin 2 of IC1 an alarm from the loud-
AC is stepped down by transformer X1 is at a higher potential than non-invert- speaker. Rectifier diode
to deliver secondary output of 9V-0-9V ing pin 3. Output pin 6 of the op-amp is D5 is used to prevent
AC at 300 mA. The transformer output low and there is no music from program- negative polarity to the
Fig. 3: Pin
is rectified by a full-wave bridge recti- mable melody generator IC UM66 (IC2). configuration
cathode of the zener
fier comprising diodes D1 through D4 Transistor BC547 (T1) remains cut-off of UM66 diode.
T
his simple smoke detector is diode and the transistor (see Fig. 1) Darlington-pair transistors conduct to
highly sensitive but inexpensive. allows interruption of the signal with activate the buzzer and light up LED1.
It uses a Darlington-pair ampli- smoke, switching the module output When the smoke in the gap is
fier employing two npn transistors and from on to off state. cleared, light from the IR LED falls on
an infrared photo-interrupter module as The circuit of the smoke detector is the phototransistor and it starts conduct-
the sensor. The circuit gives audio-visual shown in Fig. 2. ing. As a result, Darlington-pair transis-
alarm whenever thick smoke is present in When the smoke enters the gap, tors stop conducting and the buzzer and
the environment. the IR rays falling on the photo-transis- LED1 turn off.
The photo-interrupter module For maximum
(H21A1) consists of a gallium-arsenide sensitivity, ad-
infrared LED coupled to a silicon just presets VR1
and VR2. VR1 is
used to control the
sensitivity of the
photo-interrupter
module, while
VR2 is used to
control the sensi-
tivity of Darling-
Fig. 1: Top and bottom views of the photo- ton-pair transis-
Fig. 2: Schematic of the smoke detector
interrupter module (H21A1) tors.
T
his vibration detector is realised the entire circuit is in
using readily available, low-cost idle state. LED1 indi-
components. One of its many cates the power status.
applications is in a rolling shutter In the event of
guard for offices and shops. The de- vibrations, IC2 is
tector will sense vibration caused by clocked by the pulses
activities like drilling and switch on the from the piezoceram-
connected load (bulb, piezobuzzer, etc) ic element connected
to alert you. to its clock pin 14. Q1
Fig. 2: Pin
The circuit works off a 6V battery configuration of through Q9 outputs
or 6V regulated power supply and SCR1 BT169 and of IC2 are fed to re- Fig. 3: Arrangement for rolling shutter guard for
back view of the shops, offices and banks
uses a piezoceramic element as the piezo element lay-driver switching
vibration detector. The same is easily transistor T1 through its gate. This, in turn, energises relay
available from electronics/telephone diodes D1 through D9 connected in RL1. The relay contacts can be used
component vendors or you can take it OR mode. to switch any alarm device to indicate
out from an active buzzer. Immediately after clocking, any of vibration detection. The circuit can
Initially, when the power is switched the outputs Q1 through Q9 would go be reset by momentarily pressing
on, decade counter IC1 is reset by power- high and npn transistor T1 would con- switch S1.
on-reset components C2 and R1. As a duct. As a result, SCR1 is fired through Zener diodes ZD1 and ZD2 at the
clock input of IC1
are used for protec-
tion against high
voltage input. In
the case of repeated
false triggering of
IC1, add a 100nF
capacitor in parallel
to the piezoceramic
element.
The pin con-
figuration of SCR
BT169 and the
back view of the
piezo element are
shown in Fig. 2. Fig.
3 shows suggest-
ed location of the
vibration detector
for rolling shutters
of banks, shops,
Fig. 1: Circuit of the sensitive vibration detector etc.
T
his circuit lets you switch on/off by an npn transistor to drive a triac. at the bottom. When any of the micro-
an AC lamp or any other load by The triac directly activates the AC switches is pressed, the lamp will turn
pressing a normally open micro- lamp. on and off alternately.
switch. The current passing through The 12V DC required for the circuit Since this circuit is not isolated
the switch is very small. is derived from AC mains. BT136 is a from AC mains, dont touch it after
For each press of the microswitch, general-purpose triac. connecting the power supply.
the output of the IC, which is a The circuit can be used as a stair- Note. Use of a Texas or ST make IC
CMOS J-K master-slave flip-flop, case light switch. Connect two micro- 4027 is recommended.
A
re you in the habit of falling t=2.3RC sary power backup for IC1. That is,
asleep while listening to where R is the value of resistor R8 during the period, pin 3 of IC1 is low.
music? If yes, youll love this and C is the value of capacitor C3. When output pin 3 of IC1 goes high,
circuit. It will automatically start When transistor T2 is cut-off, its col- the relay is energised through transis-
functioning when you switch off your lector voltage is high. So pin 12 of IC1 is tors T3 and T4 and, at the same time,
bedroom light and shall turn your CD high and IC1 is in reset condition. counting is disabled by the feedback
player off after a predetermined time. When light is switched off, the from pins 3 through 11 (clock input)
In the presence of ambient light, or resistance of LDR1 increases, driving of IC1 via signal diode D7. That is, due
when you switch on light of the room transistor T1 into cut-off state. The col- to the feedback, output pin 3 remains
in the morning, the CD player will lector voltage of transistor T1 goes high high unless another high-to-low pulse
again start playing. Unlike the usual to light up LED2 (indicating that the is received at its reset pin 12.
timers, you dont have to set this timer timer circuit is enabled) and transistor After the relay is energised, there
before sleeping. T2 starts conducting. As the collector will be no AC power in the socket. The
The circuit derives its power di- voltage of transistor T2 goes low to glowing of LED5 indicates that your
rectly from the bridge rectifiers. When LDR1 Timer LED2 Reset pin 12 Count LED3 CD player has been switched off.
on/off switch S1 is closed, LED1 Light Off High Off The desired off time period for
glows to indicate that the circuit is Dark On Low Blink the timer circuit can be set by choosing
powered on. proper values of resistor R8 and capaci-
In the presence of light, the resis- around 0.2V, ground potential becomes tor C3. If R8 is 680 kilo-ohms and C3 is
tance of the light-dependent resistor available at reset pin 12 of IC1. The low 0.22 F, the off time period is around
(LDR1) is low, so transistor T1 conducts state at pin 12 enables the oscillator and 45 minutes.
to drive transistor T2 into cut-off state it starts counting. LED3 at pin 7 of IC1 The glowing of LED4 gives the
and the timer circuit remains inactive. starts blinking. Its blinking frequency warning that your CD player is going
The collector of transistor T2 is depends on the R-C components con- to be switched off shortly. In case you
connected to reset pin 12 of IC CD4060 nected between its pins 9 and 10. want to extend the timer setting for
(IC1) via signal diode D5. IC CD4060 is The status of LED2 and LED3 in the another round, just press reset switch
a 14-stage ripple counter with a built-in circuit with light falling and not falling S2 momentarily. LED4 stops glowing
oscillator. The time period of oscilla- on LDR1 is given below: and counting starts again from the
tions (t) is determined by capacitor C3 During counting, in case the initial stage.
M
ake your washbasin tap The receiver circuit comprises the =1.1100103100106
work automatically when sensor module, monostable timer and =11 seconds
you put your hands just be- relay driver circuit (see Fig. 2). The sen- Use shielded wires or leads for
low the water tap outlet. This infrared- sor module TSOP1738 is sensitive to IR installing the IR LED and the IR sensor
based system detects any interruption radiation modulated at 38 kHz. Its nor- at opposite sides of the washbasin. In-
of the IR rays by your hands or utensil mally high output goes momentarily stall the IR LED and IR sensor around
and water automatically starts flowing low when any IR radiation is detected half a metre apart such that the IR rays
out of the tap. or interrupted. transmitted by the IR LED directly fall
C
MOS colour micro-cameras are When the car is moving forward, even if its indicator LED2 is switched
readily available from com- transistor T1 doesnt conduct and relay off by the relay contacts. Power sup-
ponent vendors at reasonable RL1 remains de-energised. As a re- ply for the CMOS camera is provided
prices. Using such a camera (model sult, external video from the cars AV by the car battery through IC1. LED3
FQY888C), you can make a rear-view system connects to the cars TV video raises the output voltage of IC1 to
monitor for your car as described here. input, allowing you to enjoy your fa- near 11.2V and indicates that the cam-
The circuit works off the DC sup- vourite programmes. LED2 glows to era is working.
T
his circuit is designed for indi- the motor rotates, it develops a voltage. at pin 2, output pin 6 of comparator
cating over-speed and direction This over-speed indicator is built IC1 goes high to sound piezobuzzer
of rotation of the motor used in around operational amplifier CA3140 PZ1 and light up LED3.
mini hand tools, water pump motors, (IC1). Set the reference voltage (de- The rotation indicator circuit
toys and other appliances. pending on the desired speed) by is built around AND gate 74LS08
A 12V DC motor (M1) is coupled to adjusting preset VR1 at pin 2 of IC1. (IC2). Pin 2 of gate N1 goes high
when the motor rotates
in forward direction,
while pin 1 of gate N1 is
pulled high via resistor
R2. When both pins 1
and 2 are high, output
pin 3 of gate N1 goes
high to light up LED1.
Similarly, pin 5 of gate
N2 goes high when the
motor rotates in reverse
direction. When both
pins 4 and 5 are high,
output pin 6 of gate N2
goes high to light up
LED2.
T
his simple, economical and ver- monitors the flow of water and raises Freewheeling diode D5 prevents chat-
satile circuit switches on the an alarm if the pump runs dry. tering of the relay due to the back emf
motor pump when water in the Power supply is obtained through produced by the relay coil.
overhead tank falls below the lowest step-down transformer X1, diodes D1 When the water level rises to
level and turns it off when the tank through D4, capacitor C1, series current- bridge the electrodes, because of the
is full. Moreover, if the pump is run- limiting resistor R1, regulator IC1, and conductivity of water, pin 6 (E1) is
ning dry due to low voltage, it sounds noise-filtering capacitors C2 and C3. pulled down to ground (E2). This does
an alarm to alert you to switch off the The set-up for the water-level not alter the output state of IC2, which