Вы находитесь на странице: 1из 200

Electronics Projects

Vol. 20
EFY Books & Publications
FOR YOU
EFY is a reputed information house, specialising in electronics and information technology
magazines. It also publishes directories and books on several topics. Its current publications are:

(A) CONSTRUCTION PROJECTS

1. Electronics Projects, Vol. 1: A compilation of selected construction projects and circuit ideas published in Electronics For You
magazines between 1979 and 1980.

2. Electronics Projects, Vol. 2 to 19: Yearly compilations (1981 to 1998) of interesting and useful construction projects and circuit
ideas published in Electronics For You.

3. Electronics Projects, Vol. 20 to 24 (with CD): Yearly compilations (1999 to 2003).


(B) OTHER BOOKS
1. Learn to Use Microprocessors (with floppy/CD): By K. Padmanabhan and S. Ananthi (fourth enlarged edition). An EFY
publication with floppy disk. Extremely useful for the study of 8-bit processors at minimum expense.
2. ABC of Amateur Radio and Citizen Band: Authored by Rajesh Verma, VU2RVM, it deals exhaustively with the subject—giv-
ing a lot of practical information, besides theory.
3. Batteries: By D.Venkatasubbiah. This publication describes the ins and outs of almost all types of batteries used in electronic
appliances.
4. Chip Talk: By Gp Capt (Retd) K. C. Bhasin. The book explains fundamentals of electronics and more than 40 fully tested elec-
tronic projects.
5. Modern Audio-Visual Systems Including MP4, HD-DVD and Blu-ray: Explains disk working principles, troubleshooting
and servicing by Gp Capt (Retd) K. C. Bhasin.
(C) DIRECTORIES
EFY Annual Guide (with CD): Includes Directory of Indian manufacturing and distributing units, Buyers’ Guide and Index of
Brand Names, plus lots of other useful information.
(D) MAGAZINES
1. Electronics For You (with CD): In regular publication since 1969, EFY is the natural choice for the entire electronics fraternity,
be it the businessmen, industry professionals or hobbyists. From microcontrollers to DVD players, from PCB designing software
to UPS systems, all are covered every month in EFY.
2. Linux For You (with CD and DVD): Asia’s first magazine on Linux. Completely dedicated to the Open Source community.
Regular columns by Open Source evangelists. With columns focused for newbies, power users and developers, LFY is religeously
read by IT implementers and CXOs every month.
3. Facts For You: A monthly magazine on business and economic affairs. It aims to update the top decision makers on key industry
trends through its regular assortment of Market Surveys and other important information.
4. BenefIT: A technology magazine for businessmen explaining how they can benefit from IT.
5. Electronics Bazaar: A monthly B2B magazine for sourcing electronics components, products and machineries. Ideal for buying
decision makers and influencers from electronics and non-electronics industry.

For retail orders: For magazine subscriptions: For bulk orders:


Kits‘n’Spares EFY Enterprises Pvt Ltd Paramount Book Agency
D-88/5, Okhla Industrial Area, D-87/1 Okhla Industrial Area, Phase-1 Arch No. 30 (West Approach) below
Phase-1, New Delhi 110020 New Delhi 110020 Mahalaxmi Bridge, Mumbai 400034
Phone: 26371661, 26371662 Phone: 26810601-03 Phone: (022) 40497401, 40497402,
E-mail: kits@efyindia.com Fax: (011) 26817563 40497474 Fax: 40497434
Website: www.kitsnspares.com E-mail: info@efyindia.com E-mail: circulations@ibhworld.com
ELECTRONICS
PROJECTS
VOL. 20

D-87/1 Okhla Industrial Area, Phase I,


New Delhi 110020
© EFY Enterprises Pvt Ltd.
First Published in this Edition, November 2004

All rights reserved. No part of this book may be reproduced in any


form without the written permission of the publishers.

ISBN 81-88152-15-3

Published by Ramesh Chopra for EFY Enterprises Pvt Ltd,


D-87/1, Okhla Industrial Area, Phase I, New Delhi 110020.
Typeset at EFY Enterprises Pvt Ltd and
Printed at Premier Printers, A-244, Okhla Industrial Area,
Phase I, New Delhi 110020
FOREWARD
This volume of Electronics Projects is the eighteenth in the series
published by EFY Enterprises Pvt Ltd. It is a compilation of 22
construction projects and 68 circuit ideas published in Electronics
For You magazine during 1999.

For the first time we are including a CD which contains datasheet of


major components used in construction projects as also many other
books, tutorials and goodies (specially for the Motorola MCU based
projects included in this volume). Hopefully the readers will benefit
from this add-on material. (Refer CD Contents Page)

In keeping with the past trend, all modifications, corrections and


additions, sent by the readers, have been included with each project,
along with the replies and amendments, if any, proposed/suggested
by the authors themselves. It is a sincere endeavour on our part to
make each project as error-free and comprehensive as possible. However,
responsibility cannot be taken if readers are unable to make a
circuit successfully, for whatever reason.

This collection of a large number of tested circuit ideas and


construction projects in a handy volume would provide all classes of
electronics enthusiasts—be they students, teachers, hobbyists or
professionals—with a valuable source of electronic circuits, which
can be fabricated using readily-available and reasonably-priced
components. These circuits could either be used independently or in
combination with other circuits, described in this and other volumes.
We are sure that this volume, like its predecessors, will generate
tremendous interest among its readers.
CONTENTS

Section A: Construction Projects

1. Digital I/O Add-On Card for PC XT/AT ................................................................... 3


2. Versatile FM Stereo Receiver .................................................................................... 7
3. Switchless Musical Calling Bell with Counter ......................................................... 13
4. CompuMultiMeter—A Computer Interfaced Multimeter ........................................ 16
5. Calling Number Identification System Using Calculator ......................................... 20
6. Transformer Polarity Tester ....................................................................................... 23
7. Programmable Versatile Timer .................................................................................. 25
8. Caller-ID Unit Using Micro-controller ..................................................................... 28
9. Mains Frequency Monitor ......................................................................................... 36
10. Party Game How Old Are You? ................................................................................ 38
11. Chip-Card Reader–Programmer Using IBM PC ....................................................... 41
12. Morse Encoder ........................................................................................................... 46
13. Long-Range Remote Control ..................................................................................... 49
14. Fast Charger for Inverter Batteries ............................................................................ 52
15. Z-80 Based Dedicated Programmer Cum Emulator .................................................. 55
16. 8098 Development Board .......................................................................................... 69
17. Remote-Controlled Audio Processor Using Microcontroller ................................... 81
18. Soujunior—A Wireless Programmable Control Unit ............................................... 89
19. 50Hz Sinewave Inverter Using MOSFETs ................................................................ 94
20. An 8085 Microprocessor Kit for Instructors ............................................................. 97
21. Multichannel Code Lock System ............................................................................... 105
22. Automatic Induction Motor Starter with Programmable Timer ............................... 108

Section B: Circuit Ideas

1. Telephone Line Vigilant ............................................................................................. 115


2. High and Low Voltage Cutout with Delay and Melody ............................................ 116
3. Running Message Display ......................................................................................... 117
4. Colour Sensor ............................................................................................................. 119
5. Low Current, High Voltage Power Supply ................................................................ 120
6. Audio-Visual Extra Ringer for Phone ....................................................................... 121
7. Handy Zener Diode Tester ......................................................................................... 121
8. Automatic Emergency Light ...................................................................................... 122
9. Automatic Room Power Control ............................................................................... 124
10. Telecom Headset ........................................................................................................ 125
11. Smart Phone Light ..................................................................................................... 126
12. Auto Reset Over/Under Voltage Cut-Out .................................................................. 127
13. Clap Remote ............................................................................................................... 128
14. Time Switch ............................................................................................................... 130
15. Water Level Indicator With Alarm ............................................................................ 132
16. IC Controlled Emergency Light with Charger .......................................................... 133
17. Wiper Speed Controller ............................................................................................. 134
18. CD-ROM Drive as Digital-Audio CD-Player ........................................................... 135
19. Automatic Dual-Output Display ................................................................................ 135
20. Miniature Strobe Light ............................................................................................... 136
21. Electronic Card-Lock System .................................................................................... 137
22. PC-Based 7-Segment Rolling Display ...................................................................... 139
23. Contactless AC Mains Voltage Detector ................................................................... 140
24. Frequency Measurements Using PC .......................................................................... 141
25. Telephone Number Display ....................................................................................... 142
26. Digital Switching System .......................................................................................... 144
27. 40-Metre Direct Conversion Receiver ....................................................................... 145
28. Precision 1Hz Clock Generator using Chip-on-Board .............................................. 146
29. Electronic Jam ............................................................................................................ 147
30. Tiny Dew Sensor ........................................................................................................ 148
31. Electronic Scoring Game ........................................................................................... 148
32. Simple Sensitive Remote Control Tester ................................................................... 149
33. Ultra Low Drop Linear Regulator ............................................................................. 150
34. Magnetic Proximity Switch ....................................................................................... 151
35. Simple Low-Cost Digital Code Lock ........................................................................ 151
36. Hand Proximity Musical Tone Generator .................................................................. 152
37. Wireless Musical Calling Bell ................................................................................... 153
38. Simple Telephone Privacy Circuit ............................................................................. 154
39. Bidirectional Code Converter .................................................................................... 154
40. Priority Indicator For Quiz Contests ......................................................................... 156
41. Dual-Channel Digital Volume Control ...................................................................... 157
42. Water Level Controller Cum Motor Protector ........................................................... 158
43. Under Voltage Cut-out and Delay for Refrigerators ................................................. 159
44. Infrared Cordless Headphone .................................................................................... 160
45. Stabiliser with Auto Cut-off Arrangement ................................................................ 161
46. Simple Analogue-to-digital Converter ...................................................................... 162
47. Sleep-switch cum Wake-up Timer ............................................................................. 163
48. Charge Monitor for 12V Rechargeable Lead-acid Battery ....................................... 164
49. Window/Fence Charger ............................................................................................. 165
50. Cordless Phone Backup ............................................................................................. 166
51. PC-based Dice Game ................................................................................................. 167
52. Teleremote Control .................................................................................................... 168
53. Display Dialed Telephone Number Using Calculator ............................................... 169
54. 8253 Programmable Interval Timer ........................................................................... 170
55. Low-cost Transistorised Intercom ............................................................................. 171
56. Automatically Controlled Street Lights..................................................................... 172
57. Timer for Students ..................................................................................................... 173
58. Protecting Three-phase Induction Motors ................................................................. 174
59. Radio Remote Control ............................................................................................... 174
60. Sequential Card Scanner ............................................................................................ 175
61. Divide-by-n Counter Using IC 7442 ......................................................................... 177
62. DTMF Remote Switching Board ............................................................................... 178
63. Electrical Equipment Control Using PC .................................................................... 179
64. Long-range FM Transmitter ...................................................................................... 181
65. Piezo Buzzer Finds Many Applications .................................................................... 182
66. Power Supply Circuits for Hams ............................................................................... 185
67. Cyclic On and Off Timer for Cooler Pump ............................................................... 186
68. Self-switching Power Supply .................................................................................... 187
SECTION A:
CONSTRUCTION PROJECTS
DIGITAL I/O ADD-ON CARD
FOR PC XT/AT
V. RAJARAMAN AND MOHAN INGLE

A
s you are aware, the PC has a the add-on card is given in Fig. 1. by it, and compared with the address set
motherboard on which the main by the resistors and the DIP switches on
CPU and the RAM/ROM memory the right side (in Fig. 1) of IC2.
chips are located. All other functionalities Description Here, we have specified an address of
like disk controllers, parallel and serial IC2 (74HCT688) is an 8-bit magnitude 300 hex, which is a vacant I/O address on
ports and the display adapter are located comparator. The address bus lines A2 the IBM PC. This address has been re-
on the add-on cards which plug into the through A9 are continuously monitored served by IBM for experimental work. If
expansion slots on the
motherboard. It is very
easy for anyone to as-
semble such a card. De-
sign of a general-purpose
add-on card for the PC,
which will be useful in a
number of applications
like EPROM program-
mer and copier, process
controller, logic monitor
etc, is presented here.
The good news is that it
takes only four ICs to ac-
complish this!
We will be designing
the card for the 8-bit PC
(PC-XT) bus, which is
the lowest common de-
nominator available. For
this you will need a PCB
edge connector with 62
pins which are arranged
as two rows of 31 pins
on each side of the ex-
pansion slot, named side
A and side B. Fig. 2
shows the signals avail-
able on its various pins.
The circuit is based
on IC 8255A, which is a
programmable digital I/
O (input/output) device
with three external 8-bit
ports. That means, you
get 24 general-purpose
input and/or output pins.
The circuit diagram of Fig. 1: Circuit diagram of digital input-output add-on card for PC

ELECTRONICS PROJECTS Vol. 20 3


Fig. 4: Actual-size solder-side track layout for the add-on card

Fig. 2: Signals present on 62-pin expansion slot


of an IBM PC XT/AT

you want to change this address, be sure


that no other device with the intended I/O
address exists on the PC, to avoid a clash.
The AEN signal is also involved in
the address
selection,
as can be
seen from
the connec- Fig. 5: Actual-size component-side track layout for the add-on card
tion to pin
No. 12 of ing DMA operations. When the two ad- lect signal to IC3 and IC4.
IC2. This is dresses (the one on the address bus of The bi-directional bus transceiver IC3
done in or- IBM PC as extended to left side of IC2 (74HCT245) connects the data bus of the
der to dis- and the other set with the help of DIP PC to the data lines of IC4 (8255A). The
Fig. 3: Connection diagram for able our switches on the right-hand side of IC2) direction in which data is transmitted is
testing of add-on card circuit dur- match, IC2 issues an active-low chip se- determined by the DIR pin No. 1 of the

4 ELECTRONICS PROJECTS Vol. 20


transceiver IC3. Note that this pin is con-
trolled by the active low READ signal.
This ensures proper direction of data flow.
IC 8255A is a versatile chip which
can be programmed in three modes. Mode
0 is a basic input-output mode. Modes 1
and 2 involve advanced I/O operations
with handshaking. The chip has three 8-
bit ports named A, B and C and a control
port (internal) which determines how the
chip is programmed.
The two pins marked A0 and A1 (pins
9 and 8 respectively) determine which of
these four ports are accessed. This is
why the two least significant address bits
of the PC bus are directly connected to
these pins. With our address assignment
of 300 (hex) as base address, the I/O ad-
dresses of these 4 ports will be as given
below:
The three 8-bit ports A, B and C toge-
ther with +5V and ground connection are
brought out on a 26-pin FRC type male
connector for external use.
Incidentally, this circuit does not need
an external power supply. Positive 5-volt
supply is readily available on pins B3 and Fig. 6: Component layout for add-on card PCB
B29 of the 62-pin PC edge connectors it-
self. This is to be connected to the Vcc pins PARTS LIST simultaneously and display them graphi-
of all the four ICs. Similarly, the ground cally on the PC screen.
Semiconductors:
pins of the four ICs are tied to the common The program LOGICMON.C written
IC1 - 74HCT08 quad 2-input AND
ground point of the PC edge connector gate in Turbo C can be used for this purpose.
(pins B1, B10 and B31). IC2 - 74HCT688 8-bit magnitude It draws 24 small boxes on the screen.
A proper actual-size double-sided PCB comparator The inside of the box will be dark if the
layout for the circuit of Fig. 2 is given in IC3 - 74HCT245 8-bit bidirectional corresponding port pin is logic 0, and it
bus driver will be bright to indicate logic 1 state at
Figs. 4 (solder-side) and 5 (component-
IC4 - 8255A programmable
side). The component layout for the PCB peripheral interface the pin.
is given in Fig 6. Ensure that there is no Connect the 24 pins (1 through 24) of
shorting between the power supply and Resistors (all ¼ watt, ± 5% carbon, unless the FRC connector to 24 points of the cir-
stated otherwise):
ground pins, and insert the card into a R1-R8 - 10-kilo-ohm SIP 9-pin resistor
cuit to be monitored. Please note that TTL
vacant expansion slot of the PC after as- network logic levels are expected at the points to
sembly. be monitored. For CMOS circuits, you may
Capacitors:
require suitable buffers.
C1-C4 - 0.1µF ceramic disc
Connect pin 26 to the digital ground
Test Procedure Miscellaneous: of the circuit under observation. Run the
S1 - Dip switch 8-section program. Now whenever there is a change
The easiest way to test the circuit is to
CON1 - 26-pin male FRC connector
connect 24 LEDs to the connector pins 1 in the logic level at any of the 24 points,
through 24 using 26-pin FRC female con- it will be immediately reflected in corre-
nector with ribbon cable and switch them running light effect on the LEDs. sponding box on the screen. Thus you have
on/off to check the proper working of the a 24-channel logic monitor.
individual bits. Connect the LEDs through
buffers (7406) as shown in Fig. 3. 5-volt
An Application
supply and ground connection for the buff- We will use the card as a logic monitor. In
Program
ers may be taken from pins 25 and 26 large digital circuits, there would be a The program first initialises the 8255 chip
respectively of the 26-pin FRC connector number of points whose logic levels have by sending the code 9B (hex) to the con-
itself. The program TEST.C produces a to be constantly monitored. This can be trol port. This sets up the chip to oper-
Address (hex) Port accessed done with the help of a logic probe, but ate in mode 0, with all the three 8-bit
300 Port A the probe has to be moved from point to ports acting as input ports. Of course, this
301 Port B point on the circuit, and only one point is only one of the several possible ways
302 Port C can be observed at a time. Our add-on in which this powerful chip can be used.
303 Control Port card can be used to monitor up to 24 points Freely experiment with other modes to

ELECTRONICS PROJECTS Vol. 20 5


PROGRAM LISTING OF TEST.C
/* TEST.C */ { for (i=1;i<0*101;i*=2)
/* produces running lights effect on int i, port; {
LEDs */ /*intialise */ outportb (port,i);
#define PORTA 0x300 outportb (CONTROL,0x80); delay (250);
#define PORTB 0x301 while (1) if(kbhit())exit (0);
#define PORTC 0x302 { }
#define CONTROL 0x303 for (port=PORTA; port <= }
main () PORTC;port++) }
PROGRAM LISTING OF LOGICMON.C
/* LOGICMON.C */ } /*_________________________________*/
/* 24 channel logic monitor program */ show_cursor (); void scan (int port, int row)
#include <dos.h> } {
#include <conio.h> /*_________________________________*/ int i;
#include <stdio.h> unsigned char mask =0x80;
#define PORTA 0x300 void initialize () unsigned char byte;
#define PORTB 0x301 { byte = inport (port);
#define PORTC 0x302 clrscr (); for (i=0; i<8; i++, mask>>=1)
#define CONTROL 0x303 gotoxy (14,7); putch (‘A’); {
draw_box (6); gotoxy (column [i], row);
void hide_cursor(); gotoxy (14,13);putch (‘B’); if (byte & mask)
void show_cursor(); draw_box(12); putch(219);
void initialize(); gotoxy (14,19); putch (‘C’); else
void draw_box(int row); draw_box (18); putch (32);
void scan (int port, int row); outport (CONTROL,0x9b); }
int column [] = {18,23,28,33,40,45,50,55}; } }
char box [3] [4]={ /*_________________________________*/ /*_________________________________*/
{0xda,0xc4,0xbf,0}, void draw_box (int row) void hide_cursor()
{0xb3,0x20,0xb3,0}, { {
{0xc0,0xc4,0xd9,0} int i,j; _AH = 1;
}; for (i=0; i<3; i++, row++) _CH = 8;
/*_________________________________*/ { _CL =8;
void main() gotoxy (17, row); geninterrupt (0x10);
{ for (j=0; j<8;j++) }
hide_cursor(); { /*_________________________________*/
initialize(); printf (“%s “,box [i]); void show_cursor()
while (!kbhit()) if (j==3) printf (“ “); {
{ } _AH = 1;
scan (PORTA, 7); } _CH = 6;
scan (PORTB, 13); } _CL = 7;
scan (PORTC, 19); geninterrupt (0x10);
}

realise its full potential. is at logic 0 or 1 state, and switches on or position to the next across the screen, it
After initalisation, the program scans off the corresponding indicator on the causes distraction. Hence the cursor is
the three ports repeatedly in a loop. It screen. disabled during the execution of the
separates each bit, tests whether the bit As the cursor rapidly moves from one program. ❑

6 ELECTRONICS PROJECTS Vol. 20


VERSATILE FM STEREO
RECEIVER
VIDYUT SARKAR

F
M broadcast in India has gained 2. Auto-noise-mute (including inter- receiver comprising various sub-sections
much popularity and AIR (All In- station noise mute) and stop-station func- is shown in Fig. 1. Brief description of
dia Radio) is now using FM chan- tions. the circuits within each block are given
nels for Vividh Bharti programmes also. 3. LED indicators are provided for below with reference to the circuit dia-
Although the quality of FM transmission indication of the following conditions: gram of the complete system shown in
is quite good and stereophonic, several (a) FM fine tunning Fig. 2.
listeners often complain that their receiv- (b) Stereo decoder and amplifier sec- FM receiver: This sub-circuit is based
ers, including imported ones, produce quite tion power-on on the popular Sony single-chip radio IC
a bit of noise (hiss and shrill). Indian mar- (c) Stereo signal presence. CXA1019S (30-pin DIL). The IC is de-
ket is flooded with such FM receivers, Apart from its primary function as a signed for economy receivers for FM and
which though labeled as stereos, are not quality FM stereo receiver and amplifier, AM radio as well as TV applications. But
really so. Their output power is so low the circuit or its sections can also be used in the present circuit this IC has been
that the stereophonic effect cannot be pro- for the following applications: wired for FM reception only.
duced. 1. Burglar alarm having a long opera- This IC also includes a tuning meter/
Presented here is a versatile FM tional range LED driver circuit for fine tuning indica-
stereo receiver circuit which overcomes 2. Cordless FM intercom tion. This meter/LED driver output is
the above-mentioned drawbacks. Its sali- 3. Cordless call bell available at pin 20. Here this output is
ent features are: 4. Remote switch. also coupled to the auto-power on/off sec-
1. Stereo reception and its faithful re- tion.
production with reasonably high output The audio output available at pin 24
power for obtaining proper stereophonic
Description of this IC (marked as point A) is con-
effect. A functional block diagram of the stereo nected to the input of stereo decoder IC
(pin 2) for further processing.
Auto power on/off: This
section comprises a pnp tran-
sistor AC188 (T1) and three
npn transistors BD139 (T2, T3
and T4). Each of the transis-
tors T2, T3 and T4 is employed
for switching on power supply
(by completion of ground return
path) to: (a) relay driver and
buzzer section, (b) stereo de-
coder, preamplifier and power
amplifier circuit built around
IC6, and (c) power amplifier
circuit built around IC5, respec-
tively. Transistor T1 controls
the base drive to transistors T2,
T3 and T4 while conduction of
transistor T1 itself is control-
led by the output at pin 20 (me-
ter/LED driver) of IC1.
Whenever the FM receiver
Fig. 1: Functional block diagram of versatile FM stereo receiver is tuned to any FM transmitter

ELECTRONICS PROJECTS Vol. 20 7


PARTS LIST core former preamplifier based on the popular IC
Semiconductors: L2 - 4 turns | using 22SWG LA3161 has been used after the decoder
IC1 - LM7805 3-terminal enamelled copper wire
L3 - 5 turns |
stage. However, outputs provided by the
positive voltage
regulator CF1 - 10.7 MHz ceramic decoder IC can be used to directly drive
IC2 - CXA1019S Sony single- resonator low-power audio amplifiers.
chip FM/AM receiver CF2 - 10.7 MHz ceramic filter Audio power amplifier: In this cir-
IC3 - TEA1330 FM stereo - Heat sinks for T3, T4 ,
decoder IC5 and IC6 cuit two popular rugged TDA2002A ICs
IC4 - LA3161 2-channel low - 12V DC power supply are used. This IC is a class B audio power
noise preamplifier enclosure, speakers, amplifier IC capable of driving low-im-
IC5,IC6 - TDA 2002A audio power - FM mike or FM
amplifier transmitter. pedance loads (up to 1.6 ohms). It can
T1 - AC188 pnp transistor pump 10 watts of power at 12V supply
T2-T4 - BD139 npn power into a 4-ohm impedance loudspeaker. The
transistor within its range, LED1 starts glowing (i.e. output is quite adequate for all domestic
LED1-LED3 - Coloured LED
Z1-Z2 - 3V zener diode pin 20 goes to ground level). This in turn purposes.
D1 - 1N4001 rectifier diode switches on transistor T1 (AC188), mak- Optional functions/features: This
Resistors (all ¼ watt, ±5% metal/carbon ing LED2 to glow (after proper adjust- versatile receiver can perform following
film, unless stated otherwise): ment of preset VR1). Transistor T1 can optional functions:
R1 - 150-ohm further switch on the other three transis- 1. Long range remote switch. For this,
R2, R3 - 330-ohm
R4 - 680-ohm
tors T2, T3 and T4, depending on the po- switch off all switches except S3. Take an
R5 - 33-ohm, ½ watt sition of slide switches S1 through S4. FM transmitter or an FM mike. Switch it
R6 - 1.2 kilo-ohm Since, except IC1 and IC2, all other on. Rotate the gang capacitor and tune
R7,R8,R12,R13 parts of the circuit are powered through the receiver to the transmitter frequency.
R19, R20, R26 - 1 kilo-ohm
R9 - 100-ohm these three transistors, these receive On proper tuning, LED1 will start glow-
R10 - 15 kilo-ohm power only when LED2 is glowing (i.e. ing, and so also LED2.
R11, R16 - 100-ohm, ½ watt FM transmitter is on). Thus, whenever Now this pair (FM mike/transmitter
R28, R29 - 22 kilo-ohm
R14,R15,R17 the transmitter is on, the audio amplifier and the receiver) is ready to be used as a
R18 - 10 kilo-ohm is switched on automatically and the same remote switch. Any electrically powered
R21, R22 - 2.2-ohm is indicated by glowing of LEDs 1 and 2. appliance can be turned on and off via
R23, R30 - 220-ohm Stop-station and inter-station
R24, R25 - 1-ohm
relay RL1 by turning the transmitter (FM
R27 - 8.2k noise mute functions: When the FM mike) on and off.
R31, R32 - 3.9 kilo-ohm transmitter at the radio station is off (or 2. Long range cordless call bell. Switch
R33 - 100 kilo-ohm the FM mike is switched off, i.e. modula- off all the switches except switch S4. Ad-
Capacitors: tion of the carrier is absent), LED1 stops just transmitter-receiver pair as men-
C1 - 2200 µF, 25V electrolytic glowing. Thus transistor T1 is cut off, tioned earlier.
C2, C11, C15, C26
C27, C38, C40 - 0.1µF, ceramic disc which in turn cuts off transistors T2, T3 Now this receiver and FM mike (trans-
C3 - 3.3µF, 16V electrolytic and T4. As a result, in the absence of mitter) pair can be used as a cordless call
C4 - 3pF ceramic disc frequency modulated input signal, the re- bell. When mike is on, the buzzer will
C5, C33, C36 - 0.001µF ceramic disc
C6 - 22pF ceramic disc
ceiver mutes itself, reducing the supply sound.
C7, C8, C24 current to only a few milliamperes. The 3. Cordless intercom or walkie-talkie.
C25, C47 - 0.02µF ceramic disc same happens when the receiver is tuned Two such receivers and a pair of FM
C9 - 47µF, 25V electrolytic from one station to another (frequency). mikes (or transmitters) can be used as an
C10 - 0.01µF ceramic disc
C12, C13, C28 Consequently, this receiver never pro- intercom set or a walkie-talkie. As it is
C29 - 100µF, 16V electrolytic duces the characteristic shrill sound as fairly easy to construct an FM transmit-
C14, C16, C43 - 10µF, 25V electrolytic produced by other FM receivers. This fea- ter providing a good range (several
C17, C30, C31 - 1µF, 25V electrolytic
C18 - 680pF ceramic disc ture enhances the FM receiver’s compat- kilometers), the performance of this re-
C19, C35, C45 ibility for use as an intercom, long-range mote switch would be far better than any
C46 - 10µF, 16V electrolytic remote-switch, call bell and burglar alarm similar device working on IR pulses.
C20 - 100µF, 25V electrolytic etc. Functions of various LEDs and
C21 - 0.047µF ceramic disc
C22 - 0.22µF ceramic disc Stereo decoder: In ordinary FM ra- switches are summarised in Tables I and
C23 - 0.47µF ceramic disc dio receivers, output from FM receiver II respectively. An actual-size single-sided
C32, C39, C41 IC is directly fed to audio amplifiers of PCB layout for the circuit of Fig. 2 is
C42 - 1000µF, 25V electrolytic
C34, C37 - 470µF, 10V electrolytic the stereo. Thus real stereophonic effect shown in Fig. 3 and its components lay-
C44 - 470µF, 25V electrolytic is not produced as the same input is fed out is shown in Fig. 4.
Miscellaneous to both the channels without any phase
RL1 - 12V, 200-ohm, SPDT
relay
control. Construction and
- 2X gang But in this receiver, FM stereo de-
VC1, VC2 - Trimmers 0-22pF coder IC TEA1330 (IC3) is used for stereo
Adjustments
BZ1 - 12V buzzer reproduction from the aural signals. LED3 1. First construct the circuit around IC1
S1-S4 - On/off miniature slide
switches glows only when the receiver receives and IC2 (up to top first dotted line in Fig.
L1 - 3 turns | All coils are stereophonic signals. 2) only. Then switch on the power supply.
hand wound on 3mm air Preamplifier: A low-gain Adjust trimmers VC1 and VC2 to their

8 ELECTRONICS PROJECTS Vol. 20


zero positions. Now
rotate the gang ca-
pacitor to the near-
est FM broadcast sta-
tion (or use an FM
cordless mike if an
FM station is not
available). If it has
been tuned properly
and everything has
gone right, LED1 will
glow; otherwise
recheck the circuit.
Now adjust VC1 and
VC2 for maximum
brightness of LED1
and feed the audio
output provided by
this IC to any work-
ing audio amplifier
(output available at
pin No. 24 of IC1,
marked as point A).
Speak into the FM
mike; you should be
able to hear your
voice from the
speaker.
2. Construction of
the coils L1-L3 is
quite easy. Take any
3mm round rod. Use
22SWG enamelled
copper wire. Wind
closely three turns on
the rod and slip the
coil out from the rod.
Use it as coil L1. For
coil L2, wind four
slightly spaced turns
on the same rod and
slip it out. Similarly,
for coil L3, wind five
close turns with the
Fig. 2: Circuit diagram of versatile FM stereo receiver

help of the same rod.


3. After success-
ful completion of step
1 and fabrication of
the coils as per step
2, assemble all the
four transistors and
other components up
to second dotted line
(on the upper part of
the circuit), tune the
receiver to your FM
mike’s frequency till
LED1 starts glow-
ing. Then adjust pre-
set VR1 so that
LED2 glows. Now

ELECTRONICS PROJECTS Vol. 20 9


out for each
channel sepa-
rately by
switching the
speaker of the
other channel
off.
Switches S1
and S2 can be
used for con-
verting the re-
ceiver into a
mono. This fea-
ture will be use-
ful when the cir-
cuit is powered
through a bat-
tery and you
want to con-
serve its energy,
or when it is
Fig. 3: Actual-size single-sided PCB for the circuit in Fig. 2. used as an inter-
switch off the FM mike. LED2 must stop VR3. This decoder IC provides a stereo com. When the receiver is used as a re-
glowing; otherwise again adjust VR1. output which can be directly fed to a low- mote switch or cordless bell, both switches
LED2 must glow when the mike is on and power audio amplifier.
must not glow when it is off. Now If only 5. Now construct the remaining part TABLE I
S4 is closed, receiver will work as a re- of the circuit. With that the construction LED Indication
mote switch which can turn any appli- of the receiver would be complete. LED1 Fine tuning
ance on or off via the relay when the mike Potmeters VR4 and VR5 should be ad- LED2 Power on
is turned on or off. justed for minimum distortion. For this, LED3 Stereo signal available
4. After successful completion of step 3, keep the volume of the
TABLE II
construct the circuit around decoder IC audio amplifier at
TDA1330 (up to the first dotted line of the maximum and adjust Switch Positions Mode of Operation Output Function
bottom part of the circuit in Fig. 2). Now potmeters VR4 and Only S3 ON Remote switch Relay ON
tune the receiver to any FM radio station VR5 till undistorted Only S4 ON Cordless bell Buzzer sounds
Only S1 ON Mono receiver, mono Sound from speaker
transmitting stereo FM signals. If every- sound is delivered by cordless FM intercom LS1
thing has gone alright, LED3 should glow, the speakers. Adjust- Only S1 & S2 Stereo receiver, stereo Sound from both
subject to a proper adjustment of preset ment must be carried ON cordless FM intercom speakers LS1-LS2

S1 and S2 must
be kept open
(off).

Power
Supply
For excel-
lent results,
properly filtered
and regulated
12V DC power
supply is re-
quired. The
maximum cur-
rent cons-
umption (when
all switches are
on and volume
is maximum)
Fig. 4: Components layout for the PCB in Fig. 3. will not exceed

10 ELECTRONICS PROJECTS Vol. 20


2A. Minimum current consumption (when ceiver kit based on IC CXA10193 is appropriately.
th- ere is no input signal) is only a few available in the market, the same can be 2. For remote switch and cordless bell,
milliamperes, which makes it ideal for call used in this project. In that case, omit only upper part of the circuit needs to be
bell and intercom applications. corresponding part of the circuit. How- assembled.
Notes: 1. Since readymade FM re- ever, don’t forget to add an FM gang (2X)

Readers Comments: CXA1019S?


❏ This construction project looks perfect 4(b) I am interested
for stereo reception, but I have an FM kit in adding AM radio re-
based on Philips TEA5591 FM/AM IC ception in the same cir-
which has only one output. Hence, I would cuit, with FM stereo re-
like to use the remaining part of your ception. Kindly suggest
circuit for developing the stereo receiver. the modifications needed
I have the following queries: and provide modified
1. Can your FM stereo decoder IC PCB design for it.
TEA1330 be used with my circuit? If yes, Jaipal Singh
how? New Delhi
2. There is no tuning indicator in the The author Vidyut
Philips IC. So, how can I use the facility Sarkar replies:
of auto power off/on, mute functions, etc? I thank all readers for
3. What is FM 2X gang? Only a trim- their keen interest in my
mer has been provided in the kit. circuit. Replies to letters
Ruhil Dhawan from various readers are
Meerut given below:
❏ I have added one LED driver circuit Mr Dhawan can use
to pin no. 20 of CXA1019S IC and changed decoder IC TEA1330
the gang with FM 2X. On fine tuning, with Philips FM/AM re-
LED1 glows properly and the audio is also ceiver kit based on
good for both FM and AM. TEA5591. For this, he Fig. 1: Pin configuration of Sony CXA1019S IC
I have further assembled the circuit should feed the audio
around IC TEA1330. The output is given output from IC TEA5591
to AF amplifier (TBA 810) directly for test- to the input of decoder IC
ing. LED2 does not glow at all. Even the TEA1330.
input reception is stereo. I tried by ad- Auto power on/off and
justing preset VR3 but LED2 does not noise-mute facilities can-
glow. not be exploited easily
R. Rajesh while using IC 5591 as it
Chennai has no tuning indicator.
❏ I request the author to clarify the fol- There are two trim-
lowing points: mers in the actual kit.
How can I introduce automatic gain con- Therefore one can avoid
trol (AGC) in the same circuit for better FM 2X gang, but it will
and stable FM reception? be difficult to tune from
Vijay K. Yadav one frequency to another. Fig. 2: Pin configuration for TEA1330/KA2261
Raipur For simplicity and
❏ While constructing the FM receiver, I clarity in sound reproduction, I have may not be working properly.
came across the following difficulties: avoided AM section. To incorporate this Please note that LED3 (stereo indica-
1. I could not find FM stereo decoder part, some more components and addi- tor) will glow only when there is strong
IC TEA1330 in the market. Is there any tional tracks are needed on the PCB. stereo signal. In case of weak stereo sig-
substitute which is easily available? Regarding Mr Rajesh’s letter: Please nals, it may not glow but the stereo out-
Where can I obtain TEA1330 from? check the frequency at pin 12 of IC3 by a put will still be available.
2. What is the role of presets VR2 and frequency-meter and set the frequency to I do not suggest Mr Yadav to add ex-
VR3 in FM stereo decoder section? 19 kHz by trimming VR3 (4.7k pot.). tra circuit for AGC in this unit as output
3. What is 19kHz check (pin no. 12) The values of components R10, VR3 provided by CXA1019S is stable to a large
and VCO (pin no. 9) in TEA1330? and C18 collectively determine the fre- extent. Also, for better stability, he may
4(a) In an earlier issue of EFY, an FM quency constant of the oscillator section of select some other IC like KA22426 which,
receiver circuit based on TEA 5591A was IC3. Hence these are not critical. You may though, may be difficult to procure.
published. Kindly let me know whether it take some different values like R10=10k, Regarding Mr Jaipal’s letter:
can be used in place of CXA1019S-based C18=680pF etc. 1. Yes, TEA1330 can be substituted
kit, and whether output of TEA5591A can If the decoder still does not work, re- by KA2261. However, if audio output sup-
be fed to TEA1330 as shown in case of place it (TEA1330) with a new IC, as it plied by this IC contains noise, then he

ELECTRONICS PROJECTS Vol. 20 11


may think of replacing C22 by 1µF ca- trolled oscillator, and the function of pin discuss these here. However, the pin dia-
pacitor in the low-pass filter section. 12 has been mentioned above. grams of IC CXA1019S and TEA1330/
2. Preset VR2 has been used to select I have omitted AM/SW/TV reception KA2261 are given in Figs 1 and 2 respec-
the phase angle between the channels of part of this IC for simplicity and better tively.
stereo output for stereophonic effect. The reception of FM part. As regards the components for the
separation angle between the two chan- 4 (a) Yes, one can use the output of project, the same are easily available in
nels must be less than 90 degrees. This can TEA5591A. Also, one can use any other the local market and can also be pro-
be obtained by setting VR2 around 200 FM radio IC in place of CXA1019S. cured from some leading vendors who
ohms. 4 (b) Using a few additional compo- are supplying components specially to
Preset VR3 is used to set the frequency nents, one may add AM reception capa- electronic hobbyists. 2Xgang refers to a
of the oscillator section at 76 kHz. bility as well. But only FM section is sug- two-section variable capacitor with air/
3. After two successive divisions, this gested for better results. polyster insulation. Please consult EFY
appears at pin 12 as 19 kHz. Using this EFY: Some readers have asked for com- magazines where addresses of such
frequency, the phase comparator of this plete circuit details for AM/SW/TV recep- dealers are published regularly through
decoder IC decodes the information. tion. These can only be accomodated in a advertisements.
The term VCO stands for voltage con- separate article, and it is not possible to ❑

12 ELECTRONICS PROJECTS Vol. 20


SWITCHLESS MUSICAL
CALLING BELL WITH COUNTER
PRADEEP G.

T
he switchless automatic calling transmitter module uses IC 555 as astable PARTS LIST
bell system described here can be multivibrator operating at a frequency of Semiconductors:
fabricated using low-cost and eas- around 1 kHz. A pnp transistor (SK100 IC1, IC3 - NE555 timer
IC2 - CIC4822/WE4822 melody
ily available com- generator
ponents. This IC4-IC5 - CD4033 decade counter
project uses in- IC6 - 7809 9-volt regulator
IC7 - 7806 6-volt regulator
frared transmit- T1 - SK100 pnp transistor
ter and receiver T2 - 2N5777 IR photo transistor
T3,T4 - BC549C npn transistor
modules which T5 - BC558 pnp transistor
are fitted face to T6,T7 - BC548 npn transistor
face on both sides T8 - SL100 npn transistor
D1,D2 - IRED
of front entry D3,D4 - IN4148 switching diode
door or corridor of D5 - 3.6V, 0.5W zener
D6,D7 - 1N4001 rectifier diode
the premises.
When a visi- Resistors (all ¼ W, ± 5% carbon, unless
stated otherwise):
tor enters the R1 - 150 kilo-ohm
house, infrared R2,R16 - 1.5 kilo-ohm
R3,R4 - 56 ohm
beam between IR R5 - 4.7 ohm
emitter and IR Fig. 1: Overall view of the switchless calling bell system R6,R14 - 4.7 kilo-ohm
detector is inter- R7 - 470 kilo-ohm
R8 - 3.3 kilo-ohm
rupted for a moment. This results in a R9 - 2.2 kilo-ohm
specific musical tune being played and R10 - 2.7 kilo-ohm
R11 - 470 ohm
a display, indicating the number of R12,R23,R24 - 100 kilo-ohm
visitors entering the house, advances R24,R26
by one. When the next visitor enters R13 - 100 ohm
R15 - 22 kilo-ohm
the house, a different musical tune is R17,R18 - 1 kilo-ohm
heard. In this way, up to 16 different R19 - 82 kilo-ohm
R20 - 470 ohms
musical tunes will be played on suc- R21 - 10 kilo-ohm
cessive entry of the visitors. After that R22 - 220 kilo-ohm
the musical tunes are repeated. Capacitors:
Maximum count of display is 99. C1 - 10µF, 16V electrolytic
C2,C9,C4,C16 - 0.01µF ceramic disc
After displaying 99, counter is Fig. 2: IR transmitter C3,C7,C8,
automatically reset to zero and starts C18,C19,C20 - 0.1µF ceramic disc
counting again. Fig. 1 gives the overall or BD140) is used in IRED (infrared emit- C5,C14 - 47pF ceramic disc
C6 - 100µF, 16V electrolytic
view of the system. ter diode) driver stage at the output. This C10 - 2.2µF,16V electrolytic
transmitter module emits modulated C11 - 2.2nF ceramic disc
C12 - 0.04µF ceramic disc
infrared light. Two IREDs are connected
Description in series for more range and wider
C13
C15
-
-
10µF,16V electrolytic
4.7µF,16V electrolytic
The circuit comprises the following parts: directivity. The module can transmit IR C17 - 1000µF, 25V electrolytic
1. IR transmitter rays up to 4 metres without use of any Miscellaneous:
DIS 1, DIS 2 - LT543 common-cathode
2. IR receiver external lens. display
3. Melody generator IR receiver circuit (Fig. 3): IR re- RL1 - 6V, 100-ohm DPDT relay
4. Counter with display ceiver module is fully transistorised. It LS - Speaker, 8-ohm, 0.5W
X1 - 230V AC primary to 12V-0-
5. Power supply. has a tone signal amplifier, a switching 12V,500 mA sec transformer
IR transmitter (Fig. 2): Infrared circuit and relay driver to switch on mu- - PCB, switches, IC sockets

ELECTRONICS PROJECTS Vol. 20 13


off of transistors T5 as well as
T6. As a result relay driver tran-
sistor T7 gets forward biased via
resistor R16 and diode D3. The
relay is thus energised and it
causes application of trigger
pulses to both the musical bell
circuit and the counter, via its
N/O contacts.
A short duration switching
pulse is sufficient to trigger both
the bell and counter. Once a
trigger pulse is applied to musical
bell, it starts playing a tune and
it will stop only on completion of
the specific tune. After that it will
Fig. 3: IR receiver
reset automatically and be ready
tive half cycles for the next trigger/tune. Counter, mean-
of tone signals while, advances by one.
forward bias Melody generator (Fig. 4): If
transistor T5. CIC4822 or WE4822 IC is used, 16 differ-
Because of ent musical tunes can be generated. A
presence of ca- particular tune/melody can be selected by
pacitor C10 using two-way switch as shown in the
(2.2µF), tran- diagram.
sistor T6 con- If UM3482 IC is used, 12 different
tinuously con- tunes can be heard. A number of options
ducts during can be programmed with the help of pins
the period provided for the purpose. For details one
when signals may refer to the data sheets of these ICs.
from trans- Maximum safe voltage for the melody
Fig. 4: Melody generator circuit generator IC is 5
volts. A 3.6V zener
diode is used to
limit/provide
stable 3.6-volt
supply to the
melody IC.
Two-digit
counter module
(Fig. 5): Two-digit
counter module
comprises three
ICs and two com-
mon-cathode dis-
plays. The first IC
(IC3) is a 555 timer
which is wired as
monostable
multivibrator.
Time period of
monostable has
Fig. 5: Counter with display
been set for about
one second. The
sical bell and counter via the contacts of a mitter are being received. When transis- next two are CMOS decade counter
DPDT relay. tor T6 conducts, transistor T7 is cut-off CD4033 ICs, which are cascaded to drive
When signals from transmitter are re- and relay remains de-energised. the common-cathode displays directly. If
ceived by IR photo-transistor, Amplified When IR beam is interrupted for a desired, a 330-ohm resistors can be con-
AC output is obtained from the collector of moment, due to passage of a visitor, no nected to each segment output from IC
transistor T4. These amplified signals are amplified AC signals are available at base pins before connection to the displays.
used to bias pnp transistor T5. Only nega- of transistor T5. This results in cutting- Pin 2 of IC 555 is connected to one of

14 ELECTRONICS PROJECTS Vol. 20


the poles of relay contacts. Other termi-
nal (N/O) of relay contact is connected to
ground. When relay is activated for a
moment, pin 2 of IC 555 is shorted to
ground. As a result IC 555 gets triggered
and applies clock pulse to counter input.
For each clock pulse, the counter advances
by one count. The count can go up to 99
(max. count). After that, the counter resets
to zero and starts counting again. S2 is
Fig. 6: Power supply circuit manual push-to-on reset switch. By
pushing it one can reset counter at any
instant.
Power supply (Fig. 6): Power sup-
ply for the complete unit can be de-
rived from the mains using a step-down
transformer of 230V AC primary to
12V-0-12V, 500mA secondary. A full-
wave rectifier followed by a capacitor
filters the output voltage and feeds the
following 9-volt regulator whose output
is used to cater to the power supply
requirement of IR receiver, melody gen-
erator and counter modules. It is also
used to provide input to a 6-volt regu-
lator IC used for feeding the transmit-
ter circuit.
An actual-size single-sided PCB
Fig. 7: Actual-size single-sided PCB layout for the circuits in Figs 2 through 6 comprising circuits shown in Figs. 2
through 6 is given in Fig. 7 while its
component layout is given in Fig. 8.
PCB for the transmitter (Fig. 2) can be
cut out from the integrated PCB.
Use sockets for both CD4033 ICs.
Don’t try to solder CMOS ICs directly on
PCB. A 2-core cable may be used to
connect the IR transmitter module while
a 3-core cable will be necessary for IR
receiver module as shown in Fig. 1.
Power supply, musical bell with
speaker, relay and counter modules
may be fitted inside the main cabinet.
Both IREDs and photo transistor are
fitted suitably on transmitter and IR
receiver/amplifier modules as shown in
Fig. 1 and properly aligned after
Fig. 8: Component layout for the PCB assembly. ❑

ELECTRONICS PROJECTS Vol. 20 15


COMPUMULTIMETER—
A COMPUTER INTERFACED
MULTIMETER
N.V. VENKATARAYALU

L
inking an electronic project with urement
computer is a real fun, and this o f
project is one such thing. The unknown
project can be used to measure resistance resistor or
(100 ohms – 100 k ohms), capacitance capacitor,
(0.001µF – 100µF) and voltage (1.25V – switch S4
5V) by interfacing your personal compu- is kept in
ter to the simple circuit presented here. the posi-
t i o n
shown in
Description Fig. 1.
The circuit consists of a 555 timer operat- During
ing in the astable mode. This timer gen- measure-
erates square wave output at a frequency ment of
dependent on the values of external tim- unknown
ing components like Ra, Rb and C (see voltage be-
Fig. 1). Hence, the output frequency is tween the
indirectly a measure of the values of these above-
external components. mentioned
The output of this circuit is fed to the limits,
parallel port of the computer. The switch S4
frequency of the output pulses is measured is to be
by the software part of the project. From flipped to Fig. 1: Schematic circuit diagram of CompuMultimeter
this measured frequency, the value of the the other
unknown component is calculated using side. ponents that can be measured are dis-
the formula: played on the monitor’s screen.
Frequency f = 1.44 / (Ra+2Rb)C Before selecting a suitable range, ap-
However, from this formula only re-
Software propriate external components (shown in
sistance or capacitance can be measured. The software enables com-
To measure voltage (between the limits munication between the exter- TABLE I
1.25V and 5.00V (Vcc)), the 555 timer is nal circuit and the computer. Unknown Ra C Frequency Duty Cycle
used as a voltage controlled oscillator The codes have been written and Resistance
Range
(VCO) or a voltage–to-frequency converter. compiled in ‘C’. The software is
100 ohm 1k 10µF 120 Hz – 48 Hz 91% - 66%
The voltage at pin 5 (control) of the timer a user-friendly one with GUI
1k -10k 1k 10µF 48 Hz – 6.82 Hz 66% - 52%
varies the frequency of the timer. Thus (graphics user interface). 10k-100k 10k 1µF 48 Hz – 6.82 Hz 66% - 52%
by calibrating the frequency with some First of all the
known values of voltages at pin 5 of the mode of operation, TABLE II
IC, unknown voltages can be found by i.e. resistance or ca- Unknown Cap. Range Ra Rb Freq. Range Duty Cycle
applying them across pin 5 and ground. pacitance or voltage
0.001µF – 0.01µF 1M 1M 481 Hz – 48.1 Hz 66%
Suitable known standard values of Ra, measurement, is 0.01µF – 0.1µF 100k 100K 481 Hz – 48.1 Hz 66%
Rb and C are selected with the help of selected interac- 0.1µF – 1µF 10k 10K 481 Hz – 48.1 Hz 66%
rotary switches S1, S2 and S3 respectively, tively. The range of 1µF – 10µF 1k 1K 481 Hz – 48.1 Hz 66%
as described later in the text. During meas- values of the com- 10µF – 100µF 100 100 Ohm 481 Hz – 48.1 Hz 66%

16 ELECTRONICS PROJECTS Vol. 20


Software Program
/*** CompuMultiMeter by N.V.Venkatarayalu line(475,320,475,345); outtextxy(40,215,”1. 100 Ohm - 1 KOhm (Ra=1
***/ line(475,345,460,345); KOhm ,C=10uF )”);
#include <graphics.h> line(460,335,460,355); outtextxy(40,230,”2. 1 KOhm - 10 KOhms (Ra=1
#include <time.h> arc(440,345,320,40,15); KOhm ,C=10uF )”);
#include <conio.h> line(453,345,425,345); outtextxy(40,245,”3. 10 KOhms - 100 KOhms
#include <math.h> line(350,365,550,365); (Ra=10 KOhms ,C=1uF)”);
#include <string.h> line(520,205,560,205); select=getch()-’0';
line(520,255,560,255); }
void initscreen(void); circle(555,365,5); if(mode==1){
void evaluate(void); circle(565,205,5); outtextxy(35,185,” Select the range of the
int mode; circle(565,255,5); Unknown Capacitor”);
outtextxy(45,215,”1. 0.001 uF - 0.01 uF (Ra=Rb=1
void main(void) settextstyle(TRIPLEX_SCR_FONT,HORIZ_DIR,4); MOhm )”);
{ outtextxy(430,200,”555"); outtextxy(45,230,”2. 0.01 uF - 0.1 uF
initscreen(); settextstyle(TRIPLEX_SCR_FONT,HORIZ_DIR,1); (Ra=Rb=100 KOhms)”);
evaluate(); outtextxy(405,180,”7"); outtextxy(45,245,”3. 0.1 uF - 1 uF (Ra=Rb=10
closegraph(); outtextxy(405,220,”6"); KOhms )”);
return ; outtextxy(405,260,”2"); outtextxy(45,260,”4. 1 uF - 10 uF (Ra=Rb=1
} outtextxy(460,150,”8"); KOhm )”);
outtextxy(420,295,”1"); outtextxy(45,275,”5. 10 uF - 100 uF
void initscreen(){ outtextxy(470,295,”5"); (Ra=Rb=100 Ohms )”);
int gd=DETECT,gm; outtextxy(505,195,”4"); select=getch()-’0';
initgraph(&gd,&gm,” “ ); outtextxy(505,245,”3");
outp(0x378,0); outtextxy(320,145,”Ra”); }
setfillstyle(SOLID_FILL,EGA_CYAN); outtextxy(320,205,”Rb”); setfillstyle(SOLID_FILL,EGA_CYAN);
bar(10,10,630,470); outtextxy(320,325,”C”); bar(29,174,306,296);
setfillstyle(SOLID_FILL,EGA_WHITE); } setfillstyle(SOLID_FILL,EGA_BLUE);
bar(12,12,628,50); bar(30,200,285,240);
setcolor(EGA_BLACK); void evaluate(){ setfillstyle(SOLID_FILL,EGA_MAGENTA);
settextstyle(COMPLEX_FONT,HORIZ_DIR,1); void getdata(void); bar(32,202,283,238);
setusercharsize(4,8,6,7); int ch; if ((select >0 && select <6 && mode==1) ||(select
outtextxy(210,10,”CompuMultiMeter”); setfillstyle(SOLID_FILL,EGA_CYAN); >0 && select <4 && mode==0) || (select!=0 &&
setusercharsize(1,3,1,2); do{ mode==2)){
outtextxy(390,23,”By N.V.VENKATARAYALU.”); if (ch==80 && mode==0){ outtextxy(85,210,”Busy!! Wait for 5 seconds...”);
settextstyle(SIMPLEX_FONT,HORIZ_DIR,2); setcolor(EGA_CYAN);rectangle(50,70,225,100); freq=scanfreq();
outtextxy(50,70,” OhmMeter “); setcolor(EGA_BLACK);rectangle(50,100,225,130); calrescap(freq,select);
outtextxy(50,100,” Capacitance Meter”); outtextxy(370,325,”x”); select=0;
outtextxy(50,130,” Volt Meter”); bar(360,205,380,230); }
settextstyle(SMALL_FONT,HORIZ_DIR,4); mode=1; } else{
setfillstyle(SOLID_FILL,EGA_LIGHTGRAY); else if (ch==72 && mode==1){ outtextxy(65,210,”Data Input Error! Press any
bar(12,455,628,468); setcolor(EGA_CYAN);rectangle(50,100,225,130); Key...”);
outtextxy(510,455,”Press ‘Esc’ to Quit”); setcolor(EGA_BLACK);rectangle(50,70,225,100); getch();
outtextxy(524,260,”To the Computer”); outtextxy(360,205,”x”); }
outtextxy(524,210,”From the Computer”); bar(370,325,390,350); setfillstyle(SOLID_FILL,EGA_CYAN);
setfillstyle(SOLID_FILL,EGA_MAGENTA); mode=0; } bar(30,200,285,240);
fillellipse(40 ,85,5,5); else if (ch==80 && mode==1){ return;
fillellipse(40 ,115,5,5); setcolor(EGA_CYAN);rectangle(50,100,225,130); }
fillellipse(40 ,145,5,5); setcolor(EGA_BLACK);rectangle(50,130,225,160); float scanfreq(){
mode=0; bar(370,325,390,350); float m=0;
setlinestyle(SOLID_LINE,0,THICK_WIDTH); mode=2; } int s=127,t=127;
rectangle(50,70,225,100); else if (ch==72 && mode==2){ clock_t start, end=0;
setfillstyle(SOLID_FILL,EGA_YELLOW); setcolor(EGA_CYAN);rectangle(50,130,225,160); outp(0x378,1);
bar(14,14,37,48); setcolor(EGA_BLACK);rectangle(50,100,225,130); start = clock();
rectangle(16,16,34,46); outtextxy(370,325,”x”); for(;(end-start)<18.2*5;end=clock())
rectangle(400,150,520,320); mode=1; } {
circle(460,95,5); else if(ch==13) getdata(); s=inp(0x379);
line(460,150,460,100); }while((ch=getch())!=27); if(s!=t)m++;
line(460,125,350,125); return; t=s;
line(350,125,350,145); } }
moveto(350,145); outp(0x378,0);
lineto(355,150);lineto(345,160); void getdata(){ return (m/10);
lineto(355,170);lineto(350,175); float scanfreq(void); }
lineto(350,185);lineto(400,185); void calrescap(float,int); void calrescap(float fre,int selm){
moveto(350,185); float freq; double roundresult(double);
lineto(350,195);lineto(355,200); int select; double result=0.0;
lineto(345,210);lineto(355,220); setcolor(EGA_BLUE); char dispstr[50];
lineto(350,225);lineto(350,235); rectangle(30,175,305,295); setcolor(EGA_BLACK);
lineto(400,235); setfillstyle(SOLID_FILL,EGA_MAGENTA); rectangle(30,195,305,250);
moveto(350,235); bar(32,177,303,293); setfillstyle(SOLID_FILL,EGA_MAGENTA);
lineto(350,275);lineto(400,275); settextstyle(SMALL_FONT,HORIZ_DIR,5); bar(32,197,303,248);
line(350,275,350,325); setusercharsize(3,3,10,6); if (mode==0 && fre>0){
line(335,325,365,325); setcolor(EGA_BLACK); switch(selm){
arc(350,345,40,140,15); if(mode==0){ case 1: result= (1.44/(fre*10e-6)-1e3)/2; break;
line(350,333,350,365); outtextxy(35,185,” Select the range of the case 2: result= (1.44/(fre*10e-6)-1e3)/2; break;
line(425,320,425,365); Unknown Resistor”); case 3: result= (1.44/(fre*1e-6)-10e3)/2; break;

ELECTRONICS PROJECTS Vol. 20 17


} else if (mode==2 && fre >0){ char restr[10];
result=roundresult(result); result=(log(fre/3080.1))/log(0.5241); double rres;
sprintf(dispstr,”The value of the resistor Rb is: result=roundresult(result); int t,power;
%1.1e Ohms”,result); sprintf(dispstr,”The Voltage drop is : %1.1e sprintf(restr,”%1.2e”,res);
} Volts”,result); t=restr[3]-’0';
else if (mode==1 && fre >0){ } power=(restr[6]-’0')*10+restr[7]-’0';
switch(selm){ if (result<=0.0) rres=(restr[0]-’0')+(float)(restr[2]-’0')/10;
case 1: result=1.44/(fre*3.0*1e6); break; sprintf(dispstr,”Calculation Error. Check for if(t>4)
case 2: result=1.44/(fre*3.0*1e5); break; known values”,result); rres+=0.1;
case 3: result=1.44/(fre*3.0*1e4); break; outtextxy(40,210,dispstr);
case 4: result=1.44/(fre*3.0*1e3); break; getch(); if(restr[5]==’-’)
case 5: result=1.44/(fre*3.0*1e2); break; setfillstyle(SOLID_FILL,EGA_CYAN); rres*=pow(10,-power);
} bar(29,194,306,296); else
result=roundresult(result); return; rres*=pow(10,power);
sprintf(dispstr,”The value of the Capacitance C is: } return rres;
%1.1e F”,result); }
} double roundresult(double res){

TABLE III Table I) are changes pin 2 (data bit #1) of the parallel PARTS LIST
Input voltage selected us-
Frequency port from logic 0 to logic 1. This pin is Semiconductors:
1.25 1310 ing the ro- connected to pin 4 of the 555 timer, which IC1 - NE555 timer
1.50 1260 t a r y is the RESET pin, and the timer action Resistors (all 1/4W, ± 5% carbon, unless
1.75 1053 switches. begins only when it is high. After this stated otherwise):
2.00 842 Once the the program enters a ‘for loop’ that scans R1,R12 - 1 Meg-ohm
2.25 715 R2,R11 - 100 kilo-ohm
range has the port address to which the output of
2.50 595 R3,R10 - 10 kilo-ohm
2.75 513 been se- the timer is connected (data bit #8 of port
R4,R9 - 1 kilo-ohm
3.00 441 lected, logic 379 hex) for exactly five seconds. This is R5,R8 - 100 ohm
3.25 371 1 is passed done by using the statement ‘inp(0x379)’ R6 - 47 ohm
3.50 317 to the paral- where 0x379 is the input port address R7 - 56 ohm
3.75 270
4.00 225 lel port us- and it returns a byte from this hardware Capacitors:
4.25 183 ing the ‘out- port address. C1 - 0.01µF ceramic disc
4.50 183 put (0x378, Each time the port is scanned, the byte C2 - 10µF,16V electrolytic
4.75 155 C3 - 1µF,16V electrolytic
1)’ state- returned is compared with the previous
5.00 125 Miscellaneous:
ment, where value. If these are not the same, it implies
- 25-pin, male, female 'D'
0x378 is the output port address. This that either a high-to-low or a low-to-high
connectors, ribbon cable
transition has occurred. Thus counting and PCB etc.
the number of such transitions, until the
end of the ‘for loop,’ gives twice the number ordinary multimeter. The unknown ca-
of cycles in five seconds. From this data, pacitance (Cx in Fig. 1) is placed between
the number of cycles in one second, i.e. pin 6 and ground (arm C) of the IC. Other
the frequency, is found. This is the value external components, i.e. Ra and Rb, are
of ‘f’ in the above formula. The program selected as per Table II.
calculates the unknown value, i.e. the 3. To measure the voltage within the
value of the component, from this value range 1.25V to 5V, the same is to be con-
of ‘f.’ As the ‘for loop’ terminates, the 555 nected across pin 5 of 555 IC and ground.
IC is disabled by bringing its pin 4 to logic In the above two modes (i.e. while measur-
0. Sending 0 to the port using the ing resistance or capacitance values), this
statement ‘outp(0x378, 0) does this. Thus pin was grounded through a 0.01µF capaci-
Fig. 2: Actual-size PCB layout for the circuit the timer is activated only when the pro- tor. This reduces any noise at this pin and
gram scans the parallel port. the pin is maintained steadily at 2/3Vcc by
The three modes of operation are a potential divider inside the IC. Because
presented below: of this reason, whenever the external ca-
1. To measure resistance, the range pacitor charges to a voltage higher than 2/
of resistance that is to be measured is to 3Vcc (voltage at pin 5), the output state
be first known as in the case of any changes and the capacitor starts discharg-
ordinary multimeter. The unknown re- ing. Again, when its potential reduces to 1/
sistance (Rx in Fig. 1) is placed between 3Vcc, the output changes.
pins 6 and 7 (in Rb arm) of the IC. Other However, in this mode of operation
external components (Ra and C) are se- pin 5 is forced to an external voltage. This
lected with the help of Table I. causes the output state to change when
2. To measure capacitance, the range the capacitor’s voltage reaches the exter-
of capacitance that is to be measured is nal voltage while charging and reaches
Fig. 3: Component layout for the PCB to be known first, as in the case of any half of the external voltage while discharg-

18 ELECTRONICS PROJECTS Vol. 20


ing. This in turn changes the frequency, Frequency, f = a(b)V components used. Hence, for better re-
depending on the external voltage at pin Or sults, components with 1 per cent toler-
5 and other external components. The val- ance level are recommended.
ues chosen for the external components This simple circuit can be easily wired
are: where a = 3080 and b = 0.524. on a general-purpose PCB. However, for
Ra = 22 kilo-ohms The program uses this formula to cal- those readers who still desire to wire up
Rb = 56 ohms culate the value of the unknown voltage. the circuit using a proper track layout, a
C = 0.01 µF The resolution of this Compu- single-sided actual-size PCB is shown in
The frequency of the output for vari- MultiMeter in resistance and capacitance Fig. 2 and the component layout for the
ous voltages at pin 5, as computed by the measurement modes is 0.1, and the re- same is shown in Fig. 3.
author, is listed in Table III for Vcc = sult is displayed in the format X.Xe±XX Lab Note: During measurements, it
+5.25 V. where ‘e’ stands for exponent to base 10. was observed that while the values of un-
From this data, curve fitting has been For example, 4.7 kilo-ohm is displayed as known resistors and capacitors could be
done to derive a relationship between the 4.7e+3. measured fairly accurately, the results of
frequency and voltage at pin 5. An exponen- Accuracy of the results depends on voltage measurements were wide off the
tial regression leads to the relationship: the tolerance level of the other external mark. ❑

Reader Comments: The author N.V. Venkatarayalu replies: log f=v log b + log a
❑ I have completed the software and hard- From Table III published in the con- which is of the form y=mx+c
ware successfully, and it is working well. struction project, an exponential depend- where y=log f, x=v, m=log b, and
I, however, want to know as to how we ence of frequency on voltage can be no- c=log a.
calculate the constants ‘a’, ‘b’ from curve ticed. So, an exponential regression of the The standard procedure for linear re-
fitting using (f-frequency) and (v-voltage), form f = a(b)V would be best suited. To gression available in any numerical math-
and also how we arrive at the formula f = find the constants ‘a’ and ‘b’ the expres- ematics book can be used to find ‘m’ and
a(b)V from linear regression? sion is reduced to the linear form by tak- ‘c’ and hence the constants ‘a’ and ‘b’. The
S. Suresh Kumar ing the logarithm of both sides in the values of ‘a’ and ‘b’ are found to be
Alwarkurichi above equation, i.e. 3080and 0.524 respectively. ❑

ELECTRONICS PROJECTS Vol. 20 19


CALLING NUMBER
IDENTIFICATION SYSTEM
USING CALCULATOR
G. GOWRISHANKAR

H
ere is a simple and inexpensive system for cities like Mumbai and New blanking etc. The circuit of calling number
circuit to identify the calling Delhi. Many companies have already identification system presented here will
telephone number of an incoming advertised their products which can cost around Rs 300 including the cost of a
telephone call. Recently the telecommu- display the calling number with added simple calculator which has been used in
nication department has introduced the features like storage of the previous this project for displaying the calling
facility of calling number identification calling numbers and undesired number number.

Fig. 1: Circuit diagram of calling number identification system using calculator

20 ELECTRONICS PROJECTS Vol. 20


PARTS LIST Pin Description of CM8870
Semiconductors: Pin No. Symbol Description
IC1-IC3 - CD4016/CD4066 quad 1 IN+ Non-inverting input of the op-amp
analogue switch/analogue
multiplexer 2 IN- Inverting input of the op-amp
IC4 - CD4028 BCD-to-decimal 3 GS Gain select. The output used for gain adjustment of analogue input signal
decoder with a feedback resistor.
IC5 - KT 3170 or 8870 DTMF 4 VREF Reference voltage output (VDD/2, Typ.) can be used to bias the op-amp
decoder input of VDD/2.
IC6 - CD4011 quad 2-input 5 IIN Input inhibit. High input states inhibit the detection of tones. This pin is
NAND gate pulled down internally.
IC7 - CD4081 quad 2-input AND
gate 6 PDN Control input for the stand-by power down mode. Power down occurs
IC8 - MCT2E opto-coupler when the signal on this input is in high state. This pin is pulled down
T1 - 2N2222, npn switching internally.
transistor 7.6 OSC1 Clock input/output. An inexpensive 3.579545MHz crystal connected
D1-D10 - 1N4007, rectifier diode OSC2 between these pins completes internal oscillator. Also, external clock can
be used.
Resistors (all ¼ W, ± 5% carbon, unless
stated otherwise): 9 GND Ground pin
R1, R7 - 47 kilo-ohm 10 OE Output enable input. Outputs Q1-Q4 are CMOS push-pull when OE is
R2 - 330 kilo-ohm high and open circuited (high impedance) when disabled by putting OE
R3 - 1 mega-ohm low. Internal pull-up resistor built-in.
R4, R5 - 1.5 kilo-ohm 11-14 Q1-Q4 Three-state data output. When enabled by OE, these digital outputs
R6 - 100 kilo-ohm provide the hexadecimal code corresponding to the last valid tone pair
R8 - 1 kilo-ohm received.
R9 - 12 kilo-ohm
15 DSO Delayed steering output. Indicates that valid frequencies have been
R10 - 10 kilo-ohm
present for the required guard time, thus constituting a valid signal.
Capacitors: Presents a logic high when a received tone pair has been registered and
C1 - 0.1µF, 10V polyster the output latch is updated. Returns to logic low when the voltage on SI/
C2, C9 - 0.1µF ceramic disc GTO falls below VTH.
C3 - 0.47µF, 100V polyster 16 ESO Early steering outputs. Indicates detection of valid tone outputs a logic
C4 - 47µF, 16V electrolytic high immediately when the digital algorithm detects a recognisable tone
C5 - 470µF, 25V electrolytic
pair. Any moemtary loss of signal condition will cause ESO to return to
C6 - 10µF, 10V electrolytic
C7 - 1µF, 160V polyster low.
C8 - 1000µF, 25V electrolytic 17 SI/GTO Steering input/Guard time output. A voltage greater than VTS detected at
S1 causes the device to register the detected tone pair and update the
Miscellaneous: output latch. A voltage less than VTS frees the device to accept a new
Xtal - 3.579545 MHz crystal tone pair. The GTO output acts to reset the external steering time
X1 - 230V primary to 0-12V, constant, and its state is a function of ESO and the voltage on S1.
250mA secondary
transformer 18 VDC Power Supply (+5V, Typ.)
X2 - 230V primary to 0-6V,
500mA secondary CMOS IC having the following features: equivalents by IC4 (CD4028) which is a
transformer
Calculator - 12 digit calculator 1. Detects all 16 standard DTMF BCD-to-decimal decoder. The output pins
Battery - 1.5Vx4, R6 (UM-3DG) cells tones. of this IC will be ‘high’ corresponding to
2. Typical power consumption is the BCD code given at the input of IC4.
The dedicated DTMF-to-BCD con- 15 mW. The BCD output from IC5 is coupled to
verter IC KT3170 or CM8870 forms the 3. Single 5V power supply operation. IC4 via four AND gates. The gates are
heart of this circuit. This IC converts the 4. Three-state output for interfacing enabled by the delayed steering output
incoming DTMF signals sent by the to microprocessors. (DSO), a pulsed digital signal available
MTNL in between the ringing signals into 5. Uses commonly available 3.579545 at pin 15 of IC5 which will be ‘high’ only
corresponding BCD codes. IC KT3170 or MHz crystal. when the DTMF tone is detected by the
its equivalent CM8870 is a low-power 6. Valid input signal range is as low IC.
as -29 dbm. IC1 through IC3 are all quad ana-
7. Can be used logue switches controlled by the decimal
in single-ended or outputs from IC4. The analogue switch
differential input triggers the corresponding decimal
signal configura- number in the calculator which is used as
tion. a display in the circuit.
Pin description IC4 responds to all the BCD codes
of KT3170/ except the zero decimal, because the out-
CM8870 IC is put of IC5 for zero (corresponding to ‘0’
given in the box key on dial key-pad ) will be 1010 which
above. The BCD will not activate IC4. NAND gate (IC6
coded outputs (b)) is used to sense the zero code. Active
from decoder IC5 low output of gate IC6(b) is inverted by
are converted into IC6(a) to trigger the ‘0’ display in the
Fig. 2: Power supply circuit d e c i m a l calculator.

ELECTRONICS PROJECTS Vol. 20 21


Prototype of caller-identification tested in
EFY Lab
Now you can see that the tracks under
the pushbutton side are etched in such a
way that when a pushbutton is pressed
the corresponding two tracks under the
pushbutton get shorted. You can take pair
of leads from the corresponding two tracks
Fig. 3: Actual-size, single-sided combined PCB layout for the circuits of Figs 1 and 2 by scratching the green mask and solder-
ing the wires carefully.
A proper actual-size, single-sided PCB
for the circuits in Figs 1 and 2 is shown
in Fig. 3 and its component layout is
shown in Fig. 4. After assembly, the unit
can be fixed into a small plastic enclo-
sure which should have a cut-out for the
display.
The power supply for the calculator
can be taken from this circuit itself. If the
calculator requires 3V for operation, re-
place the diodes D2 through D4 with a
3.3V, 250mW zener. The given power sup-
ply circuit having a battery back-up is
suggested for proper operation.
Lab note: The testing of the circuit was
carried out in simulated conditions using
internal extensions (having DTMF dial-
ling facility) of an EPABX. Not only the
calling numbers but even the called num-
Fig. 4: Components layout for the PCB bers were displayed on calculator display.
Apparently, lifting of the handset from
IC9 (MCT2E) is an opto-coupler which analogue switch IC1(a) and the calcula- cradle, which causes sudden change of
is well known to EFY readers. It is wired tor is switched on. voltage from 48V to about 12 volts, sends
to sense the ringing signals. When the Any common type of calculator a pulse via opto-coupler to control pin of
first ring comes, the input to IC6(C) goes can be used for this application. However, IC1(a) to switch on the calculator to
high because the transistor inside the one should ensure that the calculator has display the dialled number. Capacitor C7
opto-coupler conducts. Capacitor C5 holds 12 or more digits so that the calling was added in the original circuit to obvi-
the input high for a few seconds. The number along with area code etc could be ate loading of the telephone line to avoid
output of IC6(d) also goes high simulta- accommodated. its behaving as ‘busy’ while the handset
neously and it causes a pulse to pass For interfacing the calculator with this is still on the cradle.
through capacitor C4 which closes the circuit, remove cabinet of the calculator. ❑

22 ELECTRONICS PROJECTS Vol. 20


TRANSFORMER POLARITY
TESTER
P.S. SINI

T
esting the winding polarity of which suits portable battery-powered op- ‘-’ marked probe leads are connected to
transformers, especially those of eration. winding terminals with identical ‘dot’ po-
multi-winding SMPS, audio and To test the relative polarity between larity. On the contrary, red LED when
power transformers, is a common require- any two windings, the user has to con- ‘on’ will indicate reverse dot polarity of
ment in the industry. An instrument nect only two sets of probes (or crocodile the two windings.
which could easily and quickly test the clips) to the respective winding terminals, The circuit is based on the principle
winding polarity would be extremely use- the reference winding and any other that when any winding of a transformer
ful for not only the industry but also the winding. The polarity is indicated with is excited with a voltage pulse, all other
electronics hobbyists and enthusiasts. the help of two LEDs with respect to the coupled windings generate pulses of vary-
The circuit of transformer polarity reference winding probe leads marked + ing amplitude decided by the turns ratio.
tester given here can be easily fabricated (red) and - (black). The green LED when The ‘dot’ ends of all the windings gener-
using commonly available components. ‘on’ would indicate that the two windings ate voltages in phase with the ‘dot’ end of
The supply voltage selected is 9V, are in phase, that is, the ‘+’ marked and the excited winding. This presents the pos-

Fig. 1: Circuit diagram for transformer polarity tester

ELECTRONICS PROJECTS Vol. 20 23


PARTS LIST shorting of the
Semiconductors: probes. This con-
IC1-IC3 - NE555, timer dition is indicated
IC4 - TL084, quad JFET input
opamp by the glowing of
IC5 (N1,N2) - CD4011, quad NAND gate yellow LED1.
T1 - 2N5062 or 2PUM, SCR. A sampling
T2 - BC557, pnp transistor
T3 - IRF840 n-channel MOSFET pulse is gener-
D1 - 1N4148 switching diode ated by monoshot
D2, D3 - MUR160 or1N4007 IC2 which gets a
rectifier diode
D4 - Zener, 5.I volt delayed trigger
derived from the
Resistors (all ¼ W, ± 5% carbon, unless
stated otherwise): exciting pulse.
R1 - 820-ohm Output of the
R2 - 68 kilo-ohm monoshot is
R2A* - Test selected (refer text)
R3, R16, R17 - 680-ohm given to one of
R4, R6, R13 - 1.2 kilo-ohm Fig. 2: Actual-size, single-sided PCB for the circuit of Fig. 1 the pins of NAND
R5 - 2 kilo-ohm gate N2 which
R7 - 510-ohm
R8 - 100-ohm gives an active
R9, R14 low output when
R21, R23 - 1 kilo-ohm the precondi-
R10 - 33-ohm
R11 - 180-ohm tioned pulse ap-
R12, R20, R22 - 5.1 kilo-ohm plied to its other
R15 - 33 kilo-ohm
R18 - 22 kilo-ohm
input pin is avail-
R19 - 1.5 kilo-ohm able simultane-
Capacitors: ously with the
C1, C2, C6, C7 - 0.1µF ceramic disc monoshot high
C3, C4, C5 - 0.22µF ceramic disc state.
C8 - 0.01µF ceramic disc
C9 - 3.3µF, 25V electrolytic Resistors R20
Miscellaneous:
through R22,
LED1 - Yellow LED zener diode D4
LED2 - Red LED and IC4(b) do the
LED3 - Green LED
- Crocodile clips conditioning of
- Battery, 9-volt Fig. 3: Component layout for the PCB of Fig. 2 the input pulse by
amplitude limit-
sibility of performing a simple logic AND IC1 is used to drive the MOSFET (T3) ing and comparator action. Care should
operation to determine the winding po- which in turn produces the voltage pulse still be taken, if the turns ratio is very
larity. In the circuit diagram given in Fig. at the excitation high, to produce excessive voltage at the
1, NAND gate N2 does this job in con- probe terminals. Re- measuring winding.
junction with rest of the circuit. sistor R7 and diode Timer IC3 is used for the indication
D2 provide the free- function. It is basically a re-triggerable
wheeling path when monoshot with 8ms period. The output of
Description reference winding of this monoshot remains high if NAND gate
Though the simple AND gate will work in transformer ‘under N2 output is low (active) which triggers it
principle, various edge delays and ring- test’ is connected during each measuring cycle. This causes
ing phenomenon commonly encountered across excitation the green LED to continuously glow, indi-
in transformer circuits will cause errors, probes. cating the same dot polarity of the un-
making the test results invalid. The Resistor R10 known winding as that of the exciting
circuit presented here avoids these senses the excitation winding. When polarity is not the same,
errors by sampling the pulses somewhere current and, if this is red LED will glow.
in the middle part of the exciting pulse excessive, compara- The circuit can be assembled using a
and then doing the logic detection of the tor IC4(a) gives a general-purpose PCB. However, a proper
phase. positive pulse output actual-size, single-sided PCB layout for
The first part of the circuit is a simple to trigger the SCR the circuit is given in Fig. 2. The compo-
astable multivibrator with IC1 having an (T1) to ‘on’ state. As a nents layout for the PCB is given in Fig. 3.
‘on’ period of 50 to 100 µs and ‘off’ period result, further drive After assembly, the PCB can be fixed
of approximately 5 ms. Resistance R2A to the MOSFET is in- inside a small plastic case with LEDs and
shown in series with diode D1, which de- hibited until the re- reset switch S1 protruding out. Crocodile
termines ‘on’ period, should be test se- set switch is pressed. clips with red and black coloured bands
lected to be low enough but adequate to Fig. 4: Pin configura-
This limits the cur- can be used for the two pairs of probes for
trigger the MOSFET properly. tion of transistor and rent to a safe value in connecting the reference and any other
The positive going pulse output from MOSFET case of accidental winding. ❑

24 ELECTRONICS PROJECTS Vol. 20


PROGRAMMABLE VERSATILE
TIMER
S. ARVIND

M
any timer circuits have been can be used for inputting BCD data to a while its power supply circuit is given in
published in EFY in the past. register inside the chip. The contents of Fig. 3. Other than the power supply and
But this circuit based on dedi- this register are compared with the count ground connections, certain points of Fig.
cated application-specific IC (ASIC) ICM held in the counter and the results appear 1 (A through D) need to be connected
7217A is quite versatile and compact. at output pins 2 (ZERO or Z) and 3 (EQUAL (through use of jumper wires) to various
ICM 7217A comprises a 4-digit decade or E). When both counter and register points (E through K in Fig. 2) for various
counter with multiplexed LED display driv- contents are zero, pin 2 output becomes modes of operation, as per Table I.
ers. ASIC versions with suffix A and C are logic 0 (active) and when contents of There are three modes of operation
meant for common-cathode and the counter and register are equal, pin 3 output which have been covered in this article.
versions with nil or B suffix are meant for goes logic 0 (active). These features are These modes can be used for various ap-
common-anode LED displays. The A and made use of in this circuit. plications. Many other modes, limited only
nil suffix versions have a maximum count by one’s own imagination, are also possi-
of 9999 while suffix C and B versions, ble.
which are primarily meant for timing ap-
Description As mentioned earlier, ICM 7217A ver-
plications, have a maximum count of 5959. The schematic diagram of versatile pro- sion is used with common-cathode LED
The BCD I/O port pins (7 through 4) grammable timer is given in Figs 1 and 2 displays. The average segment current is

Fig. 1: Circuit diagram showing interfacing of ICM 7217A with 7-segment displays and thumbwheel switches

ELECTRONICS PROJECTS Vol. 20 25


required to be limited to
about 3 mA.
The clock input is a
fairly conventional one.
Here the CMOS compat-
ible clock is generated us-
ing a crystal of 32.768 KHz
in conjunction with IC
CD4060 which is a 14-
stage binary counter/di-
vider and oscillator.
The final output of 2
Hz at pin 3 of IC2 is fur-
ther divided by 2 by IC3
(CD4017) which is
configured here as a tog-
gle flip-flop to provide 1Hz
pulses at pin 3 (point E).
Logic state at pin 10 of Fig. 2: Interface circuit for achieving various modes of operation
IC1 determines the counting direction. the help of thumb-
When pin 10 is at logic 1, the direction of wheel switches TWS1
counting is upwards, and when it is at through TWS4. When
logic 0, the direction of counting is down- the counter is at 0, the
wards. output at pin 2 (point
Switches S1 through S3 are spring C) becomes active low.
loaded push-to-on switches. Switch S1 is This causes the output
used to load the counter with the BCD of latch at point H to
count value selected via the thumb-wheel go high and the coun-
switches TWS1 through TWS4. Switch S2 ter starts counting up.
is similarly used to load the internal reg- When counter reaches
ister with the count value selected via the the preset value Fig. 3: Power supply circuit
thumb-wheel switches. Once both, the con- (loaded into the inter-
tents of register and those of the counter, nal register), pin 3 output (EQUAL) at via point J is connected to point D which
are equal, the output at pin 3 of IC1 goes point D becomes active low. This causes carries the EQUAL output from pin 3 of
low. Switch S4 is used to reset the coun- output of the latch to go low and, as a IC1.
ter to zero. result, the counter starts counting down. Thus until the time the counter
The three modes of operation Thus in mode 1, the counter keeps count- contents are less than the value held in
selectable with the help of jumpers, as ing back and forth between zero and the the internal register, the output at pin 3
per Table I, are described below. preset value. of IC1 is at logic 1. As a result, transistor
Mode 1: In this mode jumper J1 is Mode 2: In this mode it functions like T1 is forward biased and its collector
placed across points 1 and 2 while switch a preset timer to sound an alarm when is pulled to near ground potential,
S4 is in closed position so that IC2 func- the count reaches the programmed value. which causes counter IC2 to remain
tions continuously. The 1Hz clock gener- The 1Hz clock from point E is connected operative while timer IC4 remains non-
ated by IC3 at point E is jumpered to to pin 8 (point A) of IC1, as in mode 1. operative.
clock pin 8 (point A) of IC1. Outputs from However, in this mode the counter is Once the count reaches the value held
points C (ZERO) and D (EQUAL) are con- configured for counting up operation only, in the internal register of IC1, its output
nected to inputs of gates N1 (point F) and by connecting pin 10 (point B) of IC1 to at pin 3 goes logic 0. This causes transis-
N2 (point G) of the NAND latch circuit. Vcc (point L), i.e. logic 1. The internal tor T1 to cut-off so that its collector volt-
Output (point H) from the NAND latch register is loaded to the value preset by age becomes high and it resets counter
connected to pin 10 of IC1 (point B) con- thumbwheel switches TWS1 through IC2, while timer IC4 becomes operational
trols the direction of counting. TWS4 with the help of push-to-on switch and the buzzer sounds to indicate the end
Assume that the registers have been S2. In this mode, switch S4 remains open of the preset timing interval.
loaded with a specific value selected with and jumper J1 is placed across points 2 Please note that the value set through
and 3 so that master reset pin 12 of IC2 is thumbwheel switches corresponds to the
controlled by the potential/logic level at value in seconds since 1Hz clock is being
the collector of transistor T1. Simultane- used for counting operation by IC1.
ously, the collector of transistor T1 is con- Mode 3: In this mode the counter op-
nected to reset pin 4 of NE555 timer IC2 erates in reverse way than in mode 2.
which is configured as an astable Here the counter alone is used. The count
multivibrator operating in the audio fre- value selected by thumb-wheel switches
quency region. The base of transistor T1 is loaded into the counter using push-to-

26 ELECTRONICS PROJECTS Vol. 20


transistor T1 by PARTS LIST
shorting point C Semiconductors:
to J. IC1 - ICM 7217A, 4-digit LED
Thus ini- driver cum programmable
up/down counter
tially, when the IC2 - CD4060, 14-stage counter
count value is and oscillator
greater than 0, IC3 - CD4017 decade counter
IC4 - NE555 timer
transistor T1 re- IC5 - 74LS00 quad 2-input
mains forward bi- NAND gate
IC6 - LM7805 voltage regulator
ased and its col- T1 - 2N2222A npn transistor
lector voltage is T2 - SK100 pnp transistor
near ground po- D1-D16 - 1N4148 switching diode
D17-D19 - 1N4007 rectifier diode
tential which, in
Resistors (all ¼ W, ± 5% carbon, unless
turn, results in stated otherwise):
forward biasing of R1, R2, R11 - 10 kilo-ohm
pnp relay driver R3-R6,R9, R10 - 1 kilo-ohm
R7 - 220 kilo-ohm
transistor T2. R8 - 6.8 kilo-ohm
Thus the load R12 - 22 kilo-ohm
connected to sup- R13 - 2.2 kilo-ohm
R14, R15 - 330 ohm
ply via N/O con-
Capacitors:
tacts of relay RL1 C1 - 10µF, 16V electrolytic
is on. As the C2, C4, C6, C7 - 0.1µF ceramic disc
counter counts C3 - 0.01µF ceramic disc
C5 - 1000µF, 25V electrolytic
Fig. 4: Actual-size, single-sided PCB layout for the circuits in Figs 1 through 3 down from the
Miscellaneous:
loaded value and XTAL1 - 32.768kHz crystal
reaches zero, the DIS1-DIS4 - LT543x4 common cathode
output at pin 2 of display
X1 - 230V AC primary to 12V-0-
IC1 goes logic 0. 12V, 250mA secondary
This cuts off tran- transformer
TWS1-TWS4 - BCD thumbwheel switch
sistor T1 and con- S1-S3 - Push-to-on switch
sequently tran- S4 - SPST switch
sistor T2 to LED1 - Red LED
LED2 - Green LED
deenergise the
relay and switch
grammable duration and then in the op-
off the supply to
posite direction/other way for the same
the load.
period, repeatedly.
Mode 2: A simple application
Applica- would be as a lab timer or as a wake-up
alarm on completion of the preset time.
tions Mode 3: This mode could be used in
Mode 1: A special industrial environments for switching on/
application of this off of any device after a preset delay. Many
mode could be other applications may also be similarly
made in the tape thought of not only for this but other
recorders. The modes as well.
1Hz clock pulses An actual-size, single-sided PCB lay-
may in that case out for the circuits in Figs 1 through 3 is
be replaced by 1 given in Fig. 4. The component layout for
Fig. 5: Component layout for the PCB in Fig. 4 pulse/revolution the PCB is given in Fig. 5.
of the tape. Thus Normal precautions required for work-
on switch S1. Like modes 1 and 2, the once the tape, during play, reaches a pre- ing with CMOS ICs should be taken while
1Hz clock is applied to pin 8 of IC1 by set position, the counter reverses and the assembling this circuit. For easy fault di-
connecting point A to E. The position of tape rewinds. Once the tape reaches 0 agnosis and replacement, all the ICs may
jumper J1 is the same as for mode 2. position, it again starts playing in the for- be mounted on IC bases. The circuit, af-
However, jumper 2 is used for connecting ward direction and thus it keeps on re- ter assembly, may be fitted inside a small
the collector of transistor T1 to the base peating a particular song or speech. box with cut-out for the display. The
of relay driver transistor T2 by shorting This mode would also have industrial power supply transformer and the relay
points 5 and 6, while ZERO output from applications where a gadget is to operate may be mounted externally, if desired.
pin 2 of IC1 is connected to the base of in a particular direction/way for a pro- ❑

ELECTRONICS PROJECTS Vol. 20 27


CALLER-ID UNIT USING
MICRO-CONTROLLER
VINAY CHADDHA

T
he facility of knowing your call- India earlier, has since been extended to January 1999.
er’s telephone number before an- the normal telephone users also in Delhi, MTNL/DoT telephone exchanges
swer-ing the call, which had been Mumbai and some other cities of India transmit the telephone number of calling
available to cellular phone users only in through MTNL and DoT since 1st party just before the first ring while in

Fig. 1: Complete circuit diagram of caller-ID unit

28 ELECTRONICS PROJECTS Vol. 20


TABLE 1 associated with each row and
Column 1 Column 2 Column 3 column of the telephone key-
1209 Hz 1336 Hz 1447 Hz pad. Thus pressing 8 will
Row 1 1 2 3 generate a combination con-
697 Hz sisting of row and column fre-
Row 2 4 5 6 quencies of 852 Hz and 1336
770 Hz Hz respectively. Similarly,
Row 3 7 8 9 pressing 4 will generate 770
852 Hz
Row 4 * 0 #
Hz and 1209 Hz combination.
941 Hz The same tone frequency
combinations are used for
systems used in USA and China, the data transmitting calling party’s Fig. 3: Off-hook detector
relating to the calling number is sent be- number from exchange to
tween first and the second rings. The the called party’s telephone
number of calling party in India is trans- instrument.
mitted by MTNL/DoT exchanges in DTMF Caller-ID circuit
codes.
presented here has the
Two documents containing standards
following features:
and specifications issued by DoT’s Tel-
• Displays dialled
ecommunications Engineering Centre
numbers (in tone mode
(TEC) in the form of ‘Generic require-
only).
ments’ and ‘Interface requirements’ for
• Displays incoming
‘Subscriber service unit for calling line
identification presentation (SSU for CLIP)’ numbers and stores them in
are available from TEC, Khursheed Lal memory. Fig. 4: LCD display unit
Bhawan, Janpath, New Delhi against pay- • Only last 99 numbers
Power supply (Fig. 2): The power
ment of Rs 250 each. are stored in memory. (Older numbers are
supply unit is used to provide a constant
In older versions of telephones using automatically deleted and new numbers
5V supply to different ICs. This is a stand-
rotory dials, whenever a digit was dialled, are stored when the stored numbers ard circuit using external 12V DC adop-
telephone line was disconnected and re- exceed 99—on first-in-first-out basis.) ter and fixed 3-pin voltage regulator. Di-
connected for short durations. These were • View incoming numbers and selec- ode is added in series to avoid damage to
referred to as pulses and the system was tively delete stored numbers. the unit if reverse voltage is applied by
called pulse dialing system. The number mistake.
of connections and disconnections equaled Description Off-hook detector (Fig. 3): The tel-
the dialled digit. For example, if number This caller-ID unit has seven functional ephone line voltage is around 48V when
7 was dialled, the line was disconnected blocks: power supply, off-hook detector, unit is on-hook. This voltage falls to
7 times for short durations. For number DTMF decoder, LCD display unit, micro- around 10 V when telephone handset is
0, the number of connections and controller, memory and keyboard. The lifted from the cradle, and it remains the
disconnections equalled 10. main electronic components are shown in same during dialling or conversation. This
In later versions of telephones using Table II. voltage may vary by ± 20 per cent due to
push buttons and integrated circuits, the battery voltage variations at exchange and
same protocols are used to maintain com- line voltage drop, depending upon the dis-
TABLE II
patibility with older phones and ex- tance between exchange and the telephone
Micro-controller MC68HC705KJ1 IC1
changes. DTMF decoder MT8870 IC2 instrument.
DTMF (dual tone multi frequency) sys- Memory 24C08 IC3 Off-hook detector circuit uses a bridge
tem is replacing the pulse dialling system Comparator LM393 IC4 rectifier to take care of polarity reversal
Alphanumeric 16 characters DIS.1 of telephone lines. Resistor divider com-
in modern telephones and exchanges. In LCD x 1 Line
DTMF telephones (and exchanges), the prising R9 and R10 divides the line volt-
numbers are transmitted using different MC68HC705KJ1 is the latest low-cost age by 20 for comparison against a fixed
tone frequency pairs and not by making micro-controller from Motorola. Other voltage (approximately 1 volt), which is
or breaking connections. parts like ICs MT 8870, 24C08, LM393 derived from +5V supply using voltage
A normal telephone instrument has and LCD module are standard parts that divider comprising resistors R7 and R8.
12 buttons (keys) arranged in three col- are available from more than one source. Output of comparator IC4 at pin 7 is logic
umns and four rows. Each row in the key- low (0V) when unit is on-hook and logic
pad matrix activates a specific frequency high (+5V) when unit is off-hook. The
tone. Similarly, each column also controls output level from the comparator is suit-
a specific frequency tone. So when a key able for direct interfacing to micro-con-
is pressed, two different tones correspond- troller IC1.
ing to the row and column combination of LCD display unit (Fig. 4): LCD dis-
the key are generated. play is a single-line, 16-character unit.
Table I shows the tone frequency-pair Fig. 2: Power supply This is a standard unit available in local

ELECTRONICS PROJECTS Vol. 20 29


However, in case of Lampex, Oriole TABLE III
and Crystalonics (popular brands
Pin No Signal Remarks
available in India), connections for
1 Ground Vss
pins-15 and 16 are shown in Table 2 +5V Vcc
IV. 3 Contrast Ground for maximum contrast
LCD controller is a flexible con- 4 RS H = Data L = Command
troller and can be used with 8-bit 5 R/W H = Read L = Write
6 E H = Enable L = disable
or 4-bit micro-controller. In 4-bit 7 - 10 D0 - D3 Data lines (Lower nibble) *
mode, only D4-D7 are used, leav- 11 - 14 D4 - D7 Data lines (Higher nibble) *
ing D0-D3 open. *Note : For 8-bit (byte) data interfacing all the eight
In our circuit, we have conected data lines (Pins 7 through 14) are used whereas for 4-
Fig. 5: Non-volatile memory R/W pin to ground as we are using bit (nibble) data operation, data lines for D4-D7 (pin 11
through 14 only have to be used.)
it for write operation only.
market. Interface with micro-controller is Reading back of the module’s
TABLE IV
accomplished via four data lines D7-D4 status, which is required to
Pin/Manufacturer Lampex Oriole Crystalonics
and two control lines RS and E. Using check if LCD module is busy,
15 +5 V Ground Ground
these six lines, micro-controller displays is not possible.
16 Gnd. X X
all messages and telephone numbers. The To avoid problems, extra

delays in software are provided after


every write command so that before
writing another command/data, LCD
module should be ready (not busy).
Further, only four data lines (D4-D7)
have been used while the other four data
lines (D0-D3) are left disconnected. Thus
even though we are using an 8-bit micro-
controller, the LCD module has been
Fig. 6: Wave form showing conditions existing in I2C bus transfer interfaced for 4-bit mode. Again, to save
pin count, RS line is shared with SDA
(serial data) line for memory (IC3) since
at any given moment micro-controller will
either interface with the LCD module or
the memory, and this does not affect the
system operation.
Non-volatile memory (Fig. 5): 2-
wire serial CMOS EEPROM 24C08 is
used in this circuit to retain last 99 in-
coming numbers. Numbers stored remain
Fig. 7: Sample of I2C bus message in memory even after power failure.

signal names used here are the same as


used by the LCD module/driver manufac-
turers. Pin configuration for a typical 16-
character x 1 line LCD module is shown
in Table III.
Some LCD modules come with addi-
tional one or two pins. These extra pins
are used for back-lighting. There is no
fixed standard for the additional pins.

Fig.8: Keyboard using three tactile switches Fig. 9: DTMF decoder

30 ELECTRONICS PROJECTS Vol. 20


24C08 is an 8k can store 128 16-digit numbers, the soft-
(1024x8) bits ware used is configured only for 99 num-
non-volatile bers, so that only 2 digits are required on
memory. 8k display for call counter. This IC is inter-
bits are inter- faced with microcontroller using two con-
nally organised trol lines SCL (serial clock) and SDA (se-
as 1024 x 8 bits rial data). This 2-wire interface is popu-
or 1k bytes. As larly known as I2C bus interface.
each byte can Overview of I2C bus : I2C devices
store two digits stands for inter-integrated circuit. This
of a number, a was designed by Philips but now a number
total of 8 bytes of semiconductor device manufacturers
are reserved for are making compatible I2C bus.
each number This I2C bus is used mainly with sin-
(for maximum gle-chip based micro-controller systems
of 16-digit that require general-purpose circuits like
length). So EEPROM, RAM, real-time clock, LCD con-
Fig. 10: Micro-controller circuit while this unit troller and audio/video tuning circuits. A
key advantage of this is that
only two lines can connect mul-
tiple devices. All I2C devices
have one nibble of built-in ad-
dress followed by one nibble of
H/W address determined by A0
A1 A2 A3 lines. The 24C08 used
in this design has a device ad-
dress of A0 (hex).
In circuit with multiple de-
vices, one device (usually the
micro-controller) takes the role
of master. Another device (only
one of the multiple devices at
any one time) acts as a slave
device. Master device takes con-
trol of SCL, i.e. SCL is set low
or high under the control of
master (usually the micro-con-
troller). Slave device accepts the
Fig .11: Actual-size, single-sided PCB layout for circuit in Fig. 1 including keypad in Fig. 8 data from micro-controller (e.g.
writing into memory) or sends
the data to micro-controller
(reading from memory) under
the control of master device.
Four different conditions
exist in I2C bus transfers. These
are start, stop, bit transfer
(read/write) and acknowledge.
All these conditions are
explained below with reference
to waveforms shown in Figs 6
and 7.
1. Normal data bit write/
read. During transfer of data
from master (micro-controller)
to slave device (e.g. EEPROM),
SDA is set to logic 0 or 1 only
when SCL is low. After small
delay, SCL is pulsed high to
clock in data. During read op-
eration, SDA is an input line
Fig .12: Component layout for PCB in Fig 11 and its logic state is clocked in

ELECTRONICS PROJECTS Vol. 20 31


Raw DC at 7805 input +12 V (+8 to
+ 15 V)
Regulated DC at 7805 output +5V

Voltage On-hook Off-hook


O/P of bridge 35 to 50 V 8 to 10 V
Pin 5/LM393 1.0 V 1.0 V
Pin 6/LM393 Above 1.8 V Below 0.7 V
Pin 7/LM393 0V 5V

Description of the above sequence is


as follows:
• Action is started with start condi-
tion generated by master (micro-control-
ler).
• 1010 0000 (A0H) is transmitted as
address for EEPROM.
• EEPROM responds with acknowl-
edge during next clock pulse.
• 0101 1000 (58H) is transmitted as
byte address with EEPROM.
• Again EEPROM responds with ac-
knowledge during next clock pulse.
• Finally, data byte 0011 0000 (30H)
is transmitted.
• EEPROM acknowledges during next
clock pulse.
• At the end, master (micro-control-
ler) generates stop condition.
Keyboard (Fig. 8): Three keys (tac-
tile switches) are used to view stored num-
bers and to delete selected numbers. Key-
board is used in a scanning mode.
Each data line is set to low level
sequentially while keeping other lines at
high level. Then level of KBD signal is
checked. If it is low, it indicates that key
connected to the data line which is low
is pressed, else it is not pressed. Due to
Fig. 13: Software flow-chart of main program high speed of micro-controller, all three
keys can be checked for their positions
with SCL going high. Master (micro-con- device (e.g. EEPROM), after reading eight quickly.
troller) can then read the level of SDA. bits, direction of SDA is reversed. SDA DTMF decoder (Fig. 9): DTMF de-
2. Start condition. Start is a special is set low (to send acknowledge) or high coder IC2 MT8870 is AC coupled to tel-
condition where SDA changes its state (to send no-acknowledge) and then SCL ephone lines and keeps on sensing tone
from high to low when SCL is high. Both is pulsed. frequencies. As soon as a valid DTMF digit
SCL and SDA are controlled by master is detected, it sets STD signal (pin 15)
(micro-controller). high and interrupts the micro-controller.
3. Stop condition. Stop is also a spe- How to write a byte in DTMF decoder also requires a 3.58MHz
cial condition where SDA goes from low EEPROM crystal. For cost saving, the output of mi-
to high when SCL is high. Both SCL and cro-controller oscillator is connected to
SDA are controlled by master (micro-con- A sample I2C bus message is shown in 8870 oscillator input pin 7 through a ca-
troller). Fig. 7 while a typical example of writing pacitor. Micro-controller then reads the
4. Acknowledge. After-transmitting into memory (device address A0 hex) lo- digital number on four data lines (D4-D7)
eight data bits from micro controller to cation 58 (hex) with data byte 30 (hex) is by making TOE (output enable pin 10 of
the device (e.g. EEPROM), direction of given below: IC2) high.
SDA line is reversed. One more clock S10100000A01011000A00 Micro-controller (Fig. 10): Micro-
pulse is given by micro-controller. Dur- 110000AP controller used is MC68HC705KJ1 from
ing this period, the slave device sets Where S indicates start, P indicates Motorola which features:
SDA to low. This indicates the acceptance stop and A indicates acknowledge • 11 I/O pins
of data by receiving device (e.g. conditions (as defined in proceding • 1240 bytes of program memory
EEPROM). When data is read from slave paragraph), while 1 and 0 are data bits. • 64 bytes of user RAM

32 ELECTRONICS PROJECTS Vol. 20


PARTS LIST
Semiconductors:
IC1 - MC68HC705KJ1, micro-
controller
IC2 - MT8870, DTMF decoder
IC3 - 24C08, serial CMOS
EEPROM
IC4 - LM393, dual comparator
IC5 - 7805, voltage regulator
D1-D4, D8 - 1N4007, rectifier diode
D5-D7 - 1N4148, switching diode
D9, D10 - Zener, 8.2 volt
Resistors (all ¼ W, ± 5% carbon, unless
stated otherwise):
R1-R3, R5-R6
R8, R19 - 10 kilo-ohm
R4 - 1 kilo-ohm
R7, R13 - 39 kilo-ohm
R9 - 470 kilo-ohm
R10 - 10 mega-ohm
R11 - 300 kilo-ohm
R12 - 62 kilo-ohm
R14-R17 - 51 kilo-ohm
R18 - 100 kilo-ohm
Capacitors:
C1 - 10µF, 35V electrolytic
C2, C3 - 33 pF ceramic disc
C4, C6-C9,
C12, C13 - 0.1µF ceramic disc
C5 - 30 pF ceramic disc
C10, C11 - 0.01µF ceramic disc
Fig. 14: Flow chart of key procedure
Miscellaneous:
caller-ID unit is XTAL - 3.5795 MHz crystal
S1-S3 - Tactile switches (push-
given in Fig. 1.
to-on)
Actual-size, sin- DIS.1 - 16x1 LCD display module
gle-sided PCB lay- - RG11 connectors
out for the circuit - Tel. cable with connector
in Fig. 1, included - Body with knobs
keyboard (Fig. 8),
is given in Fig. 11. ever, before mounting the ICs, proceed as
The component follows:
layouts for PCB is 1. Do not connect telephone line.
given in Fig. 11. Power on the unit and check:
Software: 2. Mount LM393. Connect telephone
Software code in- lines. Check for following:
stalled in ROM of 3. Install micro-controller, LCD mod-
the micro-control- ule and memory IC. At power on “Have a
ler for proper op- nice day” message should appear on LCD
eration of the screen.
Fig. 15: Flow chart of DTMF procedure caller-ID unit is 4. Install DTMF decoder IC. Keep
intellectual prop- telephone line connected. Pick up the
• 15 stage multiple function timer. erty of the author, and the same can not handset and press any key on your
Out of 11 I/O pins, four pins are used be published at this stage for commercial/ telephone (make sure that telephone is
for data bus connection to LCD module, other reasons. However, software flow in tone mode) and keep it pressed. Check
DTMF decoder and keyboard (tactile chart for the main program and subrou- voltage at STD pin 15 of IC MT8870. It
switches). Two pins are used to interface tines is shown in Figs 13 and 14 through will be logic high as long as telephone
DTMF decoder (TOE and STD). Two pins 16. key is pressed.
are used for LCD controller (E and RS) The number pressed on telephone in-
interfacing. One pin is used for EEPROM strument will also appear on LCD dis-
clock signal (SCL). The pin required for Assembly and Testing play. Press more keys and numbers will
EEPROM data signal (SDA) is multiplexed Assembly of this unit is simple. Mount all continue to be displayed one after an-
with LCD module signal (RS). One pin parts as per the component/PCB layout. other. The number dialled will remain
scans keyboard. One pin scans off-hook/ For mounting ICs (except 5-volt regula- there as long as phone is off-hook. Once
on-hook status of the hand-set. tor) use sockets. No special soldering/as- you replace the handset, the standard
A complete schematic diagram of the sembly precautions are necessary. How- message “Have a nice day” will appear

ELECTRONICS PROJECTS Vol. 20 33


and DOWN key again
shows the last number re-
ceived.
7. To delete any
specific number, press UP
or DOWN key to view the
number to be deleted.
Press DEL key when the
number is on display. Dis-
play will blank out and the
number will be erased
from memory.
Pressing UP /DOWN
keys will show previous or
next numbers but the de-
leted number will not be
shown.
8. To delete all stored
numbers, switch off the
unit, press UP and DOWN
keys simultaneously.
Switch on the unit while
keeping both switches
pressed. Display will show
“Erasing Memory” mes-
sage for a few seconds and
then “Have a nice day”
message will be displayed.
Now all numbers stored in
the memory are erased
Fig 16: Flow chart of memory procedure permanently.
Your unit is ready.
again. Celebrate and have fun !
5. Short pin 7 of comparator LM393
to ground. Press some digits quickly or
use redial switch to dial out the last
What Next ?
number. This condition simulates the in- Additional functions like storing outgoing
coming number from telephone exchange. calls, missed calls, adding a new call indi-
Micro-controller thinks that unit is on- cator (blinking led), black listing speci-
hook (as pin 7 is forced to ground) and fied calls, date and time recording on all
accepts DTMF tones generated by tel- types of callers etc are also feasible. How-
ephone handset as originating from ex- ever, that requires more program memory
change. After receiving full number it in micro-controller. The present micro-con-
stores it in memory. Repeat this proce- troller version used has only 1240 bytes
dure with a few more numbers. All these of program memory and 11 I/O lines. For
numbers will be stored in memory as in- the above-mentioned upgradations a µ
coming numbers. controller with more inbuilt memory and
Remove the short. Unit is now in nor- I/O lines has to be used. Fig. 17: Flow-chart for 4-bit data interfacing on
mal condition. Last number displayed will Tech. Editor’s note: For more details LCD module (refer Tech.
remain on display till handset is picked regarding 68HC705KJ1 micro-controller,
and replaced. readers may refer to an article on the was done for 8-bit data. For 4-bit data
6. Press UP or DOWN key on key- subject in Electronics Projects Vol. 18. You interfacing, a software flow-chart using
board. The last number received will ap- may also access relevant technical data the same instruction set is given in
pear on screen. Press DOWN again and books by pointing the browser to http:// Fig. 17 for the benefit of EFY readers/
second last number will appear on screen. sps.motorola.com/csic if you have access subscribers. Flow-chart indicates that in
Press UP or DOWN to scroll through list to Internet. The instruction set and pro- ‘function set’ instruction the data length
of received calls. gramming aspects of LCD modules had parameter ‘DL’ is first set to (logic 1) for
If no key is pressed for five seconds, been dealt in some detail in a construc- 8-bit data and then changed over to (logic
the display reverts back to normal state, tion article on the subject which appeared 0) for 4-bit data operation. Only data lines
i.e. “Have a nice day” message or last re- elsewhere in Electronics Project Vol. 18. D4 through D7 are used for this initiali-
ceived number is displayed. Pressing UP However, the interfacing of LCD module sation. ❑

34 ELECTRONICS PROJECTS Vol. 20


Readers Comments: Satyajit Dutta dedicated programmer and the software,
EFY. After publication of the article a Bhopal both of which are not available to you.
number of readers have been approaching G There is an error in displaying incom- In reply to Mr Dutta’s letter, I would
the author for more information on KJ1 ing caller number. The first digit of STD like to say:
series microcontrollers from Motorola. code is displayed as the last digit of dis- The cost of a blank microcontroller is
Please note that EFY-CD’s issued with play. For example, if STD code is 0824 Rs 100 in the local market. Programmed
Dec ’01, Jan ’02 and Feb ’02 issues and phone number is 483521, the same is microcontrollers are available through
contains all necessary documents from displayed as 8244835210. Kits‘n’Spares (EFY’s associate).
author and M/s Motorola. Author had also How can I solve this problem? It is not possible to use EPROM or
offered for any further assistance (for Satish A. ROM in place of EEPROM, as the use of
product development). Desirous readers Mangalore the EEPROM is to store incoming tele-
may contact the author at his e-mail G The circuit works perfectly when pin phone numbers in memory and retain
address ‘gvc@vsnl.com.’ They may also 7 of the comparator is grounded. But them in the absence of power. Also, the
download any required documents, from when it comes to the real caller-ID sig- user should be able to delete the numbers
‘www.motorola.com’ website. nal, only the number of the first calling as and when required. EPROM or ROMs
Vinay Chaddha party is displayed, which doesn’t get do not offer the facility of writing and
(gvc@vsnl.com) stored in the memory. The MCU is not erasing with 5V.
G Could you let me know how to reset, so it prevents further numbers from As far as the use of 8085 is concerned,
program the microcontroller? It would be being displayed. These problems are not it is possible. However, it will require a
further appreciated if you please suggest seen when pin 7 is shorted to ground. minimum of four ICs to replace a single
me an application for feeding serial data Please suggest the solution. 16-pin microcontroller:
to frequency synthesiser chips, such as Deepa Mohan Microprocessor 8085 (40-pin device)
MC145156, used in digital radio tuners Through e-mail EPROM 2764 (28-pin device)
with LCD frequency readout. The author, Vinay Chaddha, replies: RAM 6264 (28-pin device)
Praveen Shanker In response to the letter from Praveen Address latch 74LS374 (20-pin device)
Hardwar Shankar I would like to say that: 8085 is an obsolete processor and is
G I request you to clarify my following Microcontrollers can be programmed not being used anywhere in any new or
doubts: using in-circuit emulator available from old design.
1. In our city neither DTMF mode nor Motorola or through its authorised In reply to Mr Satish’s letter, I would
CLIP facility is available. Could the de- distributors. However, as you have also like to say:
vice (ID) work under these conditions? experienced that they usually do not Please note that MTNL or DoT ex-
Please give possible modifications so that provide support to hobbyists, you can read changes send STD code of calling party
it can be used. and learn about KJ1 from data books avail- without zero prefix, i.e. Delhi code is sent
2. I have a (single) piece of able from the Website of Motorola so you as 11 and not as 011. Also, at the end, a
microcontroller IC MC68HC705KJ1, can design digital radio. In case you face zero is added to mark the end of caller-ID
which I have prchased from an electron- any problem, please feel free to ask for information. This is the reason for the
ics outlet. Can I use it in the circuit? any help. anamoly.
Amit Kumar Yadav In response to the letter from Amit The microcontroller or hardware has
Faizabad Kumar Yadav I would like to say follow- no problem or defect.
G The Caller-ID project (April ’99) was ing: In reply to Mr Deepa Mohan’s letter,
very interesting. I would like to know 1. Caller ID unit will work only if your I would like to say:
the price and availability of the exchange has this facility and they have When the phone handset is picked
C68HC705KJ1 microcontroller chip used. allowed this facility on your line. up, pin 7 of the comparator should go
In place of an EEPROM, is it possible to 2. The single piece of microcrontroller high. When the phone handset is put
use an EPROM or other ROM chips that that you have procured through some elec- down on the cradle, pin 7 of the compa-
are easily available? Can the circuit be tronics shop must be a blank piece. It rator should go low. If these equirements
modified so as to work with Intel 8085 cannot be used in the Caller-ID circuit. It is are not met, there is some problem with
microprocessor? not possible to program it without the the circuit. G

ELECTRONICS PROJECTS Vol. 20 35


MAINS FREQUENCY MONITOR
S. ARVIND

M
ains frequency meters are used wave pulses, which are then routed to a down sine wave pules are first filtered and
on control panels of almost all phase-locked loop (PLL). The PLL multi- then clipped using 5.1-volt zener diode
electrical equipment and thus plies the incoming mains frequency by a D3. These clipped pulses are directly fed
these are used in the industry in large factor of 100 and the resulting frequency to the input of CMOS phase-locked loop
numbers. The circuit presented here is displayed in a counter with a resolution CD4046 (IC1). IC 74LS390 (IC2), which is
converts the mains AC voltage to square of 0.01 Hz. a dual decimal counter; it divides the volt-
age-controlled oscillator (VCO) output fre-
quency by a factor of 100. This divided
Description frequency and the input mains frequency
The circuit is divided into are constantly tracked and kept in lock by
three sections: the PLL.
1. Power supply and Thus the frequency output of the VCO
clipping circuit (Fig. 1). is actually the mains frequency multiplied
2. PLL, counter and by 100. This frequency will be centred
display (Fig. 2). around 5 kHz (based on mains nominal
3. Control circuit to frequency of 50 Hz). The output from VCO
generate timing pulses for is fed to a 4-digit decade counter cum
counting the output from display driver IC 74C926 (IC3).
VCO (Fig. 3). CD4060 (IC4) is a binary counter/
Fig. 1: Power supply and clipper circuit The mains stepped- divider/oscillator IC which uses a 32.768

Fig. 2: Phase locked loop, counter and display circuit

36 ELECTRONICS PROJECTS Vol. 20


PARTS LIST
Semiconductors:
IC1 - CD4046 CMOS phase-
locked loop
IC2 - 74LS390 dual decade
counter
IC3 - 74C926 four-digit decade
counter/display driver
IC4 - CD4060 14-stage counter/
divider and oscillator
IC5 - CD4017 decade counter
IC6 - 74LS221 dual, one-shot,
monostable flip-flop
IC7 - 7805 regulator, 5-volt
D1, D2 - 1N4007 rectifier diode
D3 - 5.1-volt zener
T1-T4 - AC187 npn transistor
Fig. 3: Control circuit
Resistors (all ¼ W, ± 5% carbon, unless
KHz crystal. This gives a final output of 2 The main advantage of this circuit is stated otherwise):
Hz at pin 3. This is again divided by 2 that it gives a resolution of 0.01 Hz. Apart R1 - 220-kilo-ohm
R2-R5, R9 - 2.2-kilo-ohm
using CD4017 (IC5) to obtain 1Hz sym- from that, it also has an inherent noise- R6 - 1-kilo-ohm
metrical output. This 1Hz output is fed to rejection capability, and is quite stable R7 - 100-ohm
one of the inputs of 74LS221 (IC6), which and accurate. R8, R11 - 10-kilo-ohm
R10 - 150-kilo-ohm
is a dual, one-shot, monostable flip-flop. The circuit can be wired on a gener- R12, R13 - 47-ohm
This IC outputs a very-short-duration al-purpose PCB. However, a proper actu- Capacitors:
pulse which acts as the latch pulse for the al-size, single-sided PCB layout for the C1, C2 - 1nF ceramic disc
decade counter IC3 and thus it latches the complete circuit shown in Figs 1 through C3 - 1000µF, 25V electrolytic
output of the quad counters connected to 3 is given in Fig. 4. The component lay- C4, C7, C8 - 0.1µF ceramic disc
C5 - 1µF paper
7-segment displays. out for the PCB is given in Fig. 5. No C6 - 0.01µF ceramic disc
This latch pulse triggers the second special precautions are required to be fol- Miscellaneous:
monostable flip-flop inside IC6. This second lowed during construction. But due care Xtal - 32.768 KHz crystal
monoshot also generates a very-short-du- must be taken to handle the CMOS de- X1 - 230V AC primary to 12V-0
12V, 150mA sec. trans-
ration pulse which resets the quad counters vices. Use of IC bases is recom-ended. former
and prepares them for another counting This circuit can be easily fabricated us- DIS1-DIS4 - LT543 common-cathode
cycle. This cycle keeps on repeating. ing readily-available components. ❑ display

Fig. 4: Actual-size single-sided PCB for the circuits given in Figs 1 through Fig. 5: Component layout for the PCB shown in Fig. 4

ELECTRONICS PROJECTS Vol. 20 37


PARTY GAME
HOW OLD ARE YOU?
VASUDEVA BHATTA K.

T
his is an interesting circuit which which is, in fact, the decimal equivalent transistor, as explained later in the next.
displays a person’s age on the ba- of the binary address. The two decimal The EPROM is kept always in ‘read’ mode
sis of clues provided by the person. numbers after decoding by BCD to 7-seg- and the answer switch S10 (push-to-off) is
This could be an amusing party game which ment decoders/drivers are displayed as connected to the ‘display blank’ mode of
could also be used to guess a number. two LSB digits on common-anode displays both the 74LS47 ICs, so that the display
DIS1 and DIS2. remains blank when the answer button is
Since the circuit is restricted to show not pressed.
Description the age up to 150 years, the third decimal There are eight push-to-on switches,
At the heart of the circuit is an EPROM. display is configured to show either ‘1’ or to S1 to S8, which are connected to eight
The clues provided by an individual are remain blank. In case the display has to separate latches realised from sixteen 2-
converted into a binary address for the show decimal number equal to or greater input NAND gates (N1 to N16) from IC1
EPROM. In each of the memory locations, than 100, the ‘b’ and ‘c’ segments of the through IC4 (74LS00). One LED is con-
a two-digit decimal number is stored in third display digit are activated, making nected to each of the latched outputs. The
its binary-coded decimal (BCD) format, use of logic circuit and an LED driver LEDs remain glowing when the corre-

Fig. 1: Circuit diagram

38 ELECTRONICS PROJECTS Vol. 20


Table I: Hex dump of EPROM 1 3 5 7 9 11 13 15 17 19
76 4B 75 21 23 25 27 29 31 33 35 37 39
Sl. No. Address (Hex) Data (Hex) 77 4C 76 41 43 45 47 49 51 53 55 57 59
1 00 00 78 4D 77 61 63 65 67 69 71 73 75 77 79
2 01 01 79 4E 78 81 83 85 87 89 91 93 95 97 99
3 02 02 80 4F 79 101 103 105 107 109 111 113 115 117 119
4 03 03 81 50 80 121 123 125 127 129 131 133 135 137 139
5 04 04 82 51 81 141 143 145 147 149
6 05 05 83 52 82 S1/D1
7 06 06 84 53 83
85 54 84 2 3 6 7 10 11 14 15 18 19
8 07 07 22 23 26 27 30 31 34 35 38 39
9 08 08 86 55 85
87 56 86 42 43 46 47 50 51 54 55 58 59
10 09 09 62 63 66 67 70 71 74 75 78 79
11 0A 10 88 57 87
82 83 86 87 90 91 94 95 98 99
12 0B 11 89 58 88
102 103 106 107 110 111 114 115 118 119
13 0C 12 90 59 89
122 123 126 127 130 131 134 135 138 139
14 0D 13 91 5A 90 142 143 146 147 150
15 0E 14 92 5B 91
93 5C 92 S2/D2
16 0F 15
17 10 16 94 5D 93 4 5 6 7 12 13 14 15 20 21
18 11 17 95 5E 94 22 23 28 29 30 31 36 37 38 39
19 12 18 96 5F 95 44 45 46 47 52 53 54 55 60 61
20 13 19 97 60 96 62 63 68 69 70 71 76 77 78 79
21 14 20 98 61 97 84 85 86 87 92 93 94 95 100 101
22 15 21 99 62 98 102 103 108 109 110 111 116 117 118 119
23 16 22 100 63 99 124 125 126 127 132 133 134 135 140 141
24 17 23 101 64 00 142 143 148 149 150
25 18 24 102 65 01 S3/D3
26 19 25 103 66 02
104 67 03 8 9 10 11 12 13 14 15 24 25
27 1A 26 26 27 28 29 30 31 40 41 42 43
28 1B 27 105 68 04
44 45 46 47 56 57 58 59 60 61
29 1C 28 106 69 05
62 63 72 73 74 75 76 77 78 79
30 1D 29 107 6A 06 88 89 90 91 92 93 94 95 104 105
31 1E 30 108 6B 07 124 125 126 127 136 137 138 139 140 141
32 1F 31 109 6C 08 142 143
33 20 32 110 6D 09
111 6E 10 S4/D4
34 21 33
35 22 34 112 6F 11 16 17 18 19 20 21 22 23 24 25
36 23 35 113 70 12 26 27 28 29 30 31 48 49 50 51
37 24 36 114 71 13 52 53 54 55 56 57 58 59 60 61
38 25 37 115 72 14 62 63 80 81 82 83 84 85 86 87
39 26 38 116 73 15 88 89 90 91 92 93 94 95 112 113
40 27 39 117 74 16 114 115 116 117 118 119 120 121 123 124
41 28 40 118 75 17 125 126 127 144 145 146 147 148 149 150
42 29 41 119 76 18 S5/D5
43 2A 42 120 77 19 32 33 34 35 36 37 38 39 40 41
44 2B 43 121 78 20 42 43 44 45 46 47 48 49 50 51
45 2C 44 122 79 21 52 53 54 55 56 57 58 59 60 61
46 2D 45 123 7A 22 62 63 96 97 98 99 100 101 102 103
47 2E 46 124 7B 23 104 105 106 107 108 109 110 111 112 113
48 2F 47 125 7C 24 114 115 116 117 118 119 120 121 122 123
49 30 48 126 7D 25 124 125 126 127
50 31 49 127 7E 26 S6/D6
51 32 50 128 7F 27
129 80 28 64 65 66 67 68 69 70 71 72 73
52 33 51 74 75 76 77 78 79 80 81 82 83
53 34 52 130 81 29
131 82 30 84 85 86 87 88 89 90 91 92 93
54 35 53 94 95 96 97 98 99 100 101 102 103
55 36 54 132 83 31
133 84 32 104 105 106 107 108 109 110 111 112 113
56 37 55 114 115 116 117 118 119 120 121 122 123
57 38 56 134 85 33
135 86 34 124 125 126 127
58 39 57
59 3A 58 136 87 35 S7/D7
60 3B 59 137 88 36 128 129 130 131 132 133 134 135 136 137
61 3C 60 138 89 37 138 139 140 141 142 143 144 145 146 147
62 3D 61 139 8A 38 148 149 150
63 3E 62 140 8B 39
64 3F 63 141 8C 40 S8/D8
65 40 64 142 8D 41 quired logic 1 at the output of gate N25 to
66 41 65 143 8E 42
67 42 66 144 8F 43 operate ‘b’ and ‘c’ segments of the third
68 43 67 145 90 44 display digit. Remaining logic is designed
69 44 68 146 91 45 to give ‘high’ output at gate N25 only when
70 45 69 147 92 46
71 46 70 148 93 47 the 4-bit BCD data stored in EPROM for
72 47 71 149 94 48 driving the second decimal digit is other
73 48 72 150 95 49
151 96 50
than 1001 (i.e. decimal 9) and second nib-
74 49 73
75 4A 74 ble (4-bit MSB part) of the 8-bit hexadeci-
Outputs from NAND gates N10, N12, mal address is 0110 or above. In other
sponding switch (S1 through S8) at the N14 and N16 are taken out through four words, logic output of gate N25 will be logic
input to the latch is pressed. transistors (T1 to T4) to obtain the re- 1 only when the age of a person to be

ELECTRONICS PROJECTS Vol. 20 39


ward biasing of transistor T7 to
light up LEDs 9 and 10 to form 1 in
the 100th digit. Alternatively, one
can discard the LEDs and use the
same transistor to energise
segments ‘b’ and ‘c’ of 7-segment
display DIS3. Two 7447 ICs drive
the first two displays (DIS1 and
DIS2) using 8-bit BCD data stored
in EPROM, as mentioned earlier.

Operation
Before starting the game, one must
press ‘reset’ switch S9 to ensure
that all the LEDs are in off state
initially. There are eight blocks of
numbers displayed on the front
display panel and each block is
associated with a switch and an
Fig. 2: Actual-size single-sided PCB pattern suggested for the circuit of Fig. 1 LED indicator. First, the person
whose age has to be guessed has to
thoroughly search for his/her age
(in full years) in each of the eight
blocks. Then the switches (S1
through S8) corresponding to
those blocks in which his/her age
figures, should be pressed (indi-
cated by lighting of the corre-
sponding LEDs mounted next to
each of the eight switches) one
after the other. Once all the corre-
sponding switches have been
pressed, you may press the answer
pushbutton (S10) to get the age
displayed on the board.

Logic
In fact, the numbers in each block
are so arranged that by pressing
the corresponding switches, you
Fig. 3: Component layout for the PCB of Fig. 2
are generating a binary number which is
PARTS LIST equivalent to the age (in decimal number).
This binary number acts as address for
Semiconductors: Resistors (all ¼ W, ± 5% carbon, unless
IC1-IC4 - 74LS00 quad 2-input stated otherwise): EPROM, and the BCD data at that
NAND gate R1-R12 - 2.2-kilo-ohm location, when converted to decimal, is
IC5 - 2732 EPROM (4096x8) bit R13-R20 - 390-ohm equivalent to the hex address itself.
IC6-IC8 - 74LS20 dual 4-input R21 - 100-ohm
NAND gate R22-R27 - 1.5-kilo-ohm Single-sided PCB for the circuit shown
IC9 - 74LS21 dual 4-input AND R28-R32 - 1-kilo-ohm in Fig. 1 is given in Fig. 2 while its com-
gate ponent layout is given in Fig. 3. Please
Capacitors:
IC10 - 74LS32 quad input OR
gate
C1, C2 - 0.1µF ceramic disc note that outputs from IC5 (pins 14, 15,
IC11 - 74LS08 quad 2-input AND Miscellaneous: 16 and 17) have been brought to pins 1-4
gate DIS1-DIS3 - LT542 common-anode of SIP ‘A’ connector those from transistors
IC12, IC13 - 74LS47 BCD to 7-segment display (collectors) T4-T1 have been brought to
decoder/driver S1-S9 - Tactile microswitch (N/O)
IC14 - 74LS04 hex inverter S10 - Tactile microswitch (N/C) SIP ‘B’. These are to be extended to I/Ps
T1-T6 - BC547 npn transistor LED1-LED10 - Red LEDs of gates N18-N32 (except N26) using
jumper wires. Correct programming of the
displayed is 100 or more. This will be clear put of gate N25 is logic 1, and if the answer EPROM is the key to the successful op-
from EPROM’s hex data stored at various push switch is pressed, both inputs to AND eration of the circuit. Hence the program-
addresses as shown in Table I. When out- gate N26 are logic 1. This results in for- ming should be done carefully. ❑

40 ELECTRONICS PROJECTS Vol. 20


CHIP-CARD READER–
PROGRAMMER USING IBM PC
H.K. BHARUCHA & A.A. RANA

O
ver two billion chip-cards are ex- There is no limit to the extent to connector of the parallel port.
pected to be in circulation world- which the parallel port of the PC can be External power supply can be derived
wide by the year 2000. Chip-cards used as it provides ample number of TTL from a 4.5V battery as the system con-
are the future of money and business. compatible input and output lines. The sumes a very small amount of power be-
They represent an untapped source of op- present project uses parallel port (LPT1) cause the contacts are made only during
portunities for various businesses—ATM/ for conveying data to and from the chip- the transactions and that too for a few sec-
electronic cash, credit card payments, card in a serial fashion.
medical/employee information manage- Lines from two ports of
ment, security/loyalty checking, etc. Rec- LPT1—port A with ad-
ognising this, the banks, card companies, dress 378H and port B
telecom operators, transit authorities and with address 379H—are
even government bodies are already de- used for this purpose.
veloping chip-card projects. The use of serial mode
A chip-card stores and processes in- of data transfer is not sur-
formation on a chip (i.e. an integrated prising because a chip-card Fig. 1: Block diagram of chip-chip reader-programmer
circuit) embedded in the card. A mini- should have as few elec-
mum amount of hardware is needed to trical contacts as possible
build a chip-card as shown in the block for its reliable operation.
diagram of Fig. 1. The use of a PC is not This leads to the use of se-
inevitable; instead of PC, a standalone rial E2PROM as the data
microprocessor system capable of input/ storage IC of the chip-card.
output (I/O) operations and some memory The contacts of chip-
can be used. But PC offers user-friendly card include the power
interface as well as opens doors to many connections (Vcc and Gnd),
new applications. Other chip-card appli- data lines (one each for in-
cations include its use as a credit card, a put and output) and two
telephone card, an attendance card for control input lines (chip-
factory employees and an electronic door- select and clock)—all op-
lock system. erating at TTL levels. Fig.
2 shows the schematic dia-
PARTS LIST gram of the chip-card
Semiconductors: reader including its con-
IC1 - NM93C46 1024-bit serial nection to the 25-pin D Fig.2: Schematic circuit diagram of chip-card reader-programmer
E2PROM
D1 - 1N4148 switching diode
LED1 - Red LED TABLE I
Resistors (all ¼ W, ± 5% carbon, unless Instruction set for NM93C46
stated otherwise): Start Operation Address Data Mode
R1 - 220-ohm Bit Code
Miscellaneous: 1 10 A5, A4, A3, A2, A1, A0 — Read register at address A5-A0
- 5-pin SIP connector 1 01 A5, A4, A3, A2, A1, A0 D15..D0 Write register at address A5-A0
- 25-pin male/female D 1 11 A5, A4, A3, A2, A1, A0 — Erase register at address A5-A0
connectors with ribbon 1 00 11XXXX — Erase/write enable
cable 1 00 00XXXX — Erase/write disable
- 4.5V DC power supply 1 00 10XXXX — Erase all registers
source 1 00 01XXXX D15..D0 Write all registers

ELECTRONICS PROJECTS Vol. 20 41


Fig. 3: Actual-size PCB (with contact plates on
top side) which is connected to PC and external
power supply

Fig. 4: Silk-screen overlay for PCB of Fig. 3

Fig. 5: Actual-size chip-card PCB with contact


plates (bottom view)

Fig. 7: Flow chart for the main program

Fig. 6: Component layout for PCB of Fig. 5 screen for the same are shown in Figs 3 board. This second PCB (the actual chip-
and 4 respectively. The other part of the card) and its component layout are shown
onds only. This will be clear from the fact assembly containing the E2PROM IC and in Figs 5 and 6 respectively.
that the circuit is assembled in two parts on other circuit components is assembled on The components on chip-card com-
two different PCBs. One of the PCBs has a separate PCB with contact plates on prise only one chip (NM93C46—a 1024-
contact plates (on the top side, i.e. compo- the bottom side such that when this PCB bit serial E2PROM) and a few passive com-
nent side) which are connected to the 25- is placed over the former PCB with their ponents per card to store the data. This
pin parallel port of PC using five leads and contact plates properly aligned, the cir- results in a very compact sized chip-card.
the external supply (4.5V) using two leads. cuit gets completed for programming/ If further reduction is needed, as in the
The actual-size PCB and the silk transaction processing via the PC key- case of a mobile telephone handset, an

42 ELECTRONICS PROJECTS Vol. 20


1. 2V to 5.5V op- in the previous step.
eration in read mode • The chip-select line is inactivated.
and 2.5 to 5.5 V in all A sample application of the chip-card
other modes. as a credit card is presented here. The PC
2. Typical active emulates the chip-card reader/program-
current of 400 µA and mer machine. The software for data trans-
standby current of 25 fer and user interface is written in ‘C’.
µA. The user interface portion is divided into
3. Self-timed pro- three parts.
gramming cycle. These are ‘De-
4. 40 years data re- posit’, ‘With-
tention. drawal’ and
Table I describes ‘Verify’ modules
the commands ac- respectively.
cepted by 9346. When the card
Timing diagrams user deposits
comprising synchro- money, he/she is
nous data timing, presented with
read, write, write en- e-cash in the
able and write disable Fig. 11: Flow-chart for form of a chip-
are shown in Fig. 12. read_bit function card with
The se-
quence for
communica-
tion of pro-
grammer (PC
Fig. 8: Flow chart for write-9346 Fig. 10: Flow chart for read-9346 is used as
function function programmer
SMD version of here) with the chip-card contain-
the chip can be ing NM93C46-E2PROM is as fol-
used to achieve lows:
the reduction in • The chip is selected by
size. making the chip select line high.
The chip- • A start bit ‘1’ (as MSB of
card connector any instruction) is sent on data
layout used in input line which indicates to the
this project is chip the beginning of memory ac-
the same as that cess. A bit can be sent by plac-
of SIM card ing data on data i/p (Din) line
Fig. 9: Flow chart for (subscriber iden- and activating the clock line. A
write_bit function tification mod- bit can be read by activating
ule) for mobile phones. The signals out- clock line and then sampling
put from the PC (chip-card reader-pro- data placed by the chip on data
grammer) are CS (chip select), CLK output (Dout) line.
(clock) and Din (data input to chip). These • Two operation code bits are
are supplied from LPT1 port A, pins PA0, set on Din line to indicate the
PA2 and PA1 respectively. The signal in- mode (e.g. read, write, erase etc.)
put to the PC and output from chip-card • Six bits are sent on Din
is Dout (data output from chip), which is line to chip, specifying the ad-
read through LPT1 port B pin PB4. R1 is dress of the location which is to
the current limiting resistor and D2 is an be accessed.
LED which indicates whether the chip- • If a write operation is de-
card and the connector have perfect con- sired, sixteen bits are sent on Din
tacts or not. D1 protects the chip-card line to the chip specifying the
from power supply reversal in case of an data to be written at the loca-
operational mistake. tion specified in the previous
The National Semiconductor’s step.
NM93C46 device contains 1024 bits of • If a read operation is
non-volatile, electrically erasable memory desired, sixteen bits are read
divided into 64x16-bit registers. It fea- from Dout line, which are the
tures: contents of the location specified Fig. 12: Timing charts for various operations

ELECTRONICS PROJECTS Vol. 20 43


certain specific balance amount. For pay- by simply pressing the card against the and ‘read_bit’ functions. These in turn are
ing the bills, the user now has to simply card connector and executing an appro- used for larger blocks viz. ‘Write_9346’
press the card (PCB, Fig. 5) against the priate menu item of the program. The and ‘Read_9346’ functions to write and
card connector (PCB, Fig. 3) of card reader bit-wise operations in ‘C’ and its capabil- read a 16-bit data word respectively to/
machine and the amount is deducted from ity to control hardware ports directly is from the specified chip-card address. Rest
the balance. Of course, in all the transac- used to full advantage in this applica- of the work is as simple as playing a game
tions, security is incorporated in the form tion. A stream of 25 bits comprising one of blocks! The flowcharts for the program
of a password and identification number start-bit, 2-bit op-code, 6-bit address and are shown in Figs 7 through 11.
checking modules. 16-bit data are sent in serial fashion. The ❑
The chip-card transaction is achieved basic building blocks are the ‘write_bit’

Software Program
/* Chipcard Reader Programmer System by setbkcolor(EGA_BLACK); printf(“ \n 1. Viewing Card Details “);
H.K.BHARUCHA & A.A.RANA */ setcolor(EGA_WHITE); printf(“ \n 2. Data Entry”);
#include <stdio.h> rectangle(LEFT,TOP,RIGHT,BOTTOM); printf(“ \n 3. Exit”);
#include <conio.h> moveto(LEFT*2,TOP*2); printf(“\n YOUR CHOICE :”);
#include <graphics.h> lineto(RIGHT,TOP*2); scanf(“ %d”,&ch);
#include <stdlib.h> moveto(LEFT*2+10,TOP*2+10); switch(ch)
#include <string.h> lineto(RIGHT,TOP*2+10); {
settextstyle(TRIPLEX_FONT,HORI_DIR,FONT_SIZE); case 1: view();
#define PORTA 0x378 /* Address for LPT1 */ settextjustify(CENTER_TEXT,CENTER_TEXT); break;
#define PORTB 0x379 outtextxy(x,y,”CHIP CARD READER / case 2: data_ent();
#define CS 0x01 PROGRAMMER”); break;
#define STARTBIT 0x01 outtextxy(x,y+100,” DEVELOPED BY:”); case 3: exit(0);
#define ID_ADD 0x05 outtextxy(x,y+150,” H.K.Bharucha & default: printf(“\n Invalid Choice”);
#define BAL_ADD 0x0f Rana Amisha”); }
#define ID_NO 31572 delay(500); }
#define HORI_DIR 0 setcolor(EGA_BLACK); } /* end of main */
outtextxy(x,y,“CHIP-CARD READER
/* INITIALIZATION OF THE PROTOTYPES PROGRAMMER”); /*Function to write a word(16-Bit) to EEPROM*/
FOR THE MAIN PROGRAM */ outtextxy(x,y+100,”DEVELOPED BY:”); void write_9346(int my_add,unsigned int
void enable_9346(void); outtextxy(x,y+150,” H.K.Bharucha & Rana my_data)
void write_9346(int my_add,unsigned int Amisha”); {
my_data); delay(500); int i,new_add,new_data;
void disable_9346(void); } long int j;
unsigned int read_9346(int my_add); closegraph(); / * outportb(PORTA,CS); /* Give chip select high
void write_bit(int data); Back to the text mode */ to write a bit */
int read_bit(); getch(); write_bit(STARTBIT); /* Give startbit to write
void deposit(void); while(try!=3) /* MAIN MENU */ a bit,refer Table.1*/
void withdrawal(void); { write_bit(0x00); /* Give mode bit 1 for write
void data_ent(); printf(“ \n ENTER PASSWORD:”); operation */
void view(); for (i=0;i<8;i++) write_bit(0x01); /* Give mode bit 2 for write
{ operation */
void main(void) pass[i]=getch(); j=0x20;
{ printf(“ %c”,st); for(i=0; i<6; i++)
char pwd[]=”CHIPCARD” ,pass[10], } {
FONT_SIZE=4,st[]=”*”, ch; /* CHIPCARD is pass[i]=’\0'; new_add=(my_add & j);
used as pass-word */ if(strcmp(pass,pwd)!=0) write_bit(new_add);
int LEFT,RIGHT,TOP,BOTTOM; { j=j>>1;
int i,x,y,try=0; printf(“\n Invalid password ! ! !”); }
int driver,mode; printf(“\n Try Again ! !”); j=0x8000; /* j is a 16-bit masking number */
detectgraph(&driver,&mode); try++; for(i=0; i<16; i++)
initgraph(&driver,&mode,”d:\\bc\\bgi”); } {
/* path of bgi driver may be different on else new_data=(my_data & j); /* mask all except
different systems */ { current bit */
x=getmaxx()/2; break; write_bit(new_data);
y=getmaxy()/2; } j=j>>1;
enable_9346(); if(try==3) }
delay(1000); { outportb(PORTA,0x00); /* Remove chip select */
write_9346(ID_ADD,ID_NO); printf(“Only three trials allowed !!\n }
delay(1000); Exiting from program ...”);
disable_9346(); exit(1); /* FUNCTION TO WRITE SINGLE BIT IN TO
/* Setup & Display Opening Screen in Graphics } SERIAL E2PROM */
Mode. */ } void write_bit(int data)
LEFT=x/3; for(;;) {
RIGHT=x; /* Main Menu Loop */ if (data==0)
TOP=y/4; { {
BOTTOM=y-y/4; clrscr(); data=(CS); /* Continue to give chip select */
while(!kbhit()) printf(“\n Main Menu”); outportb(PORTA,data);
{ printf(“\n *********”); }

44 ELECTRONICS PROJECTS Vol. 20


else WRITING REFER TABLE.1 */ scanf(“ %lu”,&get_dep);
{ void enable_9346(void) if ((get_dep+bal) < 65535)
data=(CS | 0x02); /* Mask all bits except data */ { {
outportb(PORTA,data); outportb(PORTA,CS); dep = get_dep;
} write_bit(STARTBIT); /* Give startbit to enable c_bal=( dep + bal);
data=(data | 0x04); /* Give clock pulse */ a bit */ enable_9346();
outportb(PORTA,data); write_bit(0x00); /* Give mode Bit 1 for write delay(1000);
data=(data ^ 0x04); /* Remove clock pulse */ enable operation */ write_9346(BAL_ADD,c_bal);
outportb(PORTA,data); write_bit(0x00); /* Give mode Bit 2 for write delay(1000);
data=(CS); /* Continue to give Chip Select */ enable operation */ disable_9346();
outportb(PORTA,data); write_bit(0x01); /* Give address bits to delay(1000);
return; enable 9346 */ }
} write_bit(0x01); else
/* FUNCTION TO READ A WORD(16-bit) write_bit(0x00); {
FROM SERIAL EEPROM */ write_bit(0x00); printf(“Deposit Amount / Balance too Large !!”);
unsigned int read_9346(int my_add) write_bit(0x00); getch();
{ write_bit(0x00); }
int i,j,new_add,my_bit; outportb(PORTA,0x00); return;
long int my_data; } }
outportb(PORTA,CS); /* Give chip select to
read a bit */ /* TO DISABLE THE SERIAL EEPROM CHIP void withdrawal(void)
write_bit(STARTBIT); /* Give a startbit to read IC-9346 */ {
data,refer Table.1 */ void disable_9346(void) unsigned int bal,c_bal,with;
write_bit(0x01); /* Give mode bit 1 for read { unsigned long int get_with;
operation */ outportb(PORTA,CS); /* Give chip select */ printf(“ Enter Withdrawal Amount Rs. “);
write_bit(0x00); /* Give mode bit 2 for read write_bit(STARTBIT); /* Give a startbit to scanf(“ %lu”,&get_with);
operation */ disable a bit */ if (get_with < 65535)
j=0x20; write_bit(0x00); /* Give mode bit 1 for write {
for(i=0; i<6; i++) disable operation */ with = get_with;
{ write_bit(0x00); /* Give mode bit 2 for write bal=read_9346(BAL_ADD);
new_add=(my_add & j); disable operation */ if( with > bal )
write_bit(new_add); write_bit(0x00); /* Give address bits to {
j=j>>1; disable 9346 */ printf(“ \n The Withdrawal Amount Exceeds
} write_bit(0x00); Balance Amount “);
my_data=0x0000; write_bit(0x00); printf(“ \n YOUR BALANCE IS Rs.
for(i=0; i<16; i++) write_bit(0x00); %u”,bal);
{ write_bit(0x00); }
my_data=my_data<<1; write_bit(0x00); else
/* Bitwise Left shift */ outportb(PORTA,0x00); /* Remove chip select {
my_bit=read_bit(); /* Get one bit of data */ */ c_bal= (bal - with );
my_data=(my_bit | my_data); /* OR it with } enable_9346();
data word */ delay(1000);
} /* Function for Data Entry Menu */
outportb(PORTA,0x00); / * void data_ent() write_9346(BAL_ADD,c_bal);
Remove chip select */ { delay(1000);
return(my_data); unsigned int cid_no,ch; disable_9346();
} int my_add=0x05; delay(1000);
clrscr(); }
/* FUNCTION TO READ SINGLE BIT FROM printf(“ DATA ENTRY SCREEN “); }
SERIAL E2PROM */ cid_no= read_9346(my_add); else
int read_bit () printf(“ \n IDENTIFICATION NUMBER: %u”, {
{ cid_no); printf(“Withdrawal Amount too Large !!”);
int data,rv; printf(“ \n 1. Deposit”); getch();
data=(CS | 0x04); /* Apply clock pulse */ printf(“ \n 2. Withdrawals”); }
outportb(PORTA,data); printf(“ \n 3. Exit”); printf(“ \n Press any key to continue”);
rv=inportb(PORTB); /* Read the data from input printf(“ \n Your Choice:”); getch();
port */ scanf(“ %d”,&ch); return;
data = (data ^ 0x04); /* Remove the clock pulse*/ switch(ch) }
outportb(PORTA,data); { /* Function for viewing/verifying Balance */
rv = rv & 0x10; /* Mask everything except data case 1: deposit(); void view()
bit */ break; {
if (rv==0) case 2: withdrawal(); unsigned int cid_no, bal_amt;
{ break; clrscr();
data=0x0; case 3: exit(0); printf(“\n\n VIEWING SCREEN \n\n” );
} default: printf(“ Invalid choice”); cid_no=read_9346(ID_ADD);
else } printf(“ Identification Number: %u”, cid_no);
{ } bal_amt=read_9346(BAL_ADD);
data=0x1; printf(“ \n YOUR BALANCE IS Rs. %u”,
} void deposit(void) bal_amt);
return(data); { printf(“ \n Press any key to return to Main
} unsigned int dep,c_bal,bal; Menu”);
unsigned long int get_dep; getch();
bal=read_9346(BAL_ADD); return;
/* FUNCTION TO ENABLE THE CHIP FOR printf(“ Enter Deposit Amount Rs. “); }

ELECTRONICS PROJECTS Vol. 20 45


MORSE ENCODER
JUNOMON ABRAHAM

A
lthough better modes of com- Keyboard
munication such as voice section: Here
communication are available, matrix key- +

Morse code is still being used universally board is used


for land and off-shore wireless in scanning
communications by professionals and mode. The
amateurs alike. Its main advantages are: scanning is
1. The ability to use higher-power done using a
transmitters for long-range communica- 3-line to 8-line
tion as the modulation percentage can go decoder 74
up to 100 per cent. LS138 (IC3)
2. The regional accent and pronuncia- and a dual
tion does not affect the faithful transmis- 4-bit multi-
sion of a message using Morse code. plexer CD
All defence forces, police, railways and 4052 (IC4).
telecom organisations use Morse code for The binary
communication on a regular basis. Thus, number re-
the learning of Morse code forms an inte- quired for
gral part of the wireless communication scanning is
system. provided by a
12-bit binary
counter CD
Description 4040 (IC2)
The circuit presented here is used and the clock
for learning and practising the reception pulses for the
of Morse code. It converts each character same are ob-
into dots (pronounced as ‘di’ or ‘dit’) and tained from
dashes (pronounced as ‘dah’) correspond- timer 555
ing to Morse code. This circuit can be (IC1), which is
divided into two sections, viz, the key- used as an
board and coder sections. astable multi
vibrator. With
TABLE I the timing
components
Morse Code
employed as
Letters Numbers
shown in
A.– K–.– U..– 1.––––
Fig.1, the fre-
B–... L.–.. V...– 2..–––
C–.–. M–– W.–– 3...–– quency of
D–.. N–. X–..– 4....– scanning is
E. O––– Y–.–– 5..... around 2 kHz.
F..–. P.––. Z––.. 6–.... When a
G––. Q––.– 7––...
H.... R.–. 8–––.. switch is
I.. S... 9––––. closed at a
J.––– T– 0––––– particular bi-
Some punctuation signs nary number
output from
Full stop . – . – . –
Coma – – . . – –
IC2, output
Colon – – – . . . pin 13 of mul-
Interrogation mark . . – – . . tiplexer IC4 Fig. 1: Schematic circuit diagram of morse encoder

46 ELECTRONICS PROJECTS Vol. 20


PARTS LIST
Semiconductors:
IC1 - NE555 timer
IC2 - CD4040, 12-bit binary
counter
IC3 - 74LS138, 3-line to 8-line
decoder
IC4 - CD4052, dual 4-bit multi-
plexer
IC5 - CD4060, 14-stage binary
counter and oscillator
IC6 - 27C32, 4096x8 bit EPROM
IC7 - 7805, 5-volt regulator
T1 - BC547, npn transistor

Resistors (all ¼-watt, ± 5% carbon, unless


stated otherwise):
R1 - 6.8-kilo-ohm
R2 - 15-kilo-ohm
R3-R6 - 2.2-kilo-ohm
Fig. 2: Actual-size, single-sided PCB for the circuit R7, R10 - 4.7 kilo-ohm
R8 - 1-mega-ohm
R9, R11 - 10-kilo-ohm
VR1 - 100-kilo-ohm variable (linear)
VR2 - 47-kilo-ohm variable (log)
Capacitors:
C1 - 0.02µF ceramic disc
C2, C3 - 0.01µF ceramic disc
C4 - 0.1µF ceramic disc

Miscellaneous:
S1-S20 - SPST push-to-on keyboard/
tactile switch
S21 - DPDT switch
- Piezo buzzer

data bits D2 and D3 only are accessed.


Only data bits D0 and D2 are used for
producing audible note whereas bits D1
and D3 are used for resetting the byte
Fig. 3: Component layout for the PCB counter IC5 in positions 1 and 2 respec-
tively of the function switch S21. Position
goes low and this resets the 555 timer. provides five lower address bits while 1 of the function switch selects the first
Thus, no further clock is supplied by the next five address bits are provided character as annotated at each of the key-
IC1, and therefore IC2 CD4040 remains by CD4040 (IC2); the latter part of board switch while position 2 selects the
latched in its existing state till the address is considered the page address. second series of characters as shown af-
pressed key-switch is released. A unique The remaining address bits are grounded. ter the oblique line at each switch. Thus,
binary number is associated with this The data are stored page-wise in the operation of the function switch is equiva-
key (switch) such that it activates a spe- EPROM, with each page consisting of 32 lent to shift-key operation in a typewriter
cific column and row when this switch is bytes. Thus, while the pages are ad- or computer key-board.
closed. Similarly, with each keyboard dressed by IC2, each of the 32 bytes of A dot is represented by a single
switch, a different unique binary number every page is addressed by IC5 in a ‘high’ (logic 1) bit and dash is represented
or row and column combination is asso- cyclic fashion as the oscillator forming by high bit in three sequential address
ciated. The same binary number is made integral part of this IC functions as a locations (in same data-bit position),
available to the coding section. free-running oscillator. while a space between two elements is
Coding section: The heart of the When a keyboard switch is closed, the equal to a single low (logic 0) bit. These
coding section is EPROM 27C32 (IC6). It output of IC2 is stable at a particular bits are stored in adjacent memory
contains coded form of each character. binary value and CE pin 18 of EPROM, locations in a specified order. When byte
The memory locations (addresses) and connected to output pin 13 of IC4, goes address is increased, each data is output
the data stored against each address are low. This binary number is the address one by one. A high bit in D0/D2 position
given in Table II. Please note that an ‘X’, of the page where the Morse code data produces sound and thus converts a char-
in the table means ‘do not care,’ i.e. the for the particular character is stored. Only acter into audible Morse code. After the
contents could be any hex digit. The two data bits of the memory are used for last data, a reset bit is inserted at
addressing of this EPROM is done by each character. With function switch S21 D1/D3 positions. When this memory
two ICs, one of which is 14-stage binary in position 1, only bits D0 and D1 are location is accessed, the counter auto-
counter and oscillator CD4060 (IC5). It accessed while in position 2 of switch S21, matically resets and repeats the character

ELECTRONICS PROJECTS Vol. 20 47


TABLE II: Hex Contents of EPROM 27C32
Address Data Address Data Address Data Address DataAddress Data Address Data Address Data
A/U
000 X5 06B X0 OCE X4 127 X1 18C X4 1E5 X4 22C X4
001 X0 06C X0 0CF X4 128 X5 18D X0 1E6 X5 22D X4
002 X5 06D X0 0D0 X4 129 X4 18E X0 1E7 X1 22E X4
003 X1 06E X8 0D1 X0 12A X5 18F X0 1E8 X5 22F X0
004 X5 E/Y 0D2 X0 12B X1 190 X8 1E9 X4 230 X4
005 X4 080 X5 0D3 X0 12C X1 N/8 1EA X5 231 X4
006 X4 081 X4 0D4 X8 12D X0 1A0 X5 1EB X0 232 X4
007 X0 082 X4 H/2 12E X8 1A1 X5 1EC X4 233 X0
008 X2 083 X0 0E0 X5 12F X0 1A2 X5 1ED X4 234 X0
009 X0 084 X6 0E1 X0 130 X2 1A3 X0 1EE X6 235 X0
00A X8 085 X0 0E2 X5 K/5 1A4 X5 1EF X0 236 X8
B/V 086 X4 0E3 X0 140 X5 1A5 X4 1F0 X4 S/:
020 X5 087 X4 0E4 X5 141 X1 1A6 X4 1F1 X4 240 X5
021 X1 088 X4 0E5 X4 142 X5 1A7 X0 1F2 X4 241 X4
022 X5 089 X0 0E6 X5 143 X0 1A8 X6 1F3 X0 242 X5
023 X0 08A X4 0E7 X0 144 X5 1A9 X4 1F4 X0 243 X0
024 X5 08B X4 0E8 X4 145 X0 1AA X4 1F5 X0 244 X5
025 X0 08C X4 0E9 X4 146 X5 1AB X0 1F6 X8 245 X4
026 X5 08D X0 0EA X6 147 X1 1AC X4 Q/. 246 X4
027 X4 08E X0 0EB X0 148 X5 1AD X0 200 X5 247 X0
028 X5 08F X0 0EC X4 149 X0 1AE X4 201 X1 248 X6
029 X0 090 X8 0ED X4 14A X0 1AF X0 202 X5 249 X4
02A X0 F/Z 0EE X4 14B X0 1B0 X0 203 X4 24A X4
02B X0 0A0 X5 0EF X0 14C XA 1B1 X0 204 X5 24B X0
02C XA 0A1 X4 0F0 X0 L/6 1B2 X8 205 X1 24C X4
C/W 0A2 X5 0F1 X0 160 X5 O/9 206 X5 24D X0
040 X5 0A3 X0 0F2 X8 161 X4 1C0 X5 207 X0 24E X4
041 X1 0A4 X5 I/3 162 X5 1C1 X5 208 X5 24F X0
042 X5 0A5 X5 100 X5 163 X1 1C2 X5 209 X4 250 X4
043 X4 0A6 X5 101 X0 164 X5 1C3 X0 20A X5 251 X0
044 X5 0A7 X0 102 X5 165 X0 1C4 X5 20B X1 252 X0
045 X0 0A8 X5 103 X0 166 X5 1C5 X5 20C X5 253 X0
046 X5 0A9 X0 104 X4 167 X0 1C6 X5 20D X0 254 X8
047 X5 0AA X4 105 X0 168 X5 1C7 X0 20E X4 T/*
048 X5 0AB X0 106 X6 169 X0 1C8 X5 20F X4 260 X5
049 X0 0AC X2 107 X4 16A X4 1C9 X5 210 X6 261 X1
04A X1 0AD X0 108 X4 16B X0 1CA X5 211 X0 262 X5
04B X0 0AE X8 109 X0 16C X2 1CB X0 212 X0 263 X0
04C X8 G/1 10A X4 16D X0 1CC X4 213 X0 264 X4
04D X0 0C0 X5 10B X4 16E X8 1CD X4 214 X8 265 X4
04E X2 0C1 X1 10C X4 M/7 1CE X6 R/, 266 X6
D/X 0C2 X5 10D X0 180 X5 1CF X0 220 X5 267 X0
060 X5 0C3 X4 10E X0 181 X5 1D0 X4 221 X4 268 X4
061 X5 0C4 X5 10F X0 182 X5 1D1 X0 222 X5 269 X4
062 X5 0C5 X1 110 X8 183 X0 1D2 X0 223 X1 26A X4
063 X0 0C6 X5 J/4 184 X5 1D3 X0 224 X5 26B X0
064 X5 0C7 X4 120 X5 185 X5 1D4 X8 225 X4 26C X4
065 X0 0C8 X5 121 X0 186 X5 P/0 226 X5 26D X0
066 X5 0C9 X0 122 X5 187 X0 1E0 X5 227 X0 26E X4
067 X0 0CA X4 123 X1 188 X4 1E1 X4 228 X4 26F X0
068 X4 0CB X4 124 X5 189 X0 1E2 X5 229 X0 270 X0
069 X4 0CC X6 125 X0 18A X6 1E3 X1 22A X6 271 X0
06A X6 0CD X0 126 X5 18B X0 1E4 X5 22B X0 272 X8

again. This will continue until the key is responding to various letters of the The actual-size, single-sided PCB for
open, i.e. until another key is pressed. English alphabets, numerals and some the circuit is given in Fig. 2 and its com-
The volume can be controlled by varying punctuation marks used in this project ponent layout is shown in Fig. 3.
volume control VR2. The Morse code cor- (keyboard) is given in Table I. ❑

48 ELECTRONICS PROJECTS Vol. 20


LONG-RANGE
REMOTE CONTROL
BHASKAR BANERJEE

T
he circuit presented here can be
used to remotely control a number
of electrical or electronic gadgets
connected to it. Unlike IR remote control,
this circuit employs FM transmission and
reception, and hence it can be used for
comparatively longer range. Any gadget
can be switched on/off by keying the
number allocated to it. The keyboard used
with the transmitter is similar to those
used in basic version of DTMF telephones.
The system is thus composed of two sub-
systems which are described below.

Description
Code generator and transmitter. The
code generator part is shown in Fig. 1. It is
a standard DTMF generator built around
IC1, UM91215B. IC1 generates the DTMF Fig. 1: Schematic diagram of DTMF coder-transmitter
signal corresponding to the number
entered from the keyboard. The signal thus
generated is fed to an FM transmitter. As
a number of FM transmitter circuits (for
example, Quality FM Transmitter by
Pradeep G. published in April ’98 (repro-
duced in Electronics Project Vol. 19) have
been published in EFY earlier, which can
be suitably adopted. The circuit of the
transmitter is therefore not included here.
The operating range of the present system
would, however, depend on the range of
the transmitter.
Receiver and decoder. The circuit
diagram of receiver and decoder is shown
in Fig. 3. The receiver being a common FM
receiver kit readily available in the mar-
ket, no circuit is given for it either.
The output of the FM receiver, which
is a replica of the DTMF signal keyed in Fig. 2: Actual-size PCB layout for circuits in Figs 1 and 3
at the remote transmitter end, is fed to
DTMF decoder IC 8870P (IC2) which This 4-bit binary number is fed to IC3, outputs of IC3 will go high. A predeter-
gives the binary output corresponding to which is a 4-line to16-line decoder IC. De- mined sequential output from IC3 acti-
the signal received from the transmitter. pending on the binary input, one of the vates IC4 via two flip-flops IC5(a) and

ELECTRONICS PROJECTS Vol. 20 49


the sequence are; 3 #
5 *, in that order. The
buttons marked # and
*, generally available
on all the keyboards,
are used to activate
and then deactivate a
particular location.
On receiving the
binary code for deci-
mal number 3, pin 6
(Q3) of IC3 of decoder
circuit will go high,
making the set input
(pin 8) of IC5(a) high.
This forces pin 13 (Q
output) of this flip-
flop to go high,
thereby making pin 5
(data input) of IC 5
(b) also high.
Then on receiving
the next digit # (cor-
responding to decimal
digit 12), the D flip-
flop configured
Fig. 3: Schematic diagram of DTMF receiver/decoder and control circuits around IC5(b) is
clocked with the help
of Q12 output (at pin 19) of IC3 and in
turn IC5(b) is activated and its Q output
at pin 2 enables IC4 by taking its pin 15
active low.
The next keyed in digit 5 will make
the corresponding output (Q5) of IC4 (pin
4) to go high. This positive going pulse
can then be used to trigger a CD4013 IC
configured as toggle flip-flop (IC6). The
gadget to be controlled is connected to
the flip-flop via relay driver, optocoupler
etc, as required. Receipt of the next input
* (corresponding to decimal digit 11) will
then make Q11 output (pin 20) of IC3
high to reset IC4 and thereby disable IC4.
This will not, however, change the state
of the gadget under control. Thus when-
ever * button on the keypad is pressed
Fig. 4: Component layout for the PCB (transmitted), all the locations get reset/
deactivated but the existing latched state
IC5(b) connected to its outputs. Two ex- of the devices (‘on’ or ‘off’) at all the loca-
tra outputs of IC3 are used for activat-
Operation tions remains unaffected.
ing/deactivating IC4. The outputs from With the present circuit up to 100 differ- To switch on gadgets at other loca-
IC4 are used to changeover the state of ent gadgets can be controlled (switched on tions the numbers on the keypad should
toggle flip-flops, which in turn control the and switched off). All the 100 channels are be pressed (transmitted) as per the se-
devices using suitable interface (relay grouped in 10x10 matrix format. That is, quence mentioned earlier. Now to switch
driver/optocoupler etc) circuits. there are 10 locations, with each location off the gadget, repeat the above switching
Only two toggle flip-flops wiring us- having 10 outputs to control up to 10 gadg- process, i.e. transmit 3 # 5 * for switching
ing IC6 (CD4013) is shown here in Fig. 3. ets connected to it. off (in fact, toggling the existing state)
IC6 circuit should be repeated for other To understand the operation, assume device/gadget 5 at location 3.
pairs of Q outputs of IC4. The present that we want to switch on gadget num- The sequence should be strictly fol-
circuit can control up to 10 devices using bered 5 at location 3. For this operation lowed, otherwise false switching may oc-
outputs of IC4. the particular numbers to be entered in cur. The schematic diagram in Fig. 3 shows

50 ELECTRONICS PROJECTS Vol. 20


the wiring for location 3. The circuit in cept the FM transmitter and receiver PARTS LIST
Fig. 3 needs be repeated for each location modules, is shown in Fig. 2. The compo- Semiconductors:
with only a slight change pertaining to the nent layout is shown in Fig. 4. Circuit of IC1 - UM91215B DTMF dailer
output pin of IC3, which is to be connected IC6 has been repeated on the PCB to IC2 - CM8870P DTMF decoder
to ‘set’ pin 8 of IC5(a). For locations 1 enable control of up to 4 devices. IC3-IC4 - CD4067 Demultiplexer
IC5-IC6 - CD4013 Dual D Flip-Flap
through 10, IC3 pins 8, 7, 6, 5, 4, 3, 23, 22 The DTMF generator and FM trans- D1 - 3.3V, zener diode
and 21 respectively should be connected to mitter should be housed in metal box with LED1 - 5mm Red LED
pin 8 of IC5(a). If two units are located in the keyboard suitably placed. Be careful Resistors (all ¼ W, ± 5% carbon, unless
close proximity to each other, then a com- to watch the supply voltage of FM receiver stated otherwise):
mon FM receiver may be used. module if it shares a common supply with R1 - 150 ohm
Please remember that the binary the system. R2, R6 - 1 kilo-ohm
R3, R7-R11 - 10 kilo-ohm
equivalent code for ‘0’ in the keypad equals After finishing the construction, switch R4 - 120 kilo-ohm
decimal 10 and as such ‘0’ on the keypad on the transmitter and connect a small R5 - 220 kilo-ohm
may be marked as ‘10’. For the same rea- speaker or amplifier to the output of FM Capacitors:
son, Q0 (pin 9) output of IC3 and IC4 receiver. Then press any key on the C1 - 100µF, 25V electrolytic
should never be used; instead Q10 (pin keyboard and at the same time tune the C2, C3 - 0.1µF, ceramic disc
21) representing location/device 10 may FM receiver until a clear tone is heard and C4 - 1000µF, 25V electrolytic
be used. the ‘signal received’ LED starts glowing. Miscellaneous:
Always tune the FM receiver where there S1 - On/Off switch
- Keyboard
is no signal from any radio centre. If the
Construction and Testing output of the FM receiver is too low, a low-
Xtal-1, Xtal-2 -
-
3.579542 MHz crystal
+9V DC power supply or
The circuit can be built on a veroboard. power, compact amplifier may have to be battery
However, an actual-size, single-sided PCB used between receiver and decoder. The - Tx Antenna
- Flexible wires
comprising circuits in Figs 1 and 3, ex- system is now ready for use. ❑

Readers Comments: Dilip Paralkar to the project ‘DTMF Remote Switching


❑ Is it possible to use IR source and IR dilip-paralkar@hotmail.com Board’ by D. Sinha elsewhere in this
reciver to operate the circuit in IR mode? The author, Bhaskar Banerjee, replies: volume. To increase the range, two or three
Can the range of the circuit be increased IR transmitter and receiver may be IR LEDs may be used in series. Lens/
up to 10 metres? used in place of FM. For this, please refer reflector may also be used. ❑

ELECTRONICS PROJECTS Vol. 20 51


FAST CHARGER FOR
INVERTER BATTERIES
D. DINESH

N
owadays inverters using tubular is far worse in rural areas. For a fully the battery fully, fairly quickly, the charger
or automobile lead-acid batteries discharged battery of 150 Ah or higher reverts to trickle mode of charging and
have becomes more popular be- capacity you may be able to just replen- maintains the battery in fully charged con-
cause of their higher Ah (ampere-hour) ish the charge if you use 20-hour rate dition by replenishing the lost charge.
rating and longer life. However, to (i.e. 1/20th of the Ah capacity of the bat- Over-discharged batteries should not be
recharge these types of batteries, very tery). But for this you must have assured charged using the normal charging rate.
high charging current is required. Major- mains supply for 20 hours per day, which Their output voltage should first be brought
ity of inverter manufacturers use charger is not always possible. Hence 20-hour up to a safe level using a much lower charg-
transformers capable of charging at the charging rate is not quite practical, and ing current, and thereafter it could be
maximum current rating of 10 amperes. thus charging at 10-hour rate may be charged using the normal charging current.
In most cities, the electricity board/ more appropriate to replenish the charge The charger should changeover to trickle
authorities do not provide mains supply in reasonable time. charging mode when voltage across its cells
for even 20 hours in a day. The condition Batteries need charging in two steps, reaches its maximum permissible value.
TABLE I i.e. float/normal There are quite a few charging methods
Component / Battery Voltage 6V 12V 24V
mode (10-hour used in different chargers, but here a simple
to 20-hour rate) constant voltage with sine phase angle
Transformer X1 (Sec.) 7.5 15 30
Relay RL1 6V, 100-ohm 12V, 200-ohm 24V, 200-ohm and trickle control is employed, without sacrificing
Resistors (R7, R8) 680-ohm 1k 2.2k charging mode. quality and performance. Battery charger
Zeners (D4, D5) 3.3V 9.1V 17V If normal mode should have requisite built-in protections
Resistor (R6) * May be test selected between 330-ohm and 2k. is able to charge so that it is not only capable of protecting the
battery but is also capable of
protecting itself.
The charger circuit
presented here is meant for
charging 24-volt batteries at
normal/float rate of 20
amperes (i.e. 10-hour rate for
200Ah capacity batteries).
This charger can easily be
modified to cover batteries of
other voltages and ampere-
hour ratings. The suitable
component selection for
batteries of other voltages are
shown in Table I.
This charger incorporates
the following protections and
indicators:
1. Fuse protection on
mains side.
2. Power factor improv-
ing capacitor at mains side.
3. Moulded case circuit
Fig. 1: Schematic diagram of fast battery charger breaker (MCB) on battery side.

52 ELECTRONICS PROJECTS Vol. 20


standard phase angle control
circuit is used along with diac D7.
The triac gate trigger signal is
derived from MT2 terminal of the
triac, via a variable phase delay
network comprising preset VR3,
LDR (illuminated by LED3), and
combination of resistor R4 and ca-
pacitor C2. Capacitor C1
(0.047µF, 400V) decreases
hysterisis effect while resistor R5
in combination with capacitor C3
serves as a snubber network
which protects the triac. Light
Fig. 2: Outline of a modular bridge rectifier output of LED3 is coupled to LDR,
which thus controls gate current
4. Reverse battery polarity protection/ into the triac according to battery
indicator. voltage level. Preset VR3 (470k)
5. Provision for slow charging of over- is used to limit the maximum
discharged batteries. firing angle, i.e. the minimum
6. Automatic change-over from normal charging current.
to trickle mode of operation and vice versa. Transistors T1 and T2 and
7. Charging rate ammeter (optional). components wired around them Fig. 5: Proposed enclosure and component mounting
are used to control float charging layout plan for the battery charger
current in the vicinity of higher
Description and lower battery voltage limits. For planatory, a brief explanation of the same
Mains AC input to the circuit, as shown example, when the voltage exceeds the is included. Relay RL1 contacts in Fig. 1
in Fig. 1, is connected through on/off higher limit, zener D4 conducts and for- are shown in their de-energised state.
switch S1 and 3-ampere fuse F1. How- ward biases transistor T1. As a result col- Once battery is connected to the circuit
ever, no current can flow through trans- lector of transistor T1 reaches near ground with proper polarity (as shown in the
former X1 unless triac T3 is conducting. potential to cut-off transistor T2, thereby circuit), the bulb will briefly glow (with
Thus we may say that charging current is swithing off LED3 and thus reducing the low intensity), provided triac T3 is con-
controlled by triac T3 in series with the conduction period of triac T3 to minimum ducting (under conditions as explained in
primary of transformer X1. This triac (to trickle charge level). And when the preceding paragraph) and relay RL1 will
should be mounted on a small heat-sink. voltage across battery drops below the energise to changeover its contacts such
To control firing angle of the triac, threshold value (higher limit), the that battery is directly connected to the
conduction period of triac in- bridge rectifier output.
creases and vice vesa. When the battery is connected with
When the voltage at wiper reverse polarity, LED1 (red LED) will
of preset VR1 is below 17 volts, light up to warn you of wrong connection.
transistor T1 is cut off and the With reverse connection of battery, LED3
illumination of LED3 is solely is off and hence triac is also not
determined by preset VR2 which conducting, and thus there is no rectifier
now controls the current through output. In case of any short across bat-
transistor T2 as well as LED3. tery, 25-ampere MCB will trip and iso-
At very low battery voltage val- late the rectifier from the battery.
ues, the charging current will
Fig. 3: Actual-size single-sided PCB layout for the circuit in Fig. 1 reduce to a value much below
the normal/float current value Construction and Testing
as the battery now requires to Transformers X1 is a normal step-down
be charged at lower charging transformer capable of delivering 20 am-
current and the same could be peres of secondary current at 30 volts.
achieved by adjusting preset One may have additional taps for 32V
VR2 and VR3. The LED and and 34V on the secondary side to cater
LDR combination should be for low mains voltage. [Note: For those
housed in a small sealed enclo- interested in winding their own trans-
sure to prevent light from other former, here are the required details: Core:
external sources from affecting CRGO No. 7; stack: 2.5 inch or 6.3 cms;
the operation of the charger. primary: 368 turns of 19 SWG; secondary
Although remainder of the 48 turns for 30V AC, 51.5 turns for 32V
Fig. 4: Component layout for the PCB circuit appears to be self-ex- AC and 54.5 turns for 34V AC using

ELECTRONICS PROJECTS Vol. 20 53


PARTS LIST
Semiconductors:
T1, T2 - BC548 npn transistor
T3 - BT137 triac
D1, D2, D6 - 1N4001 rectifier diode
D3 - 1N5401 rectifier diode
BR1 - 50A bridge rectifier
D4, D5 - 17V,1/2W zener
D7 - DB-3 or equivalent diac
Resistors (all ¼ W, ± 5% carbon, unless
stated otherwise):
R1,R2 - 1-kilo-ohm
R3,R9 - 470-ohm
R4 - 10-kilo-ohm
R5 - 22-ohm, 0.5W
R6 - 330-ohm
R7, R8 - 2.2-kilo-ohm
Capacitors:
Fig. 6: Charging current vs battery terminal voltage for 24V lead-acid battery C1 - 0.047µF, 400V polyester
C2, C3 - 0.1µF, 400V polyester
C4 - 10µF, 400VAC (paper)
12SWG wire.] voltages. Suitable enclosure with mount- (motor start capacitor)
Care should be taken while connect- ing layout plan for components is shown Miscellaneous:
ing the wires to ensure that all connec- in Fig. 5. Mount all hardware one by one. LED1 - Green LED
tions are firm. Weaker contacts cause LED holders, SPST switch, ammeter go LED2 - Yellow LED
LED3 - Red LED
heavy voltage drop and heat dissipation on front panel, and MCB, fuses, battery RL1 - Relay 24V, 200-ohm
since heavy current flows through them. terminal and mains tag block on rear panel. F1 - Fuse cartridge, 3A
Bridge rectifier used should be of good Please note that all components in bottom X1 - 230V AC primary to 34V,
quality and capable of delivering at least half section of Fig. 1 are mounted on the 20A secondary trans-
former. With tapping for
twice the maximum charging current, and chassis of the charger as shown in Fig. 5, 30 and 32V AC
it should be used with adequate heat-sink. and hence PCB size is small. - MCB for 25A
Modular bridge rectifiers of 50-ampere Before coupling the LED to LDR in a - Bulb 24V, 3A (72W)
current rating available in the market suitable enclosure, presets VR1 and VR2 - Light dependant resistor
(LDR)
may be used. Outline of a typical bridge are to be adjusted as follows using any - Ammeter, 30A FSD
rectifier of this type is shown in Fig. 2. external variable DC power supply source - Chassis/cabinet
Its metallic body serves as heat-sink and without connecting battery:
the bridge rectifier can be secured to 1. Disconnect collector of T1 (BC148). ing preset VR3 (470k) at the high- est
metal chassis with nut and bolt through 2. Connect variable power supply resistance position. Adjust it for tric- kle
its centre hole. across battery terminals. charge level at 28 volts or near about
The bulb having 24V, 3A rating is an 3. Adjust power supply for 21 volts (whatever is the terminal voltage of the
automobile bulb used here to limit charg- and adjust preset VR2 such that LED3 fully charged battery). Repeat the setti-
ing current when relay contacts are open. just begins to light up. ngs 4 to 5 times, if necessary. Now this
Capacitor C4 (10µF, 400V AC) is used 4. Now connect collector of transistor charger is ready for normal operation.
across mains primary winding, which not T1 to base of transistor T2 and adjust DC A diagram showing charging current
only improves power factor but also im- supply to 27 volts. Adjust preset VR1 such vs battery terminal voltage for a typical
proves RF suppression. that LED begins to just light up. 24V lead-acid battery is shown in Fig. 6.
Circuit may be easily assembled on a Remove variable DC power supply and The dotted lines in figure indicate the
piece of general-purpose PCB. However, connect a fully charged battery across bat- minimum and the maximum battery
actual-size single-sided PCB layout and tery terminals. terminal voltages within the usable range
its component layout are shown in Figs 3 The LED and LDR should be housed (off-charge), while the solid lines indicate
and 4 respectively. in a properly sealed enclosure to avoid the terminal voltage with battery still on
Care should be taken while adjusting light from external sources impinging on float charge.
470k preset VR3 as it carries live mains the LDR. Connect mains input after keep- ❑

Readers comments: Chandrakant R. Joshi 2. Relay RL1 is used for protection


❑ Please clarify the following: Kolhapur of battery as well as charger. If a
1. How is this circuit a constant volt- The author, D. Dinesh, replies: deep-discharged battery is connected,
age charger? Can it also be made con- 1. The charging current is controlled a limited current flows through 24V,
stant current charger? by varying the firing angle of the triac in 3A bulb until the relay energises.
2. Why is 24V relay RL1 used? If a accordance with the battery’s terminal Once the relay energises, a normal
deep-discharged battery (17V terminal voltage, keeping the charging voltage con- charging current flows through the
voltage) is connected, will it not chatter stant. Converting the circuit into constant- battery.
or even fail to operate? voltage and constant-current charger is 3. Use of 24V, 3A bulb is explained
3. What for 24V bulb is used? not feasible. above. ❑

54 ELECTRONICS PROJECTS Vol. 20


Z-80 BASED DEDICATED
PROGRAMMER CUM
EMULATOR
K. PADMANABHAN & S. ANANTHI

E
very microprocessor or micro con- one can put the contents of one or more modating the higher address lines to
troller based project needs an earlier EPROMs into one of the faster attain increased memory size.
EPROM (or EEPROM) for its pro- and denser EPROMs of today. Past tech-
gram memory. Many day-to-day appli- nology needed 25V for programming, as
ances like photocopier, film-developing with the 2716 (2k) EPROM, but n ow most
Description
machine, printer, etc use EPROMs. PCs EPROMs are programmable at 12.5V. So, A dedicated EPROM programmer-cum-
also need EPROMs for their motherboard the risk is less. emulator circuit is presented here. It is
and various controller cards. Present-day The majority of today’s projects use convenient for programming small code
EPROMs have much larger memory. To- the 8k or 16k EPROMs, even though the applications by entering data and burn-
day it is possible to have 1 MB of pro- code programmed therein may not exceed ing it into the EPROM or EEPROM. The
grammable memory in a single IC (27800). 2k. These 8k and higher size devices are data can be first entered into the RAM of
The full BASIC interpreter of a basic 28-pin types, while the 2k (2716) have the EPROM programmer and later trans-
computer (refer EFY Dec. 1990 issue, only 24 pins. The numbering of the pins ferred to program the EPROM. Addition-
reproduced in Electronics Project Vol. 11) of these devices is shown in Fig. 1, indi- ally, there is an application for using this
can go into one EPROM of 16k. cating that the extra four pins are accom- unit to emulate an EPROM in the target
Software for typical
projects and robotic kits
also need EPROMs to be
programmed.
The EEPROM (electri-
cally erasable PROM), in
addition to this family, can
be programmed at any
random location and
operates on a voltage of
only +5 volts. One can elec-
trically erase and
reprogram any memory
cell in such an EEPROM.
The 2864A is a popular 8k
device of this type.
Earlier machines such
as a film-processing ma-
chine used to have four
EPROMs (2716) of 2k
each. Now we can
conveniently put all that
code in one 2764 EPROM.
The flexibility of a copier
is an advantage in that Fig. 1: The common pin numbering method followed for accommodating 24-28-pin ICs in 28-pin DIP sockets.

ELECTRONICS PROJECTS Vol. 20 55


56
ELECTRONICS PROJECTS Vol. 20
Fig. 2: Schematic diagram of the main board of Z-80 based EPROM programmer
board, whose program is being checked play the address and data, four for the programming and contents of addressed
during development stage. This circuit has address field and two for the data field— location can be verified. In fact, the soft-
the following features: all in hex format. ware programming routine checks the
1. It can be used to program the fol- The system uses a Z-80 microproces- programmed data in each location before
lowing devices: 2716, 2732, 2764, 27128, sor chip. The principle of programming programming the next location so that
27256 and 2864 EEPROM. an EPROM using Z-80 is quite simple, spurious programming is avoided. The full
2. It can copy from any of the follow- and you do not require any additional pe- software is given for programming or
ing EPROMs (source) into any other ripheral chip such as PIA for accessing copying from a pre-programmed EPROM.
EPROM (destination): 2716, 2732, 2532, the EPROM address or data pins. In other An emulate or program switch S4 (up
2764, 27128, 27256. words, the EPROM programming socket during program mode and down during
3. It can emulate an EPROM (a 2k, is like any other RAM chip to the Z-80 emulate mode) puts the Z-80 in hold state
2716) in a development board via a DIP microprocessor. The only difference is that during emulation. The contents of a RAM
jumper. the Z-80 is made to wait for the duration (a 6116), loaded previously with the de-
The circuit comprises a hexadecimal of the programming pulse, during which velopment system program, are used to
keyboard and a 6-digit LED display. The period the address and data lines signals transmit the information to the EPROM
keyboard has 20 keys and a reset key. are stable and the programming pulse socket on the development board via a
The 20 keys include 16 keys for hexadeci- (width = 50 ms) is applied, which causes DIP jumper. This DIP jumper plugs on a
mal data entry and four command keys. the EPROM device to be programmed separate socket in the Z-80 main PC board
A six-digit LED display is provided to dis- insitu. The EPROM can also be read after and it can be unplugged when the system

Fig. 3: Schematic diagram of circuit on auxilary board

ELECTRONICS PROJECTS Vol. 20 57


PARTS LIST
Semiconductors:
IC1 - Z-80 microprocessor
IC2 - 74LS139 dual 1-of-4 decoder
IC3 (N1-N6) - 74LS04 hex inverter
IC4 - 74LS157 quad 2-input
multiplexer
IC5 - 74LS121 monostable
multivibrator
IC6 - 75452 dual high-current
NAND gate
IC7 - µA723 (T0-5 voltage
regulator metal can package)
IC8 (N7-N12) - 74LS06 flex inverter buffer/
driver
IC9 - 2764 or 2716 8k or 2k
EPROM (monitor)
IC10 - 6264 8k static RAM
IC11 (N13-N16) - 74LS00 quad 2-input NAND
gate
IC12-IC16 - 74LS75 4-bit bistable latch
Fig. 4: Arrangement showing interconnections between EPROM programmer and a development IC17 - ULN2003 high current/
board during emulation mode voltage Darlington drivers
IC18 - 74LS245 actual bus
transceiver
is not being used as an emulator but only enables one digit of the LED display to IC19 (N17-N20) - 74LS02 quad 2-input NOR
as a programmer. glow at a time in a multiplexed manner. gate
This port drives the digits via 74LS245 IC20 - 74C923 keyboard encoder
IC21 - LM7805 or LM340 5-volt
IC18 which sources current to all the seg- regulator
The Circuit ments of a common-anode LED display. T1-T3 - 2N2907 pnp transistor
The entire unit consists of two parts. One One of the six displays (DIS1 through D1, D2 - 1N5401 3-amp rectifier diode
D3, D4 - 1N4001 1-amp rectifier diode
is the main board comprising the Z-80 DIS6) would be glowing at a time in a
Resistors (all ¼ W, ± 5% carbon, unless
microprocessor, the sockets for the follow- multiplexed manner, which is governed stated otherwise):
ing EPROMs: (i) copy master, (ii) the by software. R1,R5,R6,R8,
The input port is actually part of the R9,R12,R24 - 1.5-kilo-ohm
EPROM to be programmed, (iii) the socket R4,R23 - 470-ohm
for emulator DIP plug (double-ended) and key-encoder IC20, the 74C923, which is a R2,R3 - 1-kilo-ohm
few other ICs/components as shown in Fig. 20-key encoder CMOS chip. This IC gen- R7 - 330-ohm
R10 - 6.8-kilo-ohm
2. The other board, which is the input/ R11 - 1.2-kilo-ohm
output (I/O) board, comprises the key Table I R13 - 10-ohm
switches and the LED displays, etc, as R14,R15 - 10-kilo-ohm
Key Hex No. Function R16 - 3.3-kil-ohm
shown in Fig. 3. The two boards are con- R17-R19,R22 - 4.7-kilo-ohm
Desig. Repres-
nected together using FRC connectors R20 - 3.3-kilo-ohm
entation R21 - 150-ohm
linked by a ribbon cable.
The signals coming out of the Z-80 S 10 Store and Increment Capacitors:
key: When pressed, C1,C2,C5,C10 - 0.1µF ceramic disc
board are the data bus (D0 to D7), C3 - 15-60pF ceramic disc
the read (RD) and write (WR) signals stores the data shown C4 - 10µF, 16V electrolytic
and address decoded port select signals in the data field C6 - 1µF, 16V electrolytic
(rightmost two LEDs) C7 - 470µF, 35V electrolytic
(PORT 1 through PORT 3) which are for C8 - 220µF, 63V electrolytic
the keyboard and display ports. The into the address C9 - 2200µF, 25V electrolytic
I/O board consists of two numbers of out- (leftmost four LEDs) Miscellaneous:
put ports, each made up of a pair of 7475 and increments the DIS1-DIS6 - LT542 common anode
address display
ICs. The segment driver port is desig- S1-S3 - SPST on/off switch
nated as I/O port No. 2 and the digit- H 11 High address set key: S4 - DPDT on/off switch
driver port as port No.3. The input port, Sets the high address S5 - Push-to-on switch
(leftmost two LEDs) S6 - Rotary switch
which is acquiring the key-code of the - 16 keyboard switches
key-pressed, is designated as read port to the value displayed (N/O) tactile type)
No.1. in data field - FRC connectors male/female
L 12 Low address set key: - Ribbon cable
The two pairs of 7475 output ports - Shorting plugs for FRC
are connected to the LED display via seg- Sets low address (two connectors, wooden enclosure
ment and digit driver ICs ULN 2003 middle LEDs) to the
(IC17) and 74LS245 (IC18) respectively. value displayed in the erates the key-code of the key pressed.
The segment driver IC17 (ULN2003) sinks data field The keys are arranged in a matrix of five
the current from the LED segments and G 13 Go and execute pro- rows and four columns. At the intersec-
its input is the latched set of data values gram key: Program is tion of each row and column, a switch is
from the output pins of the IC12 and IC13 executed from the ad- wired. When a switch is closed, the 74C923
74LS75. The other 7475 pair, comprising dress displayed in the encodes the value of the switch and out-
ICs 14 and 15, is used for the digit port. It address field. puts it to the data bus. Also, whenever a

58 ELECTRONICS PROJECTS Vol. 20


TABLE II clock of 2.5 MHz which is realised by an
IC Type Mode Pin No. 18 20 21 -1 -2 +1 oscillator configured around a couple of
2716 READ CE Low 5V -- -- -- 74LS04 gates (N3 through N5). The Z-
Write 50ms High 25V -- -- -- 80’s interrupt pin 16 is used for data en-
(Prog.) Positive try from the keyboard as mentioned ear-
pulse (TTL) lier. The non-maskable interrupt NMI (pin
2516 Same as above
17) is not used and is tied, always high.
2732 READ CE Low A11 -- -- --
Write 50ms 25V A11 -- -- -- The BUSREQ or ‘hold’ pin 25 is brought
negative low whenever the switch (program-emu-
TTL pulse (21V for 2732A) late) is thrown to the emulate position.
2532 READ A11 Low Low -- -- -- During the emulate mode, both the data
Write A11 50ms 25V -- -- --
negative bus and the address bus are tri-stated
going TTL and float in the Z-80. The 6116 (or 6264)
pulse RAM chip, which has its data already
2764 READ CE Low A11 A12 5V High loaded therein, is connected to the devel-
Wrtie Low High A11 A12 21V 50ms
opment board, for which the other end of
(12.5V negative
or 2764A) going the DIP jumper plugs into its own EPROM
pulse socket. Fig. 4 offers a glimpse of the ar-
(TTL) rangement showing interconnection be-
27128 READ CE Low A11 A12 5V High tween EPROM programmer and a devel-
Write Low High A11 A12 12.5V TTL
50ms opment board during the emulation mode.
27256 READ CE Low A11 A12 5V A14 The Z-80 microprocessor has 16 ad-
Write Low High A11 A12 12.5V A14 dress lines, out of which 13 address lines
pulse (A0 through A12) are used to select blocks
2864A READ CE Low A11 A12 5V High
of 8k memory each. Address lines A13 and
Write Low High A11 A12 5V TTL
pulse A14 are used in a 74LS139 decoder (IC2) to
get four decoded address ranges, as under:
key is pressed, the data available (DAV), chip within the address range provided. 00 00 to 1F FF: This is the first 8k
pin13 in this IC, goes high. This active Therefore these keys are mainly meant memory address space which is set aside
DAV logic-1 state indicates that the key for loading of address and data and ex- for the monitor EPROM. All this 8k memory
pressed has been encoded and the data is ecution of programs. The designation of space is, however, not used because the
ready after proper debouncing of the the four command keys, along with their monitor and the programming code hardly
pressed key. The IC contains its internal hex digit representation and functions, is occupy a few pages (here a page refers to
oscillator for which a capacitor is con- given in Table I. 256 consecutive locations). A 2716 EPROM
nected on its pin 6 and another capacitor The high and low addresses are shown IC (24-pin) is used here. It will be mapped
on pin 7 for taking care of key debouncing. on the first four digits (from the left) and in the address space of 00 00 to 07 FF. If a
The data bus can read the data only when data on the last two digits of the display. 2764 EPROM IC (28-pin) is used as the
the data is available. The output pins (15 Upon pressing the reset key, for example, monitor, it will occupy the entire 8k ad-
through 19) are floated in tristate condi- the display shows: dress space (00 00 to 1F FF).
tion until the OE pin is brought low. 20 00 xx, which is the first RAM ad- 20 00 to 3F FF: This is the second 8k
Whenever a key is pressed, the active dress (20 00 hex) and xx are the content block of memory space which is set aside
high DAV signal after inversion by gate N11 (data) stored at that address. Any hexa- for a RAM chip. This socket (for IC10) is
is given to the INT (interrupt) pin16 of the decimal key, when pressed, enters that also used during the emulation mode as
Z-80 microprocessor. The Z-80 is inter- number (0 through F) as the right-most mentioned earlier. Since an emulator does
rupted and it goes into an interrupt service digit. For example, if 3 is pressed, the 6- not normally need a program of over 2k, a
routine (ISR). This ISR includes a read digit display shows: 6116 RAM chip is enough. However, it
PORT 1 (active low) command which is 20 00 x 3 would be better to use 6264 (8) RAM. The
used after combining with I/O address (Note: x in the above examples de- starting address for whichever chip is em-
PORT 1 signal (active low) in NOR gate notes any random hex digit.) ployed, would always be 20 00. The usable
N20 and inverted through gate N12 to If one keeps the key pressed for too end-address will differ depending on the
enable OE pin14 of IC 74C923. This routine long, the number repeats itself and the RAM chip used. It would be 3F FF with
reads the keycode, acquires its value and display would show: 6264 and 27FF with 6116.
acts accordingly. The IC 74C923 thus com- 20 00 33 40 00 to 7F FF: This next 8k block of
bines a port function along with key Similarly, if one presses the S key for memory is for copy EPROM. Here one
encoding logic. too long, the address keeps on would fit a 2716/32/64 in which code to be
Out of the 20 keys of the keyboard 16 incrementing one by one. This is because copied is already burnt in. The address
keys are used for hex digits 0 through F the software is so written for the inter- ranges for the above-mentioned EPROMs
and the remaining four are the command rupt service routine. having 24/28 pins as annotated against
keys. Only four simple commands are pro- Reverting to the explanation of the each within parenthesis are:
vided, because in this programmer we nor- circuit of the main board, it consists of 27128 (28-pin): 40 00 to 5F FF (8k)
mally load data into the RAM or any other the Z-80 microprocessor with a crystal 2764 (28-pin): 40 00 to 5F FF (8k)

ELECTRONICS PROJECTS Vol. 20 59


2732 (24-pin): 40 00 to 4F FF (4k) one programmer. pin 20, but 5V during programming.
2716 (24-pin): 40 00 to 47 FF (2k). In this circuit, programming of differ- Therefore, a 5V/0V signal is also switched
The 2764 or 27128 has a socket of 28 ent EPROMs has been made possible by another pole (pin 9) of IC4 (74LS157).
pins. If one were to insert a 2716 or 2732 in through use of small plug-in modules The switch is changed-over from one posi-
it, one will have to avoid the four pins called personality ‘P’ plugs. These plugs tion (read) to another (write) by a com-
which are extra, which are on the left are exactly like a 14-pin IC, and plug into mand. This command is obtained from
extreme (looking from the front) of the a 14-pin DIL socket. If one programs a one of the decoded input-output ports.
socket. Thus, while inserting a 2716 in this 2716, he plugs a 2716-P plug, and if one Since we have two bits of the digit port 3
socket, one should insert it in such away programs a 2732, he plugs a 2732 P-plug, free (as only 6 digits are used), the D7 bit
that pin 1 goes into the pin 3 position. So and so on, into the personality socket. of port No. 3 (i.e. Q7) is used for this
the socket pin numbers of the 2764 are These could be fabricated by grinding any purpose. If pin 1 of 74157 is high, it se-
renumbered, starting from –2, -1, 1 through failed throw-away 14-pin IC’s top so as to lects the switches for programming, and
12, 13 through 24, +1 and +2 (refer Fig. 1). remove the silicon dice and then wiring if it is low, it selects the switches for read-
Thus there should be no confusion during diodes, jumpers on the top between the ing. The programming software should
insertion/use of 24- or 28-pin IC in 28-pin pins as shown in Fig. 6. make this pin high and throw the switches
DIL (dual-in-line) socket if one renumbers The personality plugs ensure applica- to the programming side, so that proper
its pins in this format. tion of proper signals to the pins of the IC programming signals are applied to the
80 00 – FF FF: Last 32k of memory being programmed. For example, in a 2716, programming socket.
space has been set aside for the target pin 21 must get a 25V supply, pin 18 should In addition, the high voltage (12.5V
EPROM to be inserted in the 28-pin ZIF get a 50ms high-going TTL pulse and pin or 21V) supplies need to be switched on
socket for programming. 20 must be logic high. For reading, pin 20 only at the time of programming. For this
The programming EPROM could be a must be low, pin 18 must get chip-enable purpose, switching voltage regulator IC
2716/32/64/128/256. While programming, CE signal while pin 21 must be only at 5V. µA723 (IC7) is employed. The 723 IC is
we have to apply a 50ms TTL pulse to the Thus, when the P-plug is inserted, the 5V normally set up to obtain 12.5V or 21V
proper programming pin of the EPROM supply, the 50ms programming pulse, 21V and 25V at output pin 1 with the help of
IC being programmed. Also, we have to VPP are passed via the jumper connections resistor R14 (10k) and other resistor(s)
put the Z-80 in Wait state, so that the on this P-plug to the proper pins of the switched in by transistors 2N2907 (T1
address and the data, which are output programming socket. through T3). Transistor T1 (when on) pro-
from the Z-80 microprocessor to the In addition, to change over from the vides 12.5V output, while transistors T2
EPROM under programming, remain sta- program mode to the read mode, the sig- and T3 provide respectively 21V and 25V
ble for 50 ms, to ensure that program- nals need to be altered. For this, a output using a supply voltage of 30 volts.
ming of the location takes place properly. 4-pole, 2-way changeover switch (quad 2- But if pin 9 of the µA723 is pulled low,
At the same time, a high voltage (12.5/ input multiplexer 74LS157 IC4) is uti- the output drops to zero. Hence its pin 9
21V/25V) must be applied to the corre- lised. It is changed over from one side to is normally pulled and kept low, so that
sponding VPP pin. Table II shows the pins the other between read and programming no high voltage appears on the program-
to which the programming pulse, high operations. The four signals selected in ming socket. Only during the program-
voltage VPP, etc are applied to the different each case are shown with a separation ‘/’ ming period, pin 9 is left high and the
EPROMs. The 2532 EPROM from TI is in Fig. 2 (at pins 4, 7, 9 and 12 of IC4). 12.5V or 21V or 25V are obtainable from
slightly different from the 2732 of Intel The read operation for 2716 requires a pin 1 of IC7 (µA723). EPROM 2732A re-
and other makes. The 2732A also has a low pulse while the programming opera- quires VPP of 21V while 2764 requires
minor difference in that it needs only 21V. tion requires a high pulse (50 ms) on its 12.5V and 2716 as well as 2732 require
The programming action takes place as pin 18. So, one pole of the switch (here 25-volt VPP supply. I/O Port 1 bits D0
follows: pin 7 of IC4) changes from CE pulse to through D2 controlled via the software
When the memory block of the pro- the 50 ms high pulse. On a 2732, the program can be used to control the VPP
gramming socket, 80 00 – FF FF, is ad- programming pulse must be a low-going voltage. Alternatively, 3-way switch S6
dressed, the monostable 74LS121 (IC5) is 50ms pulse, as also for a 2764 or 27128. can be used to select the VPP voltage. (In
enabled. It produces a 50ms output pulse. For reading, 2716 requires zero volt on its the PCB only S6 has been wired.)
This pulse would be used for keeping the Z-
80 in the Wait condition, whenever one
writes data (i.e. programs) into the pro-
gramming socket. While reading from that
socket however, one need not put Z-80 in
the Wait state. Therefore one has to distin-
guish between read operation and write
operation for the IC in the programming
socket. By the same analogy, the signals
going to the programming socket also dif-
fer between read and programming opera-
tions and vary from one chip to another.
That is why it is rather difficult to have the
provision for programming several ICs in Fig. 5: Schematic diagram of power supply

60 ELECTRONICS PROJECTS Vol. 20


Pin 9 of µA723 one after the other, 3E is entered in the
IC7 cannot be data field. The address starts at the first
grounded directly RAM address (2000H) where 3E gets en-
and it is therefore tered. If one desires to employ this unit
brought under soft- as a Z-80 trainer kit, it can be easily done
ware control. The D7 by entering the program in the RAM and
bit (Q7) of port-3 is executing it with the ‘G ‘ (GO) key. For
brought high during example, the following program would
programming. The move a 1 from left to right on the display:
Q7, which then goes 20 00 3E 06 LDA 06 ;Move
low, is connected to ;00000110 to
IC6 75452 (a high ;segments
voltage/current 20 02 D3 02 OUT 02 ;via port-2
NAND inverter pair). 20 04 3E 01 LDA 01 ;Move 1 to
This NAND gate 20 06 D3 03 P: OUT 03 ;digit port-3
makes pin 9 of IC7 20 08 CD 50 04 Call delay ;wait for
low. The Q7 of port-3 ;flicker
makes the input of 20 0B CD 50 04 Call delay ;wait for
the 75452 gate low ;flicker
and thereby the out- 20 0E CD 50 04 Call delay ;wait for
put pins 3 and 5 go ;flicker
high, causing pin 9 of 20 11 07 RLA ;Rotate left
IC7 also to go high. 20 11 C3 06 20 JMP P
This permits the The keys for incrementing and set-
12.5V or 21V or 25V ting address are the S, H and L keys,
supplies to be avail- while the G key executes the program.
able. Normally, pin 9 The main monitor program simply dis-
is low upon reset, as plays the current address and its data
Q7 goes high upon re- using a multiplexed display, for which a
set operation and it software program is used, commencing at
continues to be high 00 B0. The display stays on, until it is
during data loading interrupted by pressing any of the keys.
into RAM or reading Programming software: The
operations. So, high EPROM programming program software
voltages are properly is also simple (It starts at address: 04 00
switched and applied hex) since hardware takes care of the
carefully, i.e. only 50ms pulse which is required for program-
during programming. ming the EPROM. The Z-80’s CPI
Switch S3, which instruction is used, after setting up the
supplies the unregu- source, destination and number of bytes
lated 30V to the IC in register pairs DE, HL and BC respec-
µA723, is switched on tively.
only during program- The D7-bit of port-3 (Q7) is initialised
ming. to a ‘1’ so that the 74LS157 switches over
to programming mode. At the instant of
transfer of each byte of data from source
Software to destination, the 50ms pulse is gener-
Software for the ated and the Z-80 also waits for this 50ms
programmer is sim- time duration. A comparison is made af-
ple. The interrupt ter every transfer (after switching back
service routine (ISR) the 74LS157 to the read-mode), with the
reads the keyboard programmed data by reading the EPROM.
from port-1 and waits If data was correctly programmed at that
for a certain duration byte location, it proceeds to program the
(delay) before taking next byte after switching on the 74LS157
action on the key to the program mode. When all locations
pressed. If it is a (as many as desired) have been pro-
number (hex.) key, it grammed, a flag letter ‘C’ indicating cor-
puts it in the last rect programming is displayed.
(rightmost) digit. If If a byte does not get programmed
Fig. 6: Wiring of personality (P) plugs for different EPROMs one presses 3 and E properly, it is displayed at once, showing

ELECTRONICS PROJECTS Vol. 20 61


that particular address and the wrongly ing the data (to be programmed) at one ming, either the IC is loose in its socket or
programmed data therein, before proceed- time, since we employ its page 20 for load- the EPROM is defective. The EPROM can
ing to program the next byte. The display ing addresses of destination, source and be erased with an ultraviolet light source
showing this information (wrongly pro- number of bytes to be programmed and eraser and tried again.
grammed data along with address) is live its page number 27 for the stack. If how-
for about 4 seconds, for the user to note ever, 6264 RAM is used in place of 6116
the wrong data and its address. Then it RAM, then we could use address space
Construction
proceeds to program the next byte. If there from 2100 to 3EFF. It is also advisable, The power supply circuit as given in Fig.
are no more errors, it continues right while loading from RAM, to program one 5 is to be assembled first on a base plate
through until the entire required program page at a time. For example, after loading at the back of the unit, which could be a
has been programmed into the EPROM. the data to be programmed into page 21 wooden board of about 25 cm x 35 cm.
Procedure for programming: The of the RAM one enters the number of The transformer and the heat sink for
addresses of the source, destination and bytes to be programmed as under: 7805 are then to be fitted. A lug board is
the number of bytes/pages to be pro- 20 02 = 00 ; 0 byte used for wiring the power supply circuit
grammed should be first entered. For this 20 03 = 01 ; and one page. with diodes, capacitors, etc. A 230V AC
purpose, the RAM addresses, 2000 Then the source start address for data primary to 12-0-12V, 2A secondary trans-
through 2005 are used as under. (2100) will have to be entered in locations former is used to get the DC supplies. A
Destination: 20 00 … Low order 20 04 and 20 05 as under: voltage doubler circuit is used to obtain
address and 20 04 = 00 30V unregulated output, which goes to
20 01 … High order address of EPROM 20 05 = 21 (meaning that data to be the µA723 ICs on the Z-80 board of Fig. 2.
socket (destination) corresponding to the copied into EPROM is loaded in twenty Please note that either LM 7805C or 340T
EPROM being programmed. first RAM page) in TO3 metal package capable of supply-
Suppose one wants to program only the If one wants to copy data from the ing 1 ampere of current should be used.
second half of a 2732 EPROM starting with ‘copy EPROM socket’ of Fig. 2, then the As the ready-made transformers available
its page 8 and ending with page F, one en- source address range available is 40 00 to in the market are highly over-rated, one
ters the starting address 88 00 (please note 7F FF. But if a 2716 is used in that copy- may use a transformer with secondary
that starting address of EPROM ZIF socket ing socket, the start address would be 48 current rating of 3 to 4 amperes to avoid
is 80 00 hex) as follows: 00 (since pin 21 is to be returned to +5V). excess voltage drop in the secondary and
20 00 = 00 Thus source address would be entered as over-heating.
20 01 = 88 under: A double-sided PTH glass-epoxy PCB
For a 2764 EPROM there are four 20 04 = 00 is required for the circuit of Z-80 main
parts, with starting addresses as under: 20 05 = 48 board including a major part of the circuit
80 00 = First part After entering the source address, des- of the auxilary board. This would leave us
88 00 = Second part tination address and the number of bytes with only the keyboard which can be
90 00 = Third part to be programmed and selecting the VPP assembled on a general-purpose PCB and
98 00 = Fourth part voltage (after switching on S3) and using connected to the main board using FRC 16-
Thus, the starting address of destina- either rotary switch S6 or using I/O port- pin connectors and ribbon cable.
tion (within the allocated address space 1 bits, the program is executed at 04 00 The actual-size component-side track
of 80 00 through FF FF) will vary de- using G-key. layout for the PCB is given in Fig. 7 and
pending upon which quarter of the 2764 For selection of Vpp voltage using soft- solder-side track lay-out is given in Fig.
one wants to load a program into. ware, the following instructions can be 8. The component lay-out for the PCB is
Number of bytes: Having loaded the suitably added in the EPROM program- given in Fig. 9. The Z-80 board houses all
destination address into RAM locations ming software: sockets for programming EPROM, copy
20 00 and 20 01, one proceeds to load the 3E 01 LDA, # 01 ; 01 EPROM and the emulator DIP plug. The
number of bytes/pages to be programmed for12.5V, 02 Z-80 main board is mounted on pillar sup-
in RAM locations 20 02 and 20 03. For ;for 21V, 04 for 25V ports in a raised position of about 6.5 cm,
instance, if one wants to copy a full 2716 D3 01 OUT 01 ;Output to port 1 to above the transformer. Cuts are made
EPROM, there are eight pages to be cop- ;set Q0/Q1/Q2 in against the positions of the sockets to ex-
ied. So one enters them as under: C7 RST-7 ;the voltage control pose them for inserting ICs (the EPROMs
20 02 = 00 ;zero bytes and ;circuit for programming and copymaster as well
20 03 = 08 ;eight pages On execution of EPROM programming as the DIP jumper). 28-pin zero insertion
Source: If one wants to copy from software starting at location 04 00, it trans- force (ZIF) sockets could be fitted for these,
RAM (as source), after having loaded the fers a byte from the source to the destina- since their pins are thick, having 1.0 mm
data in it, earlier, the RAM starting ad- tion, verifies it and continues until the holes are made for this programming
dress must be entered in locations 20 02 entire data has been programmed. When socket on the board.
and 20 03. the flag letter ‘C’ gets displayed (denoting The PCB containing the keyboard is
Please note that pages 21 to 26 of correct programming), press reset switch mounted in a slightly slanted position
RAM address space only are available for and switch off the unit. The EPROM is with respect to the Z-80 main board, so
storing the data to be transferred to then removed and used. It takes about 20 that the keys can be handled conve-
EPROM. The full 8 pages (available) in seconds for each page to be programmed. If niently. Sockets are to be used for all
the 6116 RAM cannot be utilised for load- there are many errors during program- ICs in this board as well. The display is

62 ELECTRONICS PROJECTS Vol. 20


63
ELECTRONICS PROJECTS Vol. 20
Fig. 7: Component-side track layout
64
ELECTRONICS PROJECTS Vol. 20
Fig. 8: Solder-side track layout
Fig. 9: Component layout

ELECTRONICS PROJECTS Vol. 20 65


mounted in a raised position using sock- The pulse of 50 ms going to pin 18 (say velopment board. For example if one is
ets and that make the display in level 2716 P-plug) can be looked on a CRO. For developing an 8035 system board, then
with the keyswitch tops, so that while the 2764 P-plug, the pin 2 gets the 21V. the EPROM socket on it is plugged by the
covering up, these can both become ex- For the 2732, the pin 20 gets the 25V. other end of the DIP jumper. After reset-
posed by a profile cut on the front panel These details are given in Table I. The ting the 8035 in that board, the program
plate. The switches S1-S6 are mounted personality plugs should thus also be in the 6116 (or 6264) here would be ex-
on the side. checked. A sample program could be ecuted by that 8035. One can check that
After wiring and interconnection, it is programmed into an IC to verify proper program for proper functioning. When
worthwhile to carry out a cold check by programming. changes are necessary in the program,
using a continuity tester for all lines, par- Emulator: This is used to develop a the 8035 is reset, and the DIP jumper
ticularly the address and data lines to program for a development board. This unplugged. The program/emulate switch
the sockets for EPROM, RAM socket for program should be loaded into the RAM is thrown to program position and the
programming, switches, etc. on the main from address 20 00 onwards using the RAM reloaded accordingly.
board and the display/key board. keyboard. Then, the program/emulate Tech Editor’s Note: The EPROM pro-
A check could be made of the pres- switch S4 is thrown to emulate position. grammer after fabrication at EFY was
ence of 12.5/25V/21V voltages on the pro- The chip select pin of the 6116 (or 6264) tested using a short test program as given
gramming socket, when the programming is now free and the Z-80 is in hold state. at the end. We could successfully program
program at location 04 00 is executed. The DIP plug is now inserted on the de- an EPROM using the same.

Z80 ASSEMBLY LANGUAGE PROGRAM FOR EPROM PROGRAMMER


ADDR OPCODE LABLE MNEMONICS COMMENTS ADDR OPCODE LABLE MNEMONICS COMMENTS
0000 C3 50 00 JP L1 031F FE 11 A2: CP 11H
0321 20 05 JR NZ,A3
0050 ED 56 L1: IM 1 0323 61 LD H,C
0052 C3 00 02 JP L2 0324 4E LD C,(HL)
0325 F1 POP AF
0200 31 FF 27 L2: LD SP,27FFH 0326 ED 4D RETI
0203 21 00 20 LD HL,2000H 0328 FE 10 A3: CP 10H
0206 4E LD C,(HL) 032A 20 06 JR NZ,A4
0207 CD B0 00 CALL DISPLAY 032C 71 LD (HL),C
020A FB EI 032D 23 INC HL
020B F3 L: DI 032E 4E B1: LD C,(HL)
020C CD B0 00 CALL DISPLAY 032F F1 POP AF
020F FB EI 0330 ED 4D RETI
0210 C3 0B 02 JP L 0332 FE 13 A4: CP 13H
0334 20 F8 JR NZ,B1
0038 F5 PUSH AF 0336 3E 79 LD A,79H
0039 C3 AF 01 JP 01AFH 0338 D3 02 OUT (02),A
033A D3 03 OUT (03),A
01AF DB 01 IN A,(01) 033C E9 JP (HL)
01B1 32 00 27 LD (2700H),A
01B4 47 LD B,A 00B0 00 DISPLAY: NOP
01B5 DB 01 IN A,(01) 00B1 F5 PUSH AF
01B7 D9 EXX 00B2 7C LD A,H ; H is displayed
01B8 08 EX AF,AF’ 00B3 E6 F0 AND F0H
01B9 11 FF 57 LD DE,57FFH 00B5 0F RRCA
01BC 1B Q: DEC DE 00B6 0F RRCA
01BD 7A LD A,D
01BE B3 OR E 00B7 0F RRCA
01BF 20 FB JR NZ,Q 00B8 0F RRCA
01C1 D9 EXX 00B9 5F LD E,A
01C2 08 EX AF,AF’ 00BA 3E 20 LD A,20H
01C3 C3 00 03 JP LX 00BC D3 03 OUT (03),A
00BE CD 10 01 CALL SEGDISP
0300 3A 00 27 LX: LD A,(2700H) 00C1 7C LD A,H
0303 E6 1F AND 1FH 00C2 E6 0F AND 0FH
0305 FE 10 CP 10H 00C4 5F LD E,A
0307 30 0D JR NC,A1 00C5 3E 10 LD A,10H
0309 47 LD B,A 00C7 D3 03 OUT (03),A
030A 79 LD A,C 00C9 CD 10 01 CALL SEGDISP
030B 17 RLA 00CC 7D LD A,L ; L is displayed
030C 17 RLA 00CD E6 F0 AND F0H
030D 17 RLA 00CF 0F RRCA
030E 17 RLA 00D0 0F RRCA
030F E6 F0 AND F0H 00D1 0F RRCA
0311 B0 OR B 00D2 0F RRCA
0312 4F LD C,A 00D3 5F LD E,A
0313 F1 POP AF 00D4 3E 08 LD A,08
0314 ED 4D RETI 00D6 D3 03 OUT (03),A
0316 FE 12 A1: CP 12H 00D8 CD 10 01 CALL SEGDISP
0318 20 05 JR NZ,A2 00DB 7D LD A,L
031A 69 LD L,C 00DC E6 0F AND 0FH
031B 4E LD C,(HL) 00DE 5F LD E,A
031C F1 POP AF 00DF 3E 04 LD A,04H
031D ED 4D RETI 00E1 D3 03 OUT (03),A

66 ELECTRONICS PROJECTS Vol. 20


ADDR OPCODE LABLE MNEMONICS COMMENTS ADDR OPCODE LABLE MNEMONICS COMMENTS
00E3 CD 10 01 CALL SEGDISP 01FF 71 DEFB 71H
00E6 79 LD A,C
00E7 E6 F0 AND F0H 0400 F3 DI
00E9 0F RRCA 0401 ED 5B 04 20 LD DE,(2004H) ;DESTINATION
00EA 0F RRCA POINTER
00EB 0F RRCA 0405 2A 00 20 LD HL,(2000H) ;SOURCE
00EC 0F RRCA POINTER
00ED 5F LD E,A 0408 ED 4B 02 20 LD BC,(2002H) ;BYTE-COUNT
00EE 3E 02 LD A,02 POINTER
00F0 D3 03 OUT (03),A 040C 3E 80 LP: LD A,80H
00F2 CD 10 01 CALL SEGDISP 040E D3 03 OUT (03),A
00F5 79 LD A,C 0410 CD 50 04 CALL TIMEDELAY
00F6 E6 0F AND 0FH
00F8 5F LD E,A 0413 1A LD A,(DE)
00F9 3E 01 LD A,01H 0414 77 LD (HL),A
00FB D3 03 OUT (03),A 0415 97 SUB A
00FD CD 10 01 CALL SEGDISP 0416 D3 03 OUT (03),A
0100 F1 POP AF 0418 1A LD A,(DE)
0101 00 NOP 0419 13 INC DE
0102 C9 RET 041A ED A1 CPI
041C C2 2F 04 JP NZ,ERROR
0110 16 01 SEGDISP: LD D,01H 041F EA 0C 04 JP PE,LP
0112 3E F0 LD A,F0H 0422 3E 39 LD A,39H
0114 B3 OR E 0424 D3 03 OUT (03),A
0115 5F LD E,A 0426 D3 02 OUT (02),A
0116 1A LD A,(DE) 0428 76 HALT
0117 D3 02 OUT (02),A
0119 CD 20 01 CALL DELAY1 ; show it 042F F5 ERROR: PUSH AF
011C AF XOR A ; clear it 0430 2B DEC HL
011D D3 02 OUT (02),A 0431 C5 PUSH BC
011F C9 RET 0432 4E LD C, (HL)
0120 F5 DELAY1: PUSH AF 0433 D5 PUSH DE
0121 D5 PUSH DE 0434 110001 LD DE, 0001
0122 1E 17 LD E,17H 0437 D5 PUSH DE
0124 1D P: DEC E 0438 CD B000 CALL DISPLAY
0125 20 FD JR NZ,P 043B D1 POP DE
0127 D1 POP DE 043C 1B DEC DE
0128 F1 POP AF 043D 7A 1D A,D
0129 C9 RET 043E B3 OR E
043F C2 3804 JP NZ P2
01F0 ORG 01F0H 0442 D1 POP DE
01F0 3F DEFB 3FH 0443 C1 POP BC
01F1 06 DEFB 06H 0444 23 INC HL
01F2 5B DEFB 5BH 0445 F1 POP AF
01F3 4F DEFB 4FH 0446 C30C04 JP LP
01F4 66 DEFB 66H
01F5 6D DEFB 6DH 0450 F5 TIMEDELAY: PUSH AF
01F6 7D DEFB 7DH 0451 D5 PUSH DE
01F7 07 DEFB 07H 0452 11 FF 02 LD DE,02FFH
01F8 7F DEFB 7FH 0455 1B A9: DEC DE
01F9 67 DEFB 67H 0456 7A LD A,D
01FA 77 DEFB 77H 0457 B3 OR E
01FB 7C DEFB 7CH 0458 20 FB JR NZ,A9
01FC 39 DEFB 39H 045A D1 POP DE
01FD 5E DEFB 5EH 045B F1 POP AF
01FE 79 DEFB 79H 045C C9 RET

TEST PROGRAM FOR PROGRAMMING OF EPROM


ADDR OPCODE LABLE MNEMONICS ADDR OPCODE LABLE MNEMONICS
0400 F3 DI 0457 B3 OR E
0401 ED 5B 04 20 LD DE,(2004H) 0458 20 FB JR NZ,A9
0405 2A 00 20 LD HL,(2000H) 045A D1 POP DE
0408 ED 4B 02 20 LD BC,(2002H) 045B F1 POP AF
040C 3E 80 LP: LD A,80H 045C C9 RET
040E D3 03 OUT (03),A
0410 CD 50 04 CALL TIMEDELAY PROGRAM FOR VERIFICATION OF EPROM PROGRAM
0413 ED A0 LDI 0500 F3 DI
0415 3E 00 LD A,0H 0501 ED 5B 00 20 LD DE,(2000H)
0417 D3 03 OUT (03),A 0505 2A 04 20 LD HL,(2004H)
0419 EA 0C 04 JP PE,LP 0508 ED 4B 02 20 LD BC,(2002H)
041C 3E 73 LD A,73H 050C 3E 00 X: LD A,00H
041E D3 03 OUT (03),A 050E D3 03 OUT (03),A
0420 D3 02 OUT (02),A 0510 1A LD A,(DE)
0422 76 HALT 0511 BE CP (HL)
0512 23 INC HL
0450 F5 TIMEDELAY: PUSH AF 0513 13 INC DE
0451 D5 PUSH DE 0514 0B DEC BC
0452 11 FF 02 LD DE,02FFH 0515 C2 30 05 JP NZ,ERROR
0455 1B A9: DEC DE 0518 EA 0C 05 JP PE,X
0456 7A LD A,D 051B 3E 39 LD A,39H

ELECTRONICS PROJECTS Vol. 20 67


051D D3 03 OUT (03),A 0538 CD B0 00 CALL DISPLAY
051F D3 02 OUT (02),A 053B C1 POP BC
0521 76 HALT 053C D1 POP DE
053D 1B DEC DE
0530 2B ERROR: DEC HL 053E 7A LD A,D
0531 4E LD C,(HL) 053F B3 OR E
0532 D5 PUSH DE 0540 20 F4 JR NZ,P2
0533 11 FF 0F LD DE,0FFFH 0542 D1 POP DE
0536 D5 P2: PUSH DE 0543 23 NC HL
0537 C5 PUSH BC 0544 C3 0C 05 JP X

Readers Comments: by keyboard into the RAM of the pro- ing data permanently into an EPROM
❑ 1. How can a hexdump be pro- grammer and then transferred (written) chip by suitable application of higher volt-
grammed? into the EPROM chip. age pulses in sequence, which is the
2. I have not found the contents of the 2. In the Z80 programmer article, method for entering data into an EPROM,
monitor EPROM (2716/64). Does it mean there is a program listing given, along in a nonvolatile manner. This unit (i.e.,
that it could be loaded with the monitor with the code (i.e., numbers). These num- the Z80-based programmer) has the
program of the 8088 given in the ‘Learn bers have to be entered into an EPROM needed circuitry for this.
To Use Microprocessors’ book? fixed in the Z80 programmer board. For Remember again, that as far as the
3. Please let me know the steps for this purpose, one has to use another EPROM is concerned, its contents are just
loading a 2716 with character generator EPROM programmer, as the present Z80 numbers in the range 0-255, written in
listing in the article, i.e., how the program programmer is not yet ready! its cells. A 2716 has 2k (2048) cells, a
is to be written in Z80 assembly language? The program that makes this ‘Z80 Pro- 2764 has 8k (8192) cells, and so on. The
Praveen Shankar grammer’ work is specific to it and hence Z80 assembly language has no connection
Haridwar only this programmer will work with it. with this. The unit uses a Z80 chip and so
The author, Prof. K. Padmanabhan The 8088 monitor program pertains to the we have given the operating program for
replies: 8088 kit only and is totally different. the unit in terms of Z80’s instruction set,
1. Programming any EPROM means 3. The numbers which go into the in the form of Z80’s assembly language.
filling its memory locations with code, character generator 2716 are, as given in The character generator codes are
i.e., numbers. Each cell in the chip is the article. Enter these numbers one-by- just numbers which give the pattern
written with a particular code, i.e., a one using the keyboard into the Z80-based of dots for each and every character—A,
number between 0 and 255 (or 00 to FF programmer unit and then run the pro- B, C, ... etc, while they appear on the
in hexadecimal notation). A ‘hexdump’ is gram for burning this data into the 2716 CRT screen. These numbers do not
just a series of numbers which occupy EPROM. In other words, use the present have anything to do with the Z80’s in-
these cells in the EPROM. In an EPROM Z80-based program unit to burn any struction sets, or for that matter, any
programmer, these numbers are entered EPROM with data. ‘Burning’ means writ- other microprocessor. ❑

68 ELECTRONICS PROJECTS Vol. 20


8098 DEVELOPMENT BOARD
K. PADMANABHAN & S. ANANTHI

A
mongst the 16-bit family of Intel ily, it has all of them at least partially. signing and proto-typing of the 8x9x prod-
microcontrollers, the 8098 is the For example, instead of eight analogue ucts. With its facilities, one can build a
one which is more economical and input channels on the main IC, this 48- prototype of the target product, develop
useful for developing a simple system for pin version has provision for four. Like- firmware for it, and debug and test its
understanding the architecture and soft- wise, the high-speed input and output fa- operation prior to the product entering
ware details of 8x9x family. Housed in a cilities are also available in a lesser quan- the manufacturing stage.”
48-pin DIP package (Fig.1), it has an 8- tity than in the main IC with the grid As the iSBE-96 is both expensive and
bit external data bus which is convenient chip carrier. Though the hardware fea- unobtainable, one Mr Coates developed
for interfacing to the byte-wide memory tures are present in slightly reduced pro- and published a system board working
IC’s data bus. Although it does not pos- portion in the 48-pin version of 8098, yet with a dumb terminal or PC as the host.
sess full features of the main 8x9x fam- all the software features of the main chip On this system, programs are developed
are fully supported by this smaller ver- only at machine-code level, by
sion as well. downloading instructions from the PC, or
In order to evaluate and understand the dumb terminal, which the system
the features and various other aspects of board executes. Even this is not a suffi-
the 8x9x family hardware and software, ciently handy system for quick and eco-
it is essential to have a system board nomical software development on this very
which is operating with the IC. Such sys- complex chip.
tems are not yet readily available in In- Therefore, it was decided (by the au-
dia, though Intel, itself markets a system thors) to develop and present a dedicated,
known as iSBE-96. As per Intel, “It is a simple but effective system development
tool available to designers for developing board/kit around this 8098, to enable all
systems based on the 8096 of its software and multi-tasking features
microcontroller. It uses the IBM PC to to be tested/experimented with and used
download to the iSBE-96, and is used in to develop suitable boards for the needed
typical development environment for de- instrumentation applications.

Fig. 1: Pin configuration of IC 8098

Note: A satisfactory demonstration of the


performance of the author’s 8098 prototype
kit was witnessed by EFY’s Chennai repre-
sentative. Fig. 2: Internal block diagram of 8098

ELECTRONICS PROJECTS Vol. 20 69


18
+5V
6

4
+5V

4
5

3
+5V
14

7
2
1
14

7
14
+5V
14
+5V
+5V

Fig. 3: Schematic diagram of 8098 development board


RD

+5V
33

14

Unlike a simple beginner’s microproc- display for effectively using its software module LT-111R from Philips. Such dis-
essor kit, such as the 8085 or Z-80 kits repertoire. Therefore this development plays are now commonly available in our
with 7-segment and LED displays, this board has been designed using a 16-char- country from multiple sources.
development system needs alphanumeric acter, single-line alphanumeric display As instructions have to be entered for

70 ELECTRONICS PROJECTS Vol. 20


Fig. 4: Block diagram of 16-characters x 1-line LCD module

program execution, a hexadecimal key- one should appreci-


board was built into the board, though it ate the wiz kids of
would have been equally possible to add Intel who developed
an IBM PC compatible keyboard. this 8x9x family soft-
The instruction set of the 8098 is very ware. The code is Fig. 5: Dimensional details of a typical 16 character x 1-line LCD module
complex, with its various multi-operand specific for each in-
formats. However, it is not as complex as struction type and addressing mode. pensive. The authors were, however, able
the 8096 where bit-level addressing modi- Please refer Tables I through III for its to obtain a cross-assembler from an al-
fications into the code are involved. This instructions set. ternate source (Pseudo Corp., USA) for
makes it absolutely impossible to write Intel sells cross-assembler, working just $50 in order to develop the needed
hand-code. The same is also true of on the PC, which can be used to develop software for the firmware of the develop-
Motorola’s 68000 family. In this respect code for 8098. This is comparatively ex- ment board and its applications that fol-
low. This is the background which
TABLE I led the authors to develop an 8098
Opcode and State Time Listing system of their own.
DIRECT IMMEDIATE INDIRECT¤ INDEXED¤
MNEMONIC

NORMAL AUTO-INC. SHORT LONG


OPERANDS

Description
OPCODE

OPCODE

OPCODE

OPCODE
STATE➀

STATE➀

STATE➀

STATE➀
BYTES

BYTES

BYTES

BYTES

BYTES

BYTES
TIMES

TIMES

TIMES

TIMES

TIMES

TIMES
The circuit is described with refer-
STATE

STATE

ence to the schematic diagram of


the system board shown in Fig.3.
ARITHMATIC INSTRUCTIONS
ADD 2 64 3 4 65 4 5 66 3 6/11 3 7/12 67 4 6/11 5 7/12 The main IC is the 8098
ADD 3 44 4 5 45 5 6 46 4 7/12 4 8/13 47 5 7/12 6 8/13 microcontroller itself whose inter-
ADDB 2 74 3 4 75 3 4 76 3 6/11 3 7/12 77 4 6/11 5 7/12 nal block diagram is shown in Fig.2.
ADDB 3 54 4 5 55 4 5 56 4 7/12 4 8/13 57 5 7/12 6 8/13 On its left, all input-output pins
ADDC 2 A4 3 4 A5 4 5 A6 3 6/11 3 7/12 A7 4 6/11 5 7/12
ADDCB 2 B4 3 4 B5 3 4 B6 3 6/11 3 7/12 B7 4 6/11 5 7/12 are shown. These include HSI and
SUB 2 68 3 4 69 4 5 6A 3 6/11 3 7/12 6B 4 6/11 5 7/12 HSO (HS stands for high speed)
SUB 3 48 4 5 49 5 6 4A 4 7/12 4 8/13 4B 5 7/12 6 8/13 pins, the four analogue signal in-
SUBB 2 78 3 4 79 3 4 7A 3 6/11 3 7/12 7B 4 6/11 5 7/12 put pins, the transmit and receive
SUBB 3 58 4 5 59 4 5 5A 4 7/12 4 8/13 5B 5 7/12 6 8/13
SUBC 2 A8 3 4 A9 4 5 AA 3 6/11 3 7/12 AB 4 6/11 5 7/12
pins of its serial interface and the
SUBCB 2 B8 3 4 B9 3 4 BA 3 6/11 3 7/12 BB 4 6/11 5 7/12 crystal oscillator as well as the reset
CMP 2 88 3 4 89 4 5 8A 3 6/11 3 7/12 8B 4 6/11 5 7/12 input pins. Output pins 7 and 8
CMPB 2 98 3 4 99 3 4 9A 3 6/11 3 7/12 9B 4 6/11 5 7/12 (HSO0 and HSO1) are provided
MULU 2 6C 3 25 6D 4 26 6E 3 27/32 3 28/33 6F 4 27/32 5 28/33 with high-current drivers (part of
MULU 3 4C 4 26 4D 5 27 4E 4 28/33 4 29/34 4F 5 28/33 6 29/34 IC ULN2003) to enable interfacing
MULUB 2 7C 3 17 7D 3 17 7E 3 19/24 3 20/25 7F 4 19/24 5 20/25 to relays etc.
MULUB 3 5C 4 18 5D 4 18 5E 4 20/25 4 21/26 5F 5 20/25 6 21/26
The 8098 has a multi-facet re-
MUL 2 ➁ 4 29 ➁ 5 30 ➁ 4 31/36 4 32/37 ➁ 5 31/36 6 32/37
MUL 3 ➁ 5 30 ➁ 6 31 ➁ 5 32/37 5 33/38 ➁ 6 32/37 7 33/38
set pin, which requires a careful
MULB 2 ➁ 4 21 ➁ 4 21 ➁ 4 23/28 4 24/29 ➁ 5 23/28 6 24/29 connection of the power-on reset
MULB 3 ➁ 5 22 ➁ 5 22 ➁ 5 24/29 5 25/30 ➁ 6 24/29 7 25/30 pulse to itself. Instead of just a
DIVU 2 8C 3 25 8D 4 26 8E 3 28/32 3 29/33 8F 4 28/32 5 29/33 simple resistor-capacitor network,
DIVUB 2 9C 3 17 9D 3 17 9E 3 20/24 3 21/25 9F 4 20/24 5 21/25 as found in most other
DIV 2 ➁ 4 29 ➁ 5 30 ➁ 4 32/36 4 33/37 ➁ 5 32/36 6 33/37
microprossors, this one has a gate
DIVB 2 ➁ 4 21 ➁ 4 21 ➁ 4 24/28 4 25/29 ➁ 5 24/28 6 25/29
to ensure a sharp reset input. In-
Notes: put must be low for at least 2 state
¤ Long indexed and indirect + instructions have indentical opcodes with short indexed and indirect modes, respectively. times to reset the chip. The clock is
The second byte of instructions using any indirect or indexed addressing mode specifies the exact mode used. If the
second byte is even, use indirect or short indexed. If it is odd, use indirect + or long indexed. In all cases the second internally generated with the crys-
byte of the instruction always specifies as even (word) location for the address referenced. tal connected between its pins 35
➀ Number of state times shown for internal/external operands. and 36. A 12MHz crystal is the
➁ The opcodes for signed multiply and divide are the opcodes for the unsigned function with an ‘FE’ appended as a prefix.
standard one, though lower fre-

ELECTRONICS PROJECTS Vol. 20 71


TABLE II while analogue channels 4 through 7
Opcode and State Time Listing are available. Analogue input for chan-
DIRECT IMMEDIATE INDIRECT¤ INDEXED¤ nel 4 has been routed through a very-
NORMAL AUTO-INC. SHORT LONG high-impedance op-amp CA3130 for use
MNEMONIC

OPERANDS
with very-low-level analogue signals.
OPCODE

OPCODE

OPCODE

OPCODE
Also, full 8-bit ports are not available;

STATEÀ

STATEÀ

STATEÀ

STATEÀ
BYTES

BYTES

BYTES

BYTES

BYTES

BYTES
TIMES

TIMES

TIMES

TIMES

TIMES

TIMES
STATE

STATE
only some bits are available for those
ports.
LOGICAL INSTRUCTIONS As with most Intel processors, the
AND 2 60 3 4 61 4 5 62 3 6/11 3 7/12 63 4 6/11 5 7/12 8-bit data bus is multiplexed with the
AND 3 40 4 5 41 5 6 42 4 7/12 4 8/13 43 5 7/12 6 8/13 low order address lines. However, in
ANDB 2 70 3 4 71 3 4 72 3 6/11 3 7/12 73 4 6/11 5 7/12
the 8x9x, there are two versions of the
ANDB 3 50 4 5 51 4 5 52 4 7/12 4 8/13 53 5 7/12 6 8/13
OR 2 80 3 4 81 4 5 82 3 6/11 3 7/12 83 4 6/11 5 7/12 address latch signal; one of them is
ORB 2 90 3 4 91 3 4 92 3 6/11 3 7/12 93 4 6/11 5 7/12 called ALE and the other is called ADV.
XOR 2 84 3 4 85 4 5 86 3 6/11 3 7/12 87 4 6/11 5 7/12 A 74LS373 IC is used for segregating
XORB 2 94 3 4 95 3 4 96 3 6/11 3 7/12 97 4 6/11 5 7/12
and latching A0 through A7 signals
DATA TRANSFER INSTRUCTIONS
LD 2 A0 3 4 A1 4 5 A2 3 6/11 3 7/12 A3 4 6/11 5 7/12
from the AD0-AD7. The data bus is
LDB 2 B0 3 4 B1 3 4 B2 3 6/11 3 7/12 B3 4 6/11 5 7/12 buffered using a 74LS245 bidirectional
ST 2 C0 3 4 – – – C2 3 7/11 3 8/12 C3 4 7/11 5 8/12 buffer. This is enabled by the RD sig-
STB 2 C4 3 4 – – – C6 3 7/11 3 8/12 C7 4 7/11 5 8/12 nal for data flow direction towards the
LDBSE 2 BC 3 4 BD 3 4 BE 3 6/11 3 7/12 BF 4 6/11 5 7/12
LDBZE 2 AC 3 4 AD 3 4 AE 3 6/11 3 7/12 AF 4 6/11 5 7/12
8098 data bus.
STACK OPERATIONS (internal stack) A dual 2-line to 4-line decoder IC,
PUSH 1 C8 2 8 C9 3 8 CA 2 11/15 2 12/16 CB 3 11/15 4 12/16 74LS139, is used as address decoder
POP 1 CC 2 12 – – – CE 2 14/18 2 14/18 CF 3 14/18 4 14/18 for memory and input-output address
PUSHF 0 F2 1 8 range selection. Address lines A14 and
POPF 0 F3 1 9
STACK OPERATIONS (external stack)
A15 are used to select a set of four
PUSH 1 C8 2 12 C9 3 12 CA 2 15/19 2 16/20 CB 3 15/19 4 16/20 groups of memory addresses in one of
POP 1 CC 2 14 – – – CE 2 16/20 2 16/20 CF 3 16/20 4 16/20 the decoders in the 64k address range
PUSHF 0 F2 1 12
POPF 0 F3 1 13
as under:
JUMPS AND CALLS 1. 0000H-3FFFH 2. 4000H-7FFFH
MNECONIC OPCODE BYTES STATES MNEMONIC OPCODE BYTES STATES 3. 8000H-BFFFH 4. C000H-FFFFH
LJMP E7 3 8 LCALL EF 3 13/16Ä The first group is meant for
SJMP 20-27Ã 2 8 SCALL 28-2FÃ 2 13/16Ä EPROM area, which contains the moni-
BR[ ] E3 2 8 RET F0 1 12/16Ä
tor program. The second address group
TRAPÂ F7 1
Notes: is used for input-output devices, and
À Number of state times shown for internal/external operands. therefore the ready pin 16 of the 8098
 The assembler does not accept this mnemonic is brought low when this group is
à The least significant 3 bits of the opcode are concatenated with the following 8 bits to form an 11-bit, 2's selected. This group is further subdi-
complement, offset for the relative call or jump vided into four smaller ranges in the
Ä State times for stack located internal/external.
Å The asssembler uses the generic jump mnemonic (BR) to generate this instruction. second decoder of 74LS139 as under:
1. 4000H-4FFFH 2. 5000H-5FFFH
quencies down to 4MHz could be used. 4 HSI.1
Here an 8MHz crystal has been used. The 5 HSI.2 or HSO.4
actual system clock is one-third of the crys- 6 HSI.3 or HSO.5
tal frequency and the state time is thus 7 HSO.0
325 ns (250 ns with 12MHz crystal). 8 HSO.1
Pins 11 and 37 are the ground or Vss 9 HSO.2
pins while pins 38 and 46 are connected 10 HSO.3
to positive 5 volts or Vcc. The reference 13 Port 2 bit 5 or PWM output
voltage for the analogue-to-digital coverter 43 Port 0.4 or analogue channel 4
section is applied at pin 45, which is also 42 Port 0.5 or analogue channel 5
connected here to +5V. Pin 44 is the ana- 40 Port 0.6 or analogue channel 6
logue ground pin. Though this has conti- 41 Port 0.7 or analogue channel 7
nuity with the digital ground or Vss, its 1 Transmit data or Port 2 bit 1
track has to be separately brought out for 2 Receive data or Port 2 bit 0
inputting the analogue signals. The vari- It may be noted that due to paucity of
ous high-speed input-output pins are given pins on this 48-pin chip, some pins assume
below for quick reference. a dual role, controlled by software, while
Pin Pin designation/ some functions are missing (not available).
no. function For example, analogue channels 0 through Fig. 6: Shows author’s prototype of 8098
3 HSI.0 3 for analogue input are not available development board

72 ELECTRONICS PROJECTS Vol. 20


TABLE III contact is debounced
Conditional Jumps and valid code is avail-
All conditional jumps are 2 byte instructions. They require 8 state times if the jump is taken, 4 if it is not.
able at A through D
MNEMONIC OPCODE MNEMONIC OPCODE MNEMONIC OPCODE MNEMONIC OPCODE output pins of the IC.
JC DB JE DF JGE D6 JGT D2 Simultaneously, ‘data
JNC D3 JNE D7 JLT DE JLE DA available’ information
JH D9 JV DD JVT DC JST D8 is output from pin 12
JNH D1 JNV D5 JNVT D4 JNST D0
of the IC. The output
JUMP ON BIT CLEAR OR BIT SET
data (A through D) and
These instructions are 3-byte instructions. They require 9 state times if the jump is taken, 5 if is it is not.
MNECONIC BIT NUMBER
‘data available’ pins are
0 1 2 3 4 5 6 7 interfaced to bits
JBC 30 31 32 33 34 35 36 37 D0 through D3 and D7
JBS 38 39 3A 3B 3C 3D 3E 3F respectively of the
LOOP CONTROL data bus via tri-state
DJNZ OPCODE EO. 3 BYTES: 5/9 STATE TIMES (NOT TAKEN/TAKEN) buffer IC 74LS365
SINGLE RESISTOR INSTRUCTIONS
for reading by the
MNECONIC OPCODE BYTES STATES MNEMONIC OPCODE BYTES STATES
DEC 05 2 4 EXT 06 2 4
microcontroller. There
DECB 15 2 4 EXTB 16 2 4 is another key called
NEG 03 2 4 NOT 02 2 4 the command key (CK),
NEGB 13 2 4 NOTB 12 2 4 which is connected to
INC 07 2 4 CLR 01 2 4 positive supply through
INCB 17 2 4 CLRB 11 2 4
a pull-up resistor.
SHIFT INSTRUCTIONS
When this key is
INSTR WORD INSTR BYTE INSTR DBL WD
MNEMONIC OP B MNEMONIC OP B MNEMONIC OP B STATE TIMES pressed, D6 bit be-
SHL 09 3 SHLB 19 3 SHLL 0D 3 7 + 1 PER SHIFTÆ comes low. Thus by
SHR 08 3 SHRB 18 3 SHRL 0C 3 7 + 1 PER SHIFTÆ pressing this key, to-
SHRA 0A 3 SHRAB 1A 3 SHRAL 0E 3 7 + 1 PER SHIFTÆ gether with the nu-
SPECIAL CONTROL INSTRUCTIONS meric (hex) keys, we
MNEMONIC OPCODE BYTES STATES MNEMONIC OPCODE BYTES STATES get additional set of
SETC F9 1 4 D1 FA 1 4
CLRC F8 1 4 E1 FB 1 4
key codes.
CLRVT FC 1 4 NOP FD 1 4 The monitor soft-
RST FF 1 16 SKIP 00 2 4 ware program reads
NORMALIZE the keyboard buffer at
NORML 0F 3 11 + 1 PER SHIFT address 5000H. The
Notes: presence of any key-clo-
Å This instruction takes 2 states to pull RST low, then holds it low for 2 states to initiate a reset. The reset takes 12 states, at which time sure is detected by the
the program restarts at location 2080H
Æ Execution will take at least 8 states, even for 0 shift. D7 bit going high. The
command key closure is
noted by looking at the
3. 6000H-6FFFH 4. 7000H-7FFFH ohms each. D6 bit status (low or high). The 74LS365
The 8000H and C000H groups are A keyboard encoder of the matrix type buffer is read by the RD signal at its
each of 16k. Two 28-pin sockets are pro- is used for connection to the hexadecimal pin 15.
vided for two RAM ICs. These could be keyboard. This is a 74C922 IC having its
fixed with 8k static RAM such as the 6264 own scan oscillator. The 16 keys are ar-
or the 32k RAM 62256. One may also use ranged in a 4 x 4 matrix for hex digits 0 The LCD Display Module
a RAM chip in the first socket and an through F. Whenever a key is closed, the The LCD module used in this project is
EEROM (such as 2864A) in the second 16-character single-row type. The inter-
socket. The EEROM will permit perma- TABLE IV nal block diagram and dimensional detail
nent storage of data or code. of a typical 16-character x 1-line LCD mod-
Pin Functions of LCD Module
An 8-bit data output port using latch ule are given in Figs 4 and 5 respectively.
Pin No. Function Level
IC 74LS373 is provided to enable out- 1 VSS 0V The display is a dot-matrix of 5 x 8 dots
putting of temporary data during pro- 2 VDD +5V for each character, with the bottom dot
gram development. This port is at the 3 VO 0.7V
4 RS 0=inst: 1=char
line used for the cursor. The module works
address range 4000H-4FFFH. The clock 5 R/W 0 = write: 1 = read with its own SMD LCD driver and con-
for this 74LS373 IC is obtained by the 6 E latch on fall troller LSI having internal memory com-
7 DB0 Databit 0
combining 4000H chip select signal 8 DB1 Databit 1 prising character generator (CG) ROM
with WR signal in a NOR gate of 9 DB2 Databit 2 and RAM as well as display data (DD)
IC 74LS02. For indication of the logic 10 DB3 Databit 3 RAM. The data can be entered into this
11 DB4 Databit 4
level at the output pins of this 74LS373 12 DB5 Databit 5 module from the 8098 through the data
IC, eight LEDs are fixed on the board 13 DB6 Databit 6 bus. There is a separate instruction set
with current limiting resistors of 220 14 DB7 Databit 7
for the LCD module. Additional Software

ELECTRONICS PROJECTS Vol. 20 73


play will show (on
TABLE V
keying in B first):
LCD Module Instruction Set
80 00 xB
Code
Instruction RS R/W DB7 DB6 DB5 DB4 DB3 DB2 DB1 DB0 Comments and after keying in 0,
Clear display 0 0 0 0 0 0 0 0 0 1 Clears display and home cursor the display will show:
Home cursor 0 0 0 0 0 0 0 0 1 x Returns cursor to home position 80 00 B0
Entry set 0 0 0 0 0 0 0 1 I/D S Selects cursor direction and shift Entries roll away
modes
Display control 0 0 0 0 0 0 1 D C B Selects display, cursor and flash modes
to left and enable cor-
Cursor or Display rections to be made.
shift 0 0 0 0 0 1 S/G R/L x x Moves cursor and shifts display To advance to the
Function set 0 0 0 0 1 DL N F x x Sets interface mode number of lines next address, the
and Command key and
character font
CG RAM address 0 0 0 1 MSB ACG LSB Selects CG RAM address
key 8 are pressed.
Following data is stored in CG RAM That is, keeping the
DD RAM address 0 0 1 MSB ADD LSB Selects DD RAM address Command key
Following data stored in DD RAM pressed, numeric key
Read busy flag 8 is pressed. The dis-
and address 0 1 BF MSB AC LSB Reads busy flag
play will then show:
Indicates if module ready
80 01 xx
Write data to CG
or DD RAM 1 0 MSB Write data LSB Writes data into CG or DD RAM If in place of Com-
Read data from CG mand key and 8 we
press Command key
Meaning of Bit Values ohm) connects to pin 3 of the module. The and numeric key 7, data B0 is stored
BIT 1 0 pin 4, register select (RS=0 selects instruc- against address 8000H before advancing
I/D Increment Decrement
S Enable Disable
tion register and RS=1 selects data regis-
PARTS LIST
S/G Display shift Cursor move ter) is connected to address line A0 to
Semiconductors:
R/L Shift to right Shift to left select one of the two internal registers. IC1 - 8098, 16-bit Microcontroller
D/L 8-bit mode 4-bit mode Pin 5 is the read/write (R/W) signal, ob- IC2, IC7 - 74LS373 octal D-type latch
N 2 lines 1 line
BF Busy Ready tained by inverting the RD in an inverter. IC3 - 74LS245 octal bus trans-
F Not used 5 x 7 dots Pin 6 is active high enable (E) signal. The receiver
IC4 - 2764, 8k byte EPROM
chip select at address 6000H is inverted IC5 - 6264, 8k byte static RAM
is therefore required to meaningfully write and connected to pin 6. Some LCDs come IC6 - 74LS139 dual 1-of-4 decoder
information into the LCD module, i.e. with 1 or 2 extra pins (pin nos. 15 and 16) IC8 - ULN2003 high current
characters, numbers, etc. The data byte for backplane illumination. In Lampex drivers
IC9 - CA3130 high input
is obtained from the character code map. supplied modules pin 15 is connected to
impedance op-amp
(Refer page 50 of Apr’97 issue of EFY for +5V via 33-ohm resistor while in Oriole IC10 - 74LS02 quad 2-input NOR
character code map or construction project and Crystlonics supplied modules , it is gate
named as “microprocessor LCD module” connected to ground. Pin 16 in Lampex IC11 - 74LS04 Hex inverter
in Electronics Project Vol. 18) The instruc- module is grounded while the other two IC12 - 74LS365 Hex buffer driver
IC13 - 74C922 keyboard encoder
tion set of LCD module is given in Table manufacturers do not use the same. IC14 - 74LS26 positive Nand gate
V. There are instructions for display setup, D1 - 0A91 detector diode
cursor positioning, setting the location of D2, D3 - 1N4148 switching diode
the next character, writing the character,
Software LED1-LED8 - Coloured LED
reading the DD RAM, shifting the dis- The listing of the monitor program is given Resistors (all ¼ W, ± 5% carbon, unless
in the Appendix ‘A’. Provision for entry of stated otherwise):
play right or left and even blinking the
R1-R9 - 10-kilo-ohm
cursor, etc. programs into the RAM memory, starting R10 - 33-kilo-ohm
For interfacing the LCD module, there at address 8000H or anywhere else, and R11, R12 - 10-kilo-ohm
is a 14-pin connector on LCD module. The executing them is made. Upon power on, R13-R20 - 220-ohm
data bus connects to pins 7 through 14 or pressing the reset switch, the LCD dis- R21 - 100-ohm
R22 - 39-kilo-ohm
(DB0 through DB7). Pin 2 is connected to play shows: R23 - 1-kilo-ohm
5V and pin 1 is connected to ground. A 80,000 xx VR1 - 10-kilo-ohm
contrast control potentiometer (10-kilo- which means that the high address is 80H Capacitors:
and the low order address is C1, C2 - 33pF ceramic disc
TABLE VI 00H. xx represents any ran- C3 - 4.7µF, 10V electrolytic
Command key and numeric key 1 Set high address dom data which may be C4, C5 - 0.1µF ceramic disc
Command key and numeric key 2 Set low address present in the RAM at ad- Miscellaneous:
Command key and numeric key 3 Execute program at - 16 character x 1-line
current display address dress 8000H. Using the Hex
LCD module
Command key and numeric key 4 Decrement address keyboard, data can be entered - Tactile switches
Command key and numeric key 7 Store current data and against the displayed ad- S1 - SPST switch
increment address dress. For example, if B0 is - Ni-Cd battery 1.2Vx3
Command key and numeric key 8 Just increment address Xtal - 8MHz quartz crystal
entered one by one, then dis-

74 ELECTRONICS PROJECTS Vol. 20


Appendix ‘A’ Monitor Program to the next address location, i.e. 80 01. If
Addr OpCode Label Mnemonics/Ass. Directives Comments now we want to decrement the address,
; LCD MONITOR PROGRAM USING command key and the numeric key 4 are
; INTEL-8098 MICROCONTROLLER
; ASSEMBLER USED - Pseudosam 96
pressed together and the display shows:
; (Cross-Assembler for 8096, 98 and 196kc 80 00 B0
; families) by PsedoCorp, USA. Now we can enter a small sample pro-
2000 ORG h’ 2000
2000 0081 ORG h’ 2000 DBh’00,h’ 81 ; TIMER OVERFLOW INTERRUPT gram as given below:
; VECTOR 80 00 A1 LD 80H, 4000H : load register 80
2002 ORG h’ 2002 with 4000H
2002 0282 DB h’ 02, h’ 82 ; A/D CONVERSION
2004 ORG h’ 2004 80 01 00 : which is LED
2004 0483 DB h’ 04, h’ 83 ; HSI DATA AVAILABLE port address
2006 ORG h’ 2006 80 02 40
2006 0684 DB h’ 06, h’ 84 ; HSO EXECUTION
2008 ORG h’ 2008 80 03 80
2008 0885 DB h’ 08, h’ 85 ; HSI . 0 80 04 B1 LD 70H,#55H : to output 55 to
200A ORG h’ 200A LED port
200A 0A86 DB h’ 0A, h’ 86 ; SOFTWARE TIMER
200C ORG h’ 200C 80 05 55
200C 0C87 DB h’ OC, h’ 87 ; SERIAL INPUT/OUTPUT 80 06 70
200E ORG h’ 200E
80 07 C6 STB 70,(80) : store contents
200E 0E88 DB h’ OE, h’ 88 ; EXT. INTERRUPT
2018 ORG h’ 2018 of 70 into
2018 95 DB h’ 95 ; CHIP CONFIGRATION BYTE 80 08 80
2019
2080 ORG h’ 2080 80 09 70 : memory point-
0018 EQU SP, h’ 0018 ; STACK POINTER ed to by 80, 81
0042 EQU REG42, h’ 0042 ; 80 0A 27 SJMP $ :
0043 EQU REG43, h’ 0043 ;
0044 EQU REG44, h’ 0044 ; 80 0B FE : loop here
0045 EQU REG45, h’ 0045 ; In the above program, the addresses
0046 EQU REG46, h’ 0046 ; INTERNAL REGISTERS
0048 EQU REG48, h’ 0048 ;
70, 80 are internal RAM locations, called
0052 EQU REG52, h’ 0052 ; Internal Registers of the 8098. For out-
0054 EQU REG54, h’ 0054 ; putting on the LED port, indirect address-
0056 EQU REG56, h’ 0056 ;
0058 EQU REG58, h’ 0058 ; ing via contents of RAM locations 80, 81
2080 has been employed. After entry of the
2080 A1C00018 LD SP, #h’ 00C0 ; SET STACK TO INT. “RAM” above programs from address locations 80
2084 A1008042 LD REG42, #h’ 8000 ; FIRST “RAM” ADDRESS EXT.
2088 B24244 LDB REG44, [REG 42] ; GET DATA 00 through 80 0B, one can execute the
208B A 1026058 LD REG 58, #h’ 6002 ; DATA REGISTER OF “LCD” program by pressing command key and
208F A 1006054 LD REG 54, #h’ 6000 ; COMMAND REG. OF “LCD”
2093 B13852 LDB REG 52 #h’ 38 ; “LCD” FUNC. SET COMMAND
then key no.3. The display would show:
2096 EF5800 LCALL CMD ; WRITE COMMAND TO “LCD” 80 00 B0 G _
2099 B10E52 LDB REG 52, #h’ 0E ; DISPLAY CONTROL COMMAND which means that the program from start
209C EF5200 LCALL CMD
209F B 10652 LDB REG 52, #h’ 06 ; “LCD” MODE COMMAND address 8000 H is going on.
20A2 EF4C00 LCALL CMD The interpretation of commands asso-
20A5 B24244 SC2: LDB REG 44, [REG 42] ; GET ADDRESS HIGH IN 44 ciated with Command key in combination
20A8 B10152 SC1: LDB REG 52, #h’ 01 ; CLEAR DISPLAY
20AB EF4300 LCALL CMD ; COMMAND TO LCD with a numeric key are given in Table VI.
20AE EF6F00 LCALL DISPLAY ; WRITE ADDR AND DATA IN Using the above commands it is pos-
20B1 EF4C00 LCALL KBD ; SCAN AND GET A KEY
20B4 994048 CMPB REG48, #h’ 40 ; IS KEYCODE> 48??
sible to enter a program, read the entered
20B7 DB08 JC D program or execute a program starting at
20B9 092C04 SHL 4, 44 ; ROTATE NIBBLE LEFT any address.
20BC 904448 ORB REG48, REG 44 ; AND JOIN WITH NEW HEX
20BF 27E7 SJMP SCI If an EEPROM is fitted in the spare
20C1 994148 D: CMPB REG48, #h’ 41 ; COMPARE WITH KEY 41 RAM socket (covering the address range
20C4 D705 JNE E C000H – FFFFH) such as 2864A, it is
20C6 B04344 LDB REG44, REG43 ; SET HIGH ADDRESS
20C9 27DA SJMP SC2 possible to write or read data to/from the
20CB 994248 E: CMPB REG48, #h’ 42 ; COMPARE WITH KEY 42 EEPROM in the mentioned address range.
20CE D705 JNE F
20D0 B04342 LDB REG42, REG44 ; SET LOW ADDRESS
It will retain the code even after switch
20D3 27D0 SJMP SC2 off and thus help in development work.
20D5 994448 F: CMPB REG48, #h’ 44 ; COMPARE WITH KEY 44 However, for reading stored data we must
20D8 D704 JNE P
20DA 0542 DEC REG42 ; DECREMENT ADDRESS use Command key and numeric key 8 (re-
20DC 27C7 SJMP SC2 fer Table VI) instead of the Command
20DE 994748 P: CMPB REG48, #h’47 ; COMPARE WITH KEY 47 key and numeric key 7, as that would
20E1 D707 JNE G
20E3 C64244 STB REG44, [REG42] ; STORE IN RAM & result in alteration of stored data because
20E6 0742 INC REG42 ; INCREMENT ADDRESS EEPROMs take time to write the data.
20E8 27BB SJMP SC2
20EA 994248 G: CMPB REG48, #h’ 43 ; COMPARE IF 43 KEY
Therefore while using EEPROMs, please
20ED D70E JNE K remember to use:
20EF E342 BR [REG42] ; JUMP INDIRECT TO ADDR. —Command key and numeric key 7
20F1 C65452 CMD: STB REG52, [REG54] ; WRITE INTO LCD
... to enter fresh byte at current address

ELECTRONICS PROJECTS Vol. 20 75


Addr OpCode Label Mnemonics/ Comments —Command key and numeric key 8... to read already en-
Ass. Directives tered stored data.
20F4 A1FF0556 LD REG56, #h’ 05FF ; FOR DELAY Some typical software programs worked on the development
LOOP COUNT
20F8 0556 AGAIN: DEC REG56 board which will demonstrate its proper usage:
20FA D7FC JNE AGAIN
20FC F0 RET 1. Direct & Immediate register addressing
20FD E7B000 K: LJMP INKEY
2100 A 1005046 KBD: LD REG46, #h’ 5000 ; KEYBOARD The following instructions are used for loading and storing
INPUT ADDR. words. Note that the immediate data 1234 will go into registers
2104 A24648 LD REG48, [REG46] ; READ FROM
KEYBOARD
such that 34 goes into even address 60 and 12 goes into odd
2107 3F48F6 JBS REG48, 7, KBD ; LAST LEY address 61.
RELEASED? Code Label Mnemonics Comments
210A EF9300 LCALL DELAY
210D A24648 LOOP: LD REG48, [REG46] A1 34 12 60 LD 60, #1234 ; Immediate load regrs. 60, 61
2110 3748F4 JBC REG48, 7, LOOP ; AWAIT A KEY ; with 1234
PRESSING A0 60 50 LD 50, 60 ; Load reg. 60 into reg. 50
2113 EF8A00 LCALL DELAY
2116 A24648 LD REG48, [REG46] ; READ AGAIN KBD C0 70 50 ST 50,70 ; Store reg. 50 into reg. 70
2119 3748F1 JBC REG48, 7, LOOP ; CHECK VALID KEY 27 FE Here: SJMP Here
211C 714F48 ANDB REG48, #h’ 4F ; MASK KEY CODE The following instructions are for loading and storing bytes.
WITH 4F
21 IF F0 RET Code Mnemonics Comments
2120 B04345 DISPLAY: LDB REG45, REG43 ; GET HIGH B1 AA 60 LDB 60, 0AAH ; Immediate loading reg. 60
ADDRESS A1 60 50 LDB 50, 60 ; Load from reg. 60 into reg. 50
2123 180445 SHRB REG45, 4 ; UPPER NIBBLE
SHIFTED C4 70 50 STB 50 , 70 ; Store from reg. 50 into reg. 70
2126 EF4000 LCALL ASCIIOUT ; CONVERT ASCII
AND 2. Register Indirect addressing
2129 B04345 LDB REG45, REG 43 ; OUTPUT
212C 710F45 ANDB REG45, #h’ 0F ; LOW NIBBLE Code Label Mnemonics Comments
212F EF3700 LCALL ASCIIOUT ; CONVERT & A1 AA 55 50 LD 50, #55AA ; Immediate loading of data
LCD OUTPUT ; into 50,51
2132 B12045 LDB REG45, #h’ 20 ; SPACE TO FOLLOW
2135 C65845 STB REG45, [REG58] ; WRITE TO A1 50 82 60 LD 60, #8250 ; Immediate loading of data
LCD DATA REG. ; into 60,61
2138 EF6500 LCALL DELAY C2 60 50 ST 50, (60) ; Store from 50,51 into
213B B04245 LDB REG45, REG42 ; FETCH LOW
ADDRESS ; address in 8250 & 8251
213E 180445 SHRB REG45, 4 ; PICK UPPER A2 60 70 LD 70, (60) ; Load contents of 8250,8251
NIBBLE ; into
2141 EF2500 LCALL ASCIIOUT ; & OUTPUT TO LCD
2144 B04245 LDB REG45, REG42 ; AGAIN LOW ; registers 70,71
ADDRESS 27 FE SJMP Here
2147 710F45 ANDB REG45, #h’ 0F ; GET LOW NIBBLE After running the above program at address 8000H, we can
214A EF1C00 LCALL ASCIIOUT
214D B12045 LDB REG45, #h’ 20 reset the system and examine memory:
2150 C65845 STB REG45, [REG58] ; SPACE TO FOLLOW Address Data
2153 EF4A00 LCALL DELAY ; GET DATA FIELD
2156 B04445 LDB REG45, REG44 ; PICK UPPER
00 70 AA
NIBBLE 00 71 55
2159 180445 SHRB REG45, 4 ; CONVERT AND The above are word operating instructions. The following
OUTPUT
215C EFOA00 LCALL ASCIIOUT ; DATA FIELD AGAIN are byte operating instructions:
215F B04445 LDB REG45, REG44 ; LOW NIBBLE Code Label Mnemonics Comments
2162 710F45 ANDB REG45, #h’ 0F
2165 EF0100 LCALL ASCIIOUT B1 FF 50 LDB 50, #FF ; Load byte FF into reg. 50
2168 F0 RET A1 60 83 60 LD 60, # 8360 ; Load 8360 into reg. 60,61
2169 990A45 ASCIIOUT: CMPB REG45, #h’ 0A ; FIND IS HEX C6 60 50 STB 50, (60) ; Store FF into memory
VALUE>A?
216C D305 JNC T B2 60 70 LDB 70, (60) ; Load from memory into 70
216E 753045 ADDB REG45, #h’ 30 ; IF LESS THAN A, 27 FE SJMP Here
ADD 37
2171 276B SJMPP Upon examining memory after running and resetting:
2173 753045 T: ADDB REG45, #h’ 30 ; FI HEX 0-9 ADD 30 Address Data
2176 A1FF0556 LD REG56, #h’ 05FF ; FOR DELAY COUNT 00 70 FF
217A 0556 A1: DEC REG56
217C D7FC JNEA1
217E C65845 STB REG45, [REG58] ; WRITE INTO LDC 3. Indirect Addressing with auto increment
2184 F0 RET The following program is for block movement from one
21A0 . ORG h’ 21A0 memory area to another, in 08 words block. The source address
21A0 A1FF0556 DELAY: LD REG56, #h’ 05FF ; DELAY COUNT
21A4 0556 A2: DEC REG56
is 8300H, and the destination address is 8400H.
21A6 D7FC JNE A2 Code Label Mnemonics Comments
21A8 F0 RET A1 00 84 80 LD 80, #8400 ; Destination address in Reg.
21B0 . ORG h’21B0 ; 80
21B0 994848 INKEY: CMPB REG48, #h’ 48
21B3 D702 JNEP1 A1 00 83 60 LD 60, #8300 ; Source address
21B5 0742 INC REG42 B1 08 50 LD 50, #08 ; words in 50
21B7 E7EBFE P1: LJMP SC2 A2 61 70 Read: LD 70, [60]+ ; Load [60] into 70 and
21BA
; increment
21BA
; 2 bytes

76 ELECTRONICS PROJECTS Vol. 20


Fig. 7: Actual-size component-side track layout for the circuit of Fig. 3 except LCD and keyboard interface circuits.

Fig. 8: Solder-side track layout for the circuit mentioned in Fig. 7.

ELECTRONICS PROJECTS Vol. 20 77


Fig. 9: Component layout for the PCB of Figs 7 and 8.

C2 81 70 ST 70, [80]+ ; Store from 70, 71 into address contains only a zero. Use of zero register addressing is depicted
; 8400 and increment in the following instruction:
E0 50 F1 DJNZ 50, Read ; Decrement word count Code Label Mnemonics Comments
; register A1 01 44 44 50 LD REG1 (50), ; Load reg. 1 with the con-
; and repeat read & store op. tents
27 FE Here: SJMP Here 4444H [0] ; of 4444H+0H
This is just equivalent to a direct or absolute memory ad-
4. Based or Indexed Addressing mode dressing.
The following is an example of short-indexed addressing.
This index can have values from -127 to +128. 6. Carry and Borrow in 8098
There is another form called long-indexed addressing. In In 8098, the C flag is set if there is no borrow in either a
this a full address range indexing is possible. subtract or compare instruction.
Code LabelMnemonics Comments CNP 50, #55 ; Compare the contents of
A1 20 84 50 LD REG 1, #8420H ; Reg1 IS 50 ; internal
; Load word into 50,51
A3 50 04 60 LD REG 2, 4 [reg1] ; Load word pointed to by TABLE VII
; reg. 1 + 4 into reg. 2 (60) HSO Command Tag Format
07 50 INC REG1 ; Increment register 1 D7 D6 D5 D4 D3 D2 D1 D0
A3 50 05 70 LD REG3, 5 [REG1] ; Load word pointed to X T D I n n n n
; by Reg1 +5 into Reg. Where X = Do not care
; 3(70) T = Timer2/Timer1
27 FE Here: SJMP Here D = Set/Clear HSO pin if relevant
Long Range Indexing: I = Interrupt On/Off
C3 51 00 10 60 ST REG2, nnnn = 0 - 5 = HSO0 - HSO5
1000H [REG1] ; STORE Contents of nnnn = 6 = HSO0 AND HSO1
; Register 2 at location nnnn = 7 = HSO2 AND HSO3
; pointed to by REG1 + 1000H nnnn = 8 - B = Software timers 8-B
nnnn = E = Reset Timer 2
5. Zero Register Addressing nnnn = F = Start ADC
There is a zero register or SRF at 0000H, which always

78 ELECTRONICS PROJECTS Vol. 20


; register 50 with value 55 Here let IREG equal 30H, WREG1 equal 40H, and WREG2
JC exit ; If value is greater than 55, equal 50H. The values used are supposed to be two’s comple-
; exit ment signed numbers and the result is a two’s complement 32-
bit number.
7. Use of Conditional Jump Instructions: 8000H FE 4C 50 40 30 MUL 30, 40, 50
JUMP IF CARRY JC 27 FE SJMP $ ;Halt
JUMP IF EQUAL JE The MULB instruction multiplies signed bytes. For example:
JUMP IF BIT SET JBS 8000H FE 5C 50 40 30 MULB 30, 40, 50
JUMP IF BIT CLEAR JBC This instruction would multiply the two bytes in 40 and 50
The above are commonly used jump instructions which use and place the word result in 30 and 31 (low order and high
short jumps from –127 to +128 only. order).
P2 EQU 10H ; Port 2 is the SFR at The MULU instruction is meant to be used for unsigned
; 0010H integers, for word operation and MULUB for byte operation.
8100H 35 10 03 JBC, P2, 5, NOTADD ; If port 2 bit 5 (pin 13) Divide instructions available are DIV, DIVU (unsigned) for
; is low, then branch word and byte operations respectively. DIVB is for byte operation
; NOTADD (signed) and DIVUB for unsigned division respectively. For
E7 2A 01 LJMP ADD1 example:
8240H ADD1: . . . . . FE 8C 40 30 DIV IREG, WREG ; Divide 32-bit integer in IREG
Here, a long jump is taken to ADD1 if the bit No. 5 is not ; by 16-bit integer in WREG
clear at port 2. Note that the ADD1 is at a distance given by: Here 30 is the start address of IREG and 40 is that of
8240H – 8106H = 012AH WREG. Dividend must be in 30, 31, 32, 33H; divisor in 40, 41H.
which is the displacement in the LJMP instruction. and result is in 30, 31H respectively. For example:
A SJMP which can branch between –1023 and +1028 can be 00 02 00 40... is stored in locations 32 30; (30) = 00; (31) = 40; (32) = 00;
employed if the distance is not too far. In the code itself, the (33) = 02
page number bit is included to allow for jumps within + or – 1K. 00 01 . . . is stored in location 40, 41 (00 in 40 and 01 in 41)
(20-27); 20 to 23 for negative values of offset and 24 to 27 for Result after program execution is in word at location 30 as
positive values of offset (refer Table III). 0200H, or 512. Remainder is in word at location 32 as 0040
H or 64 (dec).
8. Indirect branch instruction Some Programs Using High-speed Output: There are six
A1 00 50 50 LD 50, #5000H HSO usable pins in the 8098, from HSO.0 to HSO.5. In addition,
E3 50 BR [50] ;Branches to 5000H high-speed output function can also be associated with ‘Software
The above is a method of branching to the address pointed to timers’ and ‘starting of A/D conversion’ at a predetermined time.
by a register (word). Now the branching takes place indirectly The software timer interrupt can be employed for realising
through the word register 50. the function of something like a darkroom stop-watch, which
can be set to ring at a predetermined time. The following
9. Decrement and Jump instructions. program illustrates this application. It causes the LEDs of port
There is a decrement jump (not zero instruction), which can 4000H on the board to flicker at one second intervals. In using
use any register for counting or looping. HSO functions, the following registers of the SFR are impor-
; TIME DELAY PROGRAM tant:
8200H F2 TIME: PUSHF MINT ...Mask interrupt register 08H
B1 10 80 LDB 80, #10 ; Load a register 80 with PINT ...Pending inerrupt register 09H
; 10 HSOCMD ...HSO Command register
A1 FF FF 90 LOAD: LD 90, #0FFFFH ; Load word FFFF into reg. HSOTIME ...The HSO time from current time
; 90 Addr. Code Mnemonics Comments
05 90 A: DEC 90 8000H FA DI ; Disable interrupt
D7 FC JNE A 8001 B1 28 08 LDB MINT, 28H
E0 80 F5 DJNZ 80, LOAD ; Decrement and jump to ; Bit 5 Software timer int.
; LOAD ; Bit 3 HSO interrupt ; so 28H
F3 POPF 8004 B0 60 50 LDB 50,60 ; Transfer 60 to 50
F0 RET ; this is no. of interrupts/cycles
The inner loop uses a word decrement operation for which 8007 B1 38 06 LED HSOCMD,#38 ; Here 38H would mean that
the DJNZ cannot be employed. It works only up to FF. ; Timer 1 is used and
Like Jump, there are two Call Instuctions: ; interrupt is on.
SCALL for short distances -1024 to +1023 ; Also that software timer 8 is
LCALL for anywhere in memory (uses 3 bytes of code) ; used.
; Refer Table VII for HSO
10. Multiply and Divide Instructions ; Command
There is a three-operand instruction called MUL. It uses ; tag format
two-word registers, multiplies their content and puts the prod- 800A 45 00 80 0A 04 ADD HSOTIM, T1, #8000H
uct in another 32-bit register. For example: ; This command loads the
MUL IREG, WREG1, WREG2 time reg. with

ELECTRONICS PROJECTS Vol. 20 79


; with a time of 65 ms later ; To set HSO.0 w/o intr.
800F A1 00 40 72 LD 72, #4000H; LED Address is 4000h 0D 45 10 00 0A 04 ADD HSOTIM,
8013 C6 72 74 LDB 74, #00 ; 0 is stored in 74H T1, #0010 ; Pulse time
8016 FB EI ; Enable 12 FD FD NOP NOP
; interrupt 14 B1 10 06 LDB HSOCMD #10H
801A 27 FE SJMP $ ; Other task ; Clear HSO with
; (LOOP HERE) ; int. enabled
The above is the main program. The interrupt service routine 17 45 15 00 0A 04 ADD HSOTIM,
is at 200AH. In our monitor program, we have placed a jump T1, 0015 ; Pulse low period
from there to RAM location at 810AH. 1C FD FD NOP NOP
810AH B1 38 06 LDB HSOCMD #38 ; Again replace the command 1F F0 RET
0D 45 00 80 0A 04 ADD HSOTIM, T1, #8000 ; reload the number This program displays the pulse width in the LED port.
12 E0 50 09 DJNZ 50, RET Pulse can also be observed on the CRO at pin HSO.0 (pin 7).
15 B0 60 50 LDB 50, 60
18 95 FF 74 XORB 74, #FF ; Toggle the LEDs ANALOGUE DIGITAL CONVERSION
1B C6 72 74 STB (72), 74
1E F0 RET PROGRAMS
Upon executing this program, the port LEDs flicker at There are four channels of analogue input. Each channel gives a
1-second interval, if register 60 is loaded with 10H. 10-bit at a conversion time of 42 microseconds. The range of
10H x 65 ms = 16 x 65 ms = 1 sec on and 1 sec off. input voltage is 0 to 5V.
HSO Pulse Generation And Measurement of Pulse The various registers concerning A-D conversion are:
Width in HSI. As an application of pulse generation using HSO A/D COMMAND . . . 02H (WRITE)
and reading the pulse width using HSI, both input and output A/D RESULT . . . 02H (READ)
units are used. The main program can be any other program A/D RESULT . . . 02H (HIGH bits and status information)
(multi-tasking). 02H = x|x|x|x|G|2|1|0
Addr. Code Label Mnemonics Comments Bits 0-2 : channel number;
8000 FA DI ; Disable interrupt Bit 3 : Go, convert; Go = 1 means convert now;
8001 B1 08 08 LDB MINT, #8 ; HSO alone int. enabled Go = 0, start conversion by HSO interrupt.
8004 EF 03 03 LCALL LDCAM ; CAM LOAD Routine (later at a predetermined interval).
07 FB EI Suppose we want conversion on analogue channel 4 (0-3 not
08 B1 01 15 LDB IOC0.1, #01 ; IOC0 = 15, Bit 0 is 1. available on the 8098) now.
; enables HSI. 0 So, enter xxxx1100 on register 02H (AD.command)
0B B1 03 03 LDB HSIMODE, #03 Result:
; 00000011 both edges to 03H 02H
; look in the pulse D7 D6 D5 D4 D3 D2 D1 D0 D7 D6 D5 D4 D3 D2 D0 D1
0E 36 16 FD JBC 16, 6, $ ; 16 is HSISTAT, bit 6 is 9 8 7 6 5 4 3 2 1 0 x x S 2 1 0
; FIFO full <------- analog digitised value ------> â <--ch. no-->
; wait till 6 edges are Status 0 = idle; 1 = busy
; detected A/D program for one channel:
11 39 06 05 JBS HSISTAT, 1, P ; Is HSI.0 = 1, then it is 8000H B1 0C 02 B: LDB ADCOM #0C ; Start now, ch. 4
; positive edge FD NOP
14 A0 04 70 LD 70, HSITIME ; Dummy read to omit the FD NOP
; negative edge FD NOP
17 FD FD NOP (2) 3B O2 FD $: JBS, 3, 02h, $
19 A0 04 3A P: LD TIHI, HSITIM ; Read time of + edge into
; 3A A1 00 40 70 LD 70H, #4000H ; Led port addr. in 70H
1C FD FD NOP (2) C6 70 03 STB 03H, (70) ; Output to LEDs
1E A0 04 38 LD TILO, HSITIM ; Time at -ve edge into 38 27 EE SJMP B ; MS byte only
21 FD FD NOP (2) The above program takes samples and displays the most
23 48 3A 38 30 SUB 30, 38, 3A ; Subtract 38-3A TO find significant 8 bits of the analogue value on the LED display
; pulse width continuously.
27 A1 00 40 72 LD 72, # 4000H ; Load address
2B C6 72 30 STB 30, 72 ; At 4000H into 72H
; and PCB Layout
2E 27 FE SJMP $ ; Loop here The actual-size component-side and solder-side track layouts for
HSO ISR: VECTORS FROM 2006H the schematic diagram of Fig. 3, except the LCD and keyboard
HSOTIM EQU 15H interfaces, are given in Figs 7 and 8 respectively. The component
HSOCMD EQU 06H layout for the PCB is given in Fig. 9. Please note that IC8
8306 EF 01 00 LCALL LDCAM (ULN2003) is not used in PCB. If required it may be wired
F0 RET externally from connector.
0A B1 20 06 LDCAM: LDB HSOCMD #20h ❏

80 ELECTRONICS PROJECTS Vol. 20


REMOTE-CONTROLLED
AUDIO PROCESSOR
USING MICROCONTROLLER
VINAY CHADDHA

M
ost hi-fi audio CD systems It can retain data for a period of more than PARTS LIST
nowadays are available with ten years, including the current settings of Semiconductors:
remote control. However, no such volume, treble, balance, bass, as well as the IC1 - TDA7315 digitally controlled
circuit is available for adding to the AF on/off status of the main amplifier unit or audio processor
IC2 - MC68HC705KJ1CP
power amplifiers made as hobby projects. the relay status. The various audio param- Motorola microcontroller
The design of such an add-on circuit along eters can be stored in just six bytes. (GVC-AUD-257)
with remote control is presented here. It Mains power failure is quite common IC3 - 24C02 I2C serial EEPROM
can be used by hobbyists as an attachment in India. This does not allow the last set- IC4 - 7805 fixed regulator +5V
IC5 - 7809 fixed regulator +9V
to their audio power amplifiers. tings of volume, tone and balance to re- IC6 - µPD6121 infrared remote
This design is based on audio control- main intact. To overcome this the control
ler TDA7315 from SGS-THOMSON and microcontroller unit (MCU) must store all T1,T2,T3 - BC547 npn transistor
audio settings of the user in memory T4 - 2SC2001 npn transistor
Motorola microcontroller MC68HC705KJ1.
D0-D7 - Red LED
The microcontroller, after programming (EEPROM). The memory ensures that D8, D10-D11 - 1N4007 rectifier diode
with the specific software code for the cur- even after a power trip, the MCU will D9 - 8.2V,0.5W zener
rent application, has been renamed GVC- read the latest saved settings from the D12 - IR LED
AUD-257. Other construction projects by EEPROM. Resistors (all ¼ W, ± 5% carbon, unless
the author using the same series of Using two lines, SCL (serial clock) and stated otherwise):
R1,R2,R15,R16- 10-kilo-ohm
microcontrollers, which can be referred to SDA (serial data), the microcontroller can R3,R4,R14 - 1-kilo-ohm
for additional details, have been published read and write six bytes for all the audio R0,R5-R9,
in EFY in Jun. ’97 (Set-Top Converter) parameters. For more details on I2C bus R12,R13 - 330-ohm
reproduced in Electronics Project Vol. 18 and memory interfacing, please refer to R10,R11 - 5.6-kilo-ohm
R17 - 2-ohm, 0.5W
and Caller ID project, elsewhere in this Caller ID construction project, elsewhere R18,R19 - 200-kilo-ohm
volume. In addition to audio controller in this volume.
Capacitors:
and microcontroller the circuit comprises At power ‘on,’ the last-saved audio set- C1 - 10µF, 16V electrolytic
the following standard parts that are used tings are read by the MCU. In case memory C2-C4,C7,
in any normal system: IC cannot be read by the microcontroller, C19,C20 - 0.1µF ceramic disc
volume LED will blink three times to C15,C16,C9,
1. Power supply
C10,C11,C13 - 0.1µF polyester
2. LED indicator panel to indicate sta- indicate the problem. The possible reasons C5,C6 - 33pF ceramic disc
tus/keys pressed could be either a bad memory IC, or a C8 - 22µF, 25V electrolytic
3. Relay to switch on/off the supply to discontinuity/shorting of its tracks, or C12,C14 - 2.7nF polyster
C17,C18 - 2.2µF, 16V electrolytic
the power amplifier or the main unit improper insertion of the IC in its socket. C21,C22 - 220pF ceramic disc
The following parts are used in re- Under the circumstances, the unit will C23 - 10µF, 50V electrolytic
mote systems for VCR, TV, etc: still work, but it will not remember the Miscellaneous:
1. Memory (24C02). last settings and will select the centre RL1 - 12V, 150 ohm, SPST relay
2. Remote handset with 12 keys values of treble, balance and bass. Volume OEN Pt. No. 57DP-12-1C6
3. IR receiver for remote operation will be set at 50 per cent of the maximum XTAL - 4MHz quartz crystal
Y - 455kHz, ceramic resonator
Functionality of these parts is explain- value and the relay will be off. Loudness - Battery 1.5V, pencil cell
ed below with reference to Figs 1 and 3. and mute will also remain in the off mode. - IR sensor module
A remote handset can be used to change - Remote control handset,
the settings as desired. complete with keyboard
Description Audio controller. TDA7315 is a sin-
- Connectors for audio input-
output and power supply
Memory. 24C02 is an I2C bus compatible gle-chip I2C bus-compatible audio control- - 12V DC, 250mA battery
2k-bit EEPROM, organised as 256 x 8 bits. ler which is used to control all functions eliminator

ELECTRONICS PROJECTS Vol. 20 81


Fig. 1: Schematic diagram of remote-controlled audio processor using microcontroller
of the audio amplifier. Stereo audio input by an acknowledgement bit (ACK) weightage of bits representing audio pa-
from the preamplifier is fed to the IC in- • A sequence of data bytes, with each rameters, are shown in Table III. For
put. A microcontroller can control volume, byte followed by an acknowledge-ment bit sending the address and complete func-
treble, balance, bass and loudness. All • A stop condition tional parameters (six) of Table III, the
these parameters are programmed by For explanation of start, microcontroller has to send seven bytes of
microcontroller using SCL and SDA lines, acknowledgment and
which are the same lines as used for the stop conditions of I2C TABLE I
memory IC, as mentioned earlier. The au- protocol, elsewhere in The Audio Controller Reference
dio controller reference data is given in this volume. A typical Parameter Value
Table I. message format, com- Supply voltage 6 to 10V DC, 9V typically
To program any of the parameters, prising an address byte Max input signal 2 V minimum
Total harmonic distortion 0.01 % typical, 0.1% maximum
the following interface protocol is used and two data bytes, is
Signal-to-noise ratio 106 db typical
for sending the data from the MCU to shown in Table II. Channel separation 103 db @ 1 kHz
TDA7315. The interface protocol com- Address byte and Volume control 1.25 db step 0 to –78.75 dB
prises: audio parameters of Bass and treble control 2 db step +14 to –14 dB
• A start condition (S) TDA7315, showing the Balance control 1.25 db step 0 to –38.75 dB
• A chip address byte (80H) followed coding as well as Mute attenuation 100 dB typical

82 ELECTRONICS PROJECTS Vol. 20


TABLE II
MSB …… TDA7315 …… ADDR…… LSB MSB …… DATA……. LSB MSB…… DATA…….. LSB
S 1 0 0 0 0 0 0 0 A X X X X X X X X A X X X X X X X X A P
C C C
K K K
S = start condition ACK = acknowledgement P = stop condition X = any hex digit

Fig. 2(b): Software flow chart (contd.)

number adds Each increment in number adds attenua-


attenuation tion of 1.25 dB. The maximum attenua-
of 1.25 dB. tion is typically 37.5 dB.
Speaker- Speaker-control (R) byte. Any
control (L) number, from 160 to 191 (0A0H to 0BFH),
byte. Any can be sent. Minimum attenuation for the
number from right channel is 160(0A0H). Each incre-
128 to 159 ment in number adds an attenuation of
(80H to 9FH) 1.25 dB. The maximum attenuation is
can be sent. typically 37.5 dB.
Minimum at- Loudness byte. It has only two possi-
tenuation for ble values. When 64(40H) is sent, it sets
left channel the loudness on and when 70(44H) is sent,
Fig. 2(a): Software flow chart (contd.) is at it sets the loudness off.
128(80H). Bass control byte. Any number, from
data as well as start and stop condition
bits through I2C bus. The acknowledg- TABLE III
ment bit, after receipt of every byte, is MSB LSB FUNCTION
sent by the slave unit (TDA7315 in this 1 0 0 0 0 0 0 0 TDA7315 Chip address = 80H
case). 0 0 B2 B1 B0 A2 A1 A0 Volume control byte
Details of each audio control byte are 1 0 0 B1 B0 A2 A1 A0 Speaker control (L) byte
discussed below: 1 0 1 B1 B0 A2 A1 A0 Speaker control (R) byte
Volume-control byte. Any number 0 1 0 X X L X X Loudness byte
from 00 to 63 (or 3FH) can be sent (pro- 0 1 1 0 C3 C2 C1 C0 Bass control byte
grammed). Minimum attenuation is 0 1 1 1 C3 C2 C1 C0 Treble control byte
Bx = 10dB steps Ax = 1.25dB steps Cx = 2dB steps X = Don’t care
achieved with 00H. Each increment in

ELECTRONICS PROJECTS Vol. 20 83


from 112 to to switch on and switch off the relay.
127 (70H to Microcontroller. The function of
7FH), can be microcontroller is to receive commands
sent. This can from the remote handset, program audio
change the controllers as per the commands, and up-
treble value date the EEPROM if no new command is
from 14 dB given from the handset for six seconds.
gain to 14 dB However, for on/off and mute commands,
attenuation. it will update the EEPROM data immedi-
Table IV ately. The delay in updating the EEPROM
gives the is provided as normally the listener will
gain/attenua- change the value continuously till he is
tion for vari- satisfied. The MCU will, however, not
ous values of transfer all values (from RAM to
bass and tre- EEPROM) as and when these are
ble bytes. changed. Only when no key is pressed for
Thus to six seconds, will the MCU assume that
have volume the listener is satisfied and save the audio
at 10 dB at- values in the EEPROM.
tenuation This 16-pin microcontroller from
with perfectly Motorola (68HC705KJ1), used in this
balanced project, has a total of 11 I/O lines/pins.
sound, i.e. Two pins each are used for power supply
both speak- and crystal while one pin is used for reset
ers at equal function. Balance lines are available for
level, loud- any programming functions. Out of 11 I/
ness on and O lines, eight lines are exclusively used
maximum for LED outputs. Relay RL1 used for
treble and switching the mains supply to the output
minimum power amplifier shares the same line (PA0),
bass, the which is used for STDBY LED D0 output.
message to be Two lines are used for I2C bus which are
sent by the connected both to the EEPROM as well
MCU to the as the audio controller. One line (IRQ) is
TDA7315 on connected to the IR sensor output. In fact,
the I2C bus this pin serves the dual purpose of being
would be as used as an interrupt as well as an input
Fig. 2(c): Software flow chart (continued) follows: pin whose status can be read by the MCU.
START- The data sent from the remote handset is
96 to 111 (60H to 6FH), can be sent. This 80-08-80-A0-40-78-60-STOP received at this pin.
can change the bass range from 14 dB (Note: Normally, in the I2C interface The microcontroller also checks the
gain to 14dB loss (attenuation). data changes state only when the SCL functioning of the memory IC ST24C02
Treble-control byte. Any number, signal is low. However, ‘start’ and ‘stop’ and the audio controller IC TDA7315. If it
are special conditions, which indicate start is not able to communicate with these two
of I2C activity and end of I2C activity ICs on the I2C bus, it flashes the volume
TABLE IV
respectively on the bus. In start condi- and treble LEDs respectively to indicate
Bass byte Treble byte Gain(+) /Attn(-)
tion, SDA goes from high to low when that communication is not possible with
96(60H) 112(70H) -14 dB SCL is high. In a stop condition, SDA the respective ICs. Refer the assembly and
97(61H) 113(71H) -12 dB
goes from low to high when SCL is high. testing section for more details.
98(62H) 114(72H) -10 dB
99(63H) 115(73H) -8 dB Refer Apr. ’99 issue of EFY for details.) Remote control (Fig. 3). Remote con-
100(64H) 116(74H) -6 dB Microcontroller is programmed to trol is based on NEC µPD6121 custom-
101(65H) 117(75H) -4 dB check this IC (TDA7315) at power on. If ised remote transmitter IC. This IC is
102(66H) 118(76H) -2 dB the microcontroller cannot communicate also used by a number of TV manufactur-
103(67H) 119(77H) 0 dB with it through the I2C bus, it will indi- ers. The handset sends data in a specified
111(6FH) 127(7FH) 0 dB cate the error by flashing treble LED three format whenever any key is pressed on
110(6EH) 126(7EH) +2 dB
109(6DH) 125(7DH) +4 dB
times at power on. In this case audio val- the handset. The MCU reads the data
108(6CH) 124(7CH) +6 dB ues cannot be changed as communication and decides which key has been pressed.
107(6BH) 123(7BH) +8 dB between the microcontroller and the au- In this project, 12 keys have been used:
106(6AH) 122(7AH) +10 dB dio controller is not possible. However, 1. Loudness 2. Treble up
105(69H) 121(79H) +12 dB other parts of the unit will still function. 3. Balance right 4. Balance left
104(68H) 120(78H) +14 dB For instance, the remote unit can be used 5. Bass up 6. Power on/standby

84 ELECTRONICS PROJECTS Vol. 20


11. Vol up For instance, if you press the vol up key
12. Vol and keep it pressed, the volume will keep
down on increasing until it is maximum.
Standby, The audio centre key is the selection
loudness key. Pressing it once will cause it to set
and mute all audio parameters in centre. Pressing
keys are it again will have no further effect. It will
toggle keys, not cancel the audio centre mode, unlike
i.e. if you the standby, mute or loudness keys.
press them Remote handset circuit diagram is
once, they similar to that used for the Set-Top Con-
will change verter published in Jun. ’97 issue of EFY
the current (reproduced in Electronics Projects Vol.
state. For 18). The only difference is that one of the
instance, two 200 kilo-ohm resistors is now
pressing the connected to pin 12 in place of 13 of IC
loudness µPD6121. Also, the key names are
key when different and only 12 keys are used instead
loudness is of 21 in set-top converter.
already ‘on’ Transmission code. The remote’s
will cancel transmission code consists of a ‘leader
loudness. pulse,’ ‘16-bit customer code’ and ‘16-bit
Volume, data code.’ The carrier frequency with
treble, bal- 455kHz ceramic resonator is 38 kHz (1/12
ance and f0, where f0 is resonator’s fundamental fre-
bass keys quency). The code used is based on pulse
are repeat position modulation (PPM). The leader
Fig. 2(d): Software flow chart (continued)
keys. If you pulse consists of a 9ms carrier waveform
7. Audio centre 8. Bass down press them once and keep them pressed, (w/f) followed by 4.5ms off period. A ‘logic
9. Treble down 10. Mute the selected function keeps on repeating. 0’ consists of 0.56ms of carrier w/f fol-
lowed by 0.56ms of off period, and
a ‘logic 1’ consists of 1.125ms of
carrier w/f followed by 1.125ms
of off period. Each code byte
(starting with LSB) is followed
by inverse code byte to give an
extremely low-error rate.
The customer code (also re-
ferred to as custom code) of
µPD6121 suffix G-001 can be
configured as follows: The first
byte (high-order byte) bits are all
zeros (00000000) if no diode is
placed between K I/O pins and
CCS pin (cathode towards CCS).
For instance, if a diode is placed
across K I/O1 and CCS then the
higher order byte will become
01000000 (starting with LSB) or
02H. The low-order byte will be
inverse (10111111) of the high-
order byte, unless K I/O pins are
pulled to Vcc. For instance, if only
pin K I/O5 is pulled high then the
bit at that position only will not be
reversed. Thus the low-order byte
will become 10111011 (starting
with LSB) or DD (Hex). With the
above-mentioned diode and pull-
up resistor, the 16-bit custom code
Fig. 3: Schematic diagram of remote control would be 02DD (Hex). So, you can

ELECTRONICS PROJECTS Vol. 20 85


Fig. 4: Actual-size single-sided track layout for the schematic of Fig. 1

Fig. 5: Component layout for the PCB of Fig. 4

figure out how the custom code for the IR receiver module. This is a 3-pin Relay. This relay is used to switch off
present remote control circuit has been device incorporating surface mount IC. the main power amplifier circuit. Thus,
arrived at. The key code for each key is Two pins are for +5V supply and ground when the unit is switched off from re-
annotated on the keys in Fig. 3. Grounding while the third pin is for data output. IR mote, supply to the amplifier circuit is
of SEL pin 7 results in bit D7 of key code to receiver module receives the data sent by switched off, and this saves electricity.
be set to 1. Hence, key at intersection of row remote handset, amplifies, demodulates Only the circuit in this construction arti-
0 and column 0 would generate 80H as the and converts it to MCU-compatible volt- cle remains active and waits for any re-
key code. Complete remote code table for age format and outputs it on its data out- mote key operation. Relay can be used to
the present circuit configuration is given put pin. The MCU can decode this signal control AC supply or DC supply of the
in Table V. and act as per the key pressed. amplifier as desired. This choice is left to

86 ELECTRONICS PROJECTS Vol. 20


TABLE V Loudness. This LED is on when the external +12V adaptor and two linear
Remote Code Table loudness mode is on. Pressing the loud- industry-standard regulators, 7805 and
ness key will change the state of LED 7809. External +12V DC is also used for
Custom code 00 7E
Power (PWR) 85 and unit—from loudness on to loudness relay driving. So, make sure that the adap-
Mute (MUT) 8F off or loudness off, to loudness on. Press- tor is capable of catering for the relay
Treble up (TR+) 88 ing audio centre key will switch off this load easily. On full load, its voltage should
Treble down (TR-) 8B LED (if on) and set the loudness off. not drop below +11V DC.
Bass up (B+) 81
Bass down (B-) 83 Audio centre. This LED (marked flat)
Volume up (VL +) 93 goes on when the audio centre key is
Volume down (VL -) 97 pressed. All tone parameters are set at
Assembly and Testing
Balance left (BL) 94 normal, i.e. zero-attenuation for speak- Complete circuit comprising the MCU, the
Balance right (BR) 90
ers, with bass and treble at 0 dB (no gain/ memory, the audio controller and the IR
Audio centre (AC) 86
Loudness 80 no attenuation) and loudness is switched receiver, as also the power supply circuit,
off. Mute is cancelled if active. Just flat is shown in Fig. 1. Actual-size, single-sided
the reader assembling the circuit. Relay frequency response. Volume remains un- PCB for the circuit of Fig. 1 is shown in
and standby LED share the same pin from disturbed. Changing treble/balance/bass/ Fig. 4. The component layout for the PCB
the microcontroller as stated earlier. loudness level from the remote controller is shown in Fig. 5. No PCB is shown for
LED indicator panel. Eight LEDs will switch off this LED. remote. However, suitable pre-assembled
are used in the circuit. Their functions are: Volume. This LED is on when the vol remote control for the project is proposed
Standby. This LED is on when the up/vol down key is pressed. The LED goes to be made available to readers through
unit is in standby mode (power amplifier off as soon as the key is released. Kits‘n’Spares outlet.
off). When this LED is on, all other LEDs Treble. This LED is on when the treble The circuit is very simple, having very
will be off and all keys, except the standby up/treble down key is pressed. The LED few components. Before installing the
key, are rejected. Pressing the standby goes off as soon as the key is released. main ICs for MCU, memory, audio con-
key, in this state, will switch the unit on. Bass: This LED is on when the bass up/ troller in their sockets and soldering the
Mute. This LED is on when the unit bass down key is pressed. IR receiver module, make sure that sup-
is in the mute mode. Pressing the mute Balance: This LED is on when the bal- ply voltage is correct. All parts, except
key will toggle the state of LED and unit, ance left or balance right key is pressed. the audio controller, require +5V as logic
i.e. from mute to sound or sound to mute. The LED goes off as soon as the key is supply. The audio controller requires +9V
This LED is also switched off when the released. supply for the audio control section. The
unit is in sound mode, i.e. when any key Power supply. The unit requires +5V remote can be operated with two 1.5-volt
which changes the volume level is pressed regulated supply for all three major com- pencil cells.
(e.g. vol down, treble up/treble down, bass ponents—MCU/ EEPROM/IR Sensor. The The unit has built-in diagnostics,
up/bass down, balance up/balance down, audio controller requires +9V for the au- which will make the job of testing very
loudness and audio centre). dio amplifier section. Supply design uses easy. Use Table VI to test the unit and
identify/rectify faults.
TABLE VI
Indication Possible Fault And Remedial Action
All LEDs blink thrice but remote Micro controller OK. Check infra-red sensor
Software flow chart
does not function connections or remote handset. For commercial reasons the software
No LED blinks Check supply voltage/crystal connection to MCU/pull for the project, which is intellectual prop-
up resistance and capacitor at reset pin of MCU. erty of the author, is not included. How-
Vol.LED blinks thrice Replace 24C02, check supply, SCL/SDA lines to 24C02 ever, logical flow charts of the software
Treble LED blinks thrice Replace 7315, check supply SCL/SDA lines to TDA7315 are given in Figs 2(a) through 2(d), which
Vol &Treble LED blink thrice Check pull up resistance on SDA.Replace 24C02 and are quite self-explanatory.
TDA7315. Check SCL and SDA lines ❑

Readers Comments: ware, software, and documentation for 6121 (not available at Internet site of
❏ Can I use an IR sensor of the type developing projects using Motorola NEC)?
used in Philips CTV in the circuit? MC68HC705KJ1 MCU? Are there any Ronak Chokshi
❏ Is it possible to add a key-pad at the books available on this microcontroller Baroda
processor board, so that it can be oper- and I2C bus technology? ❏ Is TDA7315, which after program-
ated even without a remote control unit? Somnath Bhattacharyya ming is renamed as GVC-AUD257,
❏ Can we have PCB layout of remote Calcutta readily available in the market?
transmitter unit? ❏ What should be put in place of the ❏ Is the remote set with key-pads and
❏ Could you tell me from where to get sensor module for IR sensing? cabinet available with Kits‘n’Spares?
ready programmed microcontroller for the ❏ Where is the entire assembly of the ❏ What is the change observed when
circuit? project to be connected in an audio sys- 200k resistance is connected to pin 12 or
❏ Could I have addresses of vendors tem (CD system for example)? pin 13 of IC 6121 in remote control?
who can supply development tools, hard- ❏ How can I get data-sheet of processor ❏ I think there is no I/O pin free in the

ELECTRONICS PROJECTS Vol. 20 87


microcontroller. How can functions such
as play, stop, skip for CD, and CD/TAPE/
FM be performed?
Rajeesh Kr. Verma
Meerut Cantt
❏ What is meant by ‘I2C bus’?
❏ Is any buffer required before or after
the processor for impedance matching?
❏ Can you suggest similar control for
‘deck front panel?’
❏ What is the difference between crys- Fig. 1 Block schematic and pin configuration of Telefunken IR sensor (Rxr) module
tal and resonator?
❏ What do you mean by renaming of plifier and before power amplifier. In a Crystal is more accurate and expen-
processor as GVC-AUD257 after program- readymade system, preamplifier outputs sive compared to resonator which is low-
ming? are usually marked as line output. cost and not very reliable or accurate.
A.G. Babu 6121’s data-sheets are available with Renaming of the processor is similar
Lakshadweep EFY. to a blank audio cassette being recorded
❏ Is the audio controller in-built with (The data-sheets comprise 22 pages. with songs in your own voice and then
audio power amplifier? These can be provided on payment of putting some specific label to indicate
❏ Are the left and right outputs from Rs 50 by DD (in favour of EFY Enter- what it contains.
audio controller TDA7315 again fed to the prises Pvt Ltd) to cover postage and han- Mr Salunkhe may note, there is no
power amplifier? dling charges. in-built power amplifier. Separate power
Sandeep A. Salunkhe —Editor amplifier is required at the output of
Pune As for Mr Verma’s questions, GVC- TDA7315.
❏ I feel the IR receiver details are pur- AUD257 is available with Kits‘n’Spares Regarding Mr Kakad's queries:
posely witheld. This amounts to falsely (as part of kit) and is not available in The description of IR receiver modules
enticing a reader to buy the magazine. local market. Remote set is also available have been covered in a number of EFY
Aroon Kakad from Kits‘n’Spares. issues, in detail. Please go through ‘IR
aroonkakad@hotmail.com 200k resistance is added for generat- Remote Control’ project published in Dec.
The author, Vinay Chaddha, replies: ing custom code in remote handset. If cus- ’97 (Electronics Projects Vol. 18) and Jun.
Mr Bhattacharyya can use IR sensor of tom code is changed by changing resis- ’98 (Electronics Projects Vol. 19). These
Philips TV. But in this circuit it is not tance positions, the microcontroller will have also been covered in Jun. ’99 circuit
possible to add local key-pad. The not respond to the remote handset. idea titled ‘Simple Sensitive Remote Con-
microcontroller used in this circuit has For additional functions, a different trol Tester’ (elsewhere in this volume).
limited number of I/O pins and memory microcontroller with more pins and Such IR receiver modules manufac-
which are not sufficient for adding local memory is required. KJ1 version cannot tured by various firms (Sharp, Sony,
keyboard routines. be used for additional functions. Telefunken, etc) are used in most remote
The complete kit of remote control unit Regarding the queries of Mr Babu, TV and VCP/VCR sets and hence are no
and programmed microcontroller may be some details regarding I2C bus are avail- secret. The pin configuration (positive,
procured through Kits‘n’Spares. able in the construction article by the au- ground, and signal terminals) in these
He can download all relevant data thor published in April ’99 issue of EFY modules differ from one manufacturer to
from Websites of Motorola, Philips, and or elsewhere in this volume. the other. The internal block diagram of
SGS-Thomson. Development kit for No special impedance matching is re- Telefunken model IR sensor and its pin
microcontroller KJ1 is available through quired. configuration are given in Fig. 1. One may
Motorola’s authorised distrbutors. Logic tape decks specially designed and substitute the IR sensor module with IC
Regarding Mr Chokshi’s queries, sen- manufactured for remote control operations µPD1373 (used in conjunction with a
sor module for IR are available from Kits‘n’ are not easily available in India. However, photo-diode—refer EFY May’98 or Elec-
Spares as well as local markets in Delhi it is possible to use a different micro- tronic Project Vol. 19). Also refer the Q/A
and Mumbai. These may be available from controller with more memory and I/O pins section following for some more informa-
TV repair workshops in your city also. to control it. That is a big project which tion.
This system is to be used after pream- cannot be handled through these columns. —Tech Editor ❏

88 ELECTRONICS PROJECTS Vol. 20


SOUJUNIOR — A
WIRELESS PROGRAMMABLE
CONTROL UNIT
T. GAUTHAM KUMAR

O
ne of the most exciting and ad- board may be replaced by
venturous expeditions of this a conventional 8085 kit,
century was done not by a hu- but the port addresses
man being but by a small machine called have to be modified in the
Soujurner. It was a kind of rover that software accordingly.
traversed all the ridges and grooves on a 3. An IR or a RF link.
planet whose terrain was unknown to the Here an IR link has been
man of yesteryears. Well, before you be- used to reduce the com-
gin to think that a science fiction story is plexity of the project. But
going to be told, the author would like to with FM transmitters
enlighten you about the relevance of and receivers being eas-
Soujurner to this project, Soujunior. ily available in the mar-
The basic technology of Soujurner, as ket, all one has to do is Fig. 2: 8255 control word register
all technicians might know, consists of a to connect the FM trans-
receiver unit that receives signals or com- mitter in the final output stage at the
mands from humans on earth and ex- respective ends.
ecutes the instructions on the remote 8085 microprocessor-based control
planet. It also has an on-board microproc- unit. As we all know, the 8085 micro-
essor which helps it to take decisions on processor is intrinsically an 8-bit micro-
its own, in environments that are alien to processor, but it is more than sufficient
human kind. In this project a similar con- for real-time applications where rugged-
cept is used. Although it would not be as ness is a more important parameter than
complex as the Rover, it serves its pur- speed and complexity. The device has 40
pose. pins, and there is no need to discuss the
significance of each pin on the IC as it is
readily available in any microprocessor
Description handbook. But one significant pin which
This project basically consists of the many of us do not use much on the kits is
following modules (refer block diagram of the SID pin 5. It is the serial input data
Fig. 1). pin that can be used to get data serially
1. A PC from which information is into the microprocessor at the desired rate. Fig. 3: PC-transmitter interface
transmitted to the control unit wirelessly, There is also a complementary SOD pin 4
using either IR or RF beam. (not used here) which is used as serial tion in the software to convert it into an
2. An 8085 control unit receives the data output pin. The SID line is used by interrupt driven one.
signals serially and executes the instruc- using a software instruction called RIM Interfacing of the 8085 to the exter-
tions after it receives the execute com- in the 8085 assembly mnemonic. The demo nal world has been done using 8255 chip
mand from the PC. The microprocessor system here is not an interrupt driven (programmable peripheral interface or
one, al- PPI) which is present on most of the 8085
though it kits. The 8255 IC consists of 4 ports (port
requires A, port B, port C, and a control port or
only a register). Ports A through C can be
slight configured to operate as either input or
Fig. 1: Block diagram of Soujunior modifica- output ports depending on our require-

ELECTRONICS PROJECTS Vol. 20 89


ments. This is
achieved by
writing a control
word into the
control register.
Here, in this
project, all the
three ports have
been configured
as output ports
as no input data
is required to be
received via
8255. All the
three ports could
be used to con-
trol external de-
vices or move-
ments. Control
word can be
formed with the
help of Fig. 2.
Serial input data
is envisaged to
be received di-
rectly via SID
pin of 8085. Fig. 4: Receiver-8085 kit interface
All the in-
structions— TABLE I at 38 kHz as the IR receiver is sensitive
starting from Key Binary Code Screen Display Decimal Eqlnt. Of to that frequency.
the initialisa- Pre- Transmitted Binary Values Displayed Pin 3 of the parallel port correspond-
tion of the 8085, ssed by LEDs At Receiver ing to data bit D1 of port 378H has been
(8085) End on Execution
8255 to acquir- used for outputting the serial data. The
ing of input data After Start Bit (1) Sequence to be executed speed selected is 100 bps (bit duration
a 1010 A 0001 0011 0101 1, 3, 5 (sequentially)
from the SID b 0110 B 0010 0100 0110 2, 4, 6 of 10 ms), and this can be easily in-
line, storing, ar- c 1110 C 1111 1110 1101 15, 14, 13 creased with modification in the soft-
ranging, and in- d 1100 D 1100 1011 1010 12, 11, 10 ware part alone.
terpreting of the e 1000 E 0111 1000 1001 7, 8, 9 Reset pin 4 of IC 555 has been used
x 0100 Executing Instructions !! Not Applicable
data—are Press Any Key to continue!
to control the 555 output via pin 3 of the
stored in the parallel port as mentioned already.
EPROM (such as 2764 or 27128) of the the kit. These can normally be found in When reset pin goes high, a 40kHz modu-
8085 kit as monitor program. The tempo- the documentation of the kit. lated IR beam is transmitted, while there
rary data, which may keep varying, can- is no transmission when the reset pin is
not be stored in the EPROM and hence low.
the same is stored in a RAM (such as
Operation The protocol used for communication
62256) chip of the 8085 kit. RAM loca- Following are the memory and input-out- consists of a start bit (accomplished
tions have been used to store the data/ put device addresses (for 8085 control through software) followed by four data
instructions received via the SID line for unit) used in this project: bits that carry the instruction to the re-
later execution. The instructions that are Memory Mapped Addresses mote receiver. The transmitter (and re-
received from the central control unit (the EPROM address range : 0000 to 3FFFH ceiver) end waveforms at various pins of
PC in this case) are stored in a queue, RAM address range : 4000 to BFFFH NE555 are shown in Fig. 5.
and when the execute instruction is re- Input-output Addresses Receiver interface (Fig. 4). The re-
ceived from the PC, the 8085 processor of 8255 port A : - 00H ceiver-end hardware interface consists of
the kit starts execution of the instruc- 8255 port B : - 01H an IR receiver module followed by a high-
tions on a FIFX (first in first execute) 8255 port C : - 02H input-impedance-emitter-follower circuit
basis. 8255 control register : - 03H to prevent overloading. The output from
The 8085 kit also contains necessary Transmitter interface (Fig. 3). The the emitter-follower is then directly con-
address selection circuitry to allocate transmitter-end hardware used for inter- nected to the SID pin of 8085 on the kit.
range of addresses for memory devices facing to the PC in this project comprises The output of the IR module, when there
(RAM/EPROM) and input-output devices an IR transmitter. It basically consists of is no IR beam, is high, and vice versa.
(e.g. 8255 and keyboard decoder IC) on a 555 IC, which modulates the IR beam The software monitor program in the

90 ELECTRONICS PROJECTS Vol. 20


The rearranging of the seri- PARTS LIST
ally acquired data bits is done Semiconductors:
before it is stored in the RAM IC1 - NE555 timer
as a 4-bit data, i.e. the serial IC2,IC3 - 74LS07 hex buffers/drivers
T1 - BC107 npn transistor
data is converted into paral- IR LED1,
lel data format. IR LED2 - SE303A, SE307, or
Finally, when it receives equivalent infrared light
the 4-bit ‘execute’ instruction, emitting diode
LED1- LED8 - Red LEDs
it starts executing the
instructions that have previ- Resistors (all ¼ W, ± 5% carbon, unless
stated otherwise):
ously been stored in the RAM R1 - 47-kilo-ohm
locations—one by one, R2 - 56-kilo-ohm
sequentially. A unique count R3 - 22-ohm, 0.5W
sequence output is used in R4, R6-R13 - 100-ohm
R5 - 1-meg-ohm
the program for each instruc- R14-R21 - 330-ohm x 8 SIP resistor
tion. Identical output se- network (RNW)
quence corresponding to each Capacitors:
Fig. 5: Waveforms at transmitter and receiver end instruction (on execution) is C1 - 220pF ceramic
C2 - 0.1µF ceramic
Miscellaneous:
TSOP 1738 - IR receiver module
(38KHz)
- Male/female mating
connectors for 25-pin ‘D’ of
parallel PC port and 8255
O/P port of 8085 kit
- 8085 kit with 8255 PPI

control unit could be used even for a more


complex process.
As 8085 kits including RAM, ROM/
EPROM, and 8255 PPI are economically
Fig. 6: Actual-size, single-side PCB layout for Fig. 3 and 4
available in the market.

Software
The source code for the software at the
PC end and at the receiver end is given
below. The former software is written in
‘Turbo C’ while the latter software, to be
stored in the EPROM of 8085 kit, is writ-
ten in 8085 Assembly language.
The PC-end software is interactive.
When you run the program on the PC, it
prints the the following message on the
Fig. 7: Component layout for the PCB
computer screen:
8085 kit continuously scans the SID line. made available from port A as well as Enter Instruction key!
When it detects a low signal it identifies it port B of 8255. In response, you are required to enter
as the start bit. The first instruction bit is The outputs PA0 through PA3 (as well any one of the letters from ‘a’ through ‘e,’
scanned after a delay of 15 ms, i.e. at the as PB0 through PB3) of 8255 have been or ‘x’. While letters ‘a’ through ‘e’ are to
middle position of the first data bit. The used here to light LEDs (LED1 to LED4 be used for different instructions, letter
remaining three data bits are like-wise and LED5 to LED8 respectively). Open- ‘x’ is used for prompting the execution of
scanned after 10ms delay so that the scan- collector hex buffer/driver ICs 74LS07 the previously entered instructions.
ning is done at the middle position of each have been used to augment the output The binary codes transmitted in re-
bit. An instruction sequence comprising a drive capability of 8255 ports. sponse to depression of each of the
start bit 1 followed by binary bits 0010, as In actual practice an 8085 control unit abovementioned letters on the keyboard,
available on SID pin of 8085, is graphi- may not be required. But when the device together with messages printed on the
cally depicted in Fig. 5. (The logic level of to be controlled at the receiver end re- screen, are summarised in Table I. The
transmitted data is complement of the data quires some intelligence of its own (such last column indicates the LEDs at output
at SID pin). as a robot), a microprocessor board in- of register A and register B of 8255 at
It then stores the instruction compris- cluding on-board RAM, ROM, and PPI 8085 kit end which will sequentially light
ing four bits in sequential RAM addresses. facilities is essentially required. Such a up as a result of execution of specific in-

ELECTRONICS PROJECTS Vol. 20 91


structions. 4801H are used for storing the actual an instruction or execution command. If
The receiver end monitor software instructions. it is an instruction, the same is stored.
starts with initialisation of stack at ad- The program continuously scans the All instructions are like-wise stored in se-
dress 47FFH and configuration of 8255 SID pin for receipt of start bit (causing quential RAM locations starting with
with control word 80H (all registers in SID pin to go low). If start bit is received, 4801H. If it is ‘execute’ command, the
output mode). The RAM location 4900H it scans for the next bit after a delay of 15 stored instructions are sequentially ex-
initialised to 0 is used as a counter for ms, and thereafter a delay of 10 ms for ecuted by branching to specific sub-rou-
storing the number of instructions re- the next bit, until all four bits are scanned. tine for each instruction. Each specific
ceived prior to receipt of ‘execute’ com- The four bits so received are properly routine here lights different LEDs as per
mand, while the RAM locations starting arranged and checked to find out if it is the last column of Table I.

Transmitter-end ‘C’ Listing


#include <dos.h> outp(0x378,0); if(c==’e’)
#include <stdio.h> delay(10); {
#include <conio.h> outp(0x378,2); /*0110*/ outtextxy(20,keyp,“E”);
#include <graphics.h> delay(10); outtextxy(400,seqp,“0111 1000 1001”);
void main() outp(0x378,2); keyp=keyp+15;
{ delay(10); seqp=seqp+15;
int gd=DETECT,gm; outp(0x378,0); outp(0x378,2);
int keyp,seqp; } delay(10);
char c; if(c==’c’) outp(0x378,2);
initgraph(&gd,&gm,“”); { delay(10);
outtextxy(20,20,“Enter Instruction Key!”); outtextxy(20,keyp,“C”); outp(0x378,0); /*1000*/
outtextxy(400,20,“Sequence to be Exectuted:”); outtextxy(400,seqp,“1111 1110 1101”); delay(10);
keyp=seqp=40; keyp=keyp+15; outp(0x378,0);
c=getch(); seqp=seqp+15; delay(10);
while(c!=’q’) outp(0x378,2); outp(0x378,0);
{ delay(10); }
if(c==’a’) outp(0x378,2); if(c==’x’)
{ delay(10); {
outtextxy(20,keyp,“A”); outp(0x378,2); /*1110*/ outp(0x378,2);
outtextxy(400,seqp,“0001 0011 0101"); delay(10); delay(10);
keyp=keyp+15; outp(0x378,2); outp(0x378,0);
seqp=seqp+15; delay(10); delay(10);
outp(0x378,2); outp(0x378,0); outp(0x378,2); /*0100*/
delay(10); } delay(10);
outp(0x378,2); if(c==’d’) outp(0x378,0);
delay(10); { delay(10);
outp(0x378,0); /*1010*/ outtextxy(20,keyp,“D”); outp(0x378,0);
delay(10); outtextxy(400,seqp,“1100 1011 1010”); outtextxy(150,240,“Executing
outp(0x378,2); keyp=keyp+15; Instructions!!”);
delay(10); seqp=seqp+15; outtextxy(150,260,“Press Any Key to
outp(0x378,0); outp(0x378,2); Continue!”);
} delay(10); getch();
if(c==’b’) outp(0x378,2); setfillstyle(SOLID_FILL,0);
{ delay(10); bar(0,30,640,480);
outtextxy(20,keyp,“B”); outp(0x378,2); /*1100*/ keyp=seqp=40;
outtextxy(400,seqp,“0010 0100 0110”); delay(10); }
keyp=keyp+15; outp(0x378,0);
seqp=seqp+15; delay(10); c=getch();
outp(0x378,2); outp(0x378,0); }
delay(10); } }

Receiver-end 8085 Assembly Language Listing


CREG EQU 03H ; 8255 Control Reg LXI H,4900H CMC
; Addr MVI M,0 MOV A,B
PRTA EQU 00H ; 8255 Port Addr LXI H,4801H RAL
PRTB EQU 01H PUSH H MOV B,A
PRTC EQU 02H PUSH B
STACKEQU 47FFH ; Stack addr in 62256 SCAN: RIM ; Scanning for Start Bit CALL DELAY
; On Reset ANI 80H POP B
ORG 0000H JNZ SCAN DCR C
JMP 0060H CALL DELAY1 JNZ READ
ORG 0060H MVI C,4H JMP INTERPRET
MVI B,0H
; Initialisation ONE: STC ; When One is Received
Procedure READ: RIM ; Reading Data via SID MOV A,B
ANI 80H RAL
INITS: DI ; Disabling Interrupts JZ ONE MOV B,A
LXI SP,STACK; Initialising Stack PUSH B
MVI A,80H ZERO: STC ; When Zero is CALL DELAY
OUT CREG ; Setting CReg Value Received POP B

92 ELECTRONICS PROJECTS Vol. 20


DCR C OUT PRTA OUT PRTA
JNZ READ OUT PRTB OUT PRTB
CALL DEL2S CALL DEL2S
INTERPRET: MVI A,3H MVI A,9H
MOV A,B ;Interpreting Received OUT PRTA OUT PRTA
CPI 0AH ;Data OUT PRTB OUT PRTB
JZ STORE CALL DEL2S CALL DEL2S
CPI 06H MVI A,5H JMP SUB
JZ STORE OUT PRTA
CPI 0EH OUT PRTB DELAY1:
JZ STORE CALL DEL2S MVI C,7H ;Delay 1 = 15ms
CPI 0CH JMP SUB DEL1: MVI B,64H
JZ STORE DEL2: NOP
CPI 08H EX2: MVI A,2H ;Exec 2 Seq = 2,4,6 NOP
JZ STORE OUT PRTA NOP
CPI 04H OUT PRTB ANI 3H
JZ EXEC CALL DEL2S ORI 4H
JMP SCAN MVI A,4H PUSH B
OUT PRTA POP B
STORE:POP H ;Storing Received Data OUT PRTB STA 4920H
MOV M,A ;in RAM CALL DEL2S DCR B
INX H MVI A,6H JNZ DEL2
PUSH H OUT PRTA DCR C
LXI H,4900H OUT PRTB JNZ DEL1
INR M CALL DEL2S RET
JMP SCAN JMP SUB
DELAY:MVI C,4H ;Delay 2 = 10ms
EXEC: LXI H,4900H ; When Execute EX3: MVI A,0FH ;Exec 3 Seq = 15,14,13 DELS1: MVI B,64H
MOV C,M ; Command is Received OUT PRTA DELS2: MVI A,8H
LXI H,4801H OUT PRTB NOP
CALL DEL2S NOP
EXECUTE: MVI A,0EH ANI 3H
MOV A,M ; Execution Procedure OUT PRTA ORI 4H
PUSH H OUT PRTB PUSH B
PUSH B CALL DEL2S POP B
CPI 0AH MVI A,0DH STA 4920H
JZ EX1 OUT PRTA DCR B
CPI 06H OUT PRTB JNZ DELS2
JZ EX2 CALL DEL2S DCR C
CPI 0EH JMP SUB JNZ DELS1
JZ EX3 RET
CPI 0CH EX4: MVI A,0CH ;Exec 4 Seq = 12,11,10 DEL2S: MVI C,0B6H ;Delay 3 = 2Secs
JZ EX4 OUT PRTA DEL2S1:MVI B,0FFH
CPI 08H OUT PRTB DEL2S2: PUSH B
JZ EX5 CALL DEL2S POP B
MVI A,0BH STA 4920H
SUB: POP B OUT PRTA STA 4920H
POP H OUT PRTB PUSH B
INX H CALL DEL2S POP B
DCR C MVI A,0AH STA 4920H
JNZ EXECUTE OUT PRTA PUSH B
MVI A,0H OUT PRTB POP B
OUT PRTA CALL DEL2S STA 4920H
OUT PRTB ;Resetting O/P and JMP SUB DCR B
LXI H,4900H ;Memory for new Data JNZ DEL2S2
MVI M,0 EX5: MVI A,7H ;Exec 5 Seq = 7,8,9 DCR C
LXI H,4801H OUT PRTA JNZ DEL2S1
PUSH H OUT PRTB RET
JMP SCAN CALL DEL2S END
EX1: MVI A,1H ;Exec 1 Seq = 1,3,5 MVI A,8H ❑

Readers Comments: mitter circuit to be in working condition. to be used. LEDs did glow in our prototype.
❑ Please answer the following queries But we don’t know how to check the re- As mentioned in the text, output pin of
regarding this circuit: ceiver circuit. the IR receiver module should be ‘high’
1. Should we cover the receiver mod- 5. We used Microsoft kit and port ad- when there is no IR transmission. It should
ule during reception as it receives only in dress 41h for Port A, 42h for Port B, and go ‘low’ when a modulated IR beam falls on
dark? 43h for Port C. Is there any possibility of it. Please check if you have used correct pin
2. Can we use FM receiver instead of error due to this address usage? connections in the module and whether the
the receiver module? K.R. Anuradha module’s frequency matches with transmit-
3. Did LEDs in your transmitter and Through e-mail ter’s modulating frequency.
receiver circuit glow? During our demo, EFY: IR receiver module receives in day- If you have used a different kit, you
LEDs in the transmitter and receiver did light too, so it need not be covered. We have have to change the port addresses (together
not glow. used IR receiver module during testing and with control word register address) in the
4. Using CRO, we confirmed the trans- it worked satisfactorily. FM receiver is not receiver-end program. ❑

ELECTRONICS PROJECTS Vol. 20 93


50Hz SINEWAVE
INVERTER
USING MOSFETs
R.V. DHEKALE

A
t present, most uninterruptible are two basic configurations: high pass PARTS LIST
power supply (UPS) systems and low pass. Semiconductors:
available in the market provide The low pass type is generally pre- T1,T2,T3 - BC548 npn transistor
square wave output, which is unsuitable ferred because the feedback network at- T4,T5,T6,T7 - BC549 npn transistor
for powering those equipment which have tenuates harmonics of the fundamental T8,T9 - IRF250, n-channel power
rotating machinery such as induction mo- frequency, resulting in purer sine wave MOSFET
D1,D2 - 1N4007 rectifier diode
tors and blowers. Also, for computer sys- output. Accordingly, the low frequency D3,D4 - 12V, 1W zener diode
tems, which make use of linear power sup- model has been adopted here, which has
plies (for maintaining lower noise levels), resistors in the series arm and capacitors Resistors (all ¼-watt, ± 5% carbon, unless
square wave input results in higher noise in the parallel arms. The applicable for- stated otherwise):
level. mulas for the given configuration are: R1-R3,R5,R8 - 22-kilo-ohm
R4,R12 - 4.7-kilo-ohm
Sine wave (230V AC at 50 Hz) in- (a) Frequency R6,R10 - 68-kilo-ohm
verter is the ideal choice for powering R7,R23,R24 - 470-ohm
devices such as EPABX, cordless phone, R9 - 92-kilo-ohm
medical electronics equipment and even where C denotes shunt arm capaci- R11,R19,R20 - 100-ohm
TV, VCR, or computer etc, during mains tance and R the series arm resistance val- R13,R14 - 1-kilo-ohm
R15,R17 - 15-kilo-ohm
failure. Circuit of such an inverter, using ues. R16,R18 - 1.5-kilo-ohm
MOSFETs in the final power amplifier (b) Minimum required current gain = R21,R22 - 10-kilo-ohm
stage, is presented here. 56 [in common emitter configuration – for VR1,VR2 - 4.7 kilo-ohm pot
sustaining oscillations] Capacitors:
In Fig. 2, R = R1 = R2 = R3 = 22 kilo- C1,C2,C3 - 0.47µ, 25V tantalum
The Circuit ohm and C=C1=C2=C3=0.47µF provide a
C4,C6 - 1µF, 25V electrolytic
C5,C8 - 100µF, 16V electrolytic
An RC coupled oscillator has been cho- frequency of approximately 50 Hz. C7 - 10µF, 25V electrolytic
sen for developing the gate drive for the As amplitude of sine wave output from C9,C10 - 0.1µF polyster
final MOSFET power amplifier circuit (re- transistor T1 is quite low, it is amplified C11,C12 - 47µF, 25V electrolytic
fer Fig. 2) as it is inherently stable. There by transistors T2 and T3. The collector C13* - 12 or 16µF, 440V AC,
paper
load for transistor C14 - 0.1µF ceramic disc
T3 is a 9-volt
transistor radio’s Miscellaneous:
driver trans- X1 - Driver transformer
former. Capacitor (9V transistor radio type)
X2* - 9V-0-9V AC, 16A
C7 (10µF) was primary to 200V,0.75A
test selected for secondary transformer
the optimum - Battery 12V, 40Ah
pulse shape and - Heat sink, mica washers
amplitude (18V - Multi-strand teflon
insulated wire, teflon
peak-to-peak washers
across primary). - Heat sink compound
The value of ca-
pacitor C7 would its parameters may differ widely from one
depend upon the manufacturer to the other.
driver trans- With this circuit, a sine wave with a
Fig. 1: Oscilloscope picture of the sine wave output waveform former used, as peak amplitude of 6-volt across secondary

94 ELECTRONICS PROJECTS Vol. 20


volt peak. 230V AC is 750 mH and the calculated
The 50 Hz value of capacitor is 13.5 µF. One could
sine wave out- practically use a value of 12 to 16 µF
put from tran- (440V AC rating) to obtain a reasonable
sistor amplifi- sine wave shape. The detailed specifica-
ers T4 and T5 tions of the power transformer X2 used
are applied to during the actual testing of the proto-
the gates of type are as follows:
MOSFETs T8 Core material: CRGO
and T9 Core type: 7EI
(IRF250) via Tongue width: 5.08 cm
emitter follow- Window area: 18.969 sq. cm
ers (T6 and Stack height: 6.35 cm
T7), protective Primary turns: 15 + 15 (bifiliar) of 12
diodes (D1 and SWG
D2), current Sec. turns: 345 + 22.5 + 22.5
limiting resis- One may also use a ready-made
tors (R23 and transformer with primary voltage speci-
R240), and fication of 9V AC – 0 – 9V AC (16-
gate protecting ampere current rating) and a secondary
zeners (D3 and voltage rating of 200V AC (750mA or
D4). higher current rating). The supply for
During the circuit may be taken from a single
each half cycle, 12-volt, 40Ah battery, which is adequate
only one of the for catering to about 150-watt load for
two MOSFETs more than two hours in the absence of
conducts and mains supply. Higher ampere-hour bat-
drives current teries could be used for obtaining longer
through half of standby capacity/period. Circuit for float
the primary charger is not included as the same can
windings of be adopted from several of battery
output trans- charger circuits published in EFY maga-
Fig. 2: Complete circuit diagram of 50Hz sine wave inverter

former X2 (in zine off and on.


opposite direc- Suitable actual-size, single-sided PCB
tions). Thus al- for the circuit of Fig. 2 is given in Fig. 4.
ternating cur- The component layout for the PCB is
rent flows shown in Fig. 5. All components, with
through the the exception of MOSFETs are accom-
primary (and modated on the PCB. The two MOSFETs,
so also through are to be mounted on appropriate heat
secondary) of sink. A single heat sink may be used but
transformer the MOSFETs may be insulated from
X2. Potmeters the heat sink using mica insulators and
VR1 and VR2
have been pro-
vided for vary-
ing the base
drive for tran-
sistors T4 and
T5, so as to ob-
of driver transformer could be observed tain equal gate drives for MOSFETs T8
during testing of the prototype. Phase and T9 respectively.
splitting (1800) of the output across sec- The value of capacitor C13 across
ondary of driver transformer takes place the secondary windings of transformer
because of transformer action. The centre X2 (shown separately in Fig. 3) is so
tap of secondary winding of transformer chosen that it resonates with the sec-
X1 is connected to positive rails via 4.7- ondary inductance at the 50Hz
kilo-ohm resistor R12 while the two ends frequency to maintain the output wave-
are connected to amplifiers comprising form as close to a sine wave as possible.
transistors T4 and T5 for raising the level The measured value of secondary induc-
of the input 50Hz signal to around 10- tance across terminals marked 0 and Fig. 3: Transformer X2 details

ELECTRONICS PROJECTS Vol. 20 95


Fig. 6: Wiring diagram showing interconnections
between different parts of the inverter

secured using either teflon screws/nuts


or appropriate teflon washers, ensuring
that the drain/body is not shorted to the
Fig. 4: Actual-size single-sided PCB layout for 50Hz sinewave inverter heat sink. Also use heat sink compound
between the MOSFET body and mica
insulator as well as between mica insu-
lator and the heat sink. Precaution by
way of shorting all three terminals of
MOSFETs together, using a thin copper
strand and soldering them together, may
be taken when the item is being handled
during assembly. Remove this shorting
only after the assembly and complete
wiring is over.
Fig. 6 shows the wiring diagram of
different parts of the inverter. Multi-
strand teflon insulated wires of suitable
current handling capacity should be used
for extending the connections from bat-
tery as well as transformer X2 to the
MOSFET terminals. The PCB (without
MOSFETs) should be fully tested before
connecting the final gate outputs to the
Fig. 5: Component layout for the PCB of Fig. 3 MOSFETs. ❑

Readers Comments: like to say:


❑ The author is requested to clear my 1. For the inverter a transformer of 9-
following doubts. 0-9V, 50A is used since the supply volt-
1. To drive 600W load, a transformer age for the transformer is 12 volts i.e. 4+4 MOSFETs are required.
of 9-0-9V, 50A primary to 230V, 4A sec- Input Power = 12 x 50 = 600 watts Additional 4+4 MOSFETs can be used,
ondary rating was used. How is the trans- Output Power = 230 x 2.6 = 600 watts since as the number of MOSFETs in-
former rating for this load decided? If there Secondary current rating can be con- creases, the heat radiated by the
is any formula, please mention the same. sidered as 2.6 amp, but sometimes output MOSFETs decreases.
2. On what factor does the number of voltage may rise to 260V. In order to tol- 3. For 600-watt load, with supply of
MOSFETs connected in the circuit de- erate the additional secondary current, 4 12V, the supply current Ip is:
pend? (e.g. 5+5, 1+1, etc) amp rating is considered.
3. With 600W load, how long can a 2. For 150 watts, 1+1 IRF250
fully charged battery work? MOSFETs are required. This means cur-
4. How can we run 3-phase induction rent Id through each MOSFET with sup- This means a battery of 12V, 105 amp
motor using this circuit? ply of 12 volts is: hour can be used for 2 hours.
V.S. Nara For three-phase motor it is necessary
Guldgudd to have three outputs with 120 phase dif-
The author, R.V. Dhekale, replies: ference between any two outputs.
In reply to Mr Nara’s letter I would ❑

96 ELECTRONICS PROJECTS Vol. 20


AN 8085 MICROPROCESSOR
KIT FOR INSTRUCTORS
K. PADMANABHAN, S. ANANTHI & R.S. SANKARAN

T
he course on microprocessors in vided in this kit. This is in addition to data, and mnemonics in the format as
most electronic engineering insti- the LCD display which shows the depicted in Table II.
tutions begins with Intel 8085. The address and data fields as well as the The second row in the table shows the
main reasons are that it is easy to under- mnemonics. The monitor program of the character slot positions of the LCD mod-
stand, can be taught at any level—school kit has provision for disassembly of in- ule. The third row shows how the high
or college—and covers all the essential structions, i.e., showing the mnemonic address 10H, the low address 00H, and
features of any general-purpose micropro- of the code at every location. While im- the data 3E at that address are shown
cessor. The blackboard teaching for this parting training, the instructor first asks towards the left half (character positions
microprocessor must be supplemented by the trainee to write the codes by refer- 1 to 8), while the mnemonics appear on
both practical training on circuit assem- ring to the instruction set, so that he the right half of the display (character
bly and testing, as well as simple exer- may get familiar with them. Subse- positions 9 to 16).
cises comprising elementary programs for quently, the instructor can check and The kit has provision for an EPROM
gaining confidence in the use of 8085 in- verify if the instructions are as per the (a 2716 or a 2764), which is preprog-
struction set. Although many commercial mnemonics using the disassembler mode rammed with the monitor program firm-
trainer kits are available in the market, (CRL +D). ware, given in Appendix ‘A’ as a hex dump.
with each one possessing certain unique The simply hexadecimal keyboard has This occupies pages 0 to 7 only. If one fits
features, for the purpose of gaining prac- only 16 key switches which make it com- a EPROM 2764, there is plenty of extra
tical knowledge, one should wire up a cir- pact. All commands are entered through space for the instructor to load teaching
cuit board himself. Amongst others, an the extra control (CRL) key. For example, programs for demonstration to students.
instructor should invariably do so before CRL key pressed together with numeric There is an additional socket which
embarking on teaching or writing texts key 1 will set the high address. Similarly, can hold a 6264 (8k RAM) or a 2864 (8k
for microprocessor training classes. Here CRL + 2 keys will set the low address, RAM) EEPROM. EEPROM 2864 is meant
is one such kit, which is not only compact while CRL + 3 keys will execute the pro- for students to try lengthy programs which
but also possesses certain features (needed gram at the current address, and so on. might take few days—with the kit being
for teaching purposes), hitherto not avail- Table I lists all these command instruc- turned off in the evening after the practi-
able in any of the commercial kits. tions. Incidentally, the same commands cal session. The EEPROM 2864 is pro-
This kit comprises an on-board LCD have been used by the authors in their grammed in-situ as one enters data into
display module. It has a 16-character, sin- book ‘Learn to
TABLE I
gle-line, alphanumeric display. This mod- Use Microproces-
ule has an integral microcontroller (such sors,’ with the ex- Command Key Usage for the LCD 8085 Kit
as KS0066 LCD driver IC from Samsung), ception of the key Keys Pressed Function
which easily interfaces to the 8085 kit. for disassembly (CRL + 1) Sets the high address to the value in the display
The module provides character display (CRL + D). (CRL + 2) Sets the low address to the value in the display
(CRL + 3) Executes program at the current address in display
(with contrast adjustment facility), which The LCD (CRL + 4) Decrements the address by one and shows data there
is a very useful feature for showing the module, which (CRL + 7) Stores the data into the address and increments it
mnemonics (e.g. MVI A, etc) on its screen. has a single-line, (CRL + 8)* Increments address only, does not store data
Such display modules are available for 16-character dis- (CRL + D) Starts to disassemble from the current address
about Rs 200. The total cost of compo- play, shows the *Note: CRL + 8 combination is used for disassembly and reading the
nents, including LCD modules, is not kit’s address, on-board EEROM which could be programmed on the kit.
likely to exceed Rs 1500.
Software exercises involving the TABLE II
8085’s arithmetic and logic instructions H. Addr. L. Addr. Data Mnemonics
can be executed and directly verified 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16
through the in-built 8-bit LED port pro- 1 0 0 0 3 E M V I A

ELECTRONICS PROJECTS Vol. 20 97


the EEPROM (address range 4000-7FFF).
A number of programs can be accommo-
dated in one such device and several stu-
dents can work together on the kit—each
with his own individual program.
The following key sequence is used
for feeding data or program into the
EEPROM:
50 00 xx Set the address at 50 high and 00
low xx indicates some random data
that might be present there.
50 00 3E To enter code 3E (MVI A), one en-
ters 3 and E .
50 00 3E Now (CRL + 7) keys are pressed. This
writes 3 E there.
50 01 xx Thereupon, after writing, the address
gets incremented by one and the data
(xx) appears.
In this manner one keeps entering
data, pressing CRL + 7 keys and continu-
ing till a program is fully fed into the
EEPROM. To verify the data programmed
into the EEPROM, one should not use
the CRL + 7 keys. Instead, use the CRL +
8 keys.
When a beginner (student) enters a
program (in a general kit), involving
jumps and return instructions, he usu-
ally makes mistakes which lead to cor-
rupt data being entered at certain loca-
tions; this causes frustration and loss of
time because the student has to re-key
the entire program. This is a common
hazard during microprocessor training
sessions. But, in this kit, which uses an
EEPROM, even if a student makes mis-
takes while entering, say, the jump and
return instructions, no such alteration of
entered data takes place because the
EEPROM retains the data which cannot
be altered during the execution of a pro-
gram.

Description
The complete circuit schematic is shown
in Fig. 1. As with every 8085 circuit, there
is an address latch 74LS373 (IC2). Using
Fig. 1: Schematic diagram of 8085 microprocessor kit

control signal ALE (address latch enable),


it segregates and latches the addresses
A0 through A7 at its output from the AD0
through AD7 lines from 8085. These ad-
dress lines (A0 through A7) are routed to
all the memory ICs. IC3 is used for stor-
ing the monitor program. For IC3 we may
either use a 2716 or a 2764 EPROM IC.
Either of these ICs can be fitted to the 28-
pin socket. The 2716 IC is inserted with
the right edge aligned to the IC socket.
This IC has to be programmed with the
hex data given in Appendix ‘A’ using an
external EPROM programmer. There is a
provision for using either a 6116 RAM or

98 ELECTRONICS PROJECTS Vol. 20


Fig. 2: Actual-size component-side track layout for the circuit of Fig. 1 Fig. 3: Actual-size solder-side track layout for the circuit of Fig. 1

a 6264 RAM in the socket for IC4. placeable part for the kit and each stu- under:
IC5 is the socket in which one can fix dent can have one for his programs, which 0000 - 1FFF Monitor EPROM space (If a 2716
an EEPROM, usually EEPROM 2864, he or she fits into the IC5 socket and is used, it would use 0000-07FF
only)
which is a 5V programmable device. This starts working. Address decoder IC6 2000 - 3FFF RAM address space (If a 6116 is
costs just around Rs 150. This is a re- (74LS139) decodes the address groups as used, it would use 2000-27FF only)

ELECTRONICS PROJECTS Vol. 20 99


PARTS LIST 16 key switches. For
Semiconductors: a detailed descrip-
IC1 - 8085 microprocessor tion of this circuit,
IC2 - 74LS373 octal transparent D refer to a book called
latches ‘Learn to Use Micro-
IC3 - 2716/2764 2K/8k-byte
processors’ pub-
EPROM
IC4 - 6116/6264 2K/8k-byte SRAM lished by EFY.
IC5 - 2864 8k-byte EEPROM The keyboard
IC6 - 74LS139 dual 2-line to 4-line data is read from
decoders the input port com-
IC7, IC13,
IC18 - 74LS00 quad NAND gates prising IC14
IC8 - 74LS02 quad NOR gates (74LS244). The data
IC9, IC10 - 74LS75 4-bit bi-stable latches includes the ‘key-
IC11, IC12 - 74148 8-line to 3-line priority pressed’ information
encoder
(on D7 bit) along
IC14 - 74LS244 octal buffers/drivers
IC15 - 5369 clock generator with the keycode
IC16 - CD4518 dual BCD counter (D0-D3) and control
IC17 - 7490 decade counter key information
IC19 - 74LS374 octal D flip-flops (D6). The keyboard
D1, D2 - 1N4148 switching diode
D3-D10 - LED 4mm, red comprises 16 hexa-
decimal keys (0 to 9
Resistors (all ¼-watt, ± 5% carbon, unless and A to F) and also
stated otherwise): a separate control
R1-R5, key. A Reset key,
R7, R9 - 1-kilo-ohm
R6, R8 - 1.2-kilo-ohm
which is connected
R10-R17 - 220-ohm to the reset pin 36
VR1 - 10-kilo-ohm pot., linear of IC 8085, is also
fixed on this key-
Capacitors:
board.
C1-C3, C5 - 22pF ceramic disc.
C4 - 10µF, 10V electrolytic An optional
C6 - 0.1µF ceramic disc timer circuit is in-
cluded in the kit.
Miscellaneous: This is meant for ex-
Xtal-1 - Crystal 4 MHz
Xtal-2 - Crystal 3.579 MHz ercises based on ac-
- key-switches, tactile type curate timings (one
(N/O)- 18 or ten seconds), such
- LCD display module, 16-char. as generation of in-
X 1-line
- IC bases
terrupts on the kit
- bergstrip at precise timing in-
- Jumpers for bergstrip tervals. With inter-
rupt-based program-
4000 - 5FFF Additional RAM or EEPROM ad-
ming, one can run
dress space another program in
The LCD module is wired, not as a the background.
memory, but as an input-output device. (Multi-tasking exer-
Its port address is C0H. ICs 7 and 8 cise).
(74LS00 and 74LS02 respectively) are em- IC15 (5369) pro-
ployed to select this address in combina- vides a 60Hz output
tion with the I/O/M signal from 8085. The square wave from a
second half of the decoder IC6 is meant 3.579 MHz crystal
for providing select output signals for the and the CD4518
input-output devices. These are as under: (IC16) divides it by
Keyboard input address 02 hex 60 (note the diode
8-bit LED address 04 hex feedback) to give
The 8-LED port is energised using the 1Hz output. Further Fig. 4: Component layout for the PCB.
latched outputs of ICs 9 and 10 (74LS75) division by 10 using
via current-limiting series resistors of 220 a 7490 IC enables interrupt at 10-second terrupt RST 7.5. Of course, for using this
ohms each. intervals. The output going to the pin 7 of timed interrupt, the instructor is required
A simple circuit, using a pair of 74148 8085 is differentiated by capacitor C6 and to teach the students how to enable the
ICs (ICs 11 and 12), and IC 13 (74LS 00), resistor R8 combination to produce a wave- RST 7.5 interrupt and write an interrupt-
provides the keyboard encoding circuit for form with sharp edges which causes in- driven program.

100 ELECTRONICS PROJECTS Vol. 20


A program for a sixteen character message display is given below:

Addr. Code Label Mnemonics Comments


2000 3E 38 MVI A 38 ; 38 is LCD module function set command
2002 CD 50 20 CALL COMMAND
3E 0E MVI A 0E ; Turns display on, cursor on
; Replace 0E with 0F for blinking cursor
; or 0C for no cursor
2007 CD 50 20 CALL COMMAND
200A 3E 06 MVI A 06 ; Shift cursor right
200C CD 50 00 CALL COMMAND
200F 3E 80 MVI A 80 ; Address at left end (C0 is for IInd half)
2011 CD 50 20 CALL COMMAND
2014 3E 01 MVI A 01 ; 01 is for clearing display
2016 CD 50 20 CALL COMMAND
2019 C3 20 20 JMP A

2020 3E 80 A: MVIA 80 ; to set to 0 address on LCD


2022 D3 C0 OUT C0 ; Write to LCD command register
2024 0E 02 MVI C 02 ; for 2 lines each of 8 characters
2026 11 00 21 LXI D 21 00 ; point to message table at 2100
2029 06 10 C: MVI B 10H ; for 16 characters
202B 1A B: LDAX D ; Get first ASCII code from address
202C 13 INX D ; point to next character in RAM
202D 05 DCR B ; All 8 characters over?
202E CD 80 00 CALL WRITE ; Writing data into register
2031 C2 2B xx JNZ B
2034 CD BF 00 CALL delay 10ms
2037 76 HLT
ORG 2050H
2050 COMMAND:
2050 D3 C0 OUT C0
2052 CD BF 00 CALL delay 10ms : refer subroutine address given ab
2055 C9 RET

2080 WRITE DATA (DD RAM FILL)


2080 F5 WRITE: PUSH PSW
2081 DB C0 P: IN C0 ; read status register of LCD
2083 E6 80 ANI 80 ; check bit D7
2085 C2 ,, ,, JNZ P ; wait otherwise
2088 F1 POP PSW
2089 D3 C1 OUT C1 ; write to DD RAM
208B C9 RET

Now (45 4C 45 43 54 52 4F 4E 49 43 53) enter at 2100 onwards: The ascii codes for ‘Electronics.’ This will get displayed on the LCD
module’s display.

Appendix ‘A’
Hex Dump of 8085 Monitor Program for the Kit
Addr. 0 1 2 3 4 5 6 7 8 9 A B C D E F
0000 C3 00 01 FF FF FF CD 50 01 C3 0A 01 FF FF FF FF
0010 4E C3 50 00 CD BF 00 D3 C1 CD BF 00 C3 06 00 FF
0020 FF FF FF FF FF FF FF FF FF FF FF
0030 FF FF FF FF FF FF FF FF FF FF FF
0040 CD 50 00 CD 50 01 C9 FF D3 C0 CD BF 00 C9 FF FF
0050 F5 3E 38 CD 48 00 3E 0E CD 48 00 3E 06 CD 48 00
0060 3E 80 CD 48 00 3E 01 CD 48 00 3E 80 D3 C0 7C E6
0070 F0 0F 0F 0F 0F CD D0 00 CD F0 00 7C E6 0F CD D0
0080 00 CD F0 00 3E 20 CD F0 00 7D E6 F0 0F 0F 0F 0F
0090 CD D0 00 CD F0 00 7D E6 0F CD D0 00 CD F0 00 3E
00A0 20 CD F0 00 79 E6 F0 0F 0F 0F 0F CD D0 00 CD F0
00B0 00 79 E6 0F CD D0 00 CD F0 00 F1 C9 FF FF FF F5
00C0 D5 11 30 09 1B 7A B3 C2 C4 00 D1 F1 C9 FF FF FF
00D0 FE 0A D2 D8 00 F6 30 C9 F6 40 D6 09 C9 3E C1 D3
00E0 C0 06 06 1A 13 CD F0 00 CD BF 00 05 C2 E3 00 C9
00F0 F5 DB C0 E6 80 C2 F1 00 F1 E6 7F D3 C1 C9 FF FF
0100 31 FF 27 21 00 20 4E CD 40 00 FE 40 D2 1C 01 47
0110 79 17 17 17 17 E6 F0 B0 4F C3 07 01 FE 42 C2 25
0120 01 69 C3 06 01 FE 41 C2 2E 01 61 C3 06 01 FE 44
0130 C2 37 01 2B C3 06 01 FE 47 C2 41 01 71 23 C3 06
0140 01 FE 43 C2 70 01 3E C1 D3 C0 3E 47 CD F0 00 E9
0150 DB 02 B7 FA 50 01 CD BF 00 DB 02 B7 00 00 00 F2
0160 59 01 CD BF 00 DB 02 B7 F2 59 01 EE C0 E6 4F C9

ELECTRONICS PROJECTS Vol. 20 101


Addr. 0 1 2 3 4 5 6 7 8 9 A B C D E F
0170 FE 48 CA AA 01 FE 4D C2 06 01 3E 00 32 FF 27 4E
0180 CD E9 01 1A B7 FA 8E 01 CD DD 00 C3 06 00 3A FF
0190 27 3C 32 FF 27 13 1A B7 FA 9F 01 1B C3 88 01 3A
01A0 FF 27 3C 32 FF 27 1B C3 88 01 00 C3 00 17 C2 B9
01B0 01 23 4E CD 00 C3 7F 01 3D 32 FF 27 23 4E CD 50
01C0 00 79 E6 F0 0F 0F 0F 0F CD D0 00 F5 3E C2 D3 C0
01D0 F1 CD BF 00 D3 C1 CD BF 00 79 E6 0F CD D0 00 F5
01E0 3E C3 D3 C0 F1 C3 14 00 FF FF C5 06 00 EB 21 00
01F0 00 09 09 E5 29 C1 09 01 00 02 09 EB C1 C9 FF FF

0200 4E 4F 50 20 20 20 CC D8 49 20 42 20 53 54 41 58
0210 20 42 49 4E 58 20 42 20 49 4E 52 20 42 20 44 43
021A 52 20 42 20 CD 56 49 20 42 20 52 4C 43 20 20 20
0230 20 45 52 52 20 20 44 41 44 20 42 20 4C 44 41 58
0240 20 42 44 43 58 20 42 20 49 4E 52 20 43 20 44 43
0250 52 20 43 20 CD 56 49 20 43 20 52 52 43 20 20 20
0260 FF 45 52 52 20 20 CC D8 49 20 44 20 53 54 41 58
0270 20 44 49 4E 58 20 44 20 49 4E 52 20 44 20 44 43
0280 52 20 44 20 CD 56 49 20 44 20 52 41 4C 20 20 20
0290 20 45 52 52 20 20 44 41 44 20 42 20 4C 44 41 58
02A0 20 44 44 43 58 20 44 20 49 4E 52 20 45 20 44 43
02B0 52 20 45 20 CD 56 49 20 45 20 52 41 52 20 20 20
02C0 52 49 4D 20 20 20 CC D8 49 20 48 20 D3 C8 4C 44
02D0 20 20 49 4E 58 20 48 20 49 4E 52 20 48 20 44 43
02E0 52 20 48 20 CD 56 49 20 48 20 44 41 41 20 20 20
02F0 20 20 20 20 20 20 44 41 44 20 48 20 CC C8 4C 44

0300 20 20 44 43 58 20 48 20 49 4E 52 20 4C 20 44 43
0310 52 20 4C 20 CD 56 49 20 4C 20 43 4D 41 20 20 20
0320 53 49 4D 20 20 20 CC D8 49 20 53 50 D3 D4 41 20
0330 20 20 49 4E 58 20 53 50 49 4E 52 20 4D 20 44 43
0340 52 20 4D 20 CD 56 49 20 4D 20 53 54 43 20 20 20
0350 20 20 20 20 20 20 44 41 44 20 53 50 CC C4 41 20
0360 20 20 44 43 58 20 53 50 49 4E 52 20 41 20 44 43
0370 52 20 41 20 CD 56 49 20 41 20 43 4D 43 20 20 20
0380 4D 4F 56 20 42 42 4D 4F 56 20 42 43 4D 4F 56 20
0390 42 44 4D 4F 56 20 42 45 4D 4F 56 20 42 48 4D 4F
03A0 56 20 42 4C 4D 4F 56 20 42 4D 4D 4F 56 20 42 41
03B0 4D 4F 56 20 43 42 4D 4F 56 20 43 43 4D 4F 56 20
03C0 43 44 4D 4F 56 20 43 45 4D 4F 56 20 43 48 4D 4F
03D0 56 20 43 4C 4D 4F 56 20 43 4D 4D 4F 56 20 43 41
03E0 4D 4F 56 20 44 42 4D 4F 56 20 44 43 4D 4F 56 20
03F0 44 44 4D 4F 56 20 44 45 4D 4F 56 20 44 48 4D 4F

0400 56 20 44 4C 4D 4F 56 20 44 4D 4D 4F 56 20 44 41
0410 4D 4F 56 20 45 42 4D 4F 56 20 45 43 4D 4F 56 20
0420 45 44 4D 4F 56 20 45 45 4D 4F 56 20 45 48 4D 4F
0430 56 20 45 4C 4D 4F 56 20 45 4D 4D 4F 56 20 45 41
0440 4D 4F 56 20 48 42 4D 4F 56 20 48 43 4D 4F 56 20
0450 48 44 4D 4F 56 20 48 45 4D 4F 56 20 48 48 4D 4F
0460 56 20 48 4C 4D 4F 56 20 48 4D 4D 4F 56 20 48 41
0470 4D 4F 56 20 4C 42 4D 4F 56 20 4C 43 4D 4F 56 20
0480 4C 44 4D 4F 56 20 4C 45 4D 4F 56 20 4C 48 4D 4F
0490 56 20 4C 4C 4D 4F 56 20 4C 4D 4D 4F 56 20 4C 41
04A0 4D 4F 56 20 4D 42 4D 4F 56 20 4D 43 4D 4F 56 20
04B0 4D 44 4D 4F 56 20 4D 45 4D 4F 56 20 4D 48 4D 4F
04C0 56 20 4D 4C 48 4C 54 20 20 20 4D 4F 56 20 4D 41
04D0 4D 4F 56 20 41 42 4D 4F 56 20 41 43 4D 4F 56 20
04E0 41 44 4D 4F 56 20 41 45 4D 4F 56 20 41 48 4D 4F
04F0 56 20 41 4C 4D 4F 56 20 41 4D 4D 4F 56 20 41 41

0500 41 44 44 20 42 20 41 44 44 20 43 20 41 44 44 20
0510 44 20 41 44 44 20 45 20 41 44 44 20 48 20 41 44
0520 44 20 4C 20 41 44 44 20 4D 20 41 44 44 20 41 20
0530 41 44 43 20 42 20 41 44 43 20 43 20 41 44 43 20
0540 44 20 41 44 43 20 45 20 41 44 43 20 48 20 41 44
0550 43 20 4C 20 41 44 43 20 4D 20 41 44 43 20 41 20
0560 53 55 42 20 42 20 53 55 42 20 43 20 53 55 42 20
0570 44 20 53 55 42 20 45 20 53 55 42 20 48 20 53 55
0580 42 20 4C 20 53 55 42 20 4D 20 53 55 42 20 41 20
0590 53 42 42 20 42 20 53 42 42 20 43 20 53 42 42 20
05A0 44 20 53 42 42 20 45 20 53 42 42 20 48 20 53 42
05B0 42 20 4C 20 53 42 42 20 4D 20 53 42 42 20 41 20
05C0 41 4E 41 20 42 20 41 4E 41 20 43 20 41 4E 41 20
05D0 44 20 41 4E 41 20 45 20 41 4E 41 20 48 20 41 4E
05E0 41 20 4C 20 41 4E 41 20 4D 20 41 4E 41 20 41 20
05F0 58 52 41 20 42 20 58 52 41 20 43 20 58 52 41 20

102 ELECTRONICS PROJECTS Vol. 20


0600 44 20 58 52 41 20 45 20 58 52 41 20 48 20 58 52
0610 41 20 4C 20 58 52 41 20 4D 20 58 52 41 20 41 20
0620 4F 52 41 20 42 20 4F 52 41 20 43 20 4F 52 41 20
0630 44 20 4F 52 41 20 45 20 4F 52 41 20 48 20 4F 52
0640 41 20 4C 20 4F 52 41 20 4D 20 4F 52 41 20 41 20
0650 43 4D 50 20 42 20 43 4D 50 20 43 20 43 4D 50 20
0660 44 20 43 4D 50 20 45 20 43 4D 50 20 48 20 43 4D
0670 50 20 4C 20 43 4D 50 20 4D 20 43 4D 50 20 41 20
0680 52 4E 5A 20 20 20 50 4F 50 20 42 20 CA DE 5A 20
0690 20 20 CA CD 50 20 20 20 C3 CE 5A 20 20 20 50 55
06A0 53 48 20 42 C1 44 49 20 20 20 52 53 54 20 30 20
06B0 52 5A 20 20 20 20 52 45 54 20 20 20 CA DA 20 20
06C0 20 20 20 20 20 20 20 20 C3 DA 20 20 20 20 C3 C1

proper accommodation of the complete cir-


cuit, including the LCD display module on
a single board. The actual-size component-
side and solder-side track lay-outs for the
circuit of Fig. 1 are given in Figs 2 and 3
respectively. The component lay-out for
the PCB is given in Fig. 4.

Using the Disassembler


The kit’s monitor program includes the
Fig. 5: LCD display showing symbols/graphics 8085 disassembler. This enables one to
check programs with the mnemonics. The
IC18 (74LS00) is used for decoding student first enters the code of his pro-
port address 80H. This additional address gram, as usual, by entering them one af- Fig. 6: A prototype kit developed by authors
can be used for external add-on boards, ter another into the memory area. For
such as the 8255 board, etc, which the instance, if he writes his program at ad- should ask the student to enter 00 (the
instructor could use suitably for training. dress 5000 onwards (into the EEROM for NOP or no-operation instruction) at ad-
Alternatively, there is an additional 8-bit adding two bytes (47 and 28 for instance) dress 5004 and re-execute the program.
latch provided on the kit, using a 74LS374 as under: The display on the 8-LED panel would
(IC19) which can give eight latched out- 50 00 3E show:
puts. These can be wired to LEDs or other 50 01 47 0 1 1 0 1 1 1 1 ... i.e. 6F
controls, using external hardware, such 50 02 C6 He could then proceed to explain the
as stepper motor, etc for exercise pur- 50 03 28 use and working of DAA instruction, etc.
poses. This IC 19 need not be fitted if an 50 04 27
external 8255 add-on board is used. 50 05 D3
The LCD module is fitted on a single- 50 06 04
Conclusion
line IC strip base having 16 pins (to ca- 50 07 76 A kit with the abovementioned features
ter for 14 as well as 15/16-pin modules). After the entry is over, the address is has been found to be very useful for fresh
The LCD module has edge fingers with set back at 5000, and then CRL +D keys students to learn about microprocessors.
2.54mm pitch as applicable for DIP ICs. are pressed. The use of LCD display has its advan-
One has to solder berg-pins into the holes The display then shows: tages as one could show some simple elec-
on the edge fingers and thereby make 50 00 3E MVI A trical symbols and graphics, including
the LCD module fit snugly onto the Then CRL + 8 keys are repeatedly waveforms, on its display (refer Fig. 5).
single-line IC strip holder provided on the pressed to see the disassembled listing as The following addresses in the firmware
PCB. under: EPROM contain several LCD module-
The LCD module connections are 50 00 3E MVI A ; Move into accumulator the based routines which an instructor or a
shown in the circuit diagram. There is a 50 01 47 47 ; value 47 programmer may make use of. By suit-
50 02 C6 ADI ; Add with immediately
contrast control which is connected to the ; following value of ably calling these routines, useful pro-
pin 3 of the module. A 10k potentiometer 50 03 28 28 ; 28 grams can be prepared.
on board is used for adjusting the con- 50 04 27 DAA ; Decimal adjust accumulator Sub-routine Start address
trast. Pins 1 and 2 of the LCD module are 50 05 D3 OUT ; Output to
50 06 04 4 ; port address 4 for the 8 Time-delay for 10 ms 00 BF
for +5V and ground respectively. For more single LEDs on kit Initialisation of the LCD 00 40
details of the LCD module, readers may 50 07 76 HLT ; Halt program. Keyboard input routine 01 50
refer to the LCD module description in Upon execution of the program, it Write to display and shift (H,L,C) 00 50
the author’s article ‘8098 Development is verified on LEDs panel (in BCD Write LCD command register 00 48
Board’ published elsewhere in this vol- format) as: Writing to DD RAM of LCD 00 F0
ume. 0 1 1 1 0 1 0 1 .... i.e. 75 Long-delay routine 00 E8
A double-sided PCB is required for In the above program, the instructor ❑

ELECTRONICS PROJECTS Vol. 20 103


Readers Comments: be loaded? Programmer article in Sept ’99 issue,
❑ I request the author to reply to the 9. Can we display time in this kit by where such a provision is made to extend
following queries: using external hardware (IC 5387) or the memory cycle to a longer time needed
1. How to write an interrupt driven through a software program? for programming an EPROM. For usage
program while running another program D. Selvaraj of interrupt pins, you may again refer the
in the background? Chennai LUM book.
2. How to display formulae, wave- The author K. Padmanabhan replies: 4. Connector types are immaterial—
forms, and electric symbols on the LCD 1. This is described at pages 49-50 the connection has to be makde, that is
display? pages ‘Learning to Use Microprocessor’ all. For normal use of the kit, these exter-
3. For what purpose are SIP1, SIP2, (LUM) book published by EFY. You can nal pins are not connected to anything at
SIP3, and SIGS connectors provided? How write a main program. For example, all. Simple switches, a slow-going 555
can they be interfaced with external hard- a running display and the interrupt serv- timer working on 5V supply and an LED
ware? ice program can be doing event-counting with series resistor of 220-ohm are all
4. In our lab. we have a kit with a 26- by looking at the signals on the interrupt that may be required to demonstrate the
pin FRC connector. How can these con- pin. functions of SID, interrupt pins, etc by a
nectors (SIP1…SIP3), having 8-pins (8 I/O 2. The LCD display module has teacher.
lines), be interfaced with hardware in the facility to display some graphic 5. The port address of 74LS374 is 80H.
our lab? characters which can be user-defined. You may connect an external 8255 board,
5. What is the port address of IC19 These are well described in the LCD mod- such as the one given in Chapter VI of
(74LS374), and what will be the port ad- ule's datasheets (available through manu- the LUM Book, using the same address
dress if we use an external add-on board facturers). Since this article was meant 80H line (connected to pin 11 of 74LS374)
having an 8255 PPI, and where is this for teachers, we did not give as chip select input for the 8255.
board to be connected? everything very elaborately, and just 6. Please refer Chapter VI of LUM
6. How to add an 8255 in this kit for hinted on the possiblities, giving some book.
parallel interfacing, and how can this kit examples. 7. Missing data is FF only.
be used in serial I/O mode? 3. The various signals pins from the 8. The collection of codes in sequence
7. In hex dump (Appendix ‘A’), 8085 for external use are: is tested program is the hex dump. Any
row 0020 and 0030 have some data SIG1 - SOD - Serial output data program which you may find useful for
missing. Please check and confirm their SIG2 - SID - Serial input data teaching, say an 8-bit×8-bit multiplica-
integrity. SIG3 - READY - Ready input tion, a 16-bit by 8-bit division, etc, can be
8. In which format do we have to SIG4 - SIG7 - The four interrupt inputs loaded.
write hex dump? You have mentioned Regarding usage of SIG and SOD, you 9. Please see Appendix ‘A’ in LUM
that plenty of space is available to may refer LUM Book pages 44-45. The book and alter the display routine for LCD
load teaching programs if we use 2764 ready pin can be used when we want to display as suggested in the article.
EEPROM. What type of programs can ‘hold’ the processor. Please read the Z-80 ❑

104 ELECTRONICS PROJECTS Vol. 20


MULTICHANNEL
CODE LOCK SYSTEM
VIJAY D. SATHE

T
he circuit presented here is a code- the pairs, formed by IC2 plus IC5, IC3 PARTS LIST
based electronic locking system to plus IC6, and IC4 plus IC7, is routed via Semiconductors:
control the operation of several ap- push-to-on switches S1, S2, and S3 IC1, IC10 - NE555 timer
pliances. respectively. The three sets (each IC2-IC4 - CD4033 decade counter, 7-
segment decoder and
The circuit uses a three-digit decimal comprising a CD4033, a CD4017, and a 7- driver
coding system for operating any appliance. digit display) function independently with IC5-IC7 - CD4017 decade ring
Thus, for each appliance a unique three- the reset pin 15 of all CD4017 and CD4033 counter
digit code, from numbers 101 to 999, is ICs tied together. On reset, only the Y0 IC8 - CD4073 triple 3-input
AND gate
selected. outputs of the ring counter ICs (CD4017) IC9 - ULN2003 high-current
Although this circuit can be used to are high, while all other outputs (Y1 Darlington driver
control as many as 999 appliances, for the through Y9) are low. At this instant, the IC11 - UM66 musical tone
generator
sake of simplicity, the operation of just output of all CD4033 counters would also T1 - BC548 npn transistor
three appliances is being shown here. Ad- correspond to zero count and thus the D1-D5 - IN4007 rectifier diode
ditional appliances, if required, can be display would show 000. D6 - 3.1V zener diode
wired via the 10-pin connectors provided When the first clock pulse is applied to LED1-LED3 - Green LEDs
DIS.1-DIS.3 - LT543, 7-segment
in the circuit. For the operation of each any of the CD4017-CD4033 pairs, the high common cathode display
appliance, a manually-operated appliance- output of CD4017 shifts from Y0 to Y1. At
Resistors (all ¼ W, ± 5% carbon, unless
specific toggle switch is turned on prior to the same time the count on its paired stated otherwise):
the selection of the appliance code. CD4033 advances from zero to one and R1-R2 - 22-kilo-ohm
The code selection is done through the corresponding seven-segment also R3-R23,
R26-R28 - 1-kilo-ohm
three push-to-on switches, with each one displays 1. For the second clock pulse, the R24 - 100-kilo-ohm
associated with a specific digit. The se- high level shifts to Y2 output, the count on R25 - 100-ohm
lected number is displayed on three 7- the paired CD4033 increments by one Capacitors:
segment displays for a short duration. On count, and the corresponding display shows C1 - 0.1µF, 10V polyster
selection of any appliance, the counters 2. The count can be incremented by a C1 - 33µF, 25V electrolytic
and the displays are automatically reset. maximum of nine clock cycles when Y9 C2, C4, C5 - 0.01µF ceramic disc
C3 - 47µF, 25V electrolytic
However, the selected appliance stays on output goes high and the corresponding
Miscellaneous:
due to latching action of the relay, through display also shows 9. On the next clock Xtal - 3.579545 MHz crystal
a pair of its own contacts. A fresh selec- (tenth), the Y0 output again goes high and S1-S3 - Push-to-on switch
tion is accompanied by a short-duration the display also shows 0. Thereafter, the S4 - SPDT changeover switch
musical note. Arrangement for manual cycle repeats itself. S5-S7 - Simple on/off switch
RL1-RL3 - 6V, 100-ohm DPDT relay
resetting of the counters and displays is The outputs of ICs CD4017 (IC5 RL4 - 6V, 100-ohm SPDT relay
also included. through IC7) are connected to the inputs - Bergstrip male/female
of three 3-input AND gates N1, N2, and connectors
N3 inside IC8 (CD4073). Depending upon
The circuit the desired code for any given appliance’s connected for control of appliance number
The circuit consists of a 555 timer (IC1) operation, one can make corresponding 1 through high-current Darlington array
which is wired as an astable multivibrator connections from the outputs of CD4017 IC ULN2003 (input pin 2 and output pin
with 50 per cent duty cycle and a clock- ICs to the AND gate used for controlling 15) to DPDT relay RL1. When relay RL1
period of one second. The output of IC1 is the operation of the specific appliance. For energises, assuming switch S5 is in on po-
used as clock for CD4033 decade counter example, if you want code for appliance 1 sition, the relay gets latched as it receives
cum display driver ICs (IC2 through IC4) to be 794, then connect output Y7 of IC5, the positive supply via the switch and
and CD4017 Johnson ring counter ICs Y9 of IC6 and Y4 of IC7 to the inputs of ground via one of its N/O contacts. Thus,
(IC5 through IC7). In fact, the clock to AND gate N1. The output of gate N1 is once an appliance is operated after its cor-

ELECTRONICS PROJECTS Vol. 20 105


responding switch and code
have been correctly selected, it
can be switched off manually
by flipping its corresponding
switch (S5, S6, or S7) to off
position.
Similarly, for control of
other appliances, outputs of
AND gates N2 and N3 are con-
nected to input pins 3 and 4 of
relay driver IC ULN2003, and
its output pins 14 and 13 are
connected to relays RL2 and
RL3 respectively. External
free-wheeling diodes are not
required across relay coils be-
cause they are built within the
ULN2003 IC itself.
The circuit incorporates
automatic reset arrangement.
The outputs of all AND gates
are connected in a wired-OR
fashion to pin 1 of ULN2003
IC by making use of diodes
D2 through D4. Thus, when
the output of any AND gate
goes high, pin number 1 of IC9
also goes high. This causes its
pin 16 to go low and energise
RL4, which, in turn, causes
the positive supply rail to be
extended to the common reset
line of all counter ICs (IC2
through IC7). Once the
counters get reset, the AND
gates’ output drops low and
RL4 is de-energised. Simulta-
neously, the display also
returns to show 000, since the
counters have been reset. Re-
setting of the counters and dis-
play does not, however, affect
Fig. 1: Schematic circuit diagram of a multichannel code lock system

the operation of any appliance


because of the latching action
of the relay, as explained
above.
Also, when the circuit is
reset automatically, as ex-
plained above, it produces a
musical tone for about five sec-
onds to indicate that some ap-
pliance has been switched on.
As mentioned earlier, pin 16 of
ULN2003 goes low momentar-
ily to automatically reset the
counters through operation of
relay RL4. The high-to-low-go-
ing transition at pin 16 of
ULN2003 is also passed to trig-
ger pin 2 of timer IC NE555
(IC10) which is configured here

106 ELECTRONICS PROJECTS Vol. 20


set a logic high level is applied to the pin
15 of all counter and counter/seven-seg-
ment driver ICs. In normal case these
reset pins are at a logic-low state.
The circuit shows the connection of
three appliances having codes 794, 969,
and 337 respectively. To operate the first
appliance, reset the counters by pressing
switch S4 momentarily. Flip switch S5 to
on position. Now press switch S1 so that
clock pulses are applied to IC2 and IC5
pair, and they start counting. Release
switch S1 as soon as DIS.1 displays digit
seven. Similarly, press switches S2 and
S3 for second and third digits of the code.
The other two devices can also be oper-
ated similarly.
For control of additional appliances,
just add additional AND gates, ULN2003
Darlington arrays, relays, and switches.
Do not forget to connect all AND gates’
Fig. 2: Actual-size, single-sided PCB layout for circuit of Fig. 1 outputs to pin 1 of IC9 via diodes for auto-
matic resetting operation. The inputs for
additional AND gates can be obtained from
the outputs of CD4017 ICs terminated on
connectors as shown in the schematic
diagram of Fig. 1. Since these CMOS
devices have a high fan-out capability
(about 50 devices), you can connect each
output to a large number of AND gates
without degrading their performance. Each
device is to be allocated a unique code
between 001 and 999 (decimal). If you
desire to expand the code, you may do so
by just adding the sets comprising ICs
CD4017, CD4033, and a seven-segment
display. The AND gates used should have
the same input (or greater) capacity as the
number of sets/digits.
The actual-size, single-sided PCB
layout for the schematic circuit of Fig. 1 is
given in Fig. 2. Please note that the PCB
does not contain IC8, IC9, and the
Fig. 3: Component layout for PCB of Fig. 2 connected relays/components. These can
be assembled on general-purpose PCBs as
as a five-second monostable flip-flop. The switches S1, S2, and S3. In case wrong per the number of appliances to be con-
output of IC10 is connected to musical code gets entered, you can re-enter the trolled by the user. The required points
tone generator IC UM66 (IC11), which correct code after resetting the circuit have been brought out on Bergstrip con-
generates a musical tone for the five-second manually, by pressing reset switch S4. nectors. The component layout for PCB is
duration of monostable pulse output. During manual resetting, the system will given in Fig. 3.
The code is entered using push-to-on not produce any musical note. During re- ❑

Readers Comments:
❑ The display runs continuously from 0 The author, Vijay D. Sathe, replies: cuit given in Fig. 1 for switching purposes.
to 9, without stopping. I have assembled Mr Patil should check the tracks of the To enter the code 794, switch S1 should
the circuit on a self-etched PCB. push-to-on switches S1, S2, and S3—they be pressed seven times, S2 nine times,
Rakesh P. Patil may be shorted. He may remove the 555 and S3 four times.
Thane circuit from the system and use the cir- ❑

ELECTRONICS PROJECTS Vol. 20 107


AUTOMATIC INDUCTION
MOTOR STARTER
WITH PROGRAMMABLE TIMER
ARTHUR LOUIS

I
nduction motors are popular due to would depend on contactor and motor cur- without protections offered by the circuit
their low-cost, sturdy construction, rent ratings. The three phases from the of Fig. 2, is possible. The C and D points
fast pick-up, low maintenance ex- DOL starter are extended to the auto- are shorted (via switch S1 in off position)
penditure and good efficiency. The DOL matic starter circuit of Fig. 2 via points whereas E and F points remain open. In
(direct-on-line) starters and star/delta marked R’, Y’, and B’. The other points this state, relay contacts have no effect
starters used for starting and running of which are to be extended to Fig. 2 are on the DOL starter operation. The motor
induction motors provide coarse type of marked C through F. All the points can be switched on by momentary
protections against voltage fluctuations marked identically in Figs 1 and 2 are to operation of start switch S6 (green button).
and single phasing. Induction motors are be connected together. Please note that red (R) phase is always
very sensitive to low voltage and single Functions of switches and relays. connected to one side of the EM (electro-
phasing during which they draw a heavy To understand the circuit operation, it is magnetic) coil of contactor. The blue (B)
current and can burn out unless switched essential to know the effect of switches phase gets extended to the other side of
off within few seconds of occurrence of S1 through S6 and contacts of relays RL1 contactor coil through switch S6 (in
such conditions. This makes the require- and RL2 in on and off conditions. These depressed state), normally made contacts
ment of a sensitive protective device ab- are discussed below. of stop switch S5 (red button) and shorted
solutely essential to avoid burning of in- When switches S1 and S2 are off, only C and D points (via switch S1 in off
duction motors under such conditions. manual operation of the DOL starter, position). Once the contactor coil is
The circuit of an automatic starter,
incorporating the important features given
below, is described here. It is meant to be
used in conjunction with a DOL starter.
1. Under-voltage and over-voltage
cutout.
2. Single phasing prevention.
3. Automatic start on resumption of
proper conditions.
4. 24-hour programmable off timer
(on completion of actual run-time of the
motor).
5. Specially suited for remote opera-
tion of induction motor.
6. Simple, easy to construct, and low-
cost.

The circuit
As the circuit being described is required
to be used with a DOL starter, the inter-
nal diagram of the same is given in Fig.
1. The three phases (R, Y, and B) enter-
ing the starter are passed via fuses F1,
F2, and F3. The current rating of the fuses Fig. 1: Internal wiring diagram of a typical DOL starter

108 ELECTRONICS PROJECTS Vol. 20


energised, it is latched via
its own contact marked ‘5’
and closed dry run points
D1 and D2 to provide alter-
nate path for B phase to the
contactor coil. All three
phases (R, Y, and B) are
extended to the induction
motor via the closed con-
tacts of the contactor, and
the motor runs.
When switch S1 is on
and switch S2 is off, the red
(R) phase connection to
transformer X1 is through,
while yellow (Y) phase is al-
ready connected to bottom
end of transformer X2. In
this state, sensing circuit
and B-Y phase detector cir-
cuits of Fig. 2 are effective.
If all phases are available
and voltages are within
proper limits, relay RL1 will
get energised (as explained
later in the text) to close
contacts C and D. However,
contacts E and F remain
open irrespective of the
state of relay RL2 (contacts
of relay RL2 come in paral-
lel with the contacts of start
switch, provided switch S2
is on). Thus in this condi-
tion, although safety cir-
cuits are functional, auto
starting is not feasible.
Manual start button S6 has
to be pressed for starting
the induction motor. This
mode of operation is termed
here as mode 1.
When switches S1 and
Fig. 2: Schematic diagram of automatic induction motor starter

S2 are both on, then the


sensing circuit (for under/
over voltages and single
phasing) as well as auto
start circuits are opera-
tional. The effect of switch
S1 and relay RL1 has al-
ready been explained above.
Relay RL2, which remains
on for a short while (as ex-
plained later in the text),
along with energisation of
relay RL1, acts in the same
way as momentary depres-
sion of start switch S6 to
provide auto start/ restart
facility when 3-phase
voltages are within limits.

ELECTRONICS PROJECTS Vol. 20 109


by capacitor C3 before regulation by 9-
volt regulator 7809 (IC1). The regulated
output of IC1 regulator is used for
powering the entire circuit. No heat sink
is required for regulator 7809.
Note: When two transformers (X1 and
X2) are used in this fashion, the AC out-
put voltage should be checked after con-
necting the secondaries of both transform-
ers in series. If no voltage is present across
anodes of diodes D1 and D2 then either
primary or secondary connections need
be reversed (but not both).
Under/over voltage cutout. This sec-
tion comprises an 8-pin dual comparator
LM393N (IC3) in DIL (dual-in-line) pack-
age. The output of the two comparators
(at pins 1 and 7) has been combined in a
wired-OR fashion . This output is high as
Fig. 3: Actual-size, single-sided PCB layout for the circuit long as sampled voltages being monitored
are within preset limits. When sampled
voltages are out of limits, the wired-OR
output goes low.
Here IC2(a) is used as over-voltage
detector, while IC2(b) is used as under-
voltage detector. The 4.2V developed
across zener D4 is used as reference volt-
age for both the comparators. The
potmeter VR1 is so adjusted that when
the phase-to-phase (R-Y) input voltage
across primary of transformer (X1 and X2
combined) is less than a specific desired
level (say 350V RMS), the voltage at its
wiper contact goes less than 4.2 volts.
Thus, the output of comparator IC2(b) and
also the wired-OR output goes low,
irrespective of output of comparator
IC2(a). Similarly, potmeter VR2 is so ad-
justed that when the voltage between R-
Y phases exceeds certain desired value
(say 480V AC RMS), the voltage at its
Fig. 4: Component layout for the PCB wiper contact goes higher than 4.2 volts,
and the output of comparator IC2(a) goes
This is termed here as mode 2 operation. (or all 3-phase voltages become alright) low. Thus, we observe that whenever the
Switch S3 is used for automatic until the programmed running period is R-Y phase-to-phase voltages are beyond
switching off of the induction motor after over. acceptable limits, the output of compara-
it has operated for a preprogrammed pe- Power supply. The power supply for tor goes low to switch off the motor after
riod selected with the help of rotary switch the schematic circuit of Fig. 2 is derived a delay of four seconds, as explained in
S4. During mode 1 (switch 1 on and switch from R and Y phases, using two mains the following section.
2 off) operation when switch 3 is on, the transformers with primary voltage rating On/off time delay. The popular
induction motor will be switched off when of 230V AC connected in series across it NE555 timer is so configured as to pro-
programmed on-time is completed or through DPDT slide switch S1. Their sec- vide an on-time delay of 12 seconds after
whenever power fails. However, after ondaries rated at 6V-0-6V AC, 200mA are all conditions are suitable (i.e. all 3 phases
power resumes (and if all phase voltages also connected in series to realise 12V-0- are present and the phase-to-phase
are within limits), the motor can be re- 12V output across rectifier diodes D1 and voltages are also within limits). If all con-
started with the help of start switch D2, connected as full-wave rectifiers. The ditions are alright (at the time of start—
manually, provided the programmed output of rectifier, after some smoothing with slide switch S1 in on position), ca-
period is not over. During mode 2 (both by capacitor C1, is used for the purpose of pacitor C4 will be charged via resistors
switches S1 and S2 on) operation if switch sampling of under/over voltage conditions. R2 and R4 which would take about 12
S3 is on, the motor will keep restarting The output across capacitor C1, after pass- seconds to make pin 2 of 555 high, so that
automatically whenever power resumes ing through diode D3, is further filtered its output (at pin 3) goes low to cut off

110 ELECTRONICS PROJECTS Vol. 20


PARTS LIST four seconds before it causes pin 2 of IC3 During normal conditions, the out-
Semiconductors: to go low or its output to go high, which put of timer NE555 will initially go high
IC1 - 7809 fixed regulator +9 volts in turn causes de-energisation of relay for 12 seconds on resumption of power
IC2 - LM393 voltage comparator
IC3 - NE555 timer
RL1 to eventually switch off the motor. or when normal state is reached. The
IC4 - CD4060 14-stage ripple This is the off-time delay which allows capacitor C6 will be charged through re-
counter/oscillator the motor not to switch off if the voltage sistor R11. However, the base of transis-
IC5 - MC2TE opto-coupler returns to normal state within this 4- tor T5 will be held to ground potential
T2,T3 - BC547 npn transistor
T4,T5,T6 - 2N2222 switching transistor second period. If the voltage does not re- by diode D6, which is forward biased due
D1-D3,D5-D10, turn to normal state within this period to the condition of transistor T3. As a
D12-D16 - 1N4007 rectifier diode then only the motor is switched off. This result, relay RL2 will be in off state due
D4 - 4.2V, 0.5W zener
D11 - 27V, 0.5W zener avoids unnecessary switching off of the to non-conduction of transistor T5. When
LED1-LED3 - Coloured LED motor during momentary voltage fluctua- NE555 IC changes its output state from
Resistors (all ¼ W, ± 5% carbon, unless tions. high to low after 12 seconds, diode D6
stated otherwise): Single-phase cutout. When a single will be reverse-biased due to the posi-
R1,R5,R8-R10,R12 phase failure occurs, the motor will con- tive voltage at anode of diode D6. Ca-
R15,R18,R21 - 1-kilo-ohm
R2,R22 - 22-kilo-ohm tinue to run on remaining two phases, pacitor C6 will get discharged via resis-
R3,R7,R19, drawing heavy load current. This would tor R11 and transistor T5 will come to
R20,R25 - 10-kilo-ohm result in overheating of windings and its conduction state due to the positive volt-
R4 - 47-kilo-ohm
R6 - 220-kilo-ohm eventual burning in a short time if it is not age at its base. As a result, relay RL2
R11,R14 - 4.7-kilo-ohm disconnected. The single-phase cutout cir- will get energised. The discharge
R15 - 470-kilo-ohm cuit employed here is very simple and it action of capacitor C6 continues for
R16,R17 - 47-kilo-ohm, 1W
has the capability to sense all three phases, about two seconds (which is sufficient to
R22 - 22-kilo-ohm
R23 - 1-mega-ohm including low voltage condition of phase bring the electromagnetic relay of DOL
R24 - 100-kilo-ohm B. Sensing of under-voltage and over-volt- starter to on position). Once the starter
R26 - 22-kilo-ohm, 1W age condition of R and Y phases is already EM relay energises, it is latched as ex-
VR1,VR2 - 4.7-kilo-ohm potmeter
taking place, as described earlier. plained under ‘Functions of relays and
Capacitors:
C1,C8 - 47µF, 25V electrolytic
Phase failure of R and/or Y phase(s) switches’ subheading. After two seconds,
C2 - 1000µF, 25V electrolytic results in no supply to the circuit and the base of transistor T5 will fall to
C3 - 470µF, 16V electrolytic relays RL1 and RL2 will be in de-ener- ground potential and relay RL2 will be
C4 - 100µF, 16V electrolytic gised state and the motor is, therefore, switched off. However, relay RL1 will
C5 - 0.01µF ceramic disc
C6 - 220µF, 16V electrolytic switched off. In Y-B single phase detector continue to be on and hold the motor in
C7 - 4.7µF, 63V electrolytic part of the circuit, the diode D12 in Y on state.
C9 - 0.1µF ceramic disc phase path rectifies the voltage before po- Timer. The timer is built around 14-
C10 - 4.7µF, 25V electrolytic
tential divider network, comprising resis- stage CMOS counter CD 4060 which has
Miscellaneous: tors R16 and R17, reduces the voltage an on-chip oscillator. The timing compo-
LED1 - Yellow LED
RL1,RL2 - 9V, 150-ohm, SPST relay with respect to phase B. Capacitor C7 nent, comprising resistor R24 and capaci-
S1,S2,S3 - Slide switches DPDT smooths the voltage across resistor R17. tor C8, is selected to get an approximate
X1,X2 - 250V primary to 6V-0-6V, If this voltage is greater than 27V, zener off-time delay of 20 minutes at Q7, 45
200 mA sec. transformer
- Battery PP9V
D11 as well as the diode inside opto-cou- minutes at Q8, 1.5 hours at Q9, 3 hours
S4 - Rotary switch single-pole pler IC4 will conduct. As a result, base of at Q10, 6 hours at Q11, 12 hours at Q12,
7-throws transistor T2 is pulled to ground and it is and 24 hours at Q13 output. The timer is
- DOL starter (refer Fig. 1 cut off. This causes the comparator output not affected by power cuts as it is pro-
for details)
- Bergstrip connectors-male/ to be applied to pin 2 of timer NE555 vided with a backup, using a 9V, PP3
female without any change (modification). But in battery. The timer function comes into
case the B-phase voltage is very low, or if play when switch S3 is flipped to on posi-
transistor T3. As a result, base of transis- it is missing altogether, transistor T2 will tion.
tor T4 gets forward biased via resistor R9 be biased to saturation condition, dis- When power fails, transistor T6 will
(and R13) to energise relay RL1 to short charging capacitor C4 via resistor R5. As cut off due to absence of any forward bias
points C and D (refer Figs 1 and 2) a result, pin 2 of timer 555 would go low voltage at its base. This forward biases
through its contacts, and energise immediately and eventually switches off diode D14, which makes pin 11 of the
contactor in the DOL starter of Fig. 1 via relay RL1 to cut off the contactor in DOL counter high and the counter suspends
the start switch (in pressed state) or due starter as well as the motor. further counting. When power resumes,
to energisation of relay RL2 for short Auto start unit. The necessity of auto the counter proceeds further and the time
duration with switch S2 on (explanation start unit has, of late, increased due to count is thus not lost. The same thing
covered under ‘Auto start unit’ sub- frequent power interruptions, including occurs when an unhealthy condition of
heading). Thus, motor starts after an on- single phasing. Many auto start units are line is detected. Pin 3 of timer 555 goes
time delay of 12 seconds. available in the market. The auto start high and diode D13 causes suspension of
When comparator IC2 senses under- circuit comprises the circuitry around counting. When the final count is reached,
voltage or over-voltage condition, its out- relays RL1 and RL2 (and their contacts), the corresponding output pin of IC5 goes
put goes low and capacitor C4 discharges slide switches S1 and S2, and the DOL high. The IC5 output is coupled to pin 11
via resistance R4. This will take about starter. via diode D12 to suspend the counting. At

ELECTRONICS PROJECTS Vol. 20 111


the same time this high output is also to off and then switch it on again. The component layout for the PCB is given
connected to the base of transistor T3, LED indicators. LED1, when on, in- in Fig. 4. All switches, relays, and trans-
which starts conducting and takes the dicates that switch S1 is on and R-Y phase formers are to be mounted externally. As
base of transistor T4 to cut-off. As a result supplies and 9V output from the regulator the B-Y phase detector circuit contains
relay RL1 de-energises to switch off the IC1 are available. LED2, when on, indi- high voltages, it is recommended to cut
motor. cates that relay RL1 has energised. LED3 out the phase detector part up to opto-
To set the counter timing, first is on when switch S3 is on and 9V supply coupler from the PCB and install the same
set the value of time by rotary switch S4 from IC1 for timer is available. externally. Only the output leads from
and then flip switch S3 on to start the An actual-size, single-sided PCB for the opto-coupler may be soldered on to
timer. To reset the timer push switch S3 the circuit of Fig. 2 is shown in Fig. 3. the points provided on the PCB. ❑

112 ELECTRONICS PROJECTS Vol. 20


SECTION B:
CIRCUIT IDEAS
TELEPHONE LINE VIGILANT
K. UDHAYA KUMARAN (VU3GTH)

H
ere is a telephone line vigilant
circuit to guard against misuse
of your telephone lines. It moni-
tors telephone lines round-the-clock and
provides visual as well as an audio warn-
ing (when someone is using your tel-
ephone lines) which can be heard any-
where in the house.
Another advantage of using this cir-
cuit is that one comes to know of the mis-
use and snapping of the lines (due to any
reason) instantaneously, on its occurance.
This enables the subscriber to take neces-
sary remedial measures in proper time.
Various telephone line conditions and
resulting audio-visual indications avail-
able from the circuit are summarised in
Table I.
Even when the subscriber himself is
using his telephone (handset off-cradle)
while the vigilant circuit is on, the buzzer
beeps once every 5 seconds since the vigi-
lant circuit cannot distinguish between
self-use of the subscriber lines or its mis-
use by any unauthorised person. Thus to
avoid unnecessary disturbance, it is ad-
visable to install the vigilant unit away
from the phone. However, if one wishes to
fit the unit near the telephone then switch
S1 may be flipped to ‘off’ position to switch
off the buzzer. But remember to flip the
switch to ‘on’ position while replacing the
handset on cradle.
Irrespective of telephone line polarity C1 is used to check telephone line condi- not affected.
at the input to the circuit, proper DC po- tion as per Table I. This circuit draws neg- The circuit may be divided into two
larity is maintained across C1 due to ligible current from telephone line; parts. The first part comprises zener D9,
bridge rectifier comprising diodes D1 to D4. thus when it is connected to the telephone transistors T1 to T4 and diode D5. It is
The DC voltage developed across capacitor line, the normal telephone operation is used to verify whether telephone line loop
is intact or discontinuous. The second part
TABLE I comprising zener D10 and transistors T5
S. No. Telephone line Green Red Line Audio indication to T10 is used to check whether telephone
condition LED LED Voltage line is in use (or misuse) or not.
1. Telephone line Not Lit Lit 0V Continuous sound The zener diode D9 (3.3V) conducts
disconnected when phone line loop is intact and not bro-
2. Phone line in Lit Lit 9V DC Beep, once every ken. On conduction Zener D9 provides for-
use (H/S off-cradle) (approx.) 5-seconds ward bias for transistors T1, T2 and T3 to
3. Phone line not in use Lit Not Lit 48V DC No sound conduct and reverse bias for T4 to cut off.
(H/S on-cradle) As a result, green LED lights but no sound

ELECTRONICS PROJECTS Vol. 20 115


is heard from the buzzer. results in conduction of transistors T5 and sistor T7 conducts. Now +9V is extended
When phone line loop is discontinu- T6 and cutting off of transistor T7 (as to multivibrator circuit. This mult-
ous, no voltage is available across capaci- collector of transistor T6 is near ground ivibrator is designed such that collector of
tor C1. Thus zener D9 and transistors potential). Thus positive 9V rail is not transistor T9 goes high once every 5 sec-
T1, T2 and T3 do not conduct while T4 extended to the following multivibrator onds to forward bias transistor T10 and it
conducts. Now green LED extinguishes circuit built around transistors T8 and conducts. Thus at every 5-second interval
and a continuous sound is heard from the T9. Consequently, the red LED is not lit a beep sound is heard from buzzer. The
buzzer. and buzzer does not sound. beep sound interval can be increased or de-
When telephone line is alright but is When phone line is in use, zener D10 creased by changing the value of capacitor
not in use, zener D10 conducts as voltage does not conduct. As a result, transistors C3 while the volume can be adjusted with
across capacitor C1 is quite high. This T5 and T6 also do not conduct, while tran- the help of preset VR3.

Readers Comments: increase the output. The base-emitter cir- replies:


‰ I have successfully constructed the cuit of the amplifier should replace the Please recheck your circuit connec-
circuit but output of the buzzer is very low. buzzer and the collector should be con- tions. Spurious buzzers produce less
As a result the buzzer cannot be heard in a nected to 9V DC supply through the buzzer. sound. Good-quality, continuous-tone
room where a television set is operating. Ajay K.S. buzzers with built-in oscillator produce
I would like the author to modify the Bhopal sufficient sound which overrides all sur-
circuit by using a transistor amplifier to The author K. Udhaya Kumaran rounding noise.

HIGH AND LOW VOLTAGE CUTOUT


WITH DELAY AND MELODY
ARTHUR LOUIS

V
oltage variations and power cuts high as well as low voltages and the volt- D4 is less then 5.6V. As a result transis-
adversely affect various equip age surges. It also gives a melodious tune tor T1 is in ‘off’ state. The DC voltage at
ment such as TVs, VCRs, music when mains power resumes after a break. the cathode of zener diode D5 is greater
systems and refrigerators. This simple cir- When mains voltage is normal, the than 5.6V and as a result transistor T2 is
cuit will protect the costly equipment from DC voltage at the cathode of zener diode in ‘on’ state. Consequently, relay RL1 gets

116 ELECTRONICS PROJECTS Vol. 20


energised, which is indicated by lighting width is about 10 seconds with the timing load is protected against the voltage
up of green LED. component values used in the circuit. surges.
Under high mains voltage condition, When the power resumes after a To adjust presets VR1 and VR2, you
transistor T1 switches to ‘on’ state be- break, pin 2 of IC 555 goes low briefly may use a manually variable auto-trans-
cause the voltage at cathode of zener di- and this triggers it. Its output makes former. Set the output of auto-transformer
ode D4 becomes greater than 5.6V. Con- music IC UM66 to operate through to 270V AC and connect it to the primary
sequently, transistor T2 switches to ‘off’ transistor T3. Simultaneously, transistor of transformer X1. Adjust preset VR1 such
state, making the relay to de-energise T1 also gets forward biased as that relay RL1 just de-energises. Next set
Under low mains voltage condition, the monostable IC1 output is connected the output of auto-transformer to 170V
transistor T1 switches to ‘off’ state and as to its base via diode D8 and resistor R7. AC. Now adjust preset VR2 such that re-
a result transistor T2 also switches to ‘off’ As a result, transistor T1 conducts lay RL1 again de-energises. Volume con-
state, making the relay to de-energise. and biases transistor T2 to cut off. Thus trol VR3 may be adjusted for the desired
Timer IC 555 in the circuit is configured relay RL1 remains de-energised output volume of the tune generated by
to operate in a monostable mode. The pulse for the duration of mono pulse and the IC UM66.

Readers Comments: respectively, the relay starts chatter-


I have assembled the circuit and ob- ing when the voltage reaches 260V.
served that even after setting the low and The same is true for the lower voltage
high voltage presets for 170V and 270V limit also. To overcome the problem I
have tried the circuit given in
Fig. 1 for upper limit and it
works satisfactorily. A similar
circuit can also be used for
lower cut-off limit. I would,
however, like the author to sug- Fig. 2: Modification of melody circuit suggested by the
gest suitable changes for proper author
operation of the original circuit. reaching the threshold level, please con-
Mukesh P. Tatiya nect a capacitor of 470µF, 16V in parallel
Ahmednagar with relay coil. I also suggest slight modi-
The author Arthur Louis fication of melody circuit after transistor
replies: T3, as shown in Fig. 2, for its proper op-
Fig. 1: Suggested circuit for hi/low cut off To avoid chattering of relay on eration.

RUNNING MESSAGE DISPLAY


V. KANNAN

L
ight emitting diodes are advanta- sequencing operations. In the circuit only first clock pulse, pin 3 goes low and pin 2
geous due to their smaller size, one of the outputs remains high and goes high. Transistor T6 conducts and
low current consumption and the other outputs switch to high state letter ‘E’ lights up. The preceding letter
catchy colours they emit. Here is a run- successively on the arrival of each ‘W’ also remains lighted because of for-
ning message display circuit wherein the clock pulse. ward biasing of transistor T7 via diode
letters formed by LED arrangement light The timer NE555 (IC1) is wired as a D21. In a similar fashion, on the arrival
up progressively. Once all the letters of 1Hz astable multivibrator which clocks of each successive pulse, the other letters
the message have been lit up, the circuit the IC2 for sequencing operations. On of the display are also illuminated and
gets reset. reset, output pin 3 goes high and drives finally the complete word becomes visible.
The circuit is built around Johnson transistor T7 to ‘on’ state. The output of On the following clock pulse, pin 6 goes to
decade counter CD4017BC (IC2). One of transistor T7 is connected to letter ‘W’ of logic 1 and resets the circuit, and the
the IC CD4017BE’s features is its provi- the LED word array (all LEDs of a letter sequence repeats itself. The frequency of
sion of ten fully decoded outputs, making array are connected in parallel) and thus sequencing operations is controlled with
the IC ideal for use in a whole range of letter ‘W’ is illuminated. On arrival of the help of potmeter VR1.

ELECTRONICS PROJECTS Vol. 20 117


The display can be fixed on a connected to emitters of transistors T1 to make an LED fashion jewellery of any
veroboard of suitable size and connected through T7 as shown in the circuit. design. With two circuits connected in a
to ground of a common supply (of 6V to The above circuit is very versatile and similar manner, multiplexing of LEDs can
9V) while the anodes of LEDs are to be can be wired with a large number of LEDs be done to give a moving display effect.

Readers Comments: The author, V. Kannan, replies: say that transistors T1 to T7 (2N3053)
❑ The circuit seems to have been made In reply to Pradeep’s letter, I would like have a maximum current-rating of 700mA,
unnecessarily complicated. All diodes can to say that the idea of using IC whereas transistor 2N3055 has a current-
be eliminated by using 8-bit register IC 7AHCT164 is good, but the actual circuit rating of 3A-5A, which is not necessary.
74HCT164 in place of decade counter IC was designed using two 4017 ICs to ob- If transistor 2N3053 is not available, tran-
4017. tain a miltiplexed display. Since the cir- sistor 2N3447 or any npn transistor of
Pradeep G. cuit became too complicated, it was re- 500mA to 700mA current-rating can be
Alappuzhu drawn for simplicity keeping the basic used.
❑ Since the transistors T1 to T7 (2N3053) idea unchanged—allowing room for Cascading of diodes, as mentioned by
are not readily available in the market, multiplexing operations. Louis Mandya, would have the following
can we use transistor 2N3055 instead? In reply to Sundaresh, I would like to effect: base-terminal voltage of each suc-
V. Sundaresh
Salem
❑ Although the above-mentioned circuit
is functioning well, it can be further sim-
plified by using lesser number of diodes as
shown in Fig. 1.
Louis Mandya
Mandya
❑ What is the maximum number of LEDs
that can be used per word?
Ajay Gupta
Pantnager
❑ Can we increase or decrease the number
of characters in the message?
Faisel K. Qazi
New Mumbai Fig. 1: Suggested circuit for moving message display

118 ELECTRONICS PROJECTS Vol. 20


In reply to Ajay Gupta and Faisel K.
Qazi I would like to say that the number
of LEDs that can be connected in parallel
depends upon the current rating of
the transistor. This may be calculated
as under:
Maximum Number of Parallel LEDs=Collector Current
Rating of Transistor ÷ Current drawn by One LED
Using a single IC, a maximum of ten
characters (and a minimum of one) can
be obtained. By cascading two 4017 ICs,
we can obtain up to 17 characters. (Note:
Outputs 0 and 10 are high even during
Fig. 2: Cascading of CD4017s reset and hence these may not be used.)
Tech Editor: The circuit diagram
ceeding transistor would be 0.65V less few transistors would not be sufficiently for cascading two CD4017 is shown in
than its predecessor. As a result, the last forward-baised to conduct properly. Fig. 2.

COLOUR
SENSOR
TONY GLADVIN GEORGE

C
olour sensor is an interesting
project for hobbyists. The circuit
can sense eight colours, i.e. blue, 13
green and red (primary colours); magenta,
yellow and cyan (secondary colours); and
black and white. The circuit is based on
the fundamentals of optics and digital
electronics.
The object whose colour is required to
be detected should be placed in front of
the system. The light rays reflected from
the object will fall on the three convex
lenses which are fixed in front of the three
LDRs. The convex lenses are used to con-
verge light rays. This helps to increase
the sensitivity of LDRs.
Blue, green and red glass plates
(filters) are fixed in front of LDR1, LDR2
and LDR3 respectively. When reflected
light rays from the object fall on the
gadget, the coloured filter glass plates
determine which of the LDRs would get
triggered. The circuit makes use of only
‘AND’ gates and ‘NOT’ gates.
When a primary coloured light ray
falls on the system, the glass plate cor-
responding to that primary colour will
allow that specific light to pass through.
But the other two glass plates will not

ELECTRONICS PROJECTS Vol. 20 119


allow any light to pass through. Thus and the gate output corresponding to these be connected to positive supply.
only one LDR will get triggered and the will become logic 1 and indicate which 3. Use good quality light filters.
gate output corresponding to that LDR colour it is. The LDR is mounded in a tube, be-
will become logic 1 to indicate which When all the LDRs get triggered or hind a lens, and aimed at the object. The
colour it is. remain untriggered, you will observe coloured glass filter should be fixed in
Similarly, when a secondary coloured white and black light indications respec- front of the LDR as shown in the
light ray falls on the system, the two pri- tively. Following points may be carefully figure. Make three of that kind and
mary glass plates corresponding to the noted: fix them in a suitable case. Adjust-
mixed colour will allow that light to pass 1. Potmeters VR1, VR2 and VR3 may ments are critical and the gadget perform-
through while the remaining one will not be used to adjust the sensitivity of the ance would depend upon its proper fabri-
allow any light ray to pass through it. As LDRs. cation and use of correct filters as well as
a result two of the LDRs get triggered 2. Common ends of the LDRs should light conditions.

LOW CURRENT, HIGH


VOLTAGE POWER SUPPLY
NAGESH UPADHYAYA

A
high voltage power supply is a
very useful source which can be TABLE
effectively used in many appli- Details of the Transformer Windings
cations 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
between a ‘live’ wire and ground. When
this ‘live’ wire is touched, the discharge
occurs via body resistance and it gives a
non-lethal but deterrent shock to an in-
truder.
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- The primary oscillations amplitude is stant load, the final voltage can be ad-
ing and the feedback winding are arranged about 24V(p-p). This gets further ampli- justed by varying the supply voltage. The
such that a sustained oscillations are fied due to the large step-up ratio of the present configuration gives 2 kV for an
ensured once the supply is switched on. transformer and we get about 800V(p-p) input DC voltage of 15 V. Though higher
The waveform’s duty cycle is asymmetri- across the secondary. A simple series volt- voltages could be achieved by increasing
cal, but it is not very important in this age multiplier (known as Cockroft-Walton input supply, one word of caution is
application. Please note that if the oscilla- circuit) is used to boost up this voltage necessary: that the component ratings
tions do not occur at the ‘switch-on’ time, in steps to give a final DC voltage of about have to be kept in mind. If the ratings are
the transformer winding terminals of the 2 kV. exceeded then there will be electrical
feedback or the primary winding (but not The output voltage, however, is not discharges and breakdowns, which will
both) should be reversed. very well regulated. But if there is a con- damage the device.

120 ELECTRONICS PROJECTS Vol. 20


Readers Comments: obtained (around 8kV to 9kV) by increas- output with this circuit.
❑ I would like the author to clarify my ing the number (not value) of capacitors 2. Higher voltages can be obtained by
following doubts: and diodes of the series voltage multi- increasing the number of stages. But af-
1. Is the polarity of the output posi- plier? ter finite number of stages, the current
tive or negative? If it is positive, can nega- The author Nagesh Upadhyaya re- capacity becomes unusable and we have
tive polarity output be obtained, and vice plies: to resort to either increasing the input
versa? 1. The polarity of output is positive. It voltage or the number of turns in the
2. Can higher values of voltage be is not possible to get a negative polarity secondary windings of the transformer.

led by resistor R5 and capacitor C4, and


AUDIO-VISUAL EXTRA the repetition rate is controlled by resis-
tor R4 and capacitor C3. A little experi-

RINGER FOR PHONE


mentation with the various values of the
resistors and capacitors may be carried
out to obtain desired pleasing tone.
Working of the circuit is quite simple.
The bell signal, approximately 75V AC,
T.K. HAREENDRAN passes through capacitor C1 and resistor
R2 and appears across the diode bridge
comprising diodes D1 to D4. The rectified
DC output is smoothed by capacitor C2.

M
any a times one needs an ex- application as bell sound generator, The dual-tone ring signal is output from
tra telephone ringer in an ad- requires very few external parts. It is pin 8 of IC1 and its volume is adjusted
joining room to know if there is readily available in 8-pin mini DIP pack. by volume control VR1. Thereafter, it is
an incoming call. For example, if the Resistor R3 is used for bell sensitivity impressed on the piezo-ceramic sound
telephone is installed in the drawing room adjustment. The bell frequency is control- generator.
you may need an extra ringer in the
bedroom. All that needs to be done is to
connect the given circuit in parallel with
the existing telephone lines using twin
flexible wires.
This circuit does not require any ex-
ternal power source for its operation. The
section comprising resistor R1 and diodes
D5 and LED1 provides a visual indica-
tion of the ring. Remaining part of the
circuit is the audio ringer based on IC1
(BA8204 or ML8204). This integr- ated
circuit, specially designed for telec- om

HANDY ZENER DIODE TESTER


K. UDHAYA KUMARAN (VU3GTH)

H
ere is a handy zener diode for four 1.5V batteries and the remaining quired AC voltage across transformer’s
tester which tests zener diodes one-third is sufficient for accommodating 230V AC terminals. This AC voltage is con-
with breakdown voltages ex- this circuit. In this circuit a commonly verted to DC by diode D1 and filter capaci-
tending up to 120 volts. The main ad- available transformer with 230V AC pri- tor C2 and is used to test the zener diodes.
vantage of this circuit is that it works mary to 9-0-9V, 500mA secondary is used R3 is used as a series current limiting
with a voltage as low as 6V DC and in reverse to achieve higher AC voltage resistor.
consumes less than 8 mA current. across 230V AC terminals. After assembling the circuit, check DC
The circuit can be fitted in a 9V bat- Transistor T1 (BC547) is configured voltage across points A and B without
tery box. Two-third of the box may be used as an oscillator and driver to obtain re- connecting any zener diode. Now switch

ELECTRONICS PROJECTS Vol. 20 121


S1 on. The DC voltage across A-B should
vary from 10V to 120V by adjusting
potmeter VR1 (10k). If every thing is all
right, the circuit is ready for use.
For testing a zener diode of unknown
value, connect it across points A and B
with cathode towards A. Adjust potmeter
VR1 so as to obtain the maximum DC
voltage across A and B. Note down this
zener value corresponding to DC voltage
reading on the digital multimeter.
When testing zener diode of value less
than 3.3V, the meter shows less voltage
instead of the actual zener value. However,
correct reading is obtained for zener diodes
of value above 5.8V with a tolerance of ±10
per cent. In case zener diode shorts, the
multimeter shows 0 volts.

AUTOMATIC EMERGENCY LIGHT


LOKESH KUMATH

T
he circuit of automatic emer- tery voltage is about 10.2V, or to 325 mA Thus, relay RL3 is ‘on’ and relay RL4 is
gency light presented here has when battery voltage is about 13.5V. ‘off.’
the following features: When the battery charges to 13.5V But as soon as the battery voltage
1. When the mains supply (230V AC) (as set by VR2), zener diode D17 breaks falls to about 10.2V (as set by preset
is available, it charges a 12V battery up down, thereby triggering triac TR1. Now, VR1), zener diode D16 comes out of
to 13.5V and then the battery is discon- since DC is passing through the triac, it conduction, making pin 2 low and pin 3
nected from the charging section. remains continuously ‘on’ even if the gate high to turn ‘on’ relay RL4 and orange
2. When the battery discharges up to current is reduced to zero (by disconnect- LED D13. This also switches off relay
10.2V, it is disconnected from the load ing the gate terminal). Once the battery RL3 and LED D15.
and the charging process is resumed. is fully charged, charging section is cut- Now, if the mains is available, charg-
3. If the mains voltage is available off from the battery due to energisation of ing restarts due to de-energisation of re-
and there is darkness in the room, load relay RL2. This relay remains ‘on’ even if lay RL2 because when relay RL4 is ‘on,’
(bulb or tube) is turned on by taking power the power fails because of connection to it breaks the circuit of relay RL2 and triac
from the mains; otherwise the battery is the battery via diode D10. Switch S4, a TR1. But if the mains supply is not
connected to the load. normally closed switch, is included to present, both relays RL3 and RL1
4. When the battery discharges up to manually restart the charging process if de-energise, disconnecting the battery
10.2V and if the mains is not yet avail- required. from the remaining circuit.
able, the battery is completely discon- Battery disconnect and charging Thus when battery voltage falls to 10.2
nected from the circuit to avoid its fur- restart section comprises an NE555 volts, its further discharge is curtailed.
ther discharge. timer (IC2) wired as
The mains supply of 230V AC is monostable multi-
stepped down to 18V AC (RMS) using a vibrator. When the bat-
230V AC primary to 0-18V AC, 2A sec- tery voltage is above
ondary transformer (X1), generally used 10.2V (as indicated by
in 36cm B&W TVs. Diodes D1 through red LED D15), zener
D4 form bridge rectifier and capacitor C5 diode (D16) remains in
filters the voltage, providing about 25V the breakdown region,
DC at the output. making the trigger pin
Charging section includes 33-ohm, 10- 2 of IC2 high, thereby
watt resistor R2 which limits the charg- maintaining output pin
ing current to about 425 mA when bat- 3 in low voltage state.

122 ELECTRONICS PROJECTS Vol. 20


In darkness, LDR resistance is very peres (24 watts). Resistor R5 is sup-
high, which causes pin 2 of IC3 to fall to posed to drop approximately 12 volts
near ground potential and thus trigger when the load current flows through it
it. As a consequence, output pin 3 goes during mains availability. Hence power
high during the monostable pulse period, dissipated in it would almost be equal to
forward biasing transistor T3 which goes the load power. It is therefore desirable
into saturation, energising relay RL5. to replace R5 with a bulb of similar volt-
With auto/bypass switch S2 off (in auto age and wattage as the load so that dur-
mode), the load gets connected to supply ing mains availability we have more (dou-
via switch S3. If desired, the load may be ble) light than when the load is fed from
switched during the day-time by flipping the battery.
switch S2 to ‘on’ position (manual). For setting presets VR1 and VR2, just
Preset VR3 is the sensitivity control take out diodes D7, D10 and D18 (desolder
used for setting threshold light level at one end). Connect a variable source of
which the load is to be automatically power supply in place of battery. Set
switched on/off. Capacitors across the re- preset VR1 so that battery-high LED D15
lays ensure that there is no chattering of is just off at 10.2V output from the vari-
the relays. able source. Increase the potential of the
When the mains is present, diode D8 variable source and observe the shift from
couples the input voltage to regulator IC1 LO BAT LED D13 to Hi Batt LED D15.
whereas diode D10 feeds the input volt- Now make the voltage of the source 13.5V
But as soon as the mains supply resumes, age to it (from battery) in absense of and set preset VR2 so that relay RL2 just
it energises relay RL1, thereby connecting mains supply. Diode D5 connects the load energises. Then decrease the voltage
the battery again to the circuit. to the power supply section via resistor slowly and observe that relay RL2 does
Light sensor section also makes use R5 when mains is available (diode D18 not de-energise above 10.2V. At 10.2V,
of a 555 timer IC in the monostable does not conduct). However, when mains LED D15 should be off and relay RL2
mode. As long as normal light keeps power fails, the situation reverses and should de-energise while LED D13 should
falling on LDR1, its resistance is com- diode D18 conducts while diode D5 does light up.
paratively low. As a result pin 2 of IC3 not conduct. Preset VR3 can be adjusted during
is held near Vcc and its output at pin 3 The load can be any bulb of 12 volts evening hours so that the load is ‘on’
is at low level. with a maximum current rating of 2 am- during the desired light conditions.

ELECTRONICS PROJECTS Vol. 20 123


AUTOMATIC ROOM POWER CONTROL
TONY GLADVIN GEORGE

A
n ordinary automatic room power
control circuit has only one light
sensor. So when a person enters
the room it gets one pulse and the lights
come ‘on.’ When the person goes out it
gets another pulse and the lights go ‘off.’
But what happens when two persons en-
ter the room, one after the other? It gets
two pulses and the lights remain in ‘off’
state.
The circuit described here overcomes
the above-mentioned problem. It has a
small memory which enables it to auto-
matically switch ‘on’ and switch ‘off’ the
lights in a desired fashion.
The circuit uses two LDRs which are
placed one after another (separated by a
distance of say half a metre) so that they
may separately sense a person going into
the room or coming out of the room.
Outputs of the two LDR sensors, af-
ter processing, are used in conjunction
with a bicolour LED in such a fashion
that when a person gets into the room it
emits green light and when a person goes
out of the room it emits red light, and
vice versa. These outputs are simultane-
ously applied to two counters.
One of the counters will count as +1,
+2, +3 etc when persons are coming into
the room and the other will count as -1,
-2, -3 etc when persons are going out of
the room. These counters make use of
Johnson decade counter CD4017 ICs. The
next stage comprises two logic ICs which
can combine the outputs of the two
counters and determine if there is any
person still left in the room or not.
Since in the circuit LDRs have been
used, care should be taken to protect them
from ambient light. If desired, one may
use readily available IR sensor modules
to replace the LDRs. The sensors are in-
stalled in such a way that when a person
enters or leaves the room, he intercepts
the light falling on them sequentially—
one after the other.
When a person enters the room, first
he would obstruct the light falling on
LDR1, followed by that falling on LDR2.
When a person leaves the room it will be
the other way round.
In the normal case light keeps falling
on both the LDRs, and as such their

124 ELECTRONICS PROJECTS Vol. 20


resistance is low (about 5 kilo-ohms). As T2 via diode D4. As a result transistor through N4) are ANDed by AND gates
a result, pin 2 of both timers (IC1 and pair T1-T2 conducts because capacitor C5 (A1 through A4) and then wire ORed (us-
IC2), which have been configured as retains the charge for some time as its ing diodes D5 through D8). The net effect
monostable flip-flops, are held near the discharge time is controlled by resistor is that when persons are entering, the
supply voltage (+9V). R5 (and R7 to an extent). Thus green LED output of at least one of the AND
When the light falling on the LDRs is portion of bi-colour LED is lit momentar- gates is high, causing transistor T5 to
obstructed, their resistance becomes ily. conduct and energise relay RL1. The bulb
very high and pin 2 voltages drop to near The same output is also coupled to connected to the supply via N/O contact
ground potential, thereby triggering the IC3 for which it acts as a clock. With of relay RL1 also lights up.
flip-flops. Capacitors across pin 2 and entry of each person IC3 output (high When persons are leaving the room,
ground have been added to avoid false state) keeps advancing. At this stage tran- and till all the persons who entered the
triggering due to electrical noise. sistor pair T3-T4 cannot conduct because room have left, the wired OR output con-
When a person enters the room, LDR1 output pin 3 of IC1 is no longer positive tinues to remain high, i.e. the bulb con-
is triggered first and it results in as its output pulse duration is quite short tinues to remains ‘on,’ until all persons
triggering of monostable IC1. The and hence transistor collectors are in high who entered the room have left.
short output pulse immediately charges impedance state. The maximum number of persons that
up capacitor C5, forward biasing transis- When persons leave the room, LDR2 this circuit can handle is limited to four
tor pair T1-T2. But at this instant the is triggered first, followed by LDR1. Since since on receipt of fifth clock pulse the
collectors of transistors T1 and T2 are in the bottom half portion of circuit is iden- counters are reset. The capacity of the
high impedance state as IC2 pin 3 is at tical to top half, this time, with the de- circuit can be easily extended to
low potential and diode D4 is not con- parture of each person, red portion of bi- handle up to nine persons by removing
ducting. colour LED is lit momentarily and output the connection of pin 1 from reset pin
But when the same person passes of IC4 advances in the same fashion as in (15) and utilising Q1 to Q9 outputs of
LDR2, IC2 monostable flip-flop is case of IC3. CD4017 counters. Additional inverters,
triggered. Its pin 3 goes high and this The outputs of IC3 and those of IC4 AND gates and diodes will, however, be
potential is coupled to transistor pair T1- (after inversion by inverter gates N1 required.

TELECOM HEADSET
T.K. HAREENDRAN

A
compact, inexpensive and
low component count
telecom head-set can be
constructed using two readily avail-
able transistors and a few other elec-
tronic components. This circuit is
very useful for hands-free operation
of EPABX and pager communica-
tion. Since the circuit draws very
little current, it is ideal for parallel
operation 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 be- The bridge rectifier using diodes D1 Section comprising transistor T1, re-
cause, under idle conditions, the telephone through D4 acts as a polarity guard which sistors R2, R3 and zener diode D6 forms a
line voltage is insufficient to ionise the protects the electronic circuit from any constant voltage regulator that provides a
neon gas and thus the lamp does not light. reversal in the telephone line polarity. low voltage output of about 5 volts.
Only when the ring signal is being Zener diode D5 at the output of this bridge Dial tone and speech signals from ex-
received, it flashes at the ringing rate to rectifier is used for additional circuit pro- change are coupled to the audio amplifier
indicate an incoming call. tection. stage built around transistor T2 and re-

ELECTRONICS PROJECTS Vol. 20 125


lated parts, i.e. resistors R7, R6 and ca- The whole circuit can be
pacitor C5. Amplified signals from collec- wired on a very small PCB
tor of transistor T2 are coupled to dy- and housed in a medium size
namic receiver RT-200 (used as earpiece) headphone, as shown in the
via capacitor C7. illustration. For better re-
A condenser microphone, connected as sults at low line currents,
shown in the circuit, is used as transmit- value of resistor R2 may be
ter. Audio signals developed across the reduced after testing.
microphone are coupled to the base of
transistor T1 via capacitor C3. Resistor
R4 determines the DC bias required for
the microphone. After amplification by
transistor T1, the audio signals are
coupled to the telephone lines via the diode
bridge.

Readers Comments: The author T.K. Hareendran replies: headset.


❑ I have assembled the above-mentioned I have retested my prototype, and I One can, however, increase the out-
circuit and observed that although the like to say that the output level is not put power by further modification. For
circuit is functioning satisfactorily, the vol- very low as stated by Mr Rehman. I this, a two-transistor amplifier is used.
ume in the earpiece is quite low. How can request the reader to check his assem- Please refer my circuit idea ‘Handy Tel-
we increase the volume? bled circuit carefully. A single transis- ephone Receiver’ published in April ’98
A. Rahman tor-based audio amplifier, as in my issue of EFY. (Reproduced in Electronics
Achlady circuit, is good enough for a telecom Projects Vol. 19.)

SMART PHONE LIGHT


JAYAN A.R.

T
he circuit shown here is used to The circuit can be implemented using than 100 kilo-ohms in darkness, is at the
switch on a lamp when the tele- just two ICs. A light dependent resist- heart of the circuit.
phone rings, provided that the ance (LDR), with about 5 kilo-ohms re- The circuit is fully isolated from the
ambient light is insufficient. sistance in the ambient light and greather phone lines and it draws current only

126 ELECTRONICS PROJECTS Vol. 20


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
light available, the resistance of LDR
increases to a few mega-ohms and the
transistor switches to ‘off’ state. Thus
the DC voltage present at the collector of
transistor of the opto-coupler is normally
low and it jumps to 5V when there is no
light or insufficient light.
The 74LS123 retriggerable
monostable multivibrator IC is used to
generate a programmable pulse-width.
The first monostable 74LS123(A) gener-
ates a pulse from the trigger input avail-
able during ringing, provided its pin 2
input (marked B) is logic high (i.e.
during darkness). It remains high for
the programmed duration and
switches back to 0V at the end of the
pulse period.
This high-to-low transition (trailing
edge) is used to trigger the second
monostable flip-flop 74LS123(B) in the
same package. Output of the second
monostable is used to control a relay.
when the phone rings. The lamp can be coupler also isolates the circuit from the The lamp being controlled via the N/O
battery powered to provide light during telephone lines. Transistor in the opto- contacts of the relay gets switched ‘on.’
power failure or load shedding also. coupler is normally ‘off’ and a voltage of The ‘on’ period can be extended by simply
The light switches off automatically +5V is present at the ring indicator line pressing pushbutton switch S1. If nobody
after a programmable time period. If re- B. attends the phone, the light turns off
quired, the lamp lighting period can When telephone rings, an AC voltage automatically after the specific time
be extended by simply pressing a of around 70-80V AC present across the period equal to the pulse-width of the
pushbutton switch (S1). telephone lines turns on the diode inside second flip-flop.
The first part of the circuit functions the opto-coupler (IC2), which in turn The light sensitivity of LDR can be
as a ring detector. When telephone is on- switches on transistor inside the opto- changed by changing resistance R3 con-
hook, around 48V DC is present across coupler. The voltage at its collector drops nected at collector of the transistor in light
the TIP and RING terminals. The diode to a low level during ringing to trigger monitor circuit. Similarly, switch-on
in the opto-coupler is ‘off’ during this IC3 74LS123(A) monostable flip-flop. period of the lamp can be controlled by
condition and it draws practically no The other opto-coupler (IC1) is used changing capacitor C3’s value in the
current from the telephone lines. The opto- to detect the ambient light condition. second 74123(B) monostable circuit.

AUTO RESET OVER/UNDER


VOLTAGE CUT-OUT
J. GOPALAKRISHNAN

T
his over/under voltage cut-out mains voltages. inside 555 timer ICs. Supply is tapped
will save your costly electrical The circuit features auto reset and from different points of the power supply
and electronic appliances from the utilises easily available components. It circuit for relay and control circuit opera-
adverse effects of very high and very low makes use of the comparators available tion to achieve reliability.

ELECTRONICS PROJECTS Vol. 20 127


pin 7 is therefore age (say 270V AC) cut-out by observing
off. The output that LED2 just extinguishes when
(at pin 3) re- the mains voltage is slightly less
verses (goes low) than 270V AC. With RESET pin 4 of IC2
when pin 2 is high, the output pin 3 is also high. As a
taken more result transistor T2 conducts and ener-
*
positive than gises relay RL1, connecting load to power
1/3 Vcc. At the supply via its N/O contacts. This is the
same time pin situation as long as mains voltage is
7 goes low (as greater than 160V AC but less than 270V
Q output of AC.
internal flip- When mains voltage goes beyond
flop is high) and 270V AC, it causes output pin 3 of IC2 to
the LED con- go low and cut-off transistor T2 and de-
nected to pin energise relay RL1, in spite of RESET
7 is lit. Both pin 4 still being high. When mains volt-
timers (IC1 age goes below 160V AC, IC1’s pin 3 goes
and IC2) are high and LED1 is extinguished. The high
The circuit utilises comparator 2 for configured to function in the same output at pin 3 results in conduction of
control while comparator 1 output fashion. transistor T1. As a result collector of tran-
(connected to reset pin R) is kept low Preset VR1 is adjusted for under volt- sistor T1 as also RESET pin 4 of IC2 are
by shorting pins 5 and 6 of 555 IC. age (say 160 volts) cut-out by observing pulled low. Thus output of IC2 goes low
The positive input pin of comparator that LED1 just lights up when mains and transistor T2 does not conduct.
2 is at 1/3rd of Vcc voltage. Thus as voltage is slightly greater than 160V AC. As a result relay RL1 is de-energised,
long as negative input pin 2 is less posi- At this setting the output at pin 3 of IC1 which causes load to be disconnected
tive than 1/3 Vcc, comparator 2 output is low and transistor T1 is in cut-off state. from the supply. When mains voltage
is high and the internal flip-flop is As a result RESET pin 4 of IC2 is held again goes beyond 160V AC (but
set, i.e. its Q output (pin 3) is high. high since it is connected to Vcc via 100 less than 270V AC) the relay again
At the same time pin 7 is in high kilo-ohm resistor R4. energises to connect the load to power
impedance state and LED connected to Preset VR2 is adjusted for over volt- supply.

CLAP REMOTE
S. CHANDRA SEKHAR

A
n infra-red or wireless remote erated switch has the advantage that the hand. These switches may be used to con-
control has the disadvantage that transmitter is always with you. This trol lights or fans—or anything else that
the small, handy, remote (trans- project offers a way to control up to four does not produce too loud a sound.
mitter) is often misplaced. The sound op- latching switches with two claps of your To prevent an occasional loud sound

128 ELECTRONICS PROJECTS Vol. 20


from causing Eight outputs of this IC drive LEDs (1
malfunction, through 8). These outputs also go to the J
the circuit is and K inputs of four flip-flops inside two
normally quies- CD4027 ICs (IC3 and IC4). The clock in-
cent. The first puts of these flip-flops are connected to
clap takes it out the pulse shaped sound signal (available
of standby state at the output of gate N3).
and starts a Additional circuitry around the
scan of eight CD4017 counter ensures that it is in the
panel-mounted reset state, after reaching count 9, and
LEDs. Each of that the reset is removed when a sound
the four signal is received.
switches are Outputs of the four flip-flops are buff-
accompanied ered by transistors and fed via LEDs to
with two the gates of four triacs. These triacs switch
LEDs—one for the mains supply to four loads, usually
indicating the lamps. If small lamps are to be controlled,
‘on’ and the these may be directly driven by the tran-
other for indi- sistors.
cating the ‘off’ If this circuit is to be active, i.e. scan-
state. A second ning all the time, some components
clap, while the around CD4017 IC could be omitted and
appropriate some connections changed. But then it
LED is lit, acti- would no longer be immune to an occa-
vates that func- sional, spurious loud sound.
tion. For exam- The condenser microphone usually
ple, if you clap available in the market has two termi-
while LED10 nals. It has to be supplied with power for
used in conjunc- it to function. Any interference on this
tion with Lamp supply line will be passed on to the out-
1 is lit then the put. So the supply for the microphone is
lamp turns on. smoothed by resistor-capacitor combina-
(If it is already tion of R2, C1 and fed to it via resistor
on, nothing R1.
happens and it CD4069, a hex unbuffered inverter,
remains on.) contains six similar inverters. When the
A condenser output and input of such an inverter is
microphone, as bridged by a resistor, it functions as an
used in tape re- inverting amplifier. Capacitor C2 couples
corders, is used the signal developed by the microphone
here to pick up to N1 inverter in this IC, which is
the sound of the configured as an amplifier. The output of
claps. The sig- gate N1 is directly connected to the input
nal is then of next gate N2. Capacitor C3 couples the
amplified and output of this inverter to N3 inverter,
shaped into a which is connected as an adjustable level
pulse by three comparator. Inverter N4 is connected as
inverters (N1 an LED (9) driver to help in setting the
through N3) sensitivity.
contained in Preset VR1 supplies a variable bias
CMOS hex to N3. If the wiper of VR1 is set towards
inverter IC the negative supply end, the circuit be-
CD4069. A comes relatively insensitive (i.e. requires
clock generator a thunderous clap to operate). As the
built from two wiper is turned towards resistor R4, the
of the inverter circuit becomes progressively more sensi-
gates (N5 and tive. The sound signal supplied by gate
N6) supplies N2 is added to the voltage set by preset
clock pulses to a VR1 and applied to the input of gate N3.
decade counter When this voltage crosses half the sup-
CD4017 (IC2). ply voltage, the output of gate N3 goes

ELECTRONICS PROJECTS Vol. 20 129


low. This output is normally high since (If both J and K are high, the output will satisfactorily.
the input is held low by adjustment of change state at each clock pulse.) Thus CMOS ICs are used in this circuit for
preset VR1. although all flip-flops receive the clap implementing the amplifyingand logic
The output of gate N3 is used for two signal at their clock inputs, only the one functions. Use of a dedicated supply is
things: First, it releases the reset state of selected by the active output of IC2 will recommended because the integrated cir-
IC2 via diode D1. Second, it feeds the change state. Resistor R9 and capacitor cuits will be damaged if the supply volt-
clock inputs to the four flip-flops contained C6 ensure that the flip-flops start in the age is too high, or is of wrong polarity. An
in IC3 and IC4. In the quiescent state, off state when power to the circuit is external power supply may get connected
IC2 is reset and its ‘Q0’ output is high. switched on, by providing a positive power- up the wrong way around, or be
Capacitor C4 is charged positively and it on-reset pulse to the reset input pins when inadvertently set to too high a voltage.
holds this charge due to the connection power is applied. The preset input pins Therefore it is a good idea to start by
from R5 to this output (Q0). are not used and are therefore connected constructing the power supply section
IC2 is a decade counter with fully directly to ground. and then add the other components of
decoded outputs. It has ten outputs la- When, after eight clock pulses, out- the circuit. If the clock is working, you
belled Q0 to Q9 which go successively put Q8 of IC2 becomes high, diode D2 may turn your attention to the amplifier.
high, one at a time, when the clock input conducts, charging capacitor C4, thereby LED9 should be off, and should flash
is fed with pulses. IC3 and IC4 are dual resetting IC2 and making its Q0 output when the terminals of capacitor C2 are
JK flip-flops. In this circuit they store high. And there it stays, awaiting the touched with a wet finger (the classic
(latch) the state of the four switches and next clap. wet finger test). Preset VR1 may need to
control the output through transistors and The four Q outputs of IC3 and IC4 be adjusted until LED9 just turns off.
triacs. are buffered by npn transistors, fed The output of gate N2 will be at
At the first clap, the output of gate through current limiting resistors and about half the supply voltage. The output
N3 goes low and diode D1 conducts, dis- LEDs (to indicate the on/off state of the of gate N3 would normally be high. The
charging capacitor C4. The reset input of loads) to the gates of four triacs. Four voltage at the input of gate N3 should
IC2 goes low, releasing its reset state. All lamps operating on the mains may thus vary when preset VR1 is varied. High-
the J and K inputs of the four flip-flops be controlled. For demonstrations, it efficiency LEDs should preferably be used
are low and so these do not change state, might be better to drive small lamps in this circuit.
even though their clock inputs receive (drawing less than 100 mA at 12V) di- The microphone has two terminals,
pulses. rectly from the emitters of the transis- one of which is connected to its body. This
When the reset input of IC2 is low, tors. In this case the triacs, LEDs and terminal has to be connected to circuit
each clock pulse causes IC2 to advance by their associated current limiting resistors ground, and the other to the junction of
one count and its outputs go high succes- may be omitted. resistor R2 and capacitor C2. These wires
sively, lighting up the corresponding LEDs It has to be noted that one side of are preferably kept short (one or two
and pulling high the J and K inputs of the the mains has to be connected to the centimetres) to avoid noise pickup. With
four flip-flops, one after the other. Resistor negative supply line of this circuit when the microphone connected, a loud sound
R8 limits the current through LEDs 1 mains loads are to be controlled. This (a clap) should result in LED9 blinking.
through 8 to about 2 mA. Larger current necessitates safe construction of the cir- Adjust preset VR1 so that LED9 stays off
might cause malfunction due to the out- cuit such that no part of it is liable to be on the loudest of background noises but
puts of IC2 being pulled down below the touched. The advantage is that it may be starts glowing when you clap.
logic 1 state input voltage. mounted out of reach of curious hands If the clap-to-start feature is not re-
If a second clap is detected while the J since it does not need to be handled quired, it may be disabled by omitting
input of a particular flip-flop is high, its Q during normal operation. It is advisable components D1, D2, R5, C4 and connect-
output will go high, regardless of what to start with the low voltage version and ing a wire link in place of diode D2.
state it was in previously. Similarly, if its then upgrade to mains operation, once Then IC2 will be alive and kicking all
K input was high, the output will go low. you are sure everything else is working the time.

TIME SWITCH
AVNISH PUNDIR

T
his circuit is especially designed one up. The switch circuit described here sides, this time switch can also be used to
for those who often need to wake will come handy; it can be used to switch switch on/off any other electric or elec-
up early in the morning. Ordinary on a TV, radio or tape recorder etc, which tronic gadget at any time. What you need
alarms in electronic watches are not loud will not allow even the laziest amongst us is a simple analogue electronic clock with
enough and very often they fail to wake to ignore their sound for too long. Be- alarm facility and a small circuit to im-

130 ELECTRONICS PROJECTS Vol. 20


plement the time to ‘Off Mode’ position at power-on-reset
switch. (when point D is at logic 1), initially diode
This time D1 would be in blocking state and
switch has two transistor T2 would be forward biased via
modes. One is resistor R5 and diodes D2 and D3. As a
‘time-on’ mode result, the relay is in energised state,
and the other is which makes output power available at
‘time-off’ mode. In output socket-1 and cuts it off from socket-
time-on mode, 2. At alarm time, the audio signal toggles
you set up the logic output states of both gates N1 and
alarm in your is coupled to the AF detector built around N2. As a result, point D goes to logic 0
clock as per normal procedure and at the low-power switching transistor T1. Dur- state. Diode D1 conducts, taking the volt-
set time this switch turns on the gadget ing alarm, the collector of transistor T1 age at junction of diodes D1 and D2 to
connected at the output socket-1. In time- will fluctuate around ground level and near about 1 volt. Diode D3 ensures that
off mode, it turns your gadget off at the set Vcc. During absence of audio alarm in- its series combination with diode D2 puts
time. The optional output socket-2 is wired put, the collector of transistor T1 is held them in blocking mode. Capacitor C3
in such a way that when you use this at Vcc potential. meanwhile discharges via resistor R6 and
socket, the mode changes without having The next stage consists of an S-R latch the voltage at base of transistor T2 ap-
to flip the mode switch (i.e. mode switch built around NAND gates N1 and N2. proaches towards ground level, cutting off
can be omitted). Capacitor C2 and resistor R4 are used for transistor T2 and de-energising relay RL1.
Please refer to the back panel dia- power-on-reset. On switching the power Now the power at output socket-1 would
gram of a typical analogue clock and the supply, gate N2 output will acquire logic be cut off while it becomes available in
audio jack, to see how the existing buzzer 1 and that of gate N1 logic 0 state. This is socket-2.
of the clock is required to be wired to the the initial state, irrespective of the posi- If the above operation is repeated with
audio output from the clock. This will en- tion of mode switch. At the time of alarm, switch S1 in ‘Mode On’ position, the power
sure that when plug is inserted in the when point A connected to collector of would initially be not available in socket-
audio jack, the clock’s buzzer will remain transistor T1 passes through logic 0 state, 1 (but available in socket-2). But after
off and not consume any power unneces- the output logic state of both the gates the alarm, the power would become avail-
sarily. will toggle. able in socket-1 and not in socket-2.
The audio alarm output from the clock Assuming that mode switch is flipped

Readers Comments: P. Sasi Kumar receives clock signal via the detector.
❑ In electronic clocks, if we set the alarm Coimbatore At switching on instant, the flip-flop out-
to sound, say, 45 minutes after the set The author Avnish Pundir replies: put at point ‘D’ will be in high state. After
time, the alarm will sound after 45 min- As per your question, the time switch first pulse from detector, point D would go
utes and then stop automatically. How- is going to toggle after 45 minutes ‘if the low and remain so, irrespective of whether
ever, in your circuit, if the clock continues clock pulses arrive again.’ But this can- more pulses arrive or not. So, there cannot
to be used after the set time, it will toggle not happen as the R-S latch is being used be any toggling of flip-flop, until and unless
when the clock pulses arrive again after in the circuit whose one input is perma- there is a power loss or somebody shorts
the set time. nently connected to +Vcc and the other capacitor ‘C2’ momentarily.

ELECTRONICS PROJECTS Vol. 20 131


WATER LEVEL
INDICATOR
WITH ALARM
VIJAY D. SATHE

H
ere is a simple, versatile circuit
which indicates the level of
water in a tank. This circuit pro-
duces alarm when water level is below
the lowest level L1 and also when water
just touches the highest level L12. The
circuit is designed to display 12 different
levels. However, these display levels can
be increased or decreased depending
upon the level resolution required. This
can be done by increasing or decreasing
the number of level detector metal strips
(L1 through L12) and their associated
components.
In the circuit, diodes D1, D2 and D13
form half-wave rectifiers. The rectified
output is filtered using capacitors C1
through C3 respectively.
Initially, when water level is below
strip L1, the mains supply frequency os-
cillations are not transferred to diode D1.
Thus its output is low and LED1 does not
glow. Also, since base voltage of transister
T1 is low, it is in cut-off state and its
collector voltage is high, which enables
melody generating IC1 (UM66) and alarm
is sounded.
When water just touches level detec-
tor strip L1, the supply frequency oscilla-
tions are transferred to diode D1. It
rectifies the supply voltage and a positive
DC voltage develops across capacitor C1,
which lights up LED1. At the same time
base voltage for transistor T1 becomes
high, which makes it forward biased and
its collector voltage falls to near-ground
potential. This disables IC1 (UM66) and
alarm is inhibited.
Depending upon quantity of water
present in the tank, corresponding level
indicating LEDs glow. It thus displays
intermediate water levels in the tank in
bar-graph style.
When water in the tank just touches
the highest level detector strip L12, the
DC voltage is developed across capacitor
C2. This enables melody generating IC1
(UM66) and alarm is again sounded.

132 ELECTRONICS PROJECTS Vol. 20


IC CONTROLLED EMERGENCY
LIGHT WITH CHARGER
A.P.S. DHILLON

T
he circuit shown here is that of proximately 6.9 volts which is obtained the battery remains on charge via N/O
the IC controlled emergency using diode D5 (1N4148) and 6.2-volt contacts of relay RL1 and current limit-
light. Its main features are: auto- zener D6. The inverting pin of IC1 is ing resistor R2. When battery voltage ex-
matic switching-on of the light on mains connected to the positive terminal of bat- ceeds 6.9 volts (overcharged condition),
failure and battery charger with over- tery. Thus when mains supply is present, IC1 output goes low and relay RL1 gets
charge protection. IC1 comparator output is high, unless de-energised, and thus stops further
When mains is absent, relay RL2 is in battery voltage exceeds 6.9 volts. So tran- charging of battery.
de-energised state, feeding battery supply sistor T1 is normally forward biased, MOSFETs T3 and T4 may be
to inverter section via its N/C contacts and which energises relay RL1. In this state mounted on suitable heat sinks.
switch S1. The in-
verter section com-
prises IC2 (NE555)
which is used in
astable mode to
produce sharp
pulses at
the rate of 50 Hz
for driving the
MOSFETs. The
output of IC3 is fed
to gate of MOSFET
T4 directly while
it is applied to
MOSFET T3 gate
after inversion by
transistor T2. Thus
the power amplifier
built around
MOSFETs T3 and
T4 functions in
push-pull mode.
The output
across secondary of
transformer X2 can
easily drive a 230-
volt, 20-watt
fluorescent tube. In
case light is not
required to be on
during mains fail-
ure, simply flip
switch S1 to off po-
sition.
Battery over-
charge preventer
circuit is built
around comparator
IC1 (LM308). Its
non-inverting pin
is held at a refer-
ence voltage of ap-

ELECTRONICS PROJECTS Vol. 20 133


WIPER SPEED
CONTROLLER
PRADEEP G.

A
continuously working wiper
in a car may prove to be a
nuisance, especially when it
is not raining heavily. By using the
circuit described here one can vary
sweeping rate of the wiper from once
a second to once in ten seconds.
The circuit comprises two timer
NE555 ICs, one CD4017 decade
counter, one TIP32 driver transistor,
a 2N3055 power transistor (or
TIP3055) and a few other discrete
components.
Timer IC1 is configured as a
monostable multivibrator which pro-
duces a pulse when one presses
switch S1 momentarily. This pulse
acts as a clock pulse for the decade
counter (IC2) which advances by one
count on each successive clock pulse
or the push of switch S1.
Ten presets (VR1 through VR10),
set for different values by trial and
error, are used at the ten outputs
of IC2. But since only one output of
IC2 is high at a time, only one pre-
set (at selected output) effectively
comes in series with timing resistors
R4 and R5 connected in the circuit
of timer IC3, which functions in
astable mode.
As presets VR1 through VR10 are
set for different values, different time
periods (or frequencies) for astable
multivibrator IC3 can be selected.
The output of IC3 is applied to pnp
driver transistor T1 (TIP32) for driv-
ing the final power transistor T2
(2N3055) which in turn drives the
wiper motor at the selected sweep
speed. The power supply for the wiper
motor as well as the circuit is tapped
from the vehicle’s battery itself. The
duration of monostable multivibrator
IC1 is set for a nearly one second
period.

134 ELECTRONICS PROJECTS Vol. 20


CD-ROM DRIVE AS DIGITAL-AUDIO
CD-PLAYER
M.P. VERMA

A
CD-ROM drive can be used as a
stand-alone unit for playing dig-
ital audio CDs without interfac-
ing with a computer. The stereo output of
CD player available at the audio jack can
be amplified using audio input facility
which is normally available on a
tape-deck/tape-recorder or a stereo am-
plifier. Audio socket on front/rear of the
CD-ROM drive is capable of driving head-
phones or speakers of less than 500 mW.
Proper stereo jacks for interconnection
between CD-ROM drive and tape deck
are available from computer/tape recorder
spares vendors. The principle of opera-
tion is illustrated here with the help of
block diagram.
The 4-pin power supply socket avail-
able at the rear of a CD-ROM player is
meant for +5V, ground (two middle pins)
and +12V inputs. The power supply can mains since it has self-contained power routed using a yellow wire and
be easily derived using a conventional supply circuit inside. for +5V a red wire is used, while for
power supply circuit as shown in the fig- While there may be minor differences ground black wires are used with the
ure. If you have an external CD-ROM amongst the available CD-ROM drives’ supply connector.
drive, it can be simply plugged into the external controls, a typical drive’s con- Once the power supply has been
trols are shown in the figure connected correctly, you will notice
here. Please ensure that a that LED indicator on the drive starts
proper power supply connector flashing. Now the digital audio CD can
available from computer spare be loaded after pushing the eject button.
parts vendor is used for A second push of the same button causes
connection to CD-ROM drive. To retraction of CD carriage into the drive.
identify +5V and +12V pins on One can change the track (song) on the
the drive connector, please note CD using play switch on the
that in the computer +12V is CD-ROM drive.

AUTOMATIC DUAL-OUTPUT DISPLAY


RAJESH K.P.

T
his circuit lights up ten bulbs In this circuit, gates N1 and N2 form Depending on the logic state at its pin
sequentially, first in one direction an oscillator. The output of this oscillator 10, the counter counts up or down. During
and then in the opposite direction, is used as a clock for BCD up/down counter count up operation, pin 7 of IC2 outputs
thus presenting a nice visual effect. CD4510 (IC2). an active low pulse on reaching the ninth

ELECTRONICS PROJECTS Vol. 20 135


count. Similarly, during count-down state alternately at each terminal count The BCD outputs of IC2 are connected
operation, you again get a low-going pulse of IC2. to 1-of-10 decoder CD4028 (IC4). During
at pin 7. Initially, pin 3 (Q0) of IC3 is high and count-up operation of IC2, the outputs of
This terminal count output from pin the counter is in count-up state. On IC4 go logic high sequentially from Q0 to
7, after inversion by gate N3, is connected reaching ninth count, pin 3 of IC3 goes Q9 and thus trigger the triacs and light-
to clock pin 14 of decade counter IC3 low and as a result IC2 starts counting ing bulbs 1 through 10, one after the other.
(CD4017) which is configured here as a down. When the counter reaches 0 count, Thereafter, during count-down operation
toggle flip-flop by returning its Q2 output Q2 output of IC3 momentarily goes high of IC2, the bulbs light in the reverse order,
at pin 4 to reset pin 15. Thus output at to reset it, thus taking pin 3 to logic 1 presenting a wonderful visual effect.
pin 3 of IC3 goes to logic 1 and logic 0 state, and the cycle repeats.

Readers Comments: The author Rajesh K.P. replies: to.


❑ Please intimate the changes that need I would advise the reader to first ar- The total number of LEDs that may
to be incorporated to replace the lamps range the letters of the display and then be used varies directly as the input volt-
with LEDs to display a message? wire the LEDs in series. Many similar age. Also, connect a 1/2W, 100-ohm re-
J. Chandrasekaran circuits have been published in earlier sistor in series with the LEDs.
Chennai issues of EFY which may also be referred

MINIATURE STROBE LIGHT


T.K. HAREENDRAN

S
trobe lights are widely used by For convenience and simplicity, an may be powered by two medium-size dry
disco lovers to create wonderful ordinary neon lamp is used here in place cells (3V) or Ni-Cd cells (2.4V).
visual effects in disco halls and of the conventional Xenon tube. The whole Transistors T1 and T2 in the
auditoria. The circuit of a battery oper- gadget can thus be easily accommodated circuit form a complimentary-pair ampli-
ated portable miniature strobe light, in a small cabinet, such as a mains adap- fier. When switch S1 is momentarily
which can be constructed using readily tor cover, with a suitable reflector for neon depressed, the circuit oscillates because
available inexpensive components, is lamp to give a proper look. Since current of the positive feedback provided via re-
described here. requirement of this circuit is very small, it sistor R2 and capacitor C1 to the base of

136 ELECTRONICS PROJECTS Vol. 20


transistor T1. The sharp pulses in the
secondary windings induce a high voltage
in primary windings of transformer X1,
which in fact is a line driver transformer
(used in reverse) generally used in 36cm
TV sets.
High voltage pulses induced in pri-
mary side are rectified by diode D1 and
rapidly charge reservoir capacitor C2 to
nearly 300V DC. When switch S1 is re-
leased, capacitor C2 holds the voltage level
for a finite period while capacitor C3
charges slowly through resistor R3. When
voltage across capacitor C3 becomes high
enough, neon strikes and the capacitor
rapidly discharges through the lamp.
When voltage across capacitor C3 falls
below the extinguishing potential of neon reservoir capacitor C2’s value. therefore be taken for protection. Before
lamp, it goes off and capacitor C3 starts Precautions. The neon lamp flasher any repair work, discharge capacitor C2
charging again. This cycle keeps on section of this circuit carries dangerously using a short length of wire with a 100k
repeating for a short time, based on the high voltages. All precautions should resistor connected in series.

ELECTRONIC CARD-LOCK SYSTEM


VIJAY D. SATHE

T
he circuit presented here can be goes low. This makes transistor T16 to on photo-transistor T8.
used as a lock for important cut-off, and its collector voltage goes high. IC1 will get enabled only when the
electronic/electrical appliances. This logic high on its collector terminal card is completely inserted inside the lock
When card is inserted inside its mecha- will inhibit IC1 as long as light is present mechanism. This arrangement ensures
nism, depending upon the
position of punched hole on
the card, a particular ap-
pliance would be switched
on.
The card is inserted just
like a floppy disk inside the
disk drive. This card should
be rectangular in shape
with only one punched hole
on it.
The circuit uses eight
photo-transistors (T1
through T8). When there is
no card in the lock, light
from incandescent lamp L1
(40-watt, 230V) falls on all
the photo- transistor detec-
tors. Transistor T8 is used
as enable detector for IC1
(74LS244). When light is
incident on it, it conducts
and its collector voltage

ELECTRONICS PROJECTS Vol. 20 137


that only the selected appliance is indicate proper direction for insertion of pliance 1) is completely inserted in the
switched on and prevents false operation the card. If an attempt is made to insert mechanism, the light will fall only on
of the system. the card wrongly, it will not go completely photo-transistor T1. So only T1 will be on
You can make these cards using a inside the mechanism and the system will and other photo-transistors will be in off
black, opaque plastic sheet. A small rec- not be enabled. state. When transistor T1 is on, its
tangular notch is made on this card to When card for any appliance (say ap- collector voltage falls, making transistor

138 ELECTRONICS PROJECTS Vol. 20


T9 to cut-off. As a result, collector voltage common-cathode junction. When any of sponding LED.
of transistor T9 as also pin 2 of IC1 go the outputs of IC1 is logic high, the com- Once a specific card is inserted to
logic high. This causes pin 18 (output Q1) mon-cathode junction of diodes D1 switch on a specific relay, that relay gets
also to go high, switching LED1 on. through D7 also goes logic high, enabling latched through its second pair of con-
Simultaneously, output Q1 is connected IC3 (UM66) to generate a musical tone. tacts. Thus even when the card is re-
to pin 1 of IC2 (ULN2003) for driving the In this circuit IC1 (74LS244) is used moved, the specific appliance remains on.
relay corresponding to appliance 1. Simi- as buffer with Schmitt trigger. All out- The same holds true for all other relays/
larly, if card for appliance 2 is inserted, puts (Q1 through Q7) of this IC are con- appliances as well. The only way to de-
only output pin 16 (Q2) of IC1 will go nected to IC2 (ULN2003) which is used energise a latched relay after removal of
high-making LED2 on while at the same as relay driver. IC2 consists of seven high- the corresponding card is to switch off the
time energising relay for appliance 2 via current relay drivers having integral di- corresponding switch (S1 through S7)
ULN2003. The same is true for other odes. External free-wheeling diodes are which would cut-off the supply to the
cases/appliances also. therefore not required. desired relay.
The time during which card is present When an input of this IC is made The +5V and +12V supplies can be
inside the mechanism, the system gener- logic high, the corresponding output obtained with conventional arrangement
ates musical tone. This is achieved with will go logic low and relay connected to using a step-down transformer followed
the help of diodes D1 through D7 which that pin gets energised. This switches by rectifier, filter and regulator (using
provide a wired-OR connection at their on a specific appliance and the corre- 7805 and 7812 etc).

PC-BASED 7-SEGMENT
ROLLING DISPLAY
PRASHANT R. DESHMUKH

I
t is very interesting and con
venient to be able to control
everything while sitting at your
PC terminal. Here, a simple hard-
ware 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

ELECTRONICS PROJECTS Vol. 20 139


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

17 of ‘D’ connector are inverted by the After the display of all characters/ The program for rolling display is
computer before application to the pins digits in this way, the cycle repeats itself given in the listing DISP.C above. What-
while data bit D2 is not inverted. There- over and over again. Because of this rep- ever the message/characters to be dis-
fore to get a logic high at any of former etition at a fairly high rate, there is an played (here five characters have been
three pins, we must send logic 0 output to illusion that all the digits/characters are displayed), these are separated and stored
the corresponding pin of port 37AH. continuously being displayed. DISP1 is to in an array. Then these are decoded.
Another important concept illustrated be physically placed as the least signifi- Decoding software is very simple. Just
by the project is the time division cant digit. replace the desired character with the
multiplexing. Note that all the five 7- IC1 (74LS244) is an octal buffer which binary equivalent of the display code. The
segment displays share a common data is primarily used to increase the driving display code is a byte that has the
bus. The PC places the 7-segment code capability. It has two groups of four buff- appropriate bits turned on. For example,
for the first digit/character on the data ers with non-inverted tri-state outputs. to display character ‘L’, the segments to
bus and enables only the first 7-segment The buffer is controlled by two active low be turned on are f, e and d. This is equiva-
display. After delay of a few millisec- enable lines. IC2 (75492) can drive a maxi- lent to 111000 binary or 38 hex.
onds, the 7-segment code for the digit/ mum of six 7-segment displays. (For Please note that only limited charac-
character is replaced by that of the next driving up to seven common-cathode dis- ters can be formed using 7-segment dis-
charter/digit, but this time only second plays one may use ULN2003 described in play. Characters such as M, N and K
display digit is enabled. the previous circuit idea.) cannot be formed properly.

CONTACTLESS AC MAINS
VOLTAGE DETECTOR
PRADEEP G.

T
his is a CMOS IC (CD4033) based input impedance is ex-
circuit which can be used to de- tremely high and thus the
tect presence of AC mains volt- induced voltage is sufficient
age without any electrical contact with to clock the counter IC. Thus
the conductor carrying AC current/volt- display count advances rap-
age. Thus it can be used to detect mains idly from 0 to 9 and then
AC voltage without removing the insula- repeats itself. This is the
tion from the conductor. Just take it in indication for presence of
the vicinity of the conductor and it would mains supply. Display stops
detect presence of AC voltage. advancing when the unit is
If AC voltage is not present, the dis- taken away from the mains
play would randomly show any digit (0 carrying conductor.
through 9) permanently. If mains supply For compactness, a 9-
is available in the conductor, the electric volt PP3 battery may be
field would be induced into the sensing used for supply to the
probe. Since IC used is CMOS type, its gadget.

140 ELECTRONICS PROJECTS Vol. 20


FREQUENCY MEASUREMENTS
USING PC
PROBIR GOYAL

H
ere is a simple technique for ter are not used. When a wave is found, limit (UL) of frequency is given by
measuring frequencies over along with its time-period and frequency UL=19xN5 Hz. Thus for MOD 16 counters
quite a wide frequency range components, its measurement precision in UL≈20 MHz, and for MOD 10 counters
and with acceptable accuracy limits us- percentage is also calculated and dis- UL≈1.9 MHz. Care should be taken to
ing a PC. It follows the basic technique of played. Number of data taken in 54.9 ms ensure that this upper limit is within the
measuring low frequencies, i.e. at low is also displayed. operating frequency range of counter IC
frequency, period is measured for a com- As stated above, the lower starting used. Precision of measurement is a ma-
plete wave and frequency is calculated range is about 19 Hz. Data is read for chine-dependent parameter. High-speed
from the measured time-period. approximately 54.9 ms. Thus, the lowest machines will have better precision com-
Cascaded binary counters are used for possible frequency that can be measured pared to others. Basically, precision de-
converting the high-frequency signals into is 1/.0549 Hz. Lower frequency range de- pends directly upon the number of data
low-frequency signals. The parallel port pends only on the sampling time and is read in a standard time. Precision of mea-
of a computer is used for data input from practically fixed at 19 Hz (18.2 Hz, to be surement varies inversely as the value of
binary counters. This data is used for precise). Upper frequency range depends MOD counter used. Precision is high when
measuring time and calculating the on factors such as value of the MOD coun- MOD 10 counters are used in place of
frequency of the signal. ter used and the operating frequency MOD 16 counters, but this will restrict
The block diagram shows the basic range of the counter IC. If MOD-N coun- the upper limit of frequency measurement
connections of the counters and parallel ter is used (where N is an integer), upper and vice-versa.
port pin numbers on 25-pin ‘D’ connector
of a PC (control register 379 Hex is used
for input). External hardware is used only
for converting the higher frequency sig-
nals into low frequency signals. Thus, the
major role in frequency-measurement is
played by the software.
The PC generates a time-interrupt
at a frequency of 18.21 Hz, i.e. after
every 54.92 millisecond. Software uses
this time-interrupt as a time-reference.
The control register of the PC’s parallel
port is read and the data is stored con-
tinuously in an array for approximately
54.9 ms using a loop. This stored data is
then analysed bit-wise. Initially, the
higher-order bit (MSB or the seventh-
bit) of every array element is scanned
for the presence of a complete square
wave. If it is found, its time period is
measured and if not then the second-
highest order bit (sixth bit) is scanned.
This operation is performed till the third
bit and if no full square wave is still
found, an error message is generated
which indicates that either there is an
error in reading or the frequency signal
is lower than 19 Hz.
Lower three bits of the control regis-

ELECTRONICS PROJECTS Vol. 20 141


PROGRAM IN TURBO C
#include <stdio.h> { ps=data[j] & N;
#include <dos.h> if(ls!=ps) st++; /* finding a complete wave */
#include <conio.h> if(st>0 && st<4) count++;
#define MOD 16 /* define counter mod used */ if(st==3) break; /* wave found */
#define LPT 0x379/* LPT1 input port address */ ls=ps;
void interrupt (*old_clock)(); }

M
void interrupt new_clock (); if(st==3) /* calculate frequency of the wave */
static int t;

A
{mul=1; for(j=3;j<k;j++) mul=mul*MOD;count--;
void main() printf(“%d %f %d “,k,mul,count);

R
{ /* tick = Time for which LPT will be read */ tm=((count*div)/mul); fq=1/tm; pri=(100.0/count);

G
float div,mul,tick=54800.0; /* tick is in micro sec. */ gotoxy(20,7); printf(“Frequency = %0.3lf Kilo Hz “, fq*1000);
double fq,tm,pri; gotoxy(20,10); printf(“Time = %0.3lf micro sec “, tm);

O
char data[50000],c; gotoxy(15,23); printf(“Precision = %0.5lf percent of main

R
int count,ls,ps,k,j,N,st; frequency”,pri);

P
unsigned i; gotoxy(15,24); printf(“Samples taken in %0.2f ms = %d “, tick/
old_clock = getvect(0x08);///* capturing time vector */ 1000, i);
setvect(0x08,new_clock); /* assigning new time vector */ break;
do }
{ i=0; t=0; clrscr(); if(st<3 && k==3) /* no complete wave was present */
gotoxy(25,1); printf(“FREQUENCY MEASUREMENTS”); { gotoxy(24,7); printf(“Error in Reading ...!”); }
gotoxy(23,17); printf(“Press any key to Pause.....”); } } t=0; i=0;
while(!kbhit()) /* reading LPT between two time interrupts */ }
{ /* use “inp(LPT)” if using MS product */ getch(); gotoxy(13,21);
while(t<8) while(t>2 && t<4) {data[i] = inportb(LPT); i++; }} printf(“ Press E Esc for Exit any other key to continue”);
if(t==8) c=getch();
{ div=tick/i; }while (c!=27 && c !=’e’ && c!=’E’);
for(k=7;k>2;k—) /* analyzing each bit of read data */ setvect(0x08,old_clock); /* assigning original time interupt */
{ N=1; for(j=0;j<k;j++) N=N*2; }
st=0; count=0; void interrupt new_clock() /* new time interrupt service */
ps=(data[0] & N); ls=ps; { t++; (*old_clock)(); }
for(j=0;j<i;j++)

TELEPHONE NUMBER DISPLAY


BHASKAR BANERJEE

T
he given circuit, when connected its equivalent BCD number that corre- cuit which converts an input of ‘10102’
in parallel to a telephone, dis- sponds to the dialled number. This bi- into ‘00002’ without affecting the inputs
plays the number dialled from the nary number is stored sequentially in 10 ‘1’ through ‘9’. This is accomplished by
telephone set using the DTMF mode. This latches each time a number is dialled from gates N13 through N15 (IC11) and N1
circuit can also show the number dialled the phone. The first number is stored in (IC12).
from the phone of the calling party. This IC5A (1/2 of CD4508) while the second The storing of numbers in respective
is particularly helpful for receiving any number is stored in IC5B and so on. The latches is done by IC2 (4017). The data
number over the phone lines. binary output from IC1 for digit ‘0’ as valid output from pin 15 of IC1 is
The DTMF signal—generated by the decoded by IC1 is 10102 (=1010), and this used to clock IC2. The ten outputs of IC2
phone on dialling a number—is decoded cannot be displayed by the seven-segment are sequentially connected to the store
by DTMF decoder CM8870P1 (IC1), which decoder, IC10. Therefore the binary out- and clear inputs of all the latches,
converts the received DTMF signal into put of IC1 is passed through a logic-cir- except the last one, where the clear

142 ELECTRONICS PROJECTS Vol. 20


input is tied to ground. When an output
pin of IC2 is high, the corresponding
latch is cleared of previous data and
kept ready for storing new data. Then,
on clocking IC2, the same pin becomes
low and the data present at the inputs
of that latch at that instant gets stored
and the next latch is cleared and kept
ready. The similar input and output
pins of all latches are connected together
to form two separate input and output
buses.
There is only one 7-segment decoder/
driver IC10 for all the ten displays. This
not only reduces size and cost but re-
duces power requirement too. The out-
put from a latch is available only when
its disable pins (3 and 15) are brought
low. This is done by IC3, IC12 and IC13.
IC3 is clocked by an astable multivibrator
IC4 (555). IC3 also drives the displays
by switching corresponding transistors.
When a latch is enabled, its correspond-
ing display is turned on and the content
of that latch, after decoding by IC10,
gets displayed in the corresponding dis-
play. For instance, contents of IC5A are
displayed on display ‘DIS1,’ that of IC5B
on ‘DIS2’ and so on. The system should
be connected to the telephone lines via a
DPDT switch (not shown) for manual
switching, otherwise any circuit capable
of sensing handset’s off-hook condition
and thereby switching relays, etc. can be
used for automatic switching. The power-
supply switch can also be replaced then.
Such circuits, under different captions,
can be found in EFY’s back issues.
Though this circuit is capable of showing
a maximum of ten digits, one can reduce
the display digits as required. For doing
this, connect the reset pin of IC2, say,
for a 7-digit display, with S6 output at
pin 5.
The present circuit can be built
on a veroboard and housed in a
suitable box. The displays are common-
cathode type. To make the system
compact, small, 7-segment displays can
be used but with some extra cost. Also,
different colour displays can be used for
the first three or four digits to separate
the exchange code/STD code, etc. The
circuit can be suitably adopted for
calling-line display.

Readers Comments: 2. The pin connections of DIS1 to DIS9 ❑ I have the following queries regarding
❑ I would like to have the following doubts are not mentioned properly. How should this circuit:
clarified: we connect them? 1. What is meant by DTMF mode?
1. What is the function of external Sunny Hercleas 2. Can the proposed circuit be used in
reset switch S2? How it is used? Hyderabad a telephone set that doesn’t have the

ELECTRONICS PROJECTS Vol. 20 143


DTMF output, e.g. Priyadarshni set? note that the output of IC1
3. Can I use an LCD instead of 7- corresponding to ‘0’ in the
segment display? If yes, what are the telephone is converted to
changes to be made in the circuit? ‘0’ binary by gates P1, P2,
4. Is it possible to increase the num- P3 and N1 (and not as
ber of 7-segment displays from 10 to 12? stated in the text). Though
If yes, kindly suggest the changes to be a 5V supply is shown, a
made in the circuit. better choice would be a
5. Can the proposed circuit be 9V supply.
used with telephone exchanges which In reply to T. Kartik, I
have calling line identification (CLI) would like to thank the
facility? reader for showing inter-
T. Kartik est in my circuit idea. Here
Madurai are the answers to his que-
The author Bhaskar Banarjee replies: ries:
In reply to Sunny Hercleas: 1. With modern tele-
When the circuit is switched on, phones, we can dial a
it is automatically reset, it has to be number in pulse mode or Fig. 1: Cascading for up to 18-digit display
reset manually each time, which is done in tone mode. In DTMF
using switch S2. You may also use a (dual-tone multi-frequency) mode (tone 3. LCD cannot be used with this cir-
comparator circuit to monitor the line mode) of dialling, a particular frequency cuit. It is possible only after considerable
voltage and provide a positive pulse to pair is generated corresponding to the key changes in the present circuit.
pin 15 of IC2 each time the handset in pressed instead of pulses in the pulse 4. To increase the display up to 18
lifted. mode of dialling. The generated tones can digits, cascade another 4017 with IC2 as
Regarding displays, all the similar be heard in the earphone. shown in Fig. 1.
pins of the ten displays should be con- 2. The present circuit cannot be used 5. This circuit can be used as CLI, but
nected together and then the seven com- with telephones that don’t have tone dial- it is too basic and rather uneconomical
mon wires connected to the IC10. Also ling (DTMF) mode. for such purpose.

DIGITAL SWITCHING SYSTEM


RAJESH K.P.

T
his circuit can control any one out counter acts as a master-controller for the IC1 (74LS193) is a presettable up/
of 16 devices with the help of two system. A visual indication in the form of down counter. IC2 and IC3 (74LS154) (1
push-to-on switches. An up/down LEDs is also available. of 16 decoder/demultiplexer) perform dif-

144 ELECTRONICS PROJECTS Vol. 20


ferent functions, i.e. IC2 is used to indi- by one count. Likewise, by pressing switch The outputs of IC3 are passed through
cate the channel number while IC3 S3 the counter counts downwards. inverter gates (IC4 through IC6) because
switches on the selected channel. The counter provides BCD output. IC3 provides negative going pulses while
Before using the circuit, press switch This BCD output is used as address input for driving the triacs we need positive-
S1 to reset the circuit. Now the circuit is for IC2 and IC3 to switch one (desired going pulses. The high output of inverter
ready to receive the input clock. By press- channel) out of sixteen channels by turn- gates turn on the npn transistors to drive
ing switch S2 once, the counter advances ing on the appropriate triac and the cor- the triacs. Diodes connected in series with
by one count. Thus, each pressing of responding LED to indicate the selected triac gates serve to provide unidirectional
switch S2 enables the counter to advance channel. current for the gate-drive.

40-METRE DIRECT
CONVERSION RECEIVER
PRADEEP G.

U
sing the circuit of direct-conver- into the gate of first FET (T1) through control VR1. An audio output from the
sion receiver described here, one 10pF capacitor C16. The VFO is tuned to AF amplifier is connected to an 8-ohm, 1-
can listen to amateur radio QSO a frequency which differs from the watt speaker.
signals in CW as well as in SSB mode in incoming CW signal frequency by about 1 The receiver can be powered by a 12-
the 40-metre band. kHz to produce a beat frequency note in volt power-supply, capable of sourcing
The circuit makes use of three the audio range at the output around 250mA current. Audio-output
n-channel FETs (BFW10). The first of transformer X1, which is an audio stage can be substituted with a readymade
FET (T1) performs the function of ant./ driver transformer of the type used in L-plate audio output circuit used in
RF amplifier-cum-product detector, transistor radios. transistor amplifiers, if desired. The
while the second and third FETs (T2 and The audio output from transformer X1 necessary data regarding the coils used
T3) together form a VFO (variable fre- is connected to the input of audio amplifier in the circuit is given in the circuit
quency oscillator) whose output is injected built around IC1 (TBA820M) via volume diagram itself.

ELECTRONICS PROJECTS Vol. 20 145


PRECISION 1HZ CLOCK GENERATOR
USING CHIP-ON-BOARD
K. UDHAYAKUMARAN, VU3GTH

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 a cuits directly. This low-level voltage is adjust proper
crystal and trimmer capacitors, etc. How- amplified several times by op-amp IC 1Hz pulse at the
ever, similar or better accuracy can be CA3140. output terminal
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 at When using the COB, affix the same
on a general-pur-
pose PCB using rub-
ber based adhesive
and solder the ter-
minals 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
always find out the
appropriate points
corresponding to
Resistor R1, capacitor C3, diodes D1 the input when 1Hz clock signal of low points A, B, C and D. Figure of a second
and D2 shown in the circuit convert 5V level is connected across its input termi- COB used by EFY Lab is shown along-
DC into 1.4V DC. A ½Hz clock is avail- nals from the COB. Amplified 1Hz clock side. The points A and B (on the COB
able at terminals A and B with a phase pulse is available at its output pin 6, used by us) were observed to have
difference of 90o. The two outputs, are which is further amplified by transistors complementary 1Hz outputs and hence
combined using capacitors C1 and C2 to T1 and T2 to drive the digital clocks and anyone (only) could be used as input to
obtain a complete 1Hz clock. This 1Hz timers. opamp CA3140.

Readers Comments: make digital clocks? You may use an electronic


❑ I thought of using these COBs which R.R. Kodial quartz analogue wall clock COB in
are easily available as scrap at watch New Delhi any circuit without any modification,
repair shops. Is it possible to use The author K. Udhaya Kumaran but both terminals A and B should be
them with some add-on circuitry to replies: used.

146 ELECTRONICS PROJECTS Vol. 20


ELECTRONIC JAM
RAJESH K.P.

T
his jam circuit can be used in quiz as well as 8-input NAND gate 74LS30 of any other switch S1 through S8 has
contests wherein any participant (IC3). The output of IC3 thus becomes no effect. Thus, the contestant who
who presses his button (switch) logic 0 which, after inversion by NAND presses his switch first, jams the display
before the other contestants, gets the first gate N2, is applied to latch-enable pin 11 to show only his number. In the unlikely
chance to answer a question. The circuit of IC1. With all input pins of IC2 being event of simultaneous pressing (within
given here permits up to eight contestants logic 1, its BCD output is 0000, which few nano-seconds difference) of more than
with each one allotted a distinct number is applied to 7-segment decoder/driver one switch, the higher priority number
(1 to 8). The display will show the number 74LS47 (IC6) after inversion by hex in- (switch no.) will be displayed.
of the contestant pressing his button before verter gates inside 74LS04 (IC5). Thus, on Simultaneously, the logic 0 output of gate
the others. Simultaneously, a buzzer will reset the display shows 0. N1 drives the buzzer via pnp transistor
also sound. Both, the display as well as When any one of the push-to-on BC158 (T1). The buzzer as well the
the buzzer have to be reset manually using switches—S1 through S8—is pressed, the display can be reset (to show 0) by
a common reset switch. corresponding output line of IC1 is momentary pressing of reset switch S9
Initially, when reset switch S9 is mo- latched at logic 0 level and the display so that next round may start.
mentarily pressed and released, all out- indicates the number associated with the Lab Note: The original circuit sent
puts of 74LS373 (IC1) transparent latch specific pressed switch. At the same time, by the author has been modified as it did
go ‘high’ since all the input data lines are output pin 8 of IC3 becomes high, which not jam the display, and a higher number
returned to Vcc via resistors R1 through causes outputs of both gates N1 and N2 switch (higher priority), even when
R8. All eight outputs of IC1 are connected to go to logic 0 state. Logic 0 output of pressed later, was able to change the dis-
to inputs of priority encoder 74LS147 (IC2) gate N2 inhibits IC1, and thus pressing played number.

ELECTRONICS PROJECTS Vol. 20 147


TINY DEW SENSOR
T.K. HAREENDRAN

D
ew (condensed moisture) ad- can be procured from authorised service lar dual op-amp IC LM358N which is con-
versely affects the normal per- centres of reputed companies. The author figured here as a comparator. (Note that
formance of sensitive electronic used the dew sensor for FUNAI VCP only one half of the IC is used here.) Un-
devices. A low-cost circuit described here model No. V.I.P. 3000A (Part No: 6808- der normal conditions, resistance of the
can be used to switch off any gadget 08-04, reference no. 336) in his prototype. dew sensor is low (1 kilo-ohm or so) and
automatically in case of excessive In practice, it is observed that all dew thus the voltage at its non-inverting ter-
humidity. sensors available for video application minal (pin 3) is low compared to that at
At the heart of the circuit is an inex- possess the same electrical characteris- its inverting input (pin 2) terminal. The
pensive (resistor type) dew sensor ele- tics irrespective of their physical shape/ corresponding output of the comparator
ment. Although dew sensor elements are size, and hence are interchangeable and (at pin 1) is accordingly low and thus noth-
widely used in video cassette players and can be used in this project. ing happens in the circuit.
recorders, these may not be easily avail- The circuit is basically a switching When humidity exceeds 80 per cent,
able in local market. However, the same type circuit made with the help of a popu- 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
interfaced 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.

ELECTRONIC SCORING GAME


SUDHEESH N.

Y
ou can play this game alone
or with your friends. The
circuit comprises a timer IC,
two decade counters and a display
driver along with a 7-segment
display.
The game is simple. As stated
above, it is a scoring game and the
competitor who scores 100 points
rapidly (in short steps) is the win-
ner. For scoring, one has the option
of pressing either switch S2 or S3.

148 ELECTRONICS PROJECTS Vol. 20


Switch S2, when pressed, makes the coun- The sequence of operations for play- and repeats the steps shown in step 1
ter count in the forward direction, while ing the game between, say two players ‘X’ above and notes down his new score (say,
switch S3 helps to count downwards. Be- and ‘Y’, is summarised below: X2). He adds up this score to his previous
fore starting a fresh game, and for that 1. Player ‘X’ starts by momentary score. The same procedure is repeated by
matter even a fresh move, you must press pressing of reset switch S1 followed player ‘Y’ in his turn.
switch S1 to reset the circuit. Thereafter, by pressing and releasing of either 4. The game carries on until the score
press any of the two switches, i.e. S2 or switch S2 or S3. Thereafter he presses attained by one of the two players totals
S3. switch S4 to read the display (score) up to or exceeds 100, to be declared as the
On pressing switch S2 or S3, the and notes down this number (say X1) winner.
counter’s BCD outputs change very manually. Several players can participate in this
rapidly and when you release the switch, 2. Player ‘Y’ also starts by momen- game, with each getting a chance to score
the last number remains latched at the tary pressing of switch S1 followed during his own turn.
output of IC2. The latched BCD number by pressing of switch S2 or S3 and The circuit may be assembled
is input to BCD to 7-segment decoder/ then notes down his score (say Y1), using a multipurpose board. Fix the
driver IC3 which drives a common- after pressing switch S4, exactly display (LEDs and 7-segment display) on
anode display DIS1. However, you can in the same fashion as done by the first top of the cabinet along with the
read this number only when you press player. three switches. The supply voltage for
switch S4. 3. Player ‘X’ again presses switch S1 the circuit is 5V.

SIMPLE SENSITIVE REMOTE


CONTROL TESTER
HARISH KUMAR

H
ere is a handy gadget for test-
ing of infrared (IR) based re-
mote control transmitters used
for TVs and VCRs etc.
The IR signals from a remote control
transmitter are sensed by the IR sensor
module in the tester and its output at
pin 2 goes low. This in turn switches on
transistor T1 and causes LED1 to blink.
At the same time, the buzzer beeps at
the same rate as the incoming signals
from the remote control transmitter. The
pressing of different buttons on the re-
mote control will result in different pulse
rates which would change the rate at
which the LED blinks or the buzzer
beeps.
When no signal is sensed by the Capacitor C1 smoothes DC input are effectively grounded and do not inter-
sensor module, output pin 2 of the sen- while capacitor C2 suppresses any spikes fere with the functioning of the circuit.
sor goes high and, as a result, transistor appearing in the input supply. The proposed layout of the box containing
T1 switches off and hence LED1 and Proper grounding of the metal case the circuit is shown in the figure. The 9-
buzzer BZ1 go off. This circuit requires will ensure that the electromagnetic emis- volt DC supply from the eliminator can
5V regulated power supply which can be sions which are produced by tube-lights be fed into the jack using a banana-type
obtained from 9V eliminator and con- and electronic ballasts etc (which lie plug.
nected to the circuit through a jack. within the bandwidth of receiver circuit)

ELECTRONICS PROJECTS Vol. 20 149


ULTRA LOW DROP LINEAR
REGULATOR
P.S. SINI

T
he circuit is a MOSFET based output at slightly elevated minimum volt- will get triggered, pulling down the gate
linear voltage regulator with a age drop. Trimpot VR1 in the circuit is used voltage to ground, and thus limiting the
voltage drop of as low as 60 mV for fine adjustment of the output voltage. output current. The circuit will remain
at 1 ampere. Drop of a fewer millivolts is Combination of capacitor C5 and resistor latched in this state, and input voltage
possible with better MOSFETs having R2 provides er-
lower RDS(on) resistance. ror-amplifier
The circuit in Fig. 1 uses 15V-0-15V compensation.
secondary output from a step-down trans- The circuit is
former and employs an n-channel provided with a
MOSFET IRF540 to get the regulated 12V short-circuit
output from DC input, which could be as crow-bar protec-
low as 12.06V. The gate drive voltage re- tion to guard the
quired for the MOSFET is generated us- components
ing a voltage doubler circuit consisting of against over-
diodes D1 and D2 and capacitors C1 and stress during ac-
C4. To turn the MOSFET fully on, the cidental short at
gate terminal should be around 10V above the output. This
the source terminal which is connected to crow-bar protec- Fig. 2
the output here. The voltage doubler feeds tion will work as
this voltage to the gate through resistor follows: Under normal working conditions, has to be switched off to reset the circuit.
R1. Adjustable shunt regulator TL431 the voltage across capacitor C3 will be The circuit shown in Fig. 2 follows a
(IC2) is used here as an error amplifier, 6.3V and diode D5 will be in the off state similar scheme. It can be utilised when
and it dynamically adjusts the gate volt- since it will be reverse-biased with the the regulator has to work from a DC rail
age to maintain the regulation at the out- output voltage of 12V. However, during in place of 15V-0-15V AC supply. The gate
put. output short-circuit condition, the output voltage here is generated using an LM555
With adequate heatsink for the will momentarily drop, causing D5 to con- charge pump circuit as follows:
MOSFET, the circuit can provide up to 3A duct and the opto-triac MOC3011 (IC1) When 555 output is low, capacitor C2
will get charged through di-
ode D1 to the input voltage.
In the next half cycle, when
the 555 output goes high, ca-
pacitor C3 will get charged to
almost double the input volt-
age. The rest of the circuit
works in a similar fashion as
the circuit of Fig. 1.
The above circuits will help
reduce power-loss by allowing
to keep input voltage range to
the regulator low during ini-
tial design or even in existing
circuits. This will keep the out-
put regulated with relatively
low input voltage compared to
the conventional regulators.
The minimum voltage
drop can be further reduced
using low RDS(on) MOSFETs or
Fig. 1 by paralleling them.

150 ELECTRONICS PROJECTS Vol. 20


MAGNETIC PROXIMITY SWITCH
T.K. HAREENDRAN

H
ere is an interesting circuit for
a magnetic proximity switch
which can be used in various
applications.
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 re-
lay (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 prod-
ucts. The reed switch or relay to be used a consequence its output at pin 3 used. Note that the flip-flop is wired in
with this circuit should be the ‘normally goes high for a short duration and toggle mode with data input (pin 5) con-
open’ type. supplies clock to the clock input nected to the Q (pin 2) output. On receipt
When a magnet is brought/placed (pin 3) of IC2 (CD4013—dual D-type of clock pulse, the Q output at pin 1
in the vicinity of the sensor element flip-flop). LED D2 is used as a response changes from low to high state and due to
for a moment, the contacts of the indicator. this the relay driver transistor T1 gets
reed switch close to trigger timer This CMOS IC2 consists of two inde- forward-biased. As a result the relay RL1
IC1 wired in monostable mode. As pendent flip-flops though here only one is is energised.

SIMPLE LOW-COST
DIGITAL CODE LOCK
A. JEYABAL

M
any digital code lock circuits lock circuit is presented in this article. 2. Elimination of power amplifier tran-
have been published in this Here the keying-in code is rather unique. sistor to energise the relay.
magazine. In those circuits a Six switches are to be pressed to open 3. Low cost and small PCB size.
set of switches (conforming to code) are the lock, but only two switches at a time. An essential property of this electronic
pressed one by one within the specified Thus a total of three sets of switches code lock is that it works in monostable
time to open the lock. In some other cir- have to be pressed in a particular se- mode, i.e. once triggered, the output
cuits, custom-built ICs are used and posi- quence. (Of these three sets, one set is becomes high and remains so for a period
tive and negative logic pulses are keyed repeated.) The salient features of this of time, governed by the timing
in sequence as per the code by two circuit are: components, before returing to the quies-
switches to open the lock. 1. Use of 16 switches, which suggests cent low state. In this circuit, timer IC
A very simple low-cost digital code that there is a microprocessor inside. 555 with 8 pins is used. The IC is inex-

ELECTRONICS PROJECTS Vol. 20 151


pensive and easily available. Its pin 2 is these two switches, capacitor C3 starts code-switch pair S3-S4. These switches
the trigger input pin which, when held discharging through resistor R4. Capaci- connect the relay to output pin 3 and the
below 1/3 of the supply voltage, drives the tor C3 and resistor R4 are so selected relay is energised. The contacts of the relay
output to high state. The threshold pin 6, that it takes about five seconds to fully close and the solenoid pulls in the latch
when held higher than 2/3 of the supply discharge C3. (forming part of a lock) and the lock opens.
voltage, drives the output to low state. By Depressing switches S1 and S8 in uni- The remaining switches are connected be-
applying a low-going pulse to the reset son, within five seconds of releasing the tween reset pin 4 and ground. If any one of
pin 4, the output at pin 3 can be brought switches SA and SC, pulls pin 2 to ground these switches is pressed, the IC is reset
to the quiescent low level. Thus the reset and IC 555 is triggered. The capacitor C1 and the output goes to its quiescent low
pin 4 should be held high for normal op- starts charging through resistor R1. As a state. Possibilities of pressing these reset
eration of the IC. result, the output (pin 3) goes high for switches are more when a code breaker
Three sets of switches SA-SC, five seconds (i.e. the charging time T of tries to open the lock.
S1-S8 and S3-S4 are required to be the capacitor C1 to the threshold voltage, LED D5 indicates the presence of
pressed, in that order, to open the lock. which is calculated by the relation T=1.1 power supply while resistor R5 is a cur-
On pressing the switches SA and SC R1 x C1 seconds). rent limiting resistor.
simultaneously, capacitor C3 charges Within these five seconds, switches SA The given circuit can be recoded eas-
through the potential divider comprising and SC are to be pressed momentarily once ily by rearranging connections to the
resistors R3 and R4, and on releasing again, followed by the depression of last switches as desired by the user.

HAND PROXIMITY MUSICAL


TONE GENERATOR
RISHI KHATRI

T
his circuit generates a musical through a player’s hand will vary as the the sensor.
tone whose pitch varies as the hand’s distance varies from the sensor. The output of hand proximity detec-
distance of the hand from the sen- The sensor plate is connected to an tor is fed to IC2(a) which forms a voltage
sor varies. It consists of two stages: unstable op-amp IC1(a) (1/2 µA747) which controlled oscillator. The output of oscil-
1. Hand proximity detector oscillates at varying frequency in the lator at pin 12 of IC2 is a triangular
2. Oscillator and output stage neighbourhood of 20 kHz. This frequency wave whose frequency lies in the audio
The detector portion consists of a sen- lies in the slew rate limited range. Thus range. This output is fed into power stage
sor plate (10cm x 10cm) which can be output at pin 12 of IC1 is a triangular realised from µA741 (IC3) acting as a
made from an aluminium sheet, or we wave whose peak varies with frequency. voltage amplifier followed by a power
may use a circular loop (10cm in diam- This is followed by a peak detector wired stage which uses TIP 122 (npn) and
eter) made from an insulated copper or around IC1(b).The net output of proxim- TIP127(pnp) power Darlingtons connected
aluminium wire. The capacitance between ity detector is a voltage whose magnitude in class AB complementary push-pull con-
the sensor plate (or loop) and ground depends upon distance of hand from figuration. Their output is fed into an 8-

152 ELECTRONICS PROJECTS Vol. 20


ohm, 4W loudspeaker. The maximum out-
put thus obtained is 3.6W.
Log potentiometer VR2 (10 kilo-ohm)
can be used to adjust the volume. TIP122
and TIP127 should be mounted on sepa-
rate heat sinks or on the same heat sink
but should be isolated from the heat sink
using a mica sheet insulator.
Variable resistor VR1 is a 10k
linearly variable resistance. Its wiper
arm is varied and adjusted until loud-
speaker output lies in reasonable
frequency range and the sound is pleas-
ant to hear—with your hand and body
away from the sensor. Then as the hand
is brought near the sensor, the output
frequency decreases. Potmeter VR1
should, in fact, be so adjusted that the
output becomes zero when the hand is
brought extremely close to the sensor
(without touching it).

WIRELESS MUSICAL CALLING BELL


PRADEEP G.

M
usical and voice-generating has three terminals. One lead is con- Remote control receiver module
electronic calling bells are very nected to a compact 9V PP3 battery and VG40R is connected in input side of the
popular nowadays. These call- the other is connected to negative termi- musical bell as shown in the figure.
ing bells use a pair of wires between the nal of the battery. Central terminal is Dimensions of receiver module are
switch and bell circuit. The circuit idea connected to trigger switch as shown in 4.5cm x 2.1cm x 1.3cm. This module is
described here is for a remote wireless the diagram. The transmitter’s standby also sealed and has three external
calling bell which can work up to a dis- current is only 5 microamperes. Thus a terminals. One terminal is positive and
tance of about 15 metres. 9V PP3 battery would have a long life the other is negative across which a 3V
For wireless operation, a pair of sealed when used in this circuit. When micro battery is connected. The third terminal,
VHF remote control transmitter and switch S1 is pressed, a modulated signal the trigger terminal, is connected to
receiver modules have been employed. is transmitted which has a reception input of musical circuit as shown in the
Transmitter module VG40T is com- range of about 15 metres (50 feet) from diagram. Standby current drawn by
pact, measuring 3.4cm x 2.9cm x 1cm. It the transmitter module. the receiver module is about 300 micro-
amperes.
No PCB is required for the
transmitter because transmit-
ter module does not need any
external component. Transmit-
ter generates VHF signals of
about 300 MHz frequency. PCB
of musical section is freely
available from the components
vendors at a low cost. Modules
can be connected to the circuit
with a short length of flexible
Fig. 1: Transmitter Fig. 2: Receiver wire.
Connect a 9V PP3 battery

ELECTRONICS PROJECTS Vol. 20 153


to the transmitter and 3V battery to the will automatically stop. Depression of tunes can be heard. Transmitter and
receiver. Keep the transmitter at a dis- switch S1 on transmitter again will receiver-sealed modules have no antenna.
tance of about 5 metres. Press push generate the musical tone again. Without any antenna, a range of up to
switch S1 of transmitter for a moment. If UM3481/3482 ICs are used in the 15 metres is possible. Range will be
The music will be heard from the remote circuit, 12 different tunes can be heard. higher if the gadget is used in open
bell. After completing a musical note, it If CIC4822 IC is used, then up to 16 space.

Readers Comments: K. Venugopal can be connected to these modules


❑ In the call bell circuit, modules VG40T Cuddapah without opening their plastic moulding.
and VG40R have been used. Where can The author, Pradeep G. replies: These remote control modules are
these be procured from? Can an aerial be VG40T transmitter and VG40R available with leading component
attached to the circuit to extend the range receiver are scaled modules which have suppliers in metro cities, such as Visha
further? no antenna terminal. Thus no aerial Electronics, Mumbai.

SIMPLE TELEPHONE
PRIVACY CIRCUIT
RAJ K. GORKHALI

W
hen several telephone exten- ceasing conduction
sions use one telephone line when current is too low
pair, it becomes possible for an- to sustain it.
other extension user to overhear your con- Diacs permit the
versation. This very simple circuit arrange- ringing tone to pass,
ment prevents that possibility, cutting off since they conduct
all extensions except the one in use, with both ways as long as
no discernible effect on performance. peak voltage exceeds
As the diagram shows, each handset their break-over volt-
is connected via a diac. The telephone line age of ± 25V to 35V.
voltage is around 48V DC when all If an extension then
handsets are on hook and it drops to 6V to lifts its handset, breakdown occurs at to 10V.
10V DC when any one of the handsets is that diac and the extension is operative If two handsets are lifted simulta-
lifted. Diacs start to conduct when the since the diac is conducting with 6V now neously, the one with the diac of lower
applied voltage is above their breakover across it and with a current of around 20 breakover voltage will be activated. Thus
voltage of ± 25 to 35V DC and continue to mA through the handset. The other diacs at one time only one of the several exten-
conduct when voltage drops to a low level, cannot break over at this voltage of 6V sions become operative.

BIDIRECTIONAL CODE CONVERTER


P.R. NARAYANASWAMY

T
here are a number of codes in use code or vice versa using EXCLUSIVE OR and S1(b) are in position 1, the circuit
in digital systems. One such code (XOR) gates. Only the modes of connec- works as a binary-to-Gray code converter.
is the Gray code. A number in tion of the XOR gates differ. This is illus- In position 2 of these switches, it func-
natural binary can be converted to Gray trated in Fig. 1(a). When switches S1(a) tions as a Gray-to-binary code converter.

154 ELECTRONICS PROJECTS Vol. 20


The number of switches in- D5-D0 are the input code bits and Y5-Y0
creases with the increasing are the output code bits. When switch is
value of binary or Gray code in logic 1 position, the output at pins 4, 7,
input. 9 and 12 of 74LS157 correspond to input
These switches can be data bits D4 - D1 respectively, perform-
replaced by a 2-line to 1-line ing binary-to-Gray code conversion. When
multiplexer shown in Fig. switch S1 is flipped to logic 0, the outputs
1(b). In Fig. 1(b), when at pins 4, 7, 9 and 12 of IC1 correspond to
switch S1 is at logic 1, the output data bits Y4 - Y1 respectively, per-
forming Gray-to-binary code
conversion.
Fig. 2 shows a test circuit
which the author used for
testing of the code converter
using software (MICRO-
LOGIC II). For clarity and
simplicity in testing the
circuit using software MI-
CROLOGIC II, a four-bit in-
put code is used. The data in-
puts DATA4 to DATA1 are for
generating a four-bit input
code D3 - D0 ranging from 0
0 0 0 through 1 1 1 1 in as-
cending order. DATA5 in Fig.
2 simulates the switch S1 in
Fig. 1(c).
The simulation results
obtained are shown in Fig. 3.
When data S is at logic 0 (low)
upper AND gate is position, a Gray code input (Y3-Y0) of 0 1
enabled, perform- 1 1 results in corresponding binary output
ing binary-to-Gray (D3-D0) of 0 1 0 1. Similarly, when signal
code conversion. S is at logic 1 (high), a binary input (D3 -
When switch S1 is D0) of 0 1 1 1, results in the correspond-
flipped to logic 0, ing Gray code output (Y3 - Y0) of 0 1 0 0.
the lower AND When signal S was low and also when it
gate is enabled, was high, all other input codes and the
performing Gray- corresponding output codes were verified
to-binary code con- and found correct.
version. Simulation results indicate that the
A complete 6- code converter of Fig. 1(c) performs
bit code converter bi-directional code conversion. The code
using quad 2-line converter of Fig. 1(c) is thus an ideal
to 1-line multi- proposition. This is an interesting
plexer 74LS157 laboratory assignment for undergradu-
(IC1) is shown in ate degree curriculum in Electrical
Fig. 1(c). Data bits Engineering.

ELECTRONICS PROJECTS Vol. 20 155


PRIORITY INDICATOR
FOR QUIZ CONTESTS
SUSOBHAN DAS

I
n a quiz show, a contestant who press their buttons. The present circuit data lines of RAM against the current
presses his button before any other can be used for a maximum of four con- address (on its address lines A0 through
contestant gets the top priority for testants. A3). A sixth 74LS121 (IC10) is used for
answering the quiz. Similarly, the prior- The answer button allocated to each viewing/checking the contestants’ prior-
ity of the other contestants is decided by contestant is used in conjunction with a ity for answering the quiz and also for
the order in which each one presses his/ non-retriggerable monostable flip-flop clearing contents of the selected RAM lo-
her answer button. 74LS121. These mono flip-flop ICs (IC5 cation by writing 0000 against it.
In this circuit, the main role is played through IC8) function with switches S1 For understanding the circuit opera-
by IC3 (74LS89) which is a 64-bit RAM through S4 respectively. IC4, which is tion, assume that switch S7 is in normal
organised as 4-bit x 16-word array. It is again a 74LS121 flip-flop, is used for gen- position, switch S8 is open and counter
used for storing the sequence in which erating a write pulse (active low) for writ- IC2 (74LS93) is reset (with the help of
the contestants, during a quiz contest, ing the status (Q output logic level) on switch S6) so that all of its output pins

156 ELECTRONICS PROJECTS Vol. 20


are low. Thus initial address output of (IC9) when Q output of any of the four through L4). This happens because only
IC2 is 0000. This address (0) is also dis- flip-flops (IC5 through IC8) makes a that data output pin (5, 7, 9 or 11) which
played on 7-segment display after decod- transition from high to low. corresponds to the first depression of an
ing by IC1 (74LS47). This is the situation Now that the address has incremented answer button by a specific contestant
at the start of a fresh quiz. to 0001 at the output of 74LS93 (IC2), the would go to logic 0 and activate correspond-
At this stage if any competitor next depression of an answer button by a ing relay/bulb via its driver transistor (T1
presses his answer button, the concerned competitor has his data (logic 1) written through T4). The address of the concerned
74LS121 generates a single clock pulse against address 0001. The address line at contestant is simultaneously displayed on
at its Q output. This Q output is con- end of each depression of the switches (S1 7-segment display.
nected to a specific data line of IC3. through S4) increments by one so as to The address can be incremented by
Simultaneously Q output of the same enable writing of new data at an one by a momentary depression of switch
74LS121 IC causes output of IC9 (74LS20) incremented address. S5 to check the next contestant who
to go high and triggers IC4. The Q output When answering time allotted for a pressed his answer button next. After
of IC4 is used for writing the data present question is over, the person conducting the the round is over, switch S7 is to
on data lines at address 0000. The ad- quiz flips switch S7 to check position and be flipped to its normal position. Switch
dress which was being indicated on the resets counter output to 0000 using reset S8, which is optional, can be used for
display (0), gets incremented by one at switch S6. Now the contestant which had erasing RAM contents against the dis-
the trailing end of the pulse which pressed his button first would be indicated played locations by pressing switch S5
becomes available at the output of 74LS20 by lighting of the corresponding lamp (L1 momentarily.

DUAL-CHANNEL DIGITAL
VOLUME CONTROL
SHEENA K.

T
his circuit could be used for re- S1 and S2. To vary the pulse width of two quad bi-polar analogue switches in
placing your manual volume con- pulses from IC1, one may replace timing each of the two CD4066 ICs (IC3 and
trol in a stereo amplifier. In this resistor R1 with a variable resistor. IC4). Each of the output bits, when high,
circuit, push-to-on switch S1 controls the Operation of switch S1 (up) causes the short a part of the resistor network com-
forward (volume increase) operation of binary output to increment while opera- prising series resistors R6 through R9
both channels while a similar switch S2 tion of S2 (down) causes the binary output for one channel and R10 through R13
controls reverse (volume decrease) opera- to decrement. The maximum count being for the other channel, and thereby con-
tion of both channels. 15 (all outputs logic 1) and minimum trol the output of the audio signals be-
Here IC1 timer 555 is configured as count being 0 (all outputs logic 0), it re- ing fed to the inputs of stereo amplifier.
an astable flip-flop to provide low-fre- sults in maximum and minimum volume Push-to-on switch S3 is used for reset-
quency pulses to up/down clock input respectively. ting the output of counter to 0000, and
pins of pre-setable up/down counter The active high outputs A, B, C and thereby turning the volume of both chan-
74LS193 (IC2) via push-to-on switches D of the counter are used for controlling nels to the minimum level.

ELECTRONICS PROJECTS Vol. 20 157


WATER LEVEL CONTROLLER
CUM MOTOR PROTECTOR
RAMAKRISHNAN K.

N
owadays, usage of overhead tank latched by resistor R1 and transistor T1
(OHT) with an electrically oper- is biased to cut-off state, and hence both
ated water pump is a common relay RL1 and motor M are in off state.
sight. The pump, being a costly item, When we push switch S1 momentarily,
should be protected against damage due the input of inverter gate N1 becomes high
to high and low voltages. People find it and output of gate N2 also becomes high.
very inconvenient to switch off the pump As a result, transistor T1 turns on and both
even when their OHT starts overflowing, relay RL1 and motor are activated (pro-
specially when they are busy or it is rain- vided transistors T2 and T3 are forward
ing. This circuit provides a solution for all biased). When water level in OHT
such problems. The main features of this touches the sensors, input of N1 become
circuit are: low, which turns relay RL1 off and the
1. Low and high voltage cut-off motor stops. The motor can be turned off
2. Automatic switching off of motor manually also by pushing switch S2 at
when overhead tank is full any time. Transistors T2 and T3 are both
3. Use of convenient push-to-on but- forward biased if the line voltage is
tons for switching on and switching off of within certain low and high voltage limits, a pre-determined value, output of gate
motor. as explained below. N4 becomes high, which turns off
The heart of the circuit is IC CD4011, When the voltage level rises above a transistor T3 and relay RL1. Thus when
which has four inverter gates. When the pre-determined value, input to gate N3 the mains AC voltage (or the DC voltage
circuit gets 12V power supply, capacitor becomes high and its output become low, sample derived from mains) is above or
C1 pulls input of N1 low, and this causes which turns off transistor T2 and also the below certain limits, which could damage
the output of N2 to go low. This state is relay. When the voltage level drops below the pump motor, the supply to the motor
is cut-off.
D2 provides a constant DC voltage
to IC1.
For setting the low voltage cut-off,
adjust potmeter VR2 in such a way that
when supply voltage goes below 190V,
output of N4 goes high. Similarly, for
setting the high voltage cut-off, adjust
potmeter VR1 in such a way that when
supply voltage goes above 250V, output
of N3 goes low. The high and low cut-off
voltages can be changed according to
the requirement for a given motor.
Two wires are needed to connect the
circuit to the sensors which are fitted
in the OHT. Sensors must be fitted as
shown in figure. A simple power supply
circuit is also shown here. The circuit
can be assembled on a general-purpose
PCB and housed in an eliminator case
which is easily available in the market.
Use good-quality insulated wire to con-
nect sensor to the circuit.

158 ELECTRONICS PROJECTS Vol. 20


UNDER VOLTAGE CUT-OUT
AND DELAY FOR
REFRIGERATORS
S. CHANDRA SEKHAR

T
he circuits previously published, lished in various circuit ideas and also voltage through diode D6 and resistor R6.
and also those which are used in incorporated in the devices available in When the supply fails, capacitor C2
majority of voltage stabilisers sold the market. discharges through resistors R7 and R8
in the market, either use too many com- This circuit is most economical as and the base-emitter junction of transis-
ponents to perform what is after all a both the above-mentioned functions tor T3. If the supply is resumed after the
simple task, or perform this task badly, are implemented using only three tran- set time delay, capacitor C2 will be com-
or both. Some elaborate designs use 555 sistors, and needs only a single contact pletely discharged and transistor T3 would
timers and comparator ICs but the delay (N/O type) relay. Since the operating remain cut-off.
is present at the start of each power-up. forces are not shared amongst multiple If the supply resumes before capacitor
Other circuits implement the time contacts, the relay with a single C2 has been completely discharged,
delay correctly as the minimum time contact is sturdier than multiple contact transistor T3 turns on and clamps
between power off and power on. types. The time delay is entirely electronic, the base of transistor T2, preventing
That is, time delay is not executed if does not use relay contacts for switching it from turning on. The emitter current
the power failure lasts longer than and comes into operation only when of transistor T3 (about 200 microamperes)
the set time delay. But then, this type needed. is insufficient to actuate the relay.
of time delay uses relay contacts for When relay RL1 operates, its contacts When, after the required delay, transistor
switching the timing capacitor around - connect the supply voltage to the com- T3 turns off, the base of transistor
but the relay contacts designed pressor in the refrigerator. At the same T2 rises to the fraction of the supply
for high current do not switch time, capacitor C2 charges to the supply voltage set by preset VR1. If this voltage is
low voltages very
well. And slight
misalignment or
wear and tear of the
contacts is reflected
in erratic timing.
The circuit
presented here uses
the principle of
charging a capacitor
during the ‘on’ time
and discharging it
through a resistor
during the ‘off’ time.
This is implemented
electronically, avoid-
ing relay contacts.
Consequently, the
relay can be a simple
‘normally off’ type.
The rest of the circuit,
including the voltage
sensing part, is the
same as that pub-

ELECTRONICS PROJECTS Vol. 20 159


greater than 7.4 volts (zener voltage + VBE relay chatter because the supply voltage the supply voltage to a certain extent.
of transistor T2) then transistor T2 turns drops as the relay turns on. If over- Connecting a 12V, 250mW zener diode
on, applying forward bias to transistor T1, voltage cut-off is also desired, the across capacitor C2 will eliminate this
which drives the relay on. If this voltage required circuitry around transistor T4 dependence.
falls below 7.4V, transistor T2 will turn may be added. Preset VR2 may be ad- The circuit can be assembled on a
off, cutting off the base current of transis- justed such that transistor T4 conducts general-purpose PCB and conveniently
tor T1 which turns off, causing the relay to when the mains voltage reaches the over- wired into the refrigerator. This has
de-energise. Preset VR1 is used to adjust voltage level. This would cause the col- the advantage that the lamp inside the
the voltage corresponding to the mains lector of transistor T4 (and base of refrigerator is always operational, and
voltage, at which this happens. transistor T2) to be clamped to around that the compressor motor is protected
Resistors R3 and R4 introduce posi- 6V to cut-off transistors T2 and T1 and even if the thermostat turns off and on in
tive feedback for a certain amount of relay RL1. quick succession.
hysterisis. This is necessary to prevent The time delay is dependent on

INFRARED CORDLESS
HEADPHONE
PRADEEP G.

U
sing this low-cost project one can sistor amplifier to drive two series-con- LED1 in transmitter circuit functions as
reproduce audio from TV with- nected IR LEDs. An audio output a zener diode (0.65V) as well as supply-
out disturbing others. It does not transformer is used (in reverse) to couple on indicator.
use any wire connection between TV and audio output from TV to the IR transmit- IR receiver uses 3-stage transistor
headphones. In place of a pair of wires, it ter. Transistors T1 and T2 amplify amplifier. The first two transistors (T4
uses invisible infrared light to transmit the audio signals received from TV and T5) form audio signal amplifier while
audio signals from TV to headphones. through the audio transformer. Low- the third transistor T6 is used to drive a
Without using any lens, a range of up to impedance output windings (lower gauge headphone. Adjust potmeter VR2 for max.
6 metres is possible. Range can be ex- or thicker wires) are used for connection clarity.
tended by using lenses and reflectors with to TV side while high-impedance wind- Direct photo-transistor towards IR
IR sensors comprising transmitter and ings are connected to IR transmitter. LEDs of transmitter for max. range. A 9-
receiver. This IR transmitter can be powered from volt battery can be used with receiver for
IR transmitter uses two-stage tran- a 9-volt mains adapter or battery. Red portable operation.

160 ELECTRONICS PROJECTS Vol. 20


Readers Comments: my doubts. phototransistors. The part numbers are
❑ I have doubt on the audio output Sukanta Kumar Swain TS-8, PT-224, and SLT-15 flat head
transformer, as the rating was not men- Ganjam, Orissa (product brochure is available at
tioned on it. I used a 6V audio output EFY: You have correctly used the ‘www.microimpex.com’ of Mumbai). The
transformer. Also, the part number of 6V audio output transformer. There pin with a longer lead is normally the
the IR phototransistor in the receiver are a number of brands available collector and the pin with a shorter lead
was not mentioned. Please clear in the market. You can use 2-pin is the emitter.

STABILISER WITH AUTO


CUT-OFF ARRANGEMENT
S.C. DAS

S
tabilisers incorporating auto cut- 1. One relay with single changeover relay at serial No. 1.
off arrangement are manufac- contacts To operate the stabiliser, it is to be
tured by most of the reputed 2. One relay with two changeover con- plugged into a mains wall socket and
manufacturers using different methods. tacts the following sequence of operations is
The stabiliser circuit presented here 3. One start push-button, a DPDT to be performed:
makes use of the following major compo- changeover switch and a rotary switch Start push-button is momentarily
nents to provide the auto cut-off facility: 4. One bridge rectifier to energise the pressed so that the neutral line connec-

ELECTRONICS PROJECTS Vol. 20 161


tion to lower limb of auto-transformer is auto-transformer is connected to live relay RL1 energises while relay RL2
completed through it while the other limb point of the output socket via contacts of de-energises, cutting off supply to the
of auto-transformer is connected to live switch S3 and second set of normally- auto-transformer as well as the output
line through one of the contacts of the closed contacts of relay RL1. Note socket.
DPDT switch. The voltage developed that rotary switch is thrown to up Now the supply can be resumed only
across secondary of transformer X1 is position when mains voltage is higher after manual change of voltage tapping
available to the bridge rectifier via one than the required output voltage and it using rotary switch S4 and DPDT switch
set of normally-closed contacts of relay is flipped to down position when mains S3, or by varying the threshold voltage
RL1. As a result relay RL2 gets voltage is lower than the output voltage. level using preset VR1. Start switch is
energised to provide hold-on contacts The secondary of transformer X1 is again required to be pressed for getting
across start switch S1 to connect neutral also used to sample the output voltage. the output. This arrangement protects the
line to the neutral point of output When the output voltage exceeds a load against mains voltage variations
socket as well as the lower limb of auto- preset value, dependent upon the above the preset limit. (Note: Once ad-
transformer. The live line from the threshold value set by preset VR1, tran- justed, preset VR1 should not be fiddled
selected (by rotary switch S4) tap of the sistor T1 conducts and as a result with, unnecessarily.)

SIMPLE ANALOGUE-TO-
DIGITAL CONVERTER
B.P. LADGAONKAR

N
ormally analogue-to-digital con- here is configured around ADC 0808, (digitisation). This EOC output is coupled
verter (ADC) needs interfacing avoiding the use of a microprocessor. The to SC input, where falling edge of EOC
through a microprocessor to con- ADC 0808 is an 8-bit A-to-D converter, output acts as SC input to direct the ADC
vert analogue data into digital format. This having data output lines D0-D7. It works to start the next conversion.
requires additional hardware and neces- on the principle of successive approxima- As the conversion starts, EOC signal
sary software, resulting in increased com- tion. It has a total of eight analogue input goes high. At next clock pulse EOC out-
plexity and hence the total cost. channels, out of which any one can be se- put again goes low, and hence SC is en-
The circuit of A-to-D converter shown lected using address lines A, B and C. abled to start the next conversion. Thus,
Here, in this case, input chan- it provides continuous 8-bit digital output
nel IN0 is selected by ground- corresponding to instantaneous value of
ing A, B and C address lines. analogue input. The maximum level of
Usually the control signals analogue input voltage should be appro-
EOC (end of conversion), SC priately scaled down below positive refer-
(start conversion), ALE (ad- ence (+5V) level.
dress latch enable) and OE The ADC 0808 IC requires clock
(output enable) are interfaced signal of typically 550 kHz, which can
by means of a microprocessor. be easily derived from an astable
However, the circuit shown multivibrator constructed using 7404 in-
here is built to operate in its verter gates. In order to visualise the
continuous mode without using digital output, the row of eight LEDs
any microprocessor. Therefore (LED1 through LED8) have been used,
the input control signals wherein each LED is connected to respec-
ALE and OE, being active-high, tive data output lines D0 through D7.
are tied to Vcc (+5 volts). The Since ADC works in the continuous mode,
input control signal SC, being it displays digital output as soon as ana-
active-low, initiates start of logue input is applied. The decimal
conversion at falling edge of the equivalent digital output value D for a
pulse, whereas the output given analogue input voltage Vin can
signal EOC becomes high after be calculated from the relationship
completion of conversion

162 ELECTRONICS PROJECTS Vol. 20


SLEEP-SWITCH CUM
WAKE-UP TIMER
SHEENA K.

H
ere is a sleep-switch circuit that nary output as it counts up the input sistor T1 (normally conducting) when set
can be easily converted into a pulses and IC5 decodes/converts them to time is reached. When transistor T1 cuts
wake-up timer. A dual-mode time 1-of-10 outputs (units). Similarly, the IC6- off, its collector goes high to reset oscilla-
setting makes the system versatile. The IC7 pair provides tens output since IC6 tor IC1, and thus count at output of IC4
circuit is low-cost and can function as a clock input pin is connected to D output and IC6 gets locked. For resetting or
precise timer. pin of IC4. restarting, the power supply to the circuit
The heartbeat produced by IC1 is a Rotary switches S2 and S3 can be set should be switched off and then switched
sharp 1Hz square wave signal having a to select any time between either 0 to 99 on again.
duty cycle of 50 per cent. This is achieved seconds or 0 to 99 minutes, depending The BCD outputs of IC4 and IC6 are
by using a 4.194304MHz crystal in combi- upon the position of mode switch S1. converted to seven-segment outputs by
nation with discrete components around Switches S2 and S3 could also be replaced IC9 and IC10 to drive the units and tens
it. The 1Hz output of IC1 is connected to by thumb-wheel type switches or 10-posi- displays respectively for indicating
IC2 as well as one of the terminals of tion DIP switches with one of their side elapsed time continuously. The relay con-
switch S1. IC2 is configured as divide-by-6 terminals shorted together to serve as a tacts (normally open and normally closed)
counter while IC3 further divides the pole. Please note that IC5 and IC7 (74145) can be suitably used to energise or de-
output of IC2 by ten to produce one-minute have active low outputs. energise an alarm after the preset delay.
output at its pin 12. This is brought to the The outputs from switches S2 and S3 It can thus be used as wake-up alarm or
second terminal of two-way switch S1 to are input to a two-input OR gate inside sleep timer.
help select either the ‘minutes’ or the ‘sec- IC8 (7432) to obtain active low output on If you want to de-energise the relay,
onds’ mode of operation for IC4. completion of the set time delay to deacti- say after 30 minutes, then set switch S1
The decade counter IC4 provides bi- vate relay RL1 through relay driver tran- to minutes mode, S2 to 0 and S3 to 3, and

ELECTRONICS PROJECTS Vol. 20 163


then switch on the supply to the circuit. result, transistor T1 will be cut-off to de- to the minutes counter section compris-
After 30 minutes the outputs at poles of energise the relay. ing IC2 and IC3. Input clock for hours
switches S2 and S3 will go low and so One can easily add 0-99 hours capa- counter would be the minutes clock avail-
also the output of OR gate (IC8). As a bility by cascading two counters similar able at pin 12 of IC3.

CHARGE MONITOR FOR 12V


RECHARGEABLE LEAD-ACID BATTERY
SIDDHARTH SINGH AND SRINIVAS REDDY PINGLE

A
battery is a vital element of any 15 to 20 per cent. sophisticated method.
battery-backed system. In many It is therefore necessary for all con- Input from the battery under test is
cases the battery is more expen- cerned to monitor the charge level of their applied to LM3914 IC. This applied volt-
sive than the system it is backing up. batteries continuously. But, in practice, age is ranked anywhere between 0 and 10,
Hence we need to adopt all practical mea- many of the battery users are unable to depending upon its magnitude. The lower
sures to conserve battery life. do so because of non-availability of rea- reference voltage of 10.1V is ranked ‘0’ and
As per manufacturer’s data sheets, a sonably-priced monitoring equipment. The the upper voltage of 13.8V is ranked as
12V rechargeable lead-acid battery should circuit idea presented here will fill this ‘10.’ (Outputs 9 and 10 are logically ORed
be operated within 10.1V and 13.8V. When void by providing a circuit for monitoring in this circuit.) The calibration procedure
the battery charges higher than 13.8V it the charge level of lead-acid batteries con- of reference voltages is explained later.
is said to be overcharged, and when it tinuously. The circuit possesses two vital IC 74LS147 is a decimal-to-BCD pri-
discharges below 10.1V it can be deeply features: ority encoder which converts the output
discharged. A single event of overcharge • First, it reduces the requirement of of LM3914 into its BCD complement. The
or deep discharge can bring down the human attention by about 85 per cent. true BCD is obtained by using the hex
charge-holding capacity of a battery by • Second, it is a highly accurate and inverters inside IC 74LS04. This BCD

164 ELECTRONICS PROJECTS Vol. 20


output is displayed as a decimal digit charge falls to ten per cent. At this point it • Set the output of power supply
after conversion using IC5 (74LS247), is recommended that unnecessary load be source to 10.1V.
which is a BCD-to-seven-segment switched off and the remaining charge be • Connect the power supply source in
decoder/driver. The seven-segment LED conserved for more important purposes. place of the battery.
display (LTS-542) is used because it is Another simple combinational logic • Now the display will show some
easy to read compared to a bar graph or, circuit can also be designed that will sound reading. At this point vary preset VR2
for that matter, an analogue meter. The the buzzer when the display shows 9. Fur- until the reading on the display just
charge status of the battery can be ther charging should be stopped at this changes from 1 to 0.
quickly calculated from the display. For point in order to prevent overcharge. The higher reference voltage is cali-
instance, if the display shows 4, it means The circuit is powered by the battery brated similarly by setting the power sup-
that the battery is charged to 40 per under test, via a voltage regulator IC. The ply to 13.8V and varying preset VR1 until
cent of its maximum value of 13.8V. circuit takes about 100 mA for its opera- reading on the display just changes from
The use of digital principles enable us tion. 8 to 9.
to employ a buzzer that sounds whenever For calibrating the upper and lower After the calibration is completed, the
there is an overcharge or deep discharge, reference levels, a digital multimeter and circuit may be housed in a suitable enclo-
or there is a need to conserve battery a variable regulated power supply source sure. The cost of all the components,
charge. A buzzer is wired in the circuit are required. For calibrating the lower including the enclosure, would be around
such that it sounds whenever battery- reference voltage, follow the steps given: Rs 200.

WINDOW/FENCE CHARGER
T.K. HAREENDRAN

C
ircuit of a compact electrified win-
dow/fence charger is presented
here. The circuit is intended to
produce non-lethal mild shock to keep
away intruders.
It comprises transistors T1 and T2
which form an astable (free-running)
multivibrator with the associated resis-
tors and capacitors. The pulse repetition
rate is determined by the values of RC
time constant. With the component val-
ues used, it is about 6 Hz. The pulse
spacing can be increased by increasing
the values of resistors R3 and R4.
A high voltage generator is realised
with the help of an ordinary step-down
transformer and a medium-power tran- the pulse activity. and its output triggers switching
sistor which follows the astable When power is initially applied, ca- transistor T3. As a result, capacitor C3
multivibrator. Output of the astable pacitor C3 is charged through resistor is rapidly discharged via secondary wind-
multivibrator, from the collector of tran- R6. This RC network is used deliber- ing of transformer X1. Consequently, a
sistor T2, is directly connected to the base ately to limit the maximum output power high voltage is induced in the primary of
of switching transistor T3 to generate applied to the fence/window frame. At X1. At next pulse, the process repeats
high-amplitude pulses. LED D1 indicates the same time, oscillator starts working itself.

Readers Comments:
❑ The multivibrator stage comprising T3. Kindly suggest the required modifica- conduction of transistor T3 measures 0.8
transistors T1 and T2 works well, but when tions. volt (correct) and the circuit gave 150V
I connect the base of switching transistor J.T. Joglekar (peak) pulses at around 150ms intervals.
T3 (D313) to the collector of transistor T2, Nagpur On reducing the value of resistor R5 from
the collector voltage drops to 0.4 volt and EFY: We’ve retested the circuit and 4.7k to 1k, the pulse amplitude increased
and hence it is unable to drive transistor found that the collector voltage during to 250V (peak).

ELECTRONICS PROJECTS Vol. 20 165


CORDLESS PHONE
BACKUP
P.V. VINOD KUMAR

N
ormally the base of a cordless unit through diode D3. A green LED and the cost of the backup unit, includ-
phone has an adaptor and the is used to indicate the presence of AC ing the box and cells, would not exceed
handset has Ni-Cd cells for its mains. Rs 300. Hence the circuit is well worth
operation. The base unit becomes inop- Each Ni-Cd cell costs around Rs 34, the investment.
erative in case of power fail-
ure. Under such conditions, it
is better to provide a backup
using Ni-Cd cells externally.
Here is a simple power
supply back-up circuit which
can be used with cordless
phone SANYO CLT-420 or
similar sets.
The working is simple.
When AC mains is present,
Ni-Cd cells are charged
through IC LM317L, which
is wired as a current source.
Also, diode D3 is reverse-
biased, which keeps Ni-Cd cells
isolated from positive rail.
When AC mains goes off, the
Ni-Cd cells provide supply
to the cordless phone base

Readers Comments: From where can I get the cabinet to To improve the Ni-Cd cells’ life, they
❑ The Cordless Phone Backup circuit has house the circuit and the cells? should be charged and used. Charged
no protection circuitry to avoid overcharg- Abhay K. Changedia cells should not be stored for long
ing of cells. Can an LED be added to Pune periods (even three days). To keep the
indicate supply availability from the The author, P.V. Vinod Kumar, cells in good condition, they must be dis-
backup during a power failure? Please give replies: charged—once a month—by shorting
the details of LM317. Can I use this circuit I have designed the circuit for a cord- them with the parallel combination of
for a cordless phone which runs on 9V, less phone that runs on a 12V adaptor. To two 4.7-ohm, 10W resistors. This should
800mA? use my circuit with Sanyo CLT-6700, you be done periodically to erase the memory-
Tribikram Kar will need a new 12V adaptor. effect of Ni-Cd cells.
56 APO Inside the base unit of Sanyo CLT You can buy a plastic box from any
❑ My cordless, Sanyo CLT-6700, has a 420 cordless phone there is a 7805 regu- plastic shop to use it as a cabinet. It is
9V-250mA adapter. Please suggest a modi- lator. Hence, giving anything above 8V is better to make a battery pack rather
fication to this circuit so that I can use it sufficient for the base unit to operate. One than using cell holdres. To make one,
with my cordless phone. may use either a 12V adaptor or 8.4V Ni- solder and interconnect cells together to
The number of cells required, as Cd cells or 6AA cells. make the pack compact. Fold the cells
shown is 1.2V×7 (=8.4V) for a 12V adap- Keeping the simplicity and the cost of on a thick paper and tape them. Take
tor. Please explain how will it work with the circuit in mind. I have compromised out two leads for positive and negative
8.4V? on the cell-protection feature. connections.

166 ELECTRONICS PROJECTS Vol. 20


PC-BASED DICE GAME
V. RAJARAMAN

T
he dice has been used to deter- a good idea to use a buffer to prevent is taken from a look-up table. This acts as
mine one’s fortune from the ear- accidental damage to the PC. the translator between random number
liest days of civilisation. It has Arrange the seven LEDs on a vero- generator and display.
been used by gamblers, fortune tellers and board, or other suitable mounting plate If necessary, similar display unit can
statisticians alike. Dice made of wood, sil- exactly as per pattern shown in the fig- be connected to the second parallel port
ver, ivory, etc can be seen in many museums. ure. Connect the circuit to parallel port of the computer to simulate throwing of
A hi-tech die can be built around a designated LPT1 on the computer. If port two dice simultaneously. The modification
computer using a handful of LEDs and LPT2 is to be used, a minor modification necessary to the program is quite simple,
an IC, as shown in the figure. is necessary in the software. Just change and is left as an exercise for the reader.
Seven LEDs are arranged in the shape the line Good luck!
of the dots on a die. While a real die is a “#define PORT 0X378” to
“#define PORT 0X278” and the rest /* TEST.C */
#include <dos.h>
remains as it is. #include <stdio.h>
There is a small test program TEST.C #include <conio.h>
written using Borland C to test the inter- #include <stdlib.h>
#define PORT 0X378
face. Switch on 5V power supply and run main ()
the test program. Every time you press a {
key, LEDs 1 through 7 light up one by int i;
for (i=1; i < 0X7F; i *=2)
one, in the same order. This order is im- {
cube having six faces, this electronic die portant—otherwise the circuit will work printf (“Press any key…\n”)’
outportb (PORT, ~i);
has a single face, on which the dot pattern but the dot pattern on the die will not be getch ();
would change dynamically. consistent. Recheck the connections if }
These LEDs are activated using the these appear out of order. outportb (PORT, 0XFF);
}
parallel port of a PC. The interface circuit Now we are ready to test our fortune.
necessary for this is given in the figure. It Run the program DICE.C and press any /* DICE.C */
comprises seven LEDs connected to buffer/ key. With every key-stroke your die will #include <dos.h>
#include <stdio.h>
driver IC 74245 through current-limiting appear to roll. Finally, when it settles #include <conio.h>
resistors. down, it displays a random digit, between #include <stdlib.h>
#define PORT 0X378
The buffer helps to protect the com- one and six. Press ESC to terminate the #define ESC 0X1B
puter circuitry in case something goes program. int code[6] = {0XBF, 0XF3, 0X9E, 0XD2, 0X92,
wrong with this circuit. Whenever a home- The program makes use of the ran- 0XC0};
void run();
made gadget is connected to the PC, it is dom () function of the compiler to gener- main()
ate the pseudo random number. The com- {
int number;
puter, using some fixed algorithm, gen- printf (“press any key to throw the die. ESC to
erates this number. In this sense it is not exit…\n”);
strictly ‘random,’ since a true random randomize (); /* initialize the generator */
while (getch() !=ESC)
number is completely unpredictable, and {
cannot be generated by any mathemati- number = random(6);
cal formula! That is why it is called a printf (“%4d”,number+1);
run ();
pseudo random number. But do not worry, outportb (PORT, code [number]);
this level of randomness is sufficient for }
all day-to-day needs. outportb (PORT, 0XFF); /* all off */
}
To make it even more random, we have /*———————————————————*/
used the randomise () function. This takes void run ()
{
a clue from the real-time clock of the com- /* create running LEDs effect */
puter to initialise or ‘seed’ the random int i;
number generator. So we are assured that for (i=1; i < 0X7F; i *=2)
{
each time the program is started, we get a outporb (PORT, ~i);
different sequence of digits. delay (200);
Note how the bit pattern necessary to }
}
light the different combinations of LEDs /*———————————————————*/

ELECTRONICS PROJECTS Vol. 20 167


TELEREMOTE CONTROL
R.G. KALE

H
ere is a teleremote cir-
cuit which enables
switching ‘on’ and ‘off’ of
appliances through telephone lines.
It can be used to switch appliances
from any distance, overcoming the
limited range of infrared and radio
remote controls.
The circuit can be used to
switch up to nine appliances (cor-
responding to the digits 1 through
9 of the telephone key-pad). The
DTMF signals on telephone instru-
ment are used as control signals.
The digit ‘0’ in DTMF mode is used
to toggle between the appliance
mode and normal telephone opera-
tion mode. Thus the telephone can
be used to switch on or switch off
the appliances also while being
used for normal conversation.
The circuit uses IC KT3170
(DTMF-to-BCD converter), 74154
(4-to-16-line demult-iplexer), and
five CD4013 (D flip-flop) ICs. The
working of the circuit is as
follows.
Once a call is established (af-
ter hearing ring-back tone), dial
‘0’ in DTMF mode. IC1 decodes
this as ‘1010,’ which is further
demultiplexed by IC2 as output O10
(at pin 11) of IC2 (74154). The ac-
tive low output of IC2, after inver-
sion by an inverter gate of IC3
(CD4049), becomes logic 1. This is
used to toggle flip-flop-1 (F/F-1)
and relay RL1 is energised. Relay
RL1 has two changeover contacts,
RL1(a) and RL1(b). The energised
RL1(a) contacts provide a 220-ohm
loop across the telephone line
while RL1(b) contacts inject a
10kHz tone on the line, which in-
dicates to the caller that appliance
mode has been selected. The 220-
ohm loop on telephone line discon-
nects the ringer from the telephone
line in the exchange. The line is

168 ELECTRONICS PROJECTS Vol. 20


now connected for appliance mode of op- output, after inversion by a CD4049 the 220-ohm loop resistance and 10kHz
eration. inverter gate, goes to logic 1 state. tone needs to be removed from the tel-
If digit ‘0’ is not dialed (in DTMF) This pulse toggles the corresponding ephone line. To achieve this, digit ‘0’ (in
after establishing the call, the ring con- flip-flop to alternate state. The flip-flop DTMF mode) is dialed again to toggle flip-
tinues and the telephone can be used for output is used to drive a relay (RL2) flop-1 to de-energise relay RL1, which
normal conversation. After selection of the which can switch on or switch off the terminates the loop on line and the 10kHz
appliance mode of operation, if digit ‘1’ is appliance connected through its contacts. tone is also disconnected. The telephone
dialed, it is decoded by IC1 and By dialing other digits in a similar way, line is thus again set free to receive nor-
its output is ‘0001’. This BCD code other appliances can also be switched mal calls.
is then demultiplexed by 4-to-16-line ‘on’ or ‘off .’ This circuit is to be connected in par-
demultiplexer IC2 whose corresponding Once the switching operation is over, allel to the telephone instrument.

Readers Comments: for inverters and flip-flops are easily avail- the other may be used to send a beep
❏ 1. Can we get some confirmation that able, I suggest their use. tone on the line when the appliance turns
the state of the appliance has really 5. Instead of using separate driving on.
toggled? stages for the relays, I suggest the use of 2. Readers are welcome to make their
2. Can we include some electronic cheaply available relay driving IC ULN own modifications to the circuit—like in-
security system (such as code lock), 2003. cluding code lock.
so that only the owner can use this K.P. Deshmukh 3. IC UM66 may be used in place of
facility? Solapur the 10kHz oscillator.
3. Instead of the 10 kHz oscillator used The author R. G. Kale replies: 4 & 5. I agree with the suggestions
for return tone, can the three-pin melodi- 1. Relays with two changeovers may put forward by the reader.
ous IC UM66 be used? be used for getting a confirmation about Keep the circuit disconnected while
4. In the circuit both TTL and CMOS the state of the appliance. One changeover making outgoing calls to prevent un-
ICs have been used. As TTL counterparts contact may be used for the appliance and wanted switching of the devices.

DISPLAY DIALED TELEPHONE


NUMBER USING CALCULATOR
SMIT KAPILA

S
ometimes, while dialing a num- of the ribbon cable. Thereafter, connect it the telephone circuitry so that it does not
ber on the telephone, we may back to the telephone circuitry as shown affect the working of the calculator—since
press a wrong key, but by using in Fig. 1. The resistors are used to buffer
a simple calcu-
lator’s display
we can check
whether the di-
aled number is
correct or not.
This can be done
as follows.
Disconnect
the ribbon cable
of the key-pad
from rest of the
telephone cir-
cuitry and insert
a series resis-
tance of 27 kilo-
ohm in all ten
(nine in some
key-pads) wires Fig. 1 Fig. 2

ELECTRONICS PROJECTS Vol. 20 169


telephone is a high voltage device while Two such connections joining keys connecting leads; no other circuit
calculator is a very sensitive device oper- labeled ‘0’ and ‘1’ on telephone set components are required. Care should
ating with low voltage. Now, take two and calculator are shown in Fig. 2. be taken that leads are not shorted
leads directly from each of the contacts of Other connections may also be made together.
the keys numbered ‘0’ through ‘9’ of the in a similar way for keys ‘2’ through ‘9.’ After the above-mentioned modifica-
telephone key-pad PCB and join them to The advantage of this circuit is that tion, you will observe that the dialed num-
corresponding keys of the calculator. it needs only 9 or 10 resistances and ber gets displayed on the calculator screen.

8253 PROGRAMMABLE
INTERVAL TIMER
JUNOMON ABRAHAM

T
he circuit presented here is based counter IC 8253. IC 8253 was primarily It contains three independent 16-bit
on the commercially available designed for use as an MCS-80 periph- counters that can operate in any one of
programmable interval timer/ eral, but is now used in conjunction with the six modes (refer Table II(C)). It can

TABLE I TABLE II(A) TABLE II(C)


System Addresses SC-Select Counter (bits D6 and D7) M-mode bits (D1, D2, and D3)
A1 A0 Selects SC1 SC0 Description M2 M1 M0 Description
0 0 Counter 0 0 0 Select Counter 0 0 0 0 Mode 0: Interrupt on
0 1 Counter 1 0 1 Select Counter 1 terminal count
1 0 Counter 2 1 0 Select Counter 2 0 0 1 Mode 1: Hardware one shot
1 1 Control Word Register 1 1 Read Back Command X 1 0 Mode 2: Pulse generator
X 1 1 Mode 3: Square wave
almost all 8-bit microprocessors. generator
TABLE II Using this circuit we can study 1 0 0 Mode 4: Software triggered
Control Word Byte the operation of 8253 IC. strobe
D7 D6 D5 D4 D3 D2 D1 D0 1 0 1 Mode 5: Hardware
A long-time interval timer can triggered strobe
SC1 SCO RW1 RWO M2 M1 MO BCD also be constructed using this IC.

170 ELECTRONICS PROJECTS Vol. 20


TABLE II(D) TABLE III initially low, and after the terminal count
BCD or Binary (bit D0) C4 R15 Clock frequency the counter output goes high.
10µ 18k 2.5 Hz Mode 2 (Rate generator). Control
Value Description word: 74H
1µ 18k 25 Hz
0 Binary counter, 16 bits 100n 18k 250 Hz When a count is loaded, the output
1 Binary coded decimal counter, 10n 18k 2.5 kHz stays high until the count reaches ‘1’ and
4 decades 1n 18k 25 kHz
then goes low for one clock period.
operate with clock frequencies ranging using switches S4 to S11. Mode 3 (Square wave generator). Con-
from a few hertz to 2 MHz. 3. Enter the control word into control trol word: 76H
To initialise the counter, the follow- word register by depressing S1 momen- In this mode input frequency is di-
ing sequential steps are necessary: tarily. vided by the count word that is loaded in
1. Write a control word into its con- 4. Select counter 1 using switch S3 the counter registor.
trol word register. The control word de- (‘on’) . Note that address of counter 1 is Mode 4 (Software triggered strobe).
cides the selection of a specific counter 01 binary as per Table II(A). Control word: 78H
(number 0 or 1 or 2), its mode of opera- 5. Select lower order byte of count In this mode output is initially high,
tion, loading sequence of the count, and word using switches S4 through S11. and it goes low for one clock period at the
selection of binary or BCD counting mode. 6. Enter the lower order byte of count end of the count.
2. Load the lower order byte of the word into counter 1 by depressing S1 mo- Please note that if we want to enter a
count word in the counter register. mentarily. number into the counter register, that
3. Load the higher order byte of the 7. Select the higher order byte of count number is first converted to binary for-
count word in the counter register. word using switches S4 to S11. mat and then loaded into the counter
The abovementioned functions are 8. Enter the higher order byte of count register. Timer 555 is used here in
realised in the following manner: word into counter 1 by depressing S1. monostable mode for generating write sig-
1. Select the control word register us- Out of six possible modes of opera- nal. The value of capacitor C5 to be used
ing switches S2 and S3 (both ‘on’) because tion, as shown in Table II(C), only four with timing resistor R15 (18 kilo-ohm) for
the address of control word register is 11 modes are discussed here: realising different clock frequencies is
binary (i.e. A0 = 1, A1 = 1) as given in Mode 0 (Interrupt on terminal count). given in Table III. The circuit can be
Table I. Control word: 70 H easily assembled on a general-purpose
2. Form control word byte of Table II In this mode the counter output is PCB.

LOW-COST TRANSISTORISED
INTERCOM
PRADEEP G.

S
everal intercom circuits have ap-
peared in EFY using integrated
circuits. The circuit described here
uses three easily available transistors
only. Even a beginner can easily assemble
it on a piece of veroboard.
The circuit comprises a 3-stage resis-
tor-capacitor coupled amplifier. When ring
button S2 is
pressed, the ampli-
fier circuit formed
around transistors
T1 and T2 gets con-
verted into an asym-
metrical astable
multivib-rator gen-
erating ring signals. transistor T3 to drive the speaker of ear- is 10 to 15 mA only. Thus a 9-volt PP3
These ring signals piece. battery would have a long life, when used
are amplified by Current consumption of this intercom in this circuit.

ELECTRONICS PROJECTS Vol. 20 171


For making a two-way supply and ground terminals of both the
intercom, two identical units together.
units, as shown in figure, The complete circuit, along with
are required to be used. microphone and earpiece etc, can be
Output of one amplifier housed inside the plastic body of a toy
unit goes to speaker of the cellphone, which is easily available in
other unit, and vice versa. the market. Suggested cellphone cabi-
For single-battery opera- net, with the position of switches, speak-
tion, join corresponding ers and mike etc is shown.

AUTOMATICALLY CONTROLLED
STREET LIGHTS
YOGESH PRASAD

T
he circuit given here
can be used for
automatically
switching ‘on’ and switching
‘off’ the streetlights at ap-
propriate time. The circuit
uses a light-dependent 6
photo-resistor (LDR) as the
sensor whose resistance
changes in accordance with
the surrounding light’s in-
tensity. The circuit is so ad-
justed that when it turns
dark, the relay is energised
and the lights are switched
on, and during daylight they
go off automatically. The
LDR used should have a
‘dark’ resistance of about 15
mega-ohms, which may drop
to around 15 kilo-ohms in
bright daylight.
The LDR is
used in conjunc-
tion with a compa-
rator (IC LM311).
When it gets dark,
the voltage across *
the LDR increases
and thus voltage
VA>VT (refer cir-
cuit), and so the
output of the com-
parator goes high. *
This in turn for- *

172 ELECTRONICS PROJECTS Vol. 20


ward biases relay driver transistor SL100 shown in Fig. 2, isolation transformer ness level at which you want to switch on
and the relay gets energised. As a result X2, fed by a 555 astable multivibrator, is the lights. If initially the relay is ener-
the lights are switched on. When there is used to generate isolated DC supply gised and lights are on, adjust preset VR2
bright daylight, the VDR resistance drops across secondary of transformer X2. The such that they go off. Now trim preset
and VA<VT. This causes the output of com- presets VR1 and VR2 are used for cali- VR2 such that the lights just come on at
parator to go low. As a result the base bration. Diode D6 is used to protect the the same preset level.
drive to SL100 also goes low and the relay transistor from inductive kick, while After the system has been calibrated,
de-energises and the lights go off. diode D5 (Fig. 2) is used as rectifier. the circuit should be so placed that
Opto-coupler MCT2E is used for isola- After the circuit is assembled, it is the light from the sources controlled by
tion of the relay driver and the mains required to be calibrated as follows: the circuit do not interfere with the LDR
operated part of the circuit from rest of the 1. Adjust the voltage at point VT to operation. The LDR should be so placed
circuit. The DC supplies for both parts of about 11.50V by adjusting preset VR1. that it is surrounded by the natural light
the circuit are also similarly isolated. As 2. Now keep the LDR at the dark- sources.

TIMER FOR STUDENTS


K.K. MURTY

T
hese are the days of competitive alarm can be reset for a fresh start. piezo-buzzer becomes active and gives
examinations. Nowadays, stu- The heart of the circuit is a CMOS IC out a tone. This buzzer also beeps for a
dents are required to answer a set CD 4060. It has a built-in oscillator and a few seconds at half the set time. Transis-
of objective type of questions in a given 14-stage divider, wherein the basic oscil- tor T1 prevents further oscillations after
time which may extend to 15 minutes, 30 lator frequency is divided by 16,384. Here the elapsed time. Red LED1 is used as
minutes, or one hour. Speed and accuracy the oscillator frequency may be set using activity indicator.
win the race. Practice helps in achieving potmeter VR1 (in series with resistor R1) For simplicity, 6-volt supply is chosen
it. and capacitor C1. Potmeter VR1 is ad- for operation of the circuit. To obtain 6V
Here is a timer that gives an alarm justed for a time period of 15 minutes at supply one may either use five Ni-Cd cells
after a preset time of 30 minutes. It also output Q12 (pin 2). The output Q13 (pin 3) or four dry cells. A charger circuit is not
gives out a few beeps at half the selected will go ‘high’ after 30 minutes. Use a multi- included here as a host of charger circuits
time period. The timer could be pro- turn potmeter for better accuracy. have appeared in EFY on and off.
grammed for other periods as well. The When Q13 goes high, the 3-terminal However, you may use a standard bridge

Y1

Y2
Y3

ELECTRONICS PROJECTS Vol. 20 173


rectifier with 7806 as regulator for the is active. then you have an optional 555 circuit
power supply and charger. Piezo-electric buzzers are reliable, wired up as an astable multivibrator. This
Pressing the reset button momentarily rugged, and serve as cheap audio alarms. can be brought into operation by shorting
pulls all the internal counters of CD4060 They are available for operation in con- points x-x in the circuit. But then the
to zero and the timer starts again. The tinuous and intermittent modes, and also piezo buzzer needs to be disconnected from
timer is reliable, accurate, and consumes with musical notes. However, if you re- the circuit at the points marked Y1, Y2
about 10 mA of current when the buzzer quire louder sound, say for a classroom, and Y3.

PROTECTING THREE-PHASE
INDUCTION MOTORS
ANKUR BAL

D
amage to induction motor is rangement. For the purpose of explana-
mostly caused by unchecked op- tion, let us assume that blue (B) phase is
eration during single-phase fail- missing. Since none of the three relays
ure. In case of a single-phase blackout, can energise, none of the phase outputs
the motor continues to run on the remain- is available. Now, if yellow (Y) phase is
ing two phases, endangering the windings. missing, relay RL3 will not energise, and
The given arrangement of three relays, thus yellow and blue phase output will
as shown in the figure, disconnects the not be available. Similarly, if red (R)
remaining two phases in the event of a phase is missing, relay RL2 will not en-
single-phase failure, thus stopping and ergise, and thus red and yellow phase out-
protecting the motor. One of the three puts will not be available. The motor
phases may still remain connected to the resumes normal operation automatically
motor, but that is not much cause for con- as soon as all the three phases are re-
cern because of the absence of a rotating stored.
magnetic field in the motor. 230-volt AC relays, with appropriate
Three 230-volt relays with single contact ratings, should be selected (de-
changeover contacts are used in this ar- pending on motor ratings).

RADIO REMOTE CONTROL


PRADEEP G.

T
his Electronic Project volume shown in Fig. 1, ter. It can transmit signals up to 15
contains a circuit idea “Wireless which just meas- metres without any aerial. The operating
Musical Calling Bell” which is uses ures 34 mm x 29 frequency of the transmitter is around
VG40T and VG40R VHF remote control mm x 10 mm, can 300 MHz. The following circuits, using
modules. be used to operate VG40R remote control receiver module
After its publication many readers all remote control (measuring 45 mm x 21 mm x 13 mm),
wanted to develop remote control switches receiver-cum- can be used to:
to control mains load using these compact, switch combina- (a) activate a relay momentarily,
sealed VHF remote control modules. A tions described in (b) activate a relay for a preset pe-
few designs for remote control switches, this project. A com- riod,
using VG40T and VG40R remote control pact 9-volt PP3 (c) switch on and switch off a load.
pair, are shown here. battery can be used To activate a relay momentarily (see
The miniature transmitter module Fig. 1 with the transmit- Fig. 2), the switch on the transmitter unit

174 ELECTRONICS PROJECTS Vol. 20


Fig. 2

Fig. 3
is pressed, and correspondingly
a positive voltage is obtained at
output pin of VG40R module.
This voltage is used to biasing
the relay driver transistor. The
relay gets activated by just press-
ing push-to-on micro switch on
the transmitter unit. The relay
remains energised as long as the
switch remains pressed. When
the switch is released, the relay
gets deactivated. Any electrical/
electronic load can be connected
via N/O contacts of the relay.
To activate a relay for a pre-
set period (refer Fig. 3), the switch
on the transmitter unit is pressed
Fig. 4
momentarily. The transistor gets
base bias from VG40R module.
As a result the transistor conducts and ter 4017 IC are used. Here the 4017 IC is To switch off the relay, press the transmit-
applies a trigger pulse to IC 555, which is wired as a flip-flop for toggle action. This ter switch again. This process can be re-
wired as a monostable multivibrator. The is achieved by connecting Q2 output to peated. Time delay of monostable
relay remains activated for the preset time reset terminal while Q1 output is unused. multivibrator is set for about one second.
is determined by the pulse width of the Q0 output of IC2 is used for energising the Note: Short length of shielded wire
monostable multivibrator. Time delay can relay. The relay is activated and deacti- should be used between VG40R receiver
be varied from a few seconds to a few vated by pressing the transmitter switch module output and the rest of the circuit.
minutes by adjusting timing components. alternately. So, to activate the load, just The transmitter with 9V battery must be
To switch on and switch off a load press the transmitter switch once, mo- housed inside a nonmetallic (say, plastic)
(refer Fig. 4), a 555 IC and a decade coun- mentarily. The relay will remain activated. cabinet for maximum range of operation.

SEQUENTIAL CARD SCANNER


GIRISH JADHAV

T
his circuit of a sequential card corresponding LDRs if there is no hole IC chips, a CD4017B CMOS decade coun-
scanner can be used for any type (cut) on the card at the specific position, ter, a CD4043B SR latch, and a few other
of control application. The card, and vice versa. The resulting output from discrete components. The timer IC1
when inserted into its slot, will get aligned the scanner can be used for control appli- configured as an astable flip-flop, gener-
in such a fashion that light from the scan- cations. ates the clock for the CD4017B. An LED is
ning LEDs will be blocked from falling on The circuit consists of five NE555 timer connected at the timer output (pin 3) for

ELECTRONICS PROJECTS Vol. 20 175


monitoring the activity.
These clock pulses are fed
to clock pin 14 of the di-
vide-by-10 Johnson coun-
ter CD4017.
For the first clock
pulse, Q0 output will be
high, and for the second
clock pulse, Q1 output
will be high, and so on.
Outputs Q0 through Q3
of CD4017B are used as
control signals for quad
bilateral switches inside
CD4066 (IC3) while Q4
output is used for indica-
tion purpose as follows:
• When LED6 is ON:
It indicates that the scan-
ning is complete.
• When LED6 is
OFF: It indicates that the
scanning process is not
completed.
To understand the op-
eration of the circuit, as-
sume that the card is in
the card slot. Now press
the reset button for about
a second. During reset all
the monostable flip-flops
(IC4 through IC7) remain
in triggered state and
their outputs are high.
The outputs of inverters
N1 through N4 connected
to set pins of CD4043 are
at logic 0 while reset pins
(3, 7, 11 and 15) are con-
nected to Vcc via a reset
switch. As a result, all
outputs (A, B, C and D) of
CD4043 are 0000 on re-
set. (Please refer to the
truth table of CD4043 in Function Table of CD4043
this connection.) On re- Inputs Output
leasing the reset button, Eo Sn Rn On
further operation takes L X X Z
H L H L
place as follows: H H X H
During the first clock H L L Latched
pulse, Q0 will be logic Z=high impedence state
high, and this output, X=state immaterial
when applied as a con- L=low level
H=high level
trol signal to E0 pin of
the bilateral switch,
causes Vcc (6 to 9V DC)
to be switched from Y0 to Z0. This will tion in retriggerable mode. Its output at ohm resistor R13; a low level at set pin
cause LED1 to be lighted. Now, suppos- pin 3 will remain high or the output of does not change the output, and thus A
ing that no cut in the card exists at that inverter gate N1 will remain low. With output remains low. On the other hand,
position, the LDR resistance will be high reset pins (3, 7, 11 and 15) of all latches if there was a hole/cut in the card be-
and monostable flip-flop IC4 will func- of CD4043 are pulled low via 10-kilo- tween LED1 and LDR1, the LDR1 resis-

176 ELECTRONICS PROJECTS Vol. 20


tance would drop during the tween LED2 and LDR2, output B will
pulse through LED1, causing output latch to high state, else it will remain
of IC4 to remain low or that of low. Similar operation will take place at
inverter gate N1 to be high during the third and fourth clock pulses, and
the pulse period. This would cause the outputs A, B, C and D will corre-
output A to remain latched in high spond to the hole/no-hole state at LED/
state. LDR position of the card. At fifth clock,
During second clock pulse, Q1 will IC2 alone is reset, and the above opera-
be logic high and this output, when tion keeps repeating without affecting
applied as a control signal to E1 pin the output as long as card remains in
of the bilateral switch, will cause the slot.
Vcc (6 to 9V DC) to be switched from Potentiometers VR1 through VR4 are
Y1 to Z1. This will light up LED2. If used to set proper triggering level at pin
there is a cut/hole in the card be- 2 of monostables IC4 through IC7.

DIVIDE-BY-N COUNTER
USING IC 7442
PRAMOD KUMAR

T
he combination of ICs 7490 and this circuit we can realise a divide-by-n ger less than ten using rotary switch S1.
7447 is normally used as decade counter. Selected output of IC 7442 is used For example, if one wants to use the
counter cum seven-segment de- to reset decade counter 7490. circuit as divided-by-4 counter, the pole of
coder/LED display driver. It advances from In the circuit diagram, timer IC 555 rotary switch should be kept on output Q4
‘0’ to ‘9’ after each clock pulse and the count is used in astable mode. Output of this of IC4. The display would advance from 0
can be displayed on a 7-segment common- IC is used as clock for IC 7490. The out- to 3. On next clock pulse the Q4 output of
anode LED display such as LT542. The put of IC 7490 is connected to IC 7447 IC4 would go high after inversion by IC5
count/display repeats itself after every and IC 7442 in the usual manner. Out- (7404) and reset counter IC 7490 to zero.
tenth pulse. On several occasions, one needs put of 7447 IC is used to drive common- As a result the display would not be able to
to reset the counter after n counts. This can- anode LED display LT542. Rotary switch show the number 4 for a perceptible period.
not be accomplished by the above-men- S1 selects one of the ten outputs of IC4 Hence the maximum number displayed
tioned pair of ICs 7490 and 7447 alone. (after inversion by IC5 or IC6 inverter appears to be one less than the selected
A method for tackling the problem with gates). Pole of switch S1 is wired to pins division factor. Similarly, when we select
the help of rotary switch S1 and an addi- 2 and 3 of IC 7490, which are reset pins. division-by-2, the counter will show 0 and
tional IC 7442 is shown in the circuit. With Now one can select division by any inte- 1 repetitively.

ELECTRONICS PROJECTS Vol. 20 177


DTMF REMOTE SWITCHING BOARD
DHURJATI SINHA

T
he DTMF (dual tone multi-
frequency) tone generator
chip UM95089 generally
used in telephony for tone dialing
(used here as part of remote IR
transmitter) and DTMF tone de- Fig. 1: Block diagram of DTMF remote switching board
coder (tone to 4-bit binary output) chip
CM8870 (used in remote switching board)
are at the heart of this circuit.
The tone generator chip UM 95089
(IC1) has the capability to generate 16
different pairs of tones with the help of
3.5795MHz quartz crystal, XTL1. A key
matrix type switching system has been
provided, for selecting a particular fre-
quency pair. The coresponding output
available at pin 16 of the IC1. This signal
is amplified and used for modulating in-
frared light with the help of transistor T1
and IR LED1.
The infrared signal is detected by the
infrared sensor, converted into electrical Fig. 2: IR transmitter

Fig. 3: IR remote switching board

178 ELECTRONICS PROJECTS Vol. 20


signals, and internally amplified in the IR specific frequency pair, for the duration, all even outputs of IC3 are used to set
receiver module. This amplified signal is the incoming signal is present. (switch on), and all odd outputs are used
then fed into pin 2 of the DTMF receiver Now these 16 outputs are grouped to reset (switch off) the latches and the
chip CM 8870 (IC2) and the 4-bit binary into eight pairs to control two quad S-R corresponding relays.
outputs B0, B1, B2, and B3 are available latches inside IC4 and IC5 (CD4043B). One can easily convert this IR-based
at pins 11 through 14. The binary signal The outputs of the latches are used to system to FM-based system by using tone
is further processed by the 4- to 16-line control the eight relays (RL1 through output from IC1 for modulating an FM
decoder chip IC3 (CD4514B), and one of RL8) via the relay driver transistors, transmitter, and in Fig. 2, IR receiver mod-
the pins (Q0 through Q15) goes high for a which finally drive the AC loads. Q0 and ule can be replaced by an FM receiver.

Readers Comments: are equivalent. ohm resistors at the output of IC2


❑ Please clarify my doubts: 2. Only rows and columns are to be and press sixteen different row-
1. Is IC TCM5089 equivalent to IC connected. To test the circuit, connect out- column combinations of the transmitter
UM95089 (IC1)? put pin 16 of IC1 through a capacitor to a circuit, one by one. The output status
2. In the transmitter circuit, should headphone or an audio amplifier line-in should change from 0000 to 1111. Next,
any row and column be shorted momen- terminal. Press one combination at a time. remove these LEDs and connect sixteen
tarily, or both be grounded momentarily? If DTMF tones are heard, the circuit is LEDs through 560-ohm resistors at
How can the working of the transmitter working correctly. the output of IC3. Press the sixteen com-
be tested? 3. Any ordinary IR sensor used in TV
3. Can any IR sensor used in TV cir- can be used. To check the working of the
cuits be substituted in this circuit? sensor, connect an LED temporarily be-
4. The output voltage of the IR sensor tween output and +5V. When transmitter
is continuously fluctuating between 5.25V switches are pressed, glowing of the LED
and 4.70V. Why? indicates the proper working of the sen-
5. Why are the relays connected to sor.
the emitters of transmitters? Can these 4. Fluctuation of voltage at various
be connected to the collectors? pins is possibly due to stray electric field.
6. How can the proper working of the As CMOS chips have been used, please
receiver be tested? shield the circuit.
Nitin S. Dighe 5. Relays may be connected to the Fig. 1: Connection of relays
Mumbai collectors of transistors, as shown in
Fig. 1. binations again. All the LEDs should
The author, Dhurjati Sinha, replies: 6. If IR detection is taking place cor- glow one by one. Do not solder these ICs
1. I am not aware whether both the ICs rectly, connect four LEDs through 560- directly; use IC bases.

ELECTRICAL EQUIPMENT CONTROL


USING PC
P.V. VINOD KUMAR

H
ere is a novel idea
for using the printer
port of a PC, for con-
trol application using soft-
ware and some interface
hardware. The interface cir-
cuit along with the given soft-
ware can be used with the
printer port of any PC for con-
trolling up to eight equip-
ment. for only one device, being controlled by
The interface circuit D0 bit at pin 2 of the 25-pin parallel port.
shown in the figure is drawn Identical circuits for the remaining data

ELECTRONICS PROJECTS Vol. 20 179


bits D1 through D7 (available at pins 3 the monitor will show the control panel— the ‘Q’ key for ON and ‘W’ key for OFF
through 9) have to be similarly wired. The with the control bar at the extreme left. operation. The monitor will show the sta-
use of opto-coupler ensures complete isola- The bar can be moved using the right and tus of the relevant switch by indicating ‘1’
tion of the PC from the relay driver cir- left arrow keys. Switching on/off of bits for ON and ‘0’ for OFF status of the switch.
cuitry. D0-D7 is done by bringing the bar over In addition, the current date and time is
When the program is loaded and run, the appropriate square and then pressing also displayed on the screen.

Program Listing in Basic


CLS : SCREEN 2 IF (J = 200) AND (X$ = “W” OR X$ = “w”) THEN GOSUB FATOF
KEY(1) ON: ON KEY(1) GOSUB FINIS IF (J = 240) AND (X$ = “Q” OR X$ = “q”) THEN GOSUB SILK
KEY(5) ON: ON KEY(5) GOSUB RETIRE IF (J = 240) AND (X$ = “W” OR X$ = “w”) THEN GOSUB SILKOF
KEY(10) ON: ON KEY(10) GOSUB ALLON IF (J = 280) AND (X$ = “Q” OR X$ = “q”) THEN GOSUB SEVEN
PORT% = &H378 IF (J = 280) AND (X$ = “W” OR X$ = “w”) THEN GOSUB SEVENOF
OUT PORT%, 0 IF (J = 320) AND (X$ = “Q” OR X$ = “q”) THEN GOSUB LAST
LOCATE 8, 10: PRINT “<— —>” IF (J = 320) AND (X$ = “W” OR X$ = “w”) THEN GOSUB LASTOF
V$ = STRING$(27, “❚”) GOTO STAT ‘————ALL THE SUBROUTINES ARE BELOW———
REM ❚ obtained by pressing CTRL+ATL+2+1+9 (ASCII) APPLE: SOUND 500, 2
LOCATE 5, 6: PRINT V$; SPC(1); “CONTROL PANEL”; SPC(2); V$ AA = 1
LINE (40, 31)-(600, 180), 1, B LOCATE 6, 50
LINE (40, 40)-(600, 180), 1, B Q = 1 OR N
LINE (40, 100)-(600, 120), 1, BF OUT PORT%, Q
LINE (140, 40)-(460, 110), 1, B RETURN
LOCATE 8, 65: PRINT “ON------Q” BAT: SOUND 500, 2
LOCATE 12, 65: PRINT “OFF-----W” SS = 1
LOCATE 19, 15: PRINT “F1”; SPC(24); “F5”; SPC(27); “F10” W = 2 OR N
LOCATE 21,10: PRINT “EMERGENCY OFF”; SPC(16); “LOGOUT”; OUT PORT%, W
SPC(24); “ALLON” RETURN
D$ = DATE$ TALE: SOUND 500, 2
J$ = LEFT$(D$, 2) DD = 1
K$ = MID$(D$, 4, 2) Q = 4 OR N
L$ = RIGHT$(D$, 4) OUT PORT%, Q
LOCATE 5, 7: PRINT SPC(1); K$; “–”; J$; L$; SPC(1); “” RETURN
STAT: FLAT: SOUND 500, 2
PSET (145, 85): DRAW “R20U10L20D10” FF = 1
PSET (185, 85): DRAW “R20U10L20D10” Q = 8 OR N
PSET (225, 85): DRAW “R20U10L20D10” OUT PORT%, Q
PSET (265, 85): DRAW “R20U10L20D10” RETURN
PSET (305, 85): DRAW “R20U10L20D10” FAT: SOUND 500, 2
PSET (345, 85): DRAW “R20U10L20D10” GG = 1
PSET (385, 85): DRAW “R20U10L20D10” Q = 16 OR N
PSET (425, 85): DRAW “R20U10L20D10” OUT PORT%, Q
T$ = TIME$ RETURN
Y$ = LEFT$(T$, 2) SILK: SOUND 500, 2
Y = VAL(Y$) HH = 1
IF Y < 12 THEN PP$ = “AM” ELSE PP$ = “PM” Q = 32 OR N
IF Y > 12 THEN Y = Y - 12 OUT PORT%, Q
U$ = MID$(T$, 3, 3) RETURN
LOCATE 5, 64: PRINT SPC(1); Y; U$; PP$; SPC(1); “” SEVEN: SOUND 500, 2
LOCATE 9, 20: PRINT “1”; SPC(4); “2”; SPC(4); “3”; SPC(4); “4”; SPC(4); JJ = 1
“5”; SPC(4); “6”; SPC(4); “7”; SPC(4); “8” Q = 64 OR N
LOCATE 12, 19: PRINT AA; SPC(2); SS; SPC(2); DD; SPC(2); FF; OUT PORT%, Q
SPC(2); GG; SPC(2); HH; SPC(2); JJ; SPC(2); KK RETURN
X$ = INKEY$ LAST: SOUND 500, 2
X$ = RIGHT$(X$, 1) KK = 1
N = INP(PORT%) Q = 128 OR N
IF X$ = “K” THEN J = J - 40 OUT PORT%, Q
IF X$ = “M” THEN J = J + 40 RETURN
PSET (J + 105, 85): DRAW “R20U10L20D10R2U10R2D10R2U10R2 TALEOF: SOUND 400, 1
D10R2U10R2D10R2U10R2D10R2U10R2D10” IF DD = 0 THEN RETURN
FOR T = 1 TO 400: NEXT DD = 0
PRESET (J + 105, 85): DRAW “R20U10L20D10R2U10R2D10R2U10R2 IF N = 4 THEN P = 0
D10R2U10R2D10R2U10R2D10R2U10R2D10” IF N < 4 THEN P = N
IF J + 105 < 105 THEN J = 0 IF N > 4 THEN P = N - 4
IF J >= 360 THEN J = 360 OUT PORT%, P
IF (J = 40) AND (X$ = “Q” OR X$ = “q”) THEN GOSUB APPLE RETURN
IF (J = 40) AND (X$ = “W” OR X$ = “w”) THEN GOSUB APPLEOF APPLEOF: SOUND 400, 1
IF (J = 80) AND (X$ = “Q” OR X$ = “q”) THEN GOSUB BAT IF AA = 0 THEN RETURN
IF (J = 80) AND (X$ = “W” OR X$ = “w”) THEN GOSUB BATOF AA = 0
IF (J = 120) AND (X$ = “Q” OR X$ = “q”) THEN GOSUB TALE IF N = 1 THEN I = 0
IF (J = 120) AND (X$ = “W” OR X$ = “w”) THEN GOSUB TALEOF IF N > 1 THEN I = N - 1
IF (J = 160) AND (X$ = “Q” OR X$ = “q”) THEN GOSUB FLAT OUT PORT%, I
IF (J = 160) AND (X$ = “W” OR X$ = “w”) THEN GOSUB FLATOF RETURN
IF (J = 200) AND (X$ = “Q” OR X$ = “q”) THEN GOSUB FAT BATOF: SOUND 400, 1

180 ELECTRONICS PROJECTS Vol. 20


IF SS = 0 THEN RETURN OUT PORT%, Y
SS = 0 RETURN
IF N = 2 THEN U = 0 SEVENOF: SOUND 400, 1
IF N > 2 THEN U = N - 2 IF JJ = 0 THEN RETURN
IF N < 2 THEN U = N JJ = 0
OUT PORT%, U IF N = 64 THEN U = 0
RETURN IF N < 64 THEN U = N
FLATOF: SOUND 400, 1 IF N > 64 THEN U = N - 64
IF FF = 0 THEN RETURN OUT PORT%, U
FF = 0 RETURN
IF N = 8 THEN E = 0 LASTOF: SOUND 400, 1
IF N < 8 THEN E = N IF KK = 0 THEN RETURN
IF N > 8 THEN E = N - 8 KK = 0
OUT PORT%, E IF N = 128 THEN Z = 0
RETURN IF N < 128 THEN Z = N
FATOF: SOUND 400, 1 IF N > 128 THEN Z = N - 128
IF GG = 0 THEN RETURN OUT PORT%, Z
GG = 0 RETURN
IF N = 16 THEN Y = 0 ALLON: SOUND 500, 4
IF N < 16 THEN Y = N OUT PORT%, 255
IF N > 16 THEN Y = N - 16 AA = 1: SS = 1: DD = 1: FF = 1: GG = 1: HH = 1: JJ = 1: KK = 1
OUT PORT%, Y RETURN
RETURN FINIS: SOUND 400, 2
SILKOF: SOUND 400, 1 OUT PORT%, 0
IF HH = 0 THEN RETURN AA = 0: SS = 0: DD = 0: FF = 0: GG = 0: HH = 0: JJ = 0: KK = 0
HH = 0 RETURN
IF N = 32 THEN Y = 0 RETIRE:
IF N < 32 THEN Y = N OUT PORT%, 0
IF N > 32 THEN Y = N - 32 END

LONG-RANGE FM TRANSMITTER
PRADEEP G.

S
everal circuits for constructing FM For better results, assemble the cir- (Note: No core (i.e. air core) is used
transmitters have been published cuit on a good-quality glass epoxy board for the above coils)
in EFY. The power output of most and house the transmitter inside an alu- L3 – 7 turns of 24 SWG wire close
of these circuits were very low because no minium case. Shield the oscillator stage wound with 3mm diameter air core.
power amplifier stages were incorporated. using an aluminium sheet. L4 – 7 turns of 24 SWG wire-wound
The transmitter circuit described here Coil winding details are given below: on a ferrite bead (as choke)
has an extra RF power amplifier stage, L1 – 4 turns of 20 SWG wire close Potentiometer VR1 is used to set the
after the oscillator stage, to raise the wound over 8mm diameter plastic former. centre frequency whereas potentiometer
power output to 200-250 milliwatts. With L2 – 2 turns of 24 SWG wire near top VR2 is used for power control. For hum-
a good matching 50-ohm ground—plane end of L1. free operation, operate the transmitter on
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
diode circuit is included to change the
frequency of the transmitter and to pro-
vide frequency modulation by audio sig-
nals. The output of the oscillator is about
50 milliwatts. Transistor T2 (2N3866)
forms a VHF-class A power amplifier. It
boosts the oscillator signals’ power four
to five times. Thus, 200-250 milliwatts of
power is generated at the collector of
transistor T2.

ELECTRONICS PROJECTS Vol. 20 181


a 12V rechargeable battery pack of 10 x antenna. Adjust both trimmers (VC1 and This transmitter should only be used
1.2-volt Ni-Cd cells. Transistor T2 must VC2) for maximum transmission power. for educational purposes. Regular trans-
be mounted on a heat sink. Do not switch Adjust potentiometer VR1 to set the cen- mission using such a transmitter without
on the transmitter without a matching tre frequency near 100 MHz. a licence is illegal in India.

Readers Comments: signals from the FM transmitter.


❑ Without licence, what is the maximum My prototype was tested using
power of FM transmission permissible in Philips two-band AM/FM pocket
India? What are the changes required if radio. The range of the transmit-
the range is to be limited to the permissi- ter is 1.5 km with a 70cm tel-
ble power? escopic antenna and 3 km with a
Can preamplified signal be directly three-element Yagi antenna.
given by replacing the condenser mic? An RF power amplifier using
What are the modifications required for transistor BD139 cannot be used
stereo transmission? in VHF range. It can be used in
M.P. Murugesan HF range only. For VHF amplifi-
Tuticorin cation, readily available transis-
❑ I would like the author to clarify the Fig. 1: VHF amplifier using transistor 2N3553 in class C mode tor 2N3553 can be used in class
following points: C mode, as shown in here in Fig.
1. Can a local Philips radio be used to for licensed hams. Allowed VHF trans- 1. The coil details are as follows:
receive the FM signals? mission frequency is 144 MHz (not 88- L1, L2 - 4 turns of 20 SWG wire, close
2. Is it possible to use an aerial in 108 MHz). By adjusting the number of would on 4mm dia air-core
place of multi-element Yagi antenna, with turns in the oscillator coil, frequency of L2 - 4 turns of 20 SWG wire, loose
a 50-ohm, half-watt resistor? transmitter can be increased to 144 MHz wound on 4mm dia air-core
3. Can an RF amplifier (made using (i.e. 2-metre Ham band). To limit the L4 - 3½ turns of 20 SWG wire, close
transistor BD139) be added to the circuit range below half kilometre, avoid ampli- wound on 4mm dia air-core
to increase the power output of the trans- fier stage wired around transistor Regarding Mr Agrawal’s letter:
mitter? 2N3866. Connect the aerial directly to col- EFY: For FM band frequencies (near
Tinkku lector terminal of oscillator transistor 100 MHz), you could use a half-wave
Bhagalpur BF494. dipole with intrinsic impedance of 72
❑ I could not achieve a range of more If audio signal from other sources are ohms or a 300-ohm folded dipole with
than 200 metres. Please help me. to be fed to the transmitter, eliminate reflectors and directors (as used for TV
Deepak Agrawal microphone biasing resistor. This trans- reception) to achieve higher gain/range.
Raipur mitter cannot be modified for stereo For directional design use horizontal di-
The author, Pradeep G. replies: broadcasting, which is much more com- pole/folded dipole, and for achieving omni-
In reply to Murugesan’s letter, I would plicated. directional characteristics use vertical di-
like to say: This transmitter can be used In reply to Tinkku's letter, I would pole/folded dipole. The line of shoot (di-
for education purposes. Transmission in like to say: Any radio receiver covering rection of maximum radiation) is at right
FM broadcast band is not allowed even FM broadcast band can be used to receive angle to the dipole.

PIEZO BUZZER FINDS MANY


APPLICATIONS
A. JEYABAL

P
iezo buzzer is a low-cost, low etc). Many of us think that its application transistor). This transistor acts as an elec-
power consuming, space-saving, is limited to sophisticated instruments and tronic switch.
PCB-mountable device. It can domestic appliances. However, many low- The piezo buzzer described here is of
work on a wide range of supply voltages— cost useful devices can be constructed by continuous type, and its construction
starting from 1.5V to 27V. It is a self- simply adding a transistor to it. This ex- would cost around Rs 20. When applying
oscillating handy sounder with a variety tra transistor provides the third high-im- more than 12V, please confirm its maxi-
of sound modes (continuous, intermittent, pedance control terminal (base of the mum supply voltage rating, as some buzz-

182 ELECTRONICS PROJECTS Vol. 20


ers have a maximum supply voltage rat- placing the prods across the capacitor. A
ing of 15V. beep sound of a small duration, for low-
Table buzzer. Fig. 1 shows the simple value capacitors, confirms that they are
buzzer circuit. Connect the buzzer to the in good condition. Higher-value capaci-
battery via push-to-on switch S1. Use a tors, which produce a long beep (gradu-
proper battery box or a battery holder. ally decreasing in sound level), are in a
Now it can be used as a simple table good condition. (For a 100µF capacitor, it
buzzer using 6V or 9V power supply, takes about one minute for the sound to
which is quite adequate. stop.) A non-stop sound means that the
Morse code sender. When switch S1 capacitor is short and no sound implies it
in Fig. 1 is replaced with a Morse key, it is open. While checking electrolytic ca- Fig. 4: Game of steady hands
immediately becomes a Morse code sender. pacitors, touch the positive lead of the
Press the key and enjoy sending Morse capacitor with the red prod and the nega- eter of the zig-zag rod. Connect the prods to
code. the wires A and B. Now try to take out the
Continuity checker. Connect tran- ring through the zig-zag rod. If the ring
sistor BC547 (T1) and a 68-kilo-ohm re- touches the rod, the buzzer beeps and the
sistor (R1) as depicted in Fig. 2. Touch contestant loses the chance and should
with the testing prods the points between start from the beginning. After taking out
which the continuity is to be checked. If the ring, another contestant may try to put
there is a connection between these the ring in its initial position, i.e. from top
points, base current flows through resis- to bottom. Use more than 3V power supply
tor R1 and the said points. In turn, the for higher sound output.
transistor conducts and the current flows Fig. 1: Simple buzzer circuit Water-level monitor. It is a boon for
through the buzzer and activates it. Us- an absent-minded person who
ing this continuity tester we can also can now use this circuit to
check milky lamps, tubelight filaments, fill his bathtub without wast-
chokes, coils, wires, and transformers for ing water. The buzzer sounds
continuity. Continuity checker can also when the tub is full and he
be used as ‘go/no-go’ resistor tester. Touch can immediately close the
the terminals of the resistor with prods. tap.
If the resistor is open, no sound will be For this, connect two
heard. The buzzer sounds for the good metal strips or metal spoons
one. Resistors of up to 1 meg-ohm can be to the prods and hang them
checked with this device. over the bathtub such that
Diode/LED tester and lead identi- Fig. 2: Continuity checker, diode, LED, transistor, and capacitor the tips of the spoons are at
fier. Touch the prods on the leads of a tester the required water level (Fig.
diode or LED. Interchange the prods and 5). When the water
test again. If the buzzer sounds during touches the spoons’
both the tests, the diode/LED is short. No base, current flows
sound implies the diode/LED is open. If it through transistor T1
sounds only during one of the tests, it (Fig. 2) and the buzzer
means the diode/LED is good. For a good sounds. Use a 6V or a
diode/LED, the buzzer sounds when the (a) (b)
9V power supply for
red prod and the black prod are touched rich sound.
to the anode and the cathode of the diode/ Fig. 3: Transistor testers Rain alarm.
LED respectively. Thus we can identify Etch the pattern shown in Fig. 6 on a
the leads as well. tive lead with the black prod. For all tests piece of copper-clad board. The pattern is
Transistor tester. For testing pur- and checks do not use more than 3V not critical but any rain drops that fall
poses, the transistor can be considered power supply to avoid damage to the com- anywhere on the board should join the
equivalent to two diodes connected back ponents being tested. two tracks. Veroboard can also be used by
to back and the common junction is base Game of steady hand. This game properly connecting the appropriate
(refer Fig. 3). Now check the transistor by tests one’s steadiness while taking out a tracks. Connect the two ends of the cop-
touching the red and the black prods as ring through a zig-zag rod without touch- per tracks to the prods. Place the board
per Table I. The table also lists the us- ing the rod with the ring. in a slanting position outside the premises
ability of the transistor from the observa- Take a rod of length 40 to 50 cm with where the rain drops can fall on it. When
tions made. Please note that power tran- 3mm diameter and bend it in a zig-zag it rains, the rain drops connect the two
sistors cannot be checked in this fashion shape as shown in Fig. 4 and fix it on a tracks to allow the base current to flow
as they are leaky and give wrong results. wooden block. Take another piece of simi- into transistor T1 and the alarm sounds.
Capacitor checker. Capacitors of lar rod and bend it in the form of a ring at Use a 6V or a higher voltage power sup-
values ranging from 0.01 µF to 100 µF one end. The inner diameter of the ring ply to get high sound levels.
can also be checked with this tester by should be slightly bigger than the diam- Heat sensor. The buzzer can be made

ELECTRONICS PROJECTS Vol. 20 183


TABLE I
Type of Emitter Base Collector Observations
Transistor Faulty Good
Transistor Transistor
- Red Black No sound (base collector open) Sound
N - Black Red Sound (base collector short) No sound
P Black Red - No sound (base emitter open) Sound
N Red Black - Sound (base emitter short) No sound
Fig. 5: Water level monitor
- Red Black Sound (base collector short) No sound
P - Black Red No sound (base collector open) Sound
N Black Red - Sound (base emitter short) No sound
P Red Black - No sound (base emitter open) Sound

trial and error.


Light-interrupted alarm/smoke
alarm. Any unauthorised entry can be
brought to the notice of the user with
this light-interrupted alarm shown in Fig.
8. Put LDR (light dependent resistor) R4
inside a plastic tube of 5 to 10cm length
and connect the leads of the LDR to the
Fig. 6: Rain alarm base and the emitter of transistor T1. Fix
the tube on one side of the entry and in
the axis of the tube fix a 6V or a 12V
bulb on the other side of the entry so
that light falls on the LDR.
Rotate VR1 to the high-resistance po-
sition. Obstruct the light falling on the
LDR and adjust potentiometer VR1 until Fig. 8: Light interrupter alarm, smoke alarm
the buzzer sounds. Now re-
move the obstruction. If
the buzzer still sounds,
connect a 10k resistor (RT)
in parallel with the LDR
and adjust potentiometer
VR1 again after obstruct-
ing the light. The correct
value of RT can be found
Fig. 7: Heat sensor by trial and error. When
the light is obstructed, the
LDR’s resistance in-
to sound when a preset temperature is creases. As the LDR is part
reached. Connect a low-resistance ther- of the potential divider,
mistor (PTC) between the base and the when its voltage-drop in-
emitter of transistor T1 with a pair of creases, it forward-biases Fig. 9: Schematic diagram of all-in-one circuit
wires and a 1-kilo-ohm resistor (R2) and transistor T1 which begins
a 100-kilo-ohm potentiometer (VR1) to the to conduct and the buzzer sounds. cuit depicted in Fig. 9 and try all the
base and the collector of transistor T1 Smoke alarm. Fix a bulb and an LDR alarms. When experimenting with the
(Fig. 7). Fix the thermistor on the body of at the top of the room where the smoke alarms shown in Figs 7 and 8, plug in a
the device or material whose temperature may accumulate. When the smoke ob- shorted plug in SOC1. All the compo-
is to be sensed. When the required or structs the light, the resistance of the LDR nents, including batteries (pen torch
maximum permissible temperature is increases and the buzzer sounds. cells), can be put inside an audiocassette
reached, adjust potmeter VR1 (lower the External control. The positive out- box. One can even use a smaller box.
resistance) until the buzzer sounds. The put from any device or gadget, suitably The transistor can be directly soldered
next time the buzzer would automatically reduced to 0.6V level, can be connected to the sockets SOC1 and SOC2. Using
sound at this particular temperature. between the base and the emitter of tran- this device one can assemble many other
In case the buzzer sounds even when sistor T1 (SOC 2 in Fig. 9) to sound the gadgets, such as a plant tender, fire
potmeter VR1 is in the highest resistance alarm. alarm, dead man’s handle, power-on/
position, fix a 22k resistor (RT) in parallel All-in-one circuit. A very enthusi- power-off alarm, mail announcer, pres-
with the thermistor and adjust VR1 again. astic hobbyist will like to do all these sure sensitive alarm, infrared alarm,
The correct value of RT can be found by experiments. He can assemble the cir- headlights on reminder, and many more.

184 ELECTRONICS PROJECTS Vol. 20


Readers Comments: A. Jacab Lalrinahhana and the intensity of light should also be
❑ Fig. 8 has certain problems. The Aizawl taken into account. The value of RT
buzzer produces sound even after The author, A. Jeyabal replies: should be found by trial and error and
connecting 10k resistor (RT) in parallel It seems the reader used a power supply VR1 adjusted. If the buzzer still sounds,
to the LDR and adjusting potentiometer of more than 6V. He should reduce the the transistor must be shorting and hence
VR1. value of RT to 2k. The resistance of LDR needs to be replaced.

POWER SUPPLY CIRCUITS FOR HAMS


N. S. HARISANKAR – VU3NSH

L
ots of power supply circuits have ment is more, say around 19-20A, then power supply gives 12V ± 0.25V DC at
been printed by different maga- some minor changes are necessary in the 1.5A max. The IC SI-3120CA is a 5-pin,
zines. Here is a simple home- current rating of transformer and bridge hybrid dropper-type regulator with a
brew, high-current power supply unit rectifier, etc. One can also substitute tran- maximum input voltage (VIN) of 35V and
(PSU). The speciality of this PSU is very sistor T1 with two 2N3773 transistors (in power dissipation (PD) of 18 watts. The
good performance despite the minimum parallel). Noise filter circuit to be used IC has a number of internal protections,
use of components. The PSU delivers between the 230V AC mains and the trans- including overvoltage, overcurrent, and
12V output at 12A. At input a noise former input is shown in Fig. 2. However, overheat protections. Specified VIN range
suppressor is added. The ready-made you may also use readymade ELCOM noise is 13V to 30V. Its ripple rejection factor
noise suppressors like ‘Schaffner’ NO- filter for the purpose. This PSU is easy to is 54dB. Further, there is no need for ex-
FU1211, Switzerland, or equivalent are assemble, RF immune, and overvoltage/ ternal protections like crowbar. Use of
easily available in the market. Series- reverse-polarity protected. heat sink for the IC is recommended. You
pass transistor T1 2N6320 or 2N 6321 is General-purpose. This is a general- may use it with a mains stepdown trans-
used for this circuit. (During testing at purpose power supply for your shack, former of 0-22V AC, 2A secondary rating.
EFY lab, BD 249 transistor with current which can be used for QRP transceiver Diode 1N4007 is a reverse polarity pro-
rating of 25A was substituted.) It is a operation, testing of QRP RF amplifiers, tection diode.
high-current, high-voltage transistor with and VFO or other general-purpose appli- Discrete PSU For QRO (Fig. 3).
power dissipation rating of 300W. The cations like 2m/70cm handheld rigs. There This PSU design is meant for QRO trans-
components comprising 14V zener D2, is no need for external components other ceivers (50W) and RF linear amplifiers,
resistors R2, R3, and SCR T2 (BT151 than two capacitors and one diode. The etc. IC LM396 is a high-current voltage
used at EFY during testing) form the
crowbar protection circuit to short-circuit
the input AC voltage and blow fuse F1
in case the output voltage crosses 14V
DC level.
Use a heat sink with adequate heat
dissipation capability along with a cool-
ing fan for transistor T1. However, a small
heat sink is adequate for regulator IC
7812. The diode across the output is for
reverse polarity protection. All compo-
nents are available in the market. You
may use a mains step-down transformer
with 0-20V AC, 15A secondary rating for
the circuit. The SCR should be of 18A,
200V type. Ferrite beads (FB) at base and
output terminals avoid RF interference.
Use a 16A, 200V PIV (peak inverse volt-
age rating) bridge rectifier, followed by a
15,000µF, 60V-rated capacitor for rectifi-
cation and filtering.
One can use this power supply circuit
for high-current applications like HF and
VHF mobile stations. If current require- Fig. 1: Economical high current power supply unit

ELECTRONICS PROJECTS Vol. 20 185


This IC does not de- Transistor T1 is used for current
pend on external ca- boosting. In this circuit the power dissi-
pacitors for frequency pation (PD) of the IC is limited to 50W.
stabilisation. Internal So, we need an outboard transistor for
structure of the IC com- current boosting. In this circuit the cur-
bines high-power rent boosting transistor used is TIP36C,
discrete transistor tech- and its PD is 90W. A current-sensing
nology with modern resistor (R5) of 0.15 ohm is used. When
monolithic linear IC the current is less than 4A, the voltage
processing. This combi- across R5 is less than 0.6V and the tran-
nation yields a high- sistor is in off state. The voltage regula-
performance, single- tion works as before. LM396 holds the
chip regulator capable output voltage constant and the load cur-
of supplying 10 rent passes through LM396. When the
amperes of current. load current is greater than 4A, then the
Fig. 2: General-purpose power supply unit
voltage across R5 is greater than 0.6V
and the transistor turns on. The outboard
transistor will supply extra load current
of more than 4A.
It is a beautiful circuit because the
transistor current adjusts to the value of
the excess load current. The current
through LM396 is slightly more than 4A.
The outboard transistor handles the rest
of the current. Crowbar protection is
added against high-voltage DC output.
LED1 at VIN terminal is a normal voltage
indicator. If it goes off, it means that VIN
is very low. Capacitor between Adj. ter-
Fig. 3: Discrete power supply unit for QRO minal of the regulator and the ground
increases ripple rejection.
regulator meant for providing an adjust- Maximum input voltage rating is 20V Lab note: The protection diodes pre-
able output votage of 1.25V to 15V at and ripple rejection is 74 dB. The output vent the high-value capacitors, at the out-
current up to 10A. Its power dissipation voltage is decided by resistors R1 and put stage of the regulator, from discharg-
(PD) is 70W. For setting output voltage, R2. ing via the low-current points into the
only two external resistors are needed. Vout = 1.25 (R1+R2/R1) regulator and damaging it.

CYCLIC ON AND OFF TIMER FOR


COOLER PUMP
PRATAP CHANDRA SAHU

M
any of us use cooler pumps dur- sion of 555-based astable multivibrator duty-cycles of the overall on-off period, as
ing summer. An air-cooler unit, with a long time-period. The length of on- desired. It is recommended to set the on-
in addition to the fan motor, time is a multiple of the period of 555 time for three-four minutes and the off-
uses a 35- to 50-watt pump motor. The output and the number of used CD4017 time for seven-eight minutes as it suits
pump runs continuously and unnecessar- outputs being connected together in wired- most coolers.
ily wastes power. The pump motor can, OR fashion, using diodes. The off-time pe- When there is inadequate water in
in fact, be switched off for some time once riod is a multiple of the period of 555 and the tank, the pump is automatically
the pads are wet—save power and also the number of unused outputs of CD4017. switched off. This is achieved by pulling
prolong the life of the motor. The given The circuit thus increases the on and off the reset and inhibit pins of 4017 to sup-
circuit is a cyclic on-and-off timer which time of the 555 waveform with the help of ply voltage. Taking these pins towards
helps to achieve this objective. 4017 counter. The 4017 output being pro- ground potential (while the tank water
The circuit is simply an extended ver- grammable, can be used to get different level is sufficient) through the water in-

186 ELECTRONICS PROJECTS Vol. 20


side the tank, en-
sures that CD4017
is active. In the ab-
sence of water be-
tween sensor pins,
the circuit is both in-
hibited and reset.
Other uses of
the circuit include
on-and-off timer for
the exhaust fan. It
can also be used
where asymmetric
waveform of very
long time-period is
required for timer
applications.

SELF-SWITCHING POWER SUPPLY


ANAND S. TAMBOLI

O
ne of the main features of the de-energised, which switches off the nevertheless be changed as per user’s
regulated power supply circuit mains input to primary of transformer requirement (up to 30V maximum and
being presented is that though X1. To resume the power again, switch 1-ampere current rating). For drawing
fixed-voltage regulator LM7805 is used S1 should be pressed momentarily. more than 300mA current, the regulator
in the circuit, its output voltage is vari- Higher the value of capacitor C2, more IC must be fitted with a small heat
able. This is achieved by connecting a will be the delay in switching off the sink over a mica insulator. When the
potentiometer between common terminal power supply on disconnection of the load, transformer’s secondary voltage increases
of regulator IC and ground. For every and vice versa. beyond 12 volts (RMS), potentiometer
100-ohm increment in the in-circuit value Though in the prototype a trans- VR1 must be redimensioned. Also,
of the resistance of potentiometer VR1, former with a secondary voltage of the relay voltage rating should be
the output voltage increases by 1 volt. 12V-0V, 250mA was used, it can redetermined.
Thus, the output varies from 3.7V to 8.7V
(taking into account 1.3-volt drop across
diodes D1 and D2).
Another important feature of the sup-
ply is that it switches itself off when no
load is connected across its output
terminals. This is achieved with the help
of transistors T1 and T2, diodes D1 and
D2, and capacitor C2. When a load is
connected at the output, potential drop
across diodes D1 and D2 (approximately
1.3V) is sufficient for transistors T2 and
T1 to conduct. As a result, the relay gets
energised and remains in that state as
long as the load remains connected. At
the same time, capacitor C2 gets charged
to around 7-8 volt potential through tran-
sistor T2. But when the load is discon-
nected, transistor T2 is cut off. However,
capacitor C2 is still charged and it starts
discharging through base of transistor
T1. After some time (which is basically
determined by value of C2), relay RL1 is

ELECTRONICS PROJECTS Vol. 20 187

Вам также может понравиться