You are on page 1of 71

INTELLIGENT SWITCH

T
his intelligent switch circuit ena- remains de-en-
bles automatic, switching on of ergised. How-
an emergency light system during ever, during
darkness in the event of mains failure. darkness, pho-
The mains power failure condition to transistor
is detected by the section consisting is cut-off and
of mains step-down transformer X1 therefore tran-
followed by bridge rectifier comprising sistor T2 re-
diodes D1 through D4 and smoothing ceives forward
capacitor C1. If the mains is available base bias via
then it causes energisation of relay resistor R1
RL1 which has two sets of changeover (connected to
contacts. positive rail),
The light/darkness condition is de- as resistor R2
tected by the circuit comprising photo- is no more
transistor FPT100/2N5777 followed by grounded (via
Darlington pair comprising transistors photo-transis-
T2 and T3. However, this section will tor T1). As a
function only when mains supply is result, relay
not available (i.e. when relay RL1 is in RL2 gets en-
de-energised state) since battery supply ergised.
(negative lead) path gets completed via Thus it
lower N/C contact of relay RL1. would be ob-
During daylight, photo transistor served that
conducts and places transistor T2 base when mains is
near ground potential. Thus Darlington absent (relay RL1 de-energised) and it output path is complete. In any other
pair remains cut-off and relay RL2 is dark (relay RL2 energised), the switch condition switch output path would get
broken. The switch output terminals can
Period Conditions Switch status
be used (in series with supply) to control
a lighting system directly or indirectly
During daylight
[
(when mains is present
(when mains is absent) ] intelligent switch is ‘off ’.
through another contactor/heavy-duty
relay depending upon the load.
During night darkness
[ (when mains is absent) ]
(when mains is present) intelligent switch is ‘off ’.
intelligent switch is ‘on’.
The working of the intelligent switch
is summarised in the table.

200 ELECTRONICS PROJECTS Vol. 19


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
Long-range FM Transmitter
S
everal circuits for constructing FM
transmitters have been published
in EFY. The power output of most
of these circuits were very low because
no power amplifier stages were incorpo-
rated.
The transmitter circuit described here
has an extra RF power amplifier stage,
after the oscillator stage, to raise the
power output to 200-250 milliwatts. With
a good matching 50-ohm ground—plane
antenna or multi-element Yagi antenna,
this transmitter can provide reasonably
good signal strength up to a distance of
about 2 kilometres.
The circuit built around transistor
T1 (BF494) is a basic low-power vari-
able-frequency VHF oscillator. A varicap an aluminium sheet. VR2 is used for power control. For hum-
diode circuit is included to change the fre- Coil winding details are given below: free operation, operate the transmitter
quency of the transmitter and to provide L1 – 4 turns of 20 SWG wire close on a 12V rechargeable battery pack of
frequency modulation by audio signals. wound over 8mm diameter plastic 10 x 1.2-volt Ni-Cd cells. Transistor T2
The output of the oscillator is about 50 former. must be mounted on a heat sink. Do
milliwatts. Transistor T2 (2N3866) forms L2 – 2 turns of 24 SWG wire near top not switch on the transmitter without
a VHF-class A power amplifier. It boosts end of L1. a matching antenna. Adjust both trim-
the oscillator signals’ power four to five (Note: No core (i.e. air core) is used for mers (VC1 and VC2) for maximum
times. Thus, 200-250 milliwatts of power the above coils) transmission power. Adjust potentiom-
is generated at the collector of transistor L3 – 7 turns of 24 SWG wire close eter VR1 to set the centre frequency
T2. wound with 3mm diameter air core. near 100 MHz.
For better results, assemble the circuit L4 – 7 turns of 24 SWG wire-wound on This transmitter should only be used
on a good-quality glass epoxy board and a ferrite bead (as choke) for educational purposes. Regular trans-
house the transmitter inside an alumini- Potentiometer VR1 is used to set the mission using such a transmitter without
um case. Shield the oscillator stage using centre frequency whereas potentiometer a licence is illegal in India.

ELECTRONICS PROJECTS Vol. 20


LOW-COST PCO BILLING METER
T
he circuit presented here can be well as upon the impedance of telephone optocoupler IC3. The output of this
used in PCOs for displaying the instrument). Handset is normally lifted optocoupler is used to bridge the ‘=’
actual bill. The comparative either for dialing or in response to a ring. button on a calculator (such as Taksun
disadvantages of the presented circuit are In the circuit shown in Fig. 1, when make), which has the effect of pressing
as follows: the handset is off-hook, the optocoupler the ‘=’ button of the calculator.
1. The calculator used along with this MCT2E (IC1) conducts and forward Considering that pulse rate for a
circuit is required to be switched ‘on’ biases transistor T1, which, in turn, specific town/time/day happens to be Rs
manually before making a call. forward biases transistor T2 and 1.26 per pulse, then before maturity of
2. Certain manual entries have to be energises relay RL1. In energised the call one enters 1.26 followed by
made in the calculator; for example, for condition of relay, the upper set of relay pressing of ‘+’ key twice. Now, if a total
a pulse rate of Rs 1.26, number 1.26 is contacts connects the positive supply rail of ten billing pulses have been received

to PLL (phase- from exchange for the duration of the call,


locked loop) IC2 then on completion of the call, the
(LM567) pin 4, calculator display would show 12.60. The
while the lower set telephone operator has to bill the
of relay contacts customer Rs 14.60 (Rs 12.60 towards call
couples the positive charges plus Rs 2.00 towards service
telephone lead to charges).
input pin 3 of For tuning of the PLL circuit around
LM567 via IC2, lift the handset and inject 16kHz
capacitor C1 and tone across the line input points.
resistor R3. Tune IC2 to centre frequency of 16 kHz
The negative with the help of preset VR1. Proper
telephone lead is tuning of the PLL will cause LED
permanently (D6) to glow even with a very low-
to be entered after switching ‘on’ the capacitively coupled to ground via amplitude 16kHz tone.
calculator followed by pressing of ‘+’ capacitor C2. As soon as call matures, EFY Lab note. Arrangement used for
button twice. However, possibility exists 16kHz tone pulses would be pumped into simulating a 16kHz pulsed tone is shown
for automating these two functions by the telephone line by the telephone in Fig. 2. Push-to-on switch is used for
using additional circuitry. exchange at suitable intervals. This generation of fixed-duration pulse for
In telephony, on-hook condition is interval depends on the pulse rate of the modulating and switching on a 16kHz
represented by existance of 48V to 52V place called and also the time of the day oscillator.
across the line. Similarly, the off-hook and whether it’s a working-day or For more details regarding pulse
condition is represented by the line holiday. On receipt of 16kHz pulse, rates, pulse codes, etc, readers are
voltage dropping to a level of 8V to 10V output pin 8 of IC LM567 (which is tuned advised to go through the tariff rates and
(depending upon the length of the local for centre frequency of 16 kHz) goes ‘low’ pulse code information given in the
lead line (local loop) from telephone for the duration of the pulse. The output beginning pages of telephone directories,
exchange to the subscriber’s premises as of IC2 is coupled via transistor T3 to such as MTNL, Delhi directory, Vol. I.

188 ELECTRONICS PROJECTS Vol. 21


Low Current, High
Voltage Power Supply
A
high voltage power supply is a
very useful source which can be Table
effectively used in many applica- Details of the Transformer Windings
tions like biasing of gas-discharge tubes Windings No. of Standard wire
and radiation detectors etc. Such a power turns gauge (SWG)
supply could also be used for protection of Primary 50 31
property by charging of fences. Here the Feedback 12 31
current requirement is of the order of a Secondary 1650 41
few microamps. In such an application,
high voltage would essentially exist be-
tween a ‘live’ wire and ground. When this
‘live’ wire is touched, the discharge occurs
via body resistance and it gives a non-le-
thal but deterrent shock to an intruder.
The circuit is built around a transis-
torised blocking oscillator. An important
element in this circuit is the transformer.
It can be fabricated using easily available
ferrite core. Two ‘E’ sections of the core
are joined face-to-face after the enamelled
copper wire wound on former is placed in
it. The details of the transformer windings
are given in the Table.
In this configuration, the primary wind-
ing and the feedback winding are arranged about 24V(p-p). This gets further ampli- adjusted by varying the supply voltage.
such that a sustained oscillations are en- fied due to the large step-up ratio of the The present configuration gives 2 kV for an
sured once the supply is switched on. The transformer and we get about 800V(p-p) input DC voltage of 15 V. Though higher
waveform’s duty cycle is asymmetrical, but across the secondary. A simple series volt- voltages could be achieved by increas-
it is not very important in this application. age multiplier (known as Cockroft-Walton ing input supply, one word of caution is
Please note that if the oscillations do not oc- circuit) is used to boost up this voltage necessary: that the component ratings
cur at the ‘switch-on’ time, the transformer in steps to give a final DC voltage of about have to be kept in mind. If the ratings
winding terminals of the feedback or the 2 kV. are exceeded then there will be electrical
primary winding (but not both) should be The output voltage, however, is not discharges and breakdowns, which will
reversed. very well regulated. But if there is a damage the device.
The primary oscillations amplitude is constant load, the final voltage can be

ELECTRONICS PROJECTS Vol. 20


MAGIC LIGHTS
T
he circuit as shown in the figure emits green light. And when positive volt- BCD to 7-segment latch/decodor/driver
employs 14 bi-colour (red and age is simultaneously applied to its pins 1 ICs. Thus we obtain a total of 14 seg-
green) LEDs having three termi- and 3, it emits amber light. The circuit can ment outputs from each of the IC pairs

nals each. Different dancing colour pat- be used for decorative lights. consisting of IC4 plus IC5 and IC6 plus
terns are produced using this circuit since IC1 (555) is used in astable mode to IC7. While outputs from former pair
each LED can produce three different generate clock signal for IC2 and IC3 are connected to pin No. 1 of all the
colours. The middle terminal (pin 2) of the (CD4518) which are dual BCD counters. 14 bi-colour LEDs via current limiting
LEDs is the common cathode pin which is Both counters of each of these ICs have resistors, the ouputs of the latter pair
grounded. When a positive voltage is ap- been cascaded to obtain 8 outputs from are similarly connected to pin No.3 of
plied to pin 1, it emits red light. Similarly, each. The outputs from IC2 and IC3 are all the bi-colour LEDs to get a magical
when positive voltage is applied to pin 3. it connected to IC4 through IC7 which are dancing lights effect.

ELECTRONICS PROJECTS Vol. 19 187


Magnetic Proximity Switch
H
ere is an interesting circuit for a
magnetic proximity switch which
can be used in various applica-
tions.
The circuit, consists of a reed switch
at its heart. When a magnet is brought
in the vicinity of the sensor (reed switch),
its contacts close to control the rest
of the switching circuit. In place of the
reed switch, one may, as well, use a
general-purpose electromagnetic reed
relay (by making use of the reed switch
contacts) as the sensor, if required. These
tiny reed relays are easily available as
they are widely used in telecom products.
The reed switch or relay to be used with a consequence its output at pin 3 is used. Note that the flip-flop is wired
this circuit should be the ‘normally open’ goes high for a short duration and in toggle mode with data input (pin 5)
type. supplies clock to the clock input connected to the Q (pin 2) output. On
When a magnet is brought/placed (pin 3) of IC2 (CD4013—dual D-type receipt of clock pulse, the Q output at
in the vicinity of the sensor element flip-flop). LED D2 is used as a response pin 1 changes from low to high state and
for a moment, the contacts of the indicator. due to this the relay driver transistor
reed switch close to trigger timer This CMOS IC2 consists of two inde- T1 gets forward-biased. As a result the
IC1 wired in monostable mode. As pendent flip-flops though here only one relay RL1 is energised.

ELECTRONICS PROJECTS Vol. 20


CIRCUIT
IDEAS

MEDIUM-POWER S.C. DW
IVEDI

FM TRANSMITTER
„ PRADEEP G. in RF stages as oscillator.) The third tenna. For the
stage is a class-A tuned amplifier that maximum range,

T
he range of this FM transmi- boosts signals from the oscillator. Use use a sensitive re-
tter is around 100 metres at 9V of the additional RF amplifier increases ceiver. VC1 is a
DC supply. the range of the transmitter. frequency-adjust-
The circuit comprises three stages. Coil L1 comprises four turns of ing trimpot. VC2
The first stage is a microphone pream- 20SWG enamelled copper wire wound should be adjusted
plifier built around BC548 transistor. to 1.5cm length of a 4mm dia. air core. Fig. 2: Pin for the maximum
configurations of
The next stage is a VHF oscillator wired Coil L2 comprises six turns of 20SWG transistors BC548
range. The trans-
around another BC548. (BC series tran- enamelled copper wire wound on a and C2570 mitter unit is pow-
sistors are generally used in low-fre- 4mm dia. air core.
quency stages. But these also work fine Use a 75cm long wire as the an-

Fig. 3: Walkie-talkie arrangement

ered by a 9V PP3 battery. It can be


combined with a readily available FM
receiver kit to make a walkie-talkie set
Fig. 1: FM transmitter as shown in Fig. 3. z

80 • AUGUST 2005 • ELECTRONICS FOR YOU WWW.EFYMAG.COM

CMYK
CIRCUIT
IDEAS

MICROMOTOR CONTROLLER SUNIL K


UMAR

„ V. DAVID connected between the outputs (pin 3) tor in conjunction with switch S1. If
of IC1 and IC2. you press switch S3 after pressing

U
sing this circuit, you can con- Closing switch S5 provides power switch S1, pin 3 of IC3 goes high, while
trol the rotation of a DC to the circuit. Now, when you press its pin 4 goes low. The motor now
micromotor simply by press- switch S1 momentarily, pin 10 of IC3 starts rotating in the forward direction.

ing two push-to-on switches momen- goes high, while its pin 11 goes low. However, if you press switch S4 after
tarily. Since pin 10 of IC3 is connected to reset pressing switch S1, the motor will ro-
The circuit is built around two pin 4 of IC1 and IC2, the high output at tate in reverse direction.
NE555 ICs (IC1 and IC2) and a quad- pin 10 of IC3 will enable IC1 and IC2 Note. The complete kit of this cir-
NAND IC CD4011 (comprising NAND simultaneously. When switch S2 is cuit can be obtained from
gates N1 through N4). The NE555 ICs pressed, pin 10 of IC3 goes low, while Kits‘n’Spares, 303, Dohil Chambers, 46,
(IC1 and IC2) are configured as invert- its pin 11 goes high. The low logic at Nehru Place, New Delhi 110019;
ing buffers. IC CD4011 (IC3) NAND pin 10 disables both IC1 and IC2. Phone: 011-26430523, 26449577;
gates are configured as bistable flip- Switches S3 and S4 are used for Website: www.kitsnspares.com;
flop. The DC motor to be controlled is forward and reverse motion of the mo- E-mail: kits@efyindia.com. z

WWW.EFYMAG.COM ELECTRONICS FOR YOU • APRIL 2005 • 63

CMYK
CMYK

CIRCUIT
IDEAS

MUSICAL LIGHT CHASER S.C. DW


IVEDI

„ DEBARAJ KEOT ranged in zig-zag fashion. The bulb lighting effect generator circuit. You
sets glow one after another depending just need to place the gadget near the

T
his music-operated lighting ef- on the intensity of the audio signal. speakers of the music system.
fect generator comprises five No electrical connection is to be made Fig. 1 shows the complete circuit
sets of 60W bulbs that are ar- between the music system and the of the musical light chaser, while Fig.

Fig. 1: Circuit diagram of musical light chaser

82 • JANUARY 2005 • ELECTRONICS FOR YOU WWW.EFYMAG.COM


CMYK

CIRCUIT
IDEAS
2 shows pin configurations of 9V regu- The time constant can be changed by
lator 7809, triac BT136 and level meter changing the values of resistor R6,
IC LB1403. variable resistor VR2 and capacitor
The circuit is powered by regulated C7. Here, variable resistor VR2 is used
9V DC. The AC mains is stepped down for varying the response speed of the
by transformer X1 to deliver a second- chaser light as desired. When VR2 is
ary output of 12V AC at 250 mA. The set in the minimum resistance posi-
transformer output is rectified by a tion, the response is very fast, and
full-wave rectifier comprising diodes Fig. 2: Pin configuration when it is set at the maximum resis-
D1 and D2 and filtered by capacitors tance, the response is slow.
C1 and C2. Regulator IC 7809 (IC1) plifier, comparators and constant cur- The complete circuit including the
provides regulated 9V power supply rent source at its output pins. power supply can be constructed on
to the circuit. Closing switch S1 pro- Depending on the intensity of the any general-purpose PCB or
vides power to the circuit and LED1 input audio signals, all or some out- a small Vero board. Triacs TR1
glows to indicate that the circuit is puts of IC3 go low to drive transistors through TR5 should be kept away
ready to work. T1 through T5, which, in turn, fire the from the op-amp and its related com-
When you put your music system corresponding triacs TR1 through TR5 ponents. The metallic parts of the
in front of the condenser microphone via their gates and multicoloured zig- triacs should not touch each other and
of the light chaser, the sound pressure zag bulb sets comprising ZL1 through the other parts of the circuit. After
variation is converted into electrical ZL5 glow. assembling the circuit, house it in a
signals by the condenser microphone. When the audio level is low, only suitable shockproof plastic cabinet.
These weak electrical signals are am- triac T1 is fired and the zig-zag bulb Make some holes in the cabinet for
plified by op-amp µA741 (IC2), which set ZL1 turns on and off sequentially. heat dissipation.
is configured as an inverting ampli- When the audio level is high, triacs Note. 1. Some zig-zag lights have
fier. Using preset VR1 you can set the TR1 through TR5 get fired and all the a special bulb called ‘master bulb’ for
sensitivity of the circuit. bulb sets (ZL1 through ZL5) turn on automatic flickering. It should be
The amplified output is fed to IC and off sequentially. removed and replaced with a simple
LB1403 (IC3) at its input pin 8. IC3 is a Pin 7 of IC3 is used for selecting non-flickering colour bulb.
five-dot LED level meter commonly the response speed of the lighting. 2. Never touch any naked part of
used in stereo systems for LED The larger the time constant, the the circuit when it is connected to the
bargraph displays. It has a built-in am- slower the response, and vice versa. mains. z

WWW.EFYMAG.COM ELECTRONICS FOR YOU • JANUARY 2005 • 83


PARALLEL TELEPHONE
WITH SECRECY
O
ften a need arises for connection disconnects you toggle switch at
of two telephone instruments in in the other your telephone end
parallel to one line. But it creates position of the to receive the call
quite a few problems in their proper switch. At any and have a
performance, such as over loading and one time, only conversation. As
overhearing of the conversation by an one telephone is soon as the position
undesired person. In order to eliminate all connected to the of the toggle switch
such problems and get a clear reception, a line. To receive is changed, the line
simple scheme is presented here (Fig. 1). a call at the gets transferred to
This system will enable the incoming instrument, the other telephone
ring to be heard at both the telephones. which is not instrument.
The DPDT switch, installed with each of connected to the Mount one
the parallel telephones, connects you to line, you just DPDT toggle
the line in one position of the switch and have to flip the switch, one
telephone ringer, and one
telephone terminal box on
two wooden electrical
switchboards, as shown in
Fig. 3. Interconnect the
boards using a 4-pair
telephone cable as per Fig.
1. The system is ready to
use. Ensure that the two
lower leads of switch S2
are connected to switch S1
after reversal, as shown in
the figure.
Lab. Note: The
external ringer for the
project as shown in Fig. 2,
was designed/fabricated
at EFY Lab.

ELECTRONICS PROJECTS Vol. 21 181


PC-Based 7-Segment
Rolling Display
It
is very interesting and con
venient to be able to control
everything while sitting at
your PC terminal. Here, a simple
hardware circuit and software is
used to interface a 7-segment based
rolling display.
The printer port of a PC pro-
vides a set of points with some act-
ing as input lines and some others
as output lines. Some lines are open
collector type which can be used as
input lines. The circuit given here
can be used for interfacing with any
type of PC’s printer port.
The 25-pin parallel port connec-
tor at the back of a PC is a combi-
nation of three ports. The address
varies from 378H-37AH. The 7 lines
of port 378H (pins 2 through 8) are
used in this circuit to output the
code for segment display through
IC1. The remaining one line of port
378H (pin 9) and four lines of port
37AH (pins 1, 14, 16, 17) are used
to enable the display digits (one a
time) through IC2.
The bits D0, D1 and D3 of port
37AH connected to pins 1, 14 and 17
of ‘D’ connector are inverted by the
computer before application to the pins PC places the 7-segment code for the first over and over again. Because of this rep-
while data bit D2 is not inverted. There- digit/character on the data bus and ena- etition at a fairly high rate, there is an
fore to get a logic high at any of former bles only the first 7-segment display. After illusion that all the digits/characters are
three pins, we must send logic 0 output to delay of a few milliseconds, the 7-segment continuously being displayed. DISP1 is to
the corresponding pin of port 37AH. code for the digit/character is replaced by be physically placed as the least signifi-
Another important concept illustrated that of the next charter/digit, but this time cant digit.
by the project is the time division multi- only second display digit is enabled. IC1 (74LS244) is an octal buffer which
plexing. Note that all the five 7-segment After the display of all characters/ is primarily used to increase the driving
displays share a common data bus. The digits in this way, the cycle repeats itself capability. It has two groups of four buff-

P r o g r a m
/*DISP.C*** PC BASED ROLLING clrscr(); delay(300);
DISPLAY */ for(f=200;f<=500;f+=100)
/* P.R.DESHMUKH*/ { }
#include<stdio.h> sound(f );
#include<conio.h> delay(100); else
#include<dos.h> } {
#define PORTA 0x378 nosound(); outportb(PORTB,0x0b);
#define PORTB 0x37a while (!kbhit()) outportb(PORTA,m[j]);
void main() { outportb(PORTA ,(m[j] || ( 0x80)));
{ for (j=0;j<=4;j++) delay(300);
int dno[6]={0x0a,0x09,0x0f,0x03,0x80}; { }
/* code for “hallo”*/ outportb(PORTA,m[j]); }
int m[5]={0x76,0x77,0x38,0x38,0x3f }; if(j<=3) }
/*code for the selection of display*/ { }
int f,j; outportb(PORTB,dno[j]);

ELECTRONICS PROJECTS Vol. 20


ers with non-inverted tri-state outputs. Whatever the message/characters to has the appropriate bits turned on. For
The buffer is controlled by two active be displayed (here five characters have example, to display character ‘L’, the
low enable lines. IC2 (75492) can drive been displayed), these are separated segments to be turned on are f, e and
a maximum of six 7-segment displays. and stored in an array. Then these are d. This is equivalent to 111000 binary
(For driving up to seven common-cathode decoded. or 38 hex.
displays one may use ULN2003 described Decoding software is very simple. Please note that only limited char-
in the previous circuit idea.) Just replace the desired character with acters can be formed using 7-segment
The program for rolling display the binary equivalent of the display display. Characters such as M, N and K
is given in the listing DISP.C above. code. The display code is a byte that cannot be formed properly.

ELECTRONICS PROJECTS Vol. 20


PHONE BROADCASTER
H
ere is a simple yet very useful breakdown voltage (here 24V) and switch- tor T3 works as a common-emitter RF
circuit which can be used to ing voltage of the transistor T1 (0.7V). oscillator, with transistor T2 serving as
eavesdrop on a telephone con- Thus, if we adjust preset VR1 to get over an electronic ‘on’/‘off’ switch. The audio
versation. The circuit can also be used as 24.7 volts, it will cause the zener to signal available across the telephone lines
a wireless telephone amplifier. breakdown and transistor T1 to conduct. automatically modulates oscillator fre-
One important feature of this circuit As a result collector of transistor T1 will quency via transistor T2 along with its
is that the circuit derives its power di- get pulled towards negative supply, to cut series biasing resistor R3. The modu-
rectly from the active telephone lines, and off transistor T2. At this stage, if you lift lated RF signal is fed to the antenna. The
thus avoids use of any external battery the handset of the telephone, the line volt- telephone conversation can be heard on
or other power supplies. This not only age drops to about 11V and transistor T1 an FM receiver remotely when it is tuned
saves a lot of space but also money. It is cut off. As a result, transistor T2 gets to FM transmitter frequency.
consumes very low current from telephone forward biased through resistor R2, to pro- Lab Note: During testing of the cir-
lines without disturbing its performance. vide a DC path for transistor T3 used in cuit it was observed that the telephone
The circuit is very tiny and can be the following FM transmitter section. used was giving an engaged tone
built using a single-IC type veroboard that The low-power FM transmitter sec- when dialed by any subscriber. Addition
can be easily fitted inside a telephone tion comprises oscillator transistor T3, coil of resistor R5 and capacitor C6 was found
connection box of 3.75 cm x 5 cm. L1, and a few other components. Transis- necessary for rectification of the fault.
The circuit consists of two sec-
tions, namely, automatic switch-
ing section and FM transmitter
section.
Automatic switching section
comprises resistors R1 to R3,
preset VR1, transistors T1 and T2,
zener D2, and diode D1. Resistor
R1, along with preset VR1, works
as a voltage divider. When voltage
across the telephone lines is 48V
DC, the voltage available at wiper
of preset VR1 ranges from 0 to 32V
(adjustable). The switching voltage
of the circuit depends on zener

ELECTRONICS PROJECTS Vol. 21 167


CIRCUIT
IDEAS

PICNIC LAMP S.C. DW


IVEDI

„ D. MOHAN KUMAR is a monostable multivibrator built white LED (LED1) through ballast re-
around low-power CMOS timer IC sistor R7.

Y
ou can take this white LED- 7555. Resistor R4 keeps trigger input The circuit can be easily assembled
based night lamp on your pic- pin 2 of the monostable normally high on a perforated board. Make the cir-
nic outings. The lamp has in the absence of the trigger input. cuit assembly as compact as possible
sound trigger and push-to-on facili- Timing elements R6 and C4 give a time to enclose in a small case. Use three
ties and gives ample light dur-
ing a walk at night. It will also
prove useful in locating the
door of your tent in the dark-
ness. A click of the fingers will
switch on the lamp for three
minutes to help you in a
strange place.
The circuit uses low-power
ICs to save the battery power.
JFET op-amp TL071 (IC1) am-
plifies the sound picked up by
the condenser microphone. Re-
sistor R1 and low-value capaci-
tor C1 (0.22µF) make the am-
plifier insensitive to very low-
frequency sounds, eliminating
the chance of false triggering.
VR1 is used to adjust the sensitivity of delay of three minutes. Reset pin 4 of 1.5V pen-light cells to power the cir-
the microphone and VR2 adjusts the IC2 is connected to the positive rail cuit. Adjust VR1 and VR2 suitably to
gain of IC1. through R5 and to the negative rail get sufficient sensitivity of IC1. Toggle
The amplified output from IC1 is through C2 to provide power-on-reset switch S1 can be used to switch on the
coupled to trigger pin 2 of IC2, which function. The output of IC2 powers the lamp like a torch. z

WWW.EFYMAG.COM ELECTRONICS FOR YOU • MARCH 2006 • 101

CMYK
POWER-SUPPLY FAILURE ALARM
M
ost of the power-supply failure ‘low’ via resistor R8, it conducts and be omitted from the circuit. Following
indicator circuits need a sepa- sounds the buzzer (alarm) to give a points may be noted:
rate power-supply for them- warning of the power-failure. 1. At a higher DC voltage level, tran-
selves. But the alarm circuit presented With the value of C3 as shown, a good- sistor T1 (BC558) may pass some collec-
here needs no additional supply source. It quality buzzer would sound for about a tor-to-emitter leakage current, causing a
employs an electrolytic capacitor to store minute. By increasing or decreasing the continuous murmuring sound from the
adequate charge, to feed power to the value of capacitor C3, this time can be buzzer. In that case, replace it with some
alarm circuit which sounds an alarm for altered to serve one’s need. low-gain transistor.
a reasonable duration when the mains Assembly is quite easy. The values of 2. Piezo buzzer must be a continuous
supply fails. the components are not critical. If the tone version, with built-in oscillator.
During the presence of mains power alarm circuit is powered from any exter- To save space, one may use five small-
supply, the rectified mains voltage is nal DC power-supply source, the mains- sized 1000μF capacitors (in parallel) in
stepped down to a required low level. A supply section up to points ‘P’ and ‘M’ can place of bulky high-value capacitor C3.
zener is used to limit the
filtered voltage to 15-volt level.
Mains presence is indicated by
an LED. The low-level DC is
used for charging capacitor C3
and reverse biasing switching
transistor T1. Thus, transistor
T1 remains cut-off as long as
the mains supply is present. As
soon as the mains power fails,
the charge stored in the capaci-
tor acts as a power-supply
source for transistor T1. Since,
in the absence of mains supply,
the base of transistor is pulled

182 ELECTRONICS PROJECTS Vol. 21


C I RC ICR U
C U I T
IT I D E A S
IDEAS

POWER-SUPPLY FAILURE ALARM the components are not critical. If the


alarm circuit is powered from any exter-
nal DC power-supply source, the mains-
EDI supply section up to points ‘P’ and ‘M’ can
DWIV be omitted from the circuit. Following
M.K. CHANDRA MOULEESWARAN S.C.
points may be noted:

M
1. At a higher DC voltage level, tran-
ost of the power-supply failure transistor T1. Since, in the absence of sistor T1 (BC558) may pass some collec-
indicator circuits need a sepa- mains supply, the base of transistor is tor-to-emitter leakage current, causing a
rate power-supply for them- pulled ‘low’ via resistor R8, it conducts continuous murmuring sound from the
selves. But the alarm circuit
presented here needs no addi-
tional supply source. It em-
ploys an electrolytic capacitor
to store adequate charge, to
feed power to the alarm cir-
cuit which sounds an alarm
for a reasonable duration
when the mains supply fails.
During the presence of
mains power supply, the rec-
tified mains voltage is stepped
down to a required low level.
A zener is used to limit the
filtered voltage to 15-volt
level. Mains presence is indicated by an and sounds the buzzer (alarm) to give a buzzer. In that case, replace it with some
LED. The low-level DC is used for charg- warning of the power-failure. low-gain transistor.
ing capacitor C3 and reverse biasing With the value of C3 as shown, a good- 2. Piezo buzzer must be a continuous
switching transistor T1. Thus, transistor quality buzzer would sound for about a tone version, with built-in oscillator.
T1 remains cut-off as long as the mains minute. By increasing or decreasing the To save space, one may use five small-
supply is present. As soon as the mains value of capacitor C3, this time can be sized 1000µF capacitors (in parallel) in
power fails, the charge stored in the ca- altered to serve one’s need. place of bulky high-value capacitor C3.
pacitor acts as a power-supply source for Assembly is quite easy. The values of "

ELECTRONICS FOR YOU ! JULY 2000


PRECISION ATTENUATOR
WITH DIGITAL CONTROL
W
hen instruments are designed, testing or trials, use 1 per cent 100ppm Since ¼W resistors can withstand up
an analogue front-end is es- MFR resistors. The expected errors will to 250V, resistors R1 and R2 in series are
sential. Further, as most equip- be around 1 per cent. used for 1 meg-ohm with 500V (max) in-
ment have digital or microcontroller in- To keep parts count (hence cost) to a put limit. These resistors additionally
terface, the analogue circuit needs to have minimum, the common or ground is limit the input current as well. Diodes D1
digital control/access. used as the positive input terminal and and D2 clamp the voltage across input of
The circuit of a programmable attenu- one end of resistor R1 as the negative. op-amp to ±0.5V, thereby protecting the

Truth Table (Control input VS attenuation)


X,Y (ON-switch (2) (1) Gain
Pair) B A (Attenuation)
X0,Y0 0 0 1/1000
X1,Y1 0 1 1/100
X2,Y2 1 0 1/10
X3,Y3 1 1 1

op-amp.
(b) Output
The output can be connected to a 7107/
7135-based DPM or any other analogue-
to-digital converter or op-amp stage. Use
a buffer at the output if the output has to
be loaded by a load less than 1 meg-ohm.
Use an inverting buffer if input leads
have to have polarity where ground is the
inverting terminal. (For details, see next
circuit.)
(c) CD4052 CMOS switch
ator with digital control is described here, This is so because the op-amp inverts The on-resistance (100-ohm approx.)
where digital control can be a remote dip the polarity as it is used in inverting comes in series with the op-amp output
switch, or CMOS logic outputs of a de- configuration. This does not matter as source resistance, which produces no er-
cade counter (having binary equivalent the equipment will be isolated by the ror at output.
weight of 1, 2, 4, and 8, respectively), or power supply transformer and all polari- Caution. The circuit does not isolate,
I/O port of a microcontroller like 80C31. ties are relative. In case you want the it only attenuates. When high voltage is
The heart of this circuit is the popu- common to be the negative, you will have present at its input, do not touch any part
lar OP07 op-amp with ultra-low offset in to add some stages (IC4 and IC5 circuitry of the circuit.
the inverting configuration. A dual, 4- shown in precision amplifier circuit de- (d) Digital control options
channel CMOS analogue multiplexer scribed later). (i) A and B can be controlled by I/O
switch CD4052 enables the change in The OP07 pinout is based on stan- port of a microcontroller like 80C31 so
gain. An innovative feature of the circuit dard single op-amp 741. Any other that the controller can control gain.
is that the ‘on’ resistance (around 100 op-amp like CA3140, TLO71, or LF351 (ii) A and B can be given to counters
ohms) of CD4052 switch is bypassed so can be used but with offset errors in ex- like 4029/4518 to scroll gain digitally.
that no error is introduced by its use. cess of 1 per cent, which is not tolerable (iii) A and B can be connected to DIP
Resistors R1 to R6 used in the circuit in precision instrumentation. switch.
should be of 0.1 per cent tolerance, 50 The OP07 has equivalent ICs like (iv) A and B can be connected to a
ppm (parts per million) if you use 3½- μA741 and LM607 having ultra-low off- thumbwheel switch.
digit DPM, i.e. ±1999 counts (approx. 11 set voltage (<100μV), low input bias Notes. 1. Digital input logic 0 is 0V
bits). But for 4½-digit DPM (approx. 14 current (<10nA), and high input imped- and logic 1 is 5V.
bits), you may need to have trimpots (e.g. ance (>100M), which are the key require- 2. All resistors are metal film resis-
replace 1k-ohm resistor R6 by a fixed 900- ments for a good instrumentation op-amp tors (MFR) with 1% tolerance, unless
ohm resistor in series with a 200-ohm for use with DC inputs. specified otherwise.
trimpot) to replace R3, R4, R5, and R6 The following design considerations 3. C2 and C3 are ceramic disk capaci-
gain selection resistors for proper calibra- should be kept in mind: tors of 0.1μF = 100nF value.
tion to required accuracy. However, for (a) Input: 500V max

ELECTRONICS PROJECTS Vol. 22


PRECISION DIGITAL AC
POWER CONTROLLER
S
CRs and Triacs are
extensively used in
modern electronic power
controllers—in which power is
controlled by means of phase
angle variation of the conduction
period. Controlling the phase
angle can be made simple and
easy if we set different firing
times corresponding to different
firing angles. The design given
here is a synchronised program-
mable timer which achieves this
objective.
The following equation for a
sinewave shows how firing time
and the phase angle are related
to each other:
θ = 2πft or θ∝t
Here, θ is the angle described
by a sinewave in time t (seconds),
while f is the frequency of
sinewave in Hz. Time period T
(in seconds) of a sinewave is
equal to the reciprocal of its
frequency, i.e. T = 1/f. set again instantly for the next delay time.
The above equation indicates that This arrangement helps the timer to be
if one divides the angle described set for every half of mains wave—when
during one complete cycle of the the positive half of the mains waveform
sinewave (2π = 360o) into equal parts, starts building up, the timer is set for
then time period T of the wave will be that half and as it begins to cross zero, it
divided into identical equal parts. gets reset and set again for negative half,
Thus, it becomes fairly easy to set the when the negative half begins to build
different programmable timings up. The process is repeated. Here, instead
synchronised with the AC mains of using two zero crossing detectors—one
sinewave at zero crossing. The main for each half of mains wave—a single de-
advantage of such an arrangement, tector is used to perform both the
as already mentioned earlier, is that functions. This is possible because the
only the firing time has to be sampling wave for negative half is in-
programmed to set different firing verted by the rectifier diode bridge.
angles. It is to be noted that the The 18V AC from power transformer
more precise the timer, the more is fed to the four diodes in bridge
precise will be the power being con- configuration, followed by the filter ca-
trolled. pacitor which is again followed by a three-
In this circuit, the time period terminal voltage regulator IC LM7812.
of mains waveform is divided into The voltage so obtained drives the cir-
20 equal parts. So, there is a time cuit. The unfiltered voltage is isolated
interval of 1 ms between two con- from the filter capacitor by a diode and is
secutive steps. The sampling volt- fed to zener diode D8, which acts as a
age is unfiltered full-wave and is clipper to clip voltage above 6 volts.
obtained from the diode bridge at This voltage is fed to the base of
the output of the power transistor T1, which is wired as zero cross-
transformer. The timer is reset at ing detector. When base voltage reaches
every zero crossing of full wave and the threshold, it conducts. It thus sup-

174 ELECTRONICS PROJECTS Vol. 21


plies a narrow positive pulse which resets CD4093 as clock generator, as shown in pole of rotary switch and diode D6) and
the timer at every zero crossing. Fig. 2, is better as it provides the exact fires the Triac. Transistor T2 here acts as
A 32.768kHz crystal is used time interval required. In that case, a driver transistor. The reset pin of 4017
to get stable output of nearly CD4060 oscillator/divider is not required. is connected to zero crossing detector out-
1 kHz (1,024Hz) frequency after The CD4017B counter-cum-decoder IC put to reset it at every zero crossing. (The
five stages of binary division by then divides this 1kHz signal into ten equal load-current waveforms for a few positions
an oscillator-cum-divider IC CD4060. The intervals, which are programmed via the of the rotary switch, as observed at EFY
32.768kHz crystal is used because it can single-pole, 10-way rotary switch. Once Lab, are shown in Fig. 3.)
be found in unused quartz clocks and is the delayed output reaches the desired The circuit can be used as power con-
readily available in the market. But use time interval, the corresponding output of troller in lighting equipment, hot-air oven,
of a 1kHz crystal using a quad-NAND IC CD4017 inhibits the counter CD4017 (via universal single-phase AC motor, heater, etc.

ELECTRONICS PROJECTS Vol. 21 175


Precision 1Hz Clock Generator
using Chip-on-Board
U
sually the circuits for generation clock pulse has a very low amplitude Preset VR1
of 1Hz clock for applications in of the order of a few milli-volts which is offset null
digital clock and counter circuits cannot be used to drive the digital cir- control used to
make use of ICs in conjunction with cuits directly. This low-level voltage is adjust proper
a crystal and trimmer capacitors, etc. amplified several times by op-amp IC 1Hz pulse at the
However, similar or better accuracy can CA3140. output terminal
be achieved using a chip-on-board (COB) The op-amp CA3140 is connected in ‘E’. Connect one
device found inside a digital clock, which a non-inverting mode, and its gain is set LED in series
is readily available in the market for by resistors R4 and R3. Capacitor C2 with 220-ohm
Rs 15-20. This COB consists of IC, ca- reduces the AC gain and unwanted stray resistor between
pacitors and quartz crystal, etc which are pick-up and thus improves stability of the terminal ‘E’
mounted on its surface. It works on 1.4 the circuit. and ground and adjust preset VR1 till
volt DC source. This COB can be used to The input impedance of IC CA3140 the LED blinks once every second.
derive 1Hz clock. is very high and thus there is no drop When using the COB, affix the same
on a general-purpose
PCB using rubber
based adhesive and
solder the terminals
neatly using thin
single-strand wire.
Lab Note: The
COBs used in dif-
ferent watches
may differ some-
what in their
configuration.
But by trial-and-
error one can al-
ways find out the
appropriate points
corresponding to
Resistor R1, capacitor C3, diodes D1 at the input when 1Hz clock signal of points A, B, C and D. Figure of a sec-
and D2 shown in the circuit convert 5V low level is connected across its input ond COB used by EFY Lab is shown
DC into 1.4V DC. A ½Hz clock is avail- terminals from the COB. Amplified 1Hz alongside. The points A and B (on the
able at terminals A and B with a phase clock pulse is available at its output pin COB used by us) were observed to
difference of 90o. The two outputs, are 6, which is further amplified by transis- have complementary 1Hz outputs and
combined using capacitors C1 and C2 to tors T1 and T2 to drive the digital clocks hence anyone (only) could be used as
obtain a complete 1Hz clock. This 1Hz and timers. input to opamp CA3140.

ELECTRONICS PROJECTS Vol. 20


PROGRAMMABLE DOOR-BELL
WITH FLASHING LEDS
I
C1 (NE555) is used here as a clock of 100k each are connected to each pair is assembled in such a way that the
generator. It is configured as an of LEDs. first vertical column has orange LED1
astable multivibrator whose frequency IC3 here works as tune generator through LED5 and the second parallel
can be adjusted with the help of potmeter and the Darlington pair comprising column has green LED10 through LED6,
VR1. The clock pulses obtained from IC1 transistors BC547B and SL100B is used as shown in the figure.
are fed to pin 14 of IC2 (CD4017) which is to amplify its output. The frequency of The circuit can be easily assembled on
a well-known decade counter. IC3 is adjusted by potmeter VR2. Each a veroboard. Any well-filtered 9V, 250mA
Here LEDS have been connected in 100k preset (VR3 through VR7) is ad- DC power supply is suitable. Primary of
a rather unusual way. The LEDs flash justed for a different tune depending on the supply transformer may be connected
sequentially from Q0 to Q9. Five presets individual choice. The 10-LED display to the bell AC outlet points.

192 ELECTRONICS PROJECTS Vol. 19


Programmable LED Indicator
A
lthough IC CD4017 is a decade
counter, it can be used in a vari-
ety of ways. In this circuit it has
been used to program a bicolour LED
indicator in 10 different modes which
can be selected with a single push-button
switch.
IC3(555) is used in astable mode to
generate square wave and transistor T1
is used to obtain its complementary wave-
form. IC2 CD4081 is a quad 2-input AND
gate. These AND gates and the diode ma-
trix form the logical part of the circuit. IC4
(555) is configured as a monostable flip-
flop which provides a single clock pulse
to IC1 CD4017 for changing the mode by
depression of push-to-on switch S1. The
use of IC4 avoids switch debouncing prob-
lem which causes multiple makes/breaks.

TABLE I
Mode Operation
0 Off
1 Red ON
2 Green ON
3 Blinking Green-Yellow-Green-Yellow...
4 Blinking Red
5 Blinking Yellow
6 Blinking Green
7 Yellow ON
8 Blinking Red-Yellow-Red-Yellow...
9 Blinking Red-Green-Red-Green...

Switch S2 is included for resetting the plied to pin1, it emits red light. Similarly, Outputs of IC1 can also be selected
circuit. Instead of just one bicolour LED when positive voltage is applied to pin3, it through a 10-way rotary switch connected
you can use an array of bicolour LEDs in emits green light. And when positive volt- to Vcc. Now IC1 can be eliminated. Differ-
conjunction with two driver transistors. age is simultaneously applied to its pin1 ent indications can be activated for differ-
The bicolour (RED and GREEN) LED and 3, it emits yellowish light. ent functions of a device.
has three legs. The middle terminal (pin2) Power supply used is +5V regulated. Construction is very easy and total cost
LED is the common cathode pin which is Various modes of this circuit are sum- of this circuit is less than Rs 60. Current con-
grounded when a positive voltage is ap- merised in Table I. sumption of the circuit is less than 100mA.

ELECTRONICS PROJECTS Vol. 22 


PROTECTION FOR YOUR
ELECTRICAL APPLIANCES
H
ere is a very low-cost circuit to RL1. Initially, when the circuit is switched a parallel path for the supply to the
save your electrically operated on, the power supply path to the step- transformer as well as the load.
appliances, such as TV, tape down transformer X1 as well as the load is If there is any interruption in the power
recorder, refrigerator, and other incomplete, as the relay is in de-energised supply, the supply to the transformer is
instruments during sudden tripping and state. To energise the relay, press switch not available and the relay de-energises.
resumption of mains supply. Appliances S1 for a short duration. This completes Thus, once the supply is interrupted even
like refrigerators and air-conditioners are the path for the supply to transformer X1 for a brief period, the relay is de-energised
more prone to damage due to such as also the load via closed contacts of switch and you have to press switch S1
conditions. S1. Meanwhile, the supply to relay becomes momentarily (when the supply resumes)
The simple circuit given here switches available and it gets energised to provide to make it available to the load.
off the mains supply to the Very-short-duration
load as soon as the power N (say, 1 to 5 milliseconds)
trips. The supply can be interruptions or
resumed only by manual fluctuations will not
intervention. Thus, the affect the circuit because
supply may be switched on of presence of large-
only after it has stabilised. value capacitor which
The circuit comprises a has to discharge via the
step-down transformer relay coil. Thus the
followed by a full-wave circuit provides suitable
P
rectifier and smoothing H
safety against erratic
capacitor C1 which acts as P power supply
a supply source for relay
H
N conditions.

ELECTRONICS PROJECTS Vol. 21 155


CIRCUIT IDEAS

PULSE GENERATOR S.C. DWI


VED
I

A. JEYABAL depressed and the LED is glowing. As pins fully charges capacitor C2 via diode D. At
5 and 6 of NAND gate N2 are pulled up the same time, this high output of N2 en-

T
his circuit is very useful while by resistor R3, its output pin 4 goes low. ables NAND gate N3 and clock pulses come
checking/operating counters, step- This disables NAND gate N3 to take its out through pin 10. These are the required
ping relays, etc. It avoids the pro- output pin 10 to high state, and no pulse number of pulses used to check our de-
cedure of setting a switch for the required is available. vice.
number of pulses. By pressing appropriate IC1 is a decade counter whose Q out- The clock pulses are fed to clock-enable
switches S1 to S9, one can get 1 to 9 nega- puts normally remain low. When clock pin 13 of IC1, which starts counting. As
tive-going clock pulses, respectively. pulses are applied, its Q outputs go high soon as output pin 1 (Q5) of IC1 turns high,
Schmitt trigger NAND gate N1 of IC2, successively, i.e. Q0 shifts to Q1, Q1 shifts input pins 5 and 6 of NAND gate N2 will
resistor R1, and capacitor C1 are wired to to Q2, Q3 shifts to Q4, and so on. also become high via switch S5 because
produce clock pulses. These pulses are taken If any one of switches S1 through S9, high-frequency clock allowed five pulses
out through NAND gate N3 that is con- say, S5 (for five pulses), is momentarily during momentary pressing. This high in-
trolled by decade counter CD4017 (IC1). depressed, pins 5 and 6 of NAND gate N2 put of N2 provides low output at pin 4 to
Initially no switch from S1 to S9 is go low, making its output pin 4 high, which disable NAND gate N3 and finally no pulse
will be available to advance counter IC1.
Before the next usage, counter IC1
must be in the standby state, i.e. Q0 out-
put must be in the high state. To do this,
a time-delay pulse generator wired around
NAND gate N4, resister R4, diode D, ca-
pacitor C2, and differentiator circuit com-
prising C3 and R5 is used.
When output pin 4 of NAND gate N2
is low, it discharges capacitor C2 slowly
through resistor R4. When the voltage
across capacitor C2 goes below the lower
trip point, output pin 11 of NAND gate N4
turns high and a high-going sharp pulse is
produced at the junction of capacitor C3
and resistor R5. This sharp pulse resets
counter IC1 and its Q0 output (pin 3) goes
high. This is represented by the glowing
of LED.
Ensure the red LED is glowing before
proceeding to get the next pulse. Press
any of the switches momentarily and the
LED will glow. If the switch is kept
pressed, the counter counts continuously
and you cannot get the exact number of
pulses.
This circuit costs around Rs 70.

JUNE 2003 ELECTRONICS FOR YOU


CIRCUIT IDEAS

QUALITY FM TRANSMITTER SUN


IL KU
MAR

TAPAN KUMAR MAHARANA For frequency stability, use a regulated L1: 5 turns of 24 SWG wire closely
DC power supply and house the transmit- wound over a 5mm dia. air core

T
his FM transmitter for your stereo ter inside a metallic cabinet. For higher L2: 2 turns of 24 SWG wire closely
or any other amplifier provides a antenna gain, use a telescopic antenna in wound over the 5mm dia. air core
good signal strength up to a dis- place of the simple wire. Coils L1 and L2 L3: 7 turns of 24 SWG wire closely
tance of 500 metres with a power
output of about 200 mW. It works
off a 9V battery.
The audio-frequency modula-
tion stage is built around transis-
tor BF494 (T1), which is wired
as a VHF oscillator and modu-
lates the audio signal present at
the base. Using preset VR1, you
can adjust the audio signal level.
The VHF frequency is decided by
coil L1 and variable capacitor
VC1. Reduce the value of VR2 to
have a greater power output.
The next stage is built around
transistor BC548 (T2), which
serves as a Class-A power ampli-
fier. This stage is inductively
coupled to the audio-frequency
modulation stage. The antenna
matching network consists of
variable capacitor VC2 and capacitor C9. are to be wound over the same air core wound over a 4mm dia. air core
Adjust VC2 for the maximum transmis- such that windings for coil L2 start from L4: 5 turns of 28 SWG wire on an
sion of power or signal strength at the the end point for coil L1. Coil winding intermediate-frequency transmitter (IFT)
receiver. details are given below: ferrite core

AUGUST 2004 ELECTRONICS FOR YOU


RAMP CONTROLLED LIGHT
T
he circuit described here
can be used for control-
ling a decorative lamp
from zero intensity to maximum
intensity in a specified time.
Typical applications are for
controlling Christmas lamps and
serial lampsets etc. The bright-
ness of the lamps is controlled
by a continuously running ramp
voltage generated by a timer.
The circuit features a triac
(BT136) controlled by pulses
from a UJT (unijunction transis-
tor) relaxation oscillator. Pedes-
tal voltage control is employed
for controlling the firing angle.
Pedestal voltage is derived from
a ramp generator which sets the
time period of intensity control.
X1 secondary (sec. 2) pro-
vides the power supply for the
ramp generator section. The
555 timer circuit is configured
as astable multivibrator which
provides rectangular pulses
having required time period
which are converted to a positive going step-down transformer will serve the Transistor T2 controls the charging time
ramp by sweep generator transistor T1. purpose. However, it is advisable to of capacitor C5, thus providing the pedes-
This is coupled to the base of transistor have a higher voltage rating (9V or 12V) tal voltage control.
T2. The time period of control can be for X1 secondary (sec. 1) for extended The pulses generated by the UJT
altered by modifying the sweep generator control range. oscillator are coupled to the gate of triac
and 555 timer sections. Zener diode D12 generates the re- through a pulse transformer (X2). A ferrite
X1 is a step-down transformer hav- quired trapezoidal waveform for the UJT core transformer with 1:1 ratio can also be
ing two secondaries. Any centre-tapped oscillator from the bridge rectifier output. used for X2.

ELECTRONICS PROJECTS Vol. 19 177


CIRCUIT IDEAS

REMOTE-OPERATED MUSICAL BELL S.C.


DWIV
EDI

PRADEEP G.

T
his infrared light-
controlled 12-tone
musical bell can be
operated using any TV re-
mote control. It can be
operated from up to 10
metres, provided the re-
mote control is directed
towards the sensor.
The circuit uses the
popular 3-lead IR sensor
TK1836 to trigger musi-
cal bell built around IC
UM3481(IC1). (You can
also use IC UM3482,
UM3483, or UM3484
in place of IC UM3481.)
The sensor responds only to 36 kHz. pulses low. Transistor T1 conducts to ap- heard. This way, twelve different musical
Most TV remote controls transmit this ply a triggering pulse to IC1 at its pin 4. tones can be generated.
frequency. After playing one musical tone, the circuit The circuit works off a 5V power sup-
When any button on the TV remote automatically resets. If you again press any ply. Regulator IC 7805, powered from a 9-
control is pressed, the sensor’s output of the remote’s buttons, another music is 12V DC source, provides regulated 5V.

ELECTRONICS FOR YOU OCTOBER 2003


Running Message Display
L
ight emitting diodes are advanta- clock pulse. the complete word becomes visible. On the
geous due to their smaller size, The timer NE555 (IC1) is wired as a following clock pulse, pin 6 goes to logic 1
low current consumption and 1Hz astable multivibrator which clocks and resets the circuit, and the sequence
catchy colours they emit. Here is a run- the IC2 for sequencing operations. On repeats itself. The frequency of sequenc-
ning message display circuit wherein the reset, output pin 3 goes high and drives ing operations is controlled with the help
letters formed by LED arrangement light transistor T7 to ‘on’ state. The output of of potmeter VR1.
up progressively. Once all the letters of transistor T7 is connected to letter ‘W’ of The display can be fixed on a
the message have been lit up, the circuit the LED word array (all LEDs of a letter veroboard of suitable size and connected
gets reset. array are connected in parallel) and thus to ground of a common supply (of 6V to
The circuit is built around Johnson letter ‘W’ is illuminated. On arrival of 9V) while the anodes of LEDs are to be
decade counter CD4017BC (IC2). One of first clock pulse, pin 3 goes low and pin 2 connected to emitters of transistors T1
the IC CD4017BE’s features is its provi- goes high. Transistor T6 conducts and let- through T7 as shown in the circuit.
sion of ten fully decoded outputs, making ter ‘E’ lights up. The preceding letter ‘W’ The above circuit is very versatile and

the IC ideal for use in a whole range of also remains lighted because of forward can be wired with a large number of LEDs
sequencing operations. In the circuit biasing of transistor T7 via diode D21. In to make an LED fashion jewellery of any
only one of the outputs remains high and a similar fashion, on the arrival of each design. With two circuits connected in a
the other outputs switch to high state successive pulse, the other letters of the similar manner, multiplexing of LEDs can
successively on the arrival of each display are also illuminated and finally be done to give a moving display effect.

ELECTRONICS PROJECTS Vol. 20


CIRCUIT
IDEAS
tivity. Transistor T1 amplifies the sig-
nal received from the condenser mic
UMAR through capacitor C1. When transistor
SUNIL K
SECRET BELL T1 conducts, a short negative pulse
triggers the monostable wired around
IC1. The monostable time is decided
by resistor R7
 D. MOHAN KUMAR a switchless musical bell that activates and capacitor
with a single puff of breath. The con- C5. Reset pin 4

M
any people move through denser mic fitted inside the existing of IC1 is made
the corridors and steps in door-bell switch box will trigger the stable by R6 and
multistoried buildings. As bell on detecting air-pressure changes C3. Resistor R5
most of them are strangers for the in- following the breath. As only the mem- acts as a pull-up
habitants of the flats, it becomes nec- bers of your family know the secret of Fig. 2: Pin configuration resistor for trig-
essary to verify the identity of the visi- the bell and hence puff out before the of UM66 and BC548/549 ger pin 2 of IC1
tor before opening the door as he can hole for the switch box, the door can to keep the trig-
be a burglar. be opened without fear. ger pin high in the standby mode.
This circuit helps you identify the The front end of the circuit is a con- The high output from IC1 is used
members of your family. It is basically denser mic amplifier with fixed sensi- to power IC UM66 (IC2). IC2 gener-
ates a soft melody on receiv-
ing 3 volts at pin 2. Transis-
tor T2 amplifies the music
notes. A zener diode main-
tains the power for IC2 at a
safer level of 3 volts.
Assemble the circuit on
any general-purpose PCB
and enclose in a suitable
cabinet. The condenser mic
should be connected to the
circuit using a single-core
shielded wire to reduce
noise interference. Drill a
1mm hole in the cover of the
existing bell switch box and
fix the mic inside the box
with adhesive. The front side
of the mic should face the
Fig. 1: Secret bell circuit hole. 

94 • DECEMBER 2006 • ELECTRONICS FOR YOU WWW.EFYMAG.COM


SENSITIVE TEMPERATURE SWITCH
T
his temperature switch has a sharply, which results in
high sensitivity and is quite re- cutting off of Darlington pair
liable. Here, in place of a single and forward biasing of tran-
transistor, a Darlington pair has been sistor T3 via resistor R2 and
used for switching. diode D2. As a result, relay
At normal room temperature germi- RL1 energises and switches
num diode D1 (0A79 or equivalent) has on the alarm. Potmeter VR1
a back resistance value of about 10 kilo- may be adjusted for required
ohms. As a result Darlington pair, com- sensitivity.
prising transistors T1 and T2. conducts This simple circuit can be
and keeps the anode terminal of diode used as an overheat indicator,
D2 at ground potential. Consequently, fire alarm, or it can be used
transistor T3 does not get base bias and in a constant temperature
thus relay RL1 is not activated. circuit for switching on a fan
But when temperature increases. the etc. The circuit can be easily sensor D1 must be of germanium type
back resistance of diode D1 decreases assembled on a piece of veroboard. Diode and not silicon.

ELECTRONICS PROJECTS Vol. 19 189


CIRCUIT
IDEAS

SHADOW ALARM SANI TH


EO

„ D. MOHAN KUMAR The non-inverting input of IC1 gets a and zener diode ZD1 provide 3.1V DC
controlled voltage from potential di- to IC UM3561.

T
his opto-sensitive circuit sounds vider R2 and VR1. The circuit is easy to assemble as
an alarm whenever a shadow In the presence of ambient light, it requires only a few low-cost com-
falls on it. So it can be used at the phototransistor conducts and the ponents. Enclose it in a cabinet with
night by shopkeepers to protect the inverting input (pin 2) of IC1 gets a the photo-sensor inside. Drill a 5mm
valuables in their showrooms. A dim lower voltage than its non-inverting hole on the front panel of the cabinet
lighting in the room is necessary to input (pin 3). This makes the output to let ambient light fall on the photo-
detect the moving shadow. Unlike of IC1 high, which is indicated by the sensor.
opto-interruption alarms based on glowing of LED1. Adjust potmeter VR1 (47k) until
light-dependent resistors (LDRs), it When a shadow falls on the photo- LED2 stops glowing and the buzzer
does not require an aligned light beam sensor, the output of IC1 goes low. stops beeping while LED1 glows. This
to illuminate the photo-sensor. This low pulse triggers the monostable is the position of VR1 to be main-

The circuit is powered by a 9V PP3 (IC2) designed for a delay of 51 sec- tained for that particular
battery and uses the most sensitive onds using R6 and C3. The output of intensity of light. LED1 will continue
photo-sensor L14F1 to detect shadows. IC2 is used to light up LED2 and acti- to glow even when a shadow is
It is portable and can be used at any vate the alarm. detected.
place that is to be monitored. Slide switch S2 is used to select ei- The circuit is now ready to use.
Op-amp µA741 (IC1) is used as a ther the buzzer or siren. When it is To test it, move a paper in front of
voltage comparator. Its inverting in- towards left the buzzer beeps, and the unit. If LED2 glows along with
put is biased by the voltage obtained when it is towards right IC UM3561 the beep of the buzzer, it means that
from the junction of 100k resistor R1 (IC3) activates to give a loud alarm the photo-sensor has detected a
and the collector of phototransistor T1. simulating a police siren. Resistor R8 shadow. z

100 • JANUARY 2006 • ELECTRONICS FOR YOU WWW.EFYMAG.COM

CMYK
short wave AM TRANSMITTER
RAJESH KAMBOJ

T
he main feature of this transmit- the frequency in
ter is that it is free from the LC short wave range
(inductor, capacitor) tuned circuit can be substitut-
and operates on a fixed frequency of 12 ed in this circuit,
MHz which is extremely stable. An LC although the op-
based tuned circuit is inherently unstable eration was test-
due to drift of resonant frequency on ac- ed with a 12 MHz
count of temperature and humidity varia- crystal.
tions. The circuit is very simple and uses Transistor T1
only a few components. serves three func-
The figure shows the complete circuit tions:
diagram of the transmitter. Resistors R1 1. It provides
and R2 are used for DC biasing of transis- the DC path for
tor T1. The capacitor C1 provides coupling extending +VCC
between the condenser microphone and supply to transis-
the base of transistor T1. Similarly, resis- tor T2.
tors R3, R4 and R5 provide DC biasing to 2. It amplifies
transistor T2. the audio signals obtained from condenser loop antenna into space in the form of
The oscillator section is a combina- microphone. electromagnetic waves. The antenna
tion of transistor T2, crystal XTAL, ca- 3. It injects the audio signal into the can be tuned to a particular frequency
pacitor C2, C3 and resistors R3, R4 and high frequency carrier signal for modula- varying trimmer C5 and also by chang-
R5. The crystal is excited by a portion of tion. ing the length of ferrite rod into the
energy from the collector of transistor The condenser microphone converts coil.
T2 through the feedback capacitor C2. the voice message into the electrical The transmitted signals can be re-
The crystal vibrates at its fundamental signal which is amplified by transistor ceived on any short wave receiver without
frequency and the oscillations occurring T1. This amplified audio signal modu- distortion and noise. The range of this
due to the crystal are applied to the base lates the carrier frequency generated by transmitter is 25 to 30 metres and can
of transistor T2 across resistor R4. In transistor T2. The amplitude modulated be extended further if the length of the
this way, continuous undamped oscilla- output is obtained at the collector of antenna wire is suitably increased along
tions are obtained. Any crystal having transistor T2 and is transmitted by a with proper matching.

ELECTRONICS PROJECTS Vol. 19 179


SHORTWAVE TRANSMITTER
T
his transmitter circuit operates in capacitance of gang condenser, the fre- be directly connected to its input without
shortwave HF band (6 MHz to 15 quency of oscillation can be changed. The any amplification.
MHz), and can be used for short- carrier RF signal from the oscillator is The transmitter’s stability is gov-
range communication and for educational inductively coupled through the second- erned by the quality of the tuned circuit
purposes. ary of transformer X1 to the next RF am- components as well as the degree of regu-

The circuit consists of a mic ampli- plifier-cum-modulation stage built around lation of the supply voltage. A 9V regu-
fier, a variable frequency oscillator, and transistor T2 that is operated in class ‘A’ lated power supply is required. RF out-
modulation amplifier stages. Transistor mode. Audio signal from the audio ampli- put to the aerial contains harmonics, be-
T1 (BF195) is used as a simple RF oscil- fier built around IC BEL1895 is coupled cause transistor T2 doesn’t have tuned
lator. Resistors R6 and R7 determine base to the emitter of transistor 2N2222 (T2) coil in its collector circuit. However, for
bias, while resistor R9 is used for stabil- for RF modulation. short-range communication, this does not
ity. Feedback is provided by 150pF ca- IC BEL1895 is a monolithic audio create any problem. The harmonic con-
pacitor C11 to sustain oscillations. The power amplifier designed for sensitive AM tent of the output may be reduced by
primary of shortwave oscillator coil and radio applications. It can deliver 1W power means of a high-Q L-C filter or resonant
variable condenser VC1 (365pF, 1/2J to 4 ohms at 9V power supply, with low L-C traps tuned to each of the
gang) form the frequency determining net- distortion and noise characteristics. Since prominent harmonics. The power output
work. the amplifier’s voltage gain is of the order of this transmitter is about 100
By varying the coil inductance or the of 600, the signal from condenser mic can milliwatts.

134 ELECTRONICS PROJECTS Vol. 23


SIMPLE ELECTRONIC
CODE LOCK
T
he circuit diagram of a simple elec- can be mounted on a keyboard panel, be connected in parallel with S10 and
tronic code lock is shown in fig- and any number or letter can be used to placed on the keyboard panel for more
ure. A 9-digit code number is used mark them. Switch S10 is also placed safety.
to operate the code lock. together with other switches so that any A 12V power supply is used for the
When power supply to the circuit is stranger trying to operate the lock fre- circuit. The circuit is very simple and can
turned on, a positive pulse is applied to quently presses the switch S10, thereby be easily assembled on a general-purpose
the RESET pin (pin 15) through capaci- resetting the circuit many times. Thus, PCB. The code number can be easily
tor C1. Thus, the first output terminal he is never able to turn the relay ‘on’. If changed by changing the connections to
Q1 (pin 3) of the decade counter IC (CD necessary, two or three switches can switches (S1 to S9).
4017) will be high and all other outputs
(Q2 to Q10) will be low. To shift the high
state from Q1 to Q2, a positive pulse must
be applied at the clock input terminal (pin
14) of IC1. This is possible only by press-
ing the push-to-on switch S1 momentarily.
On pressing switch S1, the high state
shifts from Q1 to Q2.
Now, to change the high state from
Q2 to Q3, apply another positive pulse at
pin 14, which is possible only by pressing
switch S2. Similarly, the high state can
be shifted up to the tenth output (Q10)
by pressing the switches S1 through S9
sequentially in that order. When Q10 (pin
11) is high, transistor T1 conducts and
energises relay RL1. The relay can be
used to switch ‘on’ power to any electrical
appliance.
Diodes D1 through D9 are provided
to prevent damage/malfunctioning of the
IC when two switches corresponding to
‘high’ and ‘low’ output terminals are
pressed simultaneously. Capacitor C2 and
resistor R3 are provided to prevent noise
during switching action.
Switch S10 is used to reset the
circuit manually. Switches S1 to S10

ELECTRONICS PROJECTS Vol. 21 169


CIRCUIT
IDEAS

SIMPLE SHORT-WAVE S.C. DW


IVEDI

TRANSMITTER
 PRINCE PHILLIPS

T
his low-cost short-wave trans-
mitter is tunable from 10 to 15
MHz with the help of ½J gang
condenser VC1, which determines
the carrier frequency of the
transmitter in conjunction with
inductor L1. The frequency trimming
can be done with VC2. The carrier
is amplified by transistor T4
and coupled to RF amplifier transis-
tor T1 (BD677) through transformer
X1*.
The transmitter does not use any
modulator transformer. The audio out-
put from condenser MIC is
preamplified by transistor T3 (BC548).
The audio output from T3 is further
amplified by transistor T2 (BD139),
which modulates the RF amplifier
built around transistor T1 by varying
the current through it in accordance
with the audio signal’s amplitude. Fig. 1: Simple shortwave transmitter
RFC1 is used to block the carrier RF
signal from transistor T2 and the transformer transformer X1, we used a readymade
power supply. are given in short-wave antenna coil with
The modulated RF is coupled the figure. tuning slug (Jawahar make),
to the antenna via capacitor C9. EFY Lab. which worked satisfactorily. We tested
For antenna, one can use a 0.5m During test- the transmitter reception up to
long telescopic aerial. Details of ing, in place of
Fig. 2: Pin configurations of 75 metres and found good signal
RF choke, inductor L1 and coupling BD139, BD677 and BC548 coupling strength. 

WWW.EFYMAG.COM ELECTRONICS FOR YOU • APRIL 2006 • 95

CMYK
Smart Phone Light
The circuit shown here is used to in the ambient light and greather than power failure or load shedding also.
switch on a lamp when the tele- 100 kilo-ohms in darkness, is at the heart The light switches off automati-
phone rings, provided that the ambient of the circuit. cally after a programmable time period.
light is insufficient. The circuit is fully isolated from the If required, the lamp lighting period can

be extended by simply pressing a pushbut-


ton switch (S1).
The first part of the circuit functions
as a ring detector. When telephone is on-
hook, around 48V DC is present across
the TIP and RING terminals. The diode
in the opto-coupler is ‘off’ during this
condition and it draws practically no
current from the telephone lines. The opto-
coupler also isolates the circuit from the
telephone lines. Transistor in the opto-cou-
pler is normally ‘off’ and a voltage of +5V
is present at the ring indicator line B.
When telephone rings, an AC voltage
of around 70-80V AC present across the
telephone lines turns on the diode inside
the opto-coupler (IC2), which in turn
switches on transistor inside the opto-
coupler. The voltage at its collector drops
to a low level during ringing to trigger IC3
74LS123(A) monostable flip-flop.
The other opto-coupler (IC1) is used
to detect the ambient light condition.
When there is sufficient light, LDR has
a low resistance of about 5 kilo-ohms and
the transistor inside the opto-coupler is
in ‘on’ state. When there is insufficient
The circuit can be implemented using phone lines and it draws current only light available, the resistance of LDR
just two ICs. A light dependent resistance when the phone rings. The lamp can be increases to a few mega-ohms and the
(LDR), with about 5 kilo-ohms resistance battery powered to provide light during transistor switches to ‘off’ state. Thus

ELECTRONICS PROJECTS Vol. 20


the DC voltage present at the collector of the programmed duration and nobody attends the phone, the light turns
transistor of the opto-coupler is normally switches back to 0V at the end of the pulse off automatically after the specific time
low and it jumps to 5V when there is no period. period equal to the pulse-width of the
light or insufficient light. This high-to-low transition (trail- second flip-flop.
The 74LS123 retriggerable monos- ing edge) is used to trigger the second The light sensitivity of LDR
table multivibrator IC is used to gener- monostable flip-flop 74LS123(B) in the can be changed by changing re-
ate a programmable pulse-width. The same package. Output of the second sistance R3 connected at collec-
first monostable 74LS123(A) generates monostable is used to control a relay. tor of the transistor in light mon-
a pulse from the trigger input avail- The lamp being controlled via the N/O itor circuit. Similarly, switch-on
able during ringing, provided its pin 2 contacts of the relay gets switched ‘on.’ period of the lamp can be controlled by
input (marked B) is logic high (i.e. The ‘on’ period can be extended by sim- changing capacitor C3’s value in the
during darkness). It remains high for ply pressing pushbutton switch S1. If second 74123(B) monostable circuit.

ELECTRONICS PROJECTS Vol. 20


S O F TS OWF TAW R
ARE
E SECTION
S E C T I O N
Here, the number 128 gives the size
of the key in bits. This key size gives a

CRYPTOGRAPHY
key space (total number of combinations
of bits in the key) of 3.4 x 1038 keys, which
makes the ‘Brute force attack’ impracti-
cal. Higher the key size, tougher it is to
S. SUNDAR crack the ciphertext. In IDEA, eight
rounds or iterations of data manipulation
are done to generate the final output.

N
ews item in ‘The Times of India’, that a letter may be replaced by another The manipulations may consist of one
Mumbai, on June 27, 1999: “The letter three places (offset or key) down or a combination of the following three
Indian Institute of Technology, the order; for example, the letter ‘a’ will operations:
Kanpur, has developed a new-generation become ‘d’, and so on. Bit-by-Bit exclusive-ORing
cipher code for the Indian navy. The Here, lesser number of keys are pos- Addition of integers modulo 216
breakthrough would provide a technologi- sible. Also, the encryption and decryption Multiplication of integers modulo 216
cal edge to defence communication. Chris- algorithms are known and the language The expression ‘x mod y’ gives the re-
tened ‘Trinetra’, the cipher is a modern is understood easily. Because of these fac- mainder when x is divided by y. The value
computer-based code language system tors, an advanced computer using either of y is referred to as the modulus of the
which can digitise long, alphabetic mes- expression; for example,
sages within seconds.” 10 mod 3 = 1. The use of
This article is about cryptography— these manipulations in a
the science of scrambling data to make it sequential order produces
unintelligible to all, except the intended a complex transformation
person. It has come to focus recently due of the input data, mak-
to the expanding influence of e-commerce. ing crypt analysis diffi-
Almost all the credit card transactions cult.
taking place on the Internet or elsewhere Fig. 2: Public-key encryption
make use of cryptography. This concept
parallel processing or distributed comput- Data encryption standard (DES)
is also used in ‘secure server’ transactions,
where the data is guarded by the use of ing can crack this method. This type of In DES, the plaintext ought to be of 64
cryptography. cracking is termed as ‘Brute Force At- bits and the key of 56 bits. Longer blocks
Some of the terms used in this article tack’ in computer parlance. of plaintext are encrypted in 64-bit blocks.
are explained below: International Data Encryption Algo- Each block of 64-bit input is passed
Plaintext is the text or data that is to rithm (IDEA) and Data Encryption Stan- through 16 iterations, with each iteration
be encrypted. It is one of the inputs to dard (DES) are two algorithms that use producing an intermediate 64-bit value.
the encryption algorithm. the bit-replacement technique explained The iteration is essentially the same
above. These algorithms, along with com- complex function that involves a permu-
Key is the password used to decrypt
pression, are used to send secure e-mail tation of bits and substitution of one bit
the coded message.
using software programs like PGP (Pretty pattern by another. A variation of DES,
Ciphertext is the output of the encryp-
Good Privacy)—the present standard for the ‘Triple DES’ that uses two keys and
tion algorithm. It can be transmitted safely
encrypted mail. In PGP, the public-key three executions of the algorithm, has
as it is unintelligible without the key.
encryption explained in the later part of gained considerable success. Triple DES
One of the earliest known and sim-
the article is also used. employs an encrypt-decrypt-encrypt se-
plest methods of encryption is the ‘Cae-
sar Cipher’ method, which involves re- quence. There is no cryptographic signifi-
placement of each letter in the message International data encryption cance to the use of decryption for the sec-
with some other letter or numeral. The ond stage. It only allows users of triple
principle of ‘bit replacement technique’ is
algorithm (IDEA) DES to decrypt data encoded by users of
The Swiss Federal Institute of the older single DES.
Technology developed IDEA in
1990. This method uses a 128-bit
Public-key encryption
key; only the powers of two are
used as key-size. If the key is too Another commonly used method for en-
large, the computations involved cryption is the public-private key encryp-
in encryption and decryption make tion. This method uses two passwords, one
the working of the algorithm termed as public key and the other pri-
slower; and if it is too small, the vate key. The algorithms used to generate
algorithm becomes insecure. As keys are based on mathematical numbers
with any other bit replacement generated by the computer on user’s re-
scheme, there are two inputs, quest, instead of simple bit operations.
Fig. 1: Triple DES namely, the plain text and the key. An analogy of public-key encryption is

76 ELECTRONICS FOR YOU ❚ MAY 2000


SOFTWARE SECTION

safe with a special type of lock that can be How to distribute the secret key was the filled:
locked/unlocked with one or two different most difficult problem for conventional en- • Values of e, d, and n exist such that
keys. A left key turns the mechanism to cryption. This problem is eliminated by M = Med mod n, for all M < n.
the left and a right key turns it to the the public-key encryption, considering • It should be relatively easy to cal-
right. In the unlocked state, the mecha- that private key is never distributed. culate Me and Cd for all values of M < n.
nism is in the centre position. If locked • It should be unfeasible to determine
with the right key, the only way to unlock d, even if the values of e and n are known.
it is by using the left key and vice-versa. If RSA The third condition would be satis-
‘A’ wants to send a message to ‘B’, he/she Ron Rivest, Adi Shamir, and Len Adleman fied only for large values of e and n.
can put the message in the box and lock it at MIT (Massachusetts Institute of Tech- Another method, the Secure Hash
nology) devel- Function (developed by Ron Rivest, ‘R’ of
oped one of the RSA), is based on public-key encryption.
first public-key With the advent of Internet, intense re-
schemes in search is going on in this field, using di-
1977. The RSA verse technologies which employ distrib-
scheme then uted networking and the use of the inher-
reigned su- ently present noise in transmission chan-
Fig. 3: Example of RSA algorithm
preme as the nel to encrypt data. The five steps involved
with the right key. On receiving the mes- only widely accepted and implemented ap- in this algorithm are detailed below:
sage, ‘B’ can unlock the box using proach to public-key encryption. Step 1: Append padding bits. The
the corresponding left key and read the RSA is a cipher in which the plaintext message is padded such that the length
message. and the ciphertext are integers between 0 of the padded message is 64 bits less than
The lock will open only when a par- and ‘n-1’, for some valued ‘n’. For a long an integer multiple of 512 bits. Padding
ticular key combination is used. Suppose message, the message is broken into is necessarily done even if the message is
a group of people wants to share mes- blocks. These blocks are log2n bits long. already of desired length; for example,
sages using this method. Then everyone Two high-value prime numbers are mul- even a message of 448 (512-64) bits is
in the group buys one’s own safe box and tiplied to get ‘n’ so that extracting the made to 960 (512x2-64) bits by padding
freely supplies the respective right key value of ‘n’ becomes very difficult. As the 512 bits to it. Thus, the number of pad-
duplicates but keeps one’s left keys to public and private keys are dependent on ding bits lies between 1 and 512. The pad-
oneselves. For communication, one can the value of ‘n’, guessing this value is very ding consists of a single -1- bit followed
just write the message, put it in the safe, difficult. by the necessary number of -0- bits.
lock it using the right key of the recipi- Encryption and decryption make use Step 2: Append length. A 64-bit rep-
ent, and pass it to the recipient who uses of modular arithmetic. The RSA algorithm resentation of the length in bits of the
one’s own left key to unlock it. for plaintext block M and ciphertext block original message (before padding) is ap-
Thus, the message can be transmit- C with keys ‘e’ and ‘d’ is given below: pended to the result of Step 1. The out-
ted safely, since apart from the intended Key generation come is a message which is an integer
recipient no one else would be having the Select p,q p and q are both prime multiple of 512 bits in length. The mes-
correct left key. Calculate n = p x q sage is represented in blocks of 512 bits
A similar technique is used in public- Calculate f(n) = (p-1)(q-1) Y0,Y1,Y2,...,YL-1,... So, the total length of
key encryption. In place of a right key, a Select integer e gcd(f(n),e)=1; 1<e<f(n) the expanded message is L x 512.
public key is used while encrypting and, Calculate d d=e-1 mod f (n) Step 3: Initialise MD buffer. A 128-
in place of a left key, a private key is Public Key KU = {e,n} bit buffer is used to hold intermediate and
used for decrypting. Private Key KR = {d,n} final results of the hash function. The
Once a key is lost, the data encrypted Encryption buffer can be represented as four 32-bit
using the particular key can’t be recov- Plaintext: M<n registers (A, B, C, and D). These regis-
ered. So backup copies of all the keys used Ciphertext: C = Me (mod n) ters are initialised to the following hexa-
must be kept necessarily. Decryption decimal values:
Furthermore, these algorithms have Ciphertext: C A = 01234567
the following important characteristics: Plaintext: M = Cd (mod n) B = 89ABCDEF
• It is computationally unfeasible to The RSA Algorithm C = FEDCBA98
determine the decryption key with the C = Me mod n D = 76543210
knowledge of the cryptography and the M = Cd mod n = (Me)d mod n = Med mod n Step 4: Process message in 512-bit
encryption key. Both sender and receiver must know blocks. The heart of the algorithm is the
• Either of the two related keys can the value of ‘n’ and ‘e’; whereas the value module that consists of four rounds of pro-
be used for encryption. of d is known only to the receiver. Thus, cessing. These rounds may have a simi-
With conventional encryption (bit re- this is a public-key encryption algorithm lar structure, but each may use a differ-
placement technique as opposed to pub- in which the public key is {e,n} and the ent primitive logical function, like AND,
lic-key encryption), a fundamental re- private key is {d,n}. For public-key en- OR, etc.
quirement for two parties to communi- cryption, this algorithm will be satisfac- Step 5: Output. After all L 512-bit
cate securely was to share a secret key. tory if the following conditions are ful- blocks have been processed, the output

ELECTRONICS FOR YOU ❚ MAY 2000 77


SOFTWARE SECTION

from the Lth stage is the 128-bit message raphy has indeed come a long way. The breakable, only to find out later that they
digest. Indian system of ‘Trinetra’ can even were not so. And thus, public-key encryp-
Starting from the simple bit-replace- digitise and encode the voice of a sender. tion remains the standard for secure en-
ment technique to computer-based code Cryptographers have come up with vari- cryption till date.
language systems, the science of cryptog- ous schemes considered to be virtually un-

MORSE TUTOR
YUJIN BOBY character mode, separate characters can
be practiced. In file mode, stored
messages can be sent. This mode also

M
orse tutor is a program written Morse code was developed by Samual has provision for creating a new message
in C++. It can be used for learn- Morse in 1897. Due to advantages like file. The speed can be set between 5 WPM
ing or sending Morse code. overriding noise, static and simple trans- (words per minute) and 20 WPM, and
Morse code uses long (dash) and short mitter, and low power requirements, it is the tone can be varied betwen 100 Hz
(dot) sounds to communicate. The dot is still used for communication. and 4,000 Hz using the program. The
the basic unit and the dash is equal to The program provides character mode, default speed is 12 WPM and the tone is
the length of three dots. line mode, and file mode of operations. In 700 Hz.

Program Listing in C++


#include<iostream.h> case ‘B’ : strcpy (code, “-...”) ; break; character \”;
#include<conio.h> case ‘C’ : strcpy (code, “-.-.”) ; break; cout<<in<<“\”<<endl; break;
#include<dos.h> case ‘D’ : strcpy (code, “-..”) ; break; }
#include<stdio.h> case ‘E’ : strcpy (code, “.”) ; break; int len=strlen(code) ;
#include<string.h> case ‘F’ : strcpy (code, “ ..-.”) ; break; for (int i=0; i<len; i++)
#include<stdlib.h> case ‘G’ : strcpy(code,“—.”) ; break; { sound (FREQ) ;
#include<ctype.h> case ‘H’ : strcpy(code,“....”) ; break; if(code [i]==‘.’) delay(DOT) ;
void morse() ; case ‘I’ : strcpy(code,“..”) ; break; else
int mnu_one(); case ‘J’ : strcpy(code,“.—”) ; break; if(code[i]==‘-’) delay(3*DOT) ;
void mode_line() ; case ‘K’ : strcpy(code,“-.-”) ; break; nosound() ; delay (DOT) ;
void mode_file() ; case ‘L’ : strcpy(code,“.-..”) ; break; }
void mode_sett() ; case ‘M’ : strcpy(code,“—”) ; break; delay (3*DOT) ;
void mode_char() ; case ‘N’ : strcpy(code,“-.”) ; break; }
char in ; case ‘O’ : strcpy(code,“—”) ; break; int mnu_one()
int FREQ=700; // default tone 700 Hz case ‘P’ : strcpy(code,“.—.”) ; break; {
int DOT=50; // default speed 12 wpm case ‘Q’ : strcpy(code,“—.-”) ; break; int ch;
void main() case ‘R’ : strcpy(code,“.-.”) ; break; clrscr() ;
{ case ‘S’ : strcpy(code,“...”) ; break; gotoxy(30,7) ; cout<<“MORSE CODE TUTOR”;
int choice ; case ‘T’ : strcpy(code,“-”) ; break; gotoxy(30,8) ;
while (1) case ‘U’ : strcpy(code,“..-”) ; break; cout<<“~~~~~~~~~~~~~~~~” ;
{ case ‘V’ : strcpy(code,“...-”) ; break; gotoxy(33,9) ; cout<<“l. CHARACTER MODE”;
choice=mnu_one() ; case ‘W’ : strcpy(code,“.—”) ; break; gotoxy(33,10) ; cout<<“2. LINE MODE” ;
if (choice==1) mode_char() ; case ‘X’ : strcpy(code,“-..-”) ; break; gotoxy(33,11) ; cout<<“3. FILE MODE” ;
else if( choice==2 ) mode_line () ; case ‘Y’ : strcpy(code,“-.—”) ; break; gotoxy(33,12) ; cout<<“4. SETTINGS” ;
else if(choice==3) mode_file () ; case ‘Z’ : strcpy(code,“—..”) ; break; gotoxy(33,13) ; cout<<“5. EXIT” ;
else if(choice==4) mode_sett () ; case ‘1’ : strcpy(code,“.——”) ; break; gotoxy(30,15) ; cout<<“Enter your choice : ” ;
else if(choice==5) break ; case ‘2’ : strcpy(code,“..—”) ; break; gotoxy(25,19) ; cout<<“A Freeware From
} case ‘3’ : strcpy(code,“...—”) ; break; VU3PRX” ;
clrscr() ; case ‘4’ : strcpy(code,“....-”) ; break; gotoxy(50,15) ; cin>>ch ; return ch ;
cout<<endl<<“Thank you for using” ; case ‘5’ : strcpy(code,“.....”) ; break; }
highvideo() ; cprintf(“MORSE TUTOR”) ; case ‘6’ : strcpy(code,“-....”) ; break; void mode_line()
normvideo() ; case ‘7’ : strcpy(code,“—...”) ; break; {
cout<<endl<<“ 73 & Good Bye...” ; case ‘8’ : strcpy(code,“—..”) ; break; int flag=1; char line[80] ;
cout<<endl<<“de” ; case ‘9’ : strcpy (code,“——.”) ; break; clrscr() ; cout<<“LINE MODE”<<endl ;
cout<<endl<<“\t\tYUJIN BOBY, Radio case ‘0’ : strcpy(code,“——”) ; break; cout<<“Type ‘*’ to END sending”<<endl ;
VU3PRX” ; case ‘-’ : strcpy(code,“-....-”) ; break; while(flag)
cout<<endl<<“\t\tKoilparambil, Arthinkal” ; case ‘?’ : strcpy(code,“..—..”) ; break; {
cout<<endl<<“\t\tKerala, PIN - 688 530” ; case ‘(‘ : strcpy(code,“-.—.”) ; break; gets(line) ;
cout<<endl<<endl ; case ‘)’ : strcpy(code,“-.—.-”) ; break; int len=strlen(line) ;
} case ‘.’ : strcpy(code,“.-.-.-”) ; break; for (int i=0; i<len; i++)
void morse () case ‘=’ : strcpy(code,“-...-”) ; break; {
{ case ‘/’ : strcpy(code,“-..-.”) ; break; in=line[i] ;
char code [8] ; case ‘+’ : strcpy(code,“.-.-.”) ; break; if(in==‘ ’) { delay (6*DOT) ; continue ;
switch (toupper(in)) case ‘:’ : strcpy(code,“—...”) ; break; }
{ case ‘,’ : strcpy(code,“—..—”) ; break; else if(in==‘*’) { flag=0; break;
case ‘A’ : strcpy (code, “.-”) ; break; default: cout<<endl<<“MSG-Switch::Invalid }

78 ELECTRONICS FOR YOU ❚ MAY 2000


SOFTWARE SECTION

morse() ; void mode_sett() ; cout<<“\nCurrent speed is ”<<speed<<


} void mode_sett() “ Words/Minute”<<endl ;
} { cout<<“The valid Speed is from 5 WPM to 20
} int cho ; WPM ”<<endl ;
void mode_file() clrscr() ; cout<<“\n\nEnter new speed : ” ;
{ cout<<“l. CHANGE FREQUENCY”<<endl ; cin>>speed ;
FILE *fp ; char fname[10] ; cout<<“2. CHANGE SPEED”<<endl ; if((speed>4) && (speed<21))
clrscr() ; cout<<endl<<“Enter your choice : ” ; {
cout<<“Enter file name : ”; cin>> fname; cin>>cho ; DOT=36000/ (speed*60) ;
if ((fp=fopen(fname,“r”)) !=NULL) if(cho==1) cout<<“\n\nNow the speed is ”<<speed<<
{ { “Words Per Minute” ;
while((in=getc(fp)) !=EOF) cout<<endl<<“Current Frequency of tone is” }
{ <<FREQ<<“Hz”<<endl ; else cout<<“\n\nError : Speed “<<speed<<
if (in==’ ‘) cout<<“The valid frequency range is from 100 “WPM not allowed\n” ;
{ Hz to 4000 Hz” ; getch() ;
delay(6*DOT); continue; cout<<endl<<endl<<“Enter the new }
} frequency : ” ; }
morse() ; int tmp ; void mode_char()
} cin>>tmp ; {
} cout<<endl<<endl; clrscr() ;
else if ( (tmp>99) && (tmp<4001) ) cout<<“CHARACTER MODE”<<endl ;
{ { cout<<“Type ‘*’ to END sending”<<endl ;
char ans ; FREQ=tmp ; while (1)
cout<<endl<<“File not found, Create New cout<<“Now the Frequency is changed to” {
(Y/N) ? ” ; <<FREQ<<“Hz”<<endl; in=getche() ;
cin>>ans ; } if(in==‘ ’) { delay (6*DOT) ; continue;
if((ans==‘y’) || (ans==’Y’)) else cout<<“Error : Invalid frequency range” ; }
if((fp=fopen(fname,“w”)) !=NULL) getch() ; else if(in==‘*’) break ;
while((ans=getchar() ) !=‘\n’) } morse () ;
putc(ans, fp) ; if(cho==2) }
} { }
fclose(fp) ; int speed ;
} speed=36000/(DOT*60) ;

CONNECT-FOUR GAME place four pieces of your colour adjacent


to each other, as you place in tick-tack-
DHAVAL Y. TRIVEDI toe. In tick-tack-toe, you can put your piece
anywhere. But in connect-four, a piece will

C
onnect-four is a very simple and provided for two players. This game is be placed at the lowest empty block.
popular game. Here is the com- almost like tick-tack-toe. You have to just The player who places four pieces of
puter version of this game. The his colour in a row, column, or diagonally
game is quite easy and self-explanatory. will win. The software will automatically
Online help is provided to avoid any con- detect the winner. All the runtime keys
fusion during the game. are specified in the online help. Save this
This game is executable only in file as CONNECT4.BAS. If you want to
QBASIC and it runs only on a system run this game directly from DOS-prompt,
with VGA monitor or a higher system. A make a file CONNECT4.BAT in your di-
486 or higher system is recommended, as rectory as follows:
the game will run very slow on a lower @ECHO OFF
system. CLS
QBASIC/RUN CONNECT4.BAS
In this game, two different colours are CLS

Program Listing in QBASIC


CLEAR , , 8096: CLS : SCREEN 12 2”: GOSUB hlp
10 CLS : SCREEN 12: DIM cur(11): PSET (2, 0): DRAW “g2 e2 f2 h2 PLAY “L20”: PLAY “O 3CDEFG”
d8”: DEF SEG = 0: POKE 1047, &H0: DEF SEG 90 K$ = INKEY$
GET (0, 0)-(4, 8), cur: CLS : PAINT (1, 1), 7 KEY 17, CHR$(0) + CHR$(16): ON KEY(17) GOSUB ex: KEY(17) ON: KEY
LINE (0, 345)-(640, 345), 15: LINE (560, 0)-(560, 345), 15 18, CHR$(0) + CHR$(34): ON KEY(18) GOSUB grid: KEY(18) ON
LINE (572, 80)-(627, 105), 7, BF: LINE (572, 80)-(627, 105), 5, BF: KEY 15, CHR$(0) + CHR$(42): ON KEY(15) GOSUB p1: KEY(15) ON:
GOSUB grid: KEY 16, CHR$(0) + CHR$(49): ON KEY(16) GOSUB restart: KEY(16) ON
LINE (560, 175)-(639, 175), 15: LINE (0, 0)-(639, 479), 15, B IF LEN(K$) < 2 THEN 90
X = 30: y = 330: r1 = 325: r2 = 325: r3 = 325: r4 = 325: r5 = 325: r6 = K = ASC(RIGHT$(K$, 1))
325: r7 = 325: r8 = 325: r9 = 325: IF K = 75 THEN x1 = -55: y1 = 330: GOTO 170
r10 = 325: turn = 6: gr = 7: PUT (X, y), cur IF K = 77 THEN x1 = 55: y1 = 330: GOTO 170
LOCATE 2, 72: PRINT “PLAYER 1”: LOCATE 13, 72: PRINT “PLAYER GOTO 90

ELECTRONICS FOR YOU ❚ MAY 2000 79


SOFTWARE SECTION

170 PUT (X, y), cur: X = X + x1: y = y1 IF X = 470 THEN r9 = r9 - 25: SOUND 990, .5: IF r9 < 25 THEN turn =
IF X < 30 THEN X = 525 ELSE IF X > 525 THEN X = 30 5: BEEP: GOSUB play1t: GOTO 320 ELSE LINE
SOUND 190, .5: PUT (X, y), cur (X - 24, r9 + 24)-(X + 29, r9 + 1), turn, BF
GOTO 90 IF X = 525 THEN r10 = r10 - 25: SOUND 990, .5: IF r10 < 25 THEN
p1: turn = 5: BEEP: GOSUB play1t: GOTO 320 ELSE
turn = turn - 1 LINE (X - 24, r10 + 24)-(X + 29, r10 + 1), turn, BF
IF X = 30 THEN r1 = r1 - 25: SOUND 990, .5: IF r1 < 25 THEN turn = GOSUB check
6: BEEP: GOSUB play2t: GOTO 90 ELSE LINE GOSUB play2t
(X - 24, r1 + 24)-(X + 29, r1 + 1), turn, BF turn = 6
IF X = 85 THEN r2 = r2 - 25: SOUND 990, .5: IF r2 < 25 THEN turn = GOTO 90
6: BEEP: GOSUB play2t: GOTO 90 ELSE END
LINE (X - 24, r2 + 24)-(X + 29, r2 + 1), turn, BF restart:
IF X = 140 THEN r3 = r3 - 25: SOUND 990, .5: IF r3 < 25 THEN turn = GOTO 10
6: BEEP: GOSUB play2t: GOTO 90 ELSE LINE check:
(X - 24, r3 + 24)-(X + 29, r3 + 1), turn, BF FOR U = 35 TO 325 STEP 25
IF X = 195 THEN r4 = r4 - 25: SOUND 990, .5: IF r4 < 25 THEN turn = FOR D = 30 TO 525 STEP 55
6: BEEP: GOSUB play2t: GOTO 90 ELSE LINE IF POINT(D, U) = turn AND POINT(D + 55, U) = turn AND POINT(D
(X - 24, r4 + 24)-(X + 29, r4 + 1), turn, BF + 110, U) = turn AND POINT(D + 165, U) = turn THEN GOSUB win
IF X = 250 THEN r5 = r5 - 25: SOUND 990, .5: IF r5 < 25 THEN turn = IF POINT(D, U) = turn AND POINT(D, U + 25) = turn AND POINT(D,
6: BEEP: GOSUB play2t: GOTO 90 ELSE LINE U + 50) = turn AND POINT(D, U + 75) = turn THEN GOSUB win
(X - 24, r5 + 24)-(X + 29, r5 + 1), turn, BF IF POINT(D, U) = turn AND POINT(D + 55, U + 25) = turn AND
IF X = 305 THEN r6 = r6 - 25: SOUND 990, .5: IF r6 < 25 THEN turn = POINT(D + 110, U + 50) = turn AND POINT(D
6: BEEP: GOSUB play2t: GOTO 90 ELSE LINE + 165, U + 75) = turn THEN GOSUB win
(X - 24, r6 + 24)-(X + 29, r6 + 1), turn, BF IF POINT(D, U) = turn AND POINT(D + 55, U - 25) = turn AND
IF X = 360 THEN r7 = r7 - 25: SOUND 990, .5: IF r7 < 25 THEN turn = POINT(D + 110, U - 50) = turn AND POINT(D
6: BEEP: GOSUB play2t: GOTO 90 ELSE LINE + 165, U - 75) = turn THEN GOSUB win
(X - 24, r7 + 24)-(X + 29, r7 + 1), turn, BF NEXT
IF X = 415 THEN r8 = r8 - 25: SOUND 990, .5: IF r8 < 25 THEN turn = NEXT
6: BEEP: GOSUB play2t: GOTO 90 ELSE LINE RETURN
(X - 24, r8 + 24)-(X + 29, r8 + 1), turn, BF win:
IF X = 470 THEN r9 = r9 - 25: SOUND 990, .5: IF r9 < 25 THEN turn = PLAY “L20”: PLAY “O 3GFEDCP8CDEFGP8GFEDCP8CDEFG”:
6: BEEP: GOSUB play2t: GOTO 90 ELSE LINE PLAY “L30”
(X - 24, r9 + 24)-(X + 29, r9 + 1), turn, BF CLS : SCREEN 12: PAINT (1, 1), 7: KEY OFF: FOR I = 1 TO 520 STEP
IF X = 525 THEN r10 = r10 - 25: SOUND 990, .5: IF r10 < 25 THEN 7: LINE (1, 1)-(I, 479), 5: LINE (640, 1)-(640 - I, 1), 5: LINE (1,
turn = 6: BEEP: GOSUB play2t: GOTO 90 ELSE 479)-(I, 1), 5: LINE (640, 479)-(640 - I, 1), 5: LOCATE 15, 36:
LINE (X - 24, r10 + 24)-(X + 29, r10 + 1), turn, BF COLOR 7: PRINT “PLAYER “; turn - 4: LOCATE 17, 39: PRINT
GOSUB check “WINS”: NEXT
GOSUB play1t SLEEP 1
320 K$ = INKEY$ GOTO 10
ON KEY(17) GOSUB ex: ON KEY(18) GOSUB grid play1t:
KEY 15, CHR$(0) + CHR$(54): ON KEY(15) GOSUB p2: KEY(15) ON: LINE (572, 80)-(627, 105), 7, BF: LINE (572, 250)-(627, 275), 6, BF
ON KEY(16) GOSUB restart: KEY(16) ON RETURN
IF LEN(K$) < 2 THEN 320 play2t:
K = ASC(RIGHT$(K$, 1)) LINE (572, 250)-(627, 275), 7, BF: LINE (572, 80)-(627, 105), 5, BF
IF K = 75 THEN x1 = -55: y1 = 330: GOTO 400 RETURN
IF K = 77 THEN x1 = 55: y1 = 330: GOTO 400 ex:
GOTO 320 CLS : SCREEN 0
400 PUT (X, y), cur: X = X + x1: y = y1 LOCATE 11, 35: COLOR 30: PRINT “CONNECT FOUR”
IF X < 30 THEN X = 525 ELSE IF X > 525 THEN X = 30 LOCATE 12, 29: COLOR 7: PRINT “BY:- DHAVAL.Y.TRIVEDI,”
SOUND 190, .5: PUT (X, y), cur LOCATE 13, 30: PRINT “KANCHAN JUNGHA APPT, 101,”
GOTO 320 LOCATE 14, 26: PRINT “ROYAL PARK-6, UNI.ROAD, RAJKOT-5.”
p2: PLAY “L20”: PLAY “O 3GFEDC”
turn = turn + 1 SYSTEM
IF X = 30 THEN r1 = r1 - 25: SOUND 990, .5: IF r1 < 25 THEN turn = grid:
5: BEEP: GOSUB play1t: GOTO 320 ELSE LINE IF gr = 7 THEN gr = 1 ELSE IF gr = 1 THEN gr = 7
(X - 24, r1 + 24)-(X + 29, r1 + 1), turn, BF LINE (5, 325)-(555, 300), gr, B: LINE (5, 300)-(555, 275), gr, B: LINE
IF X = 85 THEN r2 = r2 - 25: SOUND 990, .5: IF r2 < 25 THEN turn = (5, 275)-(555, 250), gr, B
5: BEEP: GOSUB play1t: GOTO 320 ELSE LINE LINE (5, 250)-(555, 225), gr, B: LINE (5, 225)-(555, 200), gr, B: LINE
(X - 24, r2 + 24)-(X + 29, r2 + 1), turn, BF (5, 200)-(555, 175), gr, B
IF X = 140 THEN r3 = r3 - 25: SOUND 990, .5: IF r3 < 25 THEN turn = LINE (5, 175)-(555, 150), gr, B: LINE (5, 150)-(555, 125), gr, B: LINE
5: BEEP: GOSUB play1t: GOTO 320 ELSE LINE (5, 125)-(555, 100), gr, B
(X - 24, r3 + 24)-(X + 29, r3 + 1), turn, BF LINE (5, 100)-(555, 75), gr, B: LINE (5, 75)-(555, 50), gr, B: LINE (5,
IF X = 195 THEN r4 = r4 - 25: SOUND 990, .5: IF r4 < 25 THEN turn = 50)-(555, 25), gr, B
5: BEEP: GOSUB play1t: GOTO 320 ELSE LINE LINE (5, 325)-(60, 25), gr, B: LINE (60, 325)-(115, 25), gr, B: LINE
(X - 24, r4 + 24)-(X + 29, r4 + 1), turn, BF (115, 325)-(170, 25), gr, B
IF X = 250 THEN r5 = r5 - 25: SOUND 990, .5: IF r5 < 25 THEN turn = LINE (170, 325)-(225, 25), gr, B: LINE (225, 325)-(280, 25), gr, B: LINE
5: BEEP: GOSUB play1t: GOTO 320 ELSE LINE (280, 325)-(335, 25), gr, B
(X - 24, r5 + 24)-(X + 29, r5 + 1), turn, BF LINE (335, 325)-(390, 25), gr, B: LINE (390, 325)-(445, 25), gr, B: LINE
IF X = 305 THEN r6 = r6 - 25: SOUND 990, .5: IF r6 < 25 THEN turn = (445, 325)-(500, 25), gr, B
5: BEEP: GOSUB play1t: GOTO 320 ELSE LINE LINE (500, 325)-(555, 25), gr, B
(X - 24, r6 + 24)-(X + 29, r6 + 1), turn, BF RETURN
IF X = 360 THEN r7 = r7 - 25: SOUND 990, .5: IF r7 < 25 THEN turn = hlp:
5: BEEP: GOSUB play1t: GOTO 320 ELSE LINE LOCATE 28, 2: COLOR 15: PRINT “<LEFT SHIFT>=PLAYER 1
(X - 24, r7 + 24)-(X + 29, r7 + 1), turn, BF <RIGHT SHIFT>=PLAYER 2 <G>=GRID
IF X = 415 THEN r8 = r8 - 25: SOUND 990, .5: IF r8 < 25 THEN turn = ON/OFF <N>=NEW <Q>=QUIT”
5: BEEP: GOSUB play1t: GOTO 320 ELSE LINE RETURN
(X - 24, r8 + 24)-(X + 29, r8 + 1), turn, BF

80 ELECTRONICS FOR YOU ❚ MAY 2000


CIRCUIT
IDEAS

SOLAR BUG SANI TH


EO

small as 3 cm2.
If a digital voltmeter is connected
„ D. SOMNATH across capacitor C2, a slow build-up
of voltage can be observed when the

H
ide this solar-powered circuit panel is exposed to light. Transistors
suitably and see the reaction T1 and T2 form a relaxation oscillator.
of your friends to the chirpy When C1 charges to 0.6V, transistor
sound produced by it every few min- T1 conducts and the charge built up
utes. In all probability, it will coax in C2 is discharged through the
them to find out where the sound is piezobuzzer to produce a short beep.
coming from. While testing the circuit, the value
The circuit runs off a miniature so- of resistor R1 can be reduced to, say, 1
lar power panel, which can be taken kilo-ohm. Use a good-quality buzzer
out from an old calculator such as Citi- 2.5V is required. Note that the circuit to ensure that the sound produced is
zen CT-500. A panel giving 1.5V to can work properly from a panel as loud enough. z

WWW.EFYMAG.COM ELECTRONICS FOR YOU • APRIL 2005 • 67

CMYK
CIRCUIT
IDEAS

IVEDI
S.C. DW
SOLAR LIGHTING SYSTEM
 ASHISH AHUJA ing occurs moments after the voltage ing and the battery is in the charging
across it falls below 12V. Capacitor C1 mode.

T
he world cannot continue to rely also filters the rectified output if the At night, there will be no genera-
for long on fossil fuels for its battery is charged through AC power. tion of electricity. The relay will not
energy requirements. Fossil fuel The higher the value of the capacitor, energise and charging will not take
reserves are limited. In addition, when the more the delay in switching. The place. The solar energy stored in the
burnt, these add to global warming, switching time is to be properly ad- battery can then be used to light up
air pollution and acid rain. justed because the charging would the lamp. A 3W lamp glows continu-
So solar photovoltaic systems are practically stop in the early evening ously for around 6 hours if the battery
ideal for providing independent elec- while we want the light to be ‘on’ dur- is fully charged. Instead of a 3W lamp,
trical power and lighting in isolated ing late evening. you can also use a parallel array of
rural areas that are far away from the During daytime, relay RL1 serially connected white LEDs and lim-

power grid. These systems are non- energises, provided DPDT switch S1 iting resistors to provide sufficient
polluting, don’t deplete the natural re- is towards the solar panel side. Due to light for even longer duration.
sources and are cheap in the long run. energisation of relay RL1, the positive In case the battery is connected in
The aim of this circuit is to demon- terminal of the battery is connected to reverse polarity while charging, IC
strate how we can utilise solar light to the output of regulator IC 7808 (a 3- 7808 will get damaged. The circuit in-
electrify the remote areas, i.e., how we terminal, 1A, 8V regulator) via diode dicates this damage by lighting up
can store the solar energy and then use D1 and normally-open (N/O) contacts LED2, which is connected in reverse
it for small-scale lighting applications. of relay RL1. Here we have used a 6V, with resistor R2. However, the circuit
Solar cells generate direct current, 4.5Ah maintenance-free, lead-acid re- provides only the indication of reverse
so make sure that DPDT switch S1 is chargeable battery. It requires a con- polarity and no measure to protect the
towards the solar panel side. The DC stant voltage of approx. 7.3 volts for IC. A diode can be connected in re-
voltage from the solar panel is used to its proper charging. verse to the common terminal of the
charge the battery and control the re- Even though the output of the so- IC but this would reduce the voltage
lay. lar panel keeps varying with the light available to the battery for charging
Capacitor C1 connected in parallel intensity, IC 7808 (IC1) is used to give by another 0.7 volt.
with a 12V relay coil remains charged a constant output of 8V. Diode D1 There is also a provision for esti-
in daytime until the relay is activated. causes a drop of 0.7V, so we get mating the approximate voltage in the
Capacitor C1 is used to increase the approx. 7.3V to charge the battery. battery. This has been done by connect-
response time of the relay, so switch- LED1 indicates that the circuit is work- ing ten 1N4007 diodes (D2 through D11)

98 • APRIL 2006 • ELECTRONICS FOR YOU WWW.EFYMAG.COM

CMYK
CIRCUIT
IDEAS
in forward bias with the battery. The tery voltage falls due to prolonged op- consecutive days, the battery will not
output is taken by LED3 across diodes eration, LED3 no longer glows as the charge. So a transformer and full-wave
D2, D3, D4 and D5, which is equal to drop across D2, D3, D4 and D5 is not rectifier have been added to charge the
2.8V when the battery is fully charged. enough to light it up. This indicates battery by using DPDT switch S1. This
LED3 lights up at 2.5 volts or above. that the battery has gone weak. Micro- is particularly helpful in those areas
Here it glows with the voltage drop switch S1 has been provided to do this where power supply is irregular; the
across the four diodes, which indicates test whenever you want. battery can be charged whenever
that the battery is charged. If the bat- If the weather is cloudy for some mains power is available. 

WWW.EFYMAG.COM ELECTRONICS FOR YOU • APRIL 2006 • 99

CMYK
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

STRESS METER SANI TH


EO

„ D. MOHAN KUMAR cuit. The circuit is very sensitive and bar mode for each increment of 125
detects even a minute voltage varia- mV in the input.

T
his stress monitor lets you tion across the touch pads. Here, we’ve used only five LEDs
assess your emotional pain. If The circuit comprises signal ampli- connected at pins 14 through 18 of IC1.
the stress is very high, it gives fier and analogue display sections. LED1 glows when input pin 5 of IC1
visual indication through a light-emit- Voltage variations from the sensing receives 150 mV. LED5 glows when
ting diode (LED) display along with a pads are amplified by transistor BC548 the voltage rises to 650 mV and LED5
flashes and
piezobuzzer PZ1
beeps when the
stress level is high.
Resistors R4
and R5 and capaci-
tor C2 form the
flashing elements.
Resistor R3 main-
Fig. 2: Display panel tains the LED cur-
rent at
around 20
mA. Ca-
pacitor C3
should be
p l a c e d
close to pin
Fig. 3: Self-locking straps 3 for proper
Fig. 1: Circuit of the stress meter
functioning
warning beep. The gadget is small (T1), which is configured as a com- of the IC. Zener diode ZD1 in series
enough to be worn around the wrist. mon-emitter amplifier. The base of T1 with resistor R6 provides regulated 5V
The gadget is based on the prin- is connected to one of the touch pads to the circuit.
ciple that the resistance of the skin var- through resistor R1 and to the ground The circuit can be assembled on a
ies in accordance with your emotional rail through potmeter VR1. By vary- small piece of perforated board. Use
states. If the stress level is high the ing VR1, the sensitivity of T1 can be transparent 3mm LEDs and a small
skin offers less resistance, and if the adjusted to the desired level. Diode D1 piezobuzzer for audio-visual indica-
body is relaxed the skin resistance is maintains proper biasing of T1 and ca- tions. Enclose the circuit in a small
high. The low resistance of the skin pacitor C1 keeps the voltage from the plastic case with touch pads on the
during high stress is due to an increase emitter of T1 steady. back side. Two self-locking straps can
in the blood supply to the skin. This The amplified signal from transis- be used to tie the unit around your
increases the permeability of the skin tor T1 is given to the input of IC wrist.
and hence the conductivity for electric LM3915 (IC1) through VR2. IC After tying the unit around your
current. LM3915 is a monolithic integrated cir- wrist (with touch pads in contact with
This property of the skin is used cuit that senses analogue voltage lev- the skin), slowly vary VR1 until LED1
here to measure the stress level. The els at its pin 5 and displays them glows (assuming that you are in re-
touch pads of the stress meter sense through LEDs providing a logarith- laxed state). Adjust VR2 if the sensi-
the voltage variations across the touch mic analogue display. It can drive up tivity of IC1 is very high. The gadget
pads and convey the same to the cir- to ten LEDs one by one in the dot/ is now ready for use. z

WWW.EFYMAG.COM ELECTRONICS FOR YOU • SEPTEMBER 2005 • 101

CMYK
TELEPHONE CALL ME TER USING
CALCULATOR AND COB
I
n this circuit, a simple calculator, in The clock pulses available from ter- always be included before counting the
conjunction with a COB (chip-on- minal A and B are combined using a calls.
board) from an analogue quartz clock, bridge, comprising diodes D1 to D4, to For making call in pulse rate 4, slide
is used to make a telephone call meter.
The calculator enables conversion of STD/
ISD calls to local call equivalents and al-
ways displays current local call-meter
reading.
The circuit is simple and presents an
elegant look, with feather-touch operation.
It consumes very low current and is fully
battery operated. The batteries used last
more than a year.
Another advantage of using this cir-
cuit is that it is compatible with any type
of pulse rate format, i.e. pulse rate in
whole number, or whole number with
decimal part. Recently, the telephone de-
partment announced changes in pulse
rate format, which included pulse rate
in whole number plus decimal part. In obtain 1Hz clock pulses. These clock switch S1 to ‘off’ (pulse set position) and
such a case, this circuit proves very pulses are applied to the base of transis- press calculator buttons in the following
handy. tor T1. The collector and emitter of tran- order: 1, ‘+’, 0.25, ‘=’. Here, 1 is initial
To convert STD/ISD calls to local calls, sistor T1 are connected across calculator’s count, and 0.25 is PRE. Now calculator
this circuit needs accurate 1Hz clock ‘=’ terminals. displays 1.25. This call meter is now ready
pulses, generated by clock COB. This COB The number of pulses forming an to count. Now make the call, and as soon
is found inside analogue quartz wall equivalent call may be determined from as the call matures, immediately slide
clocks or time-piece mechanisms. It the latest telephone directory. However, switch S1 to ‘on’ (start/standby position).
consists of IC, chip capacitors, and crystal the pulse rate (PR) found in the directory The COB starts generating clock
that one can retrieve from scrap quartz cannot be used directly in this circuit. pulses of 1 Hz. Transistor T1 conducts
clock mechanisms. For compatibility with this circuit, the once every second, and thus ‘=’ button in
Normally, the COB inside clock pulse rate applicable for a particular calculator is activated electronically once
mechanism will be in good condition. place/distance, based on time of the every second. The calculator display starts
However, before using the COB, please day/holidays, is converted to pulse rate from 1.25, advancing every second as
check its serviceability by applying equivalent (PRE) using the formula follows:
1.5V DC across terminals C and D, as PRE = 1/PR. 1.25, 1.5, 1.75, 2.00, 2.25, 2.50, and so on.
shown in the figure. Then check DC You may prepare a look-up table for After finishing the call, immediately
voltage across terminals A and B; various pulse rates and their equivalents slide switch S1 to ‘off’ position (pulse set
these terminals in a clock are connected (see Table). Suppose you are going to position) and note down the local call
to a coil. If the COB is in good condition, make an STD call in pulse rate 4. Note meter reading from the calculator display.
the multimeter needle would deflect down from the table the pulse rate equiva- If decimal value is more than or equal to
forward and backward once every sec- lent for pulse rate 4, which is 0.25. Please 0.9, add another call to the whole num-
ond. In fact, 0.5Hz clock is available at note that on maturity of a call in the ber value. If decimal value is less than
terminals A and B, with a phase telephone exchange, the exchange call 0.9, neglect decimal value and note down
difference of 90o. The advantage of using meter immediately advances to one call only whole numbers.
this COB is that it works on a 1.5V DC and it will be further incremented ac- To store this local call meter reading
source. cording to pulse rate. So one call should into calculator memory, press ‘M+’ but-
ton. Now local call meter reading is stored
LOOKUP TABLE in memory and is added to the previous
Pulse rate (PR) 2 2.5 3 4 6 8 12 16 24 32 36 48 local call meter reading. For continuous
Pulse rate display of current local call meter read-
eqlt. (PRE) 0.500 0.400 0.333 0.250 0.166 0.125 0.083 0.062 0.041 0.031 0.027 0.020
ing, press ‘MRC’ button and slide switch
Note: Here PRE is shown up to three decimal places. In practice, one may use up to five S1 to ‘on’ (start/standby position). The cur-
or six decimal places.
rent local call meter reading will blink

ELECTRONICS PROJECTS Vol. 21 167


once every second. ton is activated electronically once every culator as terminals E and F. Affix COB
In prototype circuit, the author used second by transistor T1, to keep the cal- on a general-purpose PCB and solder the
TAKSUN calculator. The display height culator continuously ‘on’. remaining components neatly. For giv-
was 1 cm. In this calculator, he Useful hints. Solder the ‘=’ button ing the unit an elegant look, purchase a
substituted the two button-type batteries terminals by drilling small holes in its jewellery plastic box with flip-type cover
with two externally connected 1.5V R6 vicinity on PCB pattern using thin cop- (size 15cm x 15cm). Now fix the board,
type batteries to run the calculator for per wire and solder it neatly, such that calculator, and batteries, along with
more than an year. the ‘=’ button could get activated elec- holder inside the jewellery box. Then
The power ‘off’ button terminals were tronically as well as manually. Take mount the box on the wall and paste the
made dummy by affixing cellotape on con- the copper wire through a hole to the look-up table inside the box cover in such
tacts to avoid erasing of memory, should backside of the PCB, from where it is a way that on opening the box, it is vis-
someone accidentally press the power ‘off’ taken out of the calculator as terminals ible on left side of the box.
button. This calculator has auto ‘off’ fa- G and H. Caution. The negative terminals of
cility. Therefore, some button needs to be At calculator’s battery terminals, sol- battery A and battery B are to be kept
pressed frequently to keep the calculator der two wires to ‘+’ and ‘–’ terminals. isolated from each other for proper opera-
‘on’. So, in the idle condition, the ‘=’ but- These wires are also taken out from cal- tion of this circuit.

168 ELECTRONICS PROJECTS Vol. 21


Telephone Conversation
Recorder
T
his circuit enables automatic ensures that transistor T1 gets voltage of tor T1 is pulled to ground potential via
switching-on of the tape recorder proper polarity, irrespective of the polarity resistor R4 and thus is cut off. Thus, base
when the handset is lifted. The of the telephone lines. of transistor T2 gets forward biased via
tape recorder gets switched off when the During on-hook condition, the output resistor R5, which results in the energisa-
handset is replaced. The signals are suit- from the bridge (48V DC) passes through tion of relay RL1. The tape recorder is
ably attenuated to a level at which they 12V zener D5 and is applied to the base of switched 'on' and recording begins.
can be recorded using the 'MICIN' socket transistor T1 via the voltage divider com- The tape recorder should be kept
of the tape recorder. prising resistors R3 and R4. This switches loaded with a cassette and the record
Points X and Y in the circuit are con- on transistor T1 and its collector is pulled button of the tape recorder should re-
nected to the telephone lines. Resistors R1 low. This, in turn, causes transistor T2 to main pressed to enable it to record the
and R2 act as a voltage divider. The voltage cut off and relay RL1 is not energised. conversation as soon as the handset is
appearing across R2 is fed to the 'MIC-IN' When the telephone handset is lifted, lifted. Capacitor C2 ensures that the re-
socket of the tape recorder. The values of the voltage across points X and Y falls lay is not switched on-and-off repeatedly
R1 and R2 may be changed depending on below 12 volts and so zener diode D5 does when a number is being dialled in pulse
the input impedance of the tape recorder's not conduct. As a result, base of transis- dialling mode.
'MIC-IN' terminals. Capacitor
C1 is used for blocking the flow
of DC.
The second part of the circuit
controls relay RL1, which is used
to switch on/off the tape recorder.
A voltage of 48 volts appears
across the telephone lines in
on-hook condition. This voltage
drops to about 9 volts when the
handset is lifted. Diodes D1
through D4 constitute a bridge
rectifier/polarity guard. This

ELECTRONICS PROJECTS Vol. 21


TELEPHONE LINE BASED AUDIO
MUTING AND LIGHT-ON CIRCUIT
V
ery often when enjoying music or relays will still remain energised because The timer IC2 (555) is configured in
watching TV at high audio level, of low-impedance DC path available monostable mode and connected between
we may not be able to hear a (via cradle switch and handset) for transistor T1 and relay units provides a
telephone ring and thus miss
an important incoming phone
call. To overcome this
situation, the circuit
presented here can be used.
The circuit would
automatically light a bulb on
arrival of a telephone ring and
simultaneously mute the
music system/TV audio for
the duration the telephone
handset is off-hook. Lighting
of the bulb would not only
indicate an incoming call but
also help in locating the
telephone during darkness.
On arrival of a ring, or
when the handset is off-
hook, the inbuilt transistor
of IC1 (opto-coupler)
conducts and capacitor C1
gets charged and, in turn,
transistor T1 gets forward
biased. As a result,
transistor T1 conducts,
causing energisation of
relays RL1, RL2, and RL3.
Diode D1 connected in anti-
parallel to inbuilt diode of
IC1, in shunt with resistor R1, provides the in-built diode of IC1. After completion holding time of around 0.5 minutes.
an easy path for AC current and helps of call when handset is placed back on Similarly, energisation of DPDT
in limiting the voltage across inbuilt its cradle, the low-impedance path relay RL3 opens the leads going to
diode to a safe value during the ringing. through handset is no more available the speakers and thus mutes both audio
(The RMS value of ring voltage lies and thus relays RL1 through RL3 are speakers. Use ‘N/C’ contacts of relay
between 70 and 90 volts RMS.) Capacitor deactivated. RL3 in series with speakers of music
C1 maintains necessary voltage for As shown in the figure, the energised system and ‘N/C’ contacts of RL2 in
continuously forward biasing transistor relay RL1 contacts switch on the light, series with TV speaker. Use ‘N/O’ contact
T1 so that the relays are while energisation of relay RL2 causes the of relay RL1 in series with a bulb to
not de-energised during the negative path of TV speaker lead to be opened. (For get the visual indication of an incoming
half cycles and off-period of ring signal. dual-speaker TV, replace relay RL2 with a call as well as light during off-hook
Once the handset is picked up, the DPDT relay of 6V, 200 ohm.) period.

ELECTRONICS PROJECTS Vol. 21 187


Telecom Headset
A
compact, inexpensive and
low component count
telecom head-set can be con-
structed using two readily available
transistors and a few other electron-
ic components. This circuit is very
useful for hands-free operation of
EPABX and pager communication.
Since the circuit draws very little
current, it is ideal for parallel opera-
tion with electronic telephone set.
Working of the circuit is simple
and straightforward. Resistor R1
and an ordinary neon glow-lamp
forms a complete visual ringer cir-
cuit. This simple arrangement does
not require a DC blocking capacitor
because, under idle conditions, the tel-
ephone line voltage is insufficient to ionise
the neon gas and thus the lamp does not
light. Only when the ring signal is being
received, it flashes at the ringing rate to
indicate an incoming call.
The bridge rectifier using diodes D1
through D4 acts as a polarity guard which lector of transistor T2 are
protects the electronic circuit from any coupled to dynamic receiver
reversal in the telephone line polarity. RT-200 (used as earpiece) via
Zener diode D5 at the output of this bridge capacitor C7.
rectifier is used for additional circuit A condenser micro-
protection. phone, connected as shown
Section comprising transistor T1, re- in the circuit, is used as
sistors R2, R3 and zener diode D6 forms a transmitter. Audio signals
constant voltage regulator that provides developed across the microphone are diode bridge.
a low voltage output of about 5 volts. coupled to the base of transistor T1 The whole circuit can be wired on a
Dial tone and speech signals from ex- via capacitor C3. Resistor R4 deter- very small PCB and housed in a medium
change are coupled to the audio ampli- mines the DC bias required for the size headphone, as shown in the illustra-
fier stage built around transistor T2 and microphone. After amplification by tion. For better results at low line cur-
related parts, i.e. resistors R7, R6 and transistor T1, the audio signals are rents, value of resistor R2 may be reduced
capacitor C5. Amplified signals from col- coupled to the telephone lines via the after testing.

ELECTRONICS PROJECTS Vol. 20


TELEPHONE RINGER
USING TIMER ICs
U
sing modulated rectangular contains two timers (similar to 555 ICs) another rectangular waveform.
waves of different time periods, in a single package. One can also as- A resistor R7 is used at the collector of
the circuit presented here pro- semble this circuit using four separate transistor T2 to prevent capacitor C3 from
duces ringing tones similar to those 555 ICs. The first multivibrator produces fully discharging when transistor T2 is
produced by a telephone. a rectangular waveform with 1-second conducting. Preset VR1 must be set at
The circuit requires four astable ‘low’ duration and 2-second ‘high’ such a value that two ringing tones are
multivibrators for its working. Therefore duration. This waveform is used to con- heard in the loudspeaker in one second.
two 556 ICs are used here. The IC 556 trol the next multivibrator that produces The remaining two multivibrators are used
to produce ringing tones correspond-
ing to the ringing pulses produced
by the preceding multivibrator
stages.
When switch S1 is closed, tran-
sistor T1 cuts off and thus the first
multivibrator starts generating
pulses. If this switch is placed in the
power supply path, one has to wait
for a longer time for the ringing to
start after the switch is closed. The
circuit used also has a provision for
applying a drive voltage to the circuit
to start the ringing.
Note that the circuit is not meant
for connection to the telephone lines.
Using appropriate drive circuitry at
the input (across switch S1) one can
use this circuit with intercoms, etc.
Since ringing pulses are generated
within the circuit, only a constant
voltage is to be sent to the called
party for ringing.
EFY Lab note. To resemble the
actual telephone ringing a 400 Hz
tone is switched on in the following
sequence: 400ms on, 200ms off,
400ms on and 2000ms off and then
repeat.

ELECTRONICS PROJECTS Vol. 21 203


CIRCUIT
IDEAS

TELEPHONE-OPERATED S.C. DW
IVEDI

CALLING SYSTEM
 YOGESH KATARIA (VU3PYF) The circuit can also be used in quiz the telephone connected in parallel to
contests and by visually- or hearing- the circuit.

D
ual-tone multiple-frequency impaired people. It can be used to call 3. Gates N1 and N2 to activate the
(DTMF) receiver IC is com- a maximum of nine different persons. call bell.
monly used in telephone The circuit is built around DTMF Here is how the circuit works: Con-
equipment. One common DTMF receiver IC HT9170, BCD-to-7-segment nect the telephone and the circuit in
receiver is Holtek HT9170 used in decoder/driver 7447, quad 2-input OR parallel to the telephone line. Connect
electronic communication circuits. The gate and common-anode display. 6V to the circuit. When you press
Holtek HT9170 series comprises DTMF Simple melody generator IC UM66 is switch S1, DIS1 shows ‘0.’ Lift the
receivers integrated with digital de- used to produce melody sound in the handset off the cradle and dial a num-
coder and bandsplit filter functions. loudspeaker through Darlington-pair ber, say, ‘1.’ The output of IC1 becomes
All HT9170 series ICs use digital transistors (T1 and T2). A3A2A1A0 = 0001. LED1 glows, the
counting techniques to detect and de- The tone pair DTMF generated by display shows ‘1’ and the call bell
code all the 16 DTMF tone pairs into a pressing the telephone key is con- sounds.
4-bit code output. verted into binary values internally in To stop the call bell, put the re-
This telephone-operated calling cir- the IC. The binary values are indicated ceiver on the cradle and press switch
cuit is very helpful for doctors in call- by the glowing of LEDs at the output S1 momentarily. Now DIS1 shows ‘0’
ing the patients, in banks and in vari- of IC1. and LED1 stops glowing.
ous other situations where persons The output of IC1 is connected to: For calling other numbers, follow
have to be called or signalled. When 1. LEDs connected via resistors R15 the same procedure: Lift the handset
you need to call a person amongst through R18 at pins 11 through 14, re- off the cradle and press the desired
many standing outside your cabin, just spectively. LED1 indicates the LSB and number (0 through 9). The respective
lift the telephone handset off the cradle LED4 indicates the MSB. LED will glow, the number will be dis-
and press the respective number. The 2. BCD-to-7-segment decoder/ played on DIS1 and the call bell will
number of the person called will be driver 7447, whose outputs are con- sound. Now put the handset on the
displayed and a bell will sound to in- nected to the common-anode display cradle and press S1 momentarily to
form the person that it is his turn. for displaying the pressed number on stop the call bell. 

100 • OCTOBER 2006 • ELECTRONICS FOR YOU WWW.EFYMAG.COM

CMYK
Tiny Dew Sensor
D
ew (condensed moisture) ad- same can be procured from authorised popular dual op-amp IC LM358N which
versely affects the normal per- service centres of reputed companies. The is configured here as a comparator. (Note
formance of sensitive electronic author used the dew sensor for FUNAI that only one half of the IC is used here.)
devices. A low-cost circuit described here VCP model No. V.I.P. 3000A (Part No: Under normal conditions, resistance of
can be used to switch off any gadget 6808-08-04, reference no. 336) in his pro- the dew sensor is low (1 kilo-ohm or so)
automatically in case of excessive totype. In practice, it is observed that all and thus the voltage at its non-inverting
humidity. dew sensors available for video application terminal (pin 3) is low compared to that at
At the heart of the circuit is an possess the same electrical characteristics its inverting input (pin 2) terminal. The
inexpensive (resistor type) dew sensor irrespective of their physical shape/size, corresponding output of the comparator
element. Although dew sensor elements and hence are interchangeable and can be (at pin 1) is accordingly low and thus noth-
are widely used in video cassette players used in this project. ing happens in the circuit.
and recorders, these may not be easily The circuit is basically a switching When humidity exceeds 80 per cent,
available in local market. However, the type circuit made with the help of a the sensor resistance increases rapidly.
As a result, the non-inverting pin becomes
more positive than the inverting pin. This
pushes up the output of IC1 to a high
level. As a consequence, the LED inside
the opto-coupler is energised. At the same
time LED1 provides a visual indication.
The opto-coupler can be suitably inter-
faced to any electronic device for switching
purpose.
Circuit comprising diode D1, resistors
R8 and R6 and capacitor C1 forms a low-
voltage, low-current power supply unit.
This simple arrangement obviates the
requirement for a bulky and expensive
step-down transformer.

ELECTRONICS PROJECTS Vol. 20


CIRCUIT IDEAS

touch signal is connected to the counter/


decoder via a resistor and clock input CK

TOUCH DIMMER S.C.


DWI
VED
I is connected to the counter/decoder via a
frequency generator.
Line frequency signal is taken through
R4 at pin 2 of IC TT6061A. At zero cross-
K. KRISHNA MURTY second touch, the bulb gives medium light. ing, the triac (BT136) triggers to drive a
At the third touch, the bulb is driven 200W bulb.

B
y simply touching this touch dim- fully. Another touch puts off the light. The 6.8V power supply is taken di-
mer you can increase the light in- Since the IC is highly sensitive, use a rectly from mains through resistors R1 and
tensity of incandescent lamps in long wire to connect the IC to the touch R3, diode D3, capacitor C4, and zener
three steps. The touch dimmer is built sensor. The circuit uses minimum exter- diode and fed to power-input pin 3 of the
around 8-pin CMOS IC TT8486A/TT6061A nal components. For touch plate, you can IC. Capacitors C1, C2, and C3 connected
specifically manufactured for touch dim- use a simple copper plate of 1cm×1cm or between touch input pin 4 and touch plate

Pin Assignments of IC TT6061A


Pin No. Pin name Function description

1 CK System clock input


2 FI 50Hz line frequency
3 VDD Power input pin for VDD
4 TI Touch input
5 CI Sensor control input
6 NC Not connected
7 VSS Power input pin for VSS
8 AT Angle-trigger output

remove the shock potential from the touch


plate, so do not replace these capacitors
with a single capacitor or with a capacitor
of a lower voltage rating. Mains potential
exists in the circuit. Needless to say, it is
dangerous to touch the circuit when mains
mer applications. even the end of the lead wire. Touch plate is ‘on.’
Initially, when mains switch is ‘on,’ is coupled to the touch detector through Note. The IC had been procured by
the bulb is ‘off’. Now, if you touch the 820pF, 2kV capacitors C1, C2, and C3 con- the author from SM Semiconductors,
touch plate, the bulb glows dimly. On nected in series. Internally IC TT6061A’s Santacruz (W), Mumbai.

DECEMBER 2003 ELECTRONICS FOR YOU


TOUCH-SENSITIVE MUSICAL
BELL WITH TIMER
T
his circuit is built
around CMOS IC
CD4011 and pop-
ular melody generator
IC UM66. When touch
plates are bridged by
hand for a moment. the
circuit starts to generate
music. After a few sec-
onds the music automati-
cally stops.
Maximum supply
voltage for this circuit is
+5 volts. The IC UM66
can not operate beyond
3.3V voltage. IC 7805
regulator based power supply can be used ing values of capacitor C1 and resistor R2. 5-volt rail keep voltage applied to pin2 of
to power this circuit. Three silicon diodes connected in series UM66 below 3.2 volts because of the drop
Time delay can be changed by chang- between pin 2 of UM66 IC and positive of approximately 1.8 volts across them.

ELECTRONICS PROJECTS Vol. 19 185


CIRCUIT
IDEAS

ULTRASONIC PROXIMITY DETECTOR


 PRADEEP G. general-purpose PCB as shown in IVEDI
Fig. 3 and connect to identical points S.C. DW

W
e the humans can hear (‘a’ through ‘d’) of the detector circuit
sound of up to 20kHz fre- (Fig. 2) via external wires.
quency only. This proxim- The 40kHz oscillator is built ing CMOS decade counter IC4017 (IC1)
ity detector works at a frequency of 40 around transistors T1 and T2. If there is used at the output of the amplifier.
kHz. It uses two specially made ultra- is a solid object in front of the ultra- IC1 divides the input frequency by ’10,’
sonic transducers: One transducer sonic transmitter module (TX1), some so the 40kHz signal becomes 4 kHz,
emits 40kHz sound, while the other signals will be reflected back and which is within the audible range. The
receives 40kHz sound and converts it sensed by the receiver transducer 4kHz signals are fed to op-amp IC 741
into electrical variation of the same fre- (RX1). The 40kHz ultrasonic signals are (IC2), which is wired as an earphone
quency. converted into 40kHz electric signals amplifier.
Fig. 1 shows the block diagram of by the receiver and then amplified by This circuit can be used as an elec-
the ultrasonic proximity detector and transistors T3 and T4. tronic guard for the blind. Keep it
Fig. 2 shows its circuit. Mount the The amplified signals are still in (along with 9V battery) in their pocket
transducers (transmitter as well as re- the inaudible range, i.e., these can’t be with earphone plugged to their ear.
ceiver) about 5 cm apart on a piece of heard. So a frequency-divider stage us- The transducer modules should be di-
rected to-
wards the
walking
path. If
any object
comes up
in front or
n e a r b y , Fig. 3: Transducers mounted
Fig. 1: Block diagram of ultrasonic proximity detector they will on the PCB

Fig. 2: Circuit of ultrasonic proximity detector

88 • DECEMBER 2006 • ELECTRONICS FOR YOU WWW.EFYMAG.COM


CIRCUIT
IDEAS
hear 4kHz sound through the ear- pets can hear ultrasonic sound, which up and avoid banging against some
phone and can change their path ac- will irritate them and they will bark invisible objects. However, instead of
cordingly. unnecessarily. earphones the sound in this case is
One thing to be noted here is that EFY note. A similar device is used heard through a speaker and there is
while using this device, avoid the com- in some cars, such as Skoda’s Laura also an LCD screen to visually assist
pany of your pets. The reason is that model, to help the drivers in backing the driver. 

WWW.EFYMAG.COM ELECTRONICS FOR YOU • DECEMBER 2006 • 89


UPS FOR CORDLESS TELEPHONES
C
ordless telephones are very out, irrespective of the presence of the AC
popular nowadays. But they mains. When the AC mains is present,
have a major drawback, i.e. they the same is converted into DC and fed to
cannot be operated during power fail- the inverter. A part of the mains rectified
ure. Therefore usually another ordinary output is used to charge the battery. When
telephone is connected in parallel to the the mains power fails, the DC supply to
the inverter is from the battery and from
this is obtained AC at the inverter output.
This is shown in fig.1.
The circuit wired around IC CD4047 Fig. 3: Proposed layout of front and rear panels.
is an astable multivibrator operating at a battery, one may use two 6V, 4Ah batter-
frequency of 50 Hz. The Q and Q outputs ies (SUNCA or any other suitable brand).
Fig. 1: Block diagram of UPS.
of this multivibrator directly drive power The circuit can be easily assembled on
cordless telephone. This results in lack of MOSFETS IRF540. The configuration used a general-purpose PCB and placed inside
secrecy. UPS is a permanent solution to is push-pull type. The inverter output is a metal box. The two transformers may be
this problem. filtered and the spikes are reduced using mounted on the chassis of the box. Also,

Fig. 2: Circuit diagram of UPS

Since the UPS is meant only for the MOV (metal oxide varistor). The inverter the two batteries can be mounted in the
cordless telephone, its output power is transformer used is an ordinary 9V-0-9V, box using supporting clamps. The front
limited to around 1.5W. This is sufficient 1.5A mains transformer readily available and back panel designs are shown in the
to operate most cordless telephones. as in the market. Two LEDS (D6 and D7) indi- Fig. 3.
these employ only small capacity adapters cate the presence of mains/battery. The same circuit can deliver up to
(usually 9V/12V, 500mA), to enable the The mains supply (when present) is 100W, provided the inverter transformer
operation of the circuit and to charge the stepped down, rectified and filtered using and charging transformer are replaced
battery present in the handset. diodes D1 through D4 and capacitor C1. A with higher current rating transformers,
The UPS presently designed is of on- part of this supply is also used to charge so that the system can be used for some
line type. Here the inverter is ‘on’ through- the battery. In place of a single 12V, 4Ah other applications as well.

182 ELECTRONICS PROJECTS Vol. 19


CIRCUIT
IDEAS

VARIABLE POWER SUPPLY USING IVEDI


S.C. DW
A FIXED-VOLTAGE REGULATOR IC
 DR MAHESH N. JIVANI AND DR by using a pair of ‘voltage-divider’ re-
NIKESH A. SHAH sistors. It is not possible to obtain a Common Resistor
voltage lower than the stated rating. Combinations for the
7805 Regulator
A
voltage regulator (also called You cannot use a 12V regulator to
a ‘regulator’) with only three make a 5V power supply, but you can Vout (approx.) R1 (ohms) R2 (ohms)
terminals appears to be a use a 5V regulator to make a 12V sup-
5V 470 0
simple device, but it is in fact a very ply.
6V 470 100
complex integrated circuit. It converts Voltage regulators are very robust. 8V 470 220
a varying input voltage into a constant These can withstand over-current 9V 470 330
‘regulated’ output voltage. Voltage draw due to short circuits and also 12V 470 510
regulators are available in a variety of over-heating. In both cases, the regu-
outputs like 5V, 6V, 9V, 12V and 15V. lator will cut off before any damage Because of this constant 13.1mA cur-
The LM78XX series of voltage regu- occurs. The only way to destroy a rent, R2 can now be set to a value that
lators are designed for positive input. regulator is to apply reverse voltage will give constant 7 volts across resis-
For applications requiring negative in- to its input. Reverse polarity destroys tor R2. A resistor value of 533 or 510
put, the LM79XX series is used. Fig. 1 the regulator almost instantly. ohms (standard value) will give the
shows the pin configuration of a 5V Fig. 2 shows the circuit for increas- necessary 7 volts.
7805 regulator. ing the output voltage of a regulator With 5 volts across R1 and 7 volts
The output voltage of a regulator circuit using a pair of voltage-divider across R2, a total of about 12 volts
circuit can be increased resistors. Let’s assume the value of R1 (regulated) will appear across termi-
as 470 ohms, which nal 2 and ground. If a variable resis-
means that a constant tor is used as R2, the output voltage
current of 10.6 mA will can be easily fine-tuned to any value
be available between greater than 5 volts. The standby
terminals 2 and 3 of current will vary slightly in the
7805. This constant cur- regulator 7805, but 2.5 mA will yield
rent plus the regulator good results in the calculations. If an
standby current of exact voltage (within 0.3 volt) is
about 2.5 mA will flow needed, R2 must be a variable resis-
Fig. 1: Pin
configuration of
through R2 to ground tor. To make any fixed regulator ad-
7805 regulator Fig. 2: Circuit for increasing the output voltage regardless of its value. justable, use the following formula:
Vfixed
Vout= Vfixed+R2 +Istandby
R1

where Vout is the desired output


voltage, Vfixed is the fixed voltage
of the IC regulator (5 volts) and
Istandby is the standby current of the
regulator (2.5 mA). For resistor R1,
use any value from 470 ohms to 1
kilo-ohm for best results. For vari-
able resistor R2, put any value
from the table given here for de-
sired voltage operation.
Fig. 3 shows the circuit of a 6V-
12V variable power supply using
a 5V regulator. The 220V AC mains
voltage is stepped down by trans-
Fig. 3: Circuit of variable power supply using a 5V regulator former X1 to 9 volts, rectified by

96 • NOVEMBER 2006 • ELECTRONICS FOR YOU WWW.EFYMAG.COM


CIRCUIT
IDEAS
the bridge rectifier comprising 1N4007 of current drawn and at least twice a mere 1 mV of ripple in the regu-
diodes D1 through D4, filtered by the input voltage. Wire the 270nF or lated output.
smoothing capacitors C1 and C2, and greater disk (ceramic) capacitor close Attach the 5-way rotary switch to
regulated by IC 7805 (IC1). Capacitors to the input terminal of the IC, and a resistors of different values to get the
C1 and C2 help to maintain a constant 10µF or greater electrolytic capacitor regulated output as shown in the table.
input to the regulator. across the output. The regulator ICs Or, you can use a 1-kilo-ohm potmeter
Capacitor C1 should be rated at a typically give 60 dB of ripple rejec- as a variable resistor to get the regu-
minimum of 1000 µF for each ampere tion, so 1V of input ripple appears as lated 5V-12V output. 

WWW.EFYMAG.COM ELECTRONICS FOR YOU • NOVEMBER 2006 • 97


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

VERSATILE POWER SUPPLY S.C. DW


IVEDI

„ SUNIL KUMAR tive regulator capable of providing sistor T1 is forward biased to switch
1.2V to 37 volts at 1.5A current to the resistors R1 and R2 (in series) across

U
sing this circuit, you can ob- load. Adj pin of LM317 and ground to pro-
tain the following voltages Resistor R13 and selected combi- duce 3.3V.
(approx.) at a current limited nations of resistors R1 through R12 Other voltages can be produced in
to one ampere: 3.3V, 5V, 6V, 9V, 12V are used to produce approximately the same way by using rotary switch
and 15V. 3.3V, 5V, 6V, 9V, 12V and 15V at the S1. Capacitor C2 bypasses any ripple
The AC mains is stepped down output. The desired resistors are se- in the output. Diode D5 is used as the
by transformer X1 to deliver the sec- lected by switching into conduction protection diode. Use a heat-sink for
ondary output of 18V AC at a maxi- one of the six pnp transistors T1 dissipation of heat from IC LM317. The
mum current of 1A dependant upon through T6 by grounding the corre- fuse-rated lamp provides protection
the load. The transformer output is sponding transistor base using rotary against short circuit.
rectified by the bridge rectifier com- switch S1. This 1A rated power supply can
prising diodes D1 through D4, filtered For example, to get regulated 3.3V, be used for testing of various circuit
by capacitor C1 and fed to regulator simply rotate the knob of rotary switch ideas as well as construction projects
IC LM317, which is a 3-terminal posi- to 3.3V position. Consequently, tran- published in EFY. z

84 • FEBRUARY 2006 • ELECTRONICS FOR YOU WWW.EFYMAG.COM

CMYK
CIRCUIT
IDEAS

VISUAL AC MAINS S.C. DW


IVEDI

VOLTAGE INDICATOR
 RAJ K. GORKHALI reaches 160 volts, LED2 glows when built around quad op-amp compara-
the voltage reaches 170 volts and so on. tors IC1 through IC3. The inverting in-

Y
ou should not be surprised if The number of LEDs that glow keeps put of all the comparators is fed with
someone tells you that the increasing with every additional 10 the unregulated DC voltage, which is
mains voltage fluctuation could volts. When the input voltage reaches proportional to mains input, whereas
be anywhere from 160 volts to 270 270 volts, all the LEDs glow. the non-inverting inputs are derived
volts. Although majority of our elec- The circuit basically comprises from regulated output of IC4 through
trical and electronics appliances have three LM339 comparators (IC1, IC2 a series network of precision resistors
some kind of voltage stabilisation in- and IC3) and a 12V regulator (IC4). It to serve as reference DC voltages.
ternally built-in, more than 90 per cent is powered by regulated 12V DC. For Resistors R13 to R25 are chosen
of the faults in these appliances occur power supply, mains 230V AC is such that the reference voltage at
due to these power fluctuations. stepped down to 15V AC by step- points 1 to 12 is 0.93V, 1.87V, 2.80V,
This simple test gadget gives vi- down transformer X1, rectified by a 3.73V, 4.67V, 5.60V, 6.53V, 7.46V,
sual indication of AC mains voltage bridge rectifier comprising diodes D1 8.40V, 9.33V, 10.27V and 11.20V, re-
from 160 volts to 270 volts in steps of through D4, filtered by capacitor C4 spectively. When the input voltage var-
10 volts. and regulated by IC4. The input ies from 160V AC to 270V AC, the DC
There are twelve LEDs numbered voltage of the regulator is also fed to voltage at the anode of ZD1 also var-
LED1 to LED12 to indicate the voltage the inverting inputs of gates N1 ies accordingly. With input voltage
level. For input AC mains voltage of through N12 for controlling the level varying from 160V to 270V, the out-
less than 160 volts, all the LEDs remain of the AC. put across filter capacitors C1 and C2
off. LED1 glows when the voltage The LED-based display circuit is varies from 14.3V to 24.1V approxi-

WWW.EFYMAG.COM ELECTRONICS FOR YOU • MAY 2006 • 89

CMYK
CIRCUIT
IDEAS
mately. Zener ZD1 is used to drop purpose PCB such that all the LEDs simply plug the gadget into the mains
fixed 12V and apply proportional volt- make a bargraph. In the bargraph, AC measuring point, press switch S1
ages to all comparator stages (invert- mark LED1 for minimum level of and observe the bargraph built around
ing pins). Whenever the voltage at the 160V, then LED2 for 170V and so on. LEDs. Let’s assume that LED1 through
non-inverting input of the compara- Finally, mark LED12 for maximum LED6 glow. The measured voltage in
tors goes high, the LED connected at level of 270V. this case is 220V. Similarly, if all the
the output glows. Now your test gadget is ready to LEDs glow, it means that the voltage
Assemble the circuit on a general- use. For measuring the AC voltage, is more than 270V. 

90 • MAY 2006 • ELECTRONICS FOR YOU WWW.EFYMAG.COM

CMYK
WATCH-DOG FOR TELEPHONES
M
ost of the telephone security an alarm in case of any misuse. In ad- cut off and the remaining circuit does
devices available in market dition it transmits a loud tone through not get any power supply. In this state,
are simple but quite expensive. the telephone lines to prevent further only a small (negligible) current is taken
These devices provide blinking or beeping misuse. by the circuit, which will not affect the
type line-tap/misuse indications. Quite When switch S1 is turned on, the telephone line condition. However, when
often they do not offer guaranteed pro- normal (on-hook) telephone line voltage handset of any telephone connected to
tection against unauthorised operation. at the output of bridge-rectifier diodes the telephone lines is lifted (off-hook),
A very simple and unique circuit of a D1 to D4 is approximately 48 volts, line voltage suddenly drops to about
telephone watch-dog to safeguard sub- which being well above the break-down 10 volts. As a result, transistor T2
scriber telephone lines against any fraud voltage of zener diode D5, the diode is switched off and transistor T1 gets
is described here. conducts. As a result transistor T2 gets forward biased via resistor R1. Now, the
This little circuit keeps continuous forward biased. This effectively grounds astable multivibrator built around timer
watch over the telephone lines and sounds the base of transistor T1 which is thus IC1 starts oscillating and the speaker
starts sounding. Output of
the astable multivibrator is
also connected to the base
of transistor T1 through ca-
pacitor C5. As a result, only
a loud (and irritating) tone
is heard in the ear-piece of
the unauthorised telephone
instrument.
This circuit can be con-
structed on a veroboard us-
ing easily available low-cost
components and it can be
connected to any telephone
line without the fear of mal-
functioning. No extra power
supply is required as it draws
power from the telephone line
for operation.
EFY Note: Please discon-
nect the gadget when you are
yourself using the telephone as
it cannot distinguish between
authorised and unauthorised
operation.

184 ELECTRONICS PROJECTS Vol. 19

You might also like