You are on page 1of 180

Electronic Projects

.
new collections
L> EVEREADY
Volume 4
HEAVY DUTY

F.
■ ■

3 fWItiM
WMfbKH

»!
ij
..

I
More'ÿJl
than[•Iconstructional

Rl50 projects
K&l ! B
CIRCUIT
IDEAS

AUTOMATIC LOW-POWER SUNIL K


UMAR

EMERGENCY LIGHT
 S.C. DWIVEDI current through diode D5 and limit-
FRONT VIEW FRONT VIEW
ing resistor R16. By adjusting preset FRONT VIEW

S
H
ere is a white-LED-based VR1, the output voltage can be ad- BD140
BC
emergency light that offers justed to deliver the required charg-
the following advantages: ing current.
LM A 548
317
1. It is highly bright due to the use When the battery gets charged to
of white LEDs. 6.8V, zener diode ZD1 conducts and E C B
ADJ VlN CB E
2. The light turns on automatically charging current from regulator IC1 VoUT
when mains supply fails, and turns off finds a path through transistor T1 to Fig. 2: Pin configurations of LM317, BD140
when mains power resumes. ground and it stops charging of the and BC548
3. It has its own battery charger. battery.
When the battery is fully charged, The LED driver section uses a to- off. On the other hand, when mains
charging stops automatically. tal of twelve 10mm white LEDs. All fails, the base of transistor T2 becomes
The circuit comprises two sections: the LEDs are connected in parallel low and it conducts. This makes all
charger power supply and LED driver. with a 100-ohm resistor in series with the LEDs (LED1 through LED12) glow.
The charger power supply section is each. The common-anode junction of The mains power supply, when
available,
R15
charges the bat-
1K LED1-LED12 = 10mm tery and keeps
HIGH INTENSITY WHITE LED
A/WV
T2 the LEDs off as
BD140 R3-R14 = 100Q
transistor T2 re-
LED1 LED12 mains cut-off.
_\\ y\\ y\\ 4L\\ T\\ T\\ y\\ V\\ y\\, y\\ During mains
X1 = 230V AC failure, the
PRIMARY R3> R4> R5> R6 R7> R8 R9S R10ÿ R12S R13S R14; charging sec-
TO 0-9V, 500mA
SECONDARY tion stops
TRANSFORMER working and


L
IN IC1 OUT the battery sup-

FYÿrC!
230VAC O
50Hz
§ 9V
oAC D3k, Cl-p
3 LM317 2

ADJ
R1
\
D5
vwv
180Q 1N4007 5W
R16
16Q
ZD1
6.8V
+ 6V
0.5W T 4.5Ah
ply makes the
LEDs glow.
Assemble
1000M VR1 ZENER BATT. the circuit on a
25V 2.2K A/WV general-pur-
T1 R2
BC548 1.2K pose PCB and
N D1-D4 = 1 N4007
enclose in a
cabinet with
Fig. 1: Automatic high intensity LED-based emergency light enough space
for battery and
built around 3-terminal adjustable all the twelve LEDs is connected to switches. Mount the LEDs on the cabi-
regulator IC LM317 (IC1), while the the collector of pnp transistor T2 and net such that they light up the room.
LED driver section is built around the emitter of transistor T2 is directly A hole in the cabinet should be drilled
transistor BD140 (T2). connected to the positive terminal of to connect 230V AC input for the pri-
In the charger power supply sec- 6V battery. The unregulated DC volt- mary of the transformer.
tion, input AC mains is stepped down age, produced at the cathode junc- EFY lab note. We have tested the
by transformer X1 to deliver 9V, 500 tion of diodes D1 and D3, is fed to circuit with twelve 10mm white LEDs.
mA to the bridge rectifier, which com- the base of transistor T2 through a 1- You can use more LEDs provided the
prises diodes D1 through D4. Filter kilo-ohm resistor. total current consumption does not ex-
capacitor C1 eliminates ripples. Un- When mains power is available, the ceed 1.5A. Driver transistor T2 can de-
regulated DC voltage is fed to input base of transistor T2 remains high and liver up to 1.5A with proper heat-sink
pin 3 of IC1 and provides charging T2 does not conduct. Thus LEDs are arrangement. 

126 • JANUARY 2008 • ELECTRONICS FOR YOU WWW.EFYMAG.COM


CONSTRUCTION

MICROCONTROLLER-BASED
TACHOMETER UMAR
SUNIL K
 PROF. K. PADMANABHAN you first place a contrasting colour
mask. A strip of white adhesive tape

A
tachometer is nothing but a is ideal on the spinning object. Posi-
simple electronic digital trans- tion it such that the intensity of light
ducer. Normally, it is used for PARTS LIST reflected from the object’s surface
measuring the speed of a rotating Semiconductors: changes as it rotates.
shaft. The number of revolutions per IC1 - AT89C2051 Each time the tape spins past
minute (rpm) is valuable information microcontroller
the probe, the momentary increase
IC2 - ULN2003 current buffer
for understanding any rotational sys- IC3 - CA3140 operational in reflected light is detected by the
tem. For example, there is an optimum amplifier phototransistor. The signal processor
T1-T4 - BC557 pnp transistors
speed for drilling a particular-size hole T5 - 2N2222 npn transistor and microcontroller circuit counts
in a particular metal piece; there is an T6 - L14F1 photo-transistor the increase in the number of such light
ideal sanding disk speed that depends D1 - 1N4007 rectifier diode reflections sensed by it and thereby
DIS1 - KLQ564 4-digit,
on the material being finished. You 7-segment display evaluates the rpm, which is displayed
may also want to measure the speed Resistors (all ¼-watt, ±5% carbon): on the 4-digit, 7-segment display.
of fans you use. R1-R4 - 1-kilo-ohm The phototransistor is kept inside
This easy-to-make photoelectric R5, R6 - 10-kilo-ohm a plastic tube, which has a convex lens
R7-R11 - 1.2-kilo-ohm
tachometer measures the rpm of most RNW1 - 10-kilo-ohm resistor fitted at one end. A convex lens of
shop-floor tools and many household network about 1cm diameter and 8-10cm focal
machines without any mechanical or VR1 - 4.7-kilo-ohm preset
length is a common item used by
Capacitors:
electrical interface. C1 - 10µF, 16V electrolytic watch repairers and in cine film viewer
C2, C5, C6 - 0.1µF ceramic disk toys. It can be obtained from them to
How it works? C3, C4 - 22pF ceramic disk set up the experiment. The
Just point the light-sensitive probe tip Miscellaneous: phototransistor is fixed on a piece of
S1 - Push-to-on switch
atop the spinning shaft towards the S2 - On/Off Switch cardboard such that it faces the lens at
spinning blade, disk or chuck and read XTAL - 12MHz a distance of about 8 cm. The leads
the rpm. The only requirement is that BATT. - 6V battery
from the phototransistor are taken out

Fig. 1: Circuit of microcontroller-based tachometer

92 • JANUARY 2008 • ELECTRONICS FOR YOU WWW.EFYMAG.COM


CONSTRUCTION
The AT89C2051 is a 20-pin, Port-3 pins P3.0 through P3.3 of the
8-bit microcontroller of Intel’s microcontroller are connected to the
8051 family made by Atmel Cor- base of transistors T1 through T4, re-
poration. Port-1 pins P1.7 spectively, to select one digit out of
through P1.2, and port-3 pin P3.7 the four at a time and to supply an-
are connected to input pins 1 ode-drive currents to the common an-
through 7 of ULN2003. Port-1 ode pin of respective digit. Pin con-
pins are pulled up with 10-kilo- figuration of transistor BC557 is shown
ohm resistor network RNW1. in Fig. 3.
They drive all the seven seg- When pin P3.0 of microcontroller
Fig. 2: Suitable arrangement of phototransistor ments of the display with the IC1 goes low, it drives transistor T1
help of internal inverters. into saturation, which provides the
and connected in the drive current to
circuit shown in Fig. 1. anode pin 6 of 4-
Fig. 2 shows the suit- digit, 7-segment,
able arrangement of common-anode
phototransistor. display DIS1.
The detected signal Similarly, transis-
is amplified by transis- tors T2 through
Fig. 3: Pin
tor 2N2222 (T5) and T4, respectively,
configuration of further amplified by provide supply
transistor BC557 operational amplifier to common-an-
CA3140 (IC3). The reference voltage ode pins 8, 9 and
point for the operational amplifier is 12 of DIS1. Thus
obtained by resistor divider network microcontroller
comprising R2 and R3. The output IC1 drives the
from pin 6 of IC3 is fed to pin 12 of segment in mul-
microcontroller AT89C2051. Note that tiplexed manner
pins 12 and 13 of microcontroller using its port
AT89C2051 are the inputs (+ and -) of pins. This is time-
its internal analogue comparator. Pin division multi-
13 is adjusted to nearly half the sup- plexing process.
ply voltage using a potential divider Segment data
comprising resistor R7 and preset VR1 Fig. 4: A single-side, actual-size PCB layout for microcontroller-based
and display-en-
across the supply. tachometer able pulse for
The pulses picked up by the display are re-
phototransistor are sensed by the in- freshed every 5
ternal comparator of AT89C2051 and, ms. Thus, the dis-
through software, each pulse repre- play appears to
senting one rotation of the object is de- be continuous
tected. By counting the number of such even though it
pulses, on an average per minute ba- lights up one by
sis, the RPM is evaluated. It is dis- one.
played by a software routine to light Switch S1 is
up the LED segments of the 4-digit, 7- used to manually
segment display. reset the
microcontroller,
Circuit description while the power-
Fig. 1 shows the circuit of the on-reset signal
microcontroller-based tachometer. The for the
tachometer comprises AT89C2051 microcontroller is
microcontroller, ULN2003 high-current given by C1 and
Darlington transistor array, CA3140 R6. A 12MHz
operational amplifier, common-anode crystal is con-
7-segment (4-digit multiplexed) dis- nected to pins 4
play and its four anode-driving tran- and 5 of IC1 to
sistors. Fig. 5: Component layout for the PCB

94 • JANUARY 2008 • ELECTRONICS FOR YOU WWW.EFYMAG.COM


CONSTRUCTION
generate the basic clock frequency for torchlight for illumination of the ro- overflows every 100 microseconds and
the microcontroller. The circuit uses a tating object. For fans, use the light so the number counted by the timer
6V battery for power supply or alter- from behind. Hold the probe firmly program in this case will be ‘400.’ This
natively a mains derived low voltage so as to provide a steady, bright illu- is divided by ‘600,000’ (so many 100/
supply. An actual-size, single-side PCB mination on the object. Even an LED µs present in a minute), giving a result
layout for the tachometer (Fig. 1) is pen torch could be used here. Avoid of ‘1500.’ This gives the rpm. These
shown in Fig. 4 and its component lay- the fluctuating background light from digits are displayed on the 4-digit, 7-
out in Fig. 5. sources such as tubelight. segment display. To perform the divi-
sion, subroutine UDIV32 is employed,
Testing Software which is a standard subroutine avail-
The source code of this article is avail- The software is written in Assembly able for 8051 family for 32-bit number
able at http://www.electronicsforu. language and assembled using 8051 by 16-bit number division. It has an
com/efycodes/efy-codes.zip at code cross-assembler. It is well commented accuracy of 5 rpm in a 6000rpm count.
file ‘tacho.hex.’ Using a programmer, and easy to understand. It uses EFY note. The source code of this
load the code into the new chip AT89C2051’s internal timer for mea- article is available at http://
AT89C2051. (Refer the May 2005 issue suring the period of one cycle of the www.electronicsforu. com/efycodes/
of EFY for article on programmer for rotation in units of 100 microseconds. efy-codes.zip and will also be included
89C51 and 2051.) Then, fit it into the Thus if the speed is 1500 rpm, it is 25 in EFY-CD of February 2008 issue. 
circuit board and after powering up rps, and the time taken for one cycle
the circuit, test it. is 40 ms. Prof. K. Padmanabhan retired from Alagappa
For testing, point the probe using The timer uses an interrupt to count College of Technology, Guindy, Chennai

TACHO.ASM
$mod51 mov r2,40h DIV AB
ORG 0H CALL HEX2BCD MOV R6,B
AJMP 30H mov 50h,#0FFH MOV R7,A
ORG 0BH ;TIMER 0 INTERRUPT VECTOR call refresh ENDD: ret
AJMP TIMER0ISR ;Timer 0 Interrupt service rou- disp: call refresh1 DISP1:
tine address djnz 50h,disp ; so many times for a visible time limit REFRESH:; content of 18 to 1B memory locations are
ORG 30H jmp beg output on LEDs
MOV SP,#60H ;set stack pointer ;16 Bit Hex to BCD Conversion for 8051 Microcontroller ; only numbers 0 to 9 and A to F are valid data in
MOV P3,#0FFH ;set all port 3 bits high to enable in- ;This routine is for 16 bit Hex to BCD conversion; these locations
puts also ;Accepts a 16 bit binary number in R1,R2 and returns 5 MOV 18H,r3 ; least significant digit
MOV P1,#03 ;set port 1 to all zeros expect bits 0,1 digit BCD in ;R7,R6,R5,R4,R3(upto 64K ) MOV 19H,r4 ; next significant digit
MOV TMOD,#01100001B ;TIMER 1 - MODE 2 Hex2BCD: ;r1=high byte, r7 most significant digit, R2 MOV 1AH,r5
COUNTER,TIMR-0 TO 16 bit timer = LSByte MOV 1BH,R6 ; most significant digit (max:9999)
BEG: MOV TH0,#0ffH ;TIMER REG.0 IS SET TO 0, MOV R3,#00D RET
GIVES 64ms MOV R4,#00D refresh1:
MOV TL0,#-99 ; timer low reg. is also so MOV R5,#00D MOV R0,#1bh ; 1b,1a,19,18, holds values for 4 digits
setb et0 MOV R6,#00D MOV R4,#8 ; pin p3.3_ 0 made low one by one starts
setb ea MOV R7,#00D wth 18
mov 44h,#0 MOV B,#10D mov r7,#2 ; decimal pt.on 3rd digit from left (2 nd
mov 45h,#0 MOV A,R2 fromright)
acall delay DIV AB PQ2: CALL SEGDISP
ajmp lowsig MOV R3,B ; dec R0
delay: mov r2,#10 MOV B,#10 ; R7,R6,R5,R4,R3 mov a,r4
djnz r2,$ ;wait 20 us DIV AB rrc a
ret MOV R4,B mov r4,a
lowsig: jb p3.6,lowsig MOV R5,A jnc pQ2
call delay CJNE R1,#0H,HIGH_BYTE ; CHECK FOR HIGH PV3:RET
jnb p3.6,$ BYTE SEGDISP:mov dptr,#ledcode
setb tr0 ; start timer SJMP ENDD MOV A,@R0
mov c,p3.6 ;high begins HIGH_BYTE: MOV A,#6 ANL A,#0FH
mov p3.5,c ADD A,R3 MOVC A,@A+dptr
acall delay MOV B,#10 segcode:MOV R5,A
jb p3.6, $ DIV AB ORL A,#03H ; WE WANT TO USE PORT 1 BITS 0
mov c,p3.6 ;low now MOV R3,B AND 1 FOR INPUT ANLOG
mov p3.5,c ADD A,#5 ; so retain them high
acall delay ADD A,R4 S3: MOV P1,A ; SEGMENT_PORT
jnb p3.6,$ MOV B,#10 MOV A,R5 ;we use p3.7 for the segment ‘a’ of display
mov c,p3.6 ;high begins again DIV AB RRC A ;so get that bit D0into carry
mov p3.5,c MOV R4,B rrc a
clr tr0 ;stop timer ADD A,#2 mov p3.7,c ;segment ‘a;
clr et0 ;and interrupt by timer ADD A,R5 S1: MOV A,R4 ; get digit code from r4 00001000
mov r3,#0 ;number 600000 or 927c0 hex as Dividend MOV B,#10 cpl a ;11110111
mov r2,#09h ; 9 DIV AB rrc a ;11111011-1
mov r1,#27h ;27 MOV R5,B mov p3.0,c ; output to drive transsitors for digit light-
mov r0,#0c0h ; c0 CJNE R6,#00D,ADD_IT ing
mov r5,45h ;divisor is time for one cycle SJMP CONTINUE rrc a ;11111101-1
mov r4,44h ADD_IT: ADD A,R6 mov p3.1,c
call UDIV32 ;divide 60000/t CONTINUE: MOV R6,A rrc a ;11111110-1
mov 40h,r0 DJNZ R1,HIGH_BYTE mov p3.2,c
mov 41h,r1 MOV B, #10D rrc a ;1111111-0 yes low makes left most digit show
mov r1,41h MOV A,R6 msdigit

96 • JANUARY 2008 • ELECTRONICS FOR YOU WWW.EFYMAG.COM


CONSTRUCTION
mov p3.3,c push B mov a,r7
S5: setb RS0 ;select reg.bank 1 subb a,#0
S4: ACALL DELAY1 ; let it burn for some time mov r7,#0 mov 07,a
MOV A,#0ffH ; extinguish the digit after that time mov r6,#0 cpl C
MOV P3,A ; to prevent shadow mov r5,#0 jnc div_321
s6: RET mov r4,#0 mov r7,7
ledcode:DB 7EH,0CH,0B6H,9EH,0CCH,0DAH,0FAH mov B,#32 ;set loop count mov r6,6
;these are code for the numbers 0 to 9 and A to F div_lp32:clr RS0 ;selet reg.bank 0 mov r5,dph
DB 0EH,0FEH,0CEH,0EEH,0F8H,72H,0BCH,0F6H, clr C mov r4,dpl
0E2H mov a,r0 ;shift highestbit of X div_321: mov a,r0
DELAY1:MOV 55h,#0ffH ; 1ms rlc a rlc a
N: NOP mov r0,a mov r0,a ; shift result bit into partial quotient
DJNZ 55h,N mov a,r1 ;shift next bit of X mov a,r1
RET rlc a rlc a
TIMER0ISR:mov th0,#0ffh mov r1,a mov r1,a
mov tl0,#-90 ; in 100 us steps mov a,r2 ;shift next bit of X mov a,r2
push acc rlc a rlc a
mov a,#1 mov r2,a mov r2,a
clr c mov a,r3 ;shift next bit of X mov a,r3
add a, 44h ;count time btwn pulses rlc a rlc a
mov 44h,a mov r3,a mov r3,a
mov a,#0 setb rs0 ;reg. bank 1 djnz B,div_lp32
addc a,45h ;add carry to most sign. byte mov a,r4 ;lowest bit of remainder mov 7,r7
mov 45h,a rlc a mov 6,r6
pop acc mov r4,a mov 5,r5
reti mov a,r5 ;shift next bit of rem mov 4,r4
; subroutine UDIV32 rlc a mov 3,r3
;32 bit /16 bit to 32 bit quotient and remainder un- mov r5,a mov 2,r2
signed mov a,r6 ;shift next bit of rem mov 1,r1
;input r3,r2,r1,r0 = dividend X rlc a mov 0,r0
;input r5,r4 = divisor y mov r6,a clr rs0
;output r3-r0 = quotient Q of X/Y mov a,r7 ;shift next bit of rem pop B
;r7,r6,r5,r4 =remainder rlc a pop dph
;alters acc, flags mov r7,a pop dpl
UDIV32: push 08 ;save reg. bank 1 mov a,r4 pop 0Fh
push 09 clr C pop 0EH
push 0AH subb a,04 pop 0Dh
push 0BH mov dpl,a pop 0Ch
push 0CH mov a,r5 pop 0bh
push 0DH subb a,5 pop 0ah
push 0EH mov dph,a pop 09
push 0Fh mov a, r6 pop 08
push dpl subb a,#0 ret
push dph mov 06,a END 

98 • JANUARY 2008 • ELECTRONICS FOR YOU WWW.EFYMAG.COM


CIRCUIT
IDEAS

creates a field, stores energy and trans-


MOBILE BUG S.C. DW
IVEDI fers the stored energy in the form of
minute current to the inputs of IC1.
 D. MOHAN KUMAR This will upset the balanced input of
IC1 and convert the current into the

T
his handy, pocket-size mobile quired for a mobile bug. corresponding output voltage.
transmission detector can sense Here the circuit uses a 0.22µF disk Capacitor C4 along with high-value
the presence of an activated capacitor (C3) to capture the RF signals resistor R1 keeps the non-inverting in-
mobile phone from a distance of one- from the mobile phone. The lead length put stable for easy swing of the out-
and-a-half metres. So it can be used to of the capacitor is fixed as 18 mm with put to high state. Resistor R2 provides
prevent use of mobile phones in ex- a spacing of 8 mm between the leads to the discharge path for capacitor C4.
amination halls, confidential rooms, get the desired frequency. The disk ca- Feedback resistor R3 makes the invert-
etc. It is also useful for detecting the pacitor along with the leads acts as a ing input high when the output be-
use of mobile phone for spying and small gigahertz loop antenna to collect comes high. Capacitor C5 (47pF) is
unauthorised video transmission. the RF signals from the mobile phone. connected across ‘strobe’ (pin 8) and
‘null’ inputs (pin 1) of IC1 for phase
compensation and gain control to
optimise the frequency response.
When the mobile phone signal is
detected by C3, the output of IC1 be-
comes high and low alternately ac-
cording to the frequency of the signal
as indicated by LED1. This triggers
monostable timer IC2 through capaci-
tor C7. Capacitor C6 maintains the
base bias of transistor T1 for fast
switching action. The low-value tim-
ing components R6 and C9 produce
very short time delay to avoid audio
nuisance.
Assemble the circuit on a general-
The circuit can detect both the in- Op-amp IC CA3130 (IC1) is used purpose PCB as compact as possible
coming and outgoing calls, SMS and in the circuit as a current-to-voltage and enclose in a small box like junk
video transmission even if the mobile converter with capacitor C3 connected mobile case. As mentioned earlier, ca-
phone is kept in the silent mode. The between its inverting and non-invert- pacitor C3 should have a lead length
moment the bug detects RF transmis- ing inputs. It is a CMOS version using of 18 mm with lead spacing of 8 mm.
sion signal from an activated mobile gate-protected p-channel MOSFET Carefully solder the capacitor in stand-
phone, it starts sounding a beep alarm transistors in the input to provide very ing position with equal spacing of the
and the LED blinks. The alarm contin- high input impedance, very low input leads. The response can be optimised
ues until the signal transmission ceases. current and very high speed of perfor- by trimming the lead length of C3 for
An ordinary RF detector using mance. The output CMOS transistor the desired frequency. You may use a
tuned LC circuits is not suitable for is capable of swinging the output volt- short telescopic type antenna.
detecting signals in the GHz frequency age to within 10 mV of either supply Use the miniature 12V battery of a
band used in mobile phones. The voltage terminal. remote control and a small buzzer to
transmission frequency of mobile Capacitor C3 in conjunction with make the gadget pocket-size. The unit
phones ranges from 0.9 to 3 GHz with the lead inductance acts as a transmis- will give the warning indication if
a wavelength of 3.3 to 10 cm. So a cir- sion line that intercepts the signals someone uses mobile phone within a
cuit detecting gigahertz signals is re- from the mobile phone. This capacitor radius of 1.5 metres. 

WWW.EFYMAG.COM ELECTRONICS FOR YOU • JANUARY 2008 • 135


CONSTRUCTION

TEMPERATURE INDICATOR-
CUM-CONTROLLER EO
SANI TH

 AKSHAY MATHUR Circuit description


Fig. 1 shows the circuit of the tempera-

H
ere is an easy-to-construct ture indicator-cum-controller. It com- comprising diodes D1 through D4, fil-
temperature indicator-cum- prises microcontroller ATmega8535, tered by capacitor C1 and regulated
controller that can be inter- temperature sensor LM35, regulator by IC 7806 (IC1). LED1 acts as the DC
faced with a heater’s coil to maintain 7806, an LCD module and a few dis- power indicator. Resistor R1 acts as the
the ambient room temperature. The crete components. current limiter. A 4.8V rechargeable
controller is based on ATmega8535 The 230V, 50Hz AC mains is battery provides battery backup.
microcontroller, which makes it dy- stepped down by transformer X1 to The ATmega8535 is a low-power
namic and faster, and uses an LCD deliver a secondary output of 9V, 500 CMOS 8-bit microcontroller based on
module to display and two keys to in- mA. The transformer output is recti- the AVR enhanced RISC architecture.
crease or decrease the set values. fied by a full-wave bridge rectifier ATmega8535 has such features as 8 kB

Fig. 1: Circuit of temperature indicator-cum-controller

84 • JANUARY 2008 • ELECTRONICS FOR YOU WWW.EFYMAG.COM


CONSTRUCTION
PARTS LIST through 6 (RS, R/W, EN),
Semiconductors: and pins PD4 through
IC1 - 7806, 6V regulator PD7 to D4 through D7 of
IC2 - ATmega8535 AVR the LCD module, respec-
microcontroller
IC3 - LM35 temperature sensor tively. Contrast is con-
T1 - 2N2222 npn transistor trolled by preset VR1. Re-
D1-D6 - 1N4007 rectifier diode
LED1, LED2 - 5mm light-emitting diode sistor R3 limits the cur-
- 16-x2-line LCD module rent of backlight of the
Resistors (all ¼-watt, ±5% carbon): LCD.
R1, R5 - 330-ohm
R2 - 4.7-kilo-ohm Port-C pins PC0 and
R3 - 100-ohm PC1 are used to interface
R4 - 1-kilo-ohm
R6 - 68-ohm switches S4 and S5 for
VR1 - 10-kilo-ohm preset decrementing and
Capacitors: incrementing the tem-
C1 - 1000µF, 25V electrolytic
C2 - 0.1µF ceramic disk perature setting as per the
C3, C4 - 22pF ceramic disk room temperature.
C5 - 1µF, 16V electrolytic Port-B pin PB0 is used
Miscellaneous:
X1 - 230V AC primary to 9V,
to control the relay with
500mA secondary the help of transistor T1.
transformer The room heater coil
XTAL - 4MHz crystal
S1, S2 - On/off switch Fig. 2: Actual-size, single-side PCB for the temperature indicator- is connected to contacts of
S3-S5 - Push-to-on switch cum-controller relay RL1. LED2 is con-
Relay - 6V, 1C/O relay
BATT. - 1.2Vx4 rechargeable nected in parallel with the
battery relay to indicate the
L1 - Room heater coil
power-‘on’ status of the
relay and the heater. D6
of in-system programmable flash acts as a free-wheeling di-
memory (i.e., read-while-write ode. A 4MHz crystal, con-
capabilities), 512-byte EEPROM, 512- nected between pins 12
byte SRAM, 32 general-purpose input/ and 13 of the
output (I/O) lines, 32 general-purpose microcontroller, provides
working registers, three flexible timers/ the basic clock frequency
counters with compare modes, internal for the microcontroller.
and external interrupts, a serially Switch S3 is used for
programmable USART, a byte-oriented manual reset.
two-wire serial interface, an 8-channel, The temperature mea-
10-bit analogue-to-digital converter sured using LM35 is com-
(ADC) with optional differential input pared with the reference
stage with programmable gain, a value. If the measured
programmable watchdog timer with temperature is higher
internal oscillator, an SPI serial port, than the reference value
and six software-selectable power- by 1ºC, the heater is
saving modes. switched off, and if the
The AVR core combines a rich in- measured temperature is
struction set with 32 general-purpose Fig. 3: Component layout for the PCB lower than the reference
working registers. All 32 registers are value by 1ºC, the heater
directly connected to the arithmetic interface the temperature sensor, is switched on.
logic unit (ALU), allowing two inde- which converts signals into digital Whenever the temperature of the
pendent registers to be accessed in one equivalent. Capacitor C5 protects the environment is lower than the refer-
single instruction executed in one clock ADC input from voltage fluctuations ence temperature by 1ºC, pin PB0 goes
cycle. The resulting architecture is and resistor R6 is used as the current high. Because of this, transistor T1 goes
more code-efficient while achieving limiter. into saturation and the relay energises.
throughputs up to ten times faster than Port D is used to interface the LCD The heater connected with AC mains
the conventional complex instruction module, which displays the set refer- by the normally-open (N/O) contacts
set computer (CISC) microcontroller. ence temperature value and the of the relay increases the temperature
Port-A pin PA0 of the present temperature. Port-D pins PD0 of surroundings. Similarly, when the
microcontroller is used as the ADC to through PD2 are connected to pins 4 temperature of surroundings is higher

86 • JANUARY 2008 • ELECTRONICS FOR YOU WWW.EFYMAG.COM


CONSTRUCTION
than the reference temperature by 1ºC, C compiler. The source program is con- The lcd_clear( ) function clears the
pin PB0 goes low, transistor T1 cuts verted into hex code by compiler. Burn LCD and sets the displaying character
off, the relay de-energises and heater this hex code into Atmega8535 AVR position at row ‘0’ and column ‘0.’
is disconnected from mains. This re- microcontroller. The source program is The lcd_gotoxy(0, 0) function sets
sults in lowering of the temperature well commented and easy to under- the current display position at column
to reference value. The circuit in this stand. ‘0’ and row ‘0.’
manner works as a temperature indi- First, declare that the The delay_ms(50) function gener-
cator-cum-controller. microcontroller’s port D is used for ates a delay of 50 milliseconds.
An actual-size, single-side PCB communication with the LCD module The loop works to get temperature,
for the microcontroller-based tempera- and then include the header files like read temperature, convert it into Cel-
ture indicator-cum-controller is mega8535.h, lcd.h, delay.h and stdio.h. sius and then display on the LCD mod-
shown in Fig. 2 and its component Thereafter, define the justified external ule.
layout in Fig. 3. reference voltage and then the subrou- EFY-note. The source code of this
tine for the microcontroller to read the article is available at http://
Software digital equivalent input. www.electronicsforu.com/efycodes/
The software is written in ‘C’ language The lcd_init(16) function initialises efy-codes.zip and will also be included
and compiled using CodeVision AVR the 16-x2-line LCD. in EFY-CD of February 2008 issue.

TEMP.C
#asm unsigned int temp, temp_set=20; sprintf(buf,"Temper :%i Deg ",temp);
.equ __lcd_port=0x12 ;PORTD char buf[20]; lcd_puts(buf);
#endasm PORTB=0x00; key=PINC;
DDRB=0xFF; if(key==254)
#include <mega8535.h> PORTB=0xFF; {
#include <lcd.h> // ADC initialization temp_set=temp_set-1;
#include <delay.h> // ADC Clock frequency: 1000.000 kHz if(temp_set<5) temp_set=5;
#include <stdio.h> // ADC Voltage Reference: AREF pin }
// ADC High Speed Mode: Off else if(key==253)
#define ADC_VREF_TYPE 0x00 // ADC Auto Trigger Source: None {
ADMUX=ADC_VREF_TYPE; temp_set=temp_set+1;
// Read the AD conversion result ADCSRA=0x83; if(temp_set>40)
unsigned int read_adc(unsigned char adc_input) SFIOR&=0xEF; temp_set=40;
{ }
ADMUX=adc_input|ADC_VREF_TYPE; lcd_init(16); if (temp<temp_set-1)
// Start the AD conversion lcd_clear(); {
ADCSRA|=0x40; delay_ms(50); PORTB.0=1;
// Wait for the AD conversion to complete }
while ((ADCSRA & 0x10)==0); while (1) else if(temp>temp_set+1)
ADCSRA|=0x10; { { PORTB.0=0;
return ADCW; temp =read_adc(0); }
} temp = temp*48/100; delay_ms(20);
lcd_gotoxy(0,0); };
void main(void) sprintf(buf,"Set val:%i Deg ",temp_set); }
{ lcd_puts(buf); 
unsigned char key; lcd_gotoxy(0,1);

Please add 4% VAT for local sale in Delhi or 4% CST for orders
BUILD YOUR OWN from outside Delhi Forwarding charges Rs 40 per kit

ELECTRONIC KITS
 Microcontroller-Based Industrial Timer (June 2007)—Rs 1400/-
 Microcontroller-Based Real Time Clock with Remote (April 2007) Rs 1500/-
 Microcontroller-Based Water Level Controller-cum-Motor Protector (Feb. 2007)—
Rs 1350/-
 Remote Control Land Rover Robotics (June 2006)—Rs 3000/-
 Low-Cost Energy Meter (May 2005)—Rs 1000/-
Please send your remittance by
DD/MO (not cheque) to: Kits‘n’Spares
D-88/5, Okhla Industrial Area, Phase-1, New Delhi 110020
Phone: 26371661, 26371662, 32975879; E-mail: kits@efyindia.com

88 • JANUARY 2008 • ELECTRONICS FOR YOU WWW.EFYMAG.COM


circuit
ideas

Tester For Remote Control s.c. dwiv


edi

 T.A. Babu mately five metres. The integrated IR


receiver detects, amplifies and de- nal from the

H
ere is a simple tester for check- modulates IR signals from the remote remote (such
ing the basic operations of an control unit. The piezobuzzer con- as TV remote
infrared remote control unit. nected at its output sounds to indicate control unit).
It is low-cost and easy to construct. the presence of signal from the remote P o w e r
The tester is built around infrared control unit. supply for
receiver module TSOP1738. Operation As shown in Fig. 1, output pin 3 of the circuit is
of the remote control is acknowledged IR receiver module TSOP1738 (IRX1) Fig. 2: Pin configuration of
derived from
by a tone from the buzzer. The circuit normally remains high and the pi- TL431 and TSOP 1738 the mains us-
is sensitive and has a range of approxi- ezobuzzer is in silent mode. When the ing a capaci-
IR module tive potential dropper, a half-wave rec-
IRX1 re- tifier, a shunt regulator and associated
ceives an components. Make sure that capacitor
infrared C1 is of X2 type. Use a suitably small
signal, its enclosure to make the unit handy.
output goes Assemble the circuit on a general-
low and, as purpose PCB and enclose in a cabinet.
a result, the Make sure that the IR receiver module
piezobuzz- is placed on the front panel of the cabi-
er sounds net so that it can receive the IR signals
to indicate easily. Before soldering/connecting the
the recep- shunt regulator and IR module, refer
Fig. 1: Circuit diagram of remote tester tion of sig- Fig. 2 for the pin configuration. 

9 6 • F e b r ua ry 2 0 0 8 • e l e c t ro n i c s f o r yo u w w w. e f y m ag . co m
Construction

Microcontroller-based
Ultrasonic Distance Meter
 K. Padmanabhan and receiver), current buffer ULN2003,
operational amplifier LM324, inverter

T
mar
here are several ways to meas- CD4049, four 7-segment displays, five sunil ku
ure distance without contact. transistors and some discreet com-
One way is to use ultrasonic ponents. The ultrasonic transmitter-
waves at 40 kHz for distance measure- receiver pair is shown in Fig. 1. higher pulse excitation voltage or a
ment. Ultrasonic transducers measure Ultrasonic generators use piezo- better transducer.
the amount of time taken for a pulse of electric materials such as zinc or lead Here the microcontroller is used to
sound to travel to a particular surface zirconium tartrates or quartz crystal. generate 40kHz sound pulses. It reads
and return as the reflected echo. The material thickness decides the when the echo arrives; it finds the time
This circuit calculates the distance resonant frequency when mounted taken in microseconds for to-and-fro
based on the speed of sound at 25°C and excited by electrodes attached on travel of sound waves. Using velocity
ambient temperature and shows it either side of it. The medical scanners of 333 m/s, it does the calculations and
on a 7-segment display. Using it, used for abdomen or heart ultrasound
you can measure distance up to 2.5 are designed at 2.5 MHz. In this cir- Parts List
metres. cuit, a 40kHz transducer is used for
Semiconductors:
For this particular application, the measurement in the air medium. The IC1 - AT89C2051
required components are AT89C2051 velocity of sound in the air is around microcontroller
IC2 - ULN2003 current buffer
microcontroller, two 40kHz ultrasonic 330 m/s at 0°C and varies with tem- IC3 - CD4049 hex inverting
transducers (one each for transmitter perature. buffer
IC4 - LM324 quad operational
In this project, you excite the ul- amplifier
trasonic transmitter unit with a 40kHz IC5 - 7815, 15V regulator
pulse burst and expect an echo from IC6 - 7915, -15V regulator
IC7 - 7805, 5V regulator
the object whose distance you want to T1-T4 - BC557 pnp transistor
measure. Fig. 2 shows the transmitted T5 - 2N2222 npn transistor
D1, D2 - 1N4148 switching diode
burst, which lasts for a period of ap- D3-D6 - 1N4007 rectifier diode
proximately 0.5 ms. It travels to the DIS1-DIS4 - LTS 542 common-anode,
7-segment display
object in the air and the echo signal
Resistors (all ¼-watt, ±5% carbon):
is picked up by another ultrasonic R1, R2 - 2-mega-ohm
Fig. 1: Ultrasonic transmitter and receiver pair transducer unit (receiver), also a 40 R3 - 82-kilo-ohm
R4, R7-R10 - 10-kilo-ohm
kHz pre-tuned unit. The re- R5 - 33-kilo-ohm
ceived signal, which is very R6 - 100-kilo-ohm
weak, is amplified several R11 - 1-kilo-ohm
R12-R15 - 1.2-kilo-ohm
times in the receiver circuit R16 - 220-ohm
and appears somewhat as RNW1 - 10-kilo-ohm resistor
network
shown in Fig. 2 when seen VR1 - 1-kilo-ohm preset
on a CRO. Capacitors:
Weak echoes also occur C1, C2 - 3.3nF ceramic disk
C7, C10-C12 - 0.1µF ceramic disk
due to the signals being C3 - 2.2nF ceramic disk
directly received through C4 - 10µF, 16V electrolytic
C5, C6 - 22pF ceramic disk
the side lobes. These are C8, C9 - 1000µF, 50V electrolytic
ignored as the real echo Miscellaneous:
received alone would give X1 - 230V AC primary to
15V-0-15V, 500mA
the correct distance. That secondary transformer
is why we should have a XTAL - 12MHz crystal
level control. Of course, S1 - Push-to-on switch
S2 - On/off switch
the signal gets weaker if TX1 - 40kHz ultrasonic
the target is farther than transmitter
RX1 - 40kHz ultrasonic receiver
Fig. 2: The ultrasonic pulse, echo signal and time measurement 2.5 metres and will need a

6 8 • F e b r ua ry 2 0 0 8 • e l e c t ro n i c s f o r yo u w w w. e f y m ag . co m
Construction
shows on the four
7-segment dis-
plays the distance
in centimetres and
millimetres (three
digits for centime-
tres and one for
millimetres).

Circuit
description Fig. 4: Two dimensional beam pattern of
ultrasonic signal showing main lobe and side
Fig. 3 shows the lobe energy levels
circuit of the mi-
crocontroller-based up pulse transformer, which steps-up
distance meter. The the transmitter output to 60V (peak-
40kHz pulse bursts to-peak).
from the microcon- The echo signal received by the
troller are ampli- receiver sensor after reflection is very
fied by transistor weak. It is amplified by quad opera-
T5. Inverting buff- tional amplifier LM324. The first stage
er CD4049 drives (A1) is a buffer with unity gain. The
the ultrasonic sen- received signal is directly fed to the
sor used as the non-inverting input (pin 3) of A1 and
transmitter. Three coupled to the second stage by a 3.3nF
inverters (N1, N2 (small-value) capacitor. If you use
and N3) are con- the ubiquitous 0.01µF capacitor for
nected in paral- coupling, there will be enormous hum
lel to increase the at the output. The second stage of the
transmited power. inverting amplifier uses a 2-mega-ohm
This inverted out- resistor for feedback. The third stage
put is fed to an- is a precision rectifier amplifier with a
other set of three gain of 10.
inverters (N4, N5 The rectifier functions, unlike a
and N6). Outputs simple diode, even for signal voltage
of both sets of par- of less than 0.6V. The output is filtered
allel inverters are to accept 40kHz frequencies and fed to
applied as a push- pin 12 of microcontroller AT89C2051,
pull drive to the which is an analogue comparator. Pin
ultrasonic trans- 13 is the other pin of the comparator
mitter. used for level adjustment using preset
The positive- VR1.
going pulse is ap- The ultrasonic transducer outputs
plied to one of the a beam of sound waves, which has
terminals of the more energy on the main lobe and less
ultrasonic sensor energy (60 dB below the main lobe) on
and the same pulse the side lobes as shown in Fig. 4. Even
after 180-degree this low side-lobe signal is directly
phase shift is ap- picked up by the receiver unit. So
plied to another you have to space the transmitter and
terminal. Thus the receiver units about 5 cm apart. The
transmitter power two units are fixed by cellotape onto a
is increased for in- cardboard, with the analogue circuit
creasing the range. at one end.
If you want to Microcontroller AT89C2051 is at
increase the range the heart of the circuit. Port-1 pins P1.7
up to 5 metres, use through P1.2, and port-3 pin P3.7 are
Fig. 3: Microcontroller based distance meter circuit a ferrite-core step- connected to input pins 1 through 7 of

7 0 • F e b r ua ry 2 0 0 8 • e l e c t ro n i c s f o r yo u w w w. e f y m ag . co m
Construction
Using switch S1 you
can manually reset
the microcontroller,
while the power-
on reset signal for
the microcontrol-
ler is derived from
the combination of
capacitor C4 and re-
sistor R8. A 12MHz
crystal is used to
generate the basic
clock frequency for
the microcontroller.
Resistor R16 con-
nected to pin 5 of
Fig. 5: Power supply circuit for distance meter
DIS2 enables the
decimal point.
The comparator is inbuilt in micro-
controller AT89C2051. The echo signal
will make port-3 pin 3.6 low when it
goes above the level of voltage set on
pin 13. This status is sensed by the mi-
crocontroller as programmed.
When port-3 pin P3.6 goes high, we
know that the echo signal has arrived;
the timer is read and the 16-bit number
is divided by twice the velocity of
sound and then converted into decimal
format as a 4-digit number.
Power supply. Fig. 5 shows the
circuit of the power supply. The 230V
AC mains is stepped down by trans-
former X1 to deliver the secondary
output of 15V-0-15V, 500 mA. The
transformer output is rectified by a
full-wave bridge rectifier comprising
diodes D3 through D6, filtered by
capacitors C8 and C9 and then regu-
lated by ICs 7815 (IC5), 7915 (IC6)
and 7805 (IC7). Regulators 7815, 7915
Fig. 6: Actual-size, single-side PCB for the microcontroller-based ultrasonic distance meter and 7805 provide +15V, -15V and
+5V regulated supply, respectively.
IC2 (IC ULN2003), respectively. These display DIS1. Similarly, transistors T2 Capacitors C10 through C12 bypass
pins are pulled up with a 10-kilo-ohm through T4 provide anode currents to the ripples present in the regulated
resistor network RNW1. They drive all the other three 7-segment displays. power supply.
the segments of the 7-segment display Microcontroller IC1 provides the
with the help of inverting buffer IC2. segment data and display-enable sig- Construction and testing
Port-3 pins P3.0 through P3.3 of nal simultaneously in time-division An actual-size, single-side PCB for the
the microcontroller are connected multiplexed mode for displaying a microcontroller-based distance meter
to the base of transistors T1 through particular number on the 7-segment is shown in Fig. 6 and its component
T4 to provide the supply to displays display unit. layout in Fig. 7.
DIS1 through DIS4, respectively. Pin Segment data and display-enable Assemble the PCB and put the
P3.0 of microcontroller IC1 goes low pulse for the display are refreshed eve- programmed microcontroller into the
to drive transistor T1 into saturation, ry 5 ms. Thus the display appears to be socket. After switching on the power
which provides supply to the com- continuous, even though the individual supply and microcontroller automati-
mon-anode pin (either pin 3 or 8) of LEDs used in it light up one by one. cally getting reset upon power-’on,’

7 2 • F e b r ua ry 2 0 0 8 • e l e c t ro n i c s f o r yo u w w w. e f y m ag . co m
Construction
the level of reference voltage set on pin
13, it will make P3.6 low; the arrival of
echo is sensed by the program using
jnb p3.6 (jump not bit) instruction.

Software
The software is written in Assembly
language and assembled using 8051
cross-assembler. It is well commented
and easy to understand.
The pulse train for 0.5 ms is started
by making pin 8 high and low alter-
nately for 12.5 microseconds so that the
pulse frequency is 40 kHz. After 25 such
pulses have passed, a waiting time is
given to avoid direct echoes for about
20 µs. Then the signal is awaited, while
the timer runs counting time in micro-
seconds. When the echo arrives, port-3
pin P3.6 goes high, the timer reads and
the 16-bit number is divided by twice
the velocity and converted into decimal
format as a 4-digit number.
If the echo does not arrive even
Fig. 7: Component layout for the PCB after 48 milliseconds, the waiting loop
is broken and the pulse train sequence
pin 8 will pulse at 40kHz bursts. This observe the echo signal. It will appear is started once again. If the echo comes
can be seen using an oscilloscope. as shown in Fig. 2. within this time, it is displayed for half
Give this signal to channel 1 of the The two transducers can be fixed a second before proceeding to another
oscilloscope. Adjust the time base to to a thick cardboard with two wires measurement. Thus, the display ap-
2 ms per division and set it to trigger leading to the circuit—two 40cm long pears continuous and flicker-free.
mode instead of normal mode. Adjust shielded cables will do. The laser
the potmeter on the oscilloscope la- pointer is fixed such that it is axial Other uses
beled ‘level’ such that the trace starts to the transducers. Channel 2 is con- Simply by changing this program, the
with the burst and appears steady as nected to pin 12, which is the positive same unit can be made to detect mov-
shown in Fig. 2. non-inverting terminal of AT89C2051’s ing objects (such as cars racing on the
Connect the transmitter and re- comparator. The negative inverting ter- street) and find their range and speed.
ceiver ultrasonic units either by a minal (pin 13) is connected to a preset It can also be used with suitable addi-
twisted pair of wire or by a shielded reference. Adjust the preset such that tional software as a burglar alarm unit
cable to the board. Give the received the voltage is 0.1V-0.2V at pin 13. This for homes or offices.
signal to channel 2 of the oscilloscope. will enable detection of weak echoes EFY note. All the relevant files of
Then, place an A4-size plastic sheet in also. this project are included in this month’s
front of the ultrasonic transducers and When the echo signal goes above EFY-CD.

ultrsnd.asm
Program listing: MOV TMOD,#01100001B ;TIMER 1 - MODE 2 ; SO WE STOP FOR THIS AMOUNT OF TIME
COUNTER,TIMR-0 TO MODE 1 and expect an echo.
$mod51 BEG: MOV TH0,#0H ;TIMER REG.0 IS SET TO mov r2,#25 ; 25 pulses 26 us =.53 ms
ORG 0H 0, GIVES 64ms (343m/s*.5ms=17cm)
AJMP 30H MOV TL0,#0 ; timer low reg. is also so
ORG 0BH ;TIMER 0 INTERRUPT VECTOR ;TOTAL CYCLE TIME IS 64.6ms ,350m/s pulse: setb p3.4 ;generates 40KHz
; AJMP TIMER0ISR ;Timer 0 Interrupt gives 0.35mx65=22.5m mov r1,#5
service routine address ; up and down 10 metres say! .35 m/ms,
ORG 30H .35 mm/us, 1mm per 3 micros djnz r1,$
MOV SP,#60H ;set stack pointer ; up and down .35/2 mm/us = 1/6 mm/us clr p3.4
MOV P3,#0FFH ;set all port 3 bits high mov r1,#5
to enable inputs also ; VELOCITY OF SOUND IN AIR IS 350 M/S djnz r1,$ ;wait for 13 us
MOV P1,#03 ;set port 1 to all zeros ; AFTER 100 TIMES, WE HAVE TO STOP djnz r2, pulse ;20pulses
expect bits 0,1 TRANSMITTING FOR A TIME OF ABOUT .1 S setb tr0 ;start timer

w w w. e f y m ag . co m e l e c t ro n i c s f o r yo u • F e b r ua ry 2 0 0 8 • 7 3
Construction
mov r2,#10 mov r0,a MOV 1BH,R6 ; most significant digit
djnz r2,$ ;wait 20 us mov a,r7 ;get rem. saved before the (max:9999)
check_echo: mov r3,a ;last subtraction.
jnb p3.6,checktimeout mov a,r6 refresh1: MOV R0,#1bh ; 1b,1a,19,18,
MOV 40h,TL0 ; read timer count mov r2,a holds values for 4 digits
MOV 41h,TH0 ret MOV R4,#8 ; pin p3.3_ 0 made low one by
mov r0,40h one starts wth 18
mov r1,41h ;16 Bit Hex to BCD Conversion for 8051 mov r7,#2 ; decimal pt.on 3rd digit
mov r3,#0 Microcontroller from left (2 nd fromright)
mov r2,#6 ; This routine is for 16 bit Hex to BCD PQ2: CALL SEGDISP
call UDIV16 ;divide by 6 conversion; deC R0
mov 40h,r0 ;Accepts a 16 bit binary number in mov a,r4
mov 41h,r1 R1,R2 and returns 5 digit BCD in rrc a
mov 50h,#25 ;R7,R6,R5,R4,R3(upto 64K ) mov r4,a
disp: call disp1 ; show the value on Hex2BCD: ;r1=high byte ;r7 most sig- jnc pQ2
LED nificant digit PV3:
djnz 50h,disp ; so many times for a ;R2 = LSByte RET
visible time limit MOV R3,#00D
MOV R4,#00D SEGDISP:
jmp beg MOV R5,#00D mov dptr,#ledcode
MOV R6,#00D MOV A,@R0
checktimeout: mov a,th0 MOV R7,#00D ANL A,#0FH
cjne a,#0c0h,check_echo ;upto 4 metres MOV B,#10D MOVC A,@A+dptr
jmp beg MOV A,R2
;subroutine UDIV16 DIV AB segcode:
;16 bit/16bit unsigned divide MOV R3,B ; MOV R5,A
;input r1,r0 =dividend X MOV B,#10 ; R7,R6,R5,R4,R3 ORL A,#03H ; WE WANT TO USE PORT 1 BITS
;input r3,r2 =divisor Y DIV AB 0 AND 1 FOR INPUT ANLOG
;output r1,r0 =quottient q of x/y MOV R4,B ; so retain them high
;output r3,r2 = remainder MOV R5,A S3: MOV P1,A ; SEGMENT_PORT
; alters acc,r4-47,flags,dptr CJNE R1,#0H,HIGH_BYTE ; CHECK FOR HIGH
UDIV16: mov r7,#0 ;clear partial re- BYTE MOV A,R5 ;we use p3.7 for the segment
mainder SJMP ENDD ‘a’ of display
mov r6,#0 ; HIGH_BYTE: MOV A,#6 RRC A ;so get that bit D0into carry
mov B,#16 ;set loop count ADD A,R3 ; cpl c
div_loop: clr C ;clear carry flag MOV B,#10 ; mov p3.5,c ; dec pt is D0 bit that is
mov a,r0 ; shift the highest bit of DIV AB wired to p3.5
dividend into MOV R3,B rrc a
rlc a ADD A,#5 mov p3.7,c ;segment ‘a;
mov r0,a ADD A,R4 S1: MOV A,R4 ; get digit code from r4
mov a,r1 MOV B,#10 00001000
rlc a DIV AB cpl a ;11110111
mov r1,a MOV R4,B rrc a ;11111011-1
mov a,r6 ;... the lowest bit of partial ADD A,#2
remainder ADD A,R5 mov p3.0,c ; output to drive transsi-
rlc a MOV B,#10 tors for digit lighting
mov r6,a DIV AB rrc a ;11111101-1
mov a,r7 MOV R5,B mov p3.1,c
rlc a CJNE R6,#00D,ADD_IT rrc a ;11111110-1
mov r7,a SJMP CONTINUE mov p3.2,c
mov a,r6 ADD_IT: ADD A,R6 rrc a ;1111111-0 yes low makes leftmost
clr C CONTINUE: MOV R6,A digit show msdigit
subb a,r2 DJNZ R1,HIGH_BYTE mov p3.3,c
mov dpl,a MOV B, #10D S5:
mov a,r7 MOV A,R6 S4: ACALL DELAY1 ; let it burn
subb a,r3 DIV AB for some time
mov dph,a MOV R6,B MOV A,#0ffH ; extinguish
cpl C MOV R7,A the digit after that time
jnc div_1 ;update partial reaminder ENDD: ret MOV P3,A ; to prevent shadow
if borrow s6: RET
mov r7,dph DISP1: ledcode:
mov r6,dpl ; update parital reminder REFRESH: ; content of 18 to 1B memory DB 7EH,0CH,0B6H,9EH,0CCH,0DAH,0FAH
div_1: mov a,r4 locations are output on LEDs DB 0EH,0FEH,0CEH,0EEH,0F8H,72H,0BCH,0
rlc a ; only numbers 0 to 9 and A to F are F6H,0E2H
mov r4,a valid data in these locations ;these are code for
mov a,r5 mov r1,41h the numbers 0 to 9 and A to F
rlc a mov r2,40h DELAY1: MOV R1,#0ffH
mov r5,a N: NOP
djnz B,div_loop CALL HEX2BCD
mov a,r5 MOV 18H,r3 ; least significant digit DJNZ R1,N
mov r1,a ; put qt. in r0,r1 MOV 19H,r4 ; next significant digit RET
mov a,r4 MOV 1AH,r5 END 

7 4 • F e b r ua ry 2 0 0 8 • e l e c t ro n i c s f o r yo u w w w. e f y m ag . co m
circuit
ideas

Versatile CMOS/TTL Logic


And Clock Probe s.c. dwiv
edi

 EFY Lab point of the logic circuit. goes low only when logic input at the
Supply for the probe circuit is probe tip exceeds the biasing voltage

F
or fault diagnosis of any logic taken from the circuit under test using and, as a result, the red LED lights up
circuit, you need a probe that can alligator clips. In the circuit, LM319 to indicate logic 1 state at the probe
test the logic level or existence of dual-comparator is connected as a tip.
clock activity. The circuit shown here window detector. The non-invert- Similarly, the inverting pin of
can be used to test CMOS and TTL ing pin of comparator N1 is biased comparator N2 is biased at nearly 0.8V
logic circuits for logic states and also to nearly 2V when switch S1 is in (in TTL position of switch S1) and 20
for the presence of clock activity from a TTL position and 80 per cent of Vcc per cent of Vcc (in CMOS position of
few hertz to more than 10 MHz, at any in CMOS position. The output of N1 switch S1). Only when the input volt-

age at probe tip is less than the biasing


Test Results
voltage, will its output drop low to
Test Specified Observed Red Green Yellow Buzzer
light up the green LED to indicate logic
conditions level level LED LED LED sound
0 state.
TTL (5V) The probe tip is also connected to
Low <0.8V <0.8V Off On Off Off the input of CD4049 (N3) via capacitor
High >2V ≥2.1V On Off Off Off C1 to pass AC/clock signals. It simply
Clock TTL 1 Hz to 10 MHz Off Momentarily On for On for acts as a buffer and couples only the
compatible or even more on/off 3 seconds 3 seconds high-to-low going signals at the in-
CMOS (12V) put/output of the gate to the input of
Low <2.5V ≤2.35V Off On Off Off next gate N4.
High >9.5V >9.5V On Off Off Off The output of gate N4 is further
Clock CMOS 1 Hz to 10 MHz Off Momentarily ‘On’ for ‘On’ for coupled to gate N5, which is wired as a
compatible or even more on/off 3 seconds 3 seconds monostable. A positive feedback from

9 2 • F e b r ua ry 2 0 0 8 • e l e c t ro n i c s f o r yo u w w w. e f y m ag . co m
circuit
ideas
the output of gate N5 to the input of Gate N6 is used for driving a yel- and N8. It briefly activates the buzzer
gate N4 ensures that unless capacitor low LED (indicating oscillatory input to beep during mono period, indicat-
C4 (0.47µF) discharges sufficiently via at probe tip), which will be switched ing oscillatory input at the probe tip.
4.7-mega-ohm resistor, further clock on for a brief period. The output of Thus we have audio-visual indication
pulses at the input of N4 will have no gate N6 is further used to inhibit/en- during clock/oscillatory input at the
effect. able the oscillator formed by gates N7 probe tip. 

w w w. e f y m ag . co m e l e c t ro n i c s f o r yo u • F e b r ua ry 2 0 0 8 • 9 3
circuit
ideas

Drinking Water Alarm s.c. dwiv


edi

 Dr C.H. Vithalani

T
he State Jal Boards supply
water for limited duration in a
day. Time of water supply is
decided by the management and the
public does not know the same. In such
a situation, this water alarm circuit will
save the people from long wait as it
will inform them as soon as the water
supply starts.
At the heart of this circuit is a
small water sensor. For fabricating
this water sensor, you need two
foils—an aluminium foil and a plastic
foil. You can assemble the sensor by
rolling aluminium and plastic foils
in the shape of a concentric cylinder.
Connect one end of the insulated
flexible wire on the aluminium foil
and the other end to resistor R2. Now work only when water flows through from the tap. The circuit works off a 9V
mount this sensor inside the water the water tap and completes the cir- battery supply.
tap such that water can flow through cuit connection. It oscillates at about Assemble the circuit on any gen-
it uninterrupted. To complete the 1 kHz. The output of the timer at pin eral-purpose PCB and house in a
circuit, connect another wire from 3 is connected to loudspeaker LS1 via suitable cabinet. The water sensor is
the junction of pins 2 and 6 of IC1 to capacitor C3. As soon as water starts inserted into the water tap. Connect
the water pipeline or the water tap flowing through the tap, the speaker the lead coming out from the junc-
itself. starts sounding, which indicates re- tion of 555 pins 2 and 6 to the body of
The working of the circuit is sim- sumption of water supply. It remains the water tap. Use on/off switch S1
ple. Timer 555 is wired as an astable ‘on’ until you switch off the circuit to power the circuit with the 9V PP3
multivibrator. The multivibrator will with switch S1 or remove the sensor battery. 

w w w. e f y m ag . co m e l e c t ro n i c s f o r yo u • m a r c h 2 0 0 8 • 1 0 5
circuit
ideas

GLOW PLUG CONTROLLER s.c. dwiv


edi

 T.A. Babu charges capacitor C1 rapidly via resis-


tor R1. When the voltage on capacitor

I
n diesel engines, the air in the C1 exceeds the threshold voltage of the glow plug gets the power supply
cylinders is not hot enough to the gate (G) of MOSFET T1, it starts through its contact.
ignite the fuel under cold condi- charging reservoir capacitor C2 and The red LED (LED1) indicates that
tions. Therefore each cylinder of these simultaneously energises relay RL1. the heating process of glow plugs is

Fig. 2: Pin configurations of bs170


and bc548

‘on.’ When the ‘on’ time is over,


the green LED (LED2) turns on
for a while, followed by a short
beep from the buzzer, which in-
dicates that the engine is ready
Fig. 1: Glow plug controller
for starting. Glow plugs draw a
heavy current, hence high-cur-
engines is fitted with an electric heater MOSFET T1 remains conducting as rent-rating contacts of an automotive
known as ‘glow plug.’ A control circuit long as the voltage on C1 is greater relay are required.
is necessary to optimise the functioning than the threshold voltage of the MOS- Assemble the circuit on any gen-
of glow plugs. It raises the air tem- FET gate. eral-purpose PCB and house in a
perature inside the engine cylinder for The ‘on’ time period depends on suitable case. Connect the glow plug
quick and reliable starting, extended the value of capacitor C1 and resistor wire to the relay contact. 12V battery
battery life and reduced diesel con- R2, which govern the discharge current already available with the vehicle is
sumption. of capacitor C2. The component values used to power the circuit. Connect
The glow plug controller (Fig. 1) given here will produce ‘on’ time of the piezobuzzer and LED1 and LED2
uses a simple timer circuit built around around 25 seconds. In effect, when you through an external connection and
MOSFET T1 for reliability and simplic- press switch S2 momentarily, the relay place it at a convenient location for the
ity. Momentary pushing of switch S2 energises for about 25 seconds and driver to operate. 

1 0 4 • m a r c h 2 0 0 8 • e l e c t ro n i c s f o r yo u w w w. e f y m ag . co m
Construction

Microcontroller-Based
Capacitance Meter
 Prof. K. Padmanabhan automatically measures the capaci-
mar
tance and shows it on the 7-segment sunil ku

M
ost multimeters can measure displays directly.
the resistance value. Some
new types of digital mul- Working principle
timeters can measure capacitance as Fig. 1 shows the capacitor charging then:
well, but these are expensive. At the circuit and Fig. 2 shows the exponen- exp(-t/CR)=0.63,
same time, small capacitors made of tial rise of voltage across capacitor which gives
ceramic material exhibit wide vari- on charging. A CMOS FET switch t/CR = 1
ations in their value and one has to IC CD4066 is used to switch the volt- So with 10 kilo-ohms for R, you
measure their value before these are age for charging the unknown capaci- get C as t/10000 Farads. If ‘t’ is in
put to use in the circuit. Also, capaci- tor C through resistor R. As the volt- microseconds, you will get C as time
tors should be chosen properly for use age rises exponentially and crosses the in microseconds × 100 as the value of
in the power supply, timer and cou- threshold voltage (set at one pin of the C in pF. Thus you get a resolution of
pling circuits. comparator), the output of the compa- 100 pF per microsecond. For 100k, it
There arises the need for a ca- rator transits from ‘low’ to ‘high’ state. will become 10 pF.
pacitance meter that can measure At any time ‘t’ (in seconds), voltage A discharge switch across the ca-
the capacitance values and display Vc across capacitor C (farads), which pacitor is also required so that the ca-
them in µF and nF automatically. is charging exponentially through pacitor is discharged prior to charging
Here we describe such a microcon- resistor R (ohms) after application of of the capacitor through resistor R.
troller-based capacitance meter that voltage Vcc, is given by the following
relationship: Circuit description
Vc= Vcc{(1–exp(–t/CR)} Fig. 3 shows the power supply circuit.
On substituting Vcc = 5V, you get: 230V AC mains is stepped down by
Vc= 5–5exp(–t/CR) transformer X1 to deliver the secondary
But the threshold voltage of the output of 9V, 500 mA. The transformer
comparator pin is set to half of the sup- output is rectified by a full-wave bridge
ply voltage, so: rectifier comprising diodes D1 through
exp(-t/CR) = 2.5/5 = 0.5 D4, filtered by capacitor C4 and then
t/CR = 0.6931 regulated by IC 7805 (IC6). Capacitor
CR = 1.442t C5 bypasses any ripple present in the
If R is 10 kilo-ohms, regulated power supply. Light-emit-
C = 0.1442 × 10-3 × t ting diode LED1 acts as the power in-
If the threshold of the comparator dicator and resistor R14 limits current
Fig. 1: Basic principle of capacitance charging pin is set to 0.63 of supply voltage, through LED1.

Fig. 2: Charging takes an exponential rise Fig. 3: Power supply circuit

w w w. e f y m ag . co m e l e c t ro n i c s f o r yo u • a p r i l 2 0 0 8 • 5 9
Construction
Parts List
Semiconductors:
IC1 - AT89C2051
microcontroller
IC2 - ULN2803 current buffer
IC3 - 74LS138 3-to-8 decoder
IC4 - CD4066 analogue switch
IC5 - CD4069 NOT gate
IC6 - 7805 6V regulator
T1-T6 - BC557 pnp transistor
D1-D4 - 1N4007 rectifier diode
DIS1, DIS2 - LTS542 common-anode,
7-segment display
DIS3 - KLQ564 4-digit, common-
anode, 7-segment display
LED1 - 5mm LED
Resistors (all ¼-watt, ±5% carbon):
R1, R3 - 10-kilo-ohm
R2, R6 - 4.7-kilo-ohm
R4 - 1-kilo-ohm
R5 - 100-kilo-ohm
R7 - 8.2-kilo-ohm
R8-R13 - 1.2-kilo-ohm
R14 - 330-ohm
RNW1 - 10-kilo-ohm resistor
network
Capacitors:
C1 - 10µF, 25V electrolytic
C2, C3 - 22pF ceramic disk
C4 - 1000µF, 25V electrolytic
C5 - 0.1µF ceramic disk
Miscellaneous:
X1 - 230V AC primary to 9V,
500mA secondary
transformer
S1 - On/off switch
S2 - Push-to-on switch
XTAL - 11.0592MHz crystal
Fig. 4: Circuit of microcontroller-based capacitance meter

Fig. 5: Pin details of CD4066

At the heart of the capacitance


meter circuit (Fig. 4) is microcontroller
AT89C2051 (IC1). It is a 20-pin, 8-bit
microcontroller with 2 kB of Flash
programmable and erasable read-only
memory (PEROM), 128 bytes of RAM,
15 input/output (I/O) lines, two 16-bit
timers/counters, a five-vector two-
level interrupt architecture, a full-du-
plex serial port, a precision analogue
comparator, an on-chip oscillator and
clock circuitry.

6 2 • a p r i l 2 0 0 8 • e l e c t ro n i c s f o r yo u w w w. e f y m ag . co m
Construction
network RNW1 to drive the 7-seg-
ment displays with the help of invert-
ing buffer IC2. The display is selected
by 3-to-8 decoder IC 74LS138(IC3).
IC3 decodes one of the eight lines,
based upon the conditions at the
three binary inputs. These three in-
puts are provided by port pins P3.0
through P3.2 of the microcontroller
(IC1). Output pins 9 through 14 of IC3
are connected to the bases of transis-
tors T1 through T6, respectively. Pin
14 of IC3 goes low to drive transistor
T6 into saturation and provides sup-
ply to common-anode pin 12 of DIS3.
Similarly, transistors T5 through T1
drive common-anode pins 9, 8 and 6
of 7-segment display DIS3, and com-
mon-anode pins 3 and 8 of DIS2 and
DIS1, respectively.
IC2 provides segment data and
display-enable signals simultaneously
in time-division-multiplexed mode
for displaying a particular number on
the 7-segment display unit. Segment
Fig. 6: Actual-size, single-side PCB for the microcontroller-based capacitance meter data and display-enable pulses for the
display are refreshed every 5 ms. Thus
the display appears to be continuous,
even though the segments light up one
by one.
Switch S2 is used to manually reset
the microcontroller, while the power-
on reset signal for the microcontrol-
ler is derived from the combination
of capacitor C1 and resistor R1. An
11.0592MHz crystal is used to gener-
ate the basic clock frequency for the
microcontroller. Pin assignment of
CD4066 is shown in Fig. 5 for better
understanding of its internal switches.
The switches of CD4066 are used in
charging and discharging of the capaci-
tor under test (CUT) shown in Fig. 4.
One of the CMOS switches of CD4066
provides 5V supply to the charging
circuit.
Port pins P3.4 and P3.3 are used
for measurement control. Port pin
P3.4 shorts the CMOS switch, which is
used to discharge the capacitor prior
to charging through resistor R5. Port
pin P3.3 is used in case the capacitance
Fig. 7: Component layout for the PCB value is large and charging will take
longer than 999 ms. It switches another
Port-1 pins P1.7 through P1.2, input pins 1 through 8 of ULN2803 11-kilo-ohm charging resistor (R3+R4)
and port-3 pins P3.7 and P3.5 of the (IC2), respectively. These pins are parallel to the existing 100-kilo-ohm
AT89C2051 (IC1) are connected to pulled up with 10-kilo-ohm resistor resistor, the combination making the

6 4 • a p r i l 2 0 0 8 • e l e c t ro n i c s f o r yo u w w w. e f y m ag . co m
Construction
charging resistance value as 10 kilo- CD4066 and the crystal with care. cross-assembler. The generated hex
ohms. The range gets multiplied by Program AT89C2051 and put it into code is burnt into the microcontroller
‘10’ and the decimal point shifts auto- the IC base after soldering all other by a suitable programmer. The soft-
matically. components. Reset switch S2 is mo- ware is well commented and easy to
mentarily pressed for capacitance understand. Set pin P3.4 to discharge
Construction and testing measurement. Connect the capacitor the capacitor and clear pin P3.4 to
An actual-size, single-side PCB for under test. The capacitance value will short the CMOS switch. Clear port pin
the microcontroller-based capaci- be automatically displayed on six 7- P3.3 for making 11- and 100-kilo-ohm
tance meter is shown in Fig. 6 and its segment display units. resistors in parallel for automatic range
component layout in Fig. 7. Assemble selection.
the PCB with various components Software EFY lab note. The source code
along with bases for ICs. Wire the The software is written in Assembly of this project is included in this
reset (S2) switch to the panel. Handle language and assembled using 8051 month’s EFY-CD.

Cap.asm
$mod51 mov 1bh,a
ORG 0 HighC: clr p3.3 ; use this to switch CALL HEXTOBCD
AJMP 30H on a paralel R to charge C MOV 18H,r5
ORG 0BH mov 44h,#1 ; to add a dec. MOV 19H,R6 ;least significant
JMP TIM0ISR pt digit
ORG 30H clr tr0 ;stop timer ; leave away r4,r3
MOV TH0,#0D8H for microfarads display
BEG: MOV SP,#60H MOV TL0,#0F0H dw1: mov 49h,#0ffh
MOV P3,#0FFH jmp BEGINNING dis_wait1: CALL refresh1 ;DISPLAY for
SETB P1.0 st: setb tr0 ;start timer some time before doing another reading
SETB P1.1 ; TO ENABLE ANALOG jnb p3.6,$ call micro
COMPARATOR CALL f_h
MOV TMOD,#61H stopt: CLR TR0 ; STOP TIMER djnz 49h,dis_wait1
SETB F0 ; F0 bit is used clr p3.4 ; remove supply ajmp start
for Capacitance for charging C nano: ;displays fifth l.e.d. with the
jnb p3.3,capmeas ;read bit MOV 40H,TL0 ; read timer symbol ‘n’
sensing Cap count mov a,#0a8h ;10101000B
; HEREAFTER p3.3 is also MOV 41H,TH0 nanolike: jb F0,cap
available for use to switch a resistor mov a,40h ajmp L_display
capmeas: clr c cap:
start: MOV TH0,#0D8H subb a,#0f0h ; subtract ini- e1: mov r4,#5 ;on led no. 5
MOV TL0,#0F0H ; WE LOAD - tial counter value plus overhead 3 call segcode
10000 SO THAT WE CAN COUNT INSTEPS OF mov 40h,a ret
10000 mov a,41h L_display:
SETB ET0 ;ENABLE TIMER 0 IN- subb a,#0d8h mov a,#10000000b
TERRUPT mov 41h,a mov r4,#5
SETB EA ; GLOBAL ENABLE ;ten thousands get stored in call segcode
; pin 3.7 used for segment ‘a’ the timer service routine ret
; pin 3.5 for decimal point ;42h HOLDS TEN THOUSANDS, 41,40 micro: ; symbol for micro
; since pins 1.0 and 1.1 are used HOLD WITHIN TEN THOUSAND mov a,#0e4h ;11100100
as comparator ;both have 2nd place dec. pt., jb F0,nanolike
; pin 3.4 is used to control the we show nano by
switch for charging C ;’n’ and microfarad (when 42 is e11: ret
setb p3.3 zero) and by ‘u’ on the fifth LED! f_h: MOV A,#11100010B
mov 44h,#0 ; decimal point DIS: mov a,42h f_h1: MOV R4,#6 ;on digit 6
change flag for resistor change cjne a,#0,dis1 ; for display- CALL SEGCODE
BEGINNING:; BEGIN SHORT C ; WAIT ; ing /ufarad/mH RET
open ; apply voltage dis13: jb f0,capdp1
; COMPARE CHECK FOR PIN3.6 ind_DP1: mov 45h,#1 ; last digit has DISP1:
; READ TIMER VALUE d.p. REFRESH: ;content of 18 to 1B memory
; READ REGISTER VALUE FOR ajmp dr locations are output on LEDs
OVERFLOWS (THAT COUNTS DECIMALLY) capdp1: mov 45h,#3 ; for capaci- ;only numbers 0 to 9 and A to
; NOTE ACTUAL VALUE TO MOST tance, decimal pt. is at : xx.xx (3rd F are valid data in these locations
SIGNIFICANT FOUR PLACES digit from left) mov r1,41h
; AFTER HEX TO BCD CONVERSION dr: mov 49h,#0FFh ; 256 times mov r2,40h
; NOW PLACE DECIMAL POINT PO- the display is refreshed before another CALL HEXTOBCD
SITION CORRECTLY reading MOV 18H,r3 ; least signifi-
; CALL DISPLAY dis_wait: CALL DISP1 ;DISPLAY for some cant digit
; LOOP ON DISPLAY FOR 1 OR 2 time before doing another reading MOV 19H,r4 ; next significant
SECONDS call nano digit
; REPEAT FROM BEGINNING call f_h ;show “F” for MOV 1AH,r5
Mov 42h,#0 ; RAM address Farad MOV 1BH,R6 ; most significant
42 is used to count in 100,000 micro- djnz 49h,dis_wait digit (max:9999)
seconds AJMP start ; nF xx.xx, uF
mov 43h,#0 ; further larger xx xx xxx refresh1: MOV R0,#18h ; 1b,1a,19,18,
capacitor holds values for 4 digits
dis1: nop MOV R4,#4 ; pin p3.3_ 0 made
CAPC: clr P3.4 ; CMOS switch shorted capdp2: mov 45h,#4 ; we get d.p low one by one starts wth 18
for capacitance (USES INVERTER) at x.xxx/ xx.xx uF in capacitor MOV a,45h
CALL DELAY dr1: clr c
CALL DELAY noextradgt: mov a,42h ;ten thousands subb a,44h
setb P3.4 ; close switch are used here (/uF) mov r7,a ;dec point on sec-
to +5 V anl a,#0fh ond digit for C measurement
; 10 pF/100 pF(100K/10K) mov 1ah,a
forCap: SETB TR0 ; START TIMER 0 mov a,42h PQ2: CALL SEGDISP
Chk: JB P3.6,STOPT rrc a INC R0
KS: mov a,43h rrc a djnz r4, PQ2
cjne a,#0,HighC ; high C will rrc a PV3: RET
cause too much charge time rrc a
ajmp Chk anl a,#0fh SEGDISP:MOV A,@R0

w w w. e f y m ag . co m e l e c t ro n i c s f o r yo u • a p r i l 2 0 0 8 • 6 5
Construction
ANL A,#0FH ;16 Bit Hex to BCD Conversion for 8051 MOV A,R6
MOVC A,@A+dptr Microcontroller DIV AB
mov dptr,#ledcode ;This routine is for 16 bit Hex to BCD MOV R6,B
k: djnz r7,segcode conversion MOV R7,A
yesDP: orl a,#01 ; add a dec. pt. ;Accepts a 16 bit binary number in ENDD: ret
where it should be R1,R2 and returns 5 digit BCD in TIM0ISR: push psw
segcode: MOV R5,A ;R7,R6,R5,R4,R3(upto 64K ) push acc
ORL A,#03H ;WE WANT TO USE Hex2BCD: ;r1=high byte ;r7 most sig- MOV TH0,#0D8H
PORT 1 BITS 0 AND 1 FOR INPUT ANLOG nificant digit MOV TL0,#0F0H ; WE LOAD -
; so retain ;R2 = LSByte 10000 SO THAT WE CAN COUNT INSTEPS OF
them high mov r1,41h 10000
S3: MOV P1,A ;SEGMENT_PORT mov r2,40h MOV A,42H
S1: MOV A,R4 ;get digit code MOV R3,#00D ADD A,#1 ; JNZ R6,K1A ;r6 WAS
from r4 MOV R4,#00D FFH, SO 256 TIMES 4 ms GIVES 1 s
rrc a MOV R5,#00D DA A
mov p3.0,c ; output to 74138 MOV R6,#00D MOV 42H,A ; COUNTS IN 10000
pins ABC MOV R7,#00D s
rrc a MOV B,#10D jnc K1A
mov p3.1,c MOV A,R2 highdigit:mov a,43h
rrc a DIV AB add a,#1
mov p3.2,c ;but dont disturb MOV R3,B da a
pin 3.5,3.7 MOV B,#10 ; R7,R6,R5,R4,R3 mov 43h,a
MOV A,R5 ;we use p3.7 for the DIV AB K1A:pop acc
segment ‘a’ of display MOV R4,B pop psw
RRC A ;so get that bit MOV R5,A RETI ;INTERRUPT RE-
D0into carry CJNE R1,#0H,HIGH_BYTE ; CHECK TURN INSTRUCTION
mov p3.5,c ;dec pt is D0 bit FOR HIGH BYTE
that is wired to p3.5 SJMP ENDD DELAY: MOV R1,#255
rrc a HIGH_BYTE:MOV A,#6 del1: mov 50h,20
mov p3.7,c ;segment ‘a; ADD A,R3
S5: MOV B,#10 D1: NOP
S4: ACALL DELAY1 ; let it burn DIV AB djnz 50h,d1
for some time MOV R3,B DJNZ R1,del1
MOV A,#07H ;extinguish ADD A,#5 RET
the digit after that time ADD A,R4 ; we switch two resistors for capacitor
MOV P3,A ; to prevent shadow MOV B,#10 measurement, first a 100K and then
s6: RET DIV AB ; a 11K for larger capacitors. Forstill
ledcode: DB 7EH,0CH,0B6H,9EH,0CCH,0 MOV R4,B large C, a x10 switch is used, the read-
DAH,0FAH ADD A,#2 ing
DB 0EH,0FEH,0CEH,0EEH,0F8H,72 ADD A,R5 ;multiplied by 10!
H,0BCH,0F6H,0E2H MOV B,#10 ; for inductor we use only one resistor,
;these are code for DIV AB and we have a switch x10 which can
the numbers 0 to 9 and A to F MOV R5,B ; be used to measure smaller inductances
DELAY1: MOV R1,#0ffH CJNE R6,#00D,ADD_IT which do not show any reading
N: NOP SJMP CONTINUE
DJNZ R1,N ADD_IT: ADD A,R6 END
RET CONTINUE: MOV R6,A 
DJNZ R1,HIGH_BYTE
hextobcd: ; BYTE HEX TO 5 DIGITS BCD MOV B, #10D

6 6 • a p r i l 2 0 0 8 • e l e c t ro n i c s f o r yo u w w w. e f y m ag . co m
circuit
ideas
Smart Vibration Sensor s.c. dwiv
edi

 T.K. Hareendran going pulse output from the vibra-


tion sensing mechanism built around

I
n this vibration sensor alarm cir- piezo-ceramic wafer and associated speaker LS1.
cuit, initially, when power switch components. As a result, control input Reset switch S1 can be used to
S1 is flipped to ‘on’ position, power pins 2 and 6 of IC1 latch are grounded. switch off the alarm sound by resetting
indicator LED1 lights up immediately. Output pin 3 of IC1 now goes high. the latch circuit. For safety, use key-lock
IC LM555 (IC1), wired as a simple latch The positive supply from output pin 3 type switches for S1 and S2. A relay can
circuit with control input, is powered of IC1 is extended to three-tone siren also be connected at the output socket
and R-C components R4 and C5 con- generator UM3561 (IC2) through R5, (SOC1) of the circuit to energise high-
nected at its reset pin 4 force the latch D1 and R6. Components R6 and ZD1 power beacons, emergency sirens and
to standby mode (with inactive low stabilise the input power supply of IC2 fence electrification units.
output). The circuit is driven into sleep to around 3.3V. Output signals from The circuit works off 9V DC. A
mode. IC2 are amplified by Darlington-pair compact PP3-/6F22-type alkaline
As soon as vibration is detected, transistors T2 and T3 to produce alert battery can be used to power the
MOSFET T1 is fired by the positive- tone (police siren sound) via loud- circuit. 

8 8 • a p r i l 2 0 0 8 • e l e c t ro n i c s f o r yo u w w w. e f y m ag . co m
circuit
ideas
USB Power Booster s.c. dwiv
edi

 T.A. Babu power signal from the PC (+5V) is re-


ceived through socket A, LED1 glows,

T
he USB serial bus can be con- opto-diac IC1 conducts and TRIAC1 the rectified DC. Capacitor C3 at the
figured for connecting several is triggered, resulting in availability output of the regulator bypasses the
peripheral devices to a single of mains supply from the primary of ripples present in the rectified DC out-
PC. It is more complex than RS232, but transformer X1. Now transformer X1 put. LED1 indicates the status of the
faster and simpler for PC expansion. delivers 12V at its secondary, which is USB power booster circuit.
Since a PC can supply only a lim- rectified by a bridge rectifier compris- Assemble the circuit on a general-
ited power to the external devices con- ing diodes D1 through D4 and filtered purpose PCB and enclose in a suitable
nected through its USB port, when too by capacitor C2. cabinet. Bring out the +5V, ground
many devices are connected simultane- Regulator 7805 is used to stabilise and data points in the type-A socket.
ously, there is a possibility of power Connect the
shortage. Therefore an external power data cables
source has to be added to power the as assigned
external devices. in the cir-
In USB, two different types of con- cuit and the
nectors are used: type A and type B. USB power
The circuit presented here is an add- booster is
on unit, designed to add more power ready to
to a USB supply line (type-A). When Fig. 2: Pin configurations of moc3021, bt136 and 5v regulator 7805 function. 

Fig. 1: Circuit of the usb power booster

w w w. e f y m ag . co m e l e c t ro n i c s f o r yo u • a p r i l 2 0 0 8 • 8 7
circuit
ideas

Car Anti-theft Guard s.c. dwiv


edi

 T.K. Hareendran tor R1, which prevents transistor T1


from conducting. In this position, anti-

H
ere is an easy-to-build car theft guard cir-
anti-theft guard. The circuit, cuit is in sleep
shown in Fig. 1, is simple and mode.
easy to understand. When key-oper- W h e n
ated switch S2 of the car is turned on, someone opens
12V DC supply from the car battery is the car door,
extended to the entire circuit through switch S1 be-
polarity-guard diode D5. Blinking comes ‘off’ as
LED1 flashes to indicate that the guard shown in Fig.
circuit is enabled. It works off 12V 2. As a result,
power supply along with current-limit- transistor T1
ing resistor R4 in series. conducts to fire
When the car door is closed, door r e l a y - d r i v e r Fig. 2: Wiring diagram for door switch (S1)
switch S1 is in ‘on’ position and 12V SCR1 (BT169)
power supply is available across resis- after a short delay introduced by ca- pacitor C1. Electromagnetic relay RL1
energises and its N/O
contact connects the
power supply to pi-
ezobuzzer PZ1, which
starts sounding to in-
dicate that someone
is trying to steal your
car. To reset the circuit,
turn off switch S2 using
car key. This will cut-
off the power supply to
the circuit and stop the
buzzer sound.
Assemble the cir-
cuit on a general-pur-
pose PCB and house
in a small box. Con-
nect switch S1 to the
car door and keep pi-
ezobuzzer PZ1 at an
appropriate place in
Fig. 1: Circuit of car anti-theft guard the car. 

w w w. e f y m ag . co m e l e c t ro n i c s f o r yo u • M ay 2 0 0 8 • 7 5
circuit
ideas

Staircase Light With s.c. dwiv


edi

Auto Switch-Off
 Raj K. Gorkhali micro-switches—one located at the top of the micro-switches, you get a posi-
and the other located at the bottom of tive-going pulse at the junction of the

W
e are all familiar with the the staircase—that can be pushed and cathodes of diodes D1 and D2.
electrical wiring arrange- released easily during climb-up from These pulses are used to trigger the
ment that connects an elec- the bottom of the staircase or climb- monostable circuit built around timer
trical bulb with two switches: one at down from the top of the staircase. With IC2. On the trailing edge of the pulse,
the bottom of a staircase and the other every push and release of either of the the output of the monostable goes
at the top. Wiring is done such that two switches, bulb L1 lights up for a high for a time period of 40 seconds.
either of the two switches can be used preset time period of, say, 40 seconds, This drives relay-driver transistor
to switch the bulb on or off. In such a which is considered adequate for climb- 2N2222 (T1) wired as a switch. Relay
wiring arrangement, while climbing ing up or going down the staircase. The RL1 gets energised and closes N/O
up the staircase which is in dark, the bulb goes off automatically after the set contacts of the relay, wired in series
switch located at the bottom of the 40 seconds. You can change this ‘on’ with the mains and the bulb (L1). Bulb
staircase is used to switch on the light. time by changing the values of resis- L1 switches off when the relay gets
After you have climbed the staircase, tor R7 and/or capacitor C4 depending de-energised after 40-second pulse pe-
you use the switch located there to upon your requirement. riod. Free-wheeling diode D4 (1N4001)
switch off the light. Switches S1 and S2 are the two protects transistor T1 against transients
The circuit presented here is an micro-switches, which provide low in- during relay switch-off operation.
electronic-cum-electrical arrangement puts to the respective de-bouncing cir- The circuit operates off a 9V bat-
to get a similar facility as provided cuits. Each de-bouncing circuit is built tery, which gets connected to the cir-
by the hard-wired electrical system, around two NAND gates connected cuit through ‘on’/‘off’ switch S3. You
but you need to operate the switch back to back. The de-bouncing circuits can also use regulated 9V power sup-
only once. Whereas in the hard-wired ensure a clean, bounce-free pulse at the ply. Assemble the circuit on a general-
arrangement if you forget to switch output every time the micro-switch is purpose PCB and house in a small box.
off the light once you have traversed pressed and released. The outputs from Connect micro-switches S1 and S2 near
the staircase, light would remain ‘on,’ the two de-bouncing circuits are ORed top and bottom of the staircase through
wasting energy. using diodes D1 and D2 (1N4001). So flexible wires and bulb in the middle of
In this circuit also, we have two every time you press and release either the staircase. 

w w w. e f y m ag . co m e l e c t ro n i c s f o r yo u • M ay 2 0 0 8 • 7 1
circuit
ideas

Poor Man’s Hearing Aid s.c. dwiv


edi

 EFY LAB vidually, as per your requirement,


using presets VR1 and VR2, respec-

T
his miniature stereo preampli- tively. house it in a thin metallic case, which
fier-cum-headphone amplifier With 3V supply voltage, you can then be mounted in the middle of
circuit works off a 3V battery can afford to use 1/8-watt resistors, a metallic/plastic headband (gener-
(lithium non-rechargeable coin cell). while the electrolytic capacitors’ ally used by telephone operators),
Although its performance is not voltage rating can be as low as 5V. while the two microphones with
comparable to that of commercially This will allow the assembled circuit their associated earpieces are to be
available sophisticated hearing aids, to occupy very little space. Apart extended using screened wires so
still it can serve the purpose well from the usual battery ‘on’/‘off’ that these (microphone-earpiece sets)
for persons with a low degree of switch S1, muting ‘on’/‘off’ switch can be kept closest to the respective
hearing impairment. Its maximum S2 has also been provided. Both S1 earlobes.
power output at 1 kHz is around 8 and S2 could be PCB-mount slide Caution. Ensure that shielded
mW, which is adequate for driving switches. microphone wires do not touch
the headphones. After assembling the main circuit, (short) the shielded earpiece
The circuit, as shown in Fig. 1, wires, as
is wired around Sanyo’s MSI (me- these are con-
dium-scale-integrated) surface-mount nected to dif-
10-pin DIL IC LA4537M, which ferent pins
measures just 8×6.4×1.5 mm 3 . A (reference in-
functional block diagram of LA4537M put pin 5 and
IC is shown in Fig. 2. Since the MSI’s ground pins 3
pin-to-pin (centre-to-centre) distance and 8, respec-
is only 1 mm, the circuit has to be tively) of ICs
assembled on a properly designed LA4537M.
PCB using soldering iron with a You may use
pointed bit. Two ICs (LA4537M) an insulat-
have been cascaded to increase the ing sleeve
overall sensitivity and thereby the over each of
reception range. You can adjust the the shielded
volume of the stereo channels indi- Fig. 2: Functional diagram of ic la4537m wires. 

Fig. 1: Circuit for the hearing aid

8 8 • j u n e 2 0 0 8 • e l e c t ro n i c s f o r yo u w w w. e f y m ag . co m
circuit
ideas

Portable Lamp Flasher edi


s.c. dwiv
 T.K. Hareendran T1 and T2. One of the two transistors
is always conducting, while the other

H
ere is a portable, high-power is blocking. Due to regular charging
incandescent electric lamp and discharging of capacitors C1 and capacitors C1 and C2.
flasher. It is basically a dual C2, the two transistors alternate be- The oscillator circuit built around
flasher (alternating blinker) that can tween conduction and non-conduction transistors T1 and T2 generates low fre-
handle two separate 230V AC loads states. quencies. When transistor T3 conducts,
(bulbs L1 and L2). The collector of transistor T1 is con- IC1 is enabled to fire Triac1 and bulb
The circuit is fully transistorised nected to the base of driver transistor L1 glows. Similarly, when transistor T4
and battery-powered. The free-run- T4 through current-limiting resistor conducts, IC2 is enabled to fire Triac2
ning oscillator circuit is realised using R5. Similarly, the collector of transistor and bulb L2 glows.
two low-power, low-noise transistors T2 is connected to the base of driver Connect the power supply line (L)
of mains to bulbs L1 and
L2, and neutral (N) to T1
terminals of Triac1 and
Triac2. You can also con-
nect neutral (N) line of
the external 230V mains
supply to both loads
(bulbs L1 and L2) as a
common line and then
route supply line (L) to
respective loads (bulbs
L1 and L2).
The circuit works off
only 3 volts. Since current
consumption is fairly low,
two AA-type cells are
Fig. 1: Circuit for portable lamp flasher
sufficient to power the cir-
cuit. Assemble the circuit
transistor T3 through limiting on a general-purpose PCB and enclose in
resistor R6. These transistors a suitable plastic cabinet with integrated
are used to trigger Triac1 and AA-size pen-light cell holder. Drill holes
Triac2 (each BT136) through for mounting the ‘on’/‘off’ switch and
optotriacs IC1 and IC2, re- power switching terminals. Also connect
spectively, and switch on the two bulb holders for bulbs L1 and L2.
power supply to external loads Refer Fig. 2 for pin configurations.
L1 and L2. IC1 and IC2 operate EFY note. While assembling, test-
Fig. 2: Pin configurations of MOC3021, BT136 and alternatively at a low frequency ing or repairing, take care to avoid the
BC550/547
determined by the values of lethal electric shock. 

9 2 • j u n e 2 0 0 8 • e l e c t ro n i c s f o r yo u w w w. e f y m ag . co m
circuit
ideas
The output from IC1 is fed to
display driver LM3915 (IC2) through

Aquarium Probe s.c. dwiv


edi preset VR3 (50-kilo-ohm). With
careful adjustments, the wiper of
VR3 can provide 0-400 millivolts
to the input of IC2. The highly sensi-
 D. Mohan Kumar temperature, the diode generates 2mV tive input of IC2 accepts as low as
output voltage. That is, at 5°C, it is 10 50 mV if the reference voltage at its

A
number of environmental mV, which rises to 70 mV when the pin 7 is adjusted using a variable
factors including light and temperature is 35°C. This property resistor. To increase the sensitivity
temperature affect fish culture. is exploited in the circuit to sense the of IC2, preset VR4 is connected at
The temperature of water has profound temperature variation in aquarium one end to ‘reference voltage end’
effect because fish cannot breed above water. Fig. 1 shows the circuit diagram pin 7 and its wiper is connected to
or below the critical temperature lim- of the aquarium probe. ‘high end’ pin 6 of the internal resis-
its. Temperature between 24°C and Since the output from the diode tor chain.
33°C is found to be the best to induce sensor is too low, a high-gain invert- When approximately 70 mV is
spawning in fishes. This particular ing DC amplifier is used to amplify provided to the input of IC2 by adjust-
temperature range is also necessary the voltage. CA3140 (IC1) is the CMOS ing preset VR3, LED1 (green) lights
for the healthy growth of nursery fish version op-amp that can operate down up to indicate that the temperature is
fries (young fishes). Rise of water tem- to zero-volt output. The highest output approximately 35°C, which is the cross-
perature due to sunlight may adversely available from IC1 is 2.25V less than ing point. When the input receives 100
affect the fish rearing process. the input voltage at pin 7. With resistor mV, LED2 (red) lights up to indicate
approximately 50°C.
Finally, the buzzer
starts beeping if the
input receives 130
mV corresponding
to a temperature of
65°C.
In short, LEDs
and the buzzer re-
main standby when
the temperature of the
water is below 35°C
(normal). With each
step increase of 30
mV in the input (cor-
responding to 15°C
rise in temperature),
LEDs and the buzzer
become active.
Fig. 1: Circuit for aquarium probe Pin 16 of IC2 is
used to drive the pi-
The circuit of aquatic probe de- R4 and ezobuzzer through transistor T1. When
scribed here can monitor the tem- VR2, the pin 16 of IC2 becomes low, T1 conducts
perature of water and indicate the variation to beep the piezobuzzer. Resistor R7
rise in temperature through audio- in diode keeps the base of transistor T1 high to
visual indicators. A readily available Fig. 2: Diode sensor assembly voltage avoid false alarm. IC4 provides regu-
signal diode 1N34 is used in the can be lated 9V DC to the circuit.
circuit as the temperature sensing amplified to the required level. Resis- Assemble the circuit on a common
probe. The resistance of the diode tor R1 restricts current flow through PCB and enclose in a suitable case.
depends on the temperature in its diode D1 and preset VR1 (1-kilo-ohm) Glass signal diode D1 is immersed
vicinity. sets the input voltage at pin 3. IC3 in water to sense the temperature
Typically, the diode can gener- (7805) provides regulated 5 volts to the of water. Its leads should be coated
ate around 600 mV when a potential inputs of IC1, so that the input voltage with enamel paint to avoid shorting
difference is applied to its terminals. is stable for accurate measurement of in water. Alternatively, enclose the
For each degree centigrade rise in temperature. diode in a small glass tube or test

9 2 • j u ly 2 0 0 8 • e l e c t ro n i c s f o r yo u w w w. e f y m ag . co m
circuit
ideas
tube having sufficient internal space mV, so that the input of IC2 (pin 5) hot water. Now red LED2 will glow.
to fit the diode as shown in Fig. 2. receives 70 mV corresponding to the At this position, the voltage at pin 6
Make the sensor assembly waterproof diode output voltage at 35°C. At this of IC1 will be around 100 mV. When
using wax. stage, green LED1 should turn on. the temperature of water increases
Take care while calibrating and If it doesn’t, adjust VR4 until LED1 further to 65°C, the buzzer starts
setting the circuit. With 5V DC sup- just lights up. Immerse the diode beeping. After calibration, immerse
ply to diode D1 and an ambient tem- in temperature-adjusted hot water the diode assembly in the aquarium
perature of about 35°C, D1 generates (35°C) and adjust VR3 and VR4 until tank just below the water surface
around 70 mV. Adjust VR3 until the green LED1 lights up. Increase the and fix it permanently to avoid float-
voltage in its wiper increases to 70 water temperature to 50°C by adding ing. 

w w w. e f y m ag . co m e l e c t ro n i c s f o r yo u • j u ly 2 0 0 8 • 9 3
circuit
ideas

Bicycle Indicator edi


s.c. dwiv
 T.K. Hareendran the square-wave oscillators (one built
around T1 and T2 and the other built

T
he electronic bicycle signaling around T3 and T4) drive four red LEDs
unit described here uses low- (LED1 and LED2, and LED5 and LED6, determined by timing capacitors C1
cost components and is a good respectively), which blink to indicate and C2. Resistors R2 and R3 limit the
operating current of LEDs (LED1
and LED2). At the same time, the
green LED (LED3) starts glowing
to indicate the present direction
status.
Similar action happens in the
next oscillator circuit built around
transistors T3 and T4 when switch
S2 is flipped to ‘on’ position. Indi-
cators at the front right (FR) and
rear right (RR) start blinking, and
at the same time the green LED
(LED4) glows to indicate the direc-
tion status.
Switch S3 is used for emergency
indication. When it is flipped to ‘on’
position, both the oscillators get
power supply through diodes D1
and D2. As a result, LED1 through
Fig. 1: Circuit of bi-cycle indicator LED6 start working simultaneous-
ly. In this condition, all
the LEDs blink, except
LED3 and LED4, which
glow steadily.
After assembling
the circuit on a general-
purpose PCB, enclose
it in a suitable cabinet
as shown in Fig. 2 and
mount on the handle
bar of the bicycle, pref-
Fig. 3: Suggested enclosure (indicators) erably at the mechani-
cal centre point. Con-
the direction of turn. Ad- nect switch S1 at the left-hand side, S2
ditional steady-glow LEDs at the right-hand side and emergency
(LED3 and LED4) are in- switch S3 in the middle of the master
corporated to indicate the unit. Now place this master unit at
Fig. 2: Suggested enclosure (master unit)
working status. the top of the handle bar and do the
substitute to many commercially avail- The working of the cir- essential interconnections using flex-
able versions. It works in an extremely cuit is straightforward. When ible wires. Connect the front indica-
different manner and is convenient to switch S1 is flipped to ‘on’ po- tors (LED1 and LED5) to the left and
operate. sition, DC supply from right side of the handle and similarly
The circuit works off a 9V PP3 the battery is extended to the oscil- rear indicators (LED2 and LED6) can
(alkaline-type) battery and is basically lator circuit formed by transistors be mounted in the carrier frame of
a set of two independent free-running T1 and T2. Now the left-side oscil- the bicycle. For the direction indica-
oscillators (astable multivibrators) built lator starts oscillating and the visual tor, you can use the symbol shown in
around four low-power transistors indicators at the front left (FL) and Fig. 3 and place it at the centre of the
and a few passive components. Both rear left (RL) start blinking at a rate handle. 

w w w. e f y m ag . co m e l e c t ro n i c s f o r yo u • j u ly 2 0 0 8 • 9 5
circuit
ideas

PC Multimedia Speakers s.c. dwiv


edi

 T.K. Hareendran
age down to 1.8 volts and minimum
output power of around 450 mW/

T
his circuit of multimedia speak- channel with 4-ohm loudspeaker at 5V limiter and capacitors C1
ers for PCs has single-chip- DC supply input. and C4 act as buffers.
based design, low-voltage pow- An ideal power amplifier can be Working of the cir-
er supply, compatibility with USB simply defined as a circuit that can cuit is simple. Audio
power, easy heat-sinking, low cost, deliver audio power into external loads Fig. 2: Pin signals from the PC au-
high flexibility and wide temperature without generating significant signal configuration dio socket/headphone
of TDA2822M
tolerance. distortion and without consuming socket are fed to the am-
At the heart of the circuit is IC excessive quiescent current. plifier circuit through components R2
TDA2822M. This IC is, in fact, mono- This circuit is powered by 5V DC and C2 (left channel), and R3 and C3
(right channel). Pot-
meter VR1 works as
the volume control-
ler for left (L) chan-
nel and potmeter
VR2 works for right
(R) channel. Pin 7 of
TDA2822M receives
the left-channel
sound signals and
pin 6 receives the
right-channel signals
through VR1 and
VR2, respectively.
Amplified signals
for driving the left
and right loudspeak-
ers are available at
pins 1 and 3 of IC1,
respectively. Com-
ponents R5 and C8,
and R6 and C10 form
the traditional zobel
Fig. 1: Circuit for PC multimedia speaker network.
Assemble the cir-
lithic type in 8-lead mini DIP pack- supply available from the USB port cuit on a medium-size, general-purpose
age. It is intended for use as a dual of the PC. When power switch S1 is PCB and enclose in a suitable cabinet.
audio power amplifier in battery-pow- flipped to ‘on’ position, 5V power It is advisable to use a socket for IC
ered sound players. Specifications of supply is extended to the circuit and TDA2822M. The external connections
TDA2822M are low quiescent current, power-indicator red LED1 lights up should be made using suitably screened
low crossover distortion, supply volt- instantly. Resistor R1 is a current surge wires for better result. 

9 0 • au g u s t 2 0 0 8 • e l e c t ro n i c s f o r yo u w w w. e f y m ag . co m
circuit
ideas

Three-Phase Appliance Protector


 R.G. Thiagaraj Kumar and four poles.
P. Kasi Rajan Relays RL1 and RL2 act as a
edi
sensing devices for phases Y and s.c. dwiv

M
any of our costly appliances B, respectively. These relays are
require three-phase AC sup- connected such that each acts as an
ply for operation. Failure enabling device for the subsequent
of any of the phases makes the appli- relay. Therefore the combination of mately four seconds, which energises
ance prone to erratic functioning and the relays forms a logical AND gate relay RL3 and its N/O contact closes
may even lead to failure. Hence it is connected serially. to connect the line to the energising
of paramount importance to moni- The availability of phase R en- coil of four-pole contactor relay RL4.
tor the availability of the three-phase ergises relay RL1 and its normally- Contactor RL4 closes to ensure the
supply and switch off the appliance opened (N/O) contacts close to availability of the three-phase sup-
in the event of failure of one or two connect phase Y to the input of ply to the appliance.
phases. The power to the appliance transformer X2. The availability of The rating of contactor RL4 can be
should resume with the availability of phase Y energises relay RL2 and its selected according to the full-load cur-
all phases of the supply with certain N/O contacts close to connect phase rent rating of the appliances. Here the
time delay in order to avoid surges and B to the input of transformer X3, thus contact current rating of the four-pole
momentary fluctuations. applying a triggering input to timer contactor is up to 32A. The availability
The complete circuit of a three- IC NE555 (IC1). of phases R, Y and B is monitored by
phase appliance protector is described Therefore the delay timer built appropriate LEDs connected across
here. It requires three-phase supply, around NE555 triggers only when the secondary windings of transform-
three 12V relays and a timer IC NE555 all the phases (R, Y and B) are avail- ers X1, X2 and X3, respectively. Hence
along with 230V coil contactor having able. It provides a delay of approxi- this circuit does not require a separate

8 8 • au g u s t 2 0 0 8 • e l e c t ro n i c s f o r yo u w w w. e f y m ag . co m
circuit
ideas
indicator lamp for monitoring the phases by disconnecting the power mounted on the backside of cabinet.
availability of the three phases. When supply through the contactor and Connect the appliance through exter-
phase R is available, LED1 glows. automatically restores the three-phase nal wires.
When phase Y is available, LED2 supply to the appliance (with reason- Caution. To avoid the risk of elec-
glows. When phase B is available, able time delay) when all the phases tric shock, ensure that AC mains is
LED3 glows. are available. disconnected during assembly of the
The main advantage of this protec- Assemble the circuit on a gen- circuit and double check everything
tor circuit is that it protects three-phase eral-purpose PCB and enclose in a before connecting your circuit to the
appliances from failure of any of the cabinet with the relays and contactor mains. 

w w w. e f y m ag . co m e l e c t ro n i c s f o r yo u • au g u s t 2 0 0 8 • 8 9
circuit
ideas

Long-Range IR Transmitter s.c. dwiv


edi

 EFY Lab
IR laser pointer as the IR signal source.
The laser pointer is readily available in

M
ost of the IR remotes work re- the market. However, with a very nar- duces the power loss that would result
liably within a range of 5 me- row beam from the laser pointer, you if a transistor were used. To avoid any
tres. The circuit complexity have to take extra care, lest a small jerk dip during its ‘on’/‘off’ operations, a
increases if you design the IR transmit- to the gadget may change the beam 100μF reservoir capacitor C2 is used
ter for reliable operation over a longer orientation and cause loss of contact. across the battery supply. Its advan-
range, say, 10 metres. To double the Here is a simple circuit that will tage will be more obvious when the
range from 5 metres to 10 metres, you give you a pretty long range. It uses IR transmitter is powered by ordinary
need to increase the transmitted power three infrared transmitting LEDs (IR1 batteries. Capacitor C2 supplies extra
charge during ‘switch-
ing on’ operations.
As the MOSFET ex-
hibits large capacitance
across gate-source ter-
minals, a special drive
arrangement has been
made using npn-pnp
Darlington pair of
BC547 and BC557 (as
emitter followers), to
avoid distortion of the
gate drive input. Data
(CMOS-compatible) to
be transmitted is used
for modulating the 38
kHz frequency gener-
ated by CD4047 (IC1).
However, in the circuit
shown here, tactile
Fig. 1: Circuit of the long-range ir transmitter
switch S1 has been
used for modulating
four times. through IR3) in series to increase the and transmitting the IR signal.
If you wish radiated power. Further, to increase Assemble the circuit on a gen-
to realise a the directivity and so also the power eral-purpose PCB. Use switch S2 for
highly direc- density, you may assemble the IR LEDs power ‘on’/‘off’ control. Commer-
tional IR beam inside the reflector of a torch. cially available IR receiver modules
(very narrow For increasing the circuit efficiency, (e.g., TSOP1738) could be used for
Fig. 2: Pin configurations
beam), you can a MOSFET (BS170) has been used, efficient reception of the transmitted
of bc547/557 and bS170 suitably use an which acts as a switch and thus re- IR signals. 

w w w. e f y m ag . co m e l e c t ro n i c s f o r yo u • S e p t e m b e r 2 0 0 8 • 1 0 9
circuit
ideas

Muscular Stimulator s.c. dwiv


edi

 Ashok K. Doctor attached. It is useful to relieve head-


ache and muscular pain and revive

H
ere is a circuit that stimulates frozen muscles that impair movement. aid in removing cellulitis.
nerves of that part of your Though it provides muscles stimula- The system comprises two units:
body where electrodes are tion and invigoration, it’s mainly an muscular stimulator and timer.
Fig. 1 shows the circuit of the
muscular stimulator. IC 7555 is
wired as an astable multivibrator
to generate about 80Hz pulses.
The output of IC1 is fed to tran-
sistor T1, whose emitter is further
connected to the base of transistor
T2 through R3 and VR1. The col-
lector of transistor T2 is connected
to one end of the secondary wind-
ing of transformer X1. The other
end of the secondary winding of
the transformer is connected to
ground.
When IC1 oscillates, trans-
former X1 is driven by the pulse
frequencies generated to produce
high voltage at its primary termi-
nals. Separate electrodes are con-
nected to each end of the primary
Fig. 1: Muscular stimulator circuit winding of transformer X1. Diode
1N4007 (D1) protects transistor T2
against high-voltage pulses generated
by the transformer.
Using potmeter VR1 you can con-
trol the intensity of current sensing at
the electrodes. The brightness level of
LED1 indicates the amplitude of the
pulses. If you want to increase the in-
tensity level, replace the 1.8-kilo-ohm
resistor with 5.6 kilo-ohms or higher
value up to 10 kilo-ohms.
X1 is a small mains transformer
with 220V primary to 12V, 100/150mA
secondary. It must be reverse connect-
ed, i.e., connect the secondary winding
to the collector of T2 and ground, and
primary winding to the output elec-
trodes. The output voltage is about 60V
but the output current is so small that
there is no threat of electric shock.
Electrodes are made of small, thin-
guage metallic plates measuring about
2.5×2.5 cm2 in size. Use flexible wires
Fig. 2: Timer circuit to solder electrodes and connect to the

9 6 • o c to b e r 2 0 0 8 • e l e c t ro n i c s f o r yo u w w w. e f y m ag . co m
circuit
ideas
output of the device. Before attaching S2, the monostable triggers and its out- when the muscular stimulation circuit
metal electrodes to the body, wipe put goes high for 10 minutes. Thereaf- is powered on. At the same time, flip
them with a damp cloth. After attach- ter, its output goes low to give a beep switch S2 to start the timer for counting
ing the electrodes to the body (with the sound from the piezobuzzer and lights the time. At the end of the timing cycle,
help of elastic bands on velcro straps), up the red LED (LED2) indicating that the piezobuzzer beeps. Each session
flip switch S1 to activate the circuit stimulation time is over. should last about 10 minutes.
and rotate the knob of intensity-control Assemble the timer with a separate Caution: Heart patients and
preset VR1 very slowly until you feel a switch and a 9V DC battery in the same pregnant women should not use
slight tingling sensation. cabinet as the stimulator. Tape the elec- this device. Also, do not attach elec-
Fig. 2 shows the timer circuit. It trodes to the skin at opposite ends of trodes to burns, cuts, wounds or any
uses IC NE555 wired in monostable the chosen muscle and rotate VR1 knob injury. Consult your physician before
mode. Initially, when you press switch slowly until you sense light itching using this circuit. 

w w w. e f y m ag . co m e l e c t ro n i c s f o r yo u • o c to b e r 2 0 0 8 • 9 7
circuit
ideas

WIRELESS SWITCH s.c. dwiv


edi
lated 5V is connected to the circuit, IR
LED1 emits infrared rays, which are
received by phototransistor T1 if it is
 Navpreet Singh Tung properly aligned. The collector of T1
is connected to non-inverting pin 3 of

N
ormally, home appliances are IR LED1 is detected by the phototran- IC1. Inverting pin 2 of IC1 is connected
controlled by means of switch- sistor to activate the hidden lock, flush to voltage-divider preset VR1. Using
es, sensors, etc. However, system, hand dryer or else. preset VR1 you can vary the reference
physical contact with switches may be This circuit is very stable and sensi- voltage at pin 2, which also affects sen-
dangerous if there is any shorting. tive compared to other AC appliance sitivity of the phototransistor.
The circuit described here requires control circuits. It is simple, compact Op-amp IC1 amplifies the signal
no physical contact for operating the and cheap. Current consumption is received from the phototransistor.
appliance. You just need to move low in milliamperes. Resistor R3 controls the base current of
your hand between the infrared LED The circuit is built around an IC transistor BC548 (T2). The high output
(IR LED1) and the phototransistor CA3140, IRLED1, phototransistor and of IC1 at pin 6 drives transistor T2 to
(T1). The infrared rays transmitted by other discrete components. When regu- energise relay RL1 and switch on the
appliance, say, hand dryer, through the
relay contacts.
The working of the circuit is simple.
In order to switch on the appliance,
you simply interrupt the infrared rays
falling on the phototransistor through
your hand. During the interruption,
the appliance remains on through the
relay. When you remove your hand
from the infrared beam, the appliance
turns off through the relay.
Assemble the circuit on any gen-
eral-purpose PCB. Identify the resistors
through colour coding or using the
multimeter. Check the polarity and pin
configuration of the IC and mount it
using base. After soldering the circuit,
connect +5V supply to the circuit. 

1 0 0 • o c to b e r 2 0 0 8 • e l e c t ro n i c s f o r yo u w w w. e f y m ag . co m
Electronic Combination Lock | Detailed Circuit Diagram Available https://electronicsforu.com/electronics-projects/electronic-combination-lock

1 of 3 1/24/2018, 6:15 PM
Electronic Combination Lock | Detailed Circuit Diagram Available https://electronicsforu.com/electronics-projects/electronic-combination-lock

Fig. 1: Electronic combination lock circuit

2 of 3 1/24/2018, 6:15 PM
Electronic Combination Lock | Detailed Circuit Diagram Available https://electronicsforu.com/electronics-projects/electronic-combination-lock

3 of 3 1/24/2018, 6:15 PM
circuit
ideas

Night Alert s.c. dwivedi


capacitor C3 are timing components.
When fully charged, capacitor C3 takes
about two minutes to discharge.
 D. Mohan Kumar So when sound is produced in front
of the condenser mic, triac1 (BT136)

I
dea of this circuit came to me at Transistor T1 along with transistor fires and the bulb (B1) glows for about
midnight when my pet dog started T2 amplifies the sound signals and two minutes.
barking continuously on sensing provides current pulses from the col- Assemble the circuit on a general-
a moving shadow, perhaps that of an lector of T2. purpose PCB and enclose in a plastic
intruder. Dogs have a night adaptation The input trigger pulse is applied cabinet. Power to the circuit can be
capability to maximise the sensitivity to the collector of transistor T3 and derived from a 12V, 500mA step-down
of vision in low light. They are well coupled by capacitor C3 to the base of transformer with rectifier and smooth-
adapted to see moving objects rather transistor T4 causing T4 to cut off. The ing capacitor. Solder the triac ensuring
sufficient spacing
between the pins
to avoid short
circuit. Fix the
unit in the dog’s
cage, with the
lamp inside or
outside as de-
sired. Connect
the microphone
to the circuit us-
ing a short length
of shielded wire.
Enclose the mi-
crophone in a
tube to increase
than stationary ones in darkness. collector voltage of transistor T4 for- its sensitivity.
This circuit turns a lamp ‘on’ for ward biases transistor T3 via resistor Caution. Since the circuit uses
a short duration when the dog barks, R8. Transistor T1 conducts and capaci- 230V AC, many of its points are at AC
giving an impression that the occu- tor C3 discharges to keep transistor T4 mains voltage. It could give you le-
pants have been alerted. cut-off. Transistor T4 remains cut-off thal shock if you are not careful. So if
The condenser microphone fitted until capacitor C3 charges enough to you don’t know much about working
in the dog’s cage senses barking sound enable it to conduct. with line voltages, do not attempt to
and generates AC signals, which pass When transistor T4 conducts, its col- construct this circuit. EFY will not be
through DC blocking capacitor C1 lector voltage goes low to drive transis- responsible for any kind of resulting
to the base of transistor BC549 (T1). tor T3 into cut-off state. Resistor R9 and loss or damage. 

w w w. e f y m ag . co m e l e c t ro n i c s f o r yo u • N o v e m b e r 2 0 0 8 • 8 5
circuit
ideas

Traffic Controller s.c. dwiv


edi

 N.R. Paranjape high-to-low pulse at its pin 3


triggers IC3 through C5. IC3

T
his simple traffic controller can is configured as a monosta-
be used to teach children rudi- ble with ‘on’ time of about 4
ments of traffic rules. seconds, which means pin 3
The circuit (shown in Fig. 1) uses of IC3 will remain high for
readily available components. It main- this period and energise relay
ly comprises rectifier diodes (1N4001), RL2 through driver transistor
a 5V regulator 7805, two timers IC 555, T2. The amber lamp (B2) thus
two relays (5V, single-changeover), lights up for 4 seconds.
three 15W, 230V bulbs and some dis- As soon as 4-second time
crete components. period of timer IC3 at pin 3
Mains power is stepped down by lapses, relay RL2 de-ener-
transformer X1 to deliver a secondary gises and the green lamp (B3)
output of 9V, 300 mA. The transformer lights up for the rest of ‘off’
output is rectified by a full-wave period of IC2, which is about
bridge rectifier comprising diodes D1 26 seconds. The green lamp
through D4, filtered by capacitor C1 is activated through the nor-
and regulated by IC 7805 (IC1). mally closed (N/C) contacts
IC2 is wired as a multivibrator with of relay RL2.
‘on’ and ‘off’ periods of approximately So when mains power is
30 seconds each with the component switched on, red light glows for
values selected. As soon as mains 30 seconds, amber for 4 seconds
power is switched on, pin 3 of IC2 goes and green for 26 seconds.
high for 30 seconds. This, in turn, ener- You can assemble this cir-
gises relay RL1 through transistor T1 cuit on a general-purpose PCB
and the red lamp (B1) glows through and enclose in an insulated
its normally-open (N/O) contact. At box. The box should have
the same time, mains power is discon- enough space for mounting
nected from the pole of relay RL2. transformer X1 and two re-
As the ‘on’ time of IC2 ends, a lays. It can be fixed near 230V Fig. 2: Construction details of traffic controller unit

Fig. 1: Circuit of traffic controller

8 0 • N o v e m b e r 2 0 0 8 • e l e c t ro n i c s f o r yo u w w w. e f y m ag . co m
circuit
ideas
AC, 50Hz power supply or mounted box using nuts and bolts or screws. First, fix three 15W bulbs (B1
on the PVC tube used in construction Make three tubes of thin alumini- through B3) and then press on the
of the traffic light container. um sheet, which is readily available in tubes. Support the other ends of the
Construction of the traffic light hardware shops. The inner diameter of tubes in the holes made on the front
container box is shown in Fig. 2. A aluminium tubes should be such that panel of cardboard box. Sandwich gela-
stout cardboard box of 30x15x10cm3 is these can snugly fit on the light sock- tine papers of the three colours between
required for housing the lamps. To en- ets. Using a sharp knife, make holes two sheets of cardboard and fix over the
sure strength, use a 10x45cm2 plywood opposite the sockets carefully. Wire the tubes. The visibility of red, amber and
plate having 1.5cm thickness and se- sockets at the back and take the wires green lights improves with their mount-
cure onto it three light sockets and the out through the PVC tube. ing on the tubular shape. 

w w w. e f y m ag . co m e l e c t ro n i c s f o r yo u • N o v e m b e r 2 0 0 8 • 8 1
circuit
ideas

Battery-level indicator edi


s.c. dwiv
 Aniruddh K.S. makes it easier to recognise the
voltage level on the basis of the

N
ormally, in mobile phones, calibration made. Red LEDs (LED1
the battery level is shown in through LED3) indicate battery initially set it at 3V. Slowly adjust VR1
dot or bar form. This lets you capacity of less than 40 per cent. until LED1 glows. Now, increase the
easily recognise the battery level. Here Orange LEDs (LED4 through LED6) input voltage to 15V in steps of 1.2V
we present a circuit that lets you know indicate battery capacity of 40 to until the corresponding LED (LED2
the battery level of a device from the less than 70 per cent and green through LED10) lights up.
number of LEDs that are glowing. It LEDs (LED7 through LED10) indi- Now the circuit is ready to show
uses ten LEDs in all. So if three LEDs cate battery capacity of 70 to under any voltage value with respect to the
glow, it indicates battery capacity of 100 per cent. The brightness of the maximum voltage. As the number of

30 per cent. Unlike in mobile phones LEDs can be adjusted by varying the LEDs is ten, we can easily consider one
where the battery-level indicator func- value of preset VR2 between pins 6 LED for 10 per cent of the maximum
tion is integrated with other functions, and 7. voltage.
here only one comparator IC (LM3914) Diode D1 prevents the circuit Connect the voltage from any
does it all. from reverse-polarity battery con- battery to be tested at the input
The LM3914 uses ten comparators, nection. The tenth LED glows only probes of the circuit. By examining
which are internally assembled in the when the battery capacity is full, the number of LEDs glowing you
voltage divider network based on the i.e., the battery is fully charged. can easily know the status of the bat-
current-division rule. So it divides the When the battery is fully charged, tery. Suppose five LEDs are glowing.
battery level into ten parts. relay-driver transistor T1 conducts In this case, the battery capacity is
The circuit derives the power to energise relay RL1. This stops the 50 to 59 per cent of its maximum
supply for its operation from the charging through normally-open value.
battery of the device itself. It uses (N/O) contacts of relay RL1. Assemble the circuit on a general-
ten LEDs wired in a 10-dot mode. For calibration, connect 15V vari- purpose PCB. Calibrate it and then en-
The use of different coloured LEDs able, regulated power supply and close in a box. 

8 4 • D E C e m b e r 2 0 0 8 • e l e c t ro n i c s f o r yo u w w w. e f y m ag . co m
circuit
ideas

Laser-guided Door Opener s.c. dwiv


edi

 T.K. Hareendran ducts to reverse-bias transistor T3 and


the input to the first gate (N1) of IC1

T
his automatic door opener can (CD4001) is low. The high output at The second monostable built
be made using readily available pin 3 of gate N1 forward biases the around IC2 (CD4538) is enabled by
components. The electromag- LED-driver transistor (T4) and the the high-going pulse at its input pin
netic relay at the output of this gadget green standby LED (LED2) lights up 12 through the output of gate N4 of
can be used to control the DC/AC continuously. The rest of the circuit the first monostable when the laser
door-opener motor/solenoid of an remains in standby state. beam is interrupted. As a result, relay
electromechanical door opener as- When someone interrupts the RL1 energises and the door-opener
sembly, with slight intervention in its laser beam, photo-transistor T1 stops motor starts operating. LED3 glows to
electrical wiring. conducting and transistor T3 becomes indicate that the door-opener motor is
A laser diode (LED1) is used here forward-biased. This makes the output getting the supply. At the same time,
as the light transmitter. Alternatively, of gate N1 go low. Thus LED-driver piezobuzzer PZ1 sounds an alert.
you can use any available laser pointer. transistor T4 becomes reverse-biased Transistor T5, whose base is connected
The combination of resistor R1 and and LED2 stops glowing. At the same to Q output (pin 10) of IC2, is used for
diode D1 protects the laser diode time, the low output of gate N1 makes driving the relay. Transistor T6, whose
from over-current flow. By varying the output of N2 high. Instantly, this base is connected to Q output of IC2,
muliturn trimpot VR1, you can adjust high level at pin 4 of gate N2 triggers is used for driving the intermittent pi-
the sensitivity. (Note that ambient light the monostable multivibrator built ezobuzzer. ‘On’ time of relay RL1 can
reflections may slightly degrade the around the remaining two gates of IC1 be adjusted by varying trimpot VR2.
performance of this unit.) (N3 and N4). Values of resistor R8 and Resistor R9, variable resistor VR2 and
Initially, when the laser beam is capacitor C1 determine the time period capacitor C3 decide the time period of
falling on photo-transistor T1, it con- of the monostable. the second monostable and through it

w w w. e f y m ag . co m e l e c t ro n i c s f o r yo u • j a n ua ry 2 0 0 9 • 9 7
circuit
ideas
on time of RL1. totransistor on opposite sides of the relay contacts is the one used in elec-
The circuit works off 12V DC doorframe and align them such that tromechanical door-opener assembly.
power supply. Assemble it on a gen- the light beam from the laser diode If you want to use a DC motor, replace
eral-purpose PCB. After construction, falls on the phototransistor directly. mains AC connection with a DC power
mount the laser diode and the pho- The motor connected to the pole of supply. 

9 8 • j a n ua ry 2 0 0 9 • e l e c t ro n i c s f o r yo u w w w. e f y m ag . co m
circuit
ideas

Traffic Baton edi


s.c. dwiv
 Ashok K. Doctor their hand signals may not be visible
at night, it is necessary to have some

I
n small towns, there are no traffic illuminated direction indicator.
lights and the police regulates the Here we present two circuits for other uses bright LEDs. Both the cir-
traffic with hand signals. Since the same. One uses 6V bulbs and the cuits operate off a 6V, 4.5Ah recharge-
able battery,
which is
clipped to
the police-
man’s waist-
band.
Fig. 1
shows the
circuit of the
LED flasher.
It is wired
as an astable
multivibra-
tor. The ‘on’
time of the
LED cluster
is about 108
milliseconds
and ‘off’ time
is around 105
milliseconds.
The frequen-
cy is around
Fig. 1: Circuit of LED flasher 5 Hz. A di-
ode is used
in series with the base of BD140 to
increase the forward voltage in order
to ensure that when BD139 conducts,
BD140 is cut-off. Select the LED which
consumes low current (20 mA or so)
but flashes bright.
Fig. 2 shows the circuit of the bulb
flasher. Timer NE555 is wired as an
astable multivibrator. The ‘on’ period
of flashing bulb is around 344 milli-
seconds and ‘off’ period is around 329
milliseconds. The frequency is around
1.5 Hz. Bulb-driver transistors 2N3053/
BD139 and 2N2905/BD140 are used to
light up the lamp. Two diodes are used
in series with the base of 2N2905 to
increase the forward voltage in order
to ensure that when BD139 is conduct-
ing, BD140 is cut-off. Slide switch S2 is
Fig. 2: Circuit of bulb flasher used to change the colour status of the

9 4 • j a n ua ry 2 0 0 9 • e l e c t ro n i c s f o r yo u w w w. e f y m ag . co m
circuit
ideas
flashing bulb.
Assemble the LED flasher and
bulb flasher circuits on separate gen-
eral-purpose PCBs. Enclose the LED
flasher in a transparent acrylic pipe as
shown in Fig. 3. The bulb flasher can
be enclosed in another transparent
acrylic pipe as shown in Fig. 4. Slide
switches and red and green acrylic
sheets are used for appropriate colour
emissions. Now your traffic baton is
Fig. 3: Traffic baton for LED flasher ready to use. 

Fig. 4: Traffic baton for bulb flasher

w w w. e f y m ag . co m e l e c t ro n i c s f o r yo u • j a n ua ry 2 0 0 9 • 9 5
circuit
ideas

Automated Alarm Circuits s.c. dwiv


edi

Pallabi Sarkar and Normally, when the door is closed,


Anirban Sengupta reed switch S1 is closed, transistor T1
conducts and the monostable multivi- When the door is opened, reed

T
wo alarm circuits are presented brator (IC1) remains in standby mode switch S1 gets disconnected, T1 stops
here. One produces bird-chirp- with ‘low’ output at pin 10. conducting and low-to-high pulse at pin
ing sound and the other British
police siren tone.
Fig. 1 shows the circuit of the bird-
chirping-sound alarm unit along with
the circuit of the control unit. Fig. 2
shows the circuit of only the British
police siren tone generator, which has
to be integrated with the control circuit
portion of Fig. 1 at points A and B to
complete the circuit diagram of auto-
mated alarm.
The control unit is built around ICs
CD4047 and CD4027 (as shown on the
left side of the dotted line in Fig. 1). As
mentioned earlier, it is common to both
the alarm circuits. IC CD4047 (IC1)
is wired in positive-edge-triggering
monostable multivibrator mode to set
and reset IC CD4027 (IC2). The output
pulse width of IC1 depends on the
values of capacitor C2 and resistor R3
connected to its pins 1, 2 and 3. Fig. 2: Alarm circuit that generates police siren tone

Fig. 1: Alarm circuit that generates bird-chirping sound

9 6 • F e b r ua ry 2 0 0 9 • e l e c t ro n i c s f o r yo u w w w. e f y m ag . co m
circuit
ideas
8 of IC1 triggers the monostable and a T2 (BC548), which enables the alarm ing sound.
short-duration positive pulse of about circuit. For the chirping-sound alarm gen-
10 seconds is available as Q output at The output at point A is used to erator, assemble the circuit shown in
pin 10. At the same time, complementary enable the alarm tone generator circuit Fig. 1 on a separate general-purpose
output Q goes low at pin 11. The output (on the right side of the dotted line) PCB and enclose in a small box. And if
from IC1 is used to set and reset IC2. consisting of two 555 timer ICs marked you want an alarm circuit with British
IC2 is a low-power, dual J-K mas- as IC3 and IC4. The R-C network de- police siren tone, assemble the circuit
ter/slave flip-flop having independ- termines the frequency of the sound shown in Fig. 2 on another general-
ent J, K, set, reset and clock inputs. produced. The triangular waveform purpose PCB and connect it to points
The flip-flops change states on the of the astable multivibrator is taken A and B of the control unit shown in
positive-going transition of the clock out from the junction of pins 2 and Fig. 1 after removing the circuit on the
pulses. IC2 is wired such that its Q 6 of IC3. This waveform is fed as the right side of the dotted line. Use a 9V,
output turns ‘high’ when reset pin 4 control voltage at pin 5 of IC4 through 500mA standard adaptor to power the
receives a high pulse. When set pin 7 resistor R18. The output received from circuit.
receives a high pulse, Q output goes pin 3 of IC4 is fed to the base of transis- This circuit may be used as a secu-
low and Q output goes high. This tor T3 to drive an 8-ohm loudspeaker rity alarm in banks, households and
lights up LED2 and drives transistor (LS1), which generates the bird-chirp- motorcars. 

w w w. e f y m ag . co m e l e c t ro n i c s f o r yo u • F e b r ua ry 2 0 0 9 • 9 7
circuit
ideas

MIDNIGHT security light


edi
s.c. dwiv
 D. MOHAN KUMAR sunset, the high resistance of LDR1
makes pin 12 of IC1 ‘low’ and it starts

M
ost thefts happen after oscillating, which is indicated by the
midnight hours when peo- flashing of LED2 connected to pin 7 pin 12 of IC1 high during day time,
ple enter the second phase of IC1. The values of oscillator compo- so slight changes in light intensity
of sleep called ‘paradoxical’ sleep. nents (resistors R1 and R2 and capaci- don’t affect the circuit. Using preset
Here is an energy-saving circuit that tor C4) are chosen such that output VR1 you can adjust the sensitivity of
causes the thieves to abort the theft pin 3 of IC1 goes ‘high’ after seven LDR1.
attempt by lighting up the possible hours, i.e., around 1 am. This high Power supply to the circuit is de-
sites of intrusion (such as kitchen or output drives triac 1 (BT136) through rived from a step-down transformer
backyard of your house) at around LED1 and R3. X1 (230V AC primary to 0-9V, 300mA
1:00 am. It automatically resets in the Bulb L1 connected between the secondary), rectified by a full-wave
morning. phase line and M2 terminal of triac 1 rectifier comprising diodes D1 through
The circuit is fully automatic and turns on when the gate of triac 1 gets D4 and filtered by capacitor C1.
uses a CMOS IC CD 4060 to get the the trigger voltage from pin 3 of IC1. Assemble the circuit on a general-
desired time delay. Light-dependent It remains ‘on’ until pin 12 of IC1 be- purpose PCB with adequate spacing
resistor LDR1 controls reset pin 12 of comes high again in the morning. between the components. Sleeve the
IC1 for its automatic action. Capacitors C1 and C3 act as power exposed leads of the components.
During day time, the low resist- reserves, so IC1 keeps oscillating even Using switch S1 you can turn on the
ance of LDR1 makes pin 12 of IC1 if there is power interruption for a few lamp manually. Enclose the unit in a
‘high,’ so it doesn’t oscillate. After seconds. Capacitor C2 keeps trigger plastic case and mount at a location
that allows adequate
daylight.
Caution. Since the
circuit uses 230V AC,
many of its points are
at AC mains voltage. It
could give you lethal
shock if you are not
careful. So if you don’t
know much about work-
ing with line voltages,
do not attempt to con-
struct this circuit. EFY
will not be responsible
for any kind of resulting
loss or damage. 

w w w. e f y m ag . co m e l e c t ro n i c s f o r yo u • F e b r ua ry 2 0 0 9 • 9 5
do-it-yourself

A Versatile
Frequency Counter
Often, the need for a frequency counter is felt that operates in the LF, HF
and VHF ranges. The most common deterrents are the lack of programming
knowledge and the non-availability of VHF prescalers to bring down VHF to a
manageable HF range. Here we show how a commonly available low-cost radio
may be ripped apart and used as a frequency counter covering frequencies
from 500 kHz to 150 MHz
 Vasuki Prasad this section. It is used
only to keep track of

C
hinese radio company Kchibo COM1 1 36 VDD time.
makes radios based on the CX- COM2 2 35 FMIN The on-chip oscil-
A1619BM IC. This IC is a sur- COM3 3
lator is a NOT gate
34 VSS
face-mount version of the CXA1619BS, that requires an exter-
SEG0 4 33 AMIN
which most designers are familiar nal 32.768kHz crystal
with; FM boards available in the mar- SEG1 5 32 AM/FM-SEL to generate the timing
ket are built using this IC. Kchibo and SEG2 6 31 RANGE base.
other companies went a step ahead The adder/subtrac-
SEG3 7 30 NC
and thought of implementing a radio tor unit works like this:
frequency display, along with an alarm SEG4 8 29 IF70K A super heterodyne
clock, in their radios so that any station SEG5 9 28 AL-OUT radio receiver requires
can be tuned into, without doubting
SEG6 10
6610 27 AL-SIG
a local oscillator operat-
the actual frequency which the radio ing at a fixed frequency
is tuned to (no blind or approximate SEG7 11 26 CLKFREQ-SEL above the incoming
tuning). This is not a radio synthesiser; SEG8 12 25 NC signal’s frequency. This
it’s a conventional, mechanically tuned SEG9 13
fixed frequency is called
24 HR-SET
radio that sports a frequency display. intermediate frequency,
SEG10 14 23 MIN-SET
As opposed to conventional radios or IF. For commercial
which use a single IC (the CXA1619BS/ SEG11 15 22 AL DISP FM radios, it is 10.7
BM), the so-called digital radio uses SEG12 16 21 AL ON/OFF MHz for FM and 455
two ICs: the radio receiver IC and the kHz for AM/SW.
OSC IN 17 20 RST
UTC6610. Now, if the frequen-
At the heart of this project is OSC OUT 18 19 VLCD cy counter was reading
UTC6610. It comes in many pack- the actual frequency of
ages, but these radios use the chip-on- Fig. 1: Pin configuration of UTC6610 the oscillator, the user
board variety. The UTC6610 comes would have been put to
equipped with a frequency counter low-to-high) within a set period. great trouble in determining the actual
circuitry, prescaler for VHF, clock cir- The prescaler for VHF is a divide- receiving frequency. For example, for a
cuitry (time), on-chip oscillator, simple by-ten block that probably uses high- 100MHz signal to be detected, the local
adder/subtractor or offset unit, and speed CMOS circuitry to divide the oscillator is made to run at 110.7 MHz
LCD driver. As can be seen, this unit number of pulses. When a 150MHz (100+10.7=110.7 MHz). So to display
is completely self-sufficient. The only signal is fed to the prescalar, the output the intended receiving frequency, the
external components required are is 15 MHz. Datasheets specify 300mV UTC6610 subtracts 10.7 MHz from the
crystal and LCD. peak-to-peak input; higher voltages will counted frequency. This means that if
The frequency counter circuitry of destroy the IC. The prescaler is activated you are to use the UTC6610 as a fre-
the IC measures the frequency of the only in the FM mode of operation. quency counter, always bear in mind
incoming RF wave by counting the As regards clock circuitry, we’re that the actual frequency is 10.7 MHz
number of transitions (high-to-low or not interested in it and hence skipping higher than the displayed frequency

w w w. e f y m ag . co m e l e c t ro n i c s f o r yo u • m a r c h 2 0 0 9 • 1 0 7
do-it-yourself

Modes of Operation
FM mode AM mode
Function details details
Input frequency range 11 to 150 MHz 0.5 to 30 MHz
Prescaler In operation Not in operation
Input voltage 300mV pk-pk recommended 300mV pk-pk recommended
Frequency resolution 10 kHz: 11.00 to 99.99 MHz 1 kHz: 500 to 9999 kHz
100 kHz: 11.0 MHz to 149.9 MHz 10 kHz: 0.50 to 29.99 MHz
Set in radio to 100kHz resolution Set in radio to 10kHz resolution for
SW and 1kHz resolution for MW Fig. 5: The brown PCB with the metallic shield,
which is our target
IF offset 10.7 MHz 455 kHz
70 kHz also available
Input resistance 150 ohms 2000 ohms

COL S1
AM
MHz
FM KHz
PM AL
DP2 DP1

(a)

Fig. 6: Opened up: The frequency counter


UTC6610 hidden away behind the LCD, while
the flip-flop circuitry (just to set FM, AM states) is
visible as the SMD transistors
Fig. 3: The radio

(b)

Fig. 2: (a) 4 digit-LCD and (b) image of the LCD

in the FM mode. In the AM mode, it is


455 kHz above the displayed frequen-
cy. 70kHz offsets are also available as
Fig. 7: The back side: RF shield-cum-LCD
an option in the FM mode, but we are mechanical support. Notice the purple and black
skipping this for now as the radios wire for VHF and HF input, respectively
we rip these modules from have no
70kHz IF.
The LCD driver converts binary
data into voltages necessary to drive
the LCD unit.

Opening up the radio


Fig. 4: Opened up radio; note that the brown
The best part about Kchibo KK-939B PCB is the frequency counter and LCD section
radio is use of minimal external points. and green PCB is the radio receiver
Also, it is simple to understand and
operate, has an LED light to illuminate frequency counter PCB (Fig. 9), you Fig. 8: The purple line leads to the take-off point
for the VHF oscillator (FM section), while the
the LCD, and looks good. I recommend will notice the solder joints marked VH rightmost black wire leads to the take-off point
beginners to buy this radio and rip it input, HF input, points ‘1’ through ‘5,’ for the AM oscillator
apart for a clean, high-performance FM and AM. VHF input is to be con-
frequency counter. nected to the RF source whose frequen- want to determine (up to 30 MHz).
To access the frequency counter cy you want to determine (from 11 to ‘1’ is an input point. It has to be
board, the radio (Kchibo KK-939B) has 150 MHz). HF input is to be connected kept at 0V for FM (VHF) operation
to be opened up. In the close-up of the to the RF source whose frequency you and 10kHz resolution in the AM mode

1 0 8 • m a r c h 2 0 0 9 • e l e c t ro n i c s f o r yo u w w w. e f y m ag . co m
do-it-yourself
PCB provided by the manufacturer of
the radio, so as to come up with a quick,
compact, cost-effective RF counter.
To have a look at the IC, lift the
LCD, and you will see that the chip-
on-board (COB) is the UTC 6610 (see
Fig. 10).

Making the RF counter


1. Cut out the 5-wire ribbon cable. Un-
Fig. 12: Crude connection example solder it from the counter board.
2. Cut the VHF and HF input wires
A flip-flop comprising SMD transis- from the points on the radio PCB, not
Fig. 9: Close-up of the frequency counter PCB tors on the PCB locks the UTC in this the counter PCB.
mode until the AM button is pressed. 3. The counter PCB is now sepa-
Default mode on startup is the FM rated from the radio receiver PCB.
mode. 4. Solder a red wire to point ‘3’ of
Pressing AM button activates the the counter PCB. This is your positive
HF counter with frequency range of 0.5 3V supply wire.
to 30 MHz. The input is via the black 5. Solder a green wire to point ‘4’ of
wire (shown in Fig. 9); the colour may the PCB. This serves as ground.
differ in your radio. Set point 1 to Vcc 6. Connect a small switch between
for 1kHz resolution and RF input of point ‘1’ and GND and Vcc, as shown
0.5 to 9.999 MHz. Set point 1 to 0V for in Fig. 11. Push the switch to 1kHz
10kHz resolution and 0.5 MHz to 29.99 position for 1kHz resolution in the
Fig. 10: The chip-on-board is the UTC6610 MHz. Actual tests show it exceeds AM mode, and to 10kHz resolution for
75 MHz in this mode, which is good. 10kHz in the AM mode. The switch has
(HF opera- Reading on the display must be added to be kept in the 10kHz resolution mode
tion). Setting to 455 kHz to get the actual frequency. for proper VHF operation (FM mode).
it to Vcc in HF A flip-flop comprising SMD transis- With this, your crude-looking but
mode only sets tors on the PCB locks the UTC in this great-performance RF counter is set to
the display mode until the FM button is pressed. go. But bear a few things in mind:
resolution to Default mode on startup is the FM 1. Keep the VHF and HF wires as
1 kHz. ‘2’ is an mode. To activate the AM mode, this short as possible. Their length will not
output point button has to be pressed. affect the performance of the counter,
Fig. 11: Connect a small
switch between point ‘1’ for the radio Notice the blob of solder above the but the circuit under test (for example,
and GND and Vcc which lets VHF input point. This is the ground. the oscillator you might have built).
the IC know Of course, the clock pushbuttons 2. Couple the HF and VHF wires to
whether it’s the AM (SW/MW) mode are still working perfectly, so you may the RF sources via a 2pF capacitor.
or FM mode. ‘3’ is an input point at use them to set the clock too. You will 3. Preferably, replace the VHF and
Vcc (3V, do not exceed 3.3V). ‘4’ is the have to shift the SPDT switch (the HF crude wires with easily available
input point at GND. ‘5’ is the output switch which controls the radio ‘on’ 75-ohm cable TV coax. This provides
point that controls power to the radio, and ‘off’) to ‘off’ position in order to RF shielding and noise immunity to a
shutting off power to the IC when in activate the clock, and to ‘on’ position good degree.
clock mode. in order to activate the RF counter. Fig. 12 shows a crude connection
Pressing FM button activates the Please note that here we’re not try- example. Note how the green wire (HF
VHF counter with a resolution of 100 ing to use the UTC6610 directly. Most wire) is directly fed to the output of the
kHz and frequency range of 11 MHz of the hard work of wiring up the 6610 oscillator (very crude, do not attempt
to 150 MHz. The input is via the pur- IC, providing an LCD, making the PCB this), without any capacitor or buffer.
ple wire (shown in Fig. 9); the colour and adding components has been done (I admit this green wire belongs to a
may differ in your radio. You must set by the radio manufacturer; in this case, different counter, but the operation
point 1 to 0V for proper operation. The Kchibo. All we are attempting to do and concept are the same, as it too uses
display reading must be added to 10.7 here is to understand operation of the the UTC6610.) Once I disconnected the
MHz to get the actual frequency. UTC6610, and in turn operation of the counter from the oscillator I had made,

w w w. e f y m ag . co m e l e c t ro n i c s f o r yo u • m a r c h 2 0 0 9 • 1 0 9
do-it-yourself
the frequency moved up by 1 MHz.
What is important to understand
here is: If you’re keeping the counter
connected to the output of a non-
buffered oscillator, the reading of the
counter plus 455/10.7 (as the case may
be, FM or AM mode, as shown on the Fig. 13: Suggested connection
LCD) will be the true reading. At-
tempting to count the frequency and Fig. 13 shows the suggested con-
then disconnecting the counter will set nection. Never connect the HF and Fig. 14: Another radio receiver example
the oscillator at a different frequency VHF counter pins together. Use sepa-
after counting due to the capacitance rate ports and coax cables for both. tions is much more. Besides, separating
and loading effect of the counter. The the counter PCB from the radio PCB
reading got then is invalid as the fre- Why it’s good for removes the luxury of pushbuttons
quency changes on the removal of the beginners? and flip-flops; which are present in the
counter. There are other radio receiver models KK-939B.
Keeping this effect in mind, it is available with more work to do (in It took me two month to under-
important to: terms of points). Fig. 14 shows an stand the operation of the counter
1. Use the 2pF capacitor. It causes example: As you can see, the number shown in Fig. 14. After all the UTC6610
minimal frequency shift due to mini- of lines is more, and more connec- learning and circuit decoding (exten-
mal capacitance effect, so that the tions have to be made in order to get sive), the KK-939 took only 17 minutes
reading obtained, and the frequency it working. But for a beginner, the KK- flat. That’s why it’s good for beginners.
after removing the counter from your 939B is a great radio with a great coun- Enjoy and have fun with your inexpen-
oscillator, don’t differ much. ter board. It has on-board flip-flops sive counter. The radio should be avail-
2. Buffer your oscillator. Buffer- that make the external connections able for Rs 250 or less. Have fun! 
ing of oscillators is very important to simple. In the case of the board shown
prevent your oscillators from being in Fig. 14, all the flip-flops are on the The author is from Manipal Institute of Technol-
affected by external components. radio PCB, so the number of connec- ogy

Statement about ownership and other particulars about


Electronics For You
FORM IV (See Rule 8)
1. Place of publication : New Delhi
2. Periodicity of its publication : Monthly
3. Printer’s Name : Ramesh Chopra
Nationality : Indian
Address : Electronics For You
D-87/1, Okhla Industrial Area,
Phase I, New Delhi 110020
4. Publisher’s Name : Same as (3) above
Nationality
and address
5. Names and addresses of : EFY Enterprises Pvt Ltd
individuals who own the D-87/1, Okhla Industrial Area,
newspaper & partners or Phase 1, New Delhi 110020
shareholders holding more
than 1% of the total capital

I, Ramesh Chopra, hereby declare that the particulars given above are true to the best of
my knowledge and belief.
Date: 28-2-2009
Ramesh Chopra
Publisher

1 1 0 • m a r c h 2 0 0 9 • e l e c t ro n i c s f o r yo u w w w. e f y m ag . co m
wireless

Bluetooth Scatternets
A Cost-Effective Solution for Communication
The most popular application of Bluetooth is communication between
two directly paired devices. Here, we explore a less popular but powerful
application of Bluetooth which can help extend the range of Bluetooth
communication and provide a free infrastructure for communication
Scatternets: A set of
piconets
When there is a collection of devices
paired with each other, it forms a
small personal area network called
‘piconet.’ A piconet consists of a mas-
ter and at most seven active slaves.
Each piconet has its own hopping se-
quence and the master and all slaves
share the same channel. In a piconet,
the master and slave devices trans-
mit packets in even and odd slots,
respectively.
Two or more piconets connected
to each other by means of a device
(called ‘bridge’) participating in both
the piconets, form a scatternet. The role
of the bridge is to transmit data across
 Ahzam Ali Bluetooth is an evolving technol- piconets. Fig. 1 shows a scatternet
ogy. It has gone through three (stand- structure in which devices ‘a’ and ‘c’

B
luetooth is a low-power, low- ardised) revisions of the approved play the master role and device ‘b’ acts
cost and short-range wireless standard by Bluetooth Special Interest as the bridge.
technology. It was originally Group (SIG), the latest one being Blue- The scatternet formation has not
developed by Ericsson for short-range tooth 2.1 EDR (enhanced data rate) in been formally defined in the Bluetooth
communication between personal early part of 2008. The latest standard SIG specifications. As a result, numer-
devices, e.g., data transfer between supports enhanced usability, i.e., pair- ous protocols have been proposed.
a cellphone and a computer, or com- ing of devices by means of near-field While modeling ad-hoc networking,
munication with a printer. Bluetooth communication (NFC), enhanced in general, is complex, the additional
devices use the unlicensed ISM band security and broader range of device restrictions imposed by the Bluetooth
at 2.4 GHz. profiles. specifications—such as low cost of
Nowadays most of the mobile de- When a number of Bluetooth de- the device, low power consumption
vices, including mobile phones, MP3 vices communicate to each other in the and network resilience while using
players, digital cameras, video cam- same vicinity, there is a high level of piconets that have a maximum of
eras, PDAs, laptop PCs, tablet PCs and interference. To combat interference, seven active nodes—have created a
so forth, are equipped with Bluetooth. Bluetooth technology applies a fast
So you can exchange data between frequency-hopping scheme which hops P1 c P2

these devices without requiring the over 79 channels 1600 times per second. a b
MASTER
use of wires. Bluetooth is considered For devices to communicate to each SLAVE
to be a high-potential technology for other using Bluetooth they need to be BRIDGE
providing wireless communication in paired with each other to have synchro-
a home-networking environment. nised frequency-hopping sequence. Fig. 1: Scatternet structure

1 1 2 • m a r c h 2 0 0 9 • e l e c t ro n i c s f o r yo u w w w. e f y m ag . co m
wireless
significant challenge. of the scatternet, it transfers its re-
sponsibilities to another device in the
Formation of scatternets scatternet.
There has been a comprehensive study There is a switching delay (called
to propose an efficient formation of con- ‘guard time’) introduced by bridges
nected scatternet. One important prob- Fig. 2: Showing efficient network after role
while they try to transmit packets
lem that exists with scatternet as well switching across the piconets. Eliminating the
as piconet formation is to keep track of unnecessary bridges from the net-
the device that comes in and goes out of work will improve the perform-
the network—since these are low-power ance of the scatternet. There exist
handheld devices with limited commu- various protocols and algorithms
nication range over Bluetooth. A device to optimise the roles that a device
connects to another device at random, assumes in a scatternet.
according to their 48-bit Bluetooth ad- We see in the following exam-
dresses and clocks, which control the ples how effective role assignment
hopping behaviour in inquiry or inquiry Fig. 3: Unnecessary bridge elimination can reduce the hop count while
scan states. Most protocols seek to re- routing a packet, help reduce
duce the scatternet formation time and packet collisions the number of bridges in the network
form fast routing algorithms. 7. Maximise the amount of data and result in an efficient scatternet
It turns out that a good scatternet throughput structure.
formation protocol should: Given a scatternet, you can evaluate In Fig. 2, the original network was
1. Be fully distributed and rely on its performance based on the number formed with ‘c’ as a bridge node and ‘a’
local information of piconets, the number of nodes per and ‘b’ as the masters on two different
2. Generate connected scatternets piconet, the number of bridge nodes, piconets p1 and p2. Using role switch-
3. Be resilient to the disconnection the number of roles per node, average ing, with the help of ‘c,’ improves the
of nodes anywhere in the scatternet traffic delay, throughput and maxi- structure of the scatternet (now formed
4. Provide multiple routes for ro- mum traffic delay. as a ‘piconet’), shortens the routing
bustness and be self-healing Numerous models have been path and eliminates the bridge delay
5. Limit the number of bridges proposed for constructing Bluetooth in the network.
6. Limit the number of roles a de- scatternets, some of which may require Fig. 3 shows another example of
vice can assume modifications to the existing Bluetooth better role switching operation that
7. Be aware of device resources specifications. results in an improved network struc-
While forming a scatternet, keep ture.
in mind that you are dealing with, in Role switching
general, small, energy- and process- Role switching enables two devices Scatternet applications
ing-power-starved devices. The fol- to exchange roles very rapidly, rather By now you might be wondering what
lowing points should be taken care of than reconnecting by executing the possible use these scatternets could be
while developing scatternet formation time-consuming inquiry and inquiry put to. Well, there are papers proposing
protocols: scan processes. The role switching voice communication between two mo-
1. Minimise scatternet construction operation involves fewer slots than the bile devices connected over a Bluetooth
time inquiry/inquiry scan and page/page scatternet, up to a distance of 100 metres
2. Minimise the amount of control scan operations in switching the roles in an indoor environment. One of the
data transmitted of the devices. popular applications developed by No-
3. Minimise the number of hops There are three major types of role kia, called ‘sensor,’ works on somewhat
required for communication between switching operations: similar principles. It lets users communi-
devices, in order to improve response 1. Combining. A situation where a cate to each other, bypassing the service
times single node works both as slave in one provider’s network, over Bluetooth.
4. Minimise power consumption. piconet and master in another. Sensor networks are another ex-
Master-and-bridge mode of operation 2. Splitting. A piconet with a large ample where the Bluetooth scatternets
requires more power than slave mode number of devices divided in two can be used. Since sensor networks are
5. Minimise the number of roles piconets with smaller number of de- generally ad-hoc, Bluetooth scatternet
assigned to nodes vices. can be used for communication of
6. Minimise the number of piconets 3. Take-over. When the existing sensors with each other and the base.
to provide faster routing and reduced mast or a bridge is about to move out This will eliminate the requirement of

w w w. e f y m ag . co m e l e c t ro n i c s f o r yo u • m a r c h 2 0 0 9 • 1 1 3
wireless
developing a special-purpose protocol for Bluetooth scatternets. Also, there that broadcast information to all Blue-
for sensor networks. are quite a few papers which discuss tooth devices in the vicinity. So users
the point of organising the scatternet will be able to pull relevant informa-
Problems to be addressed in an efficient fashion, dealing with tion from the system.
The Bluetooth scatternet formation disparate aspects of scatternet opti- 2. Topology manger. It will enable
devices are generally small, running on misation. A proposal in ‘Bluetooth better configuration of piconets and
batteries, with low-powered CPU and Scatternet Formation for Supporting even scatternets.
low memory. At the same time, these are Device Mobility,’ by Chorng-Horng 3. Alternate media access physical
highly mobile and may frequently move Yang and Yi- Sheng Chen, deals with layer. It will enable use of some other
in and out of the network. This leads us mobility support in a Bluetooth scat- wireless technology for actual data
to think about: ternet network, but relies on a Blue- transfer at higher rate while maintain-
1. Topology and size of scatternets. tooth backbone network consisting of ing the initial pairing on standard
What is the optimal number of piconets devices that are not mobile. Another Bluetooth.
in the scatternet and how many nodes work done on similar lines is ‘Tracking 4. QoS improvements. These will
are there? The number of bridge nodes the Optimal Configuration of a Blue- enable audio and video data transmis-
increases (proportionally) with the tooth Scatternet’ by Csaba Kiss Kalló sion at a higher quality.
increasing number of piconets. The in- and Carla-Fabiana Chiasserini, which Nokia and Bluetooth SIG have an-
creases, in turn, incur significant over- deals with similar problem of redefin- nounced that Wibree (Nokia’s low pow-
head: loss of one or more time slots to ing the role of nodes in scatternets but er wireless communication protocol) will
readjust clocking when shifting from concentrates on improving the energy be a part of the Bluetooth specification
one piconet to another, more traffic efficiency of the nodes. Also, there are as an ultra-low-power Bluetooth tech-
than non-bridge nodes and increased numerous proposals for routing proto- nology, to be used in caller ID watches,
battery power consumption to perform cols including MANET (mobile ad-hoc sports sensors (used for monitoring the
these tasks. network) protocols. wearer’s heart rate during exercise) as
What is the optimal number of well as medical devices. A medical de-
piconets in which a bridge should par- Future in Bluetooth vices profile and associated protocols are
ticipate? The more the piconets with The new Bluetooth specification, called being developed by the Medical Devices
which a bridge communicates, the less the Bluetooth 2.1, is already published. Working Group (MDWG).
the time during which the bridge will It is fully backward-compatible with Bluetooth 3.0. The next version of
be available for dealing with traffic 1.1. The specification includes many Bluetooth after v2.1, code-named Seat-
from/to each individual piconet, thus new security and usability enhance- tle, is proposed to adopt ultra-wide-
increasing the likelihood of bottlenecks, ments. The most interesting of these band (UWB) radio technology. This
at the bridge itself. is incorporation of the near-field will allow Bluetooth use over UWB
2. Formation delay and resilience. communication (NFC) device, which radio, enabling very fast data transfers
How much time is required to con- helps in pairing of two Bluetooth de- of up to 480 Mbps, while taking the ad-
struct, optimise and maintain the scat- vices equipped with NFC chip by just vantage of very low-power idle modes
ternet? The ad-hoc, dynamic nature of bringing them close to each other. For of Bluetooth.
a Bluetooth network requires constant example, a headset can be paired with
modifications to the scatternet topol- a Bluetooth 2.1 phone having NFC Extending the scope
ogy to support devices that join and chip just by bringing the two devices Even though work on Bluetooth scat-
leave. How to handle the nodes that close to each other. Another example ternet is going on for about a decade
join or leave the scatternets? is automatic uploading of photos from now, it has failed to generate interest
3. Polling and scheduling. In what a mobile phone to a digital picture amongst general consumer electronics
order will the slaves be polled by the frame just by bringing the phone close goods manufacturers. Bluetooth scat-
master? Does the scatternet topology to the frame. Features like this and ternets find most of their use in sensor
impact the ability to handle scheduled other security enhancements will help networks. When there is a limitation
communications from slaves in sniff or Bluetooth gain user confidence. on setting up the communication in-
hold state? A lot of work is in progress in frastructure, Bluetooth scatternet could
4. Routing. Does the scatternet topol- the area of Bluetooth, to enhance and turn out to be a cost-effective solution.
ogy allow efficient routing of messages? widen the application of Bluetooth In future, as the processing power of
protocol. In the future, we may expect electronic devices grows and they be-
Work in the area features like: come more energy-efficient, Bluetooth
There are a number of papers discuss- 1. Broadcast channels. These will might see its way into already evolving
ing the effective routing protocols enable Bluetooth information points Bluetooth standards. 

1 1 4 • m a r c h 2 0 0 9 • e l e c t ro n i c s f o r yo u w w w. e f y m ag . co m
Power Supply

Charging Lithium-Ion
Batteries
Properly restoring energy using the latest battery technology for today’s portable
products requires careful consideration. An understanding of the charging
characteristics of the battery and the application’s requirements is essential in
order to design an appropriate and reliable battery charging system.
Linear and switch-mode charging solutions for Li-ion batteries are presented
here. Also given are the guidelines and considerations that should be taken into
account when developing any battery charging system
Each application is unique, but
one common theme rings through:
maximise battery capacity usage. This
theme directly relates to how energy is
properly restored to rechargeable bat-
teries. No single method is ideal for all
applications. An understanding of the
charging characteristics of the battery
and the application’s requirements is
essential in order to design an appro-
priate and reliable battery charging
system. Each method has its associated
advantages and disadvantages.
It is the particular application
with its individual requirements that
determines which method will be the
best to use.
Far too often, the charging system
is given low priority, especially in cost-
sensitive applications. The quality of
the charging system, however, plays a
key role in the life and reliability of the
battery. In this article, the fundamen-
tals of charging Lithium-ion (Li-ion)
batteries are explored. In particular,
linear charging solutions and a micro-
controller-based, switch-mode solution
shall be explored.

Li-ion charging
The rate of charge or discharge is often
expressed in relation to the capacity of
 Scott Dearborn batteries as a prime power source is on the battery. This rate is known as the
the rise. As a result, a burden has been C-rate. The C-rate equates to a charge

P
owering today’s portable world placed on the system designer to create or discharge current and is defined as:
poses many challenges for sophisticated systems utilising the bat- I = M × Cn
system designers. The use of tery’s full potential. where ‘I’ is charge or discharge current

9 2 • M a r c h 2 0 0 9 • e l e c t ro n i c s f o r yo u w w w. e f y m ag . co m
Power Supply
current of 100 mA.
Typically, manufacturers specify
the capacity of a battery at a 5-hour
rate, n = 5. For example, the above-
mentioned battery would provide
five hours of operating time when
discharged at a constant current of
200 mA. In theory, the battery would
provide one hour of operating time
when discharged at a constant current
of 1000 mA. In practice, however, the
operating time will be less than one
hour due to inefficiencies in the dis-
charge cycle.
So how is energy properly restored
to a Li-ion battery? The preferred
charge algorithm for Li-ion battery
Fig. 1: Li-ion charge profile chemistries is a constant-current, con-
stant-voltage algorithm that can be
broken up into four stages, namely,
trickle charge, constant-current charge,
constant-voltage charge and charge
termination (refer to Fig. 1):
Stage 1 (trickle charge): Trickle
charge is employed to restore charge
to deeply depleted cells. When the cell
voltage is below approximately 3V, the
cell is charged with a constant current
of 0.1C maximum.
Stage 2 (constant-current charge):
After the cell voltage has risen above
the trickle-charge threshold, the charge
current is raised to perform constant-
current charging. The constant-current
charge should be in the 0.2C to 1.0C
range. The constant current does not
need to be precise and semi-constant
Fig. 2: Capacity loss vs undercharge voltage current is allowed. Often, in linear
chargers, the current is ramped-up as
the rated capacity in the cell voltage rises in order to mini-
Ah and ‘n’ is the time mise heat dissipation in the pass tran-
in hours at which ‘C’ sistor.
is declared. Charging at constant current rates
A battery dis- above 1C does not reduce the overall
charging at a C-rate charge cycle time and should be avoid-
of ‘1’ will deliver its ed. When charging at higher currents,
nominal rated capac- the cell voltage rises more rapidly due
ity in one hour. For to over-voltage in the electrode reac-
example, if the rated tions and the increased voltage across
capacity is 1000 mAh, the internal resistance of the cell. The
Fig. 3: Typical linear solution a discharge rate of constant-current stage becomes shorter,
1C corresponds to a but the overall charge cycle time is not
in amperes, ‘M’ is the multiple or frac- discharge current of 1000 mA. A rate reduced because the percentage of time
tion of ‘C,’ ‘C’ is the numerical value of of C/10 corresponds to a discharge in the constant voltage stage increases

9 4 • M a r c h 2 0 0 9 • e l e c t ro n i c s f o r yo u w w w. e f y m ag . co m
Power Supply
proportionately.
Stage 3 (constant voltage): Constant
current charge ends and the constant-
voltage stage is invoked when the
cell voltage reaches 4.2V. In order to
maximise performance, the voltage
regulation tolerance should be better
than 1 per cent.
Stage 4 (charge termination): Un-
like nickel-based batteries, it is not
recommended to continue to trickle-
charge Li-ion batteries. Continuing Fig. 4: Typical, fully integrated, linear solution
to trickle charge can cause plating
of metallic lithium—a condition that
makes the battery unstable. The result
can be sudden, automatic and rapid
disassembly.
Charging is typically terminated by
one of two methods: minimum charge
current or a timer (or a combination
of the two). The minimum current
approach monitors the charge cur-
rent during the constant voltage stage
and terminates the charge when the
charge current diminishes in the range
of 0.02C to 0.07C. The second method
determines when the constant voltage
stage is invoked. Charging continues
for an additional two hours, and then
the charge is terminated. Fig. 5: MCP73843 charge cycle waveforms
Charging in this manner replenish-
es a deeply depleted battery in roughly age can vary from 90Vrms to 132Vrms of 9V to 18V.
2.5 to 3 hours. for a standard wall outlet. Assuming Constant-current charge rate and
Advanced chargers employ ad- a nominal input voltage of 120Vrms, accuracy. The choice of topology for a
ditional safety features. For example, the tolerance is +10 per cent, –25 per given application may be determined
the charge is suspended if the cell tem- cent. The charger must provide proper by the desired constant current. Many
perature is outside a specified window, regulation to the battery independent high-constant-current, or multiple-cell,
typically 0°C to 45°C. of its input voltage. The input voltage applications rely on a switch-mode
to the charger will scale in accordance charging solution for improved effi-
Li-ion charging: system to the AC mains voltage and the charge ciency and less heat generation.
considerations current: Linear solutions are desirable in
A high-performance charging system VO =√2×VIN×a–1O (REQ+RPTC) – 2×VFD low to moderate fast-charge-current
is required to recharge any battery REQ is the resistance of the second- applications for their superior size and
quickly and reliably. The following ary winding plus the reflected resist- cost considerations. However, a linear
system parameters should be consid- ance of the primary winding (RP/a2), solution purposely dissipates excess
ered in order to ensure a reliable, cost- RPTC is the resistance of the PTC and power in the form of heat.
effective solution. VFD is the forward drop of the bridge The tolerance on the constant-
Input source. Many applications rectifiers. In addition, transformer-core current charge becomes extremely
use very inexpensive wall cubes for loss will slightly reduce the output important to a linear system. If the
the input supply. The output voltage voltage. regulation tolerance is loose, pass
is highly dependent on the AC input Applications that charge from a transistors and other components
voltage and the load current being car adaptor can experience a similar will need to be oversized adding size
drawn from the wall cube. problem. The output voltage of a car and cost. In addition, if the constant-
In the US, the AC mains input volt- adaptor will be typically in the range current charge is low, the complete

w w w. e f y m ag . co m e l e c t ro n i c s f o r yo u • M a r c h 2 0 0 9 • 9 5
Power Supply

Fig. 6: Switch mode SEPIC charger

9 6 • M a r c h 2 0 0 9 • e l e c t ro n i c s f o r yo u w w w. e f y m ag . co m
Power Supply
charge cycle will be extended. present. The maximum current drain
Output-voltage regulation accu- should be below a few microamperes
racy. The output-voltage regulation and, typically, below one microam-
accuracy is critical in order to obtain pere.
the desired goal: maximise the battery
capacity usage. A small decrease in Application examples
output voltage accuracy results in a Taking the above system consid-
large decrease in capacity. However, erations into account, an appropriate
the output voltage cannot be set arbi- charge management system can be
trarily high because of safety and reli- developed.
ability concerns. Linear solutions. Linear charg-
Fig. 2 depicts the importance of ing solutions are generally employed
output-voltage regulation accuracy. when a well-regulated input source
Charge termination method. It can- is available. Linear solutions, in these
not be stressed enough that over-charg- applications, offer advantages of ease
ing is the Achilles’ heal of Li-ion cells. of use, size and cost.
Accurate charge termination methods Due to the low efficiency of a
are essential for a safe, reliable, charg- linear charging solution, the most
ing system. important factor is the thermal design.
Cell temperature monitoring. The The thermal design is a direct function
temperature range over which a Li-ion of the input voltage, charge current
battery should be charged is 0°C to and thermal impedance between the
45°C, typically. Charging the battery pass transistor and the ambient cool-
at temperatures outside of this range ing air. The worst-case situation is
may cause the battery to become hot. when the device transitions from the
During a charge cycle, the pressure trickle charge stage to the constant-
inside the battery increases causing current stage. In this situation, the
the battery to swell. Temperature and pass transistor has to dissipate the
pressure are directly related. As the maximum power. A trade-off must
temperature rises, the pressure can be made between the charge current,
become excessive. This can lead to size, cost and thermal requirements of
a mechanical breakdown inside the the charging system.
battery or venting. Charging the bat- Take, for example, an application
tery outside of this temperature range required to charge a 1000mAh, single
may also harm the performance of Li-Ion cell from a 5V±5% input at a
the battery or reduce the battery’s life constant-current charge rate of 0.5C
expectance. or 1C. Fig. 3 depicts a low-cost, stan-
Generally, thermistors are included dalone linear solution. With a few
in Lithium-ion battery packs in order external components, the preferred
to accurately measure the battery charge algorithm is implemented.
temperature. The charger measures The MCP73843 combines high-accu-
the resistance value of the thermis- racy constant-current, constant-volt-
tor between the thermistor terminal age regulation with automatic charge
and the negative terminal. Charging termination.
is inhibited when the resistance, and In an effort to further reduce the
therefore the temperature, is outside size, cost and complexity of linear
the specified operating range. solutions, many of the external compo-
Battery discharge current or reverse nents can be integrated into the charge
leakage current. In many applications, management controller. Advanced
the charging system remains connected packaging and reduced flexibility
to the battery in the absence of input come along with higher integration.
power. The charging system should These packages require advanced
minimise the current drain from the equipment for manufacturing, and,
battery when input power is not in many instances, preclude rework.

w w w. e f y m ag . co m e l e c t ro n i c s f o r yo u • M a r c h 2 0 0 9 • 9 7
Power Supply
protection, high-side gate drive and
current sense, and pulsed input current
(EMI concern).
The SEPIC topology has advantag-
es that include low-side gate drive and
current sense, continuous input current
and DC isolation from input to output.
The main disadvantage of the SEPIC
topology is the use of two inductors
and an energy transfer capacitor.
Fig. 6 depicts a schematic for a
switch-mode charger. A high-speed
pulse-width modulator (PWM),
MCP1630, has been utilised in a
pseudo smart battery charger ap-
plication. The MCP1630 is a high-
Fig. 7: Switch-mode charge cycles with and without PS700, 2200mAh speed, microcontroller-adaptable,
pulse-width modulator. When used
Typically, integration encompasses designer has to make a trade-off be- in conjunction with a microcontroller,
charge-current sensing, the pass tran- tween charge time, power dissipation the MCP1630 will control the power
sistor and reverse-discharge protection. and available capacity. system duty cycle to provide output
In addition, these charge-management Switch-mode charging solutions. voltage or current regulation. The
controllers typically employ some type Switch-mode charging solutions are microcontroller, PIC16F684, can be
of thermal regulation. Thermal regula- generally employed in applications used to regulate the output voltage
tion optimises the charge cycle time that have a wide-ranging input or a or current, switching frequency and
while maintaining device reliability by high input-to-output voltage differen- maximum duty cycle. The MCP1630
limiting the charge current based on tial. In these applications, switch-mode generates duty cycle, and provides
the device die temperature. Thermal solutions have the advantage of im- fast over-current protection based
regulation greatly reduces the thermal proved efficiency. The disadvantages on various external inputs. External
design effort. are system complexity, size and cost. signals include the input oscillator,
Fig. 4 depicts a fully integrated, Take, for example, an application the reference voltage, the feedback
linear solution utilising the MCP73861. required to charge a 2200mAh, single voltage and the current sense. The
The MCP73861 incorporates all the Li-ion cell from a car adaptor at a con- output signal is a square-wave pulse.
features of the MCP73843 along with stant-current charge rate of 0.5C or 1C. The power train used for the charger
charge-current sensing, the pass tran- It would be extremely difficult to utilise is SEPIC.
sistor, reverse-discharge protection and a linear solution in this application due The microcontroller provides an
cell temperature monitoring. to the thermal issues involved. A linear enormous amount of design flexibility.
Charge-cycle waveforms. Fig. 5 de- solution employing thermal regulation In addition, it can communicate with
picts complete charge cycles utilising could be utilised, but the charge cycle a battery monitor inside the battery
the MCP73843 with constant-current times at the reduced charge currents pack to significantly reduce charge-
charge rates of 1C ad 0.5C. Charging may be prohibitive. cycle times.
at a rate of 0.5C instead of 1C takes The first step to designing a suc- Charge-cycle waveforms. Fig. 7 shows
about one hour longer for the end of cessful switch-mode charging solution complete charge cycles utilising the
charge to be reached. The MCP73843 is to choose a topology: buck, boost, switch-mode charging solution. By
scales the charge termination current buck-boost, flyback, single-ended pri- utilising a battery monitor in the
proportionately with the fast charge mary inductive converter (SEPIC) or charging system, charge cycles can
current. The result is an increase of other. Knowing the input and output be significantly reduced. The battery
36 per cent in charge time with the requirements, and experience, quickly monitor eliminates sensing the voltage
benefit of a 2 per cent gain in capacity narrows the choices down to two for produced across the pack’s protection
and reduced power dissipation. The this application: buck or SEPIC. A buck circuitry and contact resistance by the
change in termination current from converter has the advantage of requir- charging current. 
0.07C to 0.035C results in an increase ing a single inductor. Disadvantages
in final capacity from around 98 of this topology include an additional The author is principal applications engineer at
per cent to 100 per cent. The system diode required for reverse-discharge Microchip Technology Inc., Chandler, USA

9 8 • M a r c h 2 0 0 9 • e l e c t ro n i c s f o r yo u w w w. e f y m ag . co m
design
Part 1 of 3
Reading the Datasheets of
Electronic Devices
A thorough understanding of datasheets allows the designers to select the right
device for their application and subsequently exploit the potential of the device
to the fullest. Beginning this month in a series of three articles, we would focus
on how to read a datasheet and then go on to discuss the datasheets of two of
the most commonly used electronics devices representing discrete devices and
integrated circuits
 Anil Kumar Maini and
Varsha Agrawal

M
ost of the present-day electron-
ics designers and application
engineers do not find it neces-
sary to look beyond the first page of the
datasheets of the electronic components
or devices while selecting one for their
application. They consider the knowl-
edge of a few major specifications of the
device sufficient for the design exercise
that they wish to undertake. Though
it may be adequate in some cases, the
design where the components are chosen
without giving due consideration to the
information contained in the datasheet
may not be the optimal one.
The datasheet of a device reveals its
true character and hence its suitability
for a given application. In addition to
listing down the device parameters, it
gives the electrical and environmental
conditions at which these parameters Fig. 1: First page of datasheet of power Mosfet type IRF250
have been measured and also contains
information on variation of important ally available from manufacturers. The Surely, the technical data of a given
parameters as a function of other word ‘comprehensive’ is used here to device in the short-form catalogue will
relevant electrical and environmental differentiate between the datasheet of a not be as comprehensive as it would
parameters. It is vital information device found in a short-form catalogue be in the detailed catalogue. In the
particularly when you are designing a and another datasheet of the same de- condensed version, one is likely to find
circuit or a module that has to qualify vice available in the detailed version. salient features, major performance
stringent environment standards. A For example, a company manufactur- specifications, package information
comprehensive datasheet almost in- ing a range of semiconductor devices and electrical characteristics along with
variably includes application circuits may have one condensed catalogue the condition for which they are valid.
recommended by the manufacturer. containing data on all categories of On the other hand, a detailed datasheet
devices like diodes, bipolar transistors, offers a range of characteristic curves
Comprehensive and MOSFETs and thyristors that it manu- showing variation of important pa-
condensed datasheets factures. It may also offer detailed rameters as a function of other relevant
Both comprehensive as well as con- catalogues separately for each of these parameters and typical application
densed versions of datasheets are usu- categories. circuits.

1 0 0 • M a r c h 2 0 0 9 • e l e c t ro n i c s f o r yo u w w w. e f y m ag . co m
design
capability and a low ther-
mal resistance… designed
primarily for half-wave AC
power control such as motor
controls, heating controls…
(taken from the datasheet
of S2800 series SCR)… high
photosensitivity, hermeti-
cally sealed… fast optical
sensor of high-modulation
bandwidth... (taken from the
data sheet of PIN photodiode
type BPX-65)… single-pulse
avalanche energy rated, na-
nosecond switching speeds,
linear transfer characteristics,
high input impedance… well
suited for applications such
as switching regulators, mo-
tor drivers, relay drivers…
Fig. 2: Package styles of op-amp type LM741 (taken from the datasheet
of power MOSFET type
IRF250 shown in Fig. 1)” are
representative of the first
page of the datasheet of the
device. This gives designers
a fair idea of the important
features and applications
without going through the
whole datasheet.
Device package outline.
A sketch with device dimen-
sions and lead identification,
outline of the package styles
of the device and other me-
chanical information are in-
cluded in this part. Quite of-
ten a given device is made in
more than one package style
either with no difference in
performance specifications
(such as medium-power sili-
con transistor type 2N6045/
MJE6045 made in TO220AB
Fig. 3: Internal schematic of op-amp type LM741
and TO127 package styles),
or with a minor difference
Common features ing features. All datasheets begin with (such as bipolar transistor 2N2222 in
A study of the datasheets of a variety typical applications as suggested by TO-92 plastic and TO-18 metal can
of devices, be they discrete or integrat- the manufacturer and the outstanding packages), and occasionally with a
ed circuit (IC), reveals a commonality features of the device. This informa- major difference (such as IC regulator
in the type of data and characteristic tion appears on the first page of the type 78-series in TO-92 plastic, TO-220
curves. These common features are datasheet and is an essential part of and TO-3 packages).
outlined in the following paragraphs. both condensed and detailed versions. Fig. 2 shows the package options
Typical applications and outstand- Statements like “It has high dv/dt for the operational amplifier LM741.

1 0 2 • M a r c h 2 0 0 9 • e l e c t ro n i c s f o r yo u w w w. e f y m ag . co m
design

Absolute Maximum Ratings (Note 1)


If military/aerospace specified devices are required, contact the National Semiconductor Sales Office/Distributors
for availability and specifications.

LF155/6 LF256/7/LF356B LF355/6/7

Supply voltage ±22V ±22V ±18V


Differential input voltage ±40V ±40V ±30V
Input voltage range (Note 2) ±20V ±20V ±16V
Output short circuit duration Continuous Continuous Continuous
TJMAX
H-package 150°C 115°C 115°C
N-package — 100°C 100°C
M-package — 100°C 100°C
Power dissipation at TA=25°C (Notes 1, 8)
H-package (still air) 560 mW 400 mW 400 mW
H-package (400 LF/min air flow) 1200 mW 1000 mW 1000 mW
N-package — 670 mW 670 mW
M-package — 380 mW 380 mW
Thermal resistance (typical) θJA
H-package (still air) 160°C/W 160°C/W 160°C/W
H-package (400 LF/min air flow) 65°C/W 65°C/W 65°C/W
N-package — 130°C/W 130°C/W
M-package — 195°C/W 195°C/W
(Typical) θJC
H-package 23°C/W 23°C/W 23°C/W
Storage temperature range –65°C to +150°C –65°C to +150°C –65°C to +150°C
Soldering information (lead temp.)
Metal can package
Soldering (10 sec.) 300°C 300°C 300°C
Dual-in-line package
Soldering (10 sec.) 260°C 260°C 260°C
Small outline package
Vapour phase (60 sec.) — 215°C 215°C
Infrared (15 sec.) — 220°C 220°C
See AN-450 ‘Surface Mounting Methods and Their Effect on Product Reliability’ for other methods of soldering
surface mount devices.
ESD tolerance
(100 pF discharged through 1.5kΩ) 1000V 1000V 1000V
Absolute maximum ratings tell the designer the conditions that will damage the device. Remember these are
not maximum operating limits

Fig. 4: Absolute maximum ratings for op-amp type LF156/256/356

As you can see from the figure, it is architecture. This sometimes helps the
available in three packages, namely, designer to explain the device behav-
the metal can package, dual-in-line iour that is otherwise not described in
package and ceramic flatpak pack- the datasheet.
age. Absolute maximum ratings. Abso-
Schematic diagram. Detailed sche- lute maximum ratings (Fig. 4) contain
matic of the internal structure of the information on voltages, currents, pow-
device is also given in the datasheet. ers and temperature range that should
Fig. 3 shows the internal schematic of never be exceeded. As is evident from
operational amplifier LM741. It helps the figure, the maximum supply volt-
the designer to correlate the electrical age for operational amplifier LF356 is
features of the device with its internal ±18V.

w w w. e f y m ag . co m e l e c t ro n i c s f o r yo u • M a r c h 2 0 0 9 • 1 0 3
design

Fig. 5: Performance curves of diodes 1N4001 to 1N4007

Performance curves. Perform- characteristics of the device, such characteristics) in the case of FETs,
ance curves of interest as a function as drain current versus drain volt- emitter voltage versus emitter cur-
of voltage, current, temperature, age (drain characteristics) or drain rent in the case of UJTs and forward
etc follow next. These include the current versus gate voltage (transfer voltage versus forward current in the

1 0 4 • M a r c h 2 0 0 9 • e l e c t ro n i c s f o r yo u w w w. e f y m ag . co m
design
case of diodes. Fig. 5 shows the char- to 1N4007. ode current changes with temperature.
acteristics curves for diodes 1N4001 It could also be variation of the cath- The curve in the second illustration
ode voltage vs cathode indicates critical dependence of the
current as a function of dark current of the PIN photodiode
temperature (Fig. 6) in on the applied reverse bias voltage.
the case of a thyristor, or And the third demonstrates significant
dark current as a func- reduction in the transconductance of the
tion of applied reverse MOSFET at a fixed drain current with
bias in the case of a PIN increase in temperature. These are all
photodiode, or transcon- very important aspects of design and
ductance versus drain therefore should not be side-stepped.
current as a function of Electrical characteristics. Electri-
temperature in the case cal characteristics are usually given
of power MOSFET. The in tabular form indicating spread
curve in the first case in parameter values that is likely to
emphasises that the re- occur in a batch of devices in terms
Fig. 6: Thyristor-cathode voltage vs. cathode current for different
lationship between the of minimum, typical and maximum
temperatures cathode voltage and cath- values. It is a vital design input as in

Fig. 7: Electrical characteristics of Mosfet type number IRF250

w w w. e f y m ag . co m e l e c t ro n i c s f o r yo u • M a r c h 2 0 0 9 • 1 0 5
cONSTRUCTION

Microcontroller-Based
Ring Tone Player sunil ku
mar

 Subhajit Roy frequency.


A cylindrical air column with both

M
obile phone ring tones sound ends open vibrates with a fundamental So λ =2L1
like real audio recordings. frequency. Each end of the column Frequency n1 = V/λ (where ‘V’ is
It’s not because of the way must be an antinode, with one node at the velocity of sound)
the melodies are composed, but the the centre for By putting the value of ‘λ,’ we get:
protocol behind playing the melody. the air motion. n1 = V/2L1
The ring tone text transfer language Therefore if If length is half, then:
(RTTTL) is behind those wonderful ‘λ’ is the wave- Frequency n2 = V/L1
lullabies and songs you have on your length of the n1/n2 = (V/2L1) × (L1/V) = 1/2
mobile phone. sound pro- or n1 = 2n2
Basically, a ring tone is the sound duced by an Thus halving the length doubles
made by a mobile phone to indicate an open cylindri- the frequency, i.e., frequency n1 is cre-
incoming call or text message. Here we cal air column, ated with one octave higher (2n1).
present a microcontroller-based ring its length ‘L1’ If the length is made quarter of the
tone generator. Fig. 1: Fundamental
frequency vibration in an
will be: original, the frequency becomes 4n1,
open air column L1 = λ/2 (λ/4+ i.e., two octaves higher.
The basics λ/4) If n1 is octave 1, then
The lowest resonant frequency of a vi- n2 is octave 2,
brating object is called its fundamental then
frequency. Most vibrating objects have n3 is octave 3,
more than one resonant frequency and and so on.
those used in musical instruments If the length is
typically vibrate at harmonics of the doubled, the fre-
fundamental. A harmonic is defined as quency is halved.
an integer multiple of the fundamental That is, the fre-
Fig. 2: PWM signal, where Ts1, ts1 and D1 are the time period, half time
period and duration of note 1, while Ts2, ts2 and D2 are the time period, half
quency becomes
Parts List time period and duration of note 2 n1/2, which is one
Semiconductors: octave lower.
IC1 - AT89C51 microcontroller In music, fre-
IC2 - 7805, 5V regulator Table I quency n1 is called a
T1 - BC337 npn transistor Nokia RTTL Frequencies (Hz) note. The pitch of a
D1-D4 - 1N4007 rectifier diode
LED1 - 5mm LED (For Octave 4 to Octave 7) piano key or guitar
Resistors (all ¼-watt, ±5% carbon): No. Octave=4 Octave=5 Octave=6 Octave=7 string is described
R1 - 330-ohm by the note.
1 A 220.000 440.000 880.000 1,760.000
R2 - 8.2-kilo-ohm According to
R3 - 10-kilo-ohm
2 A# 233.082 466.164 932.328 1,864.655
musical frequency
R4 - 1-kilo-ohm 3 B 246.942 493.883 987.767 1,975.533
conventions, there
Capacitors: 4 C 261.626 523.251 1,046.502 2,093.005
are twelve notes in
C1 - 1000µF, 25V electrolytic 5 C# 277.183 554.365 1,108.731 2,217.461
C2, C6 - 0.1µF ceramic disk
all, namely, A, A#,
6 D 293.665 587.330 1,174.659 2,349.318
C3 - 10µF, 16V electrolytic B, C, C#, D, D#, E, F,
7 D# 311.127 622.254 1,244.508 2,489.016
C4, C5 - 22pF ceramic disk F#, G and G#, where
8 E 329.628 659.255 1,318.510 2,637.020
Miscellaneous: ‘# ‘sign indicates a
9 F 349.228 698.456 1,396.913 2,793.826
X1 - 220V AC primary to 9V, sharp note.
500mA transformer 10 F# 369.994 739.989 1,479.978 2,959.955
According to
XTAL - 11.0592MHz crystal 11 G 391.995 783.991 1,567.982 3,135.963 Nokia RTTTL spec-
LS1 - 8-ohm, 1W speaker
12 G# 415.305 830.609 1,661.219 3,322.438 ifications, note A

5 2 • M a r c h 2 0 0 9 • e l e c t ro n i c s f o r yo u w w w. e f y m ag . co m
cONSTRUCTION

Table II
Values in Hex to be Loaded to Timer 1 (Oscillator Frequency 11.0592 MHz)
Notes a a# b c c# d d# e f f# g g#
Octave 4: A4=220 Hz F7D1 F847 F8B6 F91F F982 F9DF FA37 FA8A FAD9 FB23 FB68 FBAA
Octave 5: A5=440 Hz FBE9 FC23 FC58 FC8F FCC1 FCEF FD1B FD45 FD6C FD91 FDB4 FDD5
Octave 6: A6=880 Hz FDF4 FE12 FE2D FE48 FE60 FE78 FE8E FEA3 FEB6 FEC9 FEDA FEEB
Octave 7: A7=1.76 kHz FEFA FF09 FF17 FF24 FF30 FF3C FF47 FF51 FF5B FF64 FF6D FF75
Octave 8: A8=3.52 kHz FF7D FF44 FF8B FF92 FF98 FF9E FFA3 FFA9 FFAE FFB2 FFB7 FFBB

is not specified
for a particu-
lar note, the
default values
are assumed.
After get-
ting the notes,
you must
calculate the
duration for
which a note is
to be played:
Number
of notes per
second to be
played (N) =
60/beats per
minute (b)
=60/125
Net dura-
Fig. 3: Circuit of microcontroller-based ringtone generator tion D in sec-
onds for which
with octave 5 has a frequency of 440 32p, 32c, 32p, 8d, 32p, 8c, 32p, 8g, 32p, a note is to be played = No. of notes
Hz (refer Table I): f, 8p, 16c, 32p, 32c, 32p, 8c6, 32p, 8a, per second × (Default note duration)/
A5 = 440 Hz 32p, 8f, 32p, 8e, 32p, 8d, 32p, 16a#, 32p, (Duration specified for the current
So we get: 32a#, 32p, 8a, 32p, 8f, 32p, 8g, 32p note)
A6 = 880 Hz (A5x2) 1. The first section is the name of = N×d/dn
A7 = 1760 Hz (A6x2) the RTTTL melody, i.e., ‘Happy Birth- = (60/125) ×(4/8)
The space between two consecutive day Song.’ = 30/125
octaves like A5 and A6 is divided into 2. The second section defines the So to play music, all you need to
eleven equally spaced parts on the log- default values for the file. There are do is to get the RTTTL ring tone of the
arithmic scale. Thus there are twelve three categories of default values: du- particular music, then read its note and
equally spaced notes per octave: A5, ration (d=4), octave (o=5) and beat per generate the frequency for the calcu-
A#5, B5, C5, C#5, D5, D#5, E5, F5, F#5, minute (b=125). lated duration (D).
G5, G#5 and then A6 starts. 3. The third section describes the “If the note is dotted; for example,
RTTTL is a simple text-based for- melody. ‘2b’ (here ‘b’ denotes note, not beats
mat that you can use to create ring It is a set of notes separated by a per second), the duration is made 1.5
tones. An RTTTL file is made up of a comma. The notes are given in the fol- times, so that D=1.5D.”
single string divided into three sections lowing format: Generation of PWM frequency.
separated by colons (:). Duration (dn) Note Octave Since we are dealing with digital
In the example of a Happy Birthday 8 c 6 systems, we need to generate PWM
song given below: where ‘dn’ is the duration of the (pulse-width-modulated) signals from
d=4, o=5, b=125:16c, 32p, 32c, 32p, present note. port pin P2.0 of the microcontrol-
8d, 32p, 8c, 32p, 8f, 32p, e, 16p, 16c, If either the duration (dn) or octave ler. A PWM signal consists of ‘high’

5 4 • M a r c h 2 0 0 9 • e l e c t ro n i c s f o r yo u w w w. e f y m ag . co m
cONSTRUCTION
period calculation as follows:
1. Timer 0 for calculating
the duration (D)
2. Timer 1 for calculating
the half time period (ts)
The CPU takes certain
number of clock cycles to ex-
ecute an instruction. The sim-
plest instruction takes a single
byte of code and executes in
one machine cycle. The stand-
ard 8051 machine cycle is equal
to twelve oscillator cycles.
We have used a 11.0592MHz
Fig. 4: Actual-size, single-side PCB for the microcontroller-
crystal.
based ring tone generator So time period =
1/(11.0592×106) = 0.0904 µs
Time period of a machine
cycle = 0.0905×12 = 1.085 µs
Timer 0. Timer 0 is a 16-bit
timer that is used for dura-
tion ‘D.’ It is loaded with
value DC00H. Therefore the
number of machine cycles
taken by the timer before it is
reset=FFFF–DC00+1=2400H=
9216 in decimal.
Therefore time taken ‘t’
= 9216×1.085 µs
= 0.001 second
So after timer 0 is set, it will
take 0.001 second to reset.
Fig. 5: Component layout for the PCB For 1-second duration,
the timer needs to be set
(P2.0 = 1) and ‘low’ (P2.0 = 0), i.e., the 1/0.001=100 times.
bit remains ‘high’ for a certain period For duration ‘D,’ timer 0 needs to
of time and ‘low’ for the same period be set Dx100 times.
of time (refer Fig. 2). Timer 1. The half time period is
Time period of the note (Ts) = ‘ts.’
1/frequency of note Therefore the number of machine
Therefore, cycles needed = ts/1.085 µs
Duration of ‘high’ bit (time for If the value of the timer is ‘x,’ then
which P2.0 is ‘1’)= Ts/2 = ts1 (half-time FFFF–x+1 = ts/(1.085x10-6)
period) From this equation, the value of ‘x’
Duration of ‘low’ bit (time for can be calculated.
which P2.0 is ‘0’)= Ts/2 = ts1 (half-time 1’s and 0’s are continuously gener-
period) ated from port pin P2.0 at an interval
So you need to use two timers for of ‘ts’ seconds alternatively until dura-
duration D and half-time period ‘ts.’ tion ‘D’ (in seconds) completes (refer
Use one timer to generate 1’s and 0’s Table II).
at a time interval of ‘ts’ and the other
timer to interrupt the PWM signal after Circuit description
time interval D. Fig. 3 shows the circuit of the micro-
We have used two timers for time- controller-based ring tone generator.

5 6 • M a r c h 2 0 0 9 • e l e c t ro n i c s f o r yo u w w w. e f y m ag . co m
cONSTRUCTION
At the heart of the circuit is microcon- filtered by capacitor C1 and regu- This process continues until the end
troller AT89C51. It is a low-power, lated by IC 7805 (IC2). Capacitor C2 of music data is reached. Thereafter,
high-performance, 8-bit microcontrol- bypasses the ripples present in the it starts playing the music from the
ler with 4kB Flash programmable and regulated power supply. LED1 acts beginning.
erasable read-only memory. It has 128 as the power-‘on’ indicator and re- Nokia RTTTL ringtones can be
bytes of RAM, 32 input/output (I/O) sistor R1 limits the current through downloaded from the following web-
lines, two 16-bit timers/counters, a LED1. sites:
five-vector two-level interrupt archi- An actual-size, single-side PCB for 1. http://www.2thumbswap.
tecture, on-chip oscillator and clock the microcontroller-based ring tone com/members/tones/nokia/tones_
circuitry. generator is shown in Fig. 4 and its nokia_latest.html
The 11.0592MHz crystal provides component layout in Fig. 5. 2. http://nokiatone.ifrance.com/
the basic clock frequency to the mi- nokiatone/rtttf.htm
crocontroller. Port pin P2.0 of the Software 3. http://ringtones.frostzone.com/
microcontroller provides the ring The program plays “happy birthday index.htm
tone melody signal for speaker LS1. to you” in RTTTL ring tone format 4. http://arcadetones.emuunlim.
Transistor BC337 is used for amplifica- using the microcontroller AT89C51. com/files.htm
tion. The power-‘on’ reset signal for The source program, written in As- RTTL ringtones can also be tested
the microcontroller is generated by sembly language and assembled us- on the computer, the software for
the combination of capacitor C3 and ing assembler ASM51, is self-explana- which can be downloaded from the
resistor R2. Switch S1 provides manual tory and easy to understand. link ‘http://arcadetones.emuunlim.
reset to the microcontroller. Initialise timer 0 and timer 1 as com/files/nokring_full.zip.’
The 230V AC mains is stepped 16-bit timers with predetermined (Refer “A Cell Phone Player Em-
down by transformer X1 to deliver value. When you start timer 0, the data bedded in Microcontroller” by Manoel
the secondary output of 9V, 500 pointer register is loaded with memory Gomes de Andrade for details.)
mA. The transformer output is recti- address labeled as ‘SONG.’ After play- EFY note. The source code and other
fied by a full-wave bridge rectifier ing the current note, the control jumps relevant files of this article are included
comprising diodes D1 through D4, to the next note and it starts playing. in this month’s EFY-CD.

ringtones.asm
$mod51 RET DB 1,24,0FDH,06CH
FLAG EQU 07FH PLAY_NOTE: DB 0,6,0,0
SPEAKER EQU P2.0 CONTINUE: DB 1,48,0FDH,045H
BEGIN: CLR A DB 0,12,0,0
ORG 0000H MOVC A,@A+DPTR DB 1,12,0FCH,08FH
AJMP MAIN MOV R0,A DB 0,6,0,0
INC DPTR DB 1,6,0FCH,08FH
ISR: CLR A DB 0,6,0,0
ORG 000BH MOVC A,@A+DPTR DB 1,24,0FCH,0EFH
LCALL ACTION MOV R1,A DB 0,6,0,0
RETI INC DPTR DB 1,24,0FCH,08FH
ORG 0050H CLR A DB 0,6,0,0
MAIN: MOVC A,@A+DPTR DB 1,24,0FDH,0B4H
MOV TMOD,#00010001B ; MOV R2,A DB 0,6,0,0
MOV IE,#82H ; INC DPTR DB 1,48,0FDH,06CH
MOV TH0,#0DCH CLR A DB 0,24,0,0
MOV TL0,#00H MOVC A,@A+DPTR DB 1,12,0FCH,08FH
SETB TR0 MOV R3,A DB 0,6,0,0
MOV DPTR,#SONG INC DPTR DB 1,6,0FCH,08FH
MOV R0,#02 RET DB 0,6,0,0
LOOP1: ACTION: DB 1,24,0FEH,048H
ACALL PLAY_NOTE CLR TR0 DB 0,6,0,0
CJNE R0,#02,CARRY_ON CJNE R1,#0,DO2 DB 1,24,0FBH,0E9H
SJMP MAIN ;end of mu- CLR FLAG DB 0,6,0,0
sic has been detected so start again SJMP DO3 DB 1,24,0FDH,06CH
CARRY_ON: DO2: DEC R1 DB 0,6,0,0
ACALL PLAY DO3: DB 1,24,0FDH,045H
SJMP LOOP1 MOV TH0,#0DCH DB 0,6,0,0
PLAY: MOV TL0,#00H DB 1,24,0FCH,0EFH
CLR EA SETB TR0 DB 0,6,0,0
SETB FLAG RET DB 1,12,0FCH,023H
SETB EA SONG: ; HAPPY BIRTHDAY DB 0,6,0,0
RUN: JNB FLAG,STOP ; R0 R1 R2 R3 DB 1,6,0FCH,023H
DO: CJNE R0,#0,START DB 0,6,0,0
SJMP RUN DB 1, 12, 0FCH, 08FH ;R0=1 DB 1,24,0FBH,0E9H
START: MOV TH1,R2 indicates there is a note to played DB 0,6,0,0
MOV TL1,R3 DB 0,6,0,0 ;R0=0 DB 1,24,0FDH,06CH
SETB TR1 indicates there is no note to be played DB 0,6,0,0
HERE: JNB TF1,HERE DB 1,6,0FCH,08FH DB 1,24,0FDH,0B4H
CLR TF1 DB 0,6,0,0 DB 0,6,0,0
CLR TR1 DB 1,24,0FCH,0EFH DB 1,48,0FDH,06CH
CPL SPEAKER DB 0,6,0,0 DB 2,0,0,0 ;R0=2 indicates
SJMP RUN DB 1,24,0FCH,08FH end of music
STOP: CLR SPEAKER DB 0,6,0,0 END 

5 8 • M a r c h 2 0 0 9 • e l e c t ro n i c s f o r yo u w w w. e f y m ag . co m
cONSTRUCTION

Microcontroller-Based
Ring Tone Player sunil ku
mar

 Subhajit Roy frequency.


A cylindrical air column with both

M
obile phone ring tones sound ends open vibrates with a fundamental So λ =2L1
like real audio recordings. frequency. Each end of the column Frequency n1 = V/λ (where ‘V’ is
It’s not because of the way must be an antinode, with one node at the velocity of sound)
the melodies are composed, but the the centre for By putting the value of ‘λ,’ we get:
protocol behind playing the melody. the air motion. n1 = V/2L1
The ring tone text transfer language Therefore if If length is half, then:
(RTTTL) is behind those wonderful ‘λ’ is the wave- Frequency n2 = V/L1
lullabies and songs you have on your length of the n1/n2 = (V/2L1) × (L1/V) = 1/2
mobile phone. sound pro- or n1 = 2n2
Basically, a ring tone is the sound duced by an Thus halving the length doubles
made by a mobile phone to indicate an open cylindri- the frequency, i.e., frequency n1 is cre-
incoming call or text message. Here we cal air column, ated with one octave higher (2n1).
present a microcontroller-based ring its length ‘L1’ If the length is made quarter of the
tone generator. Fig. 1: Fundamental
frequency vibration in an
will be: original, the frequency becomes 4n1,
open air column L1 = λ/2 (λ/4+ i.e., two octaves higher.
The basics λ/4) If n1 is octave 1, then
The lowest resonant frequency of a vi- n2 is octave 2,
brating object is called its fundamental then
frequency. Most vibrating objects have n3 is octave 3,
more than one resonant frequency and and so on.
those used in musical instruments If the length is
typically vibrate at harmonics of the doubled, the fre-
fundamental. A harmonic is defined as quency is halved.
an integer multiple of the fundamental That is, the fre-
Fig. 2: PWM signal, where Ts1, ts1 and D1 are the time period, half time
period and duration of note 1, while Ts2, ts2 and D2 are the time period, half
quency becomes
Parts List time period and duration of note 2 n1/2, which is one
Semiconductors: octave lower.
IC1 - AT89C51 microcontroller In music, fre-
IC2 - 7805, 5V regulator Table I quency n1 is called a
T1 - BC337 npn transistor Nokia RTTL Frequencies (Hz) note. The pitch of a
D1-D4 - 1N4007 rectifier diode
LED1 - 5mm LED (For Octave 4 to Octave 7) piano key or guitar
Resistors (all ¼-watt, ±5% carbon): No. Octave=4 Octave=5 Octave=6 Octave=7 string is described
R1 - 330-ohm by the note.
1 A 220.000 440.000 880.000 1,760.000
R2 - 8.2-kilo-ohm According to
R3 - 10-kilo-ohm
2 A# 233.082 466.164 932.328 1,864.655
musical frequency
R4 - 1-kilo-ohm 3 B 246.942 493.883 987.767 1,975.533
conventions, there
Capacitors: 4 C 261.626 523.251 1,046.502 2,093.005
are twelve notes in
C1 - 1000µF, 25V electrolytic 5 C# 277.183 554.365 1,108.731 2,217.461
C2, C6 - 0.1µF ceramic disk
all, namely, A, A#,
6 D 293.665 587.330 1,174.659 2,349.318
C3 - 10µF, 16V electrolytic B, C, C#, D, D#, E, F,
7 D# 311.127 622.254 1,244.508 2,489.016
C4, C5 - 22pF ceramic disk F#, G and G#, where
8 E 329.628 659.255 1,318.510 2,637.020
Miscellaneous: ‘# ‘sign indicates a
9 F 349.228 698.456 1,396.913 2,793.826
X1 - 220V AC primary to 9V, sharp note.
500mA transformer 10 F# 369.994 739.989 1,479.978 2,959.955
According to
XTAL - 11.0592MHz crystal 11 G 391.995 783.991 1,567.982 3,135.963 Nokia RTTTL spec-
LS1 - 8-ohm, 1W speaker
12 G# 415.305 830.609 1,661.219 3,322.438 ifications, note A

5 2 • M a r c h 2 0 0 9 • e l e c t ro n i c s f o r yo u w w w. e f y m ag . co m
cONSTRUCTION

Table II
Values in Hex to be Loaded to Timer 1 (Oscillator Frequency 11.0592 MHz)
Notes a a# b c c# d d# e f f# g g#
Octave 4: A4=220 Hz F7D1 F847 F8B6 F91F F982 F9DF FA37 FA8A FAD9 FB23 FB68 FBAA
Octave 5: A5=440 Hz FBE9 FC23 FC58 FC8F FCC1 FCEF FD1B FD45 FD6C FD91 FDB4 FDD5
Octave 6: A6=880 Hz FDF4 FE12 FE2D FE48 FE60 FE78 FE8E FEA3 FEB6 FEC9 FEDA FEEB
Octave 7: A7=1.76 kHz FEFA FF09 FF17 FF24 FF30 FF3C FF47 FF51 FF5B FF64 FF6D FF75
Octave 8: A8=3.52 kHz FF7D FF44 FF8B FF92 FF98 FF9E FFA3 FFA9 FFAE FFB2 FFB7 FFBB

is not specified
for a particu-
lar note, the
default values
are assumed.
After get-
ting the notes,
you must
calculate the
duration for
which a note is
to be played:
Number
of notes per
second to be
played (N) =
60/beats per
minute (b)
=60/125
Net dura-
Fig. 3: Circuit of microcontroller-based ringtone generator tion D in sec-
onds for which
with octave 5 has a frequency of 440 32p, 32c, 32p, 8d, 32p, 8c, 32p, 8g, 32p, a note is to be played = No. of notes
Hz (refer Table I): f, 8p, 16c, 32p, 32c, 32p, 8c6, 32p, 8a, per second × (Default note duration)/
A5 = 440 Hz 32p, 8f, 32p, 8e, 32p, 8d, 32p, 16a#, 32p, (Duration specified for the current
So we get: 32a#, 32p, 8a, 32p, 8f, 32p, 8g, 32p note)
A6 = 880 Hz (A5x2) 1. The first section is the name of = N×d/dn
A7 = 1760 Hz (A6x2) the RTTTL melody, i.e., ‘Happy Birth- = (60/125) ×(4/8)
The space between two consecutive day Song.’ = 30/125
octaves like A5 and A6 is divided into 2. The second section defines the So to play music, all you need to
eleven equally spaced parts on the log- default values for the file. There are do is to get the RTTTL ring tone of the
arithmic scale. Thus there are twelve three categories of default values: du- particular music, then read its note and
equally spaced notes per octave: A5, ration (d=4), octave (o=5) and beat per generate the frequency for the calcu-
A#5, B5, C5, C#5, D5, D#5, E5, F5, F#5, minute (b=125). lated duration (D).
G5, G#5 and then A6 starts. 3. The third section describes the “If the note is dotted; for example,
RTTTL is a simple text-based for- melody. ‘2b’ (here ‘b’ denotes note, not beats
mat that you can use to create ring It is a set of notes separated by a per second), the duration is made 1.5
tones. An RTTTL file is made up of a comma. The notes are given in the fol- times, so that D=1.5D.”
single string divided into three sections lowing format: Generation of PWM frequency.
separated by colons (:). Duration (dn) Note Octave Since we are dealing with digital
In the example of a Happy Birthday 8 c 6 systems, we need to generate PWM
song given below: where ‘dn’ is the duration of the (pulse-width-modulated) signals from
d=4, o=5, b=125:16c, 32p, 32c, 32p, present note. port pin P2.0 of the microcontrol-
8d, 32p, 8c, 32p, 8f, 32p, e, 16p, 16c, If either the duration (dn) or octave ler. A PWM signal consists of ‘high’

5 4 • M a r c h 2 0 0 9 • e l e c t ro n i c s f o r yo u w w w. e f y m ag . co m
cONSTRUCTION
period calculation as follows:
1. Timer 0 for calculating
the duration (D)
2. Timer 1 for calculating
the half time period (ts)
The CPU takes certain
number of clock cycles to ex-
ecute an instruction. The sim-
plest instruction takes a single
byte of code and executes in
one machine cycle. The stand-
ard 8051 machine cycle is equal
to twelve oscillator cycles.
We have used a 11.0592MHz
Fig. 4: Actual-size, single-side PCB for the microcontroller-
crystal.
based ring tone generator So time period =
1/(11.0592×106) = 0.0904 µs
Time period of a machine
cycle = 0.0905×12 = 1.085 µs
Timer 0. Timer 0 is a 16-bit
timer that is used for dura-
tion ‘D.’ It is loaded with
value DC00H. Therefore the
number of machine cycles
taken by the timer before it is
reset=FFFF–DC00+1=2400H=
9216 in decimal.
Therefore time taken ‘t’
= 9216×1.085 µs
= 0.001 second
So after timer 0 is set, it will
take 0.001 second to reset.
Fig. 5: Component layout for the PCB For 1-second duration,
the timer needs to be set
(P2.0 = 1) and ‘low’ (P2.0 = 0), i.e., the 1/0.001=100 times.
bit remains ‘high’ for a certain period For duration ‘D,’ timer 0 needs to
of time and ‘low’ for the same period be set Dx100 times.
of time (refer Fig. 2). Timer 1. The half time period is
Time period of the note (Ts) = ‘ts.’
1/frequency of note Therefore the number of machine
Therefore, cycles needed = ts/1.085 µs
Duration of ‘high’ bit (time for If the value of the timer is ‘x,’ then
which P2.0 is ‘1’)= Ts/2 = ts1 (half-time FFFF–x+1 = ts/(1.085x10-6)
period) From this equation, the value of ‘x’
Duration of ‘low’ bit (time for can be calculated.
which P2.0 is ‘0’)= Ts/2 = ts1 (half-time 1’s and 0’s are continuously gener-
period) ated from port pin P2.0 at an interval
So you need to use two timers for of ‘ts’ seconds alternatively until dura-
duration D and half-time period ‘ts.’ tion ‘D’ (in seconds) completes (refer
Use one timer to generate 1’s and 0’s Table II).
at a time interval of ‘ts’ and the other
timer to interrupt the PWM signal after Circuit description
time interval D. Fig. 3 shows the circuit of the micro-
We have used two timers for time- controller-based ring tone generator.

5 6 • M a r c h 2 0 0 9 • e l e c t ro n i c s f o r yo u w w w. e f y m ag . co m
cONSTRUCTION
At the heart of the circuit is microcon- filtered by capacitor C1 and regu- This process continues until the end
troller AT89C51. It is a low-power, lated by IC 7805 (IC2). Capacitor C2 of music data is reached. Thereafter,
high-performance, 8-bit microcontrol- bypasses the ripples present in the it starts playing the music from the
ler with 4kB Flash programmable and regulated power supply. LED1 acts beginning.
erasable read-only memory. It has 128 as the power-‘on’ indicator and re- Nokia RTTTL ringtones can be
bytes of RAM, 32 input/output (I/O) sistor R1 limits the current through downloaded from the following web-
lines, two 16-bit timers/counters, a LED1. sites:
five-vector two-level interrupt archi- An actual-size, single-side PCB for 1. http://www.2thumbswap.
tecture, on-chip oscillator and clock the microcontroller-based ring tone com/members/tones/nokia/tones_
circuitry. generator is shown in Fig. 4 and its nokia_latest.html
The 11.0592MHz crystal provides component layout in Fig. 5. 2. http://nokiatone.ifrance.com/
the basic clock frequency to the mi- nokiatone/rtttf.htm
crocontroller. Port pin P2.0 of the Software 3. http://ringtones.frostzone.com/
microcontroller provides the ring The program plays “happy birthday index.htm
tone melody signal for speaker LS1. to you” in RTTTL ring tone format 4. http://arcadetones.emuunlim.
Transistor BC337 is used for amplifica- using the microcontroller AT89C51. com/files.htm
tion. The power-‘on’ reset signal for The source program, written in As- RTTL ringtones can also be tested
the microcontroller is generated by sembly language and assembled us- on the computer, the software for
the combination of capacitor C3 and ing assembler ASM51, is self-explana- which can be downloaded from the
resistor R2. Switch S1 provides manual tory and easy to understand. link ‘http://arcadetones.emuunlim.
reset to the microcontroller. Initialise timer 0 and timer 1 as com/files/nokring_full.zip.’
The 230V AC mains is stepped 16-bit timers with predetermined (Refer “A Cell Phone Player Em-
down by transformer X1 to deliver value. When you start timer 0, the data bedded in Microcontroller” by Manoel
the secondary output of 9V, 500 pointer register is loaded with memory Gomes de Andrade for details.)
mA. The transformer output is recti- address labeled as ‘SONG.’ After play- EFY note. The source code and other
fied by a full-wave bridge rectifier ing the current note, the control jumps relevant files of this article are included
comprising diodes D1 through D4, to the next note and it starts playing. in this month’s EFY-CD.

ringtones.asm
$mod51 RET DB 1,24,0FDH,06CH
FLAG EQU 07FH PLAY_NOTE: DB 0,6,0,0
SPEAKER EQU P2.0 CONTINUE: DB 1,48,0FDH,045H
BEGIN: CLR A DB 0,12,0,0
ORG 0000H MOVC A,@A+DPTR DB 1,12,0FCH,08FH
AJMP MAIN MOV R0,A DB 0,6,0,0
INC DPTR DB 1,6,0FCH,08FH
ISR: CLR A DB 0,6,0,0
ORG 000BH MOVC A,@A+DPTR DB 1,24,0FCH,0EFH
LCALL ACTION MOV R1,A DB 0,6,0,0
RETI INC DPTR DB 1,24,0FCH,08FH
ORG 0050H CLR A DB 0,6,0,0
MAIN: MOVC A,@A+DPTR DB 1,24,0FDH,0B4H
MOV TMOD,#00010001B ; MOV R2,A DB 0,6,0,0
MOV IE,#82H ; INC DPTR DB 1,48,0FDH,06CH
MOV TH0,#0DCH CLR A DB 0,24,0,0
MOV TL0,#00H MOVC A,@A+DPTR DB 1,12,0FCH,08FH
SETB TR0 MOV R3,A DB 0,6,0,0
MOV DPTR,#SONG INC DPTR DB 1,6,0FCH,08FH
MOV R0,#02 RET DB 0,6,0,0
LOOP1: ACTION: DB 1,24,0FEH,048H
ACALL PLAY_NOTE CLR TR0 DB 0,6,0,0
CJNE R0,#02,CARRY_ON CJNE R1,#0,DO2 DB 1,24,0FBH,0E9H
SJMP MAIN ;end of mu- CLR FLAG DB 0,6,0,0
sic has been detected so start again SJMP DO3 DB 1,24,0FDH,06CH
CARRY_ON: DO2: DEC R1 DB 0,6,0,0
ACALL PLAY DO3: DB 1,24,0FDH,045H
SJMP LOOP1 MOV TH0,#0DCH DB 0,6,0,0
PLAY: MOV TL0,#00H DB 1,24,0FCH,0EFH
CLR EA SETB TR0 DB 0,6,0,0
SETB FLAG RET DB 1,12,0FCH,023H
SETB EA SONG: ; HAPPY BIRTHDAY DB 0,6,0,0
RUN: JNB FLAG,STOP ; R0 R1 R2 R3 DB 1,6,0FCH,023H
DO: CJNE R0,#0,START DB 0,6,0,0
SJMP RUN DB 1, 12, 0FCH, 08FH ;R0=1 DB 1,24,0FBH,0E9H
START: MOV TH1,R2 indicates there is a note to played DB 0,6,0,0
MOV TL1,R3 DB 0,6,0,0 ;R0=0 DB 1,24,0FDH,06CH
SETB TR1 indicates there is no note to be played DB 0,6,0,0
HERE: JNB TF1,HERE DB 1,6,0FCH,08FH DB 1,24,0FDH,0B4H
CLR TF1 DB 0,6,0,0 DB 0,6,0,0
CLR TR1 DB 1,24,0FCH,0EFH DB 1,48,0FDH,06CH
CPL SPEAKER DB 0,6,0,0 DB 2,0,0,0 ;R0=2 indicates
SJMP RUN DB 1,24,0FCH,08FH end of music
STOP: CLR SPEAKER DB 0,6,0,0 END 

5 8 • M a r c h 2 0 0 9 • e l e c t ro n i c s f o r yo u w w w. e f y m ag . co m
cONSTRUCTION

PC-BASED WIRELESS
STEPPER MOTOR control
mar
sunil ku

 V. Mariyappan signals are transmitted from the RF Parts List


transmitter and received by the RF

S
Semiconductors:
tepper motors find lots of ap- receiver. IC1 - HT12E Holtek encoder
plications in process control, IC2 - 7806, 6V regulator
machine tools and robotics. Es- Circuit description IC3 - HT12D Holtek decoder
IC4 - CD40106 hex inverter
pecially in robotics and process control, Fig. 1 shows the block diagram for IC5 - ULN2003 Darlington array
it is necessary to control the stepper PC-based wireless control of a stepper T1-T4 - BC547 npn transistor
motor from a remote place. motor. The signals from the parallel T5 - BC548 npn transistor
Here we describe how to wirelessly port of the PC are interfaced to the RF D1-D4 - 1N4148 switching diode
D5-D10 - 1N4007 rectifier diode
control a stepper motor from a remote transmitter through an encoder. The TX1 - TX-433 RF transmitter
place by using RF modules. For this encoder continuously reads the status RX1 - RX-433 RF receiver
wireless stepper-motor control system, of the relay switches, passes the data LED1 - 5mm LED
you need to design and develop the to the RF transmitter and the transmit- Resistors (all ¼-watt, ±5% carbon):
R1 - 1-mega-ohm
required hardware and software. The ter transmits the data. At the receiving R2-R5 - 10-kilo-ohm
parallel port of the PC is used to con- end, the RF receiver receives this data R6-R9 - 1.2-kilo-ohm
trol the direction of the stepper motor and gives it to the decoder. The de- R10 - 1-kilo-ohm
R11 - 47-kilo-ohm
at the transmitter side. RF interface is coder converts the single-bit data into
R12 - 3.9-kilo-ohm
used instead of IR to overcome all the four-bit data and presents to the step- R13 - 470-ohm
drawbacks of the IR interface. The PC per-motor driver. Now, the driver per- Capacitors:
forms the corresponding C1, C3 - 100µF, 16V electrolytic
Table I action, i.e., it rotates the C2 - 0.1µF ceramic disk
Output Power and Current stepper motor clockwise
C4 - 10µF, 16V electrolytic
Miscellaneous:
Drain w.r.t. VCC or anticlockwise. BATT.1 - 9V battery
VCC O/P Current Remote control. BATT.2 - 6V, 4.5Ah battery
For remote control, we S1, S2 - On/off switch
5V DC –0 dbm 1.0 mA DIP-SW1,
have used the Holtek
12V DC +9 dbm 3 mA DIP-SW2
- 8-way DIP switch
Fig. 2: Pin encoder-decoder pair - 25-pin D-type male
configuration of HT12E and HT12D. connector
Table II of the rf
transmitter Both of these are 18-pin
Technical Specifications of module DIP ICs. Encoder HT12E has eight address and
RF Receiver RX-433 Operation of Holtek another four address/data lines. The
Description Value HT12E and data set on these twelve lines (address
H T 1 2 D . and address/data lines) is serially
Working voltage 4.5V-5.5V
HT12E and transmitted when transmit-enable pin
Bandwidth 12 MHz
HT12D are TE is taken low. The data output ap-
Sensitivity –103 dbm
CMOS ICs pears serially on DOUT pin. It is trans-
Data rate 4800 bps
with a work- mitted four times in succession.
Max. data rate 9600 bps ing voltage The data consists of differing
Standby current 1, 2 mA
Fig. 3: Pin configuration of the r a n g e of lengths of positive-going pulses for
Antenna Whip, strip line or helical rf receiver module 2.4V to 12V. ‘1’ and ‘0,’ the pulse width for ‘0’ be-
ing twice the width of the pulse
for ‘1.’ The frequency of these
pulses may lie between 1.5 and 7
kHz depending on the resistance
value between OSC1 and OSC2
pins. The internal oscillator fre-
quency of decoder HT12D is 50
Fig. 1: Block diagram for PC-based wireless control of a stepper motor times the oscillator frequency of

6 0 • M a r c h 2 0 0 9 • e l e c t ro n i c s f o r yo u w w w. e f y m ag . co m
cONSTRUCTION

Fig. 4: Transmitter circuit for wireless stepper motor control

encoder HT12E. The values of timing circuits are chosen here for approxi- pins four times in succession, the valid
resistors connected between OSC1 mately 3kHz frequency of the encoder transmission pin (VT) is taken high.
and OSC2 pins of HT12E and HT12D, (HT12E) at Vcc of 9V and 150 kHz of The data on pins AD8 through AD11 of
for the given supply voltages, can be the decoder (HT12D) at Vcc of 5V. the HT12E appear on pins D8 through
found out from the graphs given in The HT12D receives the data from D11 of the HT12D. Thus the device acts
the datasheets of the respective chips the HT12E on its DIN pin serially. If as a receiver of 4-bit data (16 possible
(included in this month’s EFY-CD). the address part of the data received codes) with 8-bit addressing (256 pos-
The resistance values used in the matches the levels on A0 through A7 sible channels).

Fig. 5: Actual-size, single-side PCB for the transmitter circuit Fig. 6: Component layout for the PCB shown in Fig. 5

6 2 • M a r c h 2 0 0 9 • e l e c t ro n i c s f o r yo u w w w. e f y m ag . co m
cONSTRUCTION
shown in Table I.
The pin configuration
of the transmitter module
is shown in Fig. 2.
The RF receiver RX-
433 is a 433MHz module.
Its pin configuration is
shown in Fig. 3, while the
technical specifications
are given in Table II.
Transmitter. Fig. 4
shows the circuit of the
transmitter for wireless
stepper motor control.
The receiver address to
be transmitted can be set
with the help of 8-way
DIP switch SW1. When
any of the switch con-
tacts is open the respec-
tive pin will be at logic
1, and when any of the
Fig. 7: Receiver-cum-decoder circuit for wireless stepper motor control switch contacts is closed
the respective pin will be
Once the frequency of the pair at logic 0. The data pins are pulled high
is aligned, then on ground of any via resistors R2 through R5.
data pin of the encoder, LED1 of When pin 2 of the parallel port
the decoder should glow. You can goes high, transistor T1 is driven into
also check the transfer of data on saturation and relay RL1 energises. Pin
pins AD8 through AD11, which 10 (AD8) goes low through relay RL1
is latched to D8 through D11 pins contacts and a ‘0’ is sent at that data
of the decoder once TE pin is mo- position, while other data pins repre-
mentarily taken low by grounding sent logic-1 state. The logic circuitry at
it through diodes D1 through D4. the receiver-decoder end decodes the
RF transmitter and receiver. RF data appropriately for controlling the
transmitter and receiver modules stepper motor.
from Alpus India, Mumbai, have An actual-size, single-side PCB for
Fig. 8: Actual-size, single-side PCB for the receiver-cum-
been used for RF remote control. the transmitter circuit (Fig. 4) is shown
decoder circuit The RF transmitter TX-433 is in Fig. 5 and its component layout in
AM/ASK type. Its features in- Fig. 6.
clude: Receiver and decoder. Fig. 7 shows
1. 5V-12V single-supply opera- the circuit of the receiver-cum-decoder
tion for wireless stepper motor control.
2. On-off keying (OOK)/am- Assuming that identical address is
plitude shift keying (ASK) data selected on the encoder and decoder,
format when any of the data pins of the PC’s
3. Up to 9.6kbps data rate parallel port on the transmitter side
4. +9dBm output power (about is low, the corresponding data pin
200m range) of the decoder will go low. The data
5. SAW-based architecture outputs (D8 through D11) of HT12D
6. A 45cm wire is adequate for are fed to inverters N1 through N4,
the antenna which, in turn, are connected to driver
The output power and current ULN2003. The low output of ULN2003
Fig. 9: Component layout for the PCB shown in Fig. 8 drain for Vcc of 5V and 12V are drives the stepper motor. When any

6 4 • M a r c h 2 0 0 9 • e l e c t ro n i c s f o r yo u w w w. e f y m ag . co m
cONSTRUCTION
T5 into saturation and LED1 lights anticlockwise) depends on the switch
up. function.
An actual-size, single-side PCB for When the program (WSTEPPER.
the receiver-cum-decoder circuit (Fig. C) is loaded and run, the screen shows
7) is shown in Fig. 8 and its component the welcome message. Pressing any key
layout in Fig. 9. will lead to the main screen shown in
Fig. 10. The main screen displays three
Software messages. Pressing ‘c’ key rotates the
The software program for the user stepper motor in clockwise direction,
interface to control the stepper motor while pressing ‘a’ key rotates the step-
is written in ‘C’ language. The signals per motor in anti-clockwise direction.
Fig. 10: Main screen of wireless stepper motor
are generated by the outport( ) func- The program can be terminated by
control tion. The speed of rotation of the step- pressing ‘q’ key.
per motor can be varied by changing EFY note. The source code and
data is received, valid transmission the argument of the delay( ) function. other relevant files of this article are
(VT) pin goes high to drive transistor Direction of rotation (clockwise or included in this month’s EFY-CD.

WSTEPPER.C
/*PC BASED WIRELESS STEPPER MOTOR CON- tact”}; getch();
TROL*/ int j; }
#include<stdio.h> char ex1[31]={“Email-marietech2003@ya-
#include<conio.h> hoo.co.in”}; void clock(void)
#include<dos.h> int k; {
void main() void clock(void); int p=0x0378;
{ void anty(void); char e;
void dub(void); char ch; clrscr();
char ex[26]={“Programmed by clrscr(); textcolor(14);gotoxy(31,12);
V.MARIYAPPAN”}; textcolor(14);gotoxy(20,6); cprintf(“CLOCKWISE DIRECTION”);
int i; cprintf(“PC BASED WIRELESS STEPPER MO- textcolor(9);gotoxy(1,25);
char ex1[22]={“Programming Language: TOR CONTROL”); cprintf(“Press any key to stop”);
C”}; textcolor(11); gotoxy(24,14); do
int j; cprintf(“FOR CLOCKWISE ROTATION PRESS {
char ex2[28]={“Operating system: Win- ‘c’”); outport(p,1);
dows 98”}; textcolor(11);gotoxy(22,16); delay(200);
int k; cprintf(“FOR ANTICLOCKWISE ROTATION outport(p,2);
char ex3[39]={“PC BASED WIRELESS STEPPER PRESS ‘a’”); delay(200);
MOTOR CONTROL”}; textcolor(9);gotoxy(31,20); outport(p,4);
int l; cprintf(“FOR EXIT PRESS ‘q’”); delay(200);
clrscr(); ch=getch(); outport(p,8);
for(l=0;l<39;l++) switch(ch) delay(200);
{ { outport(p,0);
textcolor(14);gotoxy(21+l,9); case ‘c’:clock();break; sound(1000);
cprintf(“%c”,ex3[l]); case ‘a’:anty();break; delay(200);
delay(50); case ‘q’: nosound();
} clrscr(); }
sound(1900); { while(!kbhit());
delay(500); for(j=0;j<29;j++) getch();
nosound(); { dub();
delay(100); textcolor(9);gotoxy(27+j,14); }
for(i=0;i<26;i++) cprintf(“%c”,ex[j]);
{ delay(30); void anty(void)
textcolor(11);gotoxy(27+i,16); } {
cprintf(“%c”,ex[i]); for(k=0;k<31;k++) int p=0x0378;
delay(30); { char e;
} textcolor(9);gotoxy(26+k,15); clrscr();
for(k=0;k<28;k++) cprintf(“%c”,ex1[k]); textcolor(14);gotoxy(30,12);
{ delay(30); cprintf(“ANTI CLOCKWISE DIRECTION”);
textcolor(9);gotoxy(26+k,18); } textcolor(9);gotoxy(1,25);
cprintf(“%c”,ex2[k]); outport(0x0378,0); cprintf(“Press any key to stop”);
delay(30); textcolor(14);gotoxy(1,25); do
} cprintf(“Press any key”); {
for(j=0;j<22;j++) getch(); outport(p,8);
{ exit(0); delay(200);
textcolor(9);gotoxy(29+j,20); } outport(p,4);
cprintf(“%c”,ex1[j]); default: clrscr(); delay(200);
delay(30); textcolor(12);gotoxy(33,1 outport(p,2);
} 4); delay(200);
sound(1800); cprintf(“WRONG KEY outport(p,1);
delay(500); PRESSED”); delay(200);
nosound(); for(i=0;i<5;i++) outport(p,0);
getch(); { sound(2000);
dub(); sound(1000); delay(200);
} delay(100); nosound();
nosound(); }
void dub(void) delay(100); while(!kbhit());
{ } getch();
int i; dub(); dub();
char ex[29]={“For any clarification con- } } 

6 6 • M a r c h 2 0 0 9 • e l e c t ro n i c s f o r yo u w w w. e f y m ag . co m
first look!
the latest Home and office products

World’s First 200Hz LCD TV multimedia


Watch action and sports without jerks on Sony BRAVIA Z450A
Projectors
ment to the next level.
Give edge to your business
The advantages of this new presentations with Sharp’s PG-
technology can be noticed espe- F320W and PG-F255W
cially in action scenes or sports
broadcasts as it reduces jerkiness by
Price:
creating an additional, transitional PG-F255W: Rs 75,000
picture that is inserted into fast- PG-320W: Rs 99,000
moving sequences. By increasing
the number of images, the Bravia
Z450A can display even the fastest
sports scene smoothly without a
Price:
132cm: Rs. 359,900 blur. The transitional images are
117cm: Rs 243,900 created by examining the pictures that
102cm: Rs 183,900 immediately precede and follow the
Sony claims to have introduced the next image in the sequence. For exam-
world’s first LCD TV with MotionFlow ple, MotionFlow looks at the flight of
200Hz technology in India. With its a cricket ball, to work out how it gets
ultra-smooth picture enhancement, the from the player’s bat to the sky, and
Bravia Z450A takes home entertain- inserts the relevant transitional images.
Sharp Business Systems (India) has

Gen-next Keyboards and Pianos


expanded its multimedia projection
systems lineup with the launch of PG-
Price: 320W and PG-F255W. Designed for
The new keyboards and pianos from Casio KEYBOARDS: business users, these projectors prom-
come with Indian tones and rhythms CTK-2000: Rs 6495
CTK-3000: Rs 7995 ise quality, flexibility, ease-of-use and
CTK-4000: Rs 9995 portability.
CTK-5000: Rs 13,995
WK-500: Rs 18,995 The projectors are WXGA
WK-200: Rs 13,995 (1280×800-pixel resolution) compatible
PIANOS: and provide 16:9 wide-screen viewing
AP-200: Rs 49,995 area, which is 1.3 times wider than
PX-720/ PX-720C: Rs 44,995
CDP-200R: Rs 29,995 standard XGA (1024×768-pixel resolu-
CDP-100: Rs 21,995 tion). The advanced optoelectronics
technology maximises light output,
Casio India has launched a new range The Privia pianos come with natu- providing crystal-clear images in
of digital pianos and keyboards that ral key touch and majestic sound qual- high brightness. The 3X colour wheel
combine tradition with technology. ity, while the Celviano range of pianos includes yellow and cyan, in addition
The multifunctional keyboards come have an elegant design with rich reso- to red, green and blue, reproducing
with special features. Audio-in terminal nance. GenNext digital pianos blend an highly realistic colourful pictures.
lets you connect the MP3 player and improved AIF sound source with 128- The PG-F255W and PG-320W boast
play your own music along with the note polyphony, which makes their of upwards of 2500 and 3000 ANSI
song. With the mike attachment, you tone quality very similar to acoustic lumens with an impressive 2200:1
can karaoke, with live music played on pianos. Some pianos also have Indian and 2000:1 contrast ratio, respectively.
the keyboard. You can sample sound tones and rhythms, SD card slot, pitch Both the models are ideal for use with
from an audio device and use it while bender, audio-in terminal and rhythm WXGA laptops, in small- to medium-
playing. editor. sized venues.

6 8 • m a r c h 2 0 0 9 • e l e c t ro n i c s f o r yo u w w w. e f y m ag . co m
first look!
Affordable Portable Music System
Mobile Phones Hear your iPod the Bose way

Say goodbye to headsets as LG


The Bose SoundDock portable
launches its first Intenna
FM radio phones digital music system bring your
iPod tunes to life for all to hear.
Price: Your iPod can be enjoyed out
GB110: Rs 3100 loud in more locations, without
GB106: Rs 2100
compromising sound quality.
The system is easy to
The LG GB110 and GB106 mobile use: Just dock and
phones don’t require you to attach a play your compat- Price: Rs 23,513
headset while listening to FM radio. ible iPod. It charges
So there are no hassles associated with while you enjoy music with no inter- rechargeable batteries. The rotating
using a headphone. Equipped with ruptions. iPod docking station disappears for
Intenna FM radio, the phones let you The system reproduces your fa- storage and protection during transit.
listen to unlimited songs and tune into vourite tunes with fullness and clarity The moulded handle makes it easy to
favourite music shows, sport reports, unusual for a portable system. And carry this iPod accessory from place to
updates and other information without it’s so compact that you can take it just place. A custom remote easily controls
adding headset to the phone. about anywhere, even outdoors. the system and basic iPod functions
Both the handsets are packed with A rechargeable lithium-ion bat- including playlist navigation. The aux-
an extremely strong battery that gives tery (included) provides more power iliary input lets you play other portable
up to ten hours of talktime, 3.8cm and longer playing time than most sources too.
colour display, extensive phonebook
memory and a stylish leatherite
carry pouch to save the phones from
scratches. While the GB106 packs in
Portable DLP Projectors
an anti-theft mobile tracker, the GB110 The BenQ CP270 and MP727 are good for business travelers
comes with additional features like a
1 GB VGA camera, a micro SD card
slot, an expandable memory of up to BenQ’s new projectors aim at
2 GB and MP3 playback. providing optimal solutions
for frequent traveling profes-
sionals.
The 1.5kg Commuter Series
CP270 is ideal for business travel-
ers and small offices. It projects Price:
at native XGA (1024x768) resolution CP270: Price not available
and features a high brightness of 2000 MP727: Rs 168,000 plus tax
ANSI lumens with a high contrast ratio
of 1000:1. Further, its 30-second quick- mens, which makes it perform in black-
cool feature allows the projector to cool out conditions to well-lit environments.
fast even after long usage hours. Contrast ratio is as high as 3500:1.
Targeted at the industrial sector, For multimedia users, the MP727
the MP727 high-brightness projector is projector has HDTV compatibility,
equipped with a host of features that integrated 3-watt speaker and HDMI
suit the needs of small- and medium- 1.3 (with HDCP). The universal audio
size businesses. This intelligent and remote lets you easily adjust the vol-
automatic projector gives high-quality umes of all audio devices connected to
output in almost any condition. The the projector, such as external speakers,
projector has a brilliant 4300 ANSI lu- DVD player and notebook.

7 0 • m a r c h 2 0 0 9 • e l e c t ro n i c s f o r yo u w w w. e f y m ag . co m
first look!
Tabletop Desktops Airtel IPTV
The HP CQ 2000 series desktops weigh only 3.5 kg and come loaded
with Compaq Bhasha vernacular interface
Service
Airtel’s digital TV interactive
The Compaq Presario CQ 2000 series and do what you need to.  The CQ offers telephone, broadband
and TV on a single line
of Hewlett Packard (HP) is a sleek, eco- 2000 is Energy Star certified for being
friendly machine at an affordable price energy-efficient.
of around Rs 18,990. Designed for the Bharti Airtel has launched the digital
modern households, this small device Price: Rs 18,990 plus taxes TV interactive—its Internet protocol
can easily replace your music television (IPTV) service. With this,
system and DVD player as Airtel delivers the triple-play advan-
you can attach it to your tage of telephony, broad-
LCD monitor and speak- band and entertainment
ers or simply enjoy online service to its customers. The
video clips on YouTube. triple-play service will be
The CQ 2000 also comes initially available to custom-
with the Compaq My Bha- ers in Delhi, Gurgaon and
sha software—a commu- Noida.
nication enabler providing Airtel digital TV inter-
vernacular interface. active claims to bring many
With a 6-in-1 digital firsts to the TV viewing
media reader and USB experience: Interactive 2.0
drives, all you need to offers a completely interac-
do is plug-in, sit back tive experience including
the freedom of ordering pizzas
and movie tickets from the

Ultra-Short-Throw Projector comfort of your TV set. Time-shift


TV transforms TV into a two-way ex-
perience, allowing you to pause and
Hitachi’s CP-A100 projector eliminates shadowing effects

The presenter’s shadow on the screen jection capability means that the
during a presentation and the projector Hitachi CP-A100 projector can
glare which blinds the presenter, have be mounted very close to the
been the two major problems with the screen. This brings additional
projectors.  Hitachi has developed an convenience, viewing comfort and
ultra-short-throw projec- safety while eliminating shadowing
tor that overcomes these effects common with conventional Entry cost: Rs 3999
problems. projectors.
The dramatic reduction The high-quality 3LCD panel rewind live TV as well as auto-record
in throw distance (ca- provides crisp, flicker-free images and store favourite programmes for
pability to project at XGA resolution. Brightness seven days. Movie-on-demand with
an image onto a level is 2000 lumens 100 blockbuster titles means you can
203cm screen in normal mode view movie of your choice at any
from a dis- and 2500 lumens time. 
tance of in bright mode. The  The entry cost for the Airtel dig-
merely 24.8 contrast ratio is 400:1. ital TV interactive subscriber is Rs
cm) and the In whisper mode the 3999 only. This includes a one-time
introduction projector has quietness of activation cost, Internet connection
of a high-angle pro- 28 dB—the same as that of with modem and landline, and set-
Price: Rs 125,000 a guest room in a hotel! top box.

7 2 • m a r c h 2 0 0 9 • e l e c t ro n i c s f o r yo u w w w. e f y m ag . co m
Buyers’
Guide

Personal
Music Players
Personal music players are available in a multitude
of formats, sizes and feature sets. So you are
bound to get confused in selecting the right one.
Here are the guidelines for a smart buy

iPod touch

Uma Bansal There is loss of quality with each sub- dedicated CD players, MP3-enabled

P

sequent copy. Storage becomes head- mobiles and portable MP3 players.
ersonal music players are ache when collection grows bigger. Of these, MP3 players are ubiquitous
of two types: analogue and On the other hand, the quality of today.
digital. Analogue players digital music varies from average to Portable MP3 players. These are
are long-play gramophone excellent depending upon the conver- continually evolving from simple
record/cassette type, while sion format and compression technique audio players to complex multimedia
digital players can be uncompressed used, quality and the technological devices. Most can show digital photos
(capable of CD playback) or com- advancement of replay device. Con- transferred from your computer, some-
pressed (capable of MP3/WMA/AAC sistency of music quality is very high. times with accompanying music. Many
playback). Playback devices are compact to ultra- can also play movies and music videos
The quality of analogue music is compact. And storage is no issue for downloaded from the Web.
excellent to start with but deteriorates compressed music. Among the flurry of models avail-
over the usage period of time. Also, able, Apple’s iPods account for ma-
mechanical devices are used for play- What’s available in digital? jority of MP3 players sold. Apple’s
back, which are bulky and prone to When going for a personal music success rests in part on its creation of
wear and tear. Portability is lesser. player, you have a choice between a self-contained digital entertainment

w w w. e f y m ag . co m e l e c t ro n i c s f o r yo u • m a r c h 2 0 0 9 • 7 3
Buyers’
Guide
system. Its online iTunes store offers
a large library of online video content, MP4 players, also known as personal video players,
supplementing its dominance over let you view video clipping/video films apart from
online music sales. listening to audio. These score over MP3 players
MP3 players score high over mo- in that they have a larger display screen and can
biles on the following counts: support more formats.
1. The sound clarity of portable
MP3 players is far superior to MP3- flash memory are extremely sturdy memory digital music player range
enabled mobiles. and robust for usage on the move. The does not only look good, it can accom-
2. The battery life of MP3 players reason is these have no moving parts, modate unlimited music transfers or
can be up to 35 hours, without requir- so you can take them for jogging and even serve as a data storage device.
ing recharging even for weeks. your music won’t skip. They are the Some of the latest Walkman video
3. Some MP3 players come with smallest and lightest players, measur- MP3 players include NWZ-E436F/P
very high ease of use while searching ing no bigger than a pack of playing and NWZ-E435F/B. Both of these are
for the songs or storing and retrieving cards. Flash memory is available up compact and light-weight, come with
different album arts. to 64 GB. In India, you can get up to FM tuner, support high-quality video
There are hundreds of MP3 players 16GB only. Most users prefer flash playback and have a user-friendly
to choose from, all with their own ad- memory-based music players. MP3 interface for easy operation. The 4GB
vantages. Major brands of MP3 players players can also double as USB mem- NWZ-E436F/P is available for Rs 6490,
include Apple, Creative Labs, iRiver, ory sticks. Some may have expansion while the 2GB NWZ-E435F/B is priced
Philips, RCA, Samsung, SanDisk, Sony slots to add more memory via card at Rs 4990.
and Toshiba. Brands from smaller com- slots on the player. Hard-disk memory type. These play-
panies are also available in the market. However, MP3 players are little ers use mechanical parts and are prone
MP3 playback has also been incor- expensive in terms of per GB cost com- to usage issues when used while
porated into handheld products like pared to hard-disk type. skipping or dropped down. They are
CD players, cell phones and personal A good example of MP3 players is larger and heavier than flash players.
digital assistants (PDAs). Sony’s Walkman. Catering to music The memory capacity cost per GB is
Digital MP3 players can be differ- fanatics with countless CDs at home, low. In India, you can get up to 160GB
entiated based on the type of memory Sony’s collection of MP3 Walkman is hard-disk player. It can store up to
used: Flash and hard-disk. able to shrink your multitude of CDs 40,000 songs.
Flash-memory type. Players that use into just one small device. The flash Hard-disk MP3 players like Apple
iPods lead the portable audio world
in terms of storage. The limiting fac-
tor is usually price. In general, buy
as large a memory as you can afford,
but if you only need the space to hold
a thousand tunes, there is no reason
to spend the extra money for a 40GB
player.
Portable MP3 players can be further
differentiated based on the formats:
1. MP3-only audio players. Branded
good-quality MP3-only players are
available for Rs 1500 to Rs 6000. Chi-
nese unbranded versions can come for
as less as Rs 600-Rs 2000.
2. MP4 players. MP4 players, also

Philips personal audio player

7 4 • m a r c h 2 0 0 9 • e l e c t ro n i c s f o r yo u w w w. e f y m ag . co m
Buyers’
Guide
known as personal video players, you can group songs on each disk workout routines, jogging or even
let you view video clipping/video according to artist, genre and other clipping to a shirt lapel for everyday
films apart from listening to audio. categories. use. Larger MP3 players are fantastic
These score over MP3 players in that A CD, with its 650 to 800MB stor- for playing video and enjoying music,
they have a larger display screen and age capacity (about 150 to 200 songs), but these are typically much more ex-
can support more formats than MP3 can hold more than ten hours of MP3- pensive and can be considered niche
players. Like MP3 players, these may format music at the standard CD-qual- products with far fewer accessories.
come in hard drive or flash memory ity setting. You can create MP3 CDs Appearance aside, a player’s design
versions. Good-quality branded MP4 using the proper software and your also goes hand in hand with its size
players are priced between Rs 2000 PC’s CD burner. and weight. This can vary a lot be-
and Rs 18,000. Cell phones. An increasing number tween devices, the lightest weighing
MP4 players from Humx are avail- of phones have built-in MP3 play- around 20 gm.
able in screen sizes ranging from 7.1 ers—some with controls and features Hard-disk players tend to be much
cm (2.8 inches) to 7.6 cm (3 inches), that rival standalone players. Some heavier than their flash counterparts
with built-in capacity of 1 GB, 2 GB cell-phone providers let subscribers due to the weight of the hard disk
or 4 GB. There are four models in all: download music over their networks. and the larger battery required. Light-
MP252, MP342, MP432 and MP522. Song capacity is often determined by weight and sleek flash-memory-based
All are MLC flash memory-based and the size of the external memory card, players are the current style state-
support rechargeable Li-ion battery, as well as the phone manufacturer, ment.
20 FM channels, numerous audio and carrier or music provider. Whichever MP3 player you choose,
video formats (MP3, WMA, WAV, make sure you’ll be comfortable using
DAT, VOB, MP4, MOV, ASF, ASX and What to look for in an the device. Look for a display that is
WMV), e-book and game function. mP3 player? easy to read. Also, the controls should
The MP252 and MP432 also support Size, weight and design. Let’s face it, be easily accessible.
RM/RMVB, AVI, FLV, 3GP and MPG aesthetics go a long way. Just like mo- Audio format. MP3 (Moving Pic-
formats. bile phones, MP3 players have become tures Expert Group Audio Layer 3)
CD players with ‘MP3’ compat- fashion accessories. The player should is just one of the many formats you
ibility. Other than flash-memory and also be lightweight, compact and easy can play on digital audio players. It
hard-disk portable players, many of to operate with one hand. Some MP3 is a digital audio format encoded on
today’s portable CD players also let players are so small that these can computer from a source such as CD.
you play digital music saved on disks. hang off a keychain, while others will The files are compressed but retain
But these don’t support the copyright- barely fit in your hand. near-original sound quality. Most
protected formats from online music Tomonori Moroda, division head, MP3 players can play one or more
stores. Controls and displays are as personal audio, Sony India, says that other compressed audio formats
good as in portable MP3 players, and the smallest players are great for too, such as Advanced Audio Cod-
ing (AAC), Ogg Vorbis (OGG) and
Microsoft’s Windows Media Audio
(WMA). Make sure that your player
is compatible with MP3, WMA and
AAC at least.
Here’s how these audio formats
differ:
WMA. A Windows Media Audio
file is about half the size of an MP3 file,
but offers similar sound quality.
If you want to fit as many songs
as possible onto your audio player,
look for WMA compatibility. A 60GB
WMA-compatible MP3 player can
store up to 30,000 songs in WMA for-
mat—or just 15,000 in MP3.
MP3Pro. It has better audio quality
than MP3, but isn’t widely popular
Humx MP4 player among manufacturers.

7 8 • m a r c h 2 0 0 9 • e l e c t ro n i c s f o r yo u w w w. e f y m ag . co m
Buyers’
Guide
Pros and cons of MP3 players
Pros
• Most MP3 players are compact and light
• With the lack of moving parts, unlike CD players, there is no chance of skip, whether
the user is jogging, on a bumpy car ride or cycling
• These can store large collections of music, thus usually supporting your playlists on
a single device
• Often contain extra features such as radio
Cons
• More expensive than older-format devices
• Some storage formats (such as MP3) could be superseded
• Encoding files and transferring data can be time consuming and require other devices
such as PCs
—Tomonori Moroda, division head, personal audio, Sony India

OGG. Ogg Vorbis format has ex- depends on the memory used. As
cellent sound quality and is gaining mentioned earlier, in India you can
popularity. get up to 16GB flash player or up to
AAC. Dolby’s Advanced Audio 160GB hard disk player. A 1GB player
Coding format is used in Apple iPods can store around 250 songs (16 hours
and can be downloaded from Apple’s of music).
Internet music store ‘iTunes.’ Hard disk-based players can store a
WAV. It’s uncompressed audio, just fairly large collection of songs, but are
as you would hear on a standard CD. expensive and not as sturdy as flash
Storage capacity and format. memory-based players.
The storage capacity of an M3 player Some players may use memory

Sony NWZ-B130F series

w w w. e f y m ag . co m e l e c t ro n i c s f o r yo u • m a r c h 2 0 0 9 • 7 9
Buyers’
Guide
cards such as MultiMediaCard (MMC), 4. More consistent and higher-qual-
SecureDigital, CompactFlash and ity metadata
MemoryStick (for Sony) for storage. In Software bundled with the player.
case you have a handheld gadget like Good bundled software is a great bo-
cellphone or digicam using memory nus as the quality of your recordings
card, make sure that you choose an depends on the quality of software
MP3 player that accepts that particular you use.
card too. Media player is the software used
Battery type, replaceability and for playback of multimedia files. Typi-
life. Most players come with an inbuilt cal features of such a software are:
rechargeable battery. When you con- 1. Rips music from a CD and saves
nect it to your computer or laptop, the it as an MP3 file
battery gets charged automatically. 2. Burns MP3 file to CD or DVD
After full charging, it can play audio 3. Organises MP3 files with ID3
for up to 15-30 hours and video for up data tags
to 2-6 hours depending upon the brand 4. Allows you to create your own
and model of player you are using. playlists
Battery life of no less than 12 hours It’s important that the media player
for music and four hours for video is software is supported by the operating
a good bet. Rechargeable batteries last system of your computer.
up to three years depending on the Some common software are iTunes,
usage. Real Player, Windows Media Player,
A few players have battery bays Quick Time and KM player.
for AA or AAA batteries. Generally, Other extra features (like FM tuner,
users don’t prefer the recurring cost of voice recording, games, etc). Most
replaceable batteries. MP3 players come with FM tuner. FM
Display. The display lets you eas- comes very handy for current news
ily select your music by artist, album update and change in music enter-
or genre. It is also useful when you’re tainment. Lots of college students are
looking for a particular radio station. using voice recording feature very in-
In audio formats, the displays avail- novatively. They record lectures in the
able are 2.5cm black & white (capable classroom and prepare notes at leisure.
of one to three lines), 2.5cm colour and This helps them focus on the content at
3.8cm OLED. the time of lectures. A 1GB MP3 player
In video formats, the screen size can support voice recording of up to 65
varies from 3.8 cm (1.5 inches) to 8.9 hours, while a 2GB player can support
cm (3.5 inches) with 262,000 colours. up to 135 hours.
The screen type varies from TFT to FM tuner and voice recording are
QVGA/WQVGA. The resolution also standard features on all Philips digital
varies from 128x128 to 240x400. players. Also, high-end players from
Hard disk players may come with Philips come with inbuilt noise cancel-
a colour screen for song info and for lation feature.
viewing your digital photos. Accessories. Flash-based MP3 play-
Music store. Online music buying ers need speakers and amplifiers for
is not very prevalent in India but is a loud sound. Lots of docking systems
normal practice in West. The benefits are available for these music players.
of online music buying are: The small and sleek players can be
1. Offers instant, legal access to worn on the body as ornaments. The
hundreds and thousands of songs related accessories are available in
2. Allows you to preview/prelisten various shapes and sizes. Philips pro-
and purchase individual songs instead vides high-definition earphones with
of the whole album noise-isolation technique. 
3. Legal source complies with copy-
right laws The author is a deputy editor at EFY

8 0 • m a r c h 2 0 0 9 • e l e c t ro n i c s f o r yo u w w w. e f y m ag . co m
circuit
ideas
Triple Power Supply s.c. dwiv
edi

 Sandip Trivedi and P.D. Lele is used for op-amp-based analogue


circuit experiments.

T
his low-cost, multipurpose Fig. 1 shows the circuit of the triple in positive and negative regulated
power supply fulfils the re- power supply, while Fig. 2 shows the power supplies. LED1 glows to indi-
quirements of almost all labora- pin configuration of the regulators cate that +5V is available, while LED2
tory experiments. Nonetheless, it can used in the circuit. Transformer X1 indicates that –5V is available.
be easily fabricated by hobbyists. steps down the mains power to deliver Switch S1 is used for mains ‘on’/
A single transformer is used to the secondary output of 18V-0-18V. ‘off’. Using switches S2 through
build this triple power supply. Regula- The transformer output is rectified by S4, any of the three supplies can be
tor IC LM317 generates variable power full-wave bridge rectifier BR1, filtered independently turned off when not
supply of 1.25 to 20V, 1A. The dual by capacitors C1, C2, C3, C7 and C8, required in a particular experiment.
±12V, 1A power supply is generated and regulated by IC1 through IC5. This reduces unnecessary power dis-
by regulators 7812 and 7912. Similarly, Regulator IC1 (LM317) provides vari- sipation and increases the life and
dual ±5V, 1A power supply is gener- able voltages (1.25 to 20V), while IC2 reliability of the power supply. Since
ated by regulators 7805 and 7905. and IC4 provide regulated +12V and the circuit uses three terminal regula-
‘On’/‘off’ switches (S2 through S4) –12V, respectively. The output of IC2 is tors, only capacitors are required at
select the required power supply. Vari- fed to regulator IC3 (7805), which pro- the input and output. The use of few
able power supply is used to study the vides fixed +5V. Similarly, the output components makes the circuit very
characteristics of devices. Fixed +5V of IC4 is fed to regulator IC5 (7905), simple. The three terminal regulators
power supply is used for all digital, which provides fixed –5V. Capacitors have heat-sink provision to directly
microprocessor and microcontroller C4 through C6, and C9 through C11, deliver 1A output current. To ensure
experiments. Dual ±12V power supply are used for further filtering of ripples the maximum output, do not forget to

HEAT SINK

S2 = FOR VARIABLE VOLTAGE IN IC1 OUT


3
LM317 2
S3 = FOR +12V AND +5V S2 1
R1
ADJ. +1.25 TO 20V
S4 = FOR –12V AND –5V 120

S1-S4 = ON/OFF SWITCH C3


0.1µ
VR1 GND
2.2K
+12V
POT

S1
ON/OFF HEAT SINK HEAT SINK
SWITCH
IN IC2 OUT IN IC3 OUT
1 7812 3 1 7805 3
X1 S3 2 2
F1
1.5A GND GND
R2
FUSE
BR1 330
C1 C4 C5
L W04 1000µ C2 100µ 10µ
+5V
C6
230V AC 35V 0.1µ 25V 16V 0.1µ
50Hz
BR1 LED1
N W04

GND
X1 = 230V AC
PRIMARY TO 18V-0-18V, C7 C8 C9 C10 R3
1.5A SECONDARY 1000µ 0.1µ 100µ 10µ 330
TRANSFORMER 35V 25V 16V C11 –5V
0.1µ
GND GND
1 1 LED2
BR1-W04 2 IC4 3 2 IC5 3
1.5A, BRIDGE S4 IN 7912 OUT IN 7905 OUT
RECTIFIER

HEAT SINK HEAT SINK

–12V
GND

Fig. 1: Tripple power supply

w w w. e f y m ag . co m e l e c t ro n i c s f o r yo u • M a r c h 2 0 0 9 • 8 1
circuit
ideas
earthing tag.
5. If the 18V-0-18V
transformer is replaced
with 15V-0-15V trans-
former, the output
voltage of the variable
supply using LM317
Fig. 2: Pin configurations of regulators will be correspond-
ingly lower.
use heat-sinks for the regulators. 6. If proper voltages
The three-terminal regulators are are available, go to step
almost non-destructible. These have Fig. 3: Proposed cabinet for power supply 7. Otherwise, check the
inbuilt protection circuits including connections.
the thermal shutdown protection. Even 1. Collect all the components shown 7. Connect variable regulator
if there is overload or shorting of the in the circuit diagram. LM317 to the circuit and check 1.25V
output, the inbuilt overload protection 2. Connect switch S1, fuse, trans- to 20V output by varying the 2.2-kilo-
circuit will limit the current and slowly former and mains cord to the assem- ohm linear potentiometers.
reduce the output voltage to zero. bled PCB as well as the box. 8. Now connect ICs 7812, 7912, 7805
Similarly, if the temperature increases 3. Keep the multimeter in DC volt- and 7905 to the circuit and check their
beyond a certain value due to excessive age range (more than 25V DC) and output voltage.
load and heat dissipation, the in-built measure the DC voltage across ca- 9. Connect terminals, potmeter,
thermal shutdown circuit will reduce pacitors C1 and C7 (1000 µF, 35V). This switches and indicator LED on the
the output current and the output volt- voltage should be around 18V×1.41=25 front panel of the box and complete
age (gradually) to zero. Thus complete to 26V DC. Check both positive and the connections. Close the box by us-
protection is provided to the circuitry. negative voltages with respect to ing screws.
Assemble the circuit on a general- ground. Precaution. At the primary side of
purpose PCB and enclose in a box as 4. It is advisable to use three-wire the transformer, 230V AC could give
shown in Fig. 3. mains cable and plug. If you are using lethal shocks. So be careful not to touch
The step-by-step procedure to build any metallic box, earthing wire/pin of this part. EFY will not be responsible
the triple power supply for the labora- the mains plug should be soldered to for any resulting loss or harm to the
tory follows: the body of the metallic box using an user. 

unique Water Pump Controller


edi
s.c. dwiv A R4
12K S1
ON/OFF
B SWITCH

7 R6
3 +
 D. Mohan Kumar IC1 6
220
T1

H
µA741 +
D1 BC558 12V

ere is a simple solution for 2 4 1N4148 DC

automatic pumping of water


to the overhead tank. Unlike C1
220
other water-level indicators, it does 25V N/O

not use probes to detect the water level R5


MOTOR

VR1 LED4
10K 12K D2
and hence there is no probe corrosion PRESET 1N4007 N/C
C2
problem. It has no direct contact with
RL1
470µ 230V
25V
water, so the chance of accidental leak- L AC N
50Hz
age of electricity to the water tank is RL1 = 12V, 1 C/O RELAY
also eliminated. Two important advan-
tages of the circuit are that the water Fig. 1: Water pump controller

8 2 • M a r c h 2 0 0 9 • e l e c t ro n i c s f o r yo u w w w. e f y m ag . co m
circuit
ideas
pumping of water.
Assemble the circuit on a general-
purpose PCB and enclose in a suitable
cabinet. Solder the white LEDs-LDR1
assembly on a separate PCB and use
a separate power supply for it. Mount
LEDs behind the LDR. Otherwise, light
from the LEDs will affect the working
Fig. 2: Sensor circuit of the circuit. Connect LDR1 to the main
circuit board at ‘A’ and ‘B’ points.
level never goes below a particular Fix the LEDs-LDR1 assembly on
level and no modification in the water the inner side of the water-tank cap as
tank is required. shown in Fig. 3. Orient the LEDs and
Fig. 1 shows the circuit of the wa- the LDR such that when the water tank
terpump controller. The circuit uses an is full, the light emitted from the LEDs
LDR-white LEDs assembly to sense the Fig. 3: Sensor assembly and reflected from the water surface
water level. It forms a triggering switch falls directly on LDR1. The distance
to energise the relay for controlling the level and the face of LDR1 is minimal. between the upper level of water and
pump. The LDR-LEDs assembly (shown When white light falls on LDR1, the the LEDs-LDR setup should be mini-
in Fig. 2) is fixed on the inner side of the voltage at the non-inverting input (pin mal, ensuring that water doesn’t touch
cap of the water tank without making 3) of IC1 increases and its output goes LDR1. Otherwise, the circuit will not
contact with water. The light reflected high. This high output makes pnp function properly. By using more white
from the water tank is used to control transistor T1 non-conducting and the LEDs, this distance can be increased.
the resistance of LDR1. relay remains de-energised. LED1 also Cover the LDR with a black tube to
When the water level is high remains ‘off.’ Since the water-pump increase its sensitivity.
enough, light from the white LEDs power supply is connected to the nor- You can fix the main unit at a
(LED1 through LED3) reflects to fall mally-open (N/O) contacts of relay convenient place and connect it to the
on LDR1. This reduces the resistance RL1, pumping is stopped. LEDs-LDR assembly through wire.
of LDR1, increasing the voltage at the When water level falls, the amount Select the relay according to the horse-
non-inverting input (pin 3) of IC1. of light reflected to LDR1 decreases power (HP) of the water pump. After
IC1 is used in the circuit as a voltage and its resistance increases. This re- arranging the setup (with maximum
comparator. Resistors R4 and R5 form duces the voltage at pin 3 of IC1 and water in the tank), adjust VR1 until
a potential divider to fix half of supply its output goes low. This low output LED1 stops glowing. In this state, the re-
voltage to the inverting input of IC1. from IC1 makes transistor T1 conduct. lay should de-energise. When the water
Normally, when the water tank is Relay RL1 energises to close the N/O level decreases, the relay automatically
full, LDR1 gets more of reflected light contacts and the motor starts pump- energises to connect mains to the motor
because the distance between the water ing water. LED1 glows to indicate the and it starts pumping water. 

THREE-COMPONENT FLASHER
 T.A. Babu

S
ince this flasher system uses edi
s.c. dwiv
only three components, it is rel-
atively easy to build and install.
It can be used for signal flashing, haz-
ard warning and alternate flashing. rent rating of 5A.
At the heart of this circuit is a The working of the circuit is very
single-pole double-through (SPDT) simple. Initially, bulk capacitor C1
contacts relay (see Fig. 1). It is a 12V, charges through resistor R1 and the
400-ohm, single-changeover (1C/O), bulb filament. When capacitor C1
PCB-mounted relay with contacts cur- charges, relay RL1 energises and Fig. 1: Simple flasher circuit

w w w. e f y m ag . co m e l e c t ro n i c s f o r yo u • M a r c h 2 0 0 9 • 8 3
circuit
ideas

Fig. 4: Circuit of alternate flasher

the left or right.


Fig. 2: Circuit of turn signal flasher
The circuit of the hazard-warn-
throws its contacts to the other posi- Fig. 3: Circuit of hazard-warning flasher ing flasher is shown in Fig. 3. Used in
tion. Capacitor C1 holds the contacts vehicle lighting systems, it flashes all
until there is enough charge to keep charge stored in the capacitor. The ‘off’ the four bulbs when hazard-warning
the relay energised. Bulb L1 (12V, 5W) time is controlled by the discharging switch S3 is ‘on.’ During hazard warn-
glows for a while through the N/O time of the capacitor. ing, switch S2 can be in the left or right
contacts of the relay. When the charge The signal flasher is a four-bulb position.
in the capacitor ceases, the relay con- system as shown in Fig. 2. Two bulbs The alternate flasher circuit is
tacts return to their initial normally- are used at the front of the vehicle and shown in Fig. 4. It flashes the lamps
closed position. the other two at the back of the vehicle. alternately when the system is acti-
The charging cycle repeats to give The primary function of the ‘turn’ sig- vated. This type of flasher is typically
a flashing effect in the bulb. The ‘on’ nal flasher is to flash the lamps when used in emergency vehicles and school
time of the flasher is controlled by the the ‘turn’ signal switch is activated to buses. 

In-Car Food and Beverage Warmer

edi
s.c. dwiv

 Ashok K. Doctor

T
his is a very useful
device for those
who are frequently
on the move. It will keep
your tea, coffee or food
warm while consuming
little power.
The circuit is simple.
The ubiquitous timer 555
is used as a free-running astable mul- nected in reverse direction to facilitate Power transistor T1 is Darlington type
tivibrator. Diodes 1N4148 are con- maximum variation of the duty cycles. with 5A capacity and output of more

8 4 • M a r c h 2 0 0 9 • e l e c t ro n i c s f o r yo u w w w. e f y m ag . co m
circuit
ideas
than 60 watts. The chosen discrete watts. The consumption of current will only two wire connections. Use wires
components assure fixed frequency of be significantly less if fewer coil ele- that can carry more than 6A current.
1 Hz (approximately) at pin 3 of timer ments are connected in parallel through Fix the coil elements below an alumin-
IC1 (555). Resister R1 and potmeter VR1 toggle switches S2 through S4. Each of ium or steel rectangular plate which
(1-mega-ohm) allow adjustment of the these switches has a 6A rating. is at least 1mm thick. Do not forget
duty cycle. The higher the duty cycle, Assemble the circuit on a general- to insulate the heating plate from the
the higher the output of the heater. purpose PCB. Mount power transistor elements. Use the car battery for the
You can connect up to five 10W TIP120 on a thick heat-sink. Isolate the power supply with a proper current-
heating elements in parallel, totaling 50 circuit from the heating elements using carrying-capacity wire. 

WHITE LIGHT FOR REFRIGERATOR


 Uday ShEnde The circuit is transformerless
and uses a capacitor for provid-

N
ormally, the refrigerator lights ing the power supply to the white edi
s.c. dwiv
are yellow in colour and go LEDs. Mains input is fed to capaci-
bad very often. If you want tor C1 and resistor R1, rectified by a
a long-lasting white light for your re- bridge rectifier comprising diodes D1
frigerator, this circuit is especially for through D4, and filtered by capaci- white LEDs in 2×8 parallel-connec-
you. The circuit is easy to install inside tor C2 to provide sufficient voltage tion configuration.
the refrigerator. Also, it consumes very to drive the white LEDs. Resistor R2 Assemble the circuit on a gen-
little power compared to the traditional limits the current flowing through eral-purpose PCB along with 16 white
yellow bulb. the LEDs. The circuit uses 16 bright LEDs. Connect the LEDs in series with
resistor R2. Take out
the two wires from
the usual bulb con-
nection and connect
to the circuit. After
connecting the supply
wires, wrap electrical
tape around the wires
properly. Enclose the
entire PCB (exclud-
ing LEDs) in a plastic
box and wrap the box
properly with tape to
seal it against mois-
ture. 

Smart Hearing Aid sani the


o

Devrishi Khanna and when sound is detected. The sensi-


Rohit Modi tivity of the detection section and the
‘on’ time duration of the sound am- microphone, earphone, and sound

N
ormally, hearing aid circuits plifier circuit can be set by the user. detection and amplification sections.
consume battery power Also the circuit uses only a single The sound detection section employs
continuously once they are condenser mic for sound detection a quad op-amp IC LM324 (IC1(A)) and
switched on. The circuit given here and amplification. a timer NE555 (IC2). The sound signal
saves battery power by switching As is clear from the above, this received at the mic is pre-amplified
on the sound amplifier section only hearing aid consists of a condenser by transistor BC549 (T1). The voltage

w w w. e f y m ag . co m e l e c t ro n i c s f o r yo u • M a r c h 2 0 0 9 • 8 5
circuit
ideas

at its collector is fed to the inverting IC1(A) triggers the NE555 timer and its is fed directly to amplifier stage. The
terminal (pin 2) of op-amp IC1(A), output goes high for a preset duration. output from pin 7 of IC1(B) is fed to the
which is used as a comparator. The R4 and C2 are the timing components base of transistor T2. The weak signal
reference voltage (Vref) at the non- for setting the time duration. The high received at transistor stage T2 is further
inverting terminal (pin 3) of IC1(A) output of the timer is directly used as amplified by transistors T3, T4 and T5.
is set using preset VR1. The preset is the power source for the sound ampli- An earphone to listen to the sound is
also used to control the sensitivity of fier section. connected between the collector of T5
the sound signals received by the cir- The sound amplifier section is built and ground. It is recommended to use
cuit. The output from pin 1 of IC1(A) around transistors T2 through T5. The a mono earphone with volume control
is fed to the trigger input (pin 2) of last amplifier stage T5 (pnp transistor attached.
timer NE555, which is configured in BC558) drives the earphone. The sound With 9V DC supply, when sound is
monostable mode. signal received from the mic is fed to detected through the mic, the amplifier
When sufficient sound signal the non-inverting pin of the second section is automatically triggered and
strength is detected at the base of tran- op-amp of IC1(B) which is wired in the current consumption of the circuit
sistor T1, the pulsating voltage at its unity follower configuration. The unity is about 96 mA. When the amplifier cir-
collector exceeds the reference voltage follower mode resolves the problem cuit is ‘off,’ the circuit draws a current
at pin 3. As a result, output pin 1 of of impedance mismatch which would of about 6 mA only, thus saving con-
IC1(A) goes low. The low output from have occured if the output of the mic siderable amount of battery power. 

8 6 • M a r c h 2 0 0 9 • e l e c t ro n i c s f o r yo u w w w. e f y m ag . co m
Software
section

LAN-based Online Exam


 Rahul Bagai to the client. The question database
is stored at the server end. The client

U
sing this program, examina- accesses the database from the server sani the
o

tions can be conducted online machine and displays the contents on


for students of various sub- its output screen.
jects in schools and colleges. The ex- The project includes three Java
amination result along with solutions source code files: ServerOnline.java, ConnectDatabase1.java and Clien-
to the questions is displayed at the end tOnline.java. There is an Online
of the exam. Exams.mdb Microsoft Access data-
The questions are randomly gener- base file which contains the list of
ated from a bank of questions stored questions and answers. The detailed
in a database maintained by the ad- questions are saved in GIF (graphic
ministrator. These are multiple-choice interchange format). The ‘Questions
with four possible answers. Each Fig. 1: First page on the client PC and Answers’ folder contains the
question is worth one mark. The stu- images of the multiple-choice ques-
dent has to select one subject at a time, tions. There are also some other images
so the questions will be on that topic and MP3 files included for the project.
only. For example, a subject may have All the image and MP3 files are linked
many chapters and multiple questions to the MS Access database through
related to that chapter are stored in configurations as explained under the
the database. From here, only 15 testing steps.
questions from selected chapter are
generated randomly for the test. The Operation of the program
software has the facility to store many Fig. 2: Instructions for the students 1. As soon as the client program is
chapters under one particular subject. started, a Java applet page as shown
The exam paper will be made up of in Fig. 1 loads into its output screen.
some questions taken from every Here the student can select his class
topic/chapter. (10th or 12th) and the subject (physics,
The administrator can change this chemistry, biology or mathematics) for
content by adding new topics and which he wants to give the exam. In
changing the number of questions for the database for this project, we have
each topic. He can add any number of included sample questions on biol-
questions and topics. Fig. 3: Screenshot to select a chapter ogy and mathematics only. As soon
The student can answer each ques- as a radio button corresponding to a
tion by clicking a radio button, so from particular subject
four possible answers only one answer is selected using
is selected per question. After answer- mouse, the client
ing all the questions, the student machine needs
needs to click a button at the bottom. to connect to the
All the answers by the student are database stored
stored in the PC and the marks scored in the server ma-
displayed. chine. So click
‘Connect to Da-
Software program tabase’ button to
The program is developed using J2SE start the test.
software development kit (JDK1.6) and 2. Next, the
MS Access application on a Windows instruction page
XP machine. It is designed on a cli- is loaded. It dis-
ent-server architecture which operates plays some in-
only when the server provides services Fig. 4: Screenshot of the online question structions to be

w w w. e f y m ag . co m e l e c t ro n i c s f o r yo u • m a r c h 2 0 0 9 • 8 7
software
section
followed. Click ‘Continue’ button
(refer Fig. 2).
3. Select a chapter of your choice
using a pull-down menu (refer Fig. 3).
4. Start attempting the questions
(refer Fig. 4). The questions here are
generated randomly from the database
stored in the server machine. You can
select the respective radio button for
your choice of answer.
5. As soon as you select an option,
click ‘submit’ button to submit the an-
swer and move to the next question.
Note that chapters stored in the Fig. 5: Test report
database can store any number of
questions but from those questions, (d) Type ‘Data Source Name’ as
only 15 are displayed on the client side ‘OnlineExams’ while observing case
for each test. sensitivity. Fig. 6: Solutions to the questions
At the end of 15 questions, a test (e) Assuming that all the relevant
report is generated (refer Fig. 5), where programs of this project are stored go to the next step to run the client
you can view your performance. under ‘D:\Rahul’ folder, locate program.
To view the correct answers after the database stored in ‘D:\Rahul\’ The steps for compiling and run-
the test, just click ‘Get Answers’ button by using ‘Select’ button of the same ning the client program are the same as
on the test report screen (refer Fig. 6). window. When the database is se- mentioned above. That is, click ‘Start/
lected, you will see the path of your Run’ option followed by ‘cmd.’ Open
Testing steps to run the database under ‘Database’ of the same ‘D:\Rahul’ folder and give the path of
program on a PC window. the JDK files.
Using a single PC, server and client (f) Click ‘Ok’ to complete the con- 8. Now instead of ‘ServerOnline.
programs can be run at the same time. figurations. java,’ type ‘ClientOnline.java’ against
Here, the server program is under the 4. Run the server program. All the the prompt.
control of the administrator and the questions are stored in ‘Questions If you run the ClientOnline pro-
client program is accessed by the stu- And Answers’ file of ‘Rahul’ folder. gram successfully, you will see the
dent. To achieve this, first the server Open the command prompt from screen as shown in Fig. 1. A PC can
program is made to run, followed ‘Start\Run...’ option and type ‘cmd’ handle multiple clients, so you can
by the client program as explained from the keyboard. Open ‘Rahul’ minimise the current client operation
below: folder from ‘D’ drive. Type the ap- and open another client program on
1. Download ‘Java SE Develop- propriate path against the prompt as the same machine.
ment Kit (JDK) 6’ from ‘http://java. given below:
sun.com/javase/downloads/index. “Path = c:\program files\java\ Testing steps to run on
jsp’ website. jdk1.6.0\bin” two PCs
2. Install JDK in your machine. By This is the path where the JDK files 1. Make sure that the PCs used for the
default it is installed under ‘c:\pro- like javac, java and appletviewer are project are connected on a local area
gram files\java\jdk1.6.0\bin’ direc- located. network (LAN).
tory. 5. Now type command ‘javac Serve- 2. Place ‘Rahul’ folder in server and
3. Install MS Access application rOnline.java’ to compile the ServerOn- client machines. This is mandatory.
program and configure the data source line.java program. If you have set the Next, follow Steps 1 through 3 under
for accessing MS Access database from path correctly, you will find class files sub-heading “Testing steps to run the
Java as follows: under ‘d:\rahul.’ Else, you will find program on a single PC.”
(a) Open ‘Administrative Tools’ error. Ignore warnings, if any. 3. Provide an appropriate path
from ‘Control Panel.’ 6. Next type ‘Java ServerOnline’ on for JDK as mentioned in Step 4 of the
(b) Now open ‘Data Sources’ first command prompt to execute the above sub-heading. Compile the Serve-
(ODBC) and click ‘Add’ button. software. You will see “Server Started rOnline.java program and run it on the
(c) Locate ‘Microsoft Access Driver’ !!!” in the next line. server machine.
(*.mdb) and click ‘Finish.’ 7. Minimise the window and then 4. On the client PC, the Connect-

8 8 • m a r c h 2 0 0 9 • e l e c t ro n i c s f o r yo u w w w. e f y m ag . co m
Software
section
Database1.java file, which is located both ConnectDatabase1.java and Cli-
under ‘Rahul’ folder, requires the IP entOnline.java programs.
address of the server. So open the 6. Run the ClientOnline.java pro-
ConnectDatabase1.java source file and gram. You will see the program output
replace ‘localhost’ with the IP address as shown in Fig. 1. Click the appropri-
of the server wherever ‘localhost’ ap- ate button to proceed for the online
pears. Save the file and close it. exams.
5. Provide an appropriate path for EFY-CD. All the relevant files and
JDK as mentioned in Step 4 under the source codes of this article have been
previous sub-heading, and compile included in this month’s EFY-CD.

serveronline.java
import java.net.*; BufferedReader is = null;
import java.io.*; PrintStream os = null;
import java.sql.*; Socket clientSocket = null;

public class ServerOnline { Connection conn;


public static void main(String Statement stmt;
args[]) {
try { String chapterSelected = “”,pass;

DriverManager.registerDriver(new public connection(Socket client-


sun.jdbc.odbc.JdbcOdbcDriver()); Socket) {
this.clientSocket = clientSocket;
}catch(Exception e) {
System.out.println(“Error oc- try {
cured : “+e.getMessage()); is = new BufferedReader(new
} InputStreamReader(clientSocket.getInput-
new ServerClass(); Stream()));
} os = new
} PrintStream(clientSocket.getOutput-
Stream());
class ServerClass implements Runna-
ble { }catch(IOException e) {
try {
Thread t; clientSocket.close();
ServerSocket echoServer = null; }catch(Exception ex) {}
Socket clientSocket = null; System.err.println(“Unable to
setup stream “+e);
ServerClass() { return;
try { }
echoServer = new ServerSock- t = new Thread(this,””);
et(1111); t.start();
}
}catch(IOException e) {
System.out.println(“Could not public void run() {
start server.” + e );
System.exit(1); try {
}
conn = DriverManager.
t = new Thread(this); getConnection(“jdbc:odbc:OnlineExams”);
System.out.println(“Server started stmt = conn.createStatement(Resu
!!!”); ltSet.TYPE_SCROLL_INSENSITIVE,ResultSet.
t.start(); CONCUR_READ_ONLY);
}
}catch(Exception e) {
public void run() { System.out.println(“Error oc-
try { cured : “+e.getMessage());
}
while(true) {
clientSocket = echoServer. try {
accept();
connection con = new connec pass = is.readLine();
tion(clientSocket);
} if(pass.equals(“1”)) {

}catch(IOException e) { tableName =
System.err.println(“Not listen- is.readLine(); //subject-
ing.” + e); Selected
System.exit(1); tableName +=
} is.readLine(); //classSe-
} lected
}
ResultSet rset = stmt.
class connection implements Runnable { executeQuery(“Select * from “+tableNa-
me);
Thread t; rset.last();
String tableName = “”; //this gets os.println(rset.get-
the name of the tablename from where String(1)); //lastSNo
the question and options are to be re-
trieved rset = stmt.
String requestQuestion = “”; executeQuery(“Select * from “+tableNa-

w w w. e f y m ag . co m e l e c t ro n i c s f o r yo u • m a r c h 2 0 0 9 • 8 9
software
section
me); lected); }
while(rset.next()) { rset.last();
os.println(rset.get- os.println(rset.get- }catch(Exception e) {
String(2)); //chapterNos String(1)); System.out.println(“Error oc-
os.println(rset.get- cured while sending/retrieving data:
String(3)); //chapterNames rset = stmt. “+e);
} executeQuery(“Select * from “+chapterSe- }finally {
} lected + “ where QNo = “+requestQues- try {
tion); clientSocket.close();
else if(pass.equals(“2”)) if(rset.next()) { is.close();
{ os.println(rset.get- os.close();
chapterSelected = String(2)); //send ques- stmt.close();
is.readLine(); //chapterSelected tion conn.close();
os.println(rset.get-
requestQuestion = String(3)); //send An- }catch(Exception e) {}
(String)is.readLine(); swer }
os.println(rset.get- }
ResultSet rset = stmt. String(4)); //send hint }
executeQuery(“Select * from “+chapterSe- }

clientonline.java
import java.awt.*; Group(); JRadioButton chemistry = new JRadi
import java.awt.event.*; bg.add(physics); oButton(“Chemistry”);
import javax.swing.*; bg.add(chemistry); chemistry.addActionListener(this);
bg.add(biology); add(chemistry);
public class ClientOnline extends bg.add(mathematics);
JFrame { JRadioButton biology = new
JButton connect = new JRadioButton(“Biology”);
public ClientOnline() { JButton(“Connect to DataBase”); biology.addActionListener(this);
connect.addActionListener(this); add(biology);
JTabbedPane jtp = new JTabbed- add(connect);
Pane(); } JRadioButton mathematics = new
jtp.addTab(“Class 10th”,new JRadioButton(“Mathematics”);
Class10th()); public void actionPerformed(ActionE mathematics.
jtp.addTab(“Class 12th”,new vent ae) { addActionListener(this);
Class12th()); add(mathematics);
getContentPane().add(jtp); if(ae.getActionCommand().
equals(“Connect to DataBase”) && sub- ButtonGroup bg = new Button-
addWindowListener(new WindowA- jectSelected != “”) { Group();
dapter() { try { bg.add(physics);
public void windowClosing(Wind new ConnectDatabase1(classS bg.add(chemistry);
owEvent we) { elected,subjectSelected,1,1,0,img,img,r bg.add(biology);
dispose(); andomQnoStored); bg.add(mathematics);
}
}); }catch(Exception e) { JButton connect = new
} System.out.println(“Could JButton(“Connect to DataBase”);
not connect to the database Server connect.addActionListener(this);
public static void main(String !!!”+e); add(connect);
args[]) { } }
ClientOnline clonlie = new Clien- }
tOnline(); public void actionPerformed(ActionE
clonlie.setSize(400,150); else if(ae.getActionCommand(). vent ae) {
clonlie.setVisible(true); equals(“Physics”)) { if(ae.getActionCommand().
} subjectSelected = “Physics”; equals(“Connect to DataBase”) && sub-
} } jectSelected != “”) {

class Class10th extends JPanel imple- else if(ae.getActionCommand(). try{


ments ActionListener { equals(“Chemistry”)) { new ConnectDatabase1(classS
subjectSelected = “Chemistry”; elected,subjectSelected,1,1,0,img,img,r
String subjectSelected = “”; } andomQnoStored);
String classSelected = “10”; }catch(Exception e) {
String[] img = new String[15]; else if(ae.getActionCommand(). System.out.println(“Could
int[] randomQnoStored = new int[15]; equals(“Biology”)) { not connect to database !!!”);
subjectSelected = “Biology”; }
public Class10th() { } }

JRadioButton physics = new else if(ae.getActionCommand(). else if(ae.getActionCommand().


JRadioButton(“Physics”); equals(“Mathematics”)) { equals(“Physics”)) {
physics.addActionListener(this); subjectSelected = “Mathemat- subjectSelected = “Physics”;
add(physics); ics”; }
}
JRadioButton chemistry = new JRadi } else if(ae.getActionCommand().
oButton(“Chemistry”); } equals(“Chemistry”)) {
chemistry.addActionListener(this); subjectSelected = “Chemistry”;
add(chemistry); class Class12th extends JPanel imple- }
ments ActionListener {
JRadioButton biology = new else if(ae.getActionCommand().
JRadioButton(“Biology”); String subjectSelected = “”; equals(“Biology”)) {
biology.addActionListener(this); String classSelected = “12”; subjectSelected = “Biology”;
add(biology); String[] img = new String[15]; }
int[] randomQnoStored = new int[15];
JRadioButton mathematics = new else if(ae.getActionCommand().
JRadioButton(“Mathematics”); public Class12th() { equals(“Mathematics”)) {
mathematics. subjectSelected = “Mathemat-
addActionListener(this); JRadioButton physics = new ics”;
add(mathematics); JRadioButton(“Physics”); }
physics.addActionListener(this); }
ButtonGroup bg = new Button- add(physics); } 

9 0 • m a r c h 2 0 0 9 • e l e c t ro n i c s f o r yo u w w w. e f y m ag . co m
Power Supply

Charging Lithium-Ion
Batteries
Properly restoring energy using the latest battery technology for today’s portable
products requires careful consideration. An understanding of the charging
characteristics of the battery and the application’s requirements is essential in
order to design an appropriate and reliable battery charging system.
Linear and switch-mode charging solutions for Li-ion batteries are presented
here. Also given are the guidelines and considerations that should be taken into
account when developing any battery charging system
Each application is unique, but
one common theme rings through:
maximise battery capacity usage. This
theme directly relates to how energy is
properly restored to rechargeable bat-
teries. No single method is ideal for all
applications. An understanding of the
charging characteristics of the battery
and the application’s requirements is
essential in order to design an appro-
priate and reliable battery charging
system. Each method has its associated
advantages and disadvantages.
It is the particular application
with its individual requirements that
determines which method will be the
best to use.
Far too often, the charging system
is given low priority, especially in cost-
sensitive applications. The quality of
the charging system, however, plays a
key role in the life and reliability of the
battery. In this article, the fundamen-
tals of charging Lithium-ion (Li-ion)
batteries are explored. In particular,
linear charging solutions and a micro-
controller-based, switch-mode solution
shall be explored.

Li-ion charging
The rate of charge or discharge is often
expressed in relation to the capacity of
 Scott Dearborn batteries as a prime power source is on the battery. This rate is known as the
the rise. As a result, a burden has been C-rate. The C-rate equates to a charge

P
owering today’s portable world placed on the system designer to create or discharge current and is defined as:
poses many challenges for sophisticated systems utilising the bat- I = M × Cn
system designers. The use of tery’s full potential. where ‘I’ is charge or discharge current

9 2 • M a r c h 2 0 0 9 • e l e c t ro n i c s f o r yo u w w w. e f y m ag . co m
Power Supply
current of 100 mA.
Typically, manufacturers specify
the capacity of a battery at a 5-hour
rate, n = 5. For example, the above-
mentioned battery would provide
five hours of operating time when
discharged at a constant current of
200 mA. In theory, the battery would
provide one hour of operating time
when discharged at a constant current
of 1000 mA. In practice, however, the
operating time will be less than one
hour due to inefficiencies in the dis-
charge cycle.
So how is energy properly restored
to a Li-ion battery? The preferred
charge algorithm for Li-ion battery
Fig. 1: Li-ion charge profile chemistries is a constant-current, con-
stant-voltage algorithm that can be
broken up into four stages, namely,
trickle charge, constant-current charge,
constant-voltage charge and charge
termination (refer to Fig. 1):
Stage 1 (trickle charge): Trickle
charge is employed to restore charge
to deeply depleted cells. When the cell
voltage is below approximately 3V, the
cell is charged with a constant current
of 0.1C maximum.
Stage 2 (constant-current charge):
After the cell voltage has risen above
the trickle-charge threshold, the charge
current is raised to perform constant-
current charging. The constant-current
charge should be in the 0.2C to 1.0C
range. The constant current does not
need to be precise and semi-constant
Fig. 2: Capacity loss vs undercharge voltage current is allowed. Often, in linear
chargers, the current is ramped-up as
the rated capacity in the cell voltage rises in order to mini-
Ah and ‘n’ is the time mise heat dissipation in the pass tran-
in hours at which ‘C’ sistor.
is declared. Charging at constant current rates
A battery dis- above 1C does not reduce the overall
charging at a C-rate charge cycle time and should be avoid-
of ‘1’ will deliver its ed. When charging at higher currents,
nominal rated capac- the cell voltage rises more rapidly due
ity in one hour. For to over-voltage in the electrode reac-
example, if the rated tions and the increased voltage across
capacity is 1000 mAh, the internal resistance of the cell. The
Fig. 3: Typical linear solution a discharge rate of constant-current stage becomes shorter,
1C corresponds to a but the overall charge cycle time is not
in amperes, ‘M’ is the multiple or frac- discharge current of 1000 mA. A rate reduced because the percentage of time
tion of ‘C,’ ‘C’ is the numerical value of of C/10 corresponds to a discharge in the constant voltage stage increases

9 4 • M a r c h 2 0 0 9 • e l e c t ro n i c s f o r yo u w w w. e f y m ag . co m
Power Supply
proportionately.
Stage 3 (constant voltage): Constant
current charge ends and the constant-
voltage stage is invoked when the
cell voltage reaches 4.2V. In order to
maximise performance, the voltage
regulation tolerance should be better
than 1 per cent.
Stage 4 (charge termination): Un-
like nickel-based batteries, it is not
recommended to continue to trickle-
charge Li-ion batteries. Continuing Fig. 4: Typical, fully integrated, linear solution
to trickle charge can cause plating
of metallic lithium—a condition that
makes the battery unstable. The result
can be sudden, automatic and rapid
disassembly.
Charging is typically terminated by
one of two methods: minimum charge
current or a timer (or a combination
of the two). The minimum current
approach monitors the charge cur-
rent during the constant voltage stage
and terminates the charge when the
charge current diminishes in the range
of 0.02C to 0.07C. The second method
determines when the constant voltage
stage is invoked. Charging continues
for an additional two hours, and then
the charge is terminated. Fig. 5: MCP73843 charge cycle waveforms
Charging in this manner replenish-
es a deeply depleted battery in roughly age can vary from 90Vrms to 132Vrms of 9V to 18V.
2.5 to 3 hours. for a standard wall outlet. Assuming Constant-current charge rate and
Advanced chargers employ ad- a nominal input voltage of 120Vrms, accuracy. The choice of topology for a
ditional safety features. For example, the tolerance is +10 per cent, –25 per given application may be determined
the charge is suspended if the cell tem- cent. The charger must provide proper by the desired constant current. Many
perature is outside a specified window, regulation to the battery independent high-constant-current, or multiple-cell,
typically 0°C to 45°C. of its input voltage. The input voltage applications rely on a switch-mode
to the charger will scale in accordance charging solution for improved effi-
Li-ion charging: system to the AC mains voltage and the charge ciency and less heat generation.
considerations current: Linear solutions are desirable in
A high-performance charging system VO =√2×VIN×a–1O (REQ+RPTC) – 2×VFD low to moderate fast-charge-current
is required to recharge any battery REQ is the resistance of the second- applications for their superior size and
quickly and reliably. The following ary winding plus the reflected resist- cost considerations. However, a linear
system parameters should be consid- ance of the primary winding (RP/a2), solution purposely dissipates excess
ered in order to ensure a reliable, cost- RPTC is the resistance of the PTC and power in the form of heat.
effective solution. VFD is the forward drop of the bridge The tolerance on the constant-
Input source. Many applications rectifiers. In addition, transformer-core current charge becomes extremely
use very inexpensive wall cubes for loss will slightly reduce the output important to a linear system. If the
the input supply. The output voltage voltage. regulation tolerance is loose, pass
is highly dependent on the AC input Applications that charge from a transistors and other components
voltage and the load current being car adaptor can experience a similar will need to be oversized adding size
drawn from the wall cube. problem. The output voltage of a car and cost. In addition, if the constant-
In the US, the AC mains input volt- adaptor will be typically in the range current charge is low, the complete

w w w. e f y m ag . co m e l e c t ro n i c s f o r yo u • M a r c h 2 0 0 9 • 9 5
Power Supply

Fig. 6: Switch mode SEPIC charger

9 6 • M a r c h 2 0 0 9 • e l e c t ro n i c s f o r yo u w w w. e f y m ag . co m
Power Supply
charge cycle will be extended. present. The maximum current drain
Output-voltage regulation accu- should be below a few microamperes
racy. The output-voltage regulation and, typically, below one microam-
accuracy is critical in order to obtain pere.
the desired goal: maximise the battery
capacity usage. A small decrease in Application examples
output voltage accuracy results in a Taking the above system consid-
large decrease in capacity. However, erations into account, an appropriate
the output voltage cannot be set arbi- charge management system can be
trarily high because of safety and reli- developed.
ability concerns. Linear solutions. Linear charg-
Fig. 2 depicts the importance of ing solutions are generally employed
output-voltage regulation accuracy. when a well-regulated input source
Charge termination method. It can- is available. Linear solutions, in these
not be stressed enough that over-charg- applications, offer advantages of ease
ing is the Achilles’ heal of Li-ion cells. of use, size and cost.
Accurate charge termination methods Due to the low efficiency of a
are essential for a safe, reliable, charg- linear charging solution, the most
ing system. important factor is the thermal design.
Cell temperature monitoring. The The thermal design is a direct function
temperature range over which a Li-ion of the input voltage, charge current
battery should be charged is 0°C to and thermal impedance between the
45°C, typically. Charging the battery pass transistor and the ambient cool-
at temperatures outside of this range ing air. The worst-case situation is
may cause the battery to become hot. when the device transitions from the
During a charge cycle, the pressure trickle charge stage to the constant-
inside the battery increases causing current stage. In this situation, the
the battery to swell. Temperature and pass transistor has to dissipate the
pressure are directly related. As the maximum power. A trade-off must
temperature rises, the pressure can be made between the charge current,
become excessive. This can lead to size, cost and thermal requirements of
a mechanical breakdown inside the the charging system.
battery or venting. Charging the bat- Take, for example, an application
tery outside of this temperature range required to charge a 1000mAh, single
may also harm the performance of Li-Ion cell from a 5V±5% input at a
the battery or reduce the battery’s life constant-current charge rate of 0.5C
expectance. or 1C. Fig. 3 depicts a low-cost, stan-
Generally, thermistors are included dalone linear solution. With a few
in Lithium-ion battery packs in order external components, the preferred
to accurately measure the battery charge algorithm is implemented.
temperature. The charger measures The MCP73843 combines high-accu-
the resistance value of the thermis- racy constant-current, constant-volt-
tor between the thermistor terminal age regulation with automatic charge
and the negative terminal. Charging termination.
is inhibited when the resistance, and In an effort to further reduce the
therefore the temperature, is outside size, cost and complexity of linear
the specified operating range. solutions, many of the external compo-
Battery discharge current or reverse nents can be integrated into the charge
leakage current. In many applications, management controller. Advanced
the charging system remains connected packaging and reduced flexibility
to the battery in the absence of input come along with higher integration.
power. The charging system should These packages require advanced
minimise the current drain from the equipment for manufacturing, and,
battery when input power is not in many instances, preclude rework.

w w w. e f y m ag . co m e l e c t ro n i c s f o r yo u • M a r c h 2 0 0 9 • 9 7
Power Supply
protection, high-side gate drive and
current sense, and pulsed input current
(EMI concern).
The SEPIC topology has advantag-
es that include low-side gate drive and
current sense, continuous input current
and DC isolation from input to output.
The main disadvantage of the SEPIC
topology is the use of two inductors
and an energy transfer capacitor.
Fig. 6 depicts a schematic for a
switch-mode charger. A high-speed
pulse-width modulator (PWM),
MCP1630, has been utilised in a
pseudo smart battery charger ap-
plication. The MCP1630 is a high-
Fig. 7: Switch-mode charge cycles with and without PS700, 2200mAh speed, microcontroller-adaptable,
pulse-width modulator. When used
Typically, integration encompasses designer has to make a trade-off be- in conjunction with a microcontroller,
charge-current sensing, the pass tran- tween charge time, power dissipation the MCP1630 will control the power
sistor and reverse-discharge protection. and available capacity. system duty cycle to provide output
In addition, these charge-management Switch-mode charging solutions. voltage or current regulation. The
controllers typically employ some type Switch-mode charging solutions are microcontroller, PIC16F684, can be
of thermal regulation. Thermal regula- generally employed in applications used to regulate the output voltage
tion optimises the charge cycle time that have a wide-ranging input or a or current, switching frequency and
while maintaining device reliability by high input-to-output voltage differen- maximum duty cycle. The MCP1630
limiting the charge current based on tial. In these applications, switch-mode generates duty cycle, and provides
the device die temperature. Thermal solutions have the advantage of im- fast over-current protection based
regulation greatly reduces the thermal proved efficiency. The disadvantages on various external inputs. External
design effort. are system complexity, size and cost. signals include the input oscillator,
Fig. 4 depicts a fully integrated, Take, for example, an application the reference voltage, the feedback
linear solution utilising the MCP73861. required to charge a 2200mAh, single voltage and the current sense. The
The MCP73861 incorporates all the Li-ion cell from a car adaptor at a con- output signal is a square-wave pulse.
features of the MCP73843 along with stant-current charge rate of 0.5C or 1C. The power train used for the charger
charge-current sensing, the pass tran- It would be extremely difficult to utilise is SEPIC.
sistor, reverse-discharge protection and a linear solution in this application due The microcontroller provides an
cell temperature monitoring. to the thermal issues involved. A linear enormous amount of design flexibility.
Charge-cycle waveforms. Fig. 5 de- solution employing thermal regulation In addition, it can communicate with
picts complete charge cycles utilising could be utilised, but the charge cycle a battery monitor inside the battery
the MCP73843 with constant-current times at the reduced charge currents pack to significantly reduce charge-
charge rates of 1C ad 0.5C. Charging may be prohibitive. cycle times.
at a rate of 0.5C instead of 1C takes The first step to designing a suc- Charge-cycle waveforms. Fig. 7 shows
about one hour longer for the end of cessful switch-mode charging solution complete charge cycles utilising the
charge to be reached. The MCP73843 is to choose a topology: buck, boost, switch-mode charging solution. By
scales the charge termination current buck-boost, flyback, single-ended pri- utilising a battery monitor in the
proportionately with the fast charge mary inductive converter (SEPIC) or charging system, charge cycles can
current. The result is an increase of other. Knowing the input and output be significantly reduced. The battery
36 per cent in charge time with the requirements, and experience, quickly monitor eliminates sensing the voltage
benefit of a 2 per cent gain in capacity narrows the choices down to two for produced across the pack’s protection
and reduced power dissipation. The this application: buck or SEPIC. A buck circuitry and contact resistance by the
change in termination current from converter has the advantage of requir- charging current. 
0.07C to 0.035C results in an increase ing a single inductor. Disadvantages
in final capacity from around 98 of this topology include an additional The author is principal applications engineer at
per cent to 100 per cent. The system diode required for reverse-discharge Microchip Technology Inc., Chandler, USA

9 8 • M a r c h 2 0 0 9 • e l e c t ro n i c s f o r yo u w w w. e f y m ag . co m
design
Part 1 of 3
Reading the Datasheets of
Electronic Devices
A thorough understanding of datasheets allows the designers to select the right
device for their application and subsequently exploit the potential of the device
to the fullest. Beginning this month in a series of three articles, we would focus
on how to read a datasheet and then go on to discuss the datasheets of two of
the most commonly used electronics devices representing discrete devices and
integrated circuits
 Anil Kumar Maini and
Varsha Agrawal

M
ost of the present-day electron-
ics designers and application
engineers do not find it neces-
sary to look beyond the first page of the
datasheets of the electronic components
or devices while selecting one for their
application. They consider the knowl-
edge of a few major specifications of the
device sufficient for the design exercise
that they wish to undertake. Though
it may be adequate in some cases, the
design where the components are chosen
without giving due consideration to the
information contained in the datasheet
may not be the optimal one.
The datasheet of a device reveals its
true character and hence its suitability
for a given application. In addition to
listing down the device parameters, it
gives the electrical and environmental
conditions at which these parameters Fig. 1: First page of datasheet of power Mosfet type IRF250
have been measured and also contains
information on variation of important ally available from manufacturers. The Surely, the technical data of a given
parameters as a function of other word ‘comprehensive’ is used here to device in the short-form catalogue will
relevant electrical and environmental differentiate between the datasheet of a not be as comprehensive as it would
parameters. It is vital information device found in a short-form catalogue be in the detailed catalogue. In the
particularly when you are designing a and another datasheet of the same de- condensed version, one is likely to find
circuit or a module that has to qualify vice available in the detailed version. salient features, major performance
stringent environment standards. A For example, a company manufactur- specifications, package information
comprehensive datasheet almost in- ing a range of semiconductor devices and electrical characteristics along with
variably includes application circuits may have one condensed catalogue the condition for which they are valid.
recommended by the manufacturer. containing data on all categories of On the other hand, a detailed datasheet
devices like diodes, bipolar transistors, offers a range of characteristic curves
Comprehensive and MOSFETs and thyristors that it manu- showing variation of important pa-
condensed datasheets factures. It may also offer detailed rameters as a function of other relevant
Both comprehensive as well as con- catalogues separately for each of these parameters and typical application
densed versions of datasheets are usu- categories. circuits.

1 0 0 • M a r c h 2 0 0 9 • e l e c t ro n i c s f o r yo u w w w. e f y m ag . co m
design
capability and a low ther-
mal resistance… designed
primarily for half-wave AC
power control such as motor
controls, heating controls…
(taken from the datasheet
of S2800 series SCR)… high
photosensitivity, hermeti-
cally sealed… fast optical
sensor of high-modulation
bandwidth... (taken from the
data sheet of PIN photodiode
type BPX-65)… single-pulse
avalanche energy rated, na-
nosecond switching speeds,
linear transfer characteristics,
high input impedance… well
suited for applications such
as switching regulators, mo-
tor drivers, relay drivers…
Fig. 2: Package styles of op-amp type LM741 (taken from the datasheet
of power MOSFET type
IRF250 shown in Fig. 1)” are
representative of the first
page of the datasheet of the
device. This gives designers
a fair idea of the important
features and applications
without going through the
whole datasheet.
Device package outline.
A sketch with device dimen-
sions and lead identification,
outline of the package styles
of the device and other me-
chanical information are in-
cluded in this part. Quite of-
ten a given device is made in
more than one package style
either with no difference in
performance specifications
(such as medium-power sili-
con transistor type 2N6045/
MJE6045 made in TO220AB
Fig. 3: Internal schematic of op-amp type LM741
and TO127 package styles),
or with a minor difference
Common features ing features. All datasheets begin with (such as bipolar transistor 2N2222 in
A study of the datasheets of a variety typical applications as suggested by TO-92 plastic and TO-18 metal can
of devices, be they discrete or integrat- the manufacturer and the outstanding packages), and occasionally with a
ed circuit (IC), reveals a commonality features of the device. This informa- major difference (such as IC regulator
in the type of data and characteristic tion appears on the first page of the type 78-series in TO-92 plastic, TO-220
curves. These common features are datasheet and is an essential part of and TO-3 packages).
outlined in the following paragraphs. both condensed and detailed versions. Fig. 2 shows the package options
Typical applications and outstand- Statements like “It has high dv/dt for the operational amplifier LM741.

1 0 2 • M a r c h 2 0 0 9 • e l e c t ro n i c s f o r yo u w w w. e f y m ag . co m
design

Absolute Maximum Ratings (Note 1)


If military/aerospace specified devices are required, contact the National Semiconductor Sales Office/Distributors
for availability and specifications.

LF155/6 LF256/7/LF356B LF355/6/7

Supply voltage ±22V ±22V ±18V


Differential input voltage ±40V ±40V ±30V
Input voltage range (Note 2) ±20V ±20V ±16V
Output short circuit duration Continuous Continuous Continuous
TJMAX
H-package 150°C 115°C 115°C
N-package — 100°C 100°C
M-package — 100°C 100°C
Power dissipation at TA=25°C (Notes 1, 8)
H-package (still air) 560 mW 400 mW 400 mW
H-package (400 LF/min air flow) 1200 mW 1000 mW 1000 mW
N-package — 670 mW 670 mW
M-package — 380 mW 380 mW
Thermal resistance (typical) θJA
H-package (still air) 160°C/W 160°C/W 160°C/W
H-package (400 LF/min air flow) 65°C/W 65°C/W 65°C/W
N-package — 130°C/W 130°C/W
M-package — 195°C/W 195°C/W
(Typical) θJC
H-package 23°C/W 23°C/W 23°C/W
Storage temperature range –65°C to +150°C –65°C to +150°C –65°C to +150°C
Soldering information (lead temp.)
Metal can package
Soldering (10 sec.) 300°C 300°C 300°C
Dual-in-line package
Soldering (10 sec.) 260°C 260°C 260°C
Small outline package
Vapour phase (60 sec.) — 215°C 215°C
Infrared (15 sec.) — 220°C 220°C
See AN-450 ‘Surface Mounting Methods and Their Effect on Product Reliability’ for other methods of soldering
surface mount devices.
ESD tolerance
(100 pF discharged through 1.5kΩ) 1000V 1000V 1000V
Absolute maximum ratings tell the designer the conditions that will damage the device. Remember these are
not maximum operating limits

Fig. 4: Absolute maximum ratings for op-amp type LF156/256/356

As you can see from the figure, it is architecture. This sometimes helps the
available in three packages, namely, designer to explain the device behav-
the metal can package, dual-in-line iour that is otherwise not described in
package and ceramic flatpak pack- the datasheet.
age. Absolute maximum ratings. Abso-
Schematic diagram. Detailed sche- lute maximum ratings (Fig. 4) contain
matic of the internal structure of the information on voltages, currents, pow-
device is also given in the datasheet. ers and temperature range that should
Fig. 3 shows the internal schematic of never be exceeded. As is evident from
operational amplifier LM741. It helps the figure, the maximum supply volt-
the designer to correlate the electrical age for operational amplifier LF356 is
features of the device with its internal ±18V.

w w w. e f y m ag . co m e l e c t ro n i c s f o r yo u • M a r c h 2 0 0 9 • 1 0 3
design

Fig. 5: Performance curves of diodes 1N4001 to 1N4007

Performance curves. Perform- characteristics of the device, such characteristics) in the case of FETs,
ance curves of interest as a function as drain current versus drain volt- emitter voltage versus emitter cur-
of voltage, current, temperature, age (drain characteristics) or drain rent in the case of UJTs and forward
etc follow next. These include the current versus gate voltage (transfer voltage versus forward current in the

1 0 4 • M a r c h 2 0 0 9 • e l e c t ro n i c s f o r yo u w w w. e f y m ag . co m
design
case of diodes. Fig. 5 shows the char- to 1N4007. ode current changes with temperature.
acteristics curves for diodes 1N4001 It could also be variation of the cath- The curve in the second illustration
ode voltage vs cathode indicates critical dependence of the
current as a function of dark current of the PIN photodiode
temperature (Fig. 6) in on the applied reverse bias voltage.
the case of a thyristor, or And the third demonstrates significant
dark current as a func- reduction in the transconductance of the
tion of applied reverse MOSFET at a fixed drain current with
bias in the case of a PIN increase in temperature. These are all
photodiode, or transcon- very important aspects of design and
ductance versus drain therefore should not be side-stepped.
current as a function of Electrical characteristics. Electri-
temperature in the case cal characteristics are usually given
of power MOSFET. The in tabular form indicating spread
curve in the first case in parameter values that is likely to
emphasises that the re- occur in a batch of devices in terms
Fig. 6: Thyristor-cathode voltage vs. cathode current for different
lationship between the of minimum, typical and maximum
temperatures cathode voltage and cath- values. It is a vital design input as in

Fig. 7: Electrical characteristics of Mosfet type number IRF250

w w w. e f y m ag . co m e l e c t ro n i c s f o r yo u • M a r c h 2 0 0 9 • 1 0 5
design
These are always
an asset to the
designers, more
so for those who
are a little short
of design experi-
ence. Quite of-
ten, expressions
used to calculate
different compo-
nent values in a
given application
circuit are also
presented.
Fig. 8 shows
some of the appli-
cation circuits for
operational ampli-
fier LF356 given
in its datasheet.
The information
contained in Fig.
8 is reproduced
from the detailed
datasheet of LF
355/356/357 se-
ries of FET input
op-amps.

To sum up...
This part of the
article highlighted
the importance of
reading a datash-
eet and the host
of technical infor-
mation contained
therein. In par-
ticular, it focused
Fig. 8: Some application circuits of op-amp type LF156/256/356 on salient features
that are common
some cases, spread in values could be to the datasheets of all categories of
as much as an order of magnitude. devices illustrating the significance of
To substantiate the statement, the different parameters with practical ex-
datasheet of C122-series of SCRs from amples. The next part of the article will
RCA tells that its dv/dt rating could focus on semiconductor diodes.
be anywhere between 10V/s and …To be continued
100V/s. Similarly, the gate-source
threshold voltage of power MOSFET Anil Kumar Maini is the head of EOCM and Op-
type IRF250 could vary from 2V to toelectronics Division and associate director at
4V (Fig. 7). Laser Science and Technology Centre (Defence
R&D Organisation) and Varsha Agrawal is a senior
Application circuits. Application scientist in EOCM and Optoelectronics Division at
circuits are usually included only in Laser Science and Technology Centre (Defence
the detailed version of the datasheet. R&D Organisation)

1 0 6 • M a r c h 2 0 0 9 • e l e c t ro n i c s f o r yo u w w w. e f y m ag . co m
do-it-yourself

A Versatile
Frequency Counter
Often, the need for a frequency counter is felt that operates in the LF, HF
and VHF ranges. The most common deterrents are the lack of programming
knowledge and the non-availability of VHF prescalers to bring down VHF to a
manageable HF range. Here we show how a commonly available low-cost radio
may be ripped apart and used as a frequency counter covering frequencies
from 500 kHz to 150 MHz
 Vasuki Prasad this section. It is used
only to keep track of

C
hinese radio company Kchibo COM1 1 36 VDD time.
makes radios based on the CX- COM2 2 35 FMIN The on-chip oscil-
A1619BM IC. This IC is a sur- COM3 3
lator is a NOT gate
34 VSS
face-mount version of the CXA1619BS, that requires an exter-
SEG0 4 33 AMIN
which most designers are familiar nal 32.768kHz crystal
with; FM boards available in the mar- SEG1 5 32 AM/FM-SEL to generate the timing
ket are built using this IC. Kchibo and SEG2 6 31 RANGE base.
other companies went a step ahead The adder/subtrac-
SEG3 7 30 NC
and thought of implementing a radio tor unit works like this:
frequency display, along with an alarm SEG4 8 29 IF70K A super heterodyne
clock, in their radios so that any station SEG5 9 28 AL-OUT radio receiver requires
can be tuned into, without doubting
SEG6 10
6610 27 AL-SIG
a local oscillator operat-
the actual frequency which the radio ing at a fixed frequency
is tuned to (no blind or approximate SEG7 11 26 CLKFREQ-SEL above the incoming
tuning). This is not a radio synthesiser; SEG8 12 25 NC signal’s frequency. This
it’s a conventional, mechanically tuned SEG9 13
fixed frequency is called
24 HR-SET
radio that sports a frequency display. intermediate frequency,
SEG10 14 23 MIN-SET
As opposed to conventional radios or IF. For commercial
which use a single IC (the CXA1619BS/ SEG11 15 22 AL DISP FM radios, it is 10.7
BM), the so-called digital radio uses SEG12 16 21 AL ON/OFF MHz for FM and 455
two ICs: the radio receiver IC and the kHz for AM/SW.
OSC IN 17 20 RST
UTC6610. Now, if the frequen-
At the heart of this project is OSC OUT 18 19 VLCD cy counter was reading
UTC6610. It comes in many pack- the actual frequency of
ages, but these radios use the chip-on- Fig. 1: Pin configuration of UTC6610 the oscillator, the user
board variety. The UTC6610 comes would have been put to
equipped with a frequency counter low-to-high) within a set period. great trouble in determining the actual
circuitry, prescaler for VHF, clock cir- The prescaler for VHF is a divide- receiving frequency. For example, for a
cuitry (time), on-chip oscillator, simple by-ten block that probably uses high- 100MHz signal to be detected, the local
adder/subtractor or offset unit, and speed CMOS circuitry to divide the oscillator is made to run at 110.7 MHz
LCD driver. As can be seen, this unit number of pulses. When a 150MHz (100+10.7=110.7 MHz). So to display
is completely self-sufficient. The only signal is fed to the prescalar, the output the intended receiving frequency, the
external components required are is 15 MHz. Datasheets specify 300mV UTC6610 subtracts 10.7 MHz from the
crystal and LCD. peak-to-peak input; higher voltages will counted frequency. This means that if
The frequency counter circuitry of destroy the IC. The prescaler is activated you are to use the UTC6610 as a fre-
the IC measures the frequency of the only in the FM mode of operation. quency counter, always bear in mind
incoming RF wave by counting the As regards clock circuitry, we’re that the actual frequency is 10.7 MHz
number of transitions (high-to-low or not interested in it and hence skipping higher than the displayed frequency

w w w. e f y m ag . co m e l e c t ro n i c s f o r yo u • m a r c h 2 0 0 9 • 1 0 7
do-it-yourself

Modes of Operation
FM mode AM mode
Function details details
Input frequency range 11 to 150 MHz 0.5 to 30 MHz
Prescaler In operation Not in operation
Input voltage 300mV pk-pk recommended 300mV pk-pk recommended
Frequency resolution 10 kHz: 11.00 to 99.99 MHz 1 kHz: 500 to 9999 kHz
100 kHz: 11.0 MHz to 149.9 MHz 10 kHz: 0.50 to 29.99 MHz
Set in radio to 100kHz resolution Set in radio to 10kHz resolution for
SW and 1kHz resolution for MW Fig. 5: The brown PCB with the metallic shield,
which is our target
IF offset 10.7 MHz 455 kHz
70 kHz also available
Input resistance 150 ohms 2000 ohms

COL S1
AM
MHz
FM KHz
PM AL
DP2 DP1

(a)

Fig. 6: Opened up: The frequency counter


UTC6610 hidden away behind the LCD, while
the flip-flop circuitry (just to set FM, AM states) is
visible as the SMD transistors
Fig. 3: The radio

(b)

Fig. 2: (a) 4 digit-LCD and (b) image of the LCD

in the FM mode. In the AM mode, it is


455 kHz above the displayed frequen-
cy. 70kHz offsets are also available as
Fig. 7: The back side: RF shield-cum-LCD
an option in the FM mode, but we are mechanical support. Notice the purple and black
skipping this for now as the radios wire for VHF and HF input, respectively
we rip these modules from have no
70kHz IF.
The LCD driver converts binary
data into voltages necessary to drive
the LCD unit.

Opening up the radio


Fig. 4: Opened up radio; note that the brown
The best part about Kchibo KK-939B PCB is the frequency counter and LCD section
radio is use of minimal external points. and green PCB is the radio receiver
Also, it is simple to understand and
operate, has an LED light to illuminate frequency counter PCB (Fig. 9), you Fig. 8: The purple line leads to the take-off point
for the VHF oscillator (FM section), while the
the LCD, and looks good. I recommend will notice the solder joints marked VH rightmost black wire leads to the take-off point
beginners to buy this radio and rip it input, HF input, points ‘1’ through ‘5,’ for the AM oscillator
apart for a clean, high-performance FM and AM. VHF input is to be con-
frequency counter. nected to the RF source whose frequen- want to determine (up to 30 MHz).
To access the frequency counter cy you want to determine (from 11 to ‘1’ is an input point. It has to be
board, the radio (Kchibo KK-939B) has 150 MHz). HF input is to be connected kept at 0V for FM (VHF) operation
to be opened up. In the close-up of the to the RF source whose frequency you and 10kHz resolution in the AM mode

1 0 8 • m a r c h 2 0 0 9 • e l e c t ro n i c s f o r yo u w w w. e f y m ag . co m
do-it-yourself
PCB provided by the manufacturer of
the radio, so as to come up with a quick,
compact, cost-effective RF counter.
To have a look at the IC, lift the
LCD, and you will see that the chip-
on-board (COB) is the UTC 6610 (see
Fig. 10).

Making the RF counter


1. Cut out the 5-wire ribbon cable. Un-
Fig. 12: Crude connection example solder it from the counter board.
2. Cut the VHF and HF input wires
A flip-flop comprising SMD transis- from the points on the radio PCB, not
Fig. 9: Close-up of the frequency counter PCB tors on the PCB locks the UTC in this the counter PCB.
mode until the AM button is pressed. 3. The counter PCB is now sepa-
Default mode on startup is the FM rated from the radio receiver PCB.
mode. 4. Solder a red wire to point ‘3’ of
Pressing AM button activates the the counter PCB. This is your positive
HF counter with frequency range of 0.5 3V supply wire.
to 30 MHz. The input is via the black 5. Solder a green wire to point ‘4’ of
wire (shown in Fig. 9); the colour may the PCB. This serves as ground.
differ in your radio. Set point 1 to Vcc 6. Connect a small switch between
for 1kHz resolution and RF input of point ‘1’ and GND and Vcc, as shown
0.5 to 9.999 MHz. Set point 1 to 0V for in Fig. 11. Push the switch to 1kHz
10kHz resolution and 0.5 MHz to 29.99 position for 1kHz resolution in the
Fig. 10: The chip-on-board is the UTC6610 MHz. Actual tests show it exceeds AM mode, and to 10kHz resolution for
75 MHz in this mode, which is good. 10kHz in the AM mode. The switch has
(HF opera- Reading on the display must be added to be kept in the 10kHz resolution mode
tion). Setting to 455 kHz to get the actual frequency. for proper VHF operation (FM mode).
it to Vcc in HF A flip-flop comprising SMD transis- With this, your crude-looking but
mode only sets tors on the PCB locks the UTC in this great-performance RF counter is set to
the display mode until the FM button is pressed. go. But bear a few things in mind:
resolution to Default mode on startup is the FM 1. Keep the VHF and HF wires as
1 kHz. ‘2’ is an mode. To activate the AM mode, this short as possible. Their length will not
output point button has to be pressed. affect the performance of the counter,
Fig. 11: Connect a small
switch between point ‘1’ for the radio Notice the blob of solder above the but the circuit under test (for example,
and GND and Vcc which lets VHF input point. This is the ground. the oscillator you might have built).
the IC know Of course, the clock pushbuttons 2. Couple the HF and VHF wires to
whether it’s the AM (SW/MW) mode are still working perfectly, so you may the RF sources via a 2pF capacitor.
or FM mode. ‘3’ is an input point at use them to set the clock too. You will 3. Preferably, replace the VHF and
Vcc (3V, do not exceed 3.3V). ‘4’ is the have to shift the SPDT switch (the HF crude wires with easily available
input point at GND. ‘5’ is the output switch which controls the radio ‘on’ 75-ohm cable TV coax. This provides
point that controls power to the radio, and ‘off’) to ‘off’ position in order to RF shielding and noise immunity to a
shutting off power to the IC when in activate the clock, and to ‘on’ position good degree.
clock mode. in order to activate the RF counter. Fig. 12 shows a crude connection
Pressing FM button activates the Please note that here we’re not try- example. Note how the green wire (HF
VHF counter with a resolution of 100 ing to use the UTC6610 directly. Most wire) is directly fed to the output of the
kHz and frequency range of 11 MHz of the hard work of wiring up the 6610 oscillator (very crude, do not attempt
to 150 MHz. The input is via the pur- IC, providing an LCD, making the PCB this), without any capacitor or buffer.
ple wire (shown in Fig. 9); the colour and adding components has been done (I admit this green wire belongs to a
may differ in your radio. You must set by the radio manufacturer; in this case, different counter, but the operation
point 1 to 0V for proper operation. The Kchibo. All we are attempting to do and concept are the same, as it too uses
display reading must be added to 10.7 here is to understand operation of the the UTC6610.) Once I disconnected the
MHz to get the actual frequency. UTC6610, and in turn operation of the counter from the oscillator I had made,

w w w. e f y m ag . co m e l e c t ro n i c s f o r yo u • m a r c h 2 0 0 9 • 1 0 9
do-it-yourself
the frequency moved up by 1 MHz.
What is important to understand
here is: If you’re keeping the counter
connected to the output of a non-
buffered oscillator, the reading of the
counter plus 455/10.7 (as the case may
be, FM or AM mode, as shown on the Fig. 13: Suggested connection
LCD) will be the true reading. At-
tempting to count the frequency and Fig. 13 shows the suggested con-
then disconnecting the counter will set nection. Never connect the HF and Fig. 14: Another radio receiver example
the oscillator at a different frequency VHF counter pins together. Use sepa-
after counting due to the capacitance rate ports and coax cables for both. tions is much more. Besides, separating
and loading effect of the counter. The the counter PCB from the radio PCB
reading got then is invalid as the fre- Why it’s good for removes the luxury of pushbuttons
quency changes on the removal of the beginners? and flip-flops; which are present in the
counter. There are other radio receiver models KK-939B.
Keeping this effect in mind, it is available with more work to do (in It took me two month to under-
important to: terms of points). Fig. 14 shows an stand the operation of the counter
1. Use the 2pF capacitor. It causes example: As you can see, the number shown in Fig. 14. After all the UTC6610
minimal frequency shift due to mini- of lines is more, and more connec- learning and circuit decoding (exten-
mal capacitance effect, so that the tions have to be made in order to get sive), the KK-939 took only 17 minutes
reading obtained, and the frequency it working. But for a beginner, the KK- flat. That’s why it’s good for beginners.
after removing the counter from your 939B is a great radio with a great coun- Enjoy and have fun with your inexpen-
oscillator, don’t differ much. ter board. It has on-board flip-flops sive counter. The radio should be avail-
2. Buffer your oscillator. Buffer- that make the external connections able for Rs 250 or less. Have fun! 
ing of oscillators is very important to simple. In the case of the board shown
prevent your oscillators from being in Fig. 14, all the flip-flops are on the The author is from Manipal Institute of Technol-
affected by external components. radio PCB, so the number of connec- ogy

Statement about ownership and other particulars about


Electronics For You
FORM IV (See Rule 8)
1. Place of publication : New Delhi
2. Periodicity of its publication : Monthly
3. Printer’s Name : Ramesh Chopra
Nationality : Indian
Address : Electronics For You
D-87/1, Okhla Industrial Area,
Phase I, New Delhi 110020
4. Publisher’s Name : Same as (3) above
Nationality
and address
5. Names and addresses of : EFY Enterprises Pvt Ltd
individuals who own the D-87/1, Okhla Industrial Area,
newspaper & partners or Phase 1, New Delhi 110020
shareholders holding more
than 1% of the total capital

I, Ramesh Chopra, hereby declare that the particulars given above are true to the best of
my knowledge and belief.
Date: 28-2-2009
Ramesh Chopra
Publisher

1 1 0 • m a r c h 2 0 0 9 • e l e c t ro n i c s f o r yo u w w w. e f y m ag . co m
wireless

Bluetooth Scatternets
A Cost-Effective Solution for Communication
The most popular application of Bluetooth is communication between
two directly paired devices. Here, we explore a less popular but powerful
application of Bluetooth which can help extend the range of Bluetooth
communication and provide a free infrastructure for communication
Scatternets: A set of
piconets
When there is a collection of devices
paired with each other, it forms a
small personal area network called
‘piconet.’ A piconet consists of a mas-
ter and at most seven active slaves.
Each piconet has its own hopping se-
quence and the master and all slaves
share the same channel. In a piconet,
the master and slave devices trans-
mit packets in even and odd slots,
respectively.
Two or more piconets connected
to each other by means of a device
(called ‘bridge’) participating in both
the piconets, form a scatternet. The role
of the bridge is to transmit data across
 Ahzam Ali Bluetooth is an evolving technol- piconets. Fig. 1 shows a scatternet
ogy. It has gone through three (stand- structure in which devices ‘a’ and ‘c’

B
luetooth is a low-power, low- ardised) revisions of the approved play the master role and device ‘b’ acts
cost and short-range wireless standard by Bluetooth Special Interest as the bridge.
technology. It was originally Group (SIG), the latest one being Blue- The scatternet formation has not
developed by Ericsson for short-range tooth 2.1 EDR (enhanced data rate) in been formally defined in the Bluetooth
communication between personal early part of 2008. The latest standard SIG specifications. As a result, numer-
devices, e.g., data transfer between supports enhanced usability, i.e., pair- ous protocols have been proposed.
a cellphone and a computer, or com- ing of devices by means of near-field While modeling ad-hoc networking,
munication with a printer. Bluetooth communication (NFC), enhanced in general, is complex, the additional
devices use the unlicensed ISM band security and broader range of device restrictions imposed by the Bluetooth
at 2.4 GHz. profiles. specifications—such as low cost of
Nowadays most of the mobile de- When a number of Bluetooth de- the device, low power consumption
vices, including mobile phones, MP3 vices communicate to each other in the and network resilience while using
players, digital cameras, video cam- same vicinity, there is a high level of piconets that have a maximum of
eras, PDAs, laptop PCs, tablet PCs and interference. To combat interference, seven active nodes—have created a
so forth, are equipped with Bluetooth. Bluetooth technology applies a fast
So you can exchange data between frequency-hopping scheme which hops P1 c P2

these devices without requiring the over 79 channels 1600 times per second. a b
MASTER
use of wires. Bluetooth is considered For devices to communicate to each SLAVE
to be a high-potential technology for other using Bluetooth they need to be BRIDGE
providing wireless communication in paired with each other to have synchro-
a home-networking environment. nised frequency-hopping sequence. Fig. 1: Scatternet structure

1 1 2 • m a r c h 2 0 0 9 • e l e c t ro n i c s f o r yo u w w w. e f y m ag . co m
wireless
significant challenge. of the scatternet, it transfers its re-
sponsibilities to another device in the
Formation of scatternets scatternet.
There has been a comprehensive study There is a switching delay (called
to propose an efficient formation of con- ‘guard time’) introduced by bridges
nected scatternet. One important prob- Fig. 2: Showing efficient network after role
while they try to transmit packets
lem that exists with scatternet as well switching across the piconets. Eliminating the
as piconet formation is to keep track of unnecessary bridges from the net-
the device that comes in and goes out of work will improve the perform-
the network—since these are low-power ance of the scatternet. There exist
handheld devices with limited commu- various protocols and algorithms
nication range over Bluetooth. A device to optimise the roles that a device
connects to another device at random, assumes in a scatternet.
according to their 48-bit Bluetooth ad- We see in the following exam-
dresses and clocks, which control the ples how effective role assignment
hopping behaviour in inquiry or inquiry Fig. 3: Unnecessary bridge elimination can reduce the hop count while
scan states. Most protocols seek to re- routing a packet, help reduce
duce the scatternet formation time and packet collisions the number of bridges in the network
form fast routing algorithms. 7. Maximise the amount of data and result in an efficient scatternet
It turns out that a good scatternet throughput structure.
formation protocol should: Given a scatternet, you can evaluate In Fig. 2, the original network was
1. Be fully distributed and rely on its performance based on the number formed with ‘c’ as a bridge node and ‘a’
local information of piconets, the number of nodes per and ‘b’ as the masters on two different
2. Generate connected scatternets piconet, the number of bridge nodes, piconets p1 and p2. Using role switch-
3. Be resilient to the disconnection the number of roles per node, average ing, with the help of ‘c,’ improves the
of nodes anywhere in the scatternet traffic delay, throughput and maxi- structure of the scatternet (now formed
4. Provide multiple routes for ro- mum traffic delay. as a ‘piconet’), shortens the routing
bustness and be self-healing Numerous models have been path and eliminates the bridge delay
5. Limit the number of bridges proposed for constructing Bluetooth in the network.
6. Limit the number of roles a de- scatternets, some of which may require Fig. 3 shows another example of
vice can assume modifications to the existing Bluetooth better role switching operation that
7. Be aware of device resources specifications. results in an improved network struc-
While forming a scatternet, keep ture.
in mind that you are dealing with, in Role switching
general, small, energy- and process- Role switching enables two devices Scatternet applications
ing-power-starved devices. The fol- to exchange roles very rapidly, rather By now you might be wondering what
lowing points should be taken care of than reconnecting by executing the possible use these scatternets could be
while developing scatternet formation time-consuming inquiry and inquiry put to. Well, there are papers proposing
protocols: scan processes. The role switching voice communication between two mo-
1. Minimise scatternet construction operation involves fewer slots than the bile devices connected over a Bluetooth
time inquiry/inquiry scan and page/page scatternet, up to a distance of 100 metres
2. Minimise the amount of control scan operations in switching the roles in an indoor environment. One of the
data transmitted of the devices. popular applications developed by No-
3. Minimise the number of hops There are three major types of role kia, called ‘sensor,’ works on somewhat
required for communication between switching operations: similar principles. It lets users communi-
devices, in order to improve response 1. Combining. A situation where a cate to each other, bypassing the service
times single node works both as slave in one provider’s network, over Bluetooth.
4. Minimise power consumption. piconet and master in another. Sensor networks are another ex-
Master-and-bridge mode of operation 2. Splitting. A piconet with a large ample where the Bluetooth scatternets
requires more power than slave mode number of devices divided in two can be used. Since sensor networks are
5. Minimise the number of roles piconets with smaller number of de- generally ad-hoc, Bluetooth scatternet
assigned to nodes vices. can be used for communication of
6. Minimise the number of piconets 3. Take-over. When the existing sensors with each other and the base.
to provide faster routing and reduced mast or a bridge is about to move out This will eliminate the requirement of

w w w. e f y m ag . co m e l e c t ro n i c s f o r yo u • m a r c h 2 0 0 9 • 1 1 3
wireless
developing a special-purpose protocol for Bluetooth scatternets. Also, there that broadcast information to all Blue-
for sensor networks. are quite a few papers which discuss tooth devices in the vicinity. So users
the point of organising the scatternet will be able to pull relevant informa-
Problems to be addressed in an efficient fashion, dealing with tion from the system.
The Bluetooth scatternet formation disparate aspects of scatternet opti- 2. Topology manger. It will enable
devices are generally small, running on misation. A proposal in ‘Bluetooth better configuration of piconets and
batteries, with low-powered CPU and Scatternet Formation for Supporting even scatternets.
low memory. At the same time, these are Device Mobility,’ by Chorng-Horng 3. Alternate media access physical
highly mobile and may frequently move Yang and Yi- Sheng Chen, deals with layer. It will enable use of some other
in and out of the network. This leads us mobility support in a Bluetooth scat- wireless technology for actual data
to think about: ternet network, but relies on a Blue- transfer at higher rate while maintain-
1. Topology and size of scatternets. tooth backbone network consisting of ing the initial pairing on standard
What is the optimal number of piconets devices that are not mobile. Another Bluetooth.
in the scatternet and how many nodes work done on similar lines is ‘Tracking 4. QoS improvements. These will
are there? The number of bridge nodes the Optimal Configuration of a Blue- enable audio and video data transmis-
increases (proportionally) with the tooth Scatternet’ by Csaba Kiss Kalló sion at a higher quality.
increasing number of piconets. The in- and Carla-Fabiana Chiasserini, which Nokia and Bluetooth SIG have an-
creases, in turn, incur significant over- deals with similar problem of redefin- nounced that Wibree (Nokia’s low pow-
head: loss of one or more time slots to ing the role of nodes in scatternets but er wireless communication protocol) will
readjust clocking when shifting from concentrates on improving the energy be a part of the Bluetooth specification
one piconet to another, more traffic efficiency of the nodes. Also, there are as an ultra-low-power Bluetooth tech-
than non-bridge nodes and increased numerous proposals for routing proto- nology, to be used in caller ID watches,
battery power consumption to perform cols including MANET (mobile ad-hoc sports sensors (used for monitoring the
these tasks. network) protocols. wearer’s heart rate during exercise) as
What is the optimal number of well as medical devices. A medical de-
piconets in which a bridge should par- Future in Bluetooth vices profile and associated protocols are
ticipate? The more the piconets with The new Bluetooth specification, called being developed by the Medical Devices
which a bridge communicates, the less the Bluetooth 2.1, is already published. Working Group (MDWG).
the time during which the bridge will It is fully backward-compatible with Bluetooth 3.0. The next version of
be available for dealing with traffic 1.1. The specification includes many Bluetooth after v2.1, code-named Seat-
from/to each individual piconet, thus new security and usability enhance- tle, is proposed to adopt ultra-wide-
increasing the likelihood of bottlenecks, ments. The most interesting of these band (UWB) radio technology. This
at the bridge itself. is incorporation of the near-field will allow Bluetooth use over UWB
2. Formation delay and resilience. communication (NFC) device, which radio, enabling very fast data transfers
How much time is required to con- helps in pairing of two Bluetooth de- of up to 480 Mbps, while taking the ad-
struct, optimise and maintain the scat- vices equipped with NFC chip by just vantage of very low-power idle modes
ternet? The ad-hoc, dynamic nature of bringing them close to each other. For of Bluetooth.
a Bluetooth network requires constant example, a headset can be paired with
modifications to the scatternet topol- a Bluetooth 2.1 phone having NFC Extending the scope
ogy to support devices that join and chip just by bringing the two devices Even though work on Bluetooth scat-
leave. How to handle the nodes that close to each other. Another example ternet is going on for about a decade
join or leave the scatternets? is automatic uploading of photos from now, it has failed to generate interest
3. Polling and scheduling. In what a mobile phone to a digital picture amongst general consumer electronics
order will the slaves be polled by the frame just by bringing the phone close goods manufacturers. Bluetooth scat-
master? Does the scatternet topology to the frame. Features like this and ternets find most of their use in sensor
impact the ability to handle scheduled other security enhancements will help networks. When there is a limitation
communications from slaves in sniff or Bluetooth gain user confidence. on setting up the communication in-
hold state? A lot of work is in progress in frastructure, Bluetooth scatternet could
4. Routing. Does the scatternet topol- the area of Bluetooth, to enhance and turn out to be a cost-effective solution.
ogy allow efficient routing of messages? widen the application of Bluetooth In future, as the processing power of
protocol. In the future, we may expect electronic devices grows and they be-
Work in the area features like: come more energy-efficient, Bluetooth
There are a number of papers discuss- 1. Broadcast channels. These will might see its way into already evolving
ing the effective routing protocols enable Bluetooth information points Bluetooth standards. 

1 1 4 • m a r c h 2 0 0 9 • e l e c t ro n i c s f o r yo u w w w. e f y m ag . co m
cONSTRUCTION

PC-BASED WIRELESS
STEPPER MOTOR control
mar
sunil ku

 V. Mariyappan signals are transmitted from the RF Parts List


transmitter and received by the RF

S
Semiconductors:
tepper motors find lots of ap- receiver. IC1 - HT12E Holtek encoder
plications in process control, IC2 - 7806, 6V regulator
machine tools and robotics. Es- Circuit description IC3 - HT12D Holtek decoder
IC4 - CD40106 hex inverter
pecially in robotics and process control, Fig. 1 shows the block diagram for IC5 - ULN2003 Darlington array
it is necessary to control the stepper PC-based wireless control of a stepper T1-T4 - BC547 npn transistor
motor from a remote place. motor. The signals from the parallel T5 - BC548 npn transistor
Here we describe how to wirelessly port of the PC are interfaced to the RF D1-D4 - 1N4148 switching diode
D5-D10 - 1N4007 rectifier diode
control a stepper motor from a remote transmitter through an encoder. The TX1 - TX-433 RF transmitter
place by using RF modules. For this encoder continuously reads the status RX1 - RX-433 RF receiver
wireless stepper-motor control system, of the relay switches, passes the data LED1 - 5mm LED
you need to design and develop the to the RF transmitter and the transmit- Resistors (all ¼-watt, ±5% carbon):
R1 - 1-mega-ohm
required hardware and software. The ter transmits the data. At the receiving R2-R5 - 10-kilo-ohm
parallel port of the PC is used to con- end, the RF receiver receives this data R6-R9 - 1.2-kilo-ohm
trol the direction of the stepper motor and gives it to the decoder. The de- R10 - 1-kilo-ohm
R11 - 47-kilo-ohm
at the transmitter side. RF interface is coder converts the single-bit data into
R12 - 3.9-kilo-ohm
used instead of IR to overcome all the four-bit data and presents to the step- R13 - 470-ohm
drawbacks of the IR interface. The PC per-motor driver. Now, the driver per- Capacitors:
forms the corresponding C1, C3 - 100µF, 16V electrolytic
Table I action, i.e., it rotates the C2 - 0.1µF ceramic disk
Output Power and Current stepper motor clockwise
C4 - 10µF, 16V electrolytic
Miscellaneous:
Drain w.r.t. VCC or anticlockwise. BATT.1 - 9V battery
VCC O/P Current Remote control. BATT.2 - 6V, 4.5Ah battery
For remote control, we S1, S2 - On/off switch
5V DC –0 dbm 1.0 mA DIP-SW1,
have used the Holtek
12V DC +9 dbm 3 mA DIP-SW2
- 8-way DIP switch
Fig. 2: Pin encoder-decoder pair - 25-pin D-type male
configuration of HT12E and HT12D. connector
Table II of the rf
transmitter Both of these are 18-pin
Technical Specifications of module DIP ICs. Encoder HT12E has eight address and
RF Receiver RX-433 Operation of Holtek another four address/data lines. The
Description Value HT12E and data set on these twelve lines (address
H T 1 2 D . and address/data lines) is serially
Working voltage 4.5V-5.5V
HT12E and transmitted when transmit-enable pin
Bandwidth 12 MHz
HT12D are TE is taken low. The data output ap-
Sensitivity –103 dbm
CMOS ICs pears serially on DOUT pin. It is trans-
Data rate 4800 bps
with a work- mitted four times in succession.
Max. data rate 9600 bps ing voltage The data consists of differing
Standby current 1, 2 mA
Fig. 3: Pin configuration of the r a n g e of lengths of positive-going pulses for
Antenna Whip, strip line or helical rf receiver module 2.4V to 12V. ‘1’ and ‘0,’ the pulse width for ‘0’ be-
ing twice the width of the pulse
for ‘1.’ The frequency of these
pulses may lie between 1.5 and 7
kHz depending on the resistance
value between OSC1 and OSC2
pins. The internal oscillator fre-
quency of decoder HT12D is 50
Fig. 1: Block diagram for PC-based wireless control of a stepper motor times the oscillator frequency of

6 0 • M a r c h 2 0 0 9 • e l e c t ro n i c s f o r yo u w w w. e f y m ag . co m
cONSTRUCTION

Fig. 4: Transmitter circuit for wireless stepper motor control

encoder HT12E. The values of timing circuits are chosen here for approxi- pins four times in succession, the valid
resistors connected between OSC1 mately 3kHz frequency of the encoder transmission pin (VT) is taken high.
and OSC2 pins of HT12E and HT12D, (HT12E) at Vcc of 9V and 150 kHz of The data on pins AD8 through AD11 of
for the given supply voltages, can be the decoder (HT12D) at Vcc of 5V. the HT12E appear on pins D8 through
found out from the graphs given in The HT12D receives the data from D11 of the HT12D. Thus the device acts
the datasheets of the respective chips the HT12E on its DIN pin serially. If as a receiver of 4-bit data (16 possible
(included in this month’s EFY-CD). the address part of the data received codes) with 8-bit addressing (256 pos-
The resistance values used in the matches the levels on A0 through A7 sible channels).

Fig. 5: Actual-size, single-side PCB for the transmitter circuit Fig. 6: Component layout for the PCB shown in Fig. 5

6 2 • M a r c h 2 0 0 9 • e l e c t ro n i c s f o r yo u w w w. e f y m ag . co m
cONSTRUCTION
shown in Table I.
The pin configuration
of the transmitter module
is shown in Fig. 2.
The RF receiver RX-
433 is a 433MHz module.
Its pin configuration is
shown in Fig. 3, while the
technical specifications
are given in Table II.
Transmitter. Fig. 4
shows the circuit of the
transmitter for wireless
stepper motor control.
The receiver address to
be transmitted can be set
with the help of 8-way
DIP switch SW1. When
any of the switch con-
tacts is open the respec-
tive pin will be at logic
1, and when any of the
Fig. 7: Receiver-cum-decoder circuit for wireless stepper motor control switch contacts is closed
the respective pin will be
Once the frequency of the pair at logic 0. The data pins are pulled high
is aligned, then on ground of any via resistors R2 through R5.
data pin of the encoder, LED1 of When pin 2 of the parallel port
the decoder should glow. You can goes high, transistor T1 is driven into
also check the transfer of data on saturation and relay RL1 energises. Pin
pins AD8 through AD11, which 10 (AD8) goes low through relay RL1
is latched to D8 through D11 pins contacts and a ‘0’ is sent at that data
of the decoder once TE pin is mo- position, while other data pins repre-
mentarily taken low by grounding sent logic-1 state. The logic circuitry at
it through diodes D1 through D4. the receiver-decoder end decodes the
RF transmitter and receiver. RF data appropriately for controlling the
transmitter and receiver modules stepper motor.
from Alpus India, Mumbai, have An actual-size, single-side PCB for
Fig. 8: Actual-size, single-side PCB for the receiver-cum-
been used for RF remote control. the transmitter circuit (Fig. 4) is shown
decoder circuit The RF transmitter TX-433 is in Fig. 5 and its component layout in
AM/ASK type. Its features in- Fig. 6.
clude: Receiver and decoder. Fig. 7 shows
1. 5V-12V single-supply opera- the circuit of the receiver-cum-decoder
tion for wireless stepper motor control.
2. On-off keying (OOK)/am- Assuming that identical address is
plitude shift keying (ASK) data selected on the encoder and decoder,
format when any of the data pins of the PC’s
3. Up to 9.6kbps data rate parallel port on the transmitter side
4. +9dBm output power (about is low, the corresponding data pin
200m range) of the decoder will go low. The data
5. SAW-based architecture outputs (D8 through D11) of HT12D
6. A 45cm wire is adequate for are fed to inverters N1 through N4,
the antenna which, in turn, are connected to driver
The output power and current ULN2003. The low output of ULN2003
Fig. 9: Component layout for the PCB shown in Fig. 8 drain for Vcc of 5V and 12V are drives the stepper motor. When any

6 4 • M a r c h 2 0 0 9 • e l e c t ro n i c s f o r yo u w w w. e f y m ag . co m
cONSTRUCTION
T5 into saturation and LED1 lights anticlockwise) depends on the switch
up. function.
An actual-size, single-side PCB for When the program (WSTEPPER.
the receiver-cum-decoder circuit (Fig. C) is loaded and run, the screen shows
7) is shown in Fig. 8 and its component the welcome message. Pressing any key
layout in Fig. 9. will lead to the main screen shown in
Fig. 10. The main screen displays three
Software messages. Pressing ‘c’ key rotates the
The software program for the user stepper motor in clockwise direction,
interface to control the stepper motor while pressing ‘a’ key rotates the step-
is written in ‘C’ language. The signals per motor in anti-clockwise direction.
Fig. 10: Main screen of wireless stepper motor
are generated by the outport( ) func- The program can be terminated by
control tion. The speed of rotation of the step- pressing ‘q’ key.
per motor can be varied by changing EFY note. The source code and
data is received, valid transmission the argument of the delay( ) function. other relevant files of this article are
(VT) pin goes high to drive transistor Direction of rotation (clockwise or included in this month’s EFY-CD.

WSTEPPER.C
/*PC BASED WIRELESS STEPPER MOTOR CON- tact”}; getch();
TROL*/ int j; }
#include<stdio.h> char ex1[31]={“Email-marietech2003@ya-
#include<conio.h> hoo.co.in”}; void clock(void)
#include<dos.h> int k; {
void main() void clock(void); int p=0x0378;
{ void anty(void); char e;
void dub(void); char ch; clrscr();
char ex[26]={“Programmed by clrscr(); textcolor(14);gotoxy(31,12);
V.MARIYAPPAN”}; textcolor(14);gotoxy(20,6); cprintf(“CLOCKWISE DIRECTION”);
int i; cprintf(“PC BASED WIRELESS STEPPER MO- textcolor(9);gotoxy(1,25);
char ex1[22]={“Programming Language: TOR CONTROL”); cprintf(“Press any key to stop”);
C”}; textcolor(11); gotoxy(24,14); do
int j; cprintf(“FOR CLOCKWISE ROTATION PRESS {
char ex2[28]={“Operating system: Win- ‘c’”); outport(p,1);
dows 98”}; textcolor(11);gotoxy(22,16); delay(200);
int k; cprintf(“FOR ANTICLOCKWISE ROTATION outport(p,2);
char ex3[39]={“PC BASED WIRELESS STEPPER PRESS ‘a’”); delay(200);
MOTOR CONTROL”}; textcolor(9);gotoxy(31,20); outport(p,4);
int l; cprintf(“FOR EXIT PRESS ‘q’”); delay(200);
clrscr(); ch=getch(); outport(p,8);
for(l=0;l<39;l++) switch(ch) delay(200);
{ { outport(p,0);
textcolor(14);gotoxy(21+l,9); case ‘c’:clock();break; sound(1000);
cprintf(“%c”,ex3[l]); case ‘a’:anty();break; delay(200);
delay(50); case ‘q’: nosound();
} clrscr(); }
sound(1900); { while(!kbhit());
delay(500); for(j=0;j<29;j++) getch();
nosound(); { dub();
delay(100); textcolor(9);gotoxy(27+j,14); }
for(i=0;i<26;i++) cprintf(“%c”,ex[j]);
{ delay(30); void anty(void)
textcolor(11);gotoxy(27+i,16); } {
cprintf(“%c”,ex[i]); for(k=0;k<31;k++) int p=0x0378;
delay(30); { char e;
} textcolor(9);gotoxy(26+k,15); clrscr();
for(k=0;k<28;k++) cprintf(“%c”,ex1[k]); textcolor(14);gotoxy(30,12);
{ delay(30); cprintf(“ANTI CLOCKWISE DIRECTION”);
textcolor(9);gotoxy(26+k,18); } textcolor(9);gotoxy(1,25);
cprintf(“%c”,ex2[k]); outport(0x0378,0); cprintf(“Press any key to stop”);
delay(30); textcolor(14);gotoxy(1,25); do
} cprintf(“Press any key”); {
for(j=0;j<22;j++) getch(); outport(p,8);
{ exit(0); delay(200);
textcolor(9);gotoxy(29+j,20); } outport(p,4);
cprintf(“%c”,ex1[j]); default: clrscr(); delay(200);
delay(30); textcolor(12);gotoxy(33,1 outport(p,2);
} 4); delay(200);
sound(1800); cprintf(“WRONG KEY outport(p,1);
delay(500); PRESSED”); delay(200);
nosound(); for(i=0;i<5;i++) outport(p,0);
getch(); { sound(2000);
dub(); sound(1000); delay(200);
} delay(100); nosound();
nosound(); }
void dub(void) delay(100); while(!kbhit());
{ } getch();
int i; dub(); dub();
char ex[29]={“For any clarification con- } } 

6 6 • M a r c h 2 0 0 9 • e l e c t ro n i c s f o r yo u w w w. e f y m ag . co m
circuit
ideas
Triple Power Supply s.c. dwiv
edi

 Sandip Trivedi and P.D. Lele is used for op-amp-based analogue


circuit experiments.

T
his low-cost, multipurpose Fig. 1 shows the circuit of the triple in positive and negative regulated
power supply fulfils the re- power supply, while Fig. 2 shows the power supplies. LED1 glows to indi-
quirements of almost all labora- pin configuration of the regulators cate that +5V is available, while LED2
tory experiments. Nonetheless, it can used in the circuit. Transformer X1 indicates that –5V is available.
be easily fabricated by hobbyists. steps down the mains power to deliver Switch S1 is used for mains ‘on’/
A single transformer is used to the secondary output of 18V-0-18V. ‘off’. Using switches S2 through
build this triple power supply. Regula- The transformer output is rectified by S4, any of the three supplies can be
tor IC LM317 generates variable power full-wave bridge rectifier BR1, filtered independently turned off when not
supply of 1.25 to 20V, 1A. The dual by capacitors C1, C2, C3, C7 and C8, required in a particular experiment.
±12V, 1A power supply is generated and regulated by IC1 through IC5. This reduces unnecessary power dis-
by regulators 7812 and 7912. Similarly, Regulator IC1 (LM317) provides vari- sipation and increases the life and
dual ±5V, 1A power supply is gener- able voltages (1.25 to 20V), while IC2 reliability of the power supply. Since
ated by regulators 7805 and 7905. and IC4 provide regulated +12V and the circuit uses three terminal regula-
‘On’/‘off’ switches (S2 through S4) –12V, respectively. The output of IC2 is tors, only capacitors are required at
select the required power supply. Vari- fed to regulator IC3 (7805), which pro- the input and output. The use of few
able power supply is used to study the vides fixed +5V. Similarly, the output components makes the circuit very
characteristics of devices. Fixed +5V of IC4 is fed to regulator IC5 (7905), simple. The three terminal regulators
power supply is used for all digital, which provides fixed –5V. Capacitors have heat-sink provision to directly
microprocessor and microcontroller C4 through C6, and C9 through C11, deliver 1A output current. To ensure
experiments. Dual ±12V power supply are used for further filtering of ripples the maximum output, do not forget to

HEAT SINK

S2 = FOR VARIABLE VOLTAGE IN IC1 OUT


3
LM317 2
S3 = FOR +12V AND +5V S2 1
R1
ADJ. +1.25 TO 20V
S4 = FOR –12V AND –5V 120

S1-S4 = ON/OFF SWITCH C3


0.1µ
VR1 GND
2.2K
+12V
POT

S1
ON/OFF HEAT SINK HEAT SINK
SWITCH
IN IC2 OUT IN IC3 OUT
1 7812 3 1 7805 3
X1 S3 2 2
F1
1.5A GND GND
R2
FUSE
BR1 330
C1 C4 C5
L W04 1000µ C2 100µ 10µ
+5V
C6
230V AC 35V 0.1µ 25V 16V 0.1µ
50Hz
BR1 LED1
N W04

GND
X1 = 230V AC
PRIMARY TO 18V-0-18V, C7 C8 C9 C10 R3
1.5A SECONDARY 1000µ 0.1µ 100µ 10µ 330
TRANSFORMER 35V 25V 16V C11 –5V
0.1µ
GND GND
1 1 LED2
BR1-W04 2 IC4 3 2 IC5 3
1.5A, BRIDGE S4 IN 7912 OUT IN 7905 OUT
RECTIFIER

HEAT SINK HEAT SINK

–12V
GND

Fig. 1: Tripple power supply

w w w. e f y m ag . co m e l e c t ro n i c s f o r yo u • M a r c h 2 0 0 9 • 8 1
circuit
ideas
earthing tag.
5. If the 18V-0-18V
transformer is replaced
with 15V-0-15V trans-
former, the output
voltage of the variable
supply using LM317
Fig. 2: Pin configurations of regulators will be correspond-
ingly lower.
use heat-sinks for the regulators. 6. If proper voltages
The three-terminal regulators are are available, go to step
almost non-destructible. These have Fig. 3: Proposed cabinet for power supply 7. Otherwise, check the
inbuilt protection circuits including connections.
the thermal shutdown protection. Even 1. Collect all the components shown 7. Connect variable regulator
if there is overload or shorting of the in the circuit diagram. LM317 to the circuit and check 1.25V
output, the inbuilt overload protection 2. Connect switch S1, fuse, trans- to 20V output by varying the 2.2-kilo-
circuit will limit the current and slowly former and mains cord to the assem- ohm linear potentiometers.
reduce the output voltage to zero. bled PCB as well as the box. 8. Now connect ICs 7812, 7912, 7805
Similarly, if the temperature increases 3. Keep the multimeter in DC volt- and 7905 to the circuit and check their
beyond a certain value due to excessive age range (more than 25V DC) and output voltage.
load and heat dissipation, the in-built measure the DC voltage across ca- 9. Connect terminals, potmeter,
thermal shutdown circuit will reduce pacitors C1 and C7 (1000 µF, 35V). This switches and indicator LED on the
the output current and the output volt- voltage should be around 18V×1.41=25 front panel of the box and complete
age (gradually) to zero. Thus complete to 26V DC. Check both positive and the connections. Close the box by us-
protection is provided to the circuitry. negative voltages with respect to ing screws.
Assemble the circuit on a general- ground. Precaution. At the primary side of
purpose PCB and enclose in a box as 4. It is advisable to use three-wire the transformer, 230V AC could give
shown in Fig. 3. mains cable and plug. If you are using lethal shocks. So be careful not to touch
The step-by-step procedure to build any metallic box, earthing wire/pin of this part. EFY will not be responsible
the triple power supply for the labora- the mains plug should be soldered to for any resulting loss or harm to the
tory follows: the body of the metallic box using an user. 

8 2 • M a r c h 2 0 0 9 • e l e c t ro n i c s f o r yo u w w w. e f y m ag . co m
circuit
ideas
earthing tag.
5. If the 18V-0-18V
transformer is replaced
with 15V-0-15V trans-
former, the output
voltage of the variable
supply using LM317
Fig. 2: Pin configurations of regulators will be correspond-
ingly lower.
use heat-sinks for the regulators. 6. If proper voltages
The three-terminal regulators are are available, go to step
almost non-destructible. These have Fig. 3: Proposed cabinet for power supply 7. Otherwise, check the
inbuilt protection circuits including connections.
the thermal shutdown protection. Even 1. Collect all the components shown 7. Connect variable regulator
if there is overload or shorting of the in the circuit diagram. LM317 to the circuit and check 1.25V
output, the inbuilt overload protection 2. Connect switch S1, fuse, trans- to 20V output by varying the 2.2-kilo-
circuit will limit the current and slowly former and mains cord to the assem- ohm linear potentiometers.
reduce the output voltage to zero. bled PCB as well as the box. 8. Now connect ICs 7812, 7912, 7805
Similarly, if the temperature increases 3. Keep the multimeter in DC volt- and 7905 to the circuit and check their
beyond a certain value due to excessive age range (more than 25V DC) and output voltage.
load and heat dissipation, the in-built measure the DC voltage across ca- 9. Connect terminals, potmeter,
thermal shutdown circuit will reduce pacitors C1 and C7 (1000 µF, 35V). This switches and indicator LED on the
the output current and the output volt- voltage should be around 18V×1.41=25 front panel of the box and complete
age (gradually) to zero. Thus complete to 26V DC. Check both positive and the connections. Close the box by us-
protection is provided to the circuitry. negative voltages with respect to ing screws.
Assemble the circuit on a general- ground. Precaution. At the primary side of
purpose PCB and enclose in a box as 4. It is advisable to use three-wire the transformer, 230V AC could give
shown in Fig. 3. mains cable and plug. If you are using lethal shocks. So be careful not to touch
The step-by-step procedure to build any metallic box, earthing wire/pin of this part. EFY will not be responsible
the triple power supply for the labora- the mains plug should be soldered to for any resulting loss or harm to the
tory follows: the body of the metallic box using an user. 

unique Water Pump Controller


edi
s.c. dwiv A R4
12K S1
ON/OFF
B SWITCH

7 R6
3 +
 D. Mohan Kumar IC1 6
220
T1

H
µA741 +
D1 BC558 12V

ere is a simple solution for 2 4 1N4148 DC

automatic pumping of water


to the overhead tank. Unlike C1
220
other water-level indicators, it does 25V N/O

not use probes to detect the water level R5


MOTOR

VR1 LED4
10K 12K D2
and hence there is no probe corrosion PRESET 1N4007 N/C
C2
problem. It has no direct contact with
RL1
470µ 230V
25V
water, so the chance of accidental leak- L AC N
50Hz
age of electricity to the water tank is RL1 = 12V, 1 C/O RELAY
also eliminated. Two important advan-
tages of the circuit are that the water Fig. 1: Water pump controller

8 2 • M a r c h 2 0 0 9 • e l e c t ro n i c s f o r yo u w w w. e f y m ag . co m
circuit
ideas
pumping of water.
Assemble the circuit on a general-
purpose PCB and enclose in a suitable
cabinet. Solder the white LEDs-LDR1
assembly on a separate PCB and use
a separate power supply for it. Mount
LEDs behind the LDR. Otherwise, light
from the LEDs will affect the working
Fig. 2: Sensor circuit of the circuit. Connect LDR1 to the main
circuit board at ‘A’ and ‘B’ points.
level never goes below a particular Fix the LEDs-LDR1 assembly on
level and no modification in the water the inner side of the water-tank cap as
tank is required. shown in Fig. 3. Orient the LEDs and
Fig. 1 shows the circuit of the wa- the LDR such that when the water tank
terpump controller. The circuit uses an is full, the light emitted from the LEDs
LDR-white LEDs assembly to sense the Fig. 3: Sensor assembly and reflected from the water surface
water level. It forms a triggering switch falls directly on LDR1. The distance
to energise the relay for controlling the level and the face of LDR1 is minimal. between the upper level of water and
pump. The LDR-LEDs assembly (shown When white light falls on LDR1, the the LEDs-LDR setup should be mini-
in Fig. 2) is fixed on the inner side of the voltage at the non-inverting input (pin mal, ensuring that water doesn’t touch
cap of the water tank without making 3) of IC1 increases and its output goes LDR1. Otherwise, the circuit will not
contact with water. The light reflected high. This high output makes pnp function properly. By using more white
from the water tank is used to control transistor T1 non-conducting and the LEDs, this distance can be increased.
the resistance of LDR1. relay remains de-energised. LED1 also Cover the LDR with a black tube to
When the water level is high remains ‘off.’ Since the water-pump increase its sensitivity.
enough, light from the white LEDs power supply is connected to the nor- You can fix the main unit at a
(LED1 through LED3) reflects to fall mally-open (N/O) contacts of relay convenient place and connect it to the
on LDR1. This reduces the resistance RL1, pumping is stopped. LEDs-LDR assembly through wire.
of LDR1, increasing the voltage at the When water level falls, the amount Select the relay according to the horse-
non-inverting input (pin 3) of IC1. of light reflected to LDR1 decreases power (HP) of the water pump. After
IC1 is used in the circuit as a voltage and its resistance increases. This re- arranging the setup (with maximum
comparator. Resistors R4 and R5 form duces the voltage at pin 3 of IC1 and water in the tank), adjust VR1 until
a potential divider to fix half of supply its output goes low. This low output LED1 stops glowing. In this state, the re-
voltage to the inverting input of IC1. from IC1 makes transistor T1 conduct. lay should de-energise. When the water
Normally, when the water tank is Relay RL1 energises to close the N/O level decreases, the relay automatically
full, LDR1 gets more of reflected light contacts and the motor starts pump- energises to connect mains to the motor
because the distance between the water ing water. LED1 glows to indicate the and it starts pumping water. 

THREE-COMPONENT FLASHER
 T.A. Babu

S
ince this flasher system uses edi
s.c. dwiv
only three components, it is rel-
atively easy to build and install.
It can be used for signal flashing, haz-
ard warning and alternate flashing. rent rating of 5A.
At the heart of this circuit is a The working of the circuit is very
single-pole double-through (SPDT) simple. Initially, bulk capacitor C1
contacts relay (see Fig. 1). It is a 12V, charges through resistor R1 and the
400-ohm, single-changeover (1C/O), bulb filament. When capacitor C1
PCB-mounted relay with contacts cur- charges, relay RL1 energises and Fig. 1: Simple flasher circuit

w w w. e f y m ag . co m e l e c t ro n i c s f o r yo u • M a r c h 2 0 0 9 • 8 3
circuit
ideas

Fig. 4: Circuit of alternate flasher

the left or right.


Fig. 2: Circuit of turn signal flasher
The circuit of the hazard-warn-
throws its contacts to the other posi- Fig. 3: Circuit of hazard-warning flasher ing flasher is shown in Fig. 3. Used in
tion. Capacitor C1 holds the contacts vehicle lighting systems, it flashes all
until there is enough charge to keep charge stored in the capacitor. The ‘off’ the four bulbs when hazard-warning
the relay energised. Bulb L1 (12V, 5W) time is controlled by the discharging switch S3 is ‘on.’ During hazard warn-
glows for a while through the N/O time of the capacitor. ing, switch S2 can be in the left or right
contacts of the relay. When the charge The signal flasher is a four-bulb position.
in the capacitor ceases, the relay con- system as shown in Fig. 2. Two bulbs The alternate flasher circuit is
tacts return to their initial normally- are used at the front of the vehicle and shown in Fig. 4. It flashes the lamps
closed position. the other two at the back of the vehicle. alternately when the system is acti-
The charging cycle repeats to give The primary function of the ‘turn’ sig- vated. This type of flasher is typically
a flashing effect in the bulb. The ‘on’ nal flasher is to flash the lamps when used in emergency vehicles and school
time of the flasher is controlled by the the ‘turn’ signal switch is activated to buses. 

In-Car Food and Beverage Warmer

edi
s.c. dwiv

 Ashok K. Doctor

T
his is a very useful
device for those
who are frequently
on the move. It will keep
your tea, coffee or food
warm while consuming
little power.
The circuit is simple.
The ubiquitous timer 555
is used as a free-running astable mul- nected in reverse direction to facilitate Power transistor T1 is Darlington type
tivibrator. Diodes 1N4148 are con- maximum variation of the duty cycles. with 5A capacity and output of more

8 4 • M a r c h 2 0 0 9 • e l e c t ro n i c s f o r yo u w w w. e f y m ag . co m
circuit
ideas
than 60 watts. The chosen discrete watts. The consumption of current will only two wire connections. Use wires
components assure fixed frequency of be significantly less if fewer coil ele- that can carry more than 6A current.
1 Hz (approximately) at pin 3 of timer ments are connected in parallel through Fix the coil elements below an alumin-
IC1 (555). Resister R1 and potmeter VR1 toggle switches S2 through S4. Each of ium or steel rectangular plate which
(1-mega-ohm) allow adjustment of the these switches has a 6A rating. is at least 1mm thick. Do not forget
duty cycle. The higher the duty cycle, Assemble the circuit on a general- to insulate the heating plate from the
the higher the output of the heater. purpose PCB. Mount power transistor elements. Use the car battery for the
You can connect up to five 10W TIP120 on a thick heat-sink. Isolate the power supply with a proper current-
heating elements in parallel, totaling 50 circuit from the heating elements using carrying-capacity wire. 

WHITE LIGHT FOR REFRIGERATOR


 Uday ShEnde The circuit is transformerless
and uses a capacitor for provid-

N
ormally, the refrigerator lights ing the power supply to the white edi
s.c. dwiv
are yellow in colour and go LEDs. Mains input is fed to capaci-
bad very often. If you want tor C1 and resistor R1, rectified by a
a long-lasting white light for your re- bridge rectifier comprising diodes D1
frigerator, this circuit is especially for through D4, and filtered by capaci- white LEDs in 2×8 parallel-connec-
you. The circuit is easy to install inside tor C2 to provide sufficient voltage tion configuration.
the refrigerator. Also, it consumes very to drive the white LEDs. Resistor R2 Assemble the circuit on a gen-
little power compared to the traditional limits the current flowing through eral-purpose PCB along with 16 white
yellow bulb. the LEDs. The circuit uses 16 bright LEDs. Connect the LEDs in series with
resistor R2. Take out
the two wires from
the usual bulb con-
nection and connect
to the circuit. After
connecting the supply
wires, wrap electrical
tape around the wires
properly. Enclose the
entire PCB (exclud-
ing LEDs) in a plastic
box and wrap the box
properly with tape to
seal it against mois-
ture. 

Smart Hearing Aid sani the


o

Devrishi Khanna and when sound is detected. The sensi-


Rohit Modi tivity of the detection section and the
‘on’ time duration of the sound am- microphone, earphone, and sound

N
ormally, hearing aid circuits plifier circuit can be set by the user. detection and amplification sections.
consume battery power Also the circuit uses only a single The sound detection section employs
continuously once they are condenser mic for sound detection a quad op-amp IC LM324 (IC1(A)) and
switched on. The circuit given here and amplification. a timer NE555 (IC2). The sound signal
saves battery power by switching As is clear from the above, this received at the mic is pre-amplified
on the sound amplifier section only hearing aid consists of a condenser by transistor BC549 (T1). The voltage

w w w. e f y m ag . co m e l e c t ro n i c s f o r yo u • M a r c h 2 0 0 9 • 8 5
circuit
ideas

at its collector is fed to the inverting IC1(A) triggers the NE555 timer and its is fed directly to amplifier stage. The
terminal (pin 2) of op-amp IC1(A), output goes high for a preset duration. output from pin 7 of IC1(B) is fed to the
which is used as a comparator. The R4 and C2 are the timing components base of transistor T2. The weak signal
reference voltage (Vref) at the non- for setting the time duration. The high received at transistor stage T2 is further
inverting terminal (pin 3) of IC1(A) output of the timer is directly used as amplified by transistors T3, T4 and T5.
is set using preset VR1. The preset is the power source for the sound ampli- An earphone to listen to the sound is
also used to control the sensitivity of fier section. connected between the collector of T5
the sound signals received by the cir- The sound amplifier section is built and ground. It is recommended to use
cuit. The output from pin 1 of IC1(A) around transistors T2 through T5. The a mono earphone with volume control
is fed to the trigger input (pin 2) of last amplifier stage T5 (pnp transistor attached.
timer NE555, which is configured in BC558) drives the earphone. The sound With 9V DC supply, when sound is
monostable mode. signal received from the mic is fed to detected through the mic, the amplifier
When sufficient sound signal the non-inverting pin of the second section is automatically triggered and
strength is detected at the base of tran- op-amp of IC1(B) which is wired in the current consumption of the circuit
sistor T1, the pulsating voltage at its unity follower configuration. The unity is about 96 mA. When the amplifier cir-
collector exceeds the reference voltage follower mode resolves the problem cuit is ‘off,’ the circuit draws a current
at pin 3. As a result, output pin 1 of of impedance mismatch which would of about 6 mA only, thus saving con-
IC1(A) goes low. The low output from have occured if the output of the mic siderable amount of battery power. 

8 6 • M a r c h 2 0 0 9 • e l e c t ro n i c s f o r yo u w w w. e f y m ag . co m
design
Part 1 of 3
Reading the Datasheets of
Electronic Devices
A thorough understanding of datasheets allows the designers to select the right
device for their application and subsequently exploit the potential of the device
to the fullest. Beginning this month in a series of three articles, we would focus
on how to read a datasheet and then go on to discuss the datasheets of two of
the most commonly used electronics devices representing discrete devices and
integrated circuits
 Anil Kumar Maini and
Varsha Agrawal

M
ost of the present-day electron-
ics designers and application
engineers do not find it neces-
sary to look beyond the first page of the
datasheets of the electronic components
or devices while selecting one for their
application. They consider the knowl-
edge of a few major specifications of the
device sufficient for the design exercise
that they wish to undertake. Though
it may be adequate in some cases, the
design where the components are chosen
without giving due consideration to the
information contained in the datasheet
may not be the optimal one.
The datasheet of a device reveals its
true character and hence its suitability
for a given application. In addition to
listing down the device parameters, it
gives the electrical and environmental
conditions at which these parameters Fig. 1: First page of datasheet of power Mosfet type IRF250
have been measured and also contains
information on variation of important ally available from manufacturers. The Surely, the technical data of a given
parameters as a function of other word ‘comprehensive’ is used here to device in the short-form catalogue will
relevant electrical and environmental differentiate between the datasheet of a not be as comprehensive as it would
parameters. It is vital information device found in a short-form catalogue be in the detailed catalogue. In the
particularly when you are designing a and another datasheet of the same de- condensed version, one is likely to find
circuit or a module that has to qualify vice available in the detailed version. salient features, major performance
stringent environment standards. A For example, a company manufactur- specifications, package information
comprehensive datasheet almost in- ing a range of semiconductor devices and electrical characteristics along with
variably includes application circuits may have one condensed catalogue the condition for which they are valid.
recommended by the manufacturer. containing data on all categories of On the other hand, a detailed datasheet
devices like diodes, bipolar transistors, offers a range of characteristic curves
Comprehensive and MOSFETs and thyristors that it manu- showing variation of important pa-
condensed datasheets factures. It may also offer detailed rameters as a function of other relevant
Both comprehensive as well as con- catalogues separately for each of these parameters and typical application
densed versions of datasheets are usu- categories. circuits.

1 0 0 • M a r c h 2 0 0 9 • e l e c t ro n i c s f o r yo u w w w. e f y m ag . co m
design
capability and a low ther-
mal resistance… designed
primarily for half-wave AC
power control such as motor
controls, heating controls…
(taken from the datasheet
of S2800 series SCR)… high
photosensitivity, hermeti-
cally sealed… fast optical
sensor of high-modulation
bandwidth... (taken from the
data sheet of PIN photodiode
type BPX-65)… single-pulse
avalanche energy rated, na-
nosecond switching speeds,
linear transfer characteristics,
high input impedance… well
suited for applications such
as switching regulators, mo-
tor drivers, relay drivers…
Fig. 2: Package styles of op-amp type LM741 (taken from the datasheet
of power MOSFET type
IRF250 shown in Fig. 1)” are
representative of the first
page of the datasheet of the
device. This gives designers
a fair idea of the important
features and applications
without going through the
whole datasheet.
Device package outline.
A sketch with device dimen-
sions and lead identification,
outline of the package styles
of the device and other me-
chanical information are in-
cluded in this part. Quite of-
ten a given device is made in
more than one package style
either with no difference in
performance specifications
(such as medium-power sili-
con transistor type 2N6045/
MJE6045 made in TO220AB
Fig. 3: Internal schematic of op-amp type LM741
and TO127 package styles),
or with a minor difference
Common features ing features. All datasheets begin with (such as bipolar transistor 2N2222 in
A study of the datasheets of a variety typical applications as suggested by TO-92 plastic and TO-18 metal can
of devices, be they discrete or integrat- the manufacturer and the outstanding packages), and occasionally with a
ed circuit (IC), reveals a commonality features of the device. This informa- major difference (such as IC regulator
in the type of data and characteristic tion appears on the first page of the type 78-series in TO-92 plastic, TO-220
curves. These common features are datasheet and is an essential part of and TO-3 packages).
outlined in the following paragraphs. both condensed and detailed versions. Fig. 2 shows the package options
Typical applications and outstand- Statements like “It has high dv/dt for the operational amplifier LM741.

1 0 2 • M a r c h 2 0 0 9 • e l e c t ro n i c s f o r yo u w w w. e f y m ag . co m
design

Absolute Maximum Ratings (Note 1)


If military/aerospace specified devices are required, contact the National Semiconductor Sales Office/Distributors
for availability and specifications.

LF155/6 LF256/7/LF356B LF355/6/7

Supply voltage ±22V ±22V ±18V


Differential input voltage ±40V ±40V ±30V
Input voltage range (Note 2) ±20V ±20V ±16V
Output short circuit duration Continuous Continuous Continuous
TJMAX
H-package 150°C 115°C 115°C
N-package — 100°C 100°C
M-package — 100°C 100°C
Power dissipation at TA=25°C (Notes 1, 8)
H-package (still air) 560 mW 400 mW 400 mW
H-package (400 LF/min air flow) 1200 mW 1000 mW 1000 mW
N-package — 670 mW 670 mW
M-package — 380 mW 380 mW
Thermal resistance (typical) θJA
H-package (still air) 160°C/W 160°C/W 160°C/W
H-package (400 LF/min air flow) 65°C/W 65°C/W 65°C/W
N-package — 130°C/W 130°C/W
M-package — 195°C/W 195°C/W
(Typical) θJC
H-package 23°C/W 23°C/W 23°C/W
Storage temperature range –65°C to +150°C –65°C to +150°C –65°C to +150°C
Soldering information (lead temp.)
Metal can package
Soldering (10 sec.) 300°C 300°C 300°C
Dual-in-line package
Soldering (10 sec.) 260°C 260°C 260°C
Small outline package
Vapour phase (60 sec.) — 215°C 215°C
Infrared (15 sec.) — 220°C 220°C
See AN-450 ‘Surface Mounting Methods and Their Effect on Product Reliability’ for other methods of soldering
surface mount devices.
ESD tolerance
(100 pF discharged through 1.5kΩ) 1000V 1000V 1000V
Absolute maximum ratings tell the designer the conditions that will damage the device. Remember these are
not maximum operating limits

Fig. 4: Absolute maximum ratings for op-amp type LF156/256/356

As you can see from the figure, it is architecture. This sometimes helps the
available in three packages, namely, designer to explain the device behav-
the metal can package, dual-in-line iour that is otherwise not described in
package and ceramic flatpak pack- the datasheet.
age. Absolute maximum ratings. Abso-
Schematic diagram. Detailed sche- lute maximum ratings (Fig. 4) contain
matic of the internal structure of the information on voltages, currents, pow-
device is also given in the datasheet. ers and temperature range that should
Fig. 3 shows the internal schematic of never be exceeded. As is evident from
operational amplifier LM741. It helps the figure, the maximum supply volt-
the designer to correlate the electrical age for operational amplifier LF356 is
features of the device with its internal ±18V.

w w w. e f y m ag . co m e l e c t ro n i c s f o r yo u • M a r c h 2 0 0 9 • 1 0 3
design

Fig. 5: Performance curves of diodes 1N4001 to 1N4007

Performance curves. Perform- characteristics of the device, such characteristics) in the case of FETs,
ance curves of interest as a function as drain current versus drain volt- emitter voltage versus emitter cur-
of voltage, current, temperature, age (drain characteristics) or drain rent in the case of UJTs and forward
etc follow next. These include the current versus gate voltage (transfer voltage versus forward current in the

1 0 4 • M a r c h 2 0 0 9 • e l e c t ro n i c s f o r yo u w w w. e f y m ag . co m
design
case of diodes. Fig. 5 shows the char- to 1N4007. ode current changes with temperature.
acteristics curves for diodes 1N4001 It could also be variation of the cath- The curve in the second illustration
ode voltage vs cathode indicates critical dependence of the
current as a function of dark current of the PIN photodiode
temperature (Fig. 6) in on the applied reverse bias voltage.
the case of a thyristor, or And the third demonstrates significant
dark current as a func- reduction in the transconductance of the
tion of applied reverse MOSFET at a fixed drain current with
bias in the case of a PIN increase in temperature. These are all
photodiode, or transcon- very important aspects of design and
ductance versus drain therefore should not be side-stepped.
current as a function of Electrical characteristics. Electri-
temperature in the case cal characteristics are usually given
of power MOSFET. The in tabular form indicating spread
curve in the first case in parameter values that is likely to
emphasises that the re- occur in a batch of devices in terms
Fig. 6: Thyristor-cathode voltage vs. cathode current for different
lationship between the of minimum, typical and maximum
temperatures cathode voltage and cath- values. It is a vital design input as in

Fig. 7: Electrical characteristics of Mosfet type number IRF250

w w w. e f y m ag . co m e l e c t ro n i c s f o r yo u • M a r c h 2 0 0 9 • 1 0 5
design
These are always
an asset to the
designers, more
so for those who
are a little short
of design experi-
ence. Quite of-
ten, expressions
used to calculate
different compo-
nent values in a
given application
circuit are also
presented.
Fig. 8 shows
some of the appli-
cation circuits for
operational ampli-
fier LF356 given
in its datasheet.
The information
contained in Fig.
8 is reproduced
from the detailed
datasheet of LF
355/356/357 se-
ries of FET input
op-amps.

To sum up...
This part of the
article highlighted
the importance of
reading a datash-
eet and the host
of technical infor-
mation contained
therein. In par-
ticular, it focused
Fig. 8: Some application circuits of op-amp type LF156/256/356 on salient features
that are common
some cases, spread in values could be to the datasheets of all categories of
as much as an order of magnitude. devices illustrating the significance of
To substantiate the statement, the different parameters with practical ex-
datasheet of C122-series of SCRs from amples. The next part of the article will
RCA tells that its dv/dt rating could focus on semiconductor diodes.
be anywhere between 10V/s and …To be continued
100V/s. Similarly, the gate-source
threshold voltage of power MOSFET Anil Kumar Maini is the head of EOCM and Op-
type IRF250 could vary from 2V to toelectronics Division and associate director at
4V (Fig. 7). Laser Science and Technology Centre (Defence
R&D Organisation) and Varsha Agrawal is a senior
Application circuits. Application scientist in EOCM and Optoelectronics Division at
circuits are usually included only in Laser Science and Technology Centre (Defence
the detailed version of the datasheet. R&D Organisation)

1 0 6 • M a r c h 2 0 0 9 • e l e c t ro n i c s f o r yo u w w w. e f y m ag . co m
design

Part 2 of 3
Reading the Datasheets of
Electronic Devices
The device in focus this month is semiconductor diode. Depending upon the intended
application, semiconductor diodes are broadly classified into general-purpose diodes/
rectifiers, high-frequency/switching diodes and power diodes. Out of a wide range of
performance specifications included in the datasheet of a typical semiconductor diode,
some are more relevant for a particular application than the other

 Anil Kumar Maini and the right device for a particular ap- rectification.
Varsha Agrawal plication. For instance, when choosing Similarly, for diodes used for
a diode for rectification purpose, the switching applications, the impor-

T
he first part of this article specifications to be taken into consid- tant specifications to be considered
highlighted the importance of eration are the peak inverse voltage are PIV rating, reverse recovery
reading a datasheet and the (PIV), average forward current rating time and capacitance of the diode.
host of technical information contained and the ampere-square seconds (I2t) Specifications like average rectified
therein. In particular, it focused on the rating of the diode. Specifications such forward current do not have much
salient features that are common to the as reverse recovery time and switching significance.
datasheets of all categories of devices, speed are irrelevant. Knowledge of these major specifi-
illustrating the significance of different Note that here we are referring to cations and their proper interpretation
parameters with practical examples. In rectification of 50/60Hz AC mains, considerably helps a designer in choos-
continuation, here we focus on semi- and the same is not true in the case ing a diode for any given application.
conductor diodes. of rectifiers used in switched-mode The specifications are defined in a
power supply applications. In fact, datasheet under three major heads:
Selection criteria these parameters are not specified by absolute maximum ratings, electrical
for diodes the manufacturers in the datasheets characteristics and thermal character-
The specifications are the basis of selec- of diodes intended for AC mains istics.
tion criteria when it comes to choosing
Absolute maximum
ratings
Reverse breakdown voltage or
the peak inverse voltage (VBR,
PIV). It is the maximum re-
verse voltage that a diode can
withstand without breaking
down. There are usually two
Fig. 3: Bridge rectifier different PIV ratings specified
Fig. 1: Half-wave rectifier for diodes: repetitive peak in-
verse voltage (VR or VRRM) and
non-repetitive peak inverse
voltage (V RSM). The non-re-
petitive rating is obviously
greater than the repetitive
rating. The one that needs to
be considered depends upon
the intended application. In a
rectifier application, it is the
Fig. 2: Conventional full-wave rectifier Fig. 4: Cascade voltage multiplier chain repetitive inverse voltage rat-

1 1 2 • a p r i l 2 0 0 9 • e l e c t ro n i c s f o r yo u w w w. e f y m ag . co m
design

Table I be allowed to pass through the diode


without exceeding its power dissipa-
Electrical Characteristics of 1N914B Diode
tion limits. The average current rating
Symbol Parameter Conditions Min. Max. Unit is lower than the continuous or peak
VF Forward voltage repetitive forward current.
1N914; 1N914A IF = 10 mA — 1 V For a half-wave rectified signal:
1N914B IF = 5 mA 0.62 0.72 V
1N914B IF = 100 mA — 1 V
IF(av) = Ipeak/π
For a full-wave rectified signal:
IR Reverse current
IF(av) = 2Ipeak/π
VR = 20V — 25 nA
VR = 75V — 5 µA where Ipeak is the peak repetitive for-
VR = 20V; Tj = 150°C — 50 µA ward current. It is useful in selecting
Cd Diode capacitance f = 1 MHz; VR = 0 — 4 pF diodes for rectification applications.
The maximum average rectified
trr Reverse recovery When switched from IF = 10 mA to — 8 ns
time IR = 10 mA; RL = 100Ω; measured at current rating of the selected diode
IR = 1 mA should be greater than the average cur-
When switched from IF = 10 mA to — 4 ns
rent flowing through it in a particular
IR = 60 mA; RL = 100Ω; measured at application. The average rectified cur-
IR = 1 mA rent rating of 1N4001-1N4007 series
Vfr Forward recovery When switched from IF = 50 mA; — 2.5 V general-purpose rectifier diodes is 1A
voltage tr = 20 ns for 1cm lead length at an ambient tem-
perature of 25°C.
multiplier chain (Fig. 4) should Peak repetitive forward current. It
have PIV rating greater than is the maximum instantaneous value of
the peak value of the AC sig- the repetitive forward current.
nal applied at the input of the Peak forward surge current. Dur-
multiplier chain. ing turn-on, malfunction, switching,
As an illustration, consider etc, high values of current may flow
diode 1N4001 with peak re- through the diode for brief time inter-
petitive inverse voltage of 50V. vals. Surge current ratings define the
When this diode is used for maximum value and time duration of
a conventional half-wave or such surges in the current level. For
bridge rectifier, it can handle instance, a surge rating of 10A for 10
an AC signal with maximum ms implies that the diode can handle
peak value of 50V. As a two- a maximum of 10A of forward current
diode full-wave rectifier it for time duration not exceeding 10 ms.
can handle an AC signal with The surge current rating is significantly
maximum peak value of 25V higher than the maximum rectified cur-
only. For AC signals having rent rating. This specification assumes
Fig. 5: Forward current vs forward voltage of 1N914B diode higher peak values, other more importance for switching diodes
diodes like 1N4002 through like 1N914 which have a peak forward
ing that is to be considered. Repetitive 1N4007 can be used depending upon surge current rating of 1A for a pulse
peak inverse voltage rating of 1N4007 the exact value of the peak voltage of width of 1 second and 4A for a pulse
is 1000 volts. the AC signal. width of 1 µs.
For conventional single-diode Maximum average rectified current Maximum junction temperature
half-wave rectifier (Fig. 1), two-diode (I F(av)
). It is the maximum average for- (Tj). It is the maximum allowable junc-
full-wave rectifier (Fig. 2) and bridge ward rectified output current that can tion temperature. It is significant in
rectifier configurations (Fig. 3), the
chosen diodes should have a repetitive PIV, average rectified forward current and I2t
peak inverse voltage rating equal to at ratings are the parameters of interest in the case
least the peak of the applied AC input,
twice the peak value of the applied AC
of rectifiers for 50/60Hz AC mains. The same is not
input and the peak value of the AC in- true for rectifiers needed for switched-mode power
put, respectively. The diode to be used supplies where reverse recovery time is of prime
in the cascade type of diode-capacitor concern.
1 1 4 • a p r i l 2 0 0 9 • e l e c t ro n i c s f o r yo u w w w. e f y m ag . co m
design
the case of power diodes and helps reverse current value at
in finding the size of the heat-sink to which it has been meas-
be used for a given diode current and ured. It also indicates the
chosen type. reverse-biased resistance
of the diode.
Electrical characteristics Reverse current (IR).
In the following paragraphs, we dis- It is the direct current
cuss the important electrical character- flowing through a re-
istics of a semiconductor diode along verse-biased diode.
with their interpretation and practical The datasheets spec-
importance. ify the reverse voltage
Forward voltage (VF). It is the volt- of the diode for one or
age applied across a forward-biased more values of the re-
diode. It is not a specification in itself. verse current, similar to
It is given along with the correspond- Fig. 6: Reverse-biased characteristics of 1N914B that for forward current
ing forward current value at which it and forward voltage.
has been measured. It indicates static These also specify the re-
resistance of the diode. For example, verse characteristics of the
general-purpose diode 1N3611 is diode showing the relation-
specified as 1.1V at 1000 mA and it ship between the reverse
indicates that its static resistance is voltage and the reverse
1.1 ohms. current (Fig. 6).
Forward current (IF). It is the direct As is evident from the
current flowing in a forward-biased reverse characteristics of
diode. diode 1N914B shown in Fig.
The datasheets specify the forward 6, reverse current exhibits a
voltage of the diode for one or more sharp increase as the reverse
values of the forward current. For in- voltage exceeds 50 per cent
stance, the datasheet of diode 1N914 of its peak inverse voltage
specifies that the maximum forward Fig. 7: Forward current derating curve of 1N4001-1N4007 of 100 volts. This implies
voltages of diode IN914B are 0.72V series rectifiers that the reverse blocking
and 1.0V at forward currents of 5.0 capability of the diode de-
mA and 100 mA, respectively (Table grades sharply as the reverse voltage
I). This information reveals that the approaches the peak inverse voltage
static resistance of the diode varies rating. In addition, both forward and
from about 140 ohms to 10 ohms as the reverse characteristics are a function
forward current increases from 5 mA of operating temperature. Refer to the
to 100 mA. datasheet of 1N4001–1N4007 series
The datasheet of diode 1N4001 rectifiers.
specifies that the forward voltage in If we look at the absolute maximum
this case is 1.1V at a forward current ratings shown in Table II, the average
of 1A. The datasheets also give the for- rectified current is specified to be 1A
ward characteristic curve of the diode up to an ambient temperature of 75°C.
showing the relationship between the This parameter needs to be derated for
forward voltage and the forward cur- temperatures greater than 75°C. It falls
rent. Fig. 5 shows the forward voltage Fig. 8: Capacitance versus reverse voltage
to 0.4A at 120°C (Fig. 7).
vs forward current curve for diode curve of 1N914 Diode capacitance (Cd, Cs). It is
1N914B. the inherent capacitance of the diode
The information contained in the age drop across the forward-biased junction. In the reverse-bias region
datasheet therefore allows you to know diode for the known value of forward the transition- or the depletion-region
the value of the resistance offered by current. capacitance (C d) is of importance,
the diode to DC for a known value of Reverse voltage (VR). It is the volt- whereas in the forward-bias region
forward current flowing through it. age across a reverse-biased diode. It diffusion or storage capacitance (Cs)
Said differently, it tells you the volt- is specified along with corresponding dominates. It plays a very significant

1 1 6 • a p r i l 2 0 0 9 • e l e c t ro n i c s f o r yo u w w w. e f y m ag . co m
design

The datasheet is particularly important in revealing


the dependence of different parameters on operating
temperature and also in revealing the dependence
of one parameter on another related parameter.
Forward and reverse current specifications being
functions of forward and reverse voltage drops,
respectively, are some examples. This helps the
designer in predicting the behaviour of the device
under different operating conditions.

role in the functioning of switching equivalent of the surge current and the
diodes. Smaller value of diode capaci- time period of the AC waveform. It is
tance will give faster switching times. useful when choosing an appropriate
It is typically a few pico-farads in diode rectifier.
switching diodes. The datasheets generally do not
For general-purpose diode 1N4001, directly specify the I2t rating; it is gen-
the total capacitance is 15 pF for a erally specified in the form of forward
reverse voltage of 4V, whereas in the surge current for a sine wave of a
case of 1N914, which is a switching specified time period. For instance, the
diode, transition capacitance is less datasheet of diode 1N4001 specifies
than 1 pF at the same value of reverse- the non-repetitive peak forward surge
bias voltage. The datasheets of switch- current of 30A for 8.3ms single half-
ing diodes contain the characteristic sine-wave corresponding to 60Hz AC
curve showing variation of the diode’s mains (Table II). The I2t rating equals
capacitance with the applied reverse (30/√2)2×8.3×10−3 = 3.735 A2s.
bias (Fig. 8). I2t rating allows designers to esti-
Ampere-square seconds (I 2t). It mate the peak forward surge current
indicates the sub-cycle current capabil- that the device shall be able to handle
ity of diodes when used as a rectifier. for any given value of sub-cycle time
It is usually specified for one complete period. For example, 1N4001 shall be
cycle of 50/60Hz operation. It can able to handle a non-repetitive forward
be calculated from one cycle of peak peak current of more than 6A for a 2ms
surge current rating of the diode as period.
the product of the square of the RMS Reverse recovery time (trr). When

Table II
Absolute Maximum Ratings*
Symbol Parameter Value Units
IF(AV) Average rectified current 1.0 A
0.375” lead length @ TA = 75°C
IFSM Non-repetitive peak forward surge current
8.3ms single half-sine-wave 30 A
Superimposed on rated load (JEDEC method)
PD Total device dissipation 2.5 W
Derate above 25°C 20 mW/°C
Rθ(J-A) Thermal resistance, junction to ambient 50 °C/W
Tstg Storage temperature range –55 to +175 °C
TJ Operating junction temperature –55 to +150 °C
*These ratings are limiting values above which the serviceability of any semiconductor device may be
impaired.
TA = 25°C unless otherwise noted

w w w. e f y m ag . co m e l e c t ro n i c s f o r yo u • a p r i l 2 0 0 9 • 1 1 7
design
the diode is abruptly switched from
forward-biased condition to reverse- Parameters defining thermal characteristics of the
biased condition, the time required device are intimately related to one another. Power
by the reverse current or voltage dissipation capability is a function of ambient
to reach a specified value is called temperature. It is also related to the junction-to-
‘reverse recovery time.’ The reverse case thermal resistance and the maximum allowable
recovery time is a very significant
parameter in fast-recovery rectifiers
junction temperature. These parameters should
used in SMPS and in diodes used for therefore not be seen in isolation.
high-frequency switching applica-
tions. In fact, it is the most important Power dissipation and thermal re- junction-to-ambient temperature dif-
parameter to watch while choosing a sistance are two important thermal ferential for a known value of power
rectifier diode for an SMPS based on parameters. The designers should dissipated in the device. It is expressed
the flyback principle. not look at these parameters in iso- in °C/watt. For given values of
The reverse recovery time varies lation. They need to be considered power dissipation, ambient temperature
from a few nanoseconds for ultra-fast together to ensure that the diode’s and junction-to-ambient thermal resist-
diodes to about 500 nanoseconds for maximum allowable junction tempera- ance of the device, one can estimate the
a typical fast-recovery rectifier. For ture specification doesn’t exceed under junction temperature. If the device has
example, reverse recovery time for the operating conditions of the diode’s to safely dissipate the specified power
ultra-fast diode 1N914 is of the order forward voltage, forward current and at an ambient temperature greater than
of 4 ns, while it is around 300 ns for ambient temperature. We shall first the power dissipation rating is specified
fast-recovery rectifier BY299. The re- define the two parameters and then for, it should be mounted on a heat-sink
verse recovery time parameter of the illustrate their inter-relationship with to reduce its junction-to-ambient ther-
rectifier when used in a flyback-type actual data quoted from a datasheet. mal resistance.
DC-to-DC converter puts an upper Power dissipation (PD). It is the Referring to the datasheet of 1N914,
limit on the maximum usable switch- maximum power that can be safely dis- the specified power dissipation rating
ing frequency. sipated in a diode for a given ambient is 500 mW at an ambient temperature
Forward recovery time (tff). It is the temperature in the absence of any heat of 25°C and its maximum junction tem-
time required for the forward current sink. The value of maximum power perature specification is 175°C. This is
or voltage to reach a specified value dissipation is usually specified at an in agreement with its thermal resist-
after the diode has been switched from ambient temperature of 25°C. At higher ance specification, which is specified
reverse-biased state to forward-biased operating temperature, its value should to be 300°C/watt. As per this speci-
state. This parameter too is significant be derated as per the power-tempera- fication, there will be a temperature
in switching applications. ture derating curve of the diode. As an differential of 150°C between ambient
illustration, the power derating curve and junction for a power dissipation of
Thermal characteristics of 1N914 is shown in Fig. 9. The maxi- 500 mW. This means that the junction
mum power temperature would be 175°C.
rating de- If this device has to safely dis-
creases line- sipate 500mW power at, say, 75°C,
arly with the the temperature differential cannot
increase in exceed 100°C. This would necessitate
temperature a thermal resistance from junction
at a rate of to ambient of 200°C/watt. It can be
3.33 mW/°C achieved by using a suitable heat-sink,
above 25°C. thus reducing case-to-ambient thermal
Thermal resistance component of the overall
resistance thermal resistance.
from junc- …To be concluded next month
tion-to-am-
bient (θ J-A ). Anil Kumar Maini is the head of EOCM and Op-
This param- toelectronics Division and associate director at
Laser Science and Technology Centre (Defence
eter is an R&D Organisation), and Varsha Agrawal is a senior
indicator of scientist in EOCM and Optoelectronics Division at
Fig. 9: Power dissipation—temperature derating curve of 1N914 the diode’s Laser Science and Technology Centre

1 1 8 • a p r i l 2 0 0 9 • e l e c t ro n i c s f o r yo u w w w. e f y m ag . co m
design

Part 3 of 3
Reading the Datasheets of
Electronic Devices
Designers have a large variety of operational amplifiers (op-amps) to choose from. So
we focus this month on op-amps to help designers decide which category is best suited
for a given set of applications

 Anil Kumar Maini and


Varsha Agrawal

D
epending upon the perform-
ance specifications and con-
sequently their application
areas, and also on the basis of their
internal circuit, op-amps are broadly
classified as general-purpose op-amps,
high-speed and high-bandwidth op-
amps, op-amp comparators, Norton
op-amps, instrumentation op-amps
and isolation op-amps.
Like other semiconductor devices,
op-amps too are characterised by a
wide range of performance specifi-
cations. Again, the importance and
relevance of a given performance pa-
rameter to a certain application circuit
could be more or less than the other
parameters.

Selection criteria
Choosing the right op-amp for a given Fig. 1: Frequency response of LF156
application is usually a three-step
process. First, appreciate relevant identify relevant parameters such as common-mode rejection ratio (CMRR),
performance parameters and the gain bandwidth, slew rate and trans- power supply rejection ratio (PSRR),
level of these parameters required impedance gain available at the desired input impedance, slew rate, offsets,
for the intended application. Second, bandwidth and then fix the desired offset drifts and noise-related specifi-
identify the category of op-amps that values for these parameters. Having cations.
the desired device is likely to belong done that, see if any of the available Open-loop gain is the ratio of
to. Next, select the type number from general-purpose op-amps meets the single-ended output to differential
the device catalogues of the relevant required performance specifications input. It influences gain accuracy when
manufacturers. or you need a high-speed, high-band- the op-amp is wired as an amplifier.
For example, if you are looking for width op-amp. Higher open-loop gain is desirable as it
an op-amp to be used in a trans-imped- Op-amps are characterised by gives higher gain accuracy. It is, in fact,
ance amplifier configuration to convert performance specifications like sup- the loop gain—ratio of open-loop gain
the photo-current resulting from a laser ply voltage range, power dissipation, to the closed-loop gain—which decides
radiation pulse falling on a photodiode operating temperature range, open- the gain accuracy.
into an equivalent voltage signal, first loop gain, gain bandwidth product, Bandwidth represents the fre-

1 0 4 • M ay 2 0 0 9 • e l e c t ro n i c s f o r yo u w w w. e f y m ag . co m
design
quency response of the op-amp and specified input impedance.
is usually expressed as gain-band-

Output voltage swing


width product or unity-gain crossover Types of op-amps
frequency. This parameter gives the As mentioned earlier, the first step in

(50 mv/div)
small signal bandwidth. That is, signal choosing the right op-amp for a given
amplitude and frequency are such application is to know and appreciate
that the rate of change of output does the category that the desired op-amp
not exceed the slew rate specification. is likely to belong to. This helps in
Fig. 1 shows the frequency response quick identification of the device as the Time (0.5 µs/DIV)
of LF156. operational amplifier manufacturers in (a) Small-signal pulse response

Slew rate is the rate of change of their databooks often categorise their

Output voltage swing (5v/div)


output with time under large signal devices into one or more of the types
conditions. It is determined by ap- depending upon the range of devices
plying a step input and monitoring offered by them.
the output. It decides the large signal General-purpose op-amps are
bandwidth of the op-amp. those op-amps which have moderate
Fig. 2 shows the small-signal and or reasonably good values of various
large-signal pulse response of LF156. key parameters. None of the major
Increased rise time in the case of large- performance parameters is either ex-
Time (1 µs/DIV)
signal pulse response due to slew rate ceptionally good or very poor. Among
limitation is evident in Fig. 2(b). the broad category of general-purpose (b) Large-signal pulse response

Common-mode rejection ratio op-amps, those with better overall per- Fig. 2: Signal pulse response of LF156
(CMRR) is the ability of the op-amp to formance specifications are referred to
amplify differential signals and reject as high-performance, general-purpose and LF356 are 0.5V/µs and 12V/µs,
common-mode signals. This parameter op-amps. While LM741/741C is a gen- respectively. Gain bandwidths are 1
is particularly important in data acqui- eral-purpose op-amp, LF156/256/356 MHz (for LM741C) and 5 MHz (for
sition applications where it is desirable with its relatively better bandwidth, LF356).
to amplify low-level differential signals slew rate, input impedance and noise Op-amp comparators are specially
riding on high-amplitude, common- specifications may be categorised as designed to operate in comparator
mode signals. CMRR of 80 to 90 dB a high-performance, general-purpose applications. These respond relatively
is common in general-purpose op- op-amp. much faster—within a few nanosec-
amps. Instrumentation op-amps offer High-speed and high-bandwidth onds to tens of nanoseconds. Their
CMRR in excess of 100 dB. AD524, an op-amps have relatively much higher outputs are usually compatible to
instrumentation op-amp, has CMRR of slew rate and bandwidth specifica- common logic families. One such op-
greater than 120 dB. tions. These specifications are usu- amp comparator is LM 119/219/319,
Input impedance is the impedance ally a couple of orders of magnitude which is a dual comparator. Response
across input terminals of the op-amp. higher than general-purpose op-amps. time is specified to be 80 ns and its
Usually expressed in terms of resist- For example, the slew rate and gain- open-collector output with the rec-
ance only, it is different for inverting bandwidth values of AD829, which ommended pull-up resistor can drive
and non-inverting amplifier circuits. is a high-speed, high-bandwidth op- RTL, DTL and TTL family devices.
For inverting amplifier circuits it amp from Analog Devices, are 230 Norton op-amps, also known as
equals the input resistance connected V/µs and 120 MHz, respectively. You current differencing op-amps, have
from the source of signal to the in- can see the difference for yourself a different internal architecture that
verting input of the op-amp, and for when you compare these values with makes them particularly suitable for
non-inverting amplifier circuits it the corresponding values of LM741C single-supply operation. While we
equals the product of loop gain and and LF356. The slew rates of LM741C talk about differential input voltage in
the case of conventional op-amps, it is
Different categories of op-amps range from general- differential input current for Norton
op-amps. Most general-purpose op-
purpose op-amps offering moderate values of all
amp applications can be realised using
key parameters to specialised types including Norton op-amps without significantly
high-speed op-amps, op-amp comparators, compromising the performance char-
instrumentation op-amps, isolation op-amps and acteristics. This, coupled with low cost
Norton op-amps. and single supply operation, makes

w w w. e f y m ag . co m e l e c t ro n i c s f o r yo u • M ay 2 0 0 9 • 1 0 5
design
front-end circuits of data acquisition
systems). Another salient feature of
instrumentation op-amps is that the
gain is programmable with a single
externally connected resistor. Also,
some instrumentation op-amps offer
a set of fixed gain values without the
use of even the lone programmable
resistor. For example, AD524 can
be programmed for any gain value
between 1 and 1000 with a single ex-
ternally connected resistor, whereas
gain values of 1, 10, 100 and 1000
are achievable without any external
resistor.
Isolation op-amps, also called iso-
lation amplifiers, are op-amps with
their output stage electrically isolated
from the input differential stage. Iso-
lation impedance of 1000 giga-ohms
and isolation voltage of 1000 volts
are common. Isolation op-amps are
mainly used in medical instrumenta-
tion where isolation between the basic
sensor—which is usually in physical
contact with the patient’s body—and
the equipment is desired.

Op-amp datasheet
The datasheet of an op-amp begins
with general product description.
The information in this part almost
invariably includes a summary of its
performance parameters, product
highlights, package description and,
in some cases, technological aspects of
the device architecture. Fig. 3, which
is nothing but a compilation of the
information found on the first page of
the datasheet of op-amp comparator
Fig. 3: Product description page of LM119/219/319 LM119/219/319, illustrates the point.
Other sections of the datasheet
Norton op-amps a popular choice in voltage of 50 µV and offset drift of 0.5 include essential components like
many general-purpose op-amp ap- µV/°C. These features make instru- absolute maximum ratings, electrical
plication circuits. LM3900 is a popular mentation op-amps particularly suit- characteristics and thermal character-
Norton op-amp. able for amplifying low-level differen- istics. Electrical characteristics contain
In the case of instrumentation tial signals with high common-mode a range of performance curves that
op-amps, input impedance, CMRR, content (such as those available from tell us about the variation of major
and values of offsets and offset drifts
approach ideal values. For example, The first step in choosing the right op-amp for a
AD524 instrumentation op-amp from
given application is to know and appreciate the
Analog Devices offers a differential,
common-mode input resistance of
category that the desired op-amp is likely to belong
1 giga-ohm, CMRR of 120 dB, offset to. This helps in quick identification of the device.

1 0 6 • M ay 2 0 0 9 • e l e c t ro n i c s f o r yo u w w w. e f y m ag . co m
design
to the device or affect reliability of the
device.
Maximum supply voltage is speci-
fied for both positive and negative
supplies in the case of dual-supply
op-amps. Typically, values are in the
range of ±18V to ±22V. Operating
values are in the range of ±3V to ±15V.
Supply voltage parameter is significant
as most op-amp parameters depend on
it. Available peak-to-peak output volt-
age swing, input common-mode volt-
age range, supply current, open-loop
Fig. 4: Input common-mode voltage range Fig. 5: Output voltage swing versus supply
gain, slew rate and response time (in
versus supply voltage for AD829 voltage for AD829 the case of comparators) are supply-
voltage-dependent. The dependence
of these parameters on supply voltage
The organisation of an op-amp’s datasheet is is indicated in the datasheet either in
no different from that of discrete semiconductor the form of performance curves or by
devices. The information in the datasheet is again specifying the values of these param-
presented under the headings of general product eters for a given supply voltage.
description or salient features, absolute maximum Figs 4 and 5 show the dependence
ratings, electrical characteristics and thermal of input common-mode voltage range
and output voltage swing, respectively,
characteristics. on supply voltage for AD829. In the
performance parameters as a function put short-circuit duration, internal case of LM156/256/356, the datash-
of one or more relevant parameters. power dissipation, maximum junction eet specifies slew rate of 12 V/µs and
Power dissipation as a function of temperature, operating temperature gain-bandwidth of 5 MHz for supply
temperature, CMRR as a function of range and storage temperature range. voltage of ±15V (Table I).
frequency and closed-loop gain, PSRR It may be mentioned that absolute Input voltage parameter quanti-
as a function of frequency, offsets as maximum ratings are stress ratings. fies the maximum voltage that can be
a function of temperature and output Stresses above those listed under these applied to each of the input terminals.
voltage swing as a function of supply ratings may cause permanent damage This parameter too is supply-voltage-
voltage are some examples.
In addition, the datasheet Table I
includes detailed internal AC Electrical Characteristics
schematic of the device. TA = Tj = 25°C, VS = ±15V
Now, let’s look at the
Symbol Parameter Conditions LF155/355 LF156/256/ LF156/256/ LF257/357 Units
information contained under 356B 356/LF356B
the absolute maximum rat- Typ. Min. Typ. Typ.
ings, electrical characteristics
SR Slew rate LF155/6 5 7.5 12 — V/µs
and thermal characteristics AV=1, — — —
headings and see what all LF357: AV=5 — — — 50 V/µs
it has for the op-amp circuit GBW Gain bandwidth — 2.5 — 5 20 MHz
designers. product

Absolute maximum
ts Setting time to
0.01 per cent
(Note 7) 4 — 1.5 1.5 µs
ratings
en Equivalent input RS=100Ω — — — — —
Under the heading of ab- noise voltage f=100 Hz 25 — 15 15 nV/√Hz
solute maximum ratings, f=1000 Hz 20 — 12 12 nV/√Hz
the datasheet of an op-amp i n Equivalent input f=100 Hz 0.01 — 0.01 0.01 pA/√Hz
typically includes supply current noise f=1000 Hz 0.01 — 0.01 0.01 pA/√Hz
voltage, differential input CIN Input capacitance — 3 — 3 3 pF
voltage, input voltage, out-

1 0 8 • M ay 2 0 0 9 • e l e c t ro n i c s f o r yo u w w w. e f y m ag . co m
design

Table II
(Note 3) DC Electrical Characteristics (Continued)
Symbol Parameter Conditions LF155/6 LF256/7 LF355/6/7 Units
LF356B
Min. Typ. Max. Min. Typ. Max. Min. Typ. Max.
I B Input bias current TJ=25°C (Notes 3, 5) — 30 100 — 30 100 — 30 200 pA
TJ≤High — — 50 — — 5 — — 8 nA
RIN Input resistance TJ=25°C — 1012 — — 1012 — — 1012 — Ω
AVOL Large signal VS=±15V, TA=25°C 50 200 — 50 200 — 25 200 — V/mV
voltage gain Vo=±10V, RL=2k
Over temperature 25 — — 25 — — 15 — — V/mV
Vo Output voltage VS=±15V, RL=10k ±12 ±13 — ±12 ±13 — ±12 ±13 — V
swing VS=±15V, RL=2k ±10 ±12 — ±10 ±12 — ±10 ±12 — V
VCM Input common-mode +15.1 — ±15.1 — +15.1 — V
voltage range VS=±15V ±11 –12 — ±11
–12 — +10
–12 — V
CMRR Common-mode — 85 100 — 85 100 — 80 100 — dB
rejection ratio
PSRR Supply voltage — 85 100 — 85 100 — 80 100 — dB
rejection ratio

dependent. Differential input voltage


is another related parameter. For some
op-amps, manufacturers recommend
use of resistors in series with the two
inputs in order to limit the input cur-
rent if the differential input voltage
rating were exceeded. High-speed op-
amp AD 829 is an example.
Power dissipation rating is typically
specified at an ambient temperature of
25°C and it must be de-rated for opera-
tion at elevated temperatures as per the
specified de-rating curve or for given
values of maximum allowable junction
temperature TJ (max) and junction-to- Fig. 6: Output voltage swing versus load Fig. 7: Output voltage swing as a function of
ambient thermal resistance θJ-A in the resistance for LF156 operating temperature for LF156
absence of any de-rating curve.
current, input offset voltage, offset supply, peak-to-peak output voltage
Electrical characteristics drifts with temperature, open-lop gain, swing is specified to be 24V for a load
Electrical characteristics are categorised input resistance, output voltage swing, resistance of 2 kilo-ohms (Table II).
by some manufacturers as DC and AC. input common-mode voltage range, The parameter falls rapidly for lower
Others specify all under a common CMRR and PSRR. Gain-bandwidth values of load resistance—as is evident
heading. Key DC characteristics in- product, slew rate and settling time are from the output voltage swing versus
clude input bias current, input offset the major AC characteristics. load resistance curve given in the da-
Each of the electrical characteristics tasheet (Fig. 6).
Dependence of key is specified under certain test condi- Output voltage swing is also a
parameters on operating tions. These test conditions should not strong function of operating tempera-
temperature, load be ignored while designing an applica- ture (see Fig. 7).
tion circuit. The specified values will As another illustration, response
resistance and supply be different under different conditions time parameter is observed to be
voltages should not be and in some cases the variation could strongly dependent upon input over-
ignored while designing be significant. As an illustration, while drive. For LM 119/219/319, it im-
an application circuit. operating op-amp LF156 on ±15V proves from about 100 ns to 50 ns as

w w w. e f y m ag . co m e l e c t ro n i c s f o r yo u • M ay 2 0 0 9 • 1 0 9
design
tion in supply voltage and operating comprehensive datasheets include
temperature. Thus, while using AD829 internal schematic to highlight archi-
for an application circuit that is sup- tectural features of the device, package
posed to work over a temperature dimensions and application circuits.
range of, say, –40°C to +85°C, slew Some manufacturers even describe the
rate could vary from 125V/µs to 175V/ theory of operation of the device with
µs for a supply voltage of ±5V. reference to its internal schematic ar-
Similarly, you can notice the strong rangement and explain specific features
dependence of CMRR specification to highlight the product’s capabilities.
of an instrumentation op-amp—one The application section includes a lot
of the most important parameters for of useful information for the designer.
this type of op-amp—on both the pro- Quite often, the designers get the idea
grammed gain as well as frequency of for the intended application circuit
Fig. 8: Response time as a function of input
overdrive for LM119/219/319 operation (Fig. 10). from the datasheet.

Thermal characteristics To sum up


Power dissipation, operating tempera- Confining yourself to the informa-
ture range, maximum junction tem- tion contained on the first page of
perature and thermal resistance (from the datasheet is completely unpro-
junction-to-ambient) are the key thermal fessional when you set yourself out
parameters. As outlined earlier, power to do an optimal design—one that
dissipation is specified at a certain am- meets all the design objectives. The
bient temperature (usually 25°C) and impressive look of the first page
the specified power dissipation value is could more often than not kill your
such that the junction temperature for design. The summary of performance
the specified value of power dissipa- specifications and product highlights
tion and given thermal resistance value presented on the first page of the
equals the maximum junction tempera- datasheet is intended to introduce
Fig. 9: Slew rate as a function of supply voltage ture. Therefore it must be de-rated for you to the product and help you to
and operating temperature for AD829 elevated operational temperatures. make a preliminary judgment about
Also, the type number designation the suitability of the device for your
contains informa- application. It should not be treated
tion about the opera- as the final word.
tional temperature The datasheet with detailed list-
range. For example, ing of its parameters, test conditions
LM741 and LM741A under which these parameters have
offer MIL-qualified been measured, performance curves
temperature range depicting variation of the param-
of –55°C to +125°C, eters with other relevant parameters,
while LM741C offers recommended test and application
commercial-grade circuits, etc reveals the true nature
temperature range of of the device from the perspective of
0°C to +70°C. Also, the designer. Therefore a thorough
AD829J, AD829A analysis of the datasheet of the device
and AD829S offer being considered for use should be
operating tempera- the designer’s imperative and not
Fig. 10: CMRR as a function of gain and frequency for AD524 ture ranges of 0°C discretion. 
to +70°C, –40°C to Concluded
the input overdrive changes from 2 mV +125°C, and –55°C to +125°C, respec-
to 20 mV (Fig. 8). tively. Anil Kumar Maini is the head of EOCM and Op-
Dependence of slew rate on both toelectronics Division and associate director at
the supply voltage as well as oper- Other information Laser Science and Technology Centre (Defence
R&D Organisation), and Varsha Agrawal is a senior
ating temperature is evident from In addition to listing the performance scientist in EOCM and Optoelectronics Division at
Fig. 9. Slew rate degrades with reduc- parameters and characteristic curves, Laser Science and Technology Centre

1 1 0 • M ay 2 0 0 9 • e l e c t ro n i c s f o r yo u w w w. e f y m ag . co m
circuit
ideas

Remote-operated Master Switch


 D. Mohan Kumar tial divider comprising resistors R4 and
R5 maintains half of 5.1V at pin 2 of

G
edi
enerally, a bedside master IC1. In brief, the voltage at pin 2 of IC1 s.c. dwiv
switch is used to switch is higher than at pin 3 and its output
on lamps both indoors and remains low. LED2 remains ‘off’ and
outdoors when there is a threat of transistor T2 does not conduct. Relay
intruder. This circuit can be used to RL1 remains de-energised and, as a re- glows to indicate activation of the
activate the master switch from the sult, security lamps (both indoors and relay as well as switching ‘on’ of the
bed without searching for the switch outdoors) remain switched off. security lights. Connect a single-pole,
in darkness. It can be activated by the When you press any key of the single-throw ‘on’/‘off’ switch (MS) to
TV remote handset. The security lamps remote TV handset, IR rays fall on the activate the security lamps manually

glow for three minutes and then turn receiver (IRX1) and its output goes low. when required.
off. The circuit is sensitive and can be LED1 flashes in sync with pulsation of Zener diode ZD1 provides 5.1V DC
activated from a distance of up to 25 the IR rays. At the same time, transis- for safe operation of the IR receiver
metres. tor T1 (BC558) conducts to take pin 3 of and associated circuit. Power for the
IR receiver module TSOP 1738 IC1 high. IC1 is used as a comparator circuit is derived from a step-down
(IRX1) is used to sense the pulsed with timer action. transformer (X1) and a bridge recti-
38kHz IR rays from the TV remote When transistor T1 conducts, pin 3 fier comprising diodes D1 through D4.
handset. The IR receiver module has of IC1 gets a higher voltage than pin 2 Smoothing capacitor C1 removes rip-
a PIN photodiode and a preamplifier making the output of IC1 high. Mean- ples, if any, from the power supply.
enclosed in an IR filter epoxy case. Its while, capacitor C4 charges to full Assemble the circuit on a general-
open-collector output is 5 volts at 5mA voltage and keeps pin 3 high for a few purpose PCB and enclose in a suitable
current in the standby mode. minutes even after T1 is non-conduct- cabinet. Drill holes on the front panel
In the standby mode, no IR rays ing. Resistor R3 provides discharge for mounting the IR sensor and LEDs.
from the remote handset fall on the IR path for capacitor C4, which decides Connect the master switch between the
receiver, so its output pin 3 remains the time period for which the output of normally-open (N/O) contact and pole
high and LED1 doesn’t glow. Through comparator IC1 should remain high. of relay RL1 so that the master switch
resistor R2, the base of transistor T1 The high output of IC1 energises re- can be used when needed. The relay
remains high and it does not conduct. lay RL1 through relay-driver transistor contacts rating should be more than
As a result, the voltage at pin 3 of IC T2. Thus the load, i.e., security lamps, 4A. Mount the unit near the master
CA3130 (IC1) remains low. The poten- turn on for three to four minutes. LED2 switch using minimal wiring. 

8 8 • a p r i l 2 0 0 9 • e l e c t ro n i c s f o r yo u w w w. e f y m ag . co m
circuit
ideas

USB Power Socket s.c. dwiv


edi

 T.K. Hareendran

T
oday, almost all computers con-
tain logic blocks for implement-
ing a USB port. A USB port, in
practice, is capable of delivering more
than 100 mA of continuous current at
5V to the peripherals that are connected
to the bus. So a USB port can be used,
without any trouble, for powering 5V
DC operated tiny electronic gadgets.
Nowadays, many handheld de-
vices (for instance, portable reading Fig. 1: Circuit of USB power socket

lamps) utilise this facility of the USB


port to recharge their built-in bat- Assemble the
tery pack with the help of an internal CIGAR
COIL CORD
USB POWER SOCKET circuit on a gen-
PLUG WITH INDICATOR
circuitry. Usually 5V DC, 100mA cur- eral-purpose PCB
rent is required to satisfy the input and enclose in a
power demand. slim plastic cabi-
Fig. 1 shows the circuit of a versatile Fig. 2: Interconnection of cigar plug and USB power net along with the
socket using a coil cord Fig. 3: Pin
USB power socket that safely converts indicator and USB
configuration
the 12V battery voltage into stable 5V. of LM317L (To- socket. While wir-
This circuit makes it possible to power/ Capacitor C1 buffers any disorder in 92 package) ing the USB out-
recharge any USB power-operated de- the input supply. Resistors R1 and R2 let, ensure correct
vice, using in-dash board cigar lighter regulate the output of IC1 to steady 5V, polarity of the supply. For intercon-
socket of your car. which is available at the ‘A’ type female nection between the cigar plug pin
The DC supply available from the USB socket. Red LED1 indicates the out- and the device, use a long coil cord as
cigar lighter socket is fed to an adjust- put status and zener diode ZD1 acts as a shown in Fig. 2. Pin configuration of
able, three-pin regulator LM317L (IC1). protector against high voltage. LM317L is shown in Fig. 3. 

w w w. e f y m ag . co m e l e c t ro n i c s f o r yo u • a p r i l 2 0 0 9 • 8 9
circuit
ideas

Solar Panel based Charger


and Small LED Lamp
edi
s.c. dwiv
 P.V. Vinod Kumar Thekkumuri types of batteries: lead acid, Ni-Cd
and Li-ion. The lead-acid batteries

Y
ou can save on your electric- are commonly used in emergency
ity bills by switching to alter- lamps and UPS. cuit for charging a lead-acid battery,
native sources of power. The The working of the circuit is sim- replace it with a normal pulsating DC
photovoltaic module or solar panel ple. The output of the solar panel is charger once a week. Keep checking
the water level of the lead-
acid battery. Pure DC voltage
normally leads to deposition
of sulphur on the plates of
lead-acid batteries.
For charging Ni-Cd cells,
shift switches S1 and S3 to
‘on’ position and use con-
nector ‘B.’ Regulator IC 7806
(IC1) is wired as a constant-
current source and its output
is taken from the middle ter-
minal (normally grounded).
Using this circuit, a constant
current goes to Ni-Cd cell for
charging. A total of four 1.2V
cells are used here. Resistor
R2 limits the charging cur-
Fig. 1: Circuit of solar panel based charger rent.
For charging Li-ion battery
fed via diode 1N5402 (D1), which (used in mobile phones), shift switches
acts as a polarity guard and pro- S1 and S2 to ‘on’ position and use con-
tects the solar panel. An ammeter nector ‘C.’ Regulator IC 7805 (IC2) pro-
is connected in series between vides 5V for charging the Li-ion bat-
diode D1 and fuse to measure the tery. Using this circuit, you can charge
current flowing during charging a 3.6V Li-ion cell very easily. Resistor
of the batteries. As shown in Fig. R3 limits the charging current.
1, we have used an analogue mul- Fig. 2 shows the circuit for a small
timeter in 500mA range. Diode LED-based lamp. It is simple and low-
D2 is used for protection against cost. Six 10mm white LEDs (LED2
reverse polarity in case of wrong through LED7) are used here. Just
connection of the lead-acid battery. connect them in parallel and drive
When you connect wrong polarity, directly by a 3.6V DC source. You can
the fuse will blow up. use either pencil-type Ni-Cd batteries
For charging a lead-acid bat- or rechargeable batteries as the power
Fig. 2: LED lamp circuit tery, shift switch S1 to ‘on’ posi- source.
tion and use connector ‘A.’ After Assemble the circuit on a general-
described here is capable of deliver- you connect the battery, charging purpose PCB and enclose in a small box.
ing a power of 5 watts. At full sun- starts from the solar panel via diode Mount RCA socket on the front panel of
light, the solar panel outputs 16.5V. D1, multimeter and fuse. Note that the box and wire RCA plug with cable
It can deliver a current of 300-350 pulsating DC is the best for charging for connecting the battery and LED-
mA. Using it you can charge three lead-acid batteries. If you use this cir- based lamp to the charger. 

8 0 • M ay 2 0 0 9 • e l e c t ro n i c s f o r yo u w w w. e f y m ag . co m
circuit
ideas

PC POWER MANAGER s.c. dwiv


edi

 T.K. Hareendran fier comprising diodes D1 through D4,


smoothed by capacitors C1 and C2,

V
ery often we forget to switch and regulated by IC LM7812 (IC1). The To activate the PC manager circuit,
off the connected peripher- regulated 12V DC is used to energise proceed as follows: Press ‘start’ switch
als like monitor, scanner and relay RL1. LED1 works as a power- S1 and hold it in this position for a
printer while switching off our PC. ‘active’ indicator. few minutes. When power-‘active’
This leads to needless energy con- To set up the circuit, first connect indicator LED1 lights up, relay RL1
sumption and possible shortening of the input socket (SOC1) of the circuit energises and the 230V mains power
the life of the peripheral. PCs with to a proper AC mains wall outlet us- supply from SOC1 is fed to output
an ATX switch-mode power supply ing a three-core power cable. Now socket SOC2 through the contacts of
(SMPS) unit are not provided with a connect one end of a standard USB relay RL1.
mains switch outlet. It is therefore not cable to the B-type USB
possible to achieve automatic switch- input socket and the
ing (on/off) of peripheral units with other end of the cable
the computer power switch. to any vacant USB port
Here is a simple circuit that turns (A-type) of the PC. Fi-
the connected peripherals on/off along nally, plug one standard
with your PC. It consists of a regulated four-way switchboard
power supply, a simple USB interface (extension cord) into the
and two electromagnetic relays used as supply output socket
power switches. (SOC2) of the circuit
The power supply for the circuit is and take power from
derived from the AC mains via trans- this switchboard to acti-
former X1. The 15V AC available at vate all loads like moni-
the secondary winding of transformer tor, scanner, printer and
X1 is first rectified by a bridge recti- even your PC. Fig. 2: Wiring diagram for PC power manager

Fig. 1: Circuit of PC power manager

8 4 • J u n e 2 0 0 9 • e l e c t ro n i c s f o r yo u w w w. e f y m ag . co m
circuit
ideas
Now start your computer as usual, PC manager is ready to use. cabinet. Connect SOC1, SOC2 and USB
by pressing the power button on the When you switch off your PC, relay socket along with switches S1 and S2
front panel. When the PC runs, there RL2 de-energises. As a result, electric and LEDs (LED1 and LED2) on the
will be 5V DC at the USB interface power from the switchboard (to which front panel of the cabinet. Refer Fig. 2
socket. As a result, relay RL2 energises all peripherals are connected) is cut off. for connections.
via diode D6. The contacts of relay RL2 Switch S2 works here as an emergency EFY note. Take care during fab-
close switch S1 permanently, and LED2 bypass switch. rication and testing, as the circuit is
glows continuously. Assemble the circuit on a general- at mains potential and may give you
Release ‘start’ switch S1. Now your purpose PCB and enclose in a suitable lethal shock. 

w w w. e f y m ag . co m e l e c t ro n i c s f o r yo u • J u n e 2 0 0 9 • 8 5
circuit
ideas

Constant-Current s.c. dwiv


edi

Battery Charger
 Monoj Das 13.5-14.2V in the case of a 12V battery), 14+5=19V.
give indication and the charger will For the sake of simplicity, this con-

T
here are many ways of battery switch off automatically. You need not stant-current battery charger circuit is
charging but constant-current remove the battery from the circuit. divided into three sections: constant-
charging, in particular, is a 4. If the battery is discharged be- current source, overcharge protection
popular method for lead-acid and Ni- low a limit, it will give deep-discharge and deep-discharge protection sec-
Cd batteries. In this circuit, the battery indication. tions.
is charged with a constant current that 5. Quiescent current is less than 5 The constant-current source is
is generally one-tenth of the battery mA and mostly due to zeners. built around MOSFET T5, transistor
capacity in ampere-hours. So for a 6. DC source voltage (VCC) ranges T1, diodes D1 and D2, resistors R1, R2,
4.5Ah battery, constant charging cur- from 9V to 24V. R10 and R11, and potmeter VR1. Diode
rent would be 450 mA. 7. The charger is short-circuit pro- D2 is a low-temperature-coefficient,
This battery charger has the follow- tected. highly stable reference diode LM236-5.
ing features: D1 is a low-forward-drop schottky LM336-5 can also be used with reduced
1. It can charge 6V, 9V and 12V bat- diode SB560 having peak reverse volt- operating temperature range of 0 to
teries. Batteries rated at other voltages age (PRV) of 60V at 5A or a 1N5822 +70°C. Gate-source voltage (VGS) of T5
can be charged by changing the values diode having 40V PRV at 3A. Nor- is set by adjusting VR1 slightly above
of zener diodes ZD1 and ZD2. mally, the minimum DC source volt- 4V. By setting VGS, charging current
2. Constant current can be set as age should be ‘D1 drop+Full charged can be fixed depending on the battery
per the battery capacity by using a battery voltage+VDSS+ R2 drop,’ which capacity. First, decide the charging
potmeter and multimeter in series with is approximately ‘Full charged battery current (one-tenth of the battery’s Ah
the battery. voltage+5V.’ For example, if we take capacity) and then calculate the nearest
3. Once the battery is fully charged, full-charge voltage as 14V for a 12V standard value of R2 as follows:
it will attain certain voltage level (e.g. battery, the source voltage should be R2 = 0.7/Safe fault current

1 1 4 • Au g u s t 2 0 0 9 • e l e c t ro n i c s f o r yo u w w w. e f y m ag . co m
circuit
ideas
R2 and T1 limit the charging cur- diode ZD1 starts conducting after LED2 will glow to indicate that the bat-
rent if something fails or battery termi- its breakdown voltage is reached, tery voltage is low.
nals get short-circuited accidentally. i.e., it conducts when the battery Values of zener diodes ZD1 and
To set a charging current, while voltage goes beyond a prefixed high ZD2 will be the same for 6V, 9V and
a multimeter is connected in series level. Adjust VR2 when the battery 12V batteries. For other voltages, you
with the battery and source supply is is fully charged (say, 13.5V in case of need to suitably change the values of
present, adjust potmeter VR1 slowly a 12V battery) so that VGS of T5 is set ZD1 and ZD2. Charging current pro-
until the charging current reaches its to zero and hence charging current vided by this circuit is 1 mA to 1 A, and
required value. stops flowing to the battery. LED1 no heat-sink is required for T5. If the
Overcharge and deep-discharge glows to indicate that the battery is maximum charging current required is
protection have been shown in dotted fully charged. When LED1 glows, the 5A, put another LM236-5 in series with
areas of the circuit diagram. All com- internal LED of the optocoupler also diode D2, change the value of R11 to 1
ponents in these areas are subjected to glows and the internal transistor con- kilo-ohm, replace D1 with two SB560
a maximum of the battery voltage and ducts. As a result, gate-source voltage devices in parallel and provide a good
not the DC source voltage. This makes (VGS) of MOSFET T5 becomes zero and heat-sink for MOSFET T1. TO-220 pack-
the circuit work under a wide range of charging stops. age of IRF540 can handle up to 50W.
source voltages and without any influ- Normally, zener diode ZD2 con- Assemble the circuit on a gen-
ence from the charging current value. ducts to drive transistor T3 into con- eral-purpose PCB and enclose in a
Set overcharge and deep-discharge duction and thus make transistor T4 box after setting the charging current,
voltage of the battery using potmeters cut-off. If the battery terminal voltage overcharge voltage and deep-discharge
VR1 and VR2 before charging the bat- drops to, say, 11V in case of a 12V bat- voltage. Mount potmeters VR1, VR2
tery. tery, adjust potmeter VR3 such that and VR3 on the front panel of the
In overcharge protection, zener transistor T3 is cut-off and T4 conducts. box. 

w w w. e f y m ag . co m e l e c t ro n i c s f o r yo u • Au g u s t 2 0 0 9 • 1 1 5
circuit
ideas

Multitone Siren s.c. dwiv


edi

 Pradeep G. and small audio amplifier LM386. IC


4060 is used as the multitone genera-

T
his multitone siren is useful for tor. A 100µH inductor is used at the These multifrequency signals are
burglar alarms, reverse horns, input of IC 4060. So it oscillates within mixed and fed to the audio amplifier
etc. It produces five different the range of about 5MHz RF. IC 4060 built around IC LM386.
audio tones and is much more ear- itself divides RF signals into AF and The output of IC2 is fed to the
catching than a single-tone siren. ultrasonic ranges. Audio signals of speaker through capacitor C9. If you
The circuit is built around popular different frequencies are available at want louder sound, use power ampli-
CMOS oscillator-cum-divider IC 4060 pins 1, 2, 3, 13 and 15 of IC 4060 (IC1). fier TBA810 or TDA1010.
Only five out-
puts of IC1 are used
here as the other
five outputs (pins
4 through 7 and 14)
produce ultrasonic
signals, which are
not audible.
Assemble the
circuit on a gen-
eral-purpose PCB
and enclose in a
suitable cabinet.
Regulated 6V-12V
(or a battery) can be
used to power the
circuit. 

1 1 8 • Au g u s t 2 0 0 9 • e l e c t ro n i c s f o r yo u w w w. e f y m ag . co m
circuit
ideas

Mini UPS System s.c. dwiv


edi

 D. Mohan Kumar When the mains power fails,


diode D3 gets reverse biased and

T
his circuit provides an uninter- D4 gets forward biased so that the vary between 10.5V and 12V, when
rupted power supply (UPS) battery can automatically take up the UPS system is in battery mode.
to operate 12V, 9V and 5V the load without any delay. When Outputs at points B and C provide
DC-powered instruments at up to 1A the battery voltage or input voltage 9V and 5V, respectively, through regu-
current. The backup battery takes up falls below 10.5V, a cut-off circuit is lator ICs (IC1 and IC2), while output
the load without spikes or delay when used to prevent deep discharging of A provides 12V through the zener
the mains power gets interrupted. It the battery. Resistor R3, zener diode diode. The emergency lamp uses two
can also be used as a workbench power ZD1 (10.5V) and transistor T2 form ultra-bright white LEDs (LED2 and
supply that provides 12V, 9V and 5V the cut-off circuit. When the volt- LED3) with current limiting resistors
operating voltages. The circuit im- age level is above 10.5V, transistor R5 and R6. The lamp can be manually

mediately disconnects the load when T2 conducts and its base becomes switched ‘on’ and ‘off’ by S1.
the battery voltage reduces to 10.5V to negative (as set by R3, VR2 and ZD1). the circuit is assembled on a gen-
prevent deep discharge of the battery. But when the voltage reduces below eral-purpose PCB. There is adequate
LED1 indication is provided to show 10.5V, the zener diode stops conduc- space between the components to
the full charge voltage level of the bat- tion and the base voltage of transis- avoid overlapping. heat sinks for tran-
tery. miniature white LEDs (LED2 and tor T2 becomes positive. It goes into sistor T2 and regulator ICs (7809 and
LED3) are used as emergency lamps the ‘cut-off’ mode and prevents the 7805) to dissipate heat are used.
during power failure at night. current in the output stage. Preset The positive and negative rails
A standard step-down trans- VR2 (22k) adjusts the voltage below should be strong enough to handle
former provides 12V of AC, which 0.6V to make T2 work if the voltage high current. Before connecting the
is rectified by diodes D1 and D2. Ca- is above 10.5V. circuit to the battery and transformer,
pacitor C1 provides ripple-free DC to When power from the mains is connect it to a variable power supply.
charge the battery and to the remain- available, all output voltages—12V, Provide 12V DC and adjust VR1 till
ing circuit. When the mains power is 9V and 5V—are ready to run the LED1 glows. After setting the high
on, diode D3 gets forward biased to load. On the other hand, when the voltage level, reduce the voltage to
charge the battery. Resistor R1 limits mains power is down, output volt- 10.5V and adjust VR2 till the output
the charging current. Potentiometer ages can run the load only when the trips off. After the settings are com-
VR1 (10k) with transistor T1 acts as battery is fully charged (as indicated plete, remove the variable power sup-
the voltage comparator to indicate by LED1). For the partially charged ply and connect a fully-charged battery
the voltage level. VR1 is so adjusted battery, only 9V and 5V are available. to the terminals and see that LED1 is
that LED1 is in the ‘off’ mode. when Also, no output is available when the on. After making all the adjustments
the battery is fully charged, LED1 voltage goes below 10.5V. If battery connect the circuit to the battery and
glows indicating a full voltage level voltage varies between 10.5V and transformer. The battery used in the
of 12V. 13V, output at terminal A may also circuit is a 12V, 4.5Ah UPS battery. 

9 4 • N o v e m b e r 2 0 0 9 • e l e c t ro n i c s f o r yo u w w w. e f y m ag . co m
circuit
ideas

Pyroelectric fire alarm s.c. dwiv


edi

 D. Mohan Kumar gate protected p-channel MOSFETs


in the inputs. It has high speed of

H
ere is an ultra-sensitive fire performance and low input current re- momentarily changes the voltage level
sensor that exploits the direct quirements. There are two inputs—the at pin 3 of IC1 and its output swings
piezoelectric property of an non-inverting input (pin 3) connected high. Transistor T1 conducts taking
ordinary piezo element to detect fire. to the piezo element through diode D7 the reset pin 12 of IC2 to ground. IC2
The lead zirconate titanate crystals in (OA71) that carries the voltage signal is now enabled and starts oscillating.
the piezo element have the property from the piezo element and the invert- With the shown values of the oscil-
to deform and generate an electric ing input (pin 2) that gets a preset volt- lating components C3 (0.22µ) and R6

Fig. 1: Pyroelectric fire sensor

age through (1M), the first output (Q3) turns high


VR1. after a few seconds and a red LED2
By ad- starts flashing. If heat near the piezo
justing VR1, persists, Q7 (pin 14) output of IC2 be-
it is easy to comes high after one minute, and the
set the ref- alarm starts beeping. If heat contin-
erence volt- ues, Q9 (pin 15) turns high after four
age level minutes and turns on the relay driver
at pin 2. In transistor T2. At the same time, diode
normal con- D8 conducts and IC2 stops oscillating
Fig. 2: Power supply with battery backup dition, IC1 and toggles.
gives a low The solenoid pump connected to
potential when heated, thus convert- output and the remaining circuitry is the N/O (normally opened) contact of
ing the piezo element into a heat sen- in a standby state. Capacitor C2 keeps the relay starts spraying the fire-ceas-
sor. The circuit described here is very the non-inverting input of IC1 stable, ing foam or water to the possible sites
sensitive. It gives a warning alarm if so that even a slight change in volt- of fire.
the room temperature increases more age level in the inputs can change the Power supply circuit. Power
than 10°C. The entire circuit has two output to high. supply section (Fig. 2) comprises a
sections—the sensor and the power Normally, IC1 gives a low output, 0-12V, 1A step-down transformer
supply section. keeping transistor T1 non-conduct- with a standard full-wave rectifier
Sensor side circuit. Fig. 1 shows the ing. Reseting pin 12 of IC2 (CD4060) formed by D1 through D4 and filter
fire sensor circuit. The front end of the connected to the collector of transistor capacitor C1. A battery backup is
circuit has a sensitive signal amplifier T1 gets a high voltage through R5 and provided if the mains supply is cut-off
built around IC1 (CA3130). It gives a IC2 remains disabled. When the piezo due to short-circuit and fire. A 12V,
high output when temperature near element gets heat from fire, asymmetry 4.5Ah rechargeable battery is used
the piezo element increases. IC CA3130 in its crystals causes a potential change, for backup to give sufficient current
is a CMOS operational amplifier with enabling capacitor C2 to discharge. It to the solenoid pump. When mains

9 2 • D e c e m b e r 2 0 0 9 • e l e c t ro n i c s f o r yo u w w w. e f y m ag . co m
circuit
ideas
power is available, diode D5 forward to the circuit. LED1 indicates the avail- ement on a 30×30cm aluminium sheet
biases. It provides power to the circuit ability of mains power. to increase its sensitivity. Fix the sheet
and also charges the battery through Assemble the circuit on a general- with the piezo sensor to the site where
resistor R2, and it limits the charging purpose PCB and enclose it in a suit- protection is needed. The remaining
current to 120 mA. When power fails, able case. Connect the piezo element circuit can be fixed at a suitable place.
diode D5 reverse biases and diode D6 to the circuit using a thin insulated If only the alarm generator is needed,
forward biases, giving instant backup wire. Glue the flat side of the piezo el- omit the relay driver section. 

w w w. e f y m ag . co m e l e c t ro n i c s f o r yo u • D e c e m b e r 2 0 0 9 • 9 3

You might also like