EL001 Electronic Projects New Collections Vol 1N
EL001 Electronic Projects New Collections Vol 1N
new collections
Volume 1
CIRCUIT IDEAS
Controller Y. K
AT ARIA As presets VR1 through VR10 are
set for different values, different time
periods (or frequencies) for astable
multivibrator IC3 can be selected. The
PRADEEP G. output of IC3 is applied to pnp driver
transistor T1 (TIP32) for driving the fi-
A
continuously working wiper in for the decade counter (IC2) which ad- nal power transistor T2 (2N3055) which
a car may prove to be a nui- vances by one count on each successive in turn drives the wiper motor at the
sance, especially when it is not clock pulse or the push of switch S1. selected sweep speed. The power supply
raining heavily. By using the circuit de- Ten presets (VR1 through VR10), for the wiper motor as well as the circuit
scribed here one can vary sweeping rate set for different values by trial and er- is tapped from the vehicle’s battery it-
of the wiper from once a second to once ror, are used at the ten outputs of IC2. self. The duration of monostable
in ten seconds. But since only one output of IC2 is high multivibrator IC1 is set for a nearly one
The circuit comprises two timer at a time, only one preset (at selected second period.
NE555 ICs, one CD4017 decade counter, output) effectively comes in series with
one TIP32
driver tran-
sistor, a
2N3055
power tran-
sistor (or
TIP3055)
and a few
other dis-
crete compo-
nents.
Timer
IC1 is con-
figured as a
mono- stable
multivibrator
which pro-
duces a
pulse when
one presses
switch S1
momen-
tarily. This
pulse acts as
a clock pulse
EFY
PROJECTS
00
VOLUME
2000
Electronics For You
issues
C o n t e n t s
JANUARY 2000
CONSTRUCTION PROJECTS
2000
1) MICROPROCESSOR-CONTROLLED TRANSISTOR LEAD IDENTIFIER --------------------------------------------- 1
2) CONVERSION OF AUDIO CD PLAYER TO VIDEO CD PLAYER I ----------------------------------------------- 9
CIRCUIT IDEAS
1) MULTIPURPOSE CIRCUIT FOR TELEPHONES ------------------------------------------------------------------------- 13
2) SIMPLE CODE LOCK -------------------------------------------------------------------------------------------------------- 13
3) AUTOMATIC BATHROOM LIGHT ---------------------------------------------------------------------------------------- 14
4) SMART FLUID LEVEL INDICATOR --------------------------------------------------------------------------------------- 15
5) AUTOMATIC SCHOOL BELL SYSTEM ---------------------------------------------------------------------------------- 16
6) DESIGNING AN RF PROBE ------------------------------------------------------------------------------------------------ 18
FEBRUARY 2000
CONSTRUCTION PROJECTS
1) PC BASED SPEED MONITORING SYSTEM ---------------------------------------------------------------------------- 19
2) STEREO CASSETTE PLAYER ----------------------------------------------------------------------------------------------- 24
CIRCUIT IDEAS
1) BASS AND TREBLE FOR STEREO SYSTEM ---------------------------------------------------------------------------- 29
2) PROTECTION FOR YOUR ELECTRICAL APPLIANCES ---------------------------------------------------------------- 29
3) DIGITAL WATER LEVEL METER ------------------------------------------------------------------------------------------ 30
4) UNIVERSAL HIGH-RESISTANCE VOLTMETER ------------------------------------------------------------------------- 31
5) TRIAC/TRANSISTOR CHECKER ------------------------------------------------------------------------------------------- 32
6) A NOVEL METHOD OF FREQUENCY VARIATION USING 555 --------------------------------------------------- 33
MARCH 2000
CONSTRUCTION PROJECTS
1) RESONANCE TYPE L-C METER ------------------------------------------------------------------------------------------- 34
2) ELECTROLYSIS-PROOF COMPLETE WATER-LEVEL SOLUTION --------------------------------------------------- 38
CIRCUIT IDEAS
1) PENDULUM DISPLAY ------------------------------------------------------------------------------------------------------- 42
2) AUDIO LEVEL INDICATOR ------------------------------------------------------------------------------------------------ 42
3) CLEVER RAIN-ALARM ------------------------------------------------------------------------------------------------------ 44
4) LASER CONTROLLED ON/OFF SWITCH -------------------------------------------------------------------------------- 45
5) TELEPHONE CONVERSATION RECORDER ---------------------------------------------------------------------------- 45
6) SIMPLE AND ECONOMIC SINGLE- PHASING PREVENTOR ------------------------------------------------------- 46
APRIL 2000
CONSTRUCTION PROJECTS
1) SMART CLAP SWITCH ----------------------------------------------------------------------------------------------------- 48
2) ELECTRONIC VOTING MACHINE ---------------------------------------------------------------------------------------- 51
CIRCUIT IDEAS
1) WATER-TANK LEVEL METER --------------------------------------------------------------------------------------------- 57
2) PHONE BROADCASTER ---------------------------------------------------------------------------------------------------- 58
3) TELEPHONE CALL METER USING CALCULATOR AND COB ------------------------------------------------------ 59
4) SIMPLE ELECTRONIC CODE LOCK -------------------------------------------------------------------------------------- 60
5) LATCH-UP ALARM USING OPTO-COUPLER -------------------------------------------------------------------------- 61
6) MINI VOICE-PROCESSOR ------------------------------------------------------------------------------------------------- 61
C o n t e n t s
MAY 2000
CONSTRUCTION PROJECTS
2000
1) DIGITAL NUMBER SHOOTING GAME --------------------------------------------------------------------------------- 63
2) PC INTERFACED AUDIO PLAYBACK DEVICE: M-PLAYER ---------------------------------------------------------- 66
CIRCUIT IDEAS
1) STEPPER MOTOR DRIVER ------------------------------------------------------------------------------------------------- 73
2) ELECTRONIC DIGITAL TACHOMETER ---------------------------------------------------------------------------------- 74
3) LIGHT-OPERATED LIGHT SWITCH --------------------------------------------------------------------------------------- 75
4) PRECISION DIGITAL AC POWER CONTROLLER ---------------------------------------------------------------------- 76
5) LUGGAGE SECURITY SYSTEM ------------------------------------------------------------------------------------------- 77
JUNE 2000
CONSTRUCTION PROJECTS
1) PORTABLE OZONE GENERATOR ---------------------------------------------------------------------------------------- 78
2) CONFERENCE TIMER ------------------------------------------------------------------------------------------------------- 84
CIRCUIT IDEAS
1) ADD-ON STEREO CHANNEL SELECTOR ------------------------------------------------------------------------------- 87
2) WATER TEMPERATURE CONTROLLER --------------------------------------------------------------------------------- 88
3) EMERGENCY LIGHT -------------------------------------------------------------------------------------------------------- 89
4) PARALLEL TELEPHONES WITH SECRECY ------------------------------------------------------------------------------ 90
5) TWO-DOOR DOORBELL --------------------------------------------------------------------------------------------------- 91
6) POWERFUL PEST REPELLER ---------------------------------------------------------------------------------------------- 91
JULY 2000
CONSTRUCTION PROJECTS
1) BUILD YOUR OWN C-BAND SATELLITE TV-RECEIVER ------------------------------------------------------------- 92
2) EPROM-BASED PROGRAMMABLE NUMBER LOCK ---------------------------------------------------------------- 99
CIRCUIT IDEAS
1) POWER-SUPPLY FAILURE ALARM ------------------------------------------------------------------------------------- 102
2) STOPWATCH USING COB AND CALCULATOR --------------------------------------------------------------------- 102
3) DIAL A VOLTAGE ---------------------------------------------------------------------------------------------------------- 103
4) ELECTRONIC DANCING PEACOCK ------------------------------------------------------------------------------------ 104
5) INVERTER OVERLOAD PROTECTOR WITH DELAYED AUTO RESET ------------------------------------------- 105
6) TELEPHONE LINE BASED AUDIO MUTING AND LIGHT-ON CIRCUIT ---------------------------------------- 106
AUGUST 2000
CONSTRUCTION PROJECTS
1) DISPLAY SCHEMES FOR INDIAN LANGUAGESPART I (Hardware and Software) -------------------- 108
2) 8085 µP-KIT BASED SIMPLE IC TESTER ----------------------------------------------------------------------------- 115
CIRCUIT IDEAS
1) LOW COST PCO BILLING METER ------------------------------------------------------------------------------------- 119
2) AUTOMATIC MUTING CIRCUIT FOR AUDIO SYSTEMS ---------------------------------------------------------- 120
3) 2-LINE INTERCOM-CUM-TELEPHONE LINE CHANGEOVER CIRCUIT ----------------------------------------- 120
4) GUARD FOR REFRIGERATORS AND AIR-CONDITIONERS ------------------------------------------------------- 121
5) RADIO BAND POSITION DISPLAY ------------------------------------------------------------------------------------- 122
C o n t e n t s
SEPTEMBER 2000
CONSTRUCTION PROJECTS
2000
1) DISPLAY SCHEMES FOR INDIAN LANGUAGESPART II (Hardware and Software) -------------------- 123
2) DIGITAL CODE LOCK ----------------------------------------------------------------------------------------------------- 133
CIRCUIT IDEAS
1) BINARY TO DOTMATRIX DISPLAY DECODER/DRIVER ----------------------------------------------------------- 137
2) AUTOMATIC SPEED-CONTROLLER FOR FANS AND COOLERS ------------------------------------------------ 139
3) BLOWN FUSE INDICATOR ---------------------------------------------------------------------------------------------- 140
4) OVER-/UNDER-VOLTAGE CUT-OFF WITH ON-TIME DELAY ----------------------------------------------------- 140
5) ONE BUTTON FOR STEP, RUN, AND HALT COMMANDS ------------------------------------------------------- 142
OCTOBER 2000
CONSTRUCTION PROJECTS
1) MOSFET-BASED 50Hz SINEWAVE UPS-CUM-EPS ---------------------------------------------------------------- 143
2) R-2R D/A CONVERTER-BASED FUNCTION GENERATOR USING PIC16C84 MICROCONTROLLER ---- 150
CIRCUIT IDEAS
1) SIMPLE SWITCH MODE POWER SUPPLY --------------------------------------------------------------------------- 155
2) TOILET INDICATOR ------------------------------------------------------------------------------------------------------- 155
3) FEATHER-TOUCH SWITCHES FOR MAINS -------------------------------------------------------------------------- 156
4) DIGITAL FAN REGULATOR ---------------------------------------------------------------------------------------------- 157
5) TELEPHONE RINGER USING TIMER ICS ----------------------------------------------------------------------------- 159
NOVEMBER 2000
CONSTRUCTION PROJECTS
1) PC-TO-PC COMMUNICATION USING INFRARED/LASER BEAM ----------------------------------------------- 160
2) MULTI-EFFECT CHASER LIGHTS USING 8051 MICROCONTROLLER ----------------------------------------- 166
CIRCUIT IDEAS
1) AUTOMATIC BATTERY CHARGER ------------------------------------------------------------------------------------- 170
2) TEMPERATURE MEASUREMENT INSTRUMENT ------------------------------------------------------------------- 171
3) VOICE BELL ----------------------------------------------------------------------------------------------------------------- 172
4) MOVING CURTAIN DISPLAY ------------------------------------------------------------------------------------------- 173
5) PROXIMITY DETECTOR -------------------------------------------------------------------------------------------------- 174
DECEMBER 2000
CONSTRUCTION PROJECTS
1) ELECTRONIC BELL SYSTEM --------------------------------------------------------------------------------------------- 175
2) SIMPLE TELEPHONE RECORDING/ANSWERING MACHINE ---------------------------------------------------- 179
CIRCUIT IDEAS
1) MULTICHANNEL CONTROL USING SOFT SWITCHES ------------------------------------------------------------ 183
2) AN EXCLUSIVE SINEWAVE GENERATOR ---------------------------------------------------------------------------- 184
3) TTL THREE-STATE LOGIC PROBE -------------------------------------------------------------------------------------- 185
4) AM DSB TRANSMITTER FOR HAMS ---------------------------------------------------------------------------------- 185
5) GROUND CONDUCTIVITY MEASUREMENT ------------------------------------------------------------------------ 186
6) STEPPER MOTOR CONTROL VIA PARALLEL PORT ---------------------------------------------------------------- 187
January
2000
CONSTRUCTION
MICROPROCESSOR-CONTROLLED
can easily indicate the type (npn or pnp)
and the base of the device under test,
with respect to the test socket terminals
6
Fig. 1: Schematic circuit diagram of the transistor lead identifier CONSTRUCTION
7
CONSTRUCTION
8
CONSTRUCTION
9
CONSTRUCTION
Fig. 5 (iv)
TABLE VI
PC7 PC6 PC5 PC4 PC3 PC2 PC1 PC0
0 0 0 0 1 1 0 1
10
CONSTRUCTION
PARTS LIST
Semiconductors:
IC1 - NE555, timer
IC3 - CD4017, decade counter-de-
coder
IC3 - 7486, quad EX-OR gates
IC4,IC6,IC7 - MCT2E, optocoupler
IC5 - CD4066, quad bilateral switch
IC8 - LM7805, 3-terminal +5V
regulator
T1,T2,T3 - BC147, npn transistor
D1,D3,D5 - 1N34, point contact diode
D2,D4,D6 - LED, 5mm
D7,D8 - 1N4002, rectifier diode
Resistors (All ¼ watt +/- 5% metal/carbon film
unless stated otherwise)
R1,R9,R10,R14,
R15,R19,R20 - 1 kilo-ohm
R2 - 33 kilo-ohm
Fig. 6: Actual-size, single-sided PCB layout for the circuit in Fig. 1 R5 - 47 kilo-ohm
R4,R11,R16,R21 - 10 kilo-ohm
R3,R6,R7,R12,R17 - 100 kilo-ohm
R8,R13,R18 - 680 ohm
Capacitors:
C1 - 0.5µF polyster
C2 - 0.1µF polyster
C3-C5 - 220µF/12V electrolytic
C6 - 0.22µF polyster
C7 - 1000µF/12V electrolytic
Miscellaneous:
X1 - 230V/9V-0-9V, 250mA power
transformer
11
CONSTRUCTION
Memory Map And Software listing in 8085 Assembly Language Address Op Code Label Mnemonic Comments
RAM Locations used for program :2000H - 21BBH 2087 E607 ANI 07H Checks only first three bits
Stack pointer initialised :2FFFH 2089 EAA021 JPE ERR If 2 bits are at logic-1 jumps to 21A0
Monitor Program :0000H - 0FFFH 208C 326C21 STA 216CH Store the No. (Collector-Id)into mem.
Display Data Table :2160H - 219AH 208F C39220 JMP P4 Jumps to select lead configuration
Control/Status Register of 8155 :80H
Port A (Input) of 8155 :81H ;Lead configuration selection program
Port B (Output) of 8155 :82H 2092 216A21 P4: LXI H,216AH Extracts Base-Id from memory location
Port C (Output) of 8155 :83H 2095 7E MOV A,M 216A to the accumulator
2096 FE05 CPI 05H If the number is 05,
2098 CABA20 JZ P4A jumps to subroutine 4A
Address Op Code Label Mnemonic Comments
209B FE06 CPI 06H If the number is 06,
;Initialisation, base and type identification 209D CAD020 JZ P4B jumps to the subroutine 4B
2000 31FF2F MAIN: LXI SP,2FFFH Initialisation of the ports. A as the 20A0 FE03 CPI 03H If the number is 03,
2003 3E0E MVI A,0EH input and C as the output port. 20A2 CAE620 JZ P4C jumps to the subroutine 4C
2005 D380 OUT 80H Sends 07 through port C to make SW1, 20A5 FE02 CPI 02H If the number is 02,
2007 3E07 MVI A,07H SW2, SW3 ON and SW4 OFF. 20A7 CABA20 JZ P4A jumps to the subroutine 4A
2009 D383 OUT 83H Time delay should be allowed before 20AA FE01 CPI 01H If the number is 06,
200B CD3320 CALL DELAY measuring the logic voltages across 20AC CAD020 JZ P4B jumps to the subroutine 4B
200E CD3320 CALL DELAY capacitors C1, C2, and C3, so that 20AF FE04 CPI 04H If the number is 04,
2011 CD3320 CALL DELAY they charge to the peak values. 20B1 CAE620 JZ P4C jumps to the subroutine 4C
2014 AF XRA A Clears the accumulator 20B4 CDFC20 M: CALL DISPLAY Jumps to display the lead configuration
2015 DB81 IN 81H Input data from interface through. selected in P4A or P4B or P4C
portA 2017E607 ANI 07H Test only first 3 bits, masking others 20B7 C30020 JMP MAIN Jumps back to start
2019 326A21 STA 216AH Stores the number in memory.
;Lead configuration selection (Base Id.=05 or 02)
201C CA2A20 JZ P If the number is zero jumps to 202A
201F EA3D20 JPE P2 If the number has even no. of 1s, 20BA 216C21 P4A: LXI H,216CH Extracts Collector-Id from memory
jumps to 203D (refer note 2) location
2022 E26820 JPO P3 If the number has odd no. of 1s, jump 20BD 7E MOV A,M 216C to the accumulator
to 2068 (refer note 1) 20BE FE01 CPI 01H If it is = 01, jumps to 20CA
2025 00 NOP No operation 20C0 CACA20 JZ E If it is = 04, points to lead
2026 00 NOP No operation configuration “EbC”
2027 00 NOP No operation 20C3 217521 LXI H,2175H in data table
2028 00 NOP No operation 20C6 C3B420 JMP M Jumps to display the lead
2029 00 NOP No operation configuration pointed
202A 218921 P: LXI H,2189H Points to message “PUSH” in data 20C9 00 NOP NOP
table 20CA 217121 E: LXI H,2171H Points to lead config.”CbE” and jumps
202D CDFC20 CALL DISPLAY Displays the message 20CD C3B420 JMP M display the configuration
2030 C30020 JMP MAIN Jumps to start. ;Lead configuration selection (Base Id.= 06 or 01)
;Delay sub-routine 20D0 216C21 P4B: LXI H,216CH Extracts Collector-Id from memory
2033 11FFFF DELAY: LXI D,FFFFH Loads DE with FFFF location
2036 1B DCX D Decrements DE 20D3 7E MOV A,M 216C to the accumulator
2037 7A MOV A,D Moves result into Acc. 20D4 FE02 CPI 02H If it is STE02, jumps to 20E0
2038 B3 ORA E OR E with Acc. 20D6 CAE020 JZ B I If it is =04, points to lead
2039 C23620 JNZ 2036 If not zero, jumps to 2036 20D9 217D21 LXI H,217DH configuration “bEC” in data table
203C C9 RET Returns to calling program 20DC C3B420 JMP M Jumps to display the lead
configuration pointed
;Collector identification program for PNP transistors 20DF 00 NOP No oPeration
203D 216A21 P2: LXI H,216AH Points of Base-Id in data table 20E0 217921 B: LXI H,2179H Points to lead configuration “bCE”
2040 7E MOV A,M Extracts the number to the 20E3 C3B420 JMP M and jumps display the configuration
accumulator
;Lead configuration selection (Base Id.=03 or 04)
2041 D383 OUT 83H Send the number to the interface
2043 216021 LXI H,2160H Points to message ‘PnP’ in data table 20E6 216C21 P4C: LXI H,216CH Extracts Collector-Id from memory
2046 CDFC20 CALL DISPLAY Displays the message location
2049 CD3320 CALL DELAY Waits for few moments 20E9 7E MOV A,M 216C to the accumulator
204C CD3320 CALL DELAY Waits for few moments 20EA FE01 CPI 01H If it is =01, jumps to 20F6
204F CD3320 CALL DELAY Waits for few moments 20EC CAF620 JZ C If it is =02, points to lead
2052 AF XRA A Clears the accumulator 20EF 218121 LXI H,2181H configuration “ECb” in data table
2053 DB81 IN 81H Seeks data from the interface 20F2 C3B420 JMP M Jumps to display the lead
2055 E607 ANI 07H Masks all bits except bits 0,1 and 2 20F5 00 NOP configuration pointed; no operation
2057 EAA021 JPE ERR If the data contains even no. of 1s 20F6 218521 C: LXI H,2185H Points to lead configuration “CEb”
jumps to error processing routine 20F9 C3B420 JMP M and jumps to display the configuration
205A 326B21 STA 216BH Stores the data (Emitter-Id) in memory ;Display routine using 8279 of the kit (if present)
205D 47 MOV B,A Moves the Emitter-Id. to B register 2140 0E04 MVI C,03 Sets the counter to count 4 characters
205E 3A6A21 LDA 216AH Extracts Base-Id from memory 2142 3E90 MVI A,90 Sets cont.8279 to auto-incr. mode
2061 90 SUB B Subtracts Emitter-Id from Base-Id 2144 320160 STA 6001 Address of 8279 cont. reg.=6001
2062 326C21 STA 216CH Stores the result(Collector-Id)in mem. 2147 7E MOV A,M Moves 1st data character from mem.
2065 C39220 JMP P4 Jumps to select lead configuration Loc. pointed to by calling instruction.
;Collector identification program for NPN transistors 2148 2F CMA Inverts data (refer note below)
2149 320060 STA,6000 Stores data in 8279 data reg.
2068 216A21 P3: LXI H,216AH Points to Base-Id in data table (addr=6000)
206B 7E MOV A,M Extract the number to the accumulator 214C 0D DCR C Decrements counter
206C FE07 CPI 07H Refer note 1 214D CA5421 JZ 2154 Returns to calling program if count=0
206E CAB621 JZ ER Jumps to error processing routine 2150 23 INX H Increments memory pointer
2071 EE0F XRI 0FH Refer note 2 2151 C34721 JMP2147 Jumps to get next character from
2073 D383 OUT 83H Send the number to the interface memory
2075 216421 LXI H,2164H Points to the message “nPn” 2154 C9 RET Returns to the calling program
2078 CDFC20 CALL DISPLAY Displays the same
Note: In the microprocessor kit used, data is inverted before feeding the 7-seg display.
207B CD3320 CALL DELAY Waits for few moments
207E CD3320 CALL DELAY Waits for few moments ;Alternative Display Subroutine to be used with interface circuit of Fig. 4
2081 CD3320 CALL DELAY Waits for few moments 2107 0608 MVI B,08H Store 0000 1000 in reg.B
2084 AF XRA A Clears the accumulator 2109 3E00 MVI A,00H Out 00H through Port C to latch data
2085 DB81 IN 81H Seeks data from the interface in all
12
CONSTRUCTION
Address Op Code Label Mnemonic Comments Addr. Data Display Addr. Data Display Addr. Data Display
210B D383 OUT 83H 74373s. (no data would move to O/Ps) 2164 45 n 217D C7 b 218D C7 b
210D 7E MOV A,M Moves the 1st char. Of the data 2165 37 P 217E 97 E 218E 77 A
pointed, to the accumulator (mem. 2166 45 n 217F 93 C 218F E5 d
address given by 2167 00 2180 00 2190 00
210E D382 OUT 82H calling program) 216A Base-id (store) 2181 97 E 2191 7 a
2110 78 MOV A,B By moving out reg.B data throgh port 216B Emitter-id (store) 2182 93 C 2192 E5 d
C 216C Collector-id (store) 2183 C7 b 2193 E1 J
2111 D383 OUT 83H a specific latch is enabled. 2171 93 C 2184 00 2194 00
2113 1F RAR Logic 1 of counter data moves right 1 2172 C7 b 2185 93 C 2196 83 L
bit 2173 97 E 2186 97 E 2197 97 E
2114 FE00 CPI 00H Checks to see logic 1 moves out from 2174 00 2187 C7 b 2198 77 A
acc. 2175 97 E 2188 00 2199 E5 D
2116 CA2121 JZ 2121H (All 4 data digits latched)to return to 2176 C7 b 219A 00
the calling program. 2177 93 C
2119 47 MOV B,A Else stores back new counter data to B 2178 00
reg.
Address of routines/labels:
211A CD3320 CALL DELAY
211D 23 INX H Memory pointer incremented by 1 MAIN 2000 P 202A DELAY 2033 D 2036
211E C30921 JMP 2109H Jumps to the next character from the P2 203D P3 2068 P4 2092 M 20B4
table P4A 20BA E 20CA P4B 20D0 B 20E0
2121 C9 RET Returns to the calling program P4C 20E6 C 20F6 DISPLAY 20FC ERR 21A0
BAD 21AF ER 21B6
;Error Sub-routine
Notes:
21A0 219121 ERR: LXI H,2191H Points to the message “Adj.” in memory
21A3 CDFC20 CALL DISPLAY Calls the display routine to display the 1. During Base identification, if the data found has odd parity, only then the program
same jumps to this routine (starting at 2068 at P3:) for collector identification. A single logic-1
21A6 CD3320 CALL DELAY Waits denotes a good transistor, whereas three logic-1 (i.e. Base-Id = 07) denote a bad transistor
21A9 CD3320 CALL DELAY Waits with shorted leads. Hence the program jumps to error processing routine to display the
21AC 219621 LXI H,2196H Points to the message “LEAd” in message “bAd”.
memory 2. The purpose of sending the Base-Id number to the interface through Port-C, is to
21AF CDFC20 BAD: CALL DISPLAY Calls the display routine to display insert a resistor in series with the Base (as indicated in the principle above). The logic-1(s) of
21B2 C30020 JMP MAIN Jumps back to start the Base-Id, set the switches connected with the collector and emitter leads to “ON”, and that
21B5 00 NOP No operation with the base to “OFF”. The result is, the resistor already present in the base circuit (10K,
21B6 218D21 ER: LXI H,218DH Points to message “bAd” in the data 47K or 100K which one is applicable), becomes active. To achieve this result, the Base-Id
table found for an NPN device is to be inverted first.
21B9 C3AF21 JMP BAD Jumps to display the message ;Display subroutine used by EFY using monitor program of Vinytics kit.
20FC C5 DISPLAY: PUSH B
Data table:
20FD 3E00 MVI A,0H
Addr. Data Display Addr. Data Display Addr. Data Display 20FF 0600 MVI B,0H
2160 37 P 2179 C7 b 2189 37 P 2101 7E MOV A,M
2161 45 n 217A 93 C 218A E3 U 2102 CDD005 CALL 05D0H
2162 37 P 217B 97 E 218B D6 S 2105 C1 POP B
2163 00 217C 00 218C 67 H 2106 C9 RET
13
CONSTRUCTION
PARTS LIST-1
TO VIDEO CD PLAYER I
R1 - 68 ohm
R2, R3 - 1 kilo-ohm
G.S. SAGOO VR1 - 100 ohm cermet (variable resistor)
Capacitors:
C1 - 1µF paper (unipolar)
PUNERJOT SINGH MANGAT C2 - 10µF, 16V electrolytic
Miscellaneous:
T
he analogue technology is giving tal data, read from the CD, is reconverted X1 - 230V AC primary to 12V-0-12V, 1A sec.
way to the digital technology as into analogue signals. In case of video sig- transformer
S1, S2 - Push-to-on tactile switch
the latter offers numerous advan- nals, the process used for recording and - MPEG decoder card (Sony Digital Tech.)
tages. Digital signals are not only free reproduction of data is the same as used - TV modulator (optional)
from distortion while being routed from for audio CDs. However, there is an addi- - AF plugs/jacks (with screened wire)
- Co-axial connectors, male/female
one point to another (over various me- tional step involved—both during record- - Co-axial cable
dia), but error-correction is also possible. ing as well as reproduction of the digital
Digital signals can also be compressed video signals on/from the compact disk. Conversion
which makes it possible to store huge This additional step relates to the com-
amounts of data in a small space. The pression of data before recording on the An audio CD player, which is used to play
digital technology has also made remark- CD and its decompression while it is being only audio CDs, can be converted to play
able progress in the field of audio and read. As video data requires very large the video CDs as well. Audio CD players
video signal processing. storage space, it is first compressed using have all the required mechanism/functions
Digital signal processing is being MPEG- (Motion Picture Expert Group) com- to play video CDs, except an MPEG card,
widely used in audio and video CDs and CD patible software and then recorded on the which is to be added to the player. This
playing equipment. These compact disks CD. On reading the compressed video data MPEG card is readily available in the mar-
have brought about a revolution in the from the CD, it is decompressed and passed ket. This MPEG card decompresses the data
field of audio and the video technology. In to the video processor. Thus with the help available from the audio CD player and con-
audio CDs, analogue signals are first con- of the compression technique huge amount verts it into proper level of video signals
verted into digital signals and then stored of video data (for about an hour) can be before feeding it to the television.
on the CD. During reproduction, the digi- stored in one CD.
Construction
Step-by-step conversion of audio CD player
to video CD player is described with refer-
ence to Fig. 1.
Step 1. Connection of MPEG card
to TV and step-down power trans-
former to confirm proper working of
the MPEG card.
● Connect IC7805, a 5-volt regulator, to the
14
CONSTRUCTION
MPEG card to the audio/video input of TV form RF EFM in pin of the IC and find TABLE I
via jacks J7 and J11 respectively. Use any solder joint (land) on this PCB track. POSSIBLE EXTRA FUNCTIONS
only shielded wires for these connections. Solder a wire (maximum half meter) to S1 (mode switch) S2 (function switch)
● Check to ensure that the step-down this solder joint carefully. Other end of Slow —
transformer provides 12-0-12 volts at this wire should be joined to RF jack J2 Discview —
Pal/NTSC Pal NTSC
1 ampere of load, before connecting it of the MPEG card. Vol+ Volume Up
to the MPEG card. Connect it to the MPEG Caution: Unplug the soldering iron Vol- Volume Down
card via jack J1. form the mains before soldering this Key+ Left volume down
Key- Right volume down
● Switch on the TV to audio/video mode wire because any leakage in the sol- L/R/CH Left, Right, Mute, Stereo
of operation. Adjust the 100-ohm pre- dering iron may damage the audio CD Play/Pause —
set connected at the video output of player. Note: The above mentioned functions can also be accessed
MPEG card to mid position. ● Another wire should be joined between using remote control.
● Switch on the MPEG card by switching the ground of the audio CD player and
on 230 volts main supply to the 12-0- the ground of jack J2 of the MPEG card. Kenwood Diskman. A photograph of one
12 volt transformer. ● This finishes the connection of the MPEG of the scenes in black and white is in-
● If everything works right, ‘Sony Digital card to the audio CD player. cluded as Fig. 2. (Please see its coloured
Technology’ will be displayed on the Step 3. Playing audio and video CDs. clipping on cover page.)
television. The TV screen will display ● Switch on the power for the audio CD No special PCB is required and hence
this for about 5 seconds before going player and the MPEG card. the same is not included.
blank. Adjust the 100-ohm preset for ● Put a video CD in the audio CD player The author has perferred to use Sony
proper level of video signals. and press its play button to play the Digital Technology Card (against KD680 RF-
Step 2. Connections to audio CD video CD. 35C of C-Cube Technology) because of many
player after confirmation of proper ● After a few seconds the video picture more functions it provides.
functioning of MPEG card during recorded on the CD will appear on the Additional accessibility features of this
step1. television. card (Sony Digital Technology), as shown
● Open your audio CD player. Do this very ● The play, pause, eject, rewind, forward, in Table I can be invoked by adding two
carefully, avoiding any jerks to the au- track numbers, etc buttons present on push-to-on switches between jack 8(J8) and
dio CD player, as these may damage the the audio CD can be used to control the ground via 1K resistors (Fig 1). These will
player beyond repair. new video CD player. enhance the already mentioned functions
● Look for the IC number in Table II (on Now your audio CD player is capable and facilities available on this card, even
page 47) that matches with any IC in of playing video CDs as well. You can con- though it has not been possible to exploit
your audio CD player. nect a power amplifier to the MPEG card the card fully due to non-availability of
● After finding the right IC, note its RF to get a high-quality stereo sound. The technical details. I hope these additions
EF MIN pin number from the Table I. author tested this project on many audio will help the readers get maximum mile-
● Follow the PCB track which leads away players including Thompson Diskman and age from their efforts.
TO VIDEO CD PLAYER II
K.N. GHOSH
W
ant to convert your audio com- dard, the international stan-
pact disk player into video com- dard specification for compress-
pact disk player. Here is a ing the moving picture and au-
simple, economical but efficient add-on cir- dio, comprising a DSP (digital
cuit design that converts your audio signal processor) IC chip, CL860
CDplayer to video CD player. from C-cube (Fig. 3). The VCD
decoder card features small
size, high reliability, and low
Description power consumption (current
Decoder card. The add-on circuit is about 300ma) and real and gay
based on VCD decoder card, KD680 RF-3Sc, colours. This decoder card has
also known as MPEG card adopting MPEG- two play modes (Ver. 1.0 and
1 (Motion Picture Expert Group) stan- Ver. 2.0) and also the forward Fig. 3: Layout diagram of MPEG card from c-cube
15
CONSTRUCTION
TABLE II PARTS LIST-2 put (AV in) facility in their TV, can make
DSP ICs and their EFM RF pin numbers Semiconductors: use of a pre-assembled audio-video to RF
DSP IC EFM DSP IC EFM IC1 - LM78L05, voltage regulator +5V converter (modulator) module of 48.25MHz
/RF Pin /RF Pin IC2 - 78L12, voltage regulator +12V or 55.25 MHz (channel 2 or channel3),
KS 5950 5 CXA 1372Q 32, 46 D1,D2 - 1N4001, rectifier diode which is easily available in the market
KS 5990, 5991 5 CXA 1471S 18, 27 Capacitors:
KS 9210 B 5 CXA 1571S 18, 35
(refer Fig. 4). The audio and video signals
C1 - 2200µF, 35V electrolytic
KS 9211 B E, 9212 5 AN 8370S 12, 31 C2,C3 - 100µF, 16V electrolytic from the decoder card are suitably modu-
KS 9282 5, 66 AN 8373S 9, 35 lated and combined at the fixed TV
KS 9283 66 AN 8800SCE 12 Miscellaneous:
KS 9284 66 AN 8802SEN 9 - 230V AC primary to 18V-0-18V, channel’s frequency in the RF modulator.
CXD 1125 QX 5 TDA 3308 3 1A sec. transformer The output from the modulator can be con-
CXD 1130 QZ 5 LA 9200 35 - MPEG decoder card (C-cube Digital
CXD 1135 5 LA 9200 NM 36
nected to antenna connector of a colour
Tech.)
CXD 1163 Q 5 LA 9211 M 72 - TV modulator (optional)
television.
CXD 1167 R 36 HA 1215 8 NT 46, 72 Power supply unit: The VCD decoder
- AF plugs/jacks (with screened wire)
CXD 1167 Q/QE 5 SAA 7210 3, 25
CXD 20109 9, 20 (40 pin) - Co-axial connectors, male/female card and theRF modulator requires +5V and
CXD 2500 AQ/BQ 24 SAA 7310 32 - Co-axial cable +12V regulated power supply
CXD 2505 AQ 24 (44 pin) respec-
SAA 7341 36, 38
CXD 2507 AQ 14 SAA 7345 8 tively. Sup-
SAA 7378 15 ply design
CXD 2508 AQ 36 TC 9200 AF 56
CXD 2508 AR 36
uses two lin-
TC 9221 F 60
CXD 2509 AQ 34 TC 9236 AF 51,56 ear regula-
CXD 2515 Q 36, 38 TC 9284 53 tors7805 and
CXD 2518 Q 36 YM 2201/FK 76
LC 7850 K 7 YM 3805 8 7812 (Fig. 5).
LC 7860 N/K/E 7, 8 YM 7121 B 76 The voltage
LC 7861 N 8 YM 7402 4, 71 regulators
LC 7862 30 HD 49215 71
LC 78620 11 HD 49233 19 fitted with
LC 78620 E 11 AFS TO 220 -type
LC 7863 8 UPD 6374 CU 23
LC 7865 8
heat sink
UPD 6375 CU 46
M 50422 P 15 should be
LC 7866 E 7, 8 M 50427 FP 15, 17 mounted on
LC 7867 E 8 M 504239 17
LC 7868 E 8 M 515679 4 eht CD
Fig. 5: Power supply to cater for MPEG card and RF modulator
LC 7868 K 8 M 51598 FP 20 p l a y e r
LC 78681 8 MN 35510 43 enclosure’s
MN 6617 74 M 65820 AF 17
MN 6222 11 M 50423 FP 17 rear panel The circuit
MN 6625 S 41 CX 20109 20, 9 can be wired on a gen-
MN 6626 3, 62 SAA7311 25
MN 6650 6 M50122P 15
eral-purpose PCB.
MN 66240 44 M50123 FP 17 Installation
MN 66271 RA 44, 52 M50127 FP 17 steps:
MN 662720 44 UPD6374 CV 3
CXA 72S 18, 46 NM2210FK 76
1. Find suitable
CXA 1081Q 2, 27 YM2210FK 76 place in the enclosure
Fig. 6: Block diagram of connections to decoder card and codulator
of the audio CD player
cuit, digital to analogue converter, micro for fixing the decoder card, RF modulator,
The decoder card converts your CD play- computer interface, video signal proces- and the power supply unit. Make appro-
ers or video games to VCD player to give sor, and error detector, etc. Audio and priate diameter holes and fix them firmly.
almost DVD-quality pictures. video signals stored on a CD are in a high- 2. Make holes of appropriate dimen-
The decoder card mainly consists of density digital format. On replay, the digi- sions on the rear panel for fixing sockets
sync signal separator, noise rejection cir- tal information is read by a laser beam for power supply and RF output.
and converted into analogue 3. Refer to Table II (Combined for Part-
signals. I and II) and confirm DSP chip type of the
One can also use another existing audio CD player for EFM (eight to
VCD decoder card comprising an fourteenth modulation)/RF Signal (from op-
MPEG IC 680, from Technics, and tical pick-up unit of the audio CD player)
a DSP IC chip, CXD2500, with pow- pin number, connect EFMin wire to this
erful error-correction from pin.
Sony. Similarly, another card, 4. Make all the connections as per Fig.
KD 2000-680 RF comprising an 6.
MPEG IC chip, CL680 from Tech- Text of articles on the above project
nics and a DSP IC chip, MN6627 received separately from the two authors
from C-cube. have been been reproduced above so as to
RF modulator. For those make the information on the subject as
Fig. 4: Layout of TV RF modulator who do not have audio-video in- exhaustive as possible. We are further
16
CONSTRUCTION
adding the following information which player part. The DSP chip, more often than served that frequently, the picture/
we have been able to gather during the not, would be a multipin SMT device. In frames froze on the CTV screen and the
practical testing of the project at EFY. the AIWA system we located two such chips power to the MPEG converter card had to
1. There may be more than one PCB (LA9241M and LC78622E both from Sanyo). be switched off and on again. This fault
used in an audio CD player (i.e additional Their data-sheets, picked up from the was attributed to inability of 7805 regu-
for FM radio and tape recorder functions) Internet, revealed the former chip to be an lator to deliver the required current
and even the DSP chips referred in Table1, ASP (analogue signal processor) and latter (about 300 mA) to the MPEG card. The
may not figure on it. For example, we could one (LA78622E) is the CD player DSP chip for regulator circuit was therefore modified
not find the subject IC used in AIWA audio which EFMIN is not found in Table I. For as shown in Fig. 7 to provide a bypass
CD player. The PCB, which is located clos- this chip EFMIN pin is pin 10 while pin 8 is path for current above 110 mA (approxi-
est under the laser system, is related to CD the nearest digital ground pins–which we mately). A step-down transformer of 9V-
used. 0-9V, 500mA is adequate if the modula-
2. Of the two converter cards tor has its own power supply arrange-
(one displaying ‘Sony Digital ment (refer paragraph 4 below).
Technology' and the other dis- 4. RF modulator for TV channels E2
playing ‘C-cube Technology’ and E3 are available in the market com-
on the CTV screen), the latter plete with step-down transformer, hence
card's resolution and colour qual- there may not be any need to wire up a
ity was found to be very good 12V regulator circuit of part II.
when tested by us. The C-cube 5. Apart from the facilities (available
card needs a single 5V DC supply in the MPEG decoder card KD680RF-3SC from
Fig. 7: Modified 5V regulator for enhancing current for its operation. C-cube) as explained by the author, there
capability 3. During testing it was ob- are other facilities such as IR remote con-
trol of the card functions (via Jack J5)
and realisation of change-over between
NTSC and PAL modes (via jack J 4 –no
connections means PAL mode). Similarly,
Jack J1 is meant for external audio and
video input from exchange and connec-
tion of audio and video outputs to
CTV. The foregoing information is avail-
able on document accompanying the
MPEG decoder card. However, the detailed
application/information is not provided
and as such we have not tested these
facilities.
6. EFM is a technique used for encod-
ing digital samples of audio signals into
series of pits and lands into the disc sur-
face. During playback these are decoded
into digital representation of audio sig-
nal and converted to analogue form us-
ing digital-to-analogue converter for even-
tual feeding to the loud speakers.
7. For those enthusiasts who wish to
rig-up their own video modulator, an ap-
plication circuit from National Semicon-
ductor Ltd, making use of IC LM 2889 ,
which is pin for pin compatible with
LM1889 (RF section), is given in Fig 8.
Fig. 8: Two channel video modulator with FM sound —Tech Editor
www.electronicsforu.com
a portal dedicated to electronics enthusiasts
17
CIRCUIT IDEAS
CIRCUIT IDEAS
MULTIPURPOSE CIRCUIT
the telephone ring.
A CID can be connected using a relay.
The relay driver transistor can be con-
FOR TELEPHONES
nected via point A as shown in the cir-
cuit. To use the circuit for warning
G.S. SAGOO against misuse, switch S1 can be left in
on position to activate the piezo-buzzer
when anyone tries to tap the telephone
RANJITH G. PODUVAL
line. (When the telephone line is tapped,
it’s like the off-hook mode of the tele-
T
his add-on device for telephones happens, the voltage across transistor T1’s phone hand-set.)
can be connected in parallel to the base-emitter junction falls below its con- Two 1.5V pencil cells can provide Vcc1
telephone instrument. The circuit duction level to cut it off. As a result tran- power supply, while a separate power sup-
provides audio-visual indication of
on-hook, off-hook, and ringing
modes. It can also be used to con-
nect the telephone to a CID (caller
identification device) through a re-
lay and also to indicate tapping or
misuse of telephone lines by sound-
ing a buzzer.
In on-hook mode, 48V DC supply
is maintained across the telephone
lines. In this case, the bi-colour LED
glows in green, indicating the idle
state of the telephone. The value of
resistor R1 can be changed some-
what to adjust the LED glow, with-
out loading the telephone lines (by
trial and error).
In on-hook mode of the hand-
set, potentiometer VR1 is so adjusted
that base of T1 (BC547) is forward bi-
ased, which, in turn, cuts off transistor T2 sistor pair T2-T3 starts oscillating and the ply for Vcc2 is recommended to avoid
(BC108). While adjusting potmeter VR1, en- piezo-buzzer starts beeping (with switch draining the battery. However, a single
sure that the LED glows only in green and S1 in on position). At the same time, the 6-volt supply source can be used in con-
not in red. bi-colour LED glows in red. junction with a 3.3V zener diode to cater
When the hand-set is lifted, the volt- In ringing mode, the bi-colour LED to both Vcc2 and Vcc1 supplies.
age drops to around 12V DC. When this flashes in green in synchronisation with
T
he circuit described here is of an example, if the code is 1756, connect line B/C/D briefly pulls the clock input pin high
electronic combination lock for 1 to A, line 7 to B, line 5 to C, line 6 to D and the state of flip-flop is altered. The Q
daily use. It responds only to the and rest of the lines—2, 3, 4, 8, and 9—to output pin of each flip-flop is wired to D
right sequence of four digits that are the reset pad as shown by dotted lines in input pin of the next flip-flop while D pin
keyed in remotely. If a wrong key is the figure. of the first flip-flop is grounded. Thus, if
touched, it resets the lock. The lock code The circuit is built around two CD4013 correct clocking sequence is followed then
can be set by connecting the line wires to dual-D flip-flop ICs. The clock pins of the low level appears at Q2 output of IC2 which
the pads A, B, C, and D in the figure. For four flip-flops are connected to A, B, C, energises the relay through relay driver
18
CIRCUIT IDEAS
T
his circuit is used to automate the the door with a small sepa-
working of a bathroom light. It is ration between them as
designed for a bathroom fitted shown in Fig. 1. The radia-
with an automatic door-closer, where the tion from IR LED is blocked
manual verification of light status is dif- by a small opaque strip (fit-
ficult. The circuit also indicates whether ted on the door) when the
the bathroom is occupied or not. The cir- door is closed. Detector di-
cuit uses only two ICs and can be oper- ode D2 has a resistance in
ated from a 5V supply. As it does not use the range of meg-ohms when
any mechanical contacts it gives a reli- it is not activated by IR rays.
able performance. When the door is opened,
One infrared LED (D1) and one infrared the strip moves along with
detector diode (D2) form the sensor part of it. Radiation from the IR LED
the circuit. Both the infrared LED and the turns on the IR detector di-
detector diode are fitted on the frame of ode and the voltage across
Fig. 2
19
CIRCUIT IDEAS
M
ost of the fluid level indicator play driver IC. This decoder IC is capable TABLE I
circuits use a bar graph or a of producing some English alphabets be- D C B A DISPLAY
seven-segment display to indi- sides the usual digits 0 through 9. The L L L L 0
cate the fluid level. Such a display using BCD codes for various displays are given L L L H 1
LEDs or digits may not make much sense in Table I. The BCD codes are generated — — — — 2
to an ordinary person. The circuit pre- by NOR gates because of their intercon- — — — — 3
— — — — 4
sented here overcomes this flaw and dis- nections as the sensing probes get im- — — — — 5
plays the level using a seven-segment dis- mersed in water. Their operation being — — — — 6
play—but with a difference. It shows each self-explanatory is not included here. — — — — 7
level in meaningful English letters. It dis- Note that there is no display pattern H L L L 8
plays the letter E for empty, L for low, H like E or F available from the IC. There- H L L H 9
H L H L L
for half, A for above average, and F for fore to obtain the pattern for letters E H L H H H
full tank . and F, transistors T1 and T2 are used. H H L L P
The circuit is built using CMOS ICs. These transistors blank out the unneces- H H L H A
CD4001 is a quad. NOR gate and CD4055 is a sary segments from the seven-segment H H H L —
H H H H BLANK
BCD to seven-segment decoder and dis- display. It can be seen that letter E is
20
CIRCUIT IDEAS
sumption is extremely low. This makes it mersed in water) is of the order of 70 µA, Note: This circuit should not be
possible to power the circuit from a bat- which results in low rate of probe dete- used with inflammable or highly reactive
tery. The input sensing current through rioration due to oxidation as also low lev- fluids.
the fluid (with all the four probes im- els of electrolysis in the fluid.
AUTOMATIC SCHOOL
8-bit wide input/output ports (port A, port
B, and port C). Control word 80 (hex) is
used to initialise all ports of 8255-I as out-
put ports. Bit 0 of port A (PA0) is connected
T
his is an effective and useful has been tested by the author on a the school campus. The relay would get
project for educational institu- Vinytics’ microprocessor-8085 kit (VMC- energised after every 40 minutes for a
tions. In most schools and col- 8506). The kit displays
leges, the peon rings the bell after every the period number on
period (usually of a 40-minute duration). two most significant
The peon has to depend on his wrist watch digits of address field
or clock, and sometimes he can forget to and minutes of the
ring the bell in time. In the present sys- period elapsed on the
tem, the human error has been elimi- next two digits of the
nated. Every morning, when the school address field. The
starts, someone has to just switch on the data field of the kit
PA O
system and it thereafter work automati- displays seconds con-
cally. tinuously.
The automatic microprocessor con- The idea used
trolled school bell system presented here here is very simple.
21
CIRCUIT IDEAS
few seconds. The program (software) and have been used in the program. Please data field is used for display. Similarly,
data used for the purpose are given be- note that before calling the display rou- if register B contains 00 then no dot
low in mnemonic and machine code forms. tine, registers A and B are required to be is displayed at the end of address field,
The program is self-explanatory. initialised with either 00 or 01 to indicate else if B contents are 01, a dot is
The program and data have been en- to the monitor program as to where the displayed.
tered at specific memory locations. How- contents of above-mentioned memory lo- When the program is executed on the
ever, the readers are at liberty to use any cations are to be displayed (e.g. address microprocessor kit, a bell sound would be
other memory area in their kits, depend- field or data field), and whether a dot heard for a few seconds. The address and
ing on their convenience. Two monitor is to be displayed at the end of address data fields would initially display :
programs (stored in kit’s ROM/EPROM) at field or not. (Readers should refer to their 01 00 00
locations 0347H (for clearing the display) kit’s documentation before using the dis- 01 indicates start of first period with 00
and 05DOH (for displaying contents of play routine.) In Vinytics’ kit, if register as elapsed minutes and 00 seconds in the
memory locations 2050H through 2055 in A contents are 00, the address field is data field. The data field (seconds) are
the address and data fields respectively) used for display, and if it is 01, the continuously incremented.
Address Op-code Label Mnemonic Comments Address Op-code Label Mnemonic Comments
20 FC 3E 80 MVI A, 80H Initialise 8255-I as output port 21 66 3E 04 SS MVI A, 04 Put A=4
20 FE DE 03 OUT 03 H 21 68 77 MOV M, A
2100 31 FF 27 LXI SP, 27FFH Initialise the stack pointer 21 69 AF TT XRA A A=0
2103 CD 47 03 CALL 0347H Clears the display 21 6A 47 MOV B,A B=0
2106 C3 69 21 JMP TT Jump to ring the bell 21 6B 21 50 20 LXI H, 2050H
2109 AF AA XRA A Put A=0 21 6E CD D0 05 CALL 05D0H Display the period no. and minutes
210 A 47 MOV B, A Put B=0 in address field
210 B 21 50 20 LXI H, 2050 H Starting address of display 21 71 3E 01 MVI A, 01H A=1
210 E CD D0 05 CALL 05D0H Call output routine to display period 21 73 06 00 MVI B, 00H B=0
no. & minutes to address field 21 75 21 54 20 LXI H, 2054 H
21 11 3E 01 MVI A, 01H A=01 21 78 CD D0 05 CALL 05D0 H Display the seconds in data field
21 13 06 00 MVI B, 00H B=00 21 7B 3E 01 MVI A, 01H
21 15 21 54 20 LXI H, 2054H Current sec. 21 7D D3 00 OUT 00H Exite the 8255:1 for engergising the
21 18 CD D0 05 CALL 05D0H Address of LSD of current sec. relay (rings the bell)
21 1B 21 55 20 LXI H, 2055H 21 7F 21 55 20 LXI H, 2055H
21 1E 7E MOV A, M Move the LSD of current sec. to acc. 21 82 3E 00 MVI A, 00H Stores 00 to memory location
21 1F C6 01 ADI 01 H Add 01 to acc. 21 84 77 MOV M, A 2055 to
21 21 FE 0A CPI 0AH Compare LSD of sec. with 0AH (10 21 85 2B DCX H 2052 H
decimal) 21 86 77 MOVM, A
21 23 CA 36 21 JZ RR If LSD completes 09 jump to RR 21 87 2B DCX H
21 26 77 MOV M, A Move the acc. content to 20 55 H 21 88 77 MOV M, A
location 21 89 2B DCX H
21 27 06 02 DD MVI B, 02H Delay 21 8A 77 MOV M,A
21 29 11 00 FA YY LXI D, FA00H Sub- 21 8B 2B DCXH
21 2C CD 00 25 CALL 2500H Routine 21 8C 7E MOV A, M Brings the LSD current period
21 2F 05 DCR B For no. to acc
21 30 C2 29 21 JNZ YY 1 second 21 8D C6 01 ADI 01 Add 1 to it compare with OA
21 33 C3 09 21 JMP AA After delay of 1 sec. 21 8F FE 0A CPI 0A
Jump to AA for display the time 21 91 CA 98 21 JZ XX If LSD of period no. complete 09 then
21 36 3E 00 RR MVI A, 00H A=0 jump to XX
21 38 77 MOV M, A Store Acc. To memory location 21 94 77 MOVM, A Else store it to memory location
21 39 2B DCX H Decrement HL pair content 21 95 C3 A0 21 JMP XY Jump to XY
21 3A 7E MOV A, M Move the MSD of sec to acc. 21 98 3E 00 XX MVI A, 00H A=0
21 3B C6 01 ADI 01H Add 01 to Acc. 21 9A 77 MOV M,A Store it to main location
21 3D FE 06 CPI 06H Compare MSD of sec with 06H 21 9B 2B DCX H
21 3F CA 46 21 JZ UU If sec. complete 59 move to UU 21 9C 7E MOV A, M Store MSD of period no. to acc
21 42 77 MOV M, A Store acc. content to memory 21 9D C6 01 ADI 01H Add 1 to it
location 21 9F 77 XXX MOV M,A Store it memory location
21 43 C3 27 21 JMP DD Jump for delay of 1 sec. 21 A0 06 02 XY MVI B, 02
21 46 3E 00 UU MVI A, 00 Put A=00 after completing 59 21 A2 11 00 FA XYZ LXI D, FA 00H Program 1 sec display
seconds 21 A5 CD 00 25 CALL 2500 H
21 48 77 MOV M,A 21 A8 05 DCR B
21 49 2B DCX H 21 A9 C2 A2 21 JNZ XYZ
21 4A 7E MOV A,M Move current LSD of minutes to acc. 21 AC AF XRA A=0
21 4B C6 01 ADI 01H Add 01 to acc. 21 AD 47 MOV B,A B=0
21 4D FE 0A CPI 0A Compares acc. to 0A H 21 AE 21 50 20 LXI H, 2050H
21 4F CA 56 21 JZ VV Jump to VV if LSD of minutes 21 B1 CD D0 05 CALL 05D0H
completes 09 21 B4 3E 01 MVI A, 0IH
21 52 77 MOV M,A Move acc. to memory location 21 B6 06 00 MVI B, 00H Program to display
21 53 C3 27 21 JMP DD Jump for delay of 1 sec. 21 B8 21 54 20 LXI H, 2054 H The period no.
21 56 3E 00 VV MVI A,00H 21 BB CD D0 05 CALL 05 D0 H Minutes and second
21 58 77 MOV M,A 21 BE 21 55 20 LXI H, 2055H
21 59 2B DCX H Decrement H-L pair content 21 C1 7E MOV A, M LSD of stored current second to acc
21 5A 7E MOV A,M Move MSD of minutes to acc. 21 C2 C6 01 ADI 01H Add 1 to it
21 5B C6 01 ADI 01H Add 01 to acc. 21 C4 FE 06 CPI 06H Compare with 06
21 5D FE 04 CPI 04H Compare acc. content with 04 H 21 C6 C2 9F 21 JNZ XXX If not 06 jump to XXX
21 5F CA 66 21 JZ SS If minutes 40 then jump to SS 21 C9 3E 00 MVIA, 00H A=0
21 62 77 MOV M,A 21 CB D3 00 OUT 00H Output to 8255 to de-energise
21 63 C3 27 21 JMP DD Jump for delay of 1 sec the relay
22
CIRCUIT IDEAS
Address OP CODE LABEL Mnemonic Comments Address OPCODE LABEL Mnemonic Comments
21 CD C3 09 21 JMP AA Repeat for next period DATA
20 50 00 MSD of period no.
DELAY SUBROUTINE 20 51 00 LSD of period no.
25 00 1B NEXT DCX D 20 52 00 MSD of minutes
25 01 7A MOV A, D 20 53 00 LSD of minutes
25 02 B3 ORA E 20 54 00 MSD of seconds
25 03 C2 00 25 JNZ NEXT 20 55 00 LSD of seconds
25 06 C9 RET
DESIGNING AN RF PROBE
In other words, for 5-watt power in a
50-ohm load, the voltage across the load
is 15.85 volts.
The rectified DC voltage at the cath-
RUPANJANA
ode of diode D1 is at about the peak level
N.S. HARISANKAR, VU3NSH of the RF voltage at the tip of the probe.
Use shielded cable in between the probe
R
adio frequency probe is used to output and meter. It will act as feed-
TABLE I
directly measure the level of RF through capacitance and thus avoid RF in-
Voltage to Watts Conversion terference. The maximum RF input volt-
RMS voltage present across two
for 50 ohms Termination
points. It is one of the most useful test age level depends on the peak inverse volt-
RMS (V) RF Power (W) age (PIV) of diode D1. The shielded lead
instruments for home brewers as well as
2.24 0.1 length is too large to give accurate re-
for communication equipment service/de- 3.88 0.3
sign labs. 5.0 0.5
sults at UHF. Please refer Tables I and II
RF voltage level being measured pro- 7.08 1
vides useful information only when the 12.25 3
Table II
probe has been designed for use with a 15.90 5
20.0 8 Meter DC Impedence Rx
specific multimeter. The design of RF 22.4 10 20 Meg-ohm 8.25 Meg-ohm
probe is a function of the meter we in- 38.75 25 10 Meg-ohm 4.14 Meg-ohm
tend to use it with. If a meter with a 41.85 35 1 Meg-ohm 41.4 kilo-ohm
different input resistance is used with the 50.0 50 20 kilo-ohm 8.28 kilo-ohm
probe, the reading will be incorrect. The
value of RX (refer figure) is so chosen that (E) so mea-
when this resistor is connected in paral- s u r e d
lel with input resistance of the multim- across a
eter, the peak value is about 1.414 times given load
the RMS voltage. Resistor RX has to drop resistance
this excess voltage so that meter indica- ( R ) to RF
tion is accurate. If we know the input watts (W )
resistance of the meter, we can calculate using the
the value of RX with the help of the fol- following
lowing relationship: relation-
Let meter DC input resistance ship:
X 1.414 = RY Power P
Then RX = Ry – meter DC input resis- = E2 / R
tance watts (W)
For example, if meter input resis- For example, if RF probe voltage read- for ready conversion of RF voltage level (RMS) to
tance is 20 meg-ohm, Ry = 28.28 meg- ing across a load resistance of 50 ohms is equivalent power across a 50-ohm load and deduc-
ohm and RX = 8.28 meg-ohm. found to be, say, 15.85 volts, the power in tion of R value for a given meter’s DC input resis-
X
We can convert the RF voltage level the load = 15.85 x 15.85 / 50 = 5W approx. tance respectively.
23
February
2000
CONSTRUCTION
PC BASED SPEED
on any general-purpose PCB, no PCB lay-
out is included for it. The two wires to be
G.S. SAGOO extended to 25-pin parallel port may be
connected using a 25-pin male ‘D’ connec-
T
his project describes the software the machinery. The output of the circuit, sensitivity, i.e. the maximum distance
and hardware necessary to moni- available across resistor R2, is fed to the from a metallic object such that the
tor and capture in real time the PC via 25-pin ‘D’ connector of parallel port switch operates. These specifications are
speed of any rotating object. The speed LPT1. Pin 11 pertains to data bit D7 of the normally mentioned on the proximity
may be defined/stored/displayed in any of input port 379(hex) of the LPT1 port hav- switch itself or in the accompanying lit-
the three units: RPM (rev./minute), RPS ing base address 378(hex), and pin 25 is erature.
(rev./second), or RPH (rev./hour). The sys- connected to PC ground. (In fact, pins 18
tem uses a sampling time of two seconds through 25 of the parallel port are strapped
and can store up to 16 minutes of data per together and connected to ground.) The software
file. The x and y axes can be scaled to read The proximity switch is mounted on The structural block diagram of the soft-
any speed and the x-axis can be ‘stretched’ a stationary part, such as a bolt or stud, ware is shown in Fig. 4. The software has
to observe clustered points. in such a way that it senses each tooth of the following four main modules, which
The hardware mainly comprises a the rotating part as shown in Fig. 3. Two are activated from the main menu using
proximity switch whose output is con- fixing nuts are provided on the threaded four of the function keys, F1 through F4.
nected to the printer
(LPT1) port of the com-
puter through an opto-
coupler. The proximity
switch is used as a
speed-sensor. The pro-
gram is written in C++
and has effective error
handling capability and
a help facility. This sys-
tem can be used to
monitor the speed of ro-
tating parts in the in- Fig. 1: Interface circuit for PC based speed monitoring system
dustry or to read and
record wind speeds. body of the proximity
switch for securing it
firmly onto a fixed
The hardware interface part of the machinery.
The hardware interface circuit is given The software
in Fig. 1. A 230V AC primary to 0-9V, prompts the operator
250mA secondary transformer followed to enter the number of
by IC 7805 is used for catering to the teeth (being sensed
power supply requirement for proximity during every revolu- Fig. 2: Proximity switch
switch and the opto-coupler. The proxim- tion), which is used by
ity switch, as shown in Fig. 2, is a 3-wire the program for calculation
switch (e.g. PG Electronics’ EDP101) of RPM, RPS, or RPH, as
which operates at 6V to 24V DC. the case may be. In any
The inductive type proximity switch specific application, where
senses any metal surface from a distance non-metallic rotating parts
of about 5 mm to 8 mm. Thus, a gear or are present and inductive
fan blade is ideal for counting the number proximity switch cannot be
of revolutions. The number of teeth that used, one may use photo-
trigger (switch-on) the proximity switch electric switch to do the
during every revolution are to be known counting for 2-second sam-
for the software to calculate the speed of pling period. Fig. 3: Mounting of proximity switch
25
CONSTRUCTION
PARTS LIST
Semiconductors:
IC1 - 7805 regulator 5V
IC2 - MCT2E opto-coupler
Resistors (all ¼ watt, ± 5% metal/carbon
film, unless stated otherwise)
R1 - 300-ohm
R2 - 150-ohm
Capacitors:
C1 - 1000µF, 16V electrolytic
C2 - 0.22µF polyster
Miscellaneous:
X1 - 230V AC primary to 0-9,
250mA sec. transformer
BR-1A - Bridge rectifier, 1-amp.
S1 - Proximity switch (refer text)
26
CONSTRUCTION
with extension. and units, etc. HELPS.PG1. If this file cannot be opened,
(b) Enter the x-axis scale factor to en- (c) While still in the graph mode, you or is not available, the software prompts
able the graph to be ‘stretched’ on the x- may view a new graph after pressing F1. with “Help file not found or cannot be
axis to observe cramped points properly. For returning to the main menu, press opened.” Pressing any key from the help
After entering the x-axis scale, the graph F2. page returns one to main menu. The con-
appears along with all relevant data, like 3. Help. This module provides one tents of HELPS.PG1 are given in the box
scale factors for x and y axis, file name, page of help and reads from a file called (on previous page).
27
CONSTRUCTION
28
CONSTRUCTION
29
CONSTRUCTION
A
n electronics hobbyist always finds reo cassette player is shown in Fig. 1. plifier are routed to the function selector
pleasure in listening to a song The circuit may be divided into three func- configured around two CD4066 (quad bi-
from a cassette player assembled tional sections as shown in the block dia- polar analogue switches) and an HEF4017
with his own hands. Here are the details gram. (decade counter).
of a stereo cassette player with the fol- Section I (Fig. 2). It comprises a ste- When any control input pin (5, 6, 12,
lowing features, which many electronics
enthusiasts would love to assemble and
enjoy:
1. Digital 4-function selector (radio,
tape, line input, and transmit).
2. Four sound modes (normal, low
boost, hi-fi, and x-bas).
3. Bass and treble controls.
4. Function and output level displays.
5. Built-in FM transmitter for cordless
head-phones.
Description
The functional block diagram of the ste- Fig. 1: Functional block diagram of stereo cassette player
30
CONSTRUCTION
and 13) of tions. In other words, it acts like an ana- nals from the output of the preamplifier
CD4066 , as logue switch which can be turned on or reach the output terminals of the circuit.
shown in off by making its input control pin high At the same time, a 9V regulated power
Fig. 3, is or low. A single IC contains four such supply to the preamplifier is switched on
made high, switches/sections (A, B, C, and D). The through transistor T1. When Q2 (pin 4)
it can switch control inputs of the two ICS (CD4066) goes high, any audio signals applied to
AC and/or are derived from the decade counter IC the auxiliary I/P terminals (Aux. I/P (L)
DC signals (HEF4017). Only four outputs of this IC and Aux. I/P(R)) reach the output termi-
between its (Q0 through Q3) are used and the fifth nals. When Q3 (pin 7) goes high, the
correspond- output Q4 (pin 10) is connected to the power to both the FM transmitter and
ing output reset pin (pin 15) via diode D1. preamplifier is switched on and the sig-
pins (3-4, 8- When power is turned on, the output nals from the preamplifier appear at the
9, 10-11, and Q0 (pin 3) of this IC will be high. In this base of transistor T3 (BF494) which, in
Fig. 3: Internal schematic 1-2 respec- condition any audio signal fed to the ‘ra- association with some passive compo-
diagram of CD4066 tively) in dio I/P’ terminal reaches the output. If nents, forms an FM transmitter. The de-
switcher IC both direc- desired, the audio output from a radio tails of coil L1 are included in the parts
receiver can be connected list. The frequency of this transmitter falls
to this input terminal. between 88 and 108 MHz.
Circuit diagram and de- The frequency can be slightly varied
tails of such radio receiv- by adjusting trimmer capacitor VC1. The
ers have appeared in ear- transmitted signals can be received on any
lier issues of EFY. FM receiver working in 88-108 MHz
With each depression range. LEDs D2 through D5 are bilateral
of switch S1, the outputs LEDS which are used to display the se-
of IC4 (Q0-Q3) go high se- lected function.
quentially to control dif- Section II. This section employs a
ferent modes of operation. JFET dual operational amplifier LF353
When Q1 (pin 2) of IC4 whose gain for different audio frequen-
Fig. 4: Simplified schematic diagram of tone and sound goes high, the audio sig- cies is controlled by the corresponding po-
mode control (left channel)
tentiometer settings (VR3 and
VR6 for bass, VR4 and VR5 for
treble for left and right channels
respectively) and, additionally,
by sound mode selector switch
S2. The simplified circuit dia-
gram for left channel is shown
in Fig. 4, while the complete
schematic circuit diagram is
shown in Fig. 5.
In the simplified diagram,
the function of decade counter
IC (HEF 4017) and bipolar ana-
logue switcher ICs (CD4066) are
replaced by a simple switch, SW.
The output of preamplifier (sec-
tion I) is applied as input to the
inverting terminal of op-amp IC8
and at the output we obtain a
180o phase shifted amplified sig-
nal. Potentiometers VR3 and
VR4 are used to control low fre-
quencies (bass) and high fre-
quencies (treble) respectively.
In the normal mode (Q0 out-
put of IC7 high), pole-P of switch
SW is in contact with terminals
1 and 2 simultaneously. In this
condition, normal gain is
achieved for both high and low
Fig. 5: Tone and sound mode control (Section II) frequencies as per settings of
31
CONSTRUCTION
PARTS LIST
Semiconductors: R25,R32,R29, C38,C41,C43,C45 - 0.047µF polyester
IC1 - LA3161 stereo preamplifier R34 R41,R42 - 2.2-kilo-ohm C39,C42 - 2.2nF polyester
IC2,IC3,IC5,IC6 - CD4066B quad bilateral R43,R44 - 1-ohm C40,C44 - 6.2nF polyester
analogue switch R45-R50 - 33-kilo-ohm C58,C61 - 470µF, 25V electrolytic
IC7,IC4 - HEF4017B decade counter R61 - 680-ohm C62 - 2200µF electrolytic
IC8 - LF353 JFET input dual R62 - 330-ohm,0.5W C63-C66 - 4.7µF, 25V electrolytic
op-amp VR1-VR3,VR6 - 47-kilo-ohm linear C67,C69 - 1000µF, 25V electrolytic
IC9 - TA7230 stereo power potmeter C68,C70 - 4700µF, 25V electrolytic
amplifier VR4,VR5 - 100-kilo-ohm linear VC1 - 8-25pF trimmer
IC10 - KA2281 stereo level potmeter Miscellaneous:
indicator VR7 - 220-kilo-ohm linear L1 - 5T, 22 SWG, 5mm dia air
T1 - 2SC1815 npn transistor potmeter core
T2 - CL100 npn transistor VR8,VR9 - 47-kilo-ohm log potmeter L2 - 250T, 18 SWG over a
T3 - BF494 npn transistor Capacitors: ferrite rod
D1,D12,D13, C1,C5,C17,C27-C30, X1 - 230V AC primary to 12-0-
D24 D25,D9 - 1N4001 rectifier diode C32,C47,C59,C60 - 0.1µF ceramic disc 12V, 2A sec. transformer
D2,D3,D4,D5 - Bilateral coloured LEDs C2,C4,C24 - 100µF, 25V electrolytic S1,S2 - Push-to-on tactile switch
D6-D8,D14-D23 - Coloured LED C3,C11,C26 - 22nF ceramic disc - Tape drive mechanism
D10,D11 - 1N5408 rectifier diode C6,C16,C22,C23 complete with 200-ohm
D26,D27 - 9.1V zener C34,C36,C22, R/P stereo head, leaf
Resistors (all ¼W, ±5% metal carbon film, C23,C52,C53 - 1nF ceramic disc switch, and 12V DC, 2400
unless stated otherwise) C7,C15,C35,C37 rpm motor
R1,R6,R10 - 100-ohm C49,C50,C10, - Telescopic antenna
R2,R7 - 7.5-kilo-ohm C12,C51,C54 - 10µF, 25V electrolytic LS1,LS2 - 4-ohm, 8W, 9cm diameter
R3,R8,R22,R23, C8,C13,C55, woofers with piezoelectric
R28,R37,R39,R40 - 100-kilo-ohm C56,C57 - 47µF, 25V tweeter
R4,R9,R11, C9,C14 - 15nF polyester - Readymade FM/AM radio
R26,R35 - 10-kilo-ohm C18 - 100pF ceramic disc reciever kit
R5 - 150-ohm C19 - 22pF ceramic disc - Cabinet
R12,R13 - 1.2-kilo-ohm C20 - 10pF ceramic disc - Shielded cable
R14-R21,R51-R60- 1-kilo-ohm C21 - 68pF ceramic disc - Heat sink and other
R24,R27,R33,R30 C25 - 1µF, 25V electrolytic hardware items
R31,R36,R38 - 4.7-kilo-ohm C31,C33,C46,C48 - 2.2µF, 25V electrolytic
32
CONSTRUCTION
tact with terminal 3 (Q3 output of IC7 to the IC to prevent thermal run-away. sembled on a single PCB. A separate PCB
high), normal gain is provided for the Potmeters VR8 and VR9 are volume con- is used for the audio level indicator
high-frequency components (treble) and trols for left and right channels respec- and for mounting LEDs (D2 through
higher gain is available for a wide range tively, while VR7 is the balance control. D8). Single-sided, actual-size PCB for the
of low frequencies (including some mid- A dual power supply is used for the complete circuit is given in Fig. 7. The
range frequencies). This is termed as the circuit. The +12V section uses a π filter component layout for the PCB is shown
X-BAS mode. The gain of the amplifier with capacitors in the parallel arms and in Fig. 8.
for different frequencies, in each of the an inductor in the series arm. However, Use sockets for all ICs except IC1 and
above-mentioned modes, is also dependent for the – 12V supply, the inductor of the IC9. Shielded wires must be used for con-
on VR3 and VR4 potmeter settings. series arm (as used for +12V supply) is nections to stereo head and all potentio-
In the actual circuit diagram, the bi- replaced by a resistor. Filters are provided meters. The PCB must be mounted away
polar analogue switcher (CD4066) replaces to reduce the ripple factor and thereby from power transformer and DC motor.
switch SW. The LEDs D6, D7, and D8 reduce hum (noise). Please refer inductor Inductor L2 should also be placed
are used to represent the sound modes— details in parts list. away from the power transformer. If in-
low-boost, hi-fi, and X-BAS repsectively. The audio level indicator is built ductor L2 is difficult to procure or fabri-
Switch S2 is used to select variouse sound around IC KA2281. LEDs D14 through cate, it may be substituted with a 5-ohm,
modes. At power on, Q0 (pin 3) of IC7 is D23 are connected at its outputs to show 5W wire-wound resistor.
high and therefore normal sound mode the audio level of each channel in five A suitable cassette drive mechanism
is on. steps. The input to this audio level indi- and cabinet may be used to assemble the
Section III (Fig. 6). This section com- cator is derived from the output of the stereo cassette player. Readymade cabi-
prises an audio power amplifier, a 12V power amplifier. The gain of this level nets and cassette mechanisms are avail-
dual power supply, and an audio level in- indicator can be varied by changing the able in the market.
dicator. The power amplifier used is the values of resistors R49 and R50. Adjust potmeters VR1 and VR2 for
popular IC-TA7230, which delivers up to minimum distortion at higher volume
7-watt (RMS) power per channel into a level. Use separate aerials for FM trans-
4-ohm load. This IC has in-built short cir-
Assembly mitter and FM receiver. ❏
cuit protection and over-temperature cut- The complete circuit, with the exception
off. A suitable heat sink must be connected of the audio level indicator, can be as-
34
C I RC ICR CUUII TT I ID D
EAS
EAS
STEREO SYSTEM
in parallel with potentiometer VR2. In this
position, bass will have maximum attenu-
ation, producing bass cut.
G.S. SAGOO
Bass boost and bass cut are effective
by ±15 dB at 16 Hz, compared to the out-
VIVEK SHUKLA
put at 1 kHz. Treble boost and treble cut
are also effective by the same amount at
M
odern audio frequency amplifi- control. When the slider of potentiometer 20 kHz, compared to the value at 10 kHz.
ers provide flat frequency re- VR1 is at the lower end, minimum treble After assembling the circuit, we may
sponse over the whole audio signal develops across the load. The low- check the performance of the bass and
range from 16 Hz to 20 kHz. To get faith- est point is referred to as treble cut. As treble sections as follows:
ful reproduction of sound we need depth the slider is moved upward, more and 1. Set the slider of the potentiometers
of sound, which is provided by bass (low more treble signal is picked up. The high- at their mid-positions.
notes). Hence low-frequency notes should est point is referred to as treble boost. 2. Turn-on the stereo system.
be amplified more than the high-frequency Bass would be cut if capacitive reac- 3. Set the volume control of stereo
notes (treble). To cater to the individual
taste, and also to offset the effect of noise
present with the signal, provision of bass
and treble controls is made. The combined
control is referred to as tone control.
The circuit for bass and treble control
shown in the figure is quite simple and
cost-effective. This circuit is designed to
be adopted for any stereo system. Here,
the power supply is 12-volt DC, which
may be tapped from the power supply of
stereo system itself. For the sake of clar-
ity, the figure here shows only one chan-
nel (the circuit for the other channel be-
ing identical). The input for the circuit is
taken from the output of preamplifier tance in series with the signal increases. system at mid-level.
stage for the left as well as right channel Thus, when the slider of potentiometer 4. Set the slider at the position of op-
of the stereo system VR2 is at the upper end, capacitor C1 is timum sound effect.
Potentiometer VR1 (10-kilo-ohm) in shorted and the signal goes directly to This circuit can be easily assembled
series with capacitor C4 forms the treble the next stage, bypassing capacitor C1. using a general-purpose PCB.
H
ere is a very low-cost circuit to to damage due to such conditions. for the supply to transformer X1 as also
save your electrically operated The simple circuit given here switches the load via closed contacts of switch S1.
appliances, such as TV, tape re- off the mains supply to the load as soon Meanwhile, the supply to relay becomes
corder, refrigerator, and other instruments as the power trips. The supply can be available and it gets energised to provide
during sudden tripping and resumption of resumed only by manual intervention. a parallel path for the supply to the trans-
mains supply. Appliances like refrigera- Thus, the supply may be switched on only former as well as the load.
tors and air-conditioners are more prone after it has stabilised. If there is any interruption in the
35
CIRCUIT IDEAS
T
his digital water level meter shows this frequency counter needs two types of negative going pulses which are continu-
up to 65 discrete water levels in inputs. One of the these is a continuous ously available at its pin 2. At the same
the overhead tank (OHT). This 30Hz clock (approx.), which is applied to time the pnp transistor T1 remains cut-off
helps to know the quantity of water in pin 2 of IC1. The other is a timing pulse, due to the positive voltage at its base, and
the OHT quite precisely. The
circuit is specially suited for
use in apartments, hostels,
hotels, etc, where many taps
are connected to one OHT.
In such cases, if someone for-
gets to close the tap, this cir-
cuit would alert the opera-
tor well in time.
Normally, for multi wa-
ter level readings, one has to
use complicated circuits em-
ploying multi-core wires from
the OHT to the circuit. This
circuit does away with such
an arrangement and uses
just a 2-core cable to monitor
various water levels. Fig. 2.
shows various water levels
and the corresponding read-
ings on 7-sement displays.
IC1 and IC2 shown in Fig.
1 are CD4033 (decade up
counter cum 7-segment de-
coder) which form a two-digit
frequency counter. The CK
pin 1 and CE pin 2 of IC1 are
used in such a way that the
counter advances when pin 1
is held high and pin 2 under-
goes a high-to-low transition.
For water level reading, Fig. 1
36
CIRCUIT IDEAS
T
he full-scale deflection of the uni- depends on the function switch position 3.00V 24 µA
versal high-input-resistance volt- as follows: 2.00V 14 µA
meter circuit shown in the figure (a) 5V DC on position 1 1.00V 4 µA
37
CIRCUIT IDEAS
TRIAC/TRANSISTOR CHECKER
milliammeter or a multimeter to monitor
the current flowing through the SCR. If
the SCR is ‘no good,’ the LED would never
glow. If the SCR is faulty (leaky), the LED
PRAVEEN SHANKER would glow by itself. In other words, if
RUPANJANA
the LED glows only on pressing switch
S1 momentarily and goes off on pressing
H
ere is a very simple circuit which
can be used for testing of SCRs
as well as triacs. The circuit
could even be used for checking of pnp
and npn transistors.
The circuit works on 3V DC, derived
using a zener diode in conjunction with a
step-down transformer and rectifier ar-
rangement, as shown in the figure. Alter-
natively, one may power the circuit using
two pencil cells.
For testing an SCR, insert it in the Fig. 1
socket with terminals inserted in proper
slots. Slide switch S3 to ‘on’ position (to- switch S2, the SCR is good.
wards ‘a’) and press switch S1 momen- For testing a triac, initially connect
tarily. The LED would glow and keep its MT1 terminal to point A (positive),
glowing until switch S2 is pressed or MT2 to point K (negative), and its gate to
mains supply to step-down transformer point G. Now, on pressing switch S1 mo-
is interrupted for a short duration using mentarily, the LED would glow. On press-
switch S4. This would indicate that the ing switch S2 momentarily, the LED
SCR under test is serviceable. would go off. Next, on pressing switch S5,
With switch S3 in ‘off’ position (to- the LED will not glow.
Fig. 2
wards ‘b’), you may connect a Now reverse connections of MT1 and
38
CIRCUIT IDEAS
MT2, i.e. connect MT1 to the negative actually two SCRs connected back to back. Fig. 2 indicates the conventional current direc-
and MT2 to the positive side. For a good The first accepts positive pulse for con- tion and forward biasing condition for pnp and npn
working triac, S2 would not initiate con- duction while the second accepts nega- transistors. If the transistor under test is of npn type,
duction in the triac and the LED would tive pulse for conduction.) on pressing S1, theLED glows, and on releasing or
remain off. On the other hand, momen- You can also check transistors with lifting the finger, it goes off, indicating that the tran-
tary depression of S5 would initiate con- this circuit by introducing a resistor sistor is good. For pnp transistor, the LEDglows on
duction of the triac and LED1 would glow. (about 1 kilo-ohm) between the junction pressing switch S5 and goes off when it is released.
The indication of a leaky triac is simi- of switches S1 and S5 and point G. The This indicates that the transistor under test is good.
lar to that of an SCR. If, during both the collector of npn or emitter of pnp tran- A leaky or short-circuitedSCR or transistor would
above-mentioned tests, the LED lights up, sistor is to be connected to positive (point be indicated by a permanent glow of the LED by
only then the triac is good. A), while emitter of an npn and collector itself, i.e. without pressing switch S1 or S5.
Before connecting any SCR/triac in the of a pnp transistor is to be connected to
circuit, please check its anode/MT1’s con- negative (point K). The base in both cases
nection with the case. (Note: A triac is is to be connected to point G.
E
lectronics For You readers are
TABLE I
very much familiar with the func-
VR1 Frequency Frequency
tioning of timer 555 in astable (Ω) (Hz) (C1=0.1µ) (Hz) (C1=1µ)
mode of operation. Traditionally, if at all 10 453 46
there was a need to keep the duty factor 33 455 46.5 results in increase of frequency, instead of
constant and change the frequency con- 68 459 47 decrease. When the value of variable re-
tinuously, the method was to use a vari- 100 462 48 sistor is zero, frequency is given by
220 467 50
able capacitor, rated in picofarads. But in 500 478 52
that case, changing the frequency in tens 1000 506 55
of hertz range would become tedious. On 2000 585 63 Now, when the value of variable re-
the other hand, sacrificing duty factor, 3300 780 81 sistor VR1 is increased, the frequency in-
4700 1300 140
change of frequency can be done by chang- creases from the value of ‘f ’ as determined
5600 2200 244
ing the values of R1 or R2. Duty Cycle Duty Cycle from above formula (with VR1=0).
Both of the above-mentioned problems =66% =68% Lab note: The circuit has been prac-
can be overcome simply by using a vari- Note: Using higher values of capacitors (e.g., tically verified with two different values
able resistor, as shown in the circuit dia- 10µ) or higher values of resistors (e.g., 6.8k), of timing capacitor C1 and the results
gram. Surprisingly, increase of resistance the results were found to be erratic. obtained are tabulated in Table I.
39
March
2000
CONSTRUCTION
T
he voltage developed across a ca-
pacitor or an inductor in a series-
resonant LCR circuit reaches its When inductance Lw (in micro Hen-
maximum value at resonance. This fact ries) of the work-coil is known, the value
can be used to find the value of an un- of unknown inductor, LX, can also be cal-
known inductance or a capacitance. The culated using the relation:
present circuit is based on this very prin-
ciple and it may be used to measure an
inductance of even less than 1 µH, or a Author’s prototype
capacitance of the order of a few pico Far- Alternatively, the coil under test can
ads. The quality factor ‘Q’ of the circuit prising a known value of inductance (called be connected directly to the circuit, with-
can be measured if the applied RF volt- work-coil) and a standard variable cali- out any work-coil in series. In this case
age and the resonant voltage, developed brated capacitor. The resonance condition the inductance is given by the relation:
across an inductor or a capacitor, are mea- is detected by a peak detector which de-
sured with the help of a sensitive RF volt- tects the peak voltage developed across
41
CONSTRUCTION
42
CONSTRUCTION
TABLE III
Here, r is the mean ra-
Determination of the Unknown
dius, l is the length of the
Inductances by Two-frequency
Method coil in inches, and n is the
Fig. 5: Component layout for the PCB number of turns per inch
Coil Peak response C(pF) Results
obtained at L(µH) of the selected SWG (as per
fosc (MHz) wire tables). Initially, a table of l-vs-L is
ness in tuning. The peak detector input to be generated for a particular SWG, by
L1 3.5 265.2
6 74.8 7.16 should not have any direct coupling with putting various values of winding length
L2 10 81.6 the power amplifier via a stray resistance l in equation (6) and finding the resultant
14.3 20.4 2.1 or capacitance, as it would cause hin- L. The winding length, and consequently
L3 1.8 265.2 drance during the search for a peak. the number of turns required for the in-
3.5 37.8 25.2 To get better results, different work- ductance calculated above, may then be
coils are to be used with different crystal found from this table. However, it is to
sistor T3), it would show a dip in the in- frequencies. The details of these coils are be noted that formula (6) above could only
tensity of the LED, as the resonant cir- given in Table I. help us to get close to the target induc-
cuit is tuned to a peak. If a continuously variable RF source tance. The desired value is then achieved
Positive 9V supply, for the meter cir- is desired, one may substitute the crystal by adjusting its core, after connecting the
cuit, is derived using a conventional three- in the oscillator circuit with a suitable coil in the circuit.
terminal fixed-voltage regulator IC 7809. combination of an inductance and a vari- In equation (6) we may substitute N
AC mains voltage is stepped down by able condenser. The approximate fre- (total number of turns) for product l.n, if
power transformer X1 from 230V AC to quency of oscillation of the circuit can be desired.
12V AC, which is then rectified to deliver determined with the help of a radio re-
the unregulated DC input to the regula- ceiver—by bringing it close to the meter
tor IC. (Refer Fig. 2.) circuit. The frequency on the dial at which Methods
maximum reception would be heard is the Some methods to find the value of induc-
desired frequency. tance are given below:
Construction The required inductance for a particu- 1. Direct connection. Most of the un-
During construction, special care is to be lar frequency range can be calculated from known inductances may be measured by
exercised towards lead dressing. Any stray the following relation: connecting them directly to the circuit and
coupling from output to input through a using the relation:
stray capacitance, or an unwanted mu-
tual inductance, may produce unwanted
oscillations, which would hamper the re- Here, C is in µF and Cmax ≅ 280 pF for
liability of the meter. Since stray capaci- 2J. λ is the wavelength in metres corre- Here, f is in MHz and C is in pF. The
tances play a very adverting role in a mea- steps to be followed are given below:
surement, the same should be minimised TABLE IV 1. Switch on the RF generator
by keeping the length of the connecting Determination of Unknown Inductances (switch S1) with the coil under test
wires as short as possible. by Series Connection Method connected to the circuit across points
The voltage developed across tuning Coil Peak response C(pF) Results X1-X2.
capacitors (CT and CF) gradually increases obtained at (µH) 2. Switch on S2 to apply RF power
as the frequency of oscillation is lowered. fosc (MHz) to the resonating network.
Hence, the input to the peak detector L1(Lw) 6 65 3. Rotate LED-intensity-control
must be controlled accordingly for its safe L1(Lw)+L2(Lx) 6 40.8 L2=2.3 potmeter VR1 to obtain the maximum
operation. On the other hand, a reduc- L3 (Lw) 1.8 265.2 intensity of LED D5.
L3(Lw)+L4(Lx) 1.8 156.4 L4=13.6
tion in the applied voltage to the peak 4. Tune calibrated tuning capaci-
detector reduces the current through the L2(Lw) 14.3 20.4 tor CT (and/or fine-tuning calibrated
L2(Lw)+L5(Lx) 14.3 10.3 L5=0.43
LED, which again enhances the sharp- capacitor CF) for maximum intensity
43
CONSTRUCTION
of LED D5, or peak on the meter. The against a particular crystal and work-coil MHz crystal, 17µH work-coil, and a 2J
intensity of LED D5, or the deflection of combination. capacitor for CT.
the meter pointer, would be the maxi- 2. Read the capacitance values from 2. Rotate the tuning capacitor towards
mum at resonance. If no peak is found, it the dials. Let the sum be CA pF. its maximum capacity (approx. 280 pF).
might be due to low signal input to the 3. Connect the capacitor under test in 3. Tune by varying the slug of the coil
peak detector. Gradually decrease the in- parallel with CT. to get a peak on the meter or LED.
circuit resistance value of potmeter VR1. 4. Retune the circuit to get the peak 4. If you require a resolution of 10
If still no peak is found, it would mean back. pF, connect a standard low-tolerance 10
that crystal frequency is not appropriate. 5. Note the new values of capacitance pF capacitor in parallel with CT. Instantly
Try with another crystal. from the dials. Let the sum be CB pF. the circuit would be out of tune.
5. Note down the capacitance values 6. Calculate the unknown capacitance 5. Rotate capacitor CT to get back the
from the dials of CT and CF. The total from the relation: peak again. Mark the new position of CT.
value of capacitance C is given by C = Cx = (CA – C B) pF It would be Cmax =10 pF.
CT+CF+CStray. Method to determine an unknown 6. Redo steps 4 and 5 to cover the
The value of CStray may be in the range frequency. Frequency of an unknown RF entire angular span (=180o). Each time
of 10-30 pF. If CT is sufficiently high, CStray sinewave signal may be measured by fol- the new position of CT would be 10pF less
may be dropped from the calculation. lowing the steps given below: than its previous value.
6. Calculate the value of LX using 1. Connect a suitable work-coil in the
equation (7). circuit.
2. Series connection. This includes 2. Connect the RF signal source (with Limitations
following steps: unknown frequency FX) to the gate of While tuning with CT to get a resonance,
1. Insert a crystal in the crystal socket. buffer transistor T2, after disconnecting the LCR circuit may produce a peak volt-
Connect the coil under test across termi- the crystal oscillator from it, with the help age at the harmonic frequency of the crys-
nals X1-Y and a suitable work-coil across of switch S3. tal used, which would give misleading re-
X2-Y (Table I). Initially short X1-Y termi- 3. Apply power to the meter by turn-
sults. To avoid this situation, the posi-
nals using a small wire. Tune CT and CF ing switch S1 ‘on’.
tions of those harmonic frequencies on the
to get a peak on LED D5 (or meter). Note 4. Apply RF power to the resonant
dial of CT, for a particular crystal and
the capacitance values from the dials of circuit after turning switch S2 ‘on’.
work-coil combination, should be spotted
tuning capacitors CT and CF. Let this value 5. Tune the resonant circuit to get a
first, by rotating the capacitor over its
be CA. If no peak is obtained, try with peak. If no peak is obtained, try with an-
full swing.
another crystal and work-coil combination. other work-coil.
During tuning, if a conductive body is
2. Remove the short across X1-Y and 6. Note the capacitance value from
brought near the resonant network of the
retune the circuit by rotating CT (and/or the dials of the tuning capacitors. Let the
variable capacitor, interference would be
CF) towards lower capacitance value to sum be C.
7. Calculate the frequency of the in- produced.
establish the peak once again. Make a
fine adjustment using CF. Note the new coming RF signal using the following re-
positions on the dials. Let the new sum lation: Results
of CT and CF be CB. Coils practically wound, using the formu-
3. Calculate the value of the unknown MHz
lae given in the article, and inductance
inductance from Eqs (1) or (2) given above.
Here, Lw is in µH and C in pF. practically determined, using two-fre-
3. Two-frequency method. If a coil
quency method and series connection
of inductance LX gives peak responses on
method, are tabulated in Tables II, III,
two different frequencies—fA at CA and fB Calibration and IV respectively.
at CB on tuning the dial—then LX can be
If a standard variable capacitor is not Power supply may be assembled sepa-
calculated from the formula given below:
available, we may use, after proper cali- rately on the PCB, which may be cut out
bration, a 2J type variable capacitor which from the main PCB. Variable tuning ca-
is generally used for radio work. To cali- pacitors (CT and CF), snap connectors for
Method to find the value of capaci- brate the same, follow the steps given be- coils (L W and L X ), switches, LEDs,
tance. Follow the steps given below: low: potmeters, etc may be mounted on front
1. Tune the circuit to resonance 1. Switch on the RF source with a 3.5 panel. ❏
www.electronicsforu.com
a portal dedicated to electronics enthusiasts
44
CONSTRUCTION
WATER-LEVEL SOLUTION
a bridge rectifier, filter, and 12-volt regu-
lators [LM7812 for +12V (V CC ) and
LM7912 for –12V (V EE)]. Capacitors C1-
RUPANJANA C4, across rectifier diodes, and C8 and
LOKESH KUMATH C10, across regulator output, function as
noise eliminators. Diodes D5 and D6 are
O
ne major problem in using wa-
ter as a conducting medium
arises due to the process of elec-
trolysis, since the sensor probes used for
level detection are in contact with water
and they get deteriorated over a period of
time. This degradation occurs due to the
deposition of ions on the probes, which
are liberated during the process of elec-
trolysis. Thereby, the conductivity of the
probes decreases gradually and results in
the malfunctioning of the system. This
can be avoided by energising the probes
using an AC source instead of a DC
source.
The circuit presented here incorpo-
rates the following features:
1. It monitors the reservoir (sump
tank) on the ground floor and controls the
pump motor by switching it ‘on’ when the
sump tank level is sufficient and turning
it ‘off’ when the water in the sump tank
reaches a minimum level.
Fig. 1: Circuit diagram of complete water level solution (contd. refer Fig. 2)
Description
The power supply section (Fig. 1). It
45
CONSTRUCTION
Fig. 2: Part circuit of complete water level solution (contd. from Fig. 1)
used as protection diodes. are not met, the output of IC7 goes high to transistor T9 does not conduct with logic
The under- and over-voltage cut- de-energise relay RL1 via transistor T7. 0 voltage (1 to 2V) at its base.
off section (Fig. 1). It comprises a dual Bipolar squarewave generation When the motor is running (all the
comparator, two pnp transistors, and a (Fig. 1). One side of the secondary of inputs to NAND gate IC7 are high), tran-
few other discrete components. This part transformer X1 is also connected to op- sistor T9 base is pulled to ground and
of the circuit is meant to stop the motor in amp IC10 (µA 741), which is used here as thus capacitor C15 starts charging via re-
case of a low mains voltage (typically 180V a comparator to provide bipolar square sistor R16. The RC combination is selected
to 190V) or a voltage higher than a speci- wave (having positive and negative [using the well-known charging formula
fied level (say 260V to 270V). The unregu- halves). It is not advised to directly con- V(t) = Vfinal (1-e-t/RC)] such that it takes
lated DC is sampled by means of a poten- nect the secondary output to the probe in about 15 seconds for the capacitor to reach
tial divider network comprising resistors the tanks because, if due to any reason 1/3 Vcc, i.e. about 4 volts to clock flip-flop
R3 and R4. The sampled voltage is given the primary and secondary get shorted, IC4(a) to toggle, taking its Q pin low to
to two comparators inside IC LM319. The there is a risk of shock, as the secondary stop the motor (via IC7, transistor T7,
reference voltages for these two compara- would be directly connected to the probes and relay RL1). However, if water starts
tors are set by presets VR1 and VR2. The immersed in water inside the tank. But if flowing within 15 seconds after the start-
outputs of both the comparators are ac- we use a comparator in between the sec- ing of motor, transistor T8 would start
tive-low (normally high, until the low or ondary and probes, the IC would get open conducting and discharge capacitor C15,
high voltage limits are exceeded). That is, in case primary and secondary windings not allowing it to charge, irrespective of
when the AC mains goes below (or rises are short-circuited. For additional safety, the state of transistor T9. Thus capacitor
above) the preset levels, the outputs of fuses F2 and F3, both of 1A capacity, are C15 remains discharged.
the comparators change to logic zero. The connected to the output of secondary wind- But if water does not flow due to any
output of either comparator, when low, ings. reason, such as air lock or pump motor
results in lighting up of the respective Pump motor fault-detection circuit failure, IC4(a) toggles after about 15 sec-
LED—D7 (for lower limit) and D8 (for (Figs 1 and 2). A sensor probe detects onds, which makes its Q pin 2 low. As a
upper limit) via transistors T1 and T2 the flow of water. It is fixed just at the result, the output of IC7 goes high and
(2N2907), which are switching transistors. mouth of the inlet pipe, inside the over- the motor stops. Simultaneously, capaci-
The outputs from the comparators also head tank. When the motor is off (output tor C15 is discharged. At the instant Q
go to 8-input NAND gate IC7 (CD4068) to ‘G’ of NAND gate IC7 is high), transistor goes low, Q (pin 1) goes high and so a
control the motor via transistor T7. All T9 (2N222) is ‘on’ (saturated) and, there- clock is applied to IC5 via resistor-capaci-
inputs to IC7 are high when all conditions fore, capacitor C15 is short-circuited. It tor combination of R18-C16, so that clock
required for running of the pump motor also pulls the clock input pin 3 of IC4(a) input pin 14 of IC5 goes high after about
are fulfilled. When one or more conditions flip-flop to ground. Zener D30 ensures that 10 seconds. As a result, pin 2 of IC5 goes
46
CONSTRUCTION
Fig. 3: Actual-size, single-sided PCB layout for the circuit shown in Figs 1 and 2
high and resets IC4(a) to make Q high seconds to restart the motor. If this con- The output of IC9 is used to switch
again. This starts the motor again. dition repeats for the third time, pin 7 of ‘on’ the speaker at the set frequency. The
But if water still does not flow into IC5 goes high, to reset it. The same out- frequency (tone) can be set using preset
the OHT this time, Q of IC4(a) becomes put from pin 7 of IC5 functions as a clock VR4. The Q output of IC4(b) is also used
low again to switch off the motor. Simul- pulse for IC4(b), to give a logic high sig- to light up the ‘Motor Fault’ LED D27.
taneously, IC5 gets another clock pulse nal to RESET pin 4 of IC9 (NE555), con- This fault condition can be reset by press-
and IC4(a) is reset once again after 10 figured as astable multiviberator. ing switch S2 to reset IC4(a) and IC4(b),
47
CONSTRUCTION
48
C I RC ICR CUUII T
T I D E A S
IDEAS
T
he circuit presented here can be The BCD outputs of IC2 are con- counter counts up. Subsequently, when
used for producing eye-catching nected to IC3 (CD4028), which is a 1-of- output O9 become high, the flip-flop is
effects like ‘pendulum’ and ‘dash- 10 decoder. As per sequential BCD in- toggled and pin 10 of IC2 is pulled to
ing light’. To and fro motion of
a pendulum can be simulated
by arranging ten bulbs in a
curved fashion and lighting
them up sequentially, first in
one direction and then in the
other, using this circuit. For
pendulum effect, the frequency
of oscillator should be quite low.
Similarly, one may create
a dashing light effect by using
19 bulbs and connecting them
in such a way that bulb num-
ber 1 and 19, 2 and 18, 3 and
17, so on are in parallel. For
achieving the dashing light ef-
fect, the oscillator frequency
should be comparatively high.
In this circuit NOR gates
N1 and N2 form an oscillator
whose period can be adjusted
through potmeter VR1. Oscil-
lator output is fed to clock pin
15 of IC2 (CD4029), which is
a binary/BCD up/down
counter. As long as pin 10 of
IC2 is at logic 1, it counts up;
when it changes to logic 0, it
counts down. This changeover is ex- puts (up or down), outputs of IC3 go logic 0, and the counter starts counting
plained below. high and trigger the triacs (Triac1 down. The cycle repeats endlessly.
T
he audio level indicator described fect in the circles) also increases. The LEDs of one row may be made to ap-
here is quite simple and utilises lighting LEDs of one of the two circles pear moving from left to right and of
readily available ICs. The func- would appear to move in clockwise di- the other in the opposite direction, i.e
tion of the circuit can be understood rection, while the other circle’s LEDs from right to left.
with reference to Fig. 2 which shows appear to move in anticlockwise direc- In the circuit shown in Fig. 1, IC
two concentric circles formed by red and tion. When no audio is available, the 555 is wired to operate in an astable
green LEDs respectively. speed of these two roulettes appears to mode as a voltage controlled oscillator
When the audio level increases, the be constant. (VCO). The only difference here is that
speed of the roulette (moving light ef- Although the LEDs here are ar- pin 5 (which is a frequency controlling
49
C I R C U I T I D E A S
www.electronicsforu.com
a portal dedicated to electronics enthusiasts
50
C I R C U I T I D E A S
CLEVER RAIN-ALARM
of the rain-sensor plates SR1 through
SR4 remain dry. The output of gate N7 is
NA coupled to inverter gates N5 and N6. The
ANJA
RUP output from gate N5 (logic 1 when rain is
M.K. CHANDRA MOULEESWARAN sensed) is brought to ‘EXT’ output con-
nector, which may be used to control
U
sually rain-alarms employ a The four rain-sensors SR1 to SR4, other external devices. The output from
single sensor. A serious draw- along with pull-up resistors R1 to R4 the other inverter gate N6 is used as
back of this type of sensor is (connected to positive rails) and invert- enable input for NAND gate N8, which is
that even if a single drop of water falls ers N1 to N4, form the rain-sensor-moni- configured as a low-frequency oscillator
on the sensor, the alarm would sound. tor stage. The sensor wires are brought to drive/modulate the piezo buzzer via
There is a probability that the alarm to the PCB input points E1 to E5 using a transistor T1. The frequency of the oscil-
may be false. To overcome this draw- 5-core cable. The four outputs of Schmitt lator/modulator stage is variable between
back, here we make use of four sensors, inverter gates N1 to N4 go to the four 10 Hz and 200 Hz with the help of preset
each placed well away from the other at inputs of Schmitt NAND gate N7, that VR1. The buzzer is of piezo-electric type
suitable spots on the roof. The rain alarm makes the alarm driver stage. having a continuous tone that is inter-
would sound only if all the four sensors When all four sensors sense the rain, rupted by the low-frequency output of
get wet. This reduces the probability of all four inputs to gates N1 through N4 go N8. The buzzer will sound whenever rain
false alarm to a very great extent. low and their outputs go high. Thus all is sensed (by all four sensors).
6V power supply (100mA) is used
Fig. 1 here to enable proper interfacing of
the CMOS and TTL ICs used in the
circuit. The power supply require-
ment is quite low and a 6-volt battery
pack can be easily used. During
quiscent-state, only a negligible cur-
rent is consumed by the circuit. Even
during active state, not more than
20mA current is needed for driving a
good-quality piezo-buzzer. Please
note that IC2, being of TTL type,
needs a 5V regulated supply. There-
fore zener D1, along with capacitor
C2 and resistor R5, are used for this
purpose.
A parallel-track, general-purpose
PCB or a veroboard is enough to hold
all the components. The rain-sensors
SR1 to SR4 can be fabricated as shown
in the construction guide in Fig. 2.
They can be made simply by connect-
ing alternate parallel tracks using
jumpers on the component side. Use
some epoxy cement on and around
the wire joints at A and B to avoid
corrosion. Also, the sensors can be
cemented in place with epoxy cement.
If the number of sensors is to be
Fig. 2 four in- increased, just add another set of
puts to CD40106 and 7413 ICs along with the
N A N D associated discrete components.
gate N7 Another good utility of the rain-
also go alarm is in agriculture. When drip-irri-
high and gation is employed, fix the four sensors
its output at four corners of the tree-pits, at a suit-
at pin 6 able height from the ground. Then, as
goes to soon as the water rises to the sensor’s
logic 0. level, the circuit can be used to switch
The out- off the water pump.
51
C I R C U I T I D E A S
Dr K.P. RAO
T
his circuit is built around a 555 isfactorily, though it can be controlled only in dark or dull-lit environments.
timer using very few compo- from still longer distances. Aiming By focussing the laser beam on
nents. Since the circuit is very (aligning) the laser beam exactly on to LDR1 the connected gadget can be acti-
simple, even a novice can easily build it the LDR is a practical problem. vated through the relay, whereas by fo-
and use it as a controlling device. A laser The circuit is very useful in switch- cussing laser beam on LDR2 we can
pointer, now easily available in the mar- ing on/off a fan at night without get- switch off the gadget. The timer is con-
ket, can be used to operate this device. ting off the bed. It can also be used for figured to operate in bistable mode.
This circuit has been tested in op- controlling a variety of other devices The laser pointers are available for
erational conditions from a distance of like radio or music system. The limita- less than Rs 150 in the market. The cost
500 metres and was found to work sat- tion is that the circuit is operational of the actual circuit is less than Rs 50.
TELEPHONE CONVERSATION
The second part of the circuit con-
trols relay RL1, which is used to switch
on/off the tape recorder. A voltage of 48
RECORDER
volts appears across the telephone lines
in on-hook condition. This voltage drops
EDI
DWIV to about 9 volts when the handset is
S.C.
lifted. Diodes D1 through D4 constitute
PRADEEP VASUDEVA a bridge rectifier/polarity guard. This
ensures that transistor T1 gets voltage
T
his circuit enables automatic connected to the telephone lines. Re- of proper polarity, irrespective of the
switching-on of the tape recorder sistors R1 and R2 act as a voltage di- polarity of the telephone lines.
when the handset is lifted. The vider. The voltage appearing across R2 During on-hook condition, the out-
tape recorder gets switched off when is fed to the ‘MIC-IN’ socket of the tape put from the bridge (48V DC) passes
the handset is replaced. The signals are recorder. The values of R1 and R2 may through 12V zener D5 and is applied to
suitably attenuated to a level at which be changed depending on the input im- the base of transistor T1 via the volt-
they can be recorded using the ‘MIC- pedance of the tape recorder’s ‘MIC-IN’ age divider comprising resistors R3 and
IN’ socket of the tape recorder. terminals. Capacitor C1 is used for R4. This switches on transistor T1 and
Points X and Y in the circuit are blocking the flow of DC. its collector is pulled low. This, in turn,
52
C I R C U I T I D E A S
switch S1.
T
hree-phase motors and other ap- the circuit diagram. Three-phase supply L(b), and L(c) indicate the healthiness of
pliances are widely used in all is given to apparatus (load) through three phases R, Y, and B. After resump-
sectors of industry. These appli- contactor C. While the primaries of trans- tion of the balanced 3-phase supply, the
ances are prone to damage due to single formers X1, X2, and X3 are connected contactor will automatically energise
phasing. Apart from damage to the costly ahead of the contactor. The contactor (with S1 closed) and supply to the appli-
apparatus, it may also cause a produc- can be energised via N/C (normally ance will be resumed.
tion loss. Many circuits of single phasing closed) contacts of relay RL1 by pressing Notes: 1. In the actual circuit for-
preventor (SPP) are avail-
able but the circuit sug-
gested here is very simple
and economical.
Easily-available mains
step-down transformers
X1, X2, and X3 (230V AC
primary to 0-12V, 500mA
secondary rating) are used
with their primaries con-
nected in star mode and
secondaries in open delta
mode. The characteristic
of this type of connection
is that when three-phase
balanced input is applied
to the primaries, no out-
put across open delta sec-
ondaries will be available.
But in case of major un-
balance or single-phasing,
some voltage, called re-
sidual voltage, is induced
in the secondaries across
points 1 and 6 shown in
53
C I R C U I T I D E A S
warded by the author, the transformers energising properly with single-phasing. the two secondary connections to get the
X1, X2, and X3 primaries as well as 3. Proper polarity of the transformer required output. Similarly, connect the
switch S1 were connected after the con- connections has to be ensured in the third transformer secondary in series
tacts of contactor. As a result energisation above circuit. To determine proper po- with the other two secondaries. The out-
of contactor was not feasible. Even when larity, connect the primary ends which put across the unconnected ends should
switch S1 was shifted to a ‘live’ phase, are eventually to be connected to three now be treble (36V AC). If it is not so,
relay RL1 (as well as contactor C) was phases, to any single phase (the other reverse the connections of the third sec-
energising/de-energising in quick suc- ends are connected to neutral). Now pro- ondary. Now shift the primary ends
cession during single-phasing and caus- ceed to connect secondaries of two of the (connected to single phase) to each of
ing sparking—for obvious reasons. Hence three transformers in series and mea- the three phases, as shown in the fig-
the circuit was suitably modified at EFY sure the AC ouput across the uncon- ure. The voltage across points P1-P2 will
(as presented). nected ends. This should be double (24V be nearly zero if all three phases are
2. The relay was also changed from AC) of the individual secondary output present.
12V to 6V rating, as 12V relay was not (12V AC). If it is not so, reverse one of —Technical Editor
54
April
2000
CONSTRUCTION
C
ircuit of a smart clap switch, in- around op-amp N2. The gain of preampli- tor-resistor combinations of C14-R19, C11-
corporating certain unique fea- fier stage is 6.6. R16, and C15-R21 respectively. Thus, all
tures, is presented here. It over- The next stage comprising capacitor outputs of IC5 (QA to QD) are at logic zero.
comes the shortcomings observed in nor- C4 and resistor R6 constitutes a high-pass Hence, all the parallel load inputs (A
mal clap switches. The following two spe- filter with a cut-off frequency of about 3 through D) of IC5 are also at logic zero.
cial features, which you would not have kHz. This filter avoids false activation of The Q outputs of IC3 are ‘low’ while its Q
observed in other clap switches, are in- the switch by spurious low-frequency outputs are ‘high’. The CLK2 input of IC3
cluded in its design: sounds such as those produced by a fan, is initially ‘high’ because transistor T1 is
(a) It comprises a 4x4 clap switch, i.e. a motorcycle, and other gadgets. Although in conduction state.
it operates only when you clap four times this precaution may not be absolutely es- Now, when a clap sound is produced,
to switch ‘on’ a device. Similarly, for sential because we are using a coded IC5 gets a low-to-high going clock pulse.
switching ‘off’ the device, you are required sound, it provides additional safety. Its count goes up from 0000 to 0001, i.e.
to again clap four times. The high-pass filter stage is followed it is incremented by one digit. Since QA
(b) The clapping should occur within by an amplifier stage around op-amp N3
PARTS LIST
an interval of about 3.5 seconds, other- with a gain of 23. Thus, the overall gain
Semiconductors:
wise the clap switch status will remain of the op-amps N2 and N3 is about 150, IC1 - LM324 quad op-amp
unchanged. which is quite adequate. IC2 - 7812 +12V regulator
In a simple clap switch, the connected The next stage formed using op-amp IC3 - CD4027 dual JK flip-flop
device is switched ‘on’ by a single clap N4 is a comparator. The reference volt- IC4, IC6 - NE555 timer
IC5 - 74C192 up/down decade
and is switched ‘off’ in a similar manner age connected to the inverting terminal
counter
by a single clap. Since the transducer used of the comparator can be varied, from D1, D9 - Colour LED
in a clap switch is normally a condenser about 0.2V to about 8V, by adjusting pre- D2-D4, D8 - 1N4007 rectifier diode
mic, it is unable to detect difference be- set VR1. Thus, the sensitivity to clap D5-D7 - 1N4148 switching diode
tween a clap and a sound produced when sound can be set by preset VR1. The red T1, T2 - 2N2907 pnp transistor
T3 - 2N2222 npn transistor
a metallic object falls to the ground or LED D1 gives an indication that the clap
Resistors (all ¼W, ±5% metal carbon film,
simply the sound of a shouting person. signal has been detected.
unless stated otherwise)
This is a common problem in clap [Note: IC6 (NE555), configured as a R1, R15, R26 - 10-kilo-ohm
switches. monostable, with a pulse width of 250 ms, R2, R3, R18,
In the circuit of the smart clap switch, has been added at EFY lab during the R19, R21 - 100-kilo-ohm
this problem is completely eliminated. course of testing, to eliminate the effect R4, R7, R9,
Thus, it will not be affected by any spuri- of multiple pulses generated at the out- R13, R14, R16
R20, R22, R23 - 1-kilo-ohm
ous sound, including the one produced put of comparator N4, even with a single R5, R6 - 5.6-kilo-ohm
when a door is strongly banged. This can clap.] R8, R24 - 22-kilo-ohm
be well understood from the working of The main control section is formed R10 - 220-ohm
the circuit explained below. around IC5 (74C192 or CD40192), which R11 - 4.7-kilo-ohm
R12 - 680-ohm
is a 4-bit up/down presetable decade R17 - 33-kilo-ohm
counter. 74C192/CD40192 is a CMOS ver-
The circuit sion of 74192. Here, one can even use
R25
VR1
- 470-ohm
- 10-kilo-ohm preset
230V AC is converted into 12V regulated 74C193/CD40193, a 4-bit up/down binary Capacitors:
DC supply using 15-0-15,1A secondary, counter, since counting up to decimal digit C1 - 47nF ceramic disk
step-down transformer and other related 8 only is involved. The above-mentioned C2, C3 - 4.7µF, 25V electrolytic
components. Since CMOS ICs are used in C4, C6-C8, C12,
TABLE I C18 - 0.01µF ceramic disk
the circuit, its power consumption is quite C5, C10, C13 - 100µF, 25V electrolytic
low and the noise immunity of the circuit Q D QC QB QA Switch/Device status
C9 - 2200µF, 25V electrolytic
is high (about 5.4V). 0 0 0 0 Device remains ‘off’ in this C11, C17 - 10µF, 25V electrolytic
0 0 0 1 region as QC remains at C14, C15, C16 - 0.1µF ceramic disk
Resistor R1 biases the condenser mi-
0 0 1 0 logic low
crophone and the electrical signals (con- Miscellaneous:
0 0 1 1
verted from sound waves) are fed to RL1 - 12V, 200-ohm relay
0 1 0 0 Device remains ‘on’ in this MIC1 - Condenser microphone
buffer stage N1 with high input imped- 0 1 0 1 region as QC remains at X1 - 230V AC primary to 15V-
ance. The high-frequency noise signals are 0 1 1 0 logic high 0-15V, 1A secondary
bypassed to ground by shunting the mi- 0 1 1 1 transformer
crophone with capacitor C1. The mic out- 1 0 0 0 Device is reset to off state - Heat-sink
put is fed to a preamplifier stage built (unstable state) F1, F2 - 1A fuse
56
CONSTRUCTION
open contacts of
the relay to the
supply.
The first clap
activates the
monostable flip-
flop IC4. It is
clear from Table
I that if no fur-
ther claps occur
within 3.5 sec-
onds of the first
clap, the parallel
inputs to IC5 be-
come 0000 be-
57
CONSTRUCTION
www.electronicsforu.com
a portal dedicated to electronics enthusiasts
58
CONSTRUCTION
N
ow-a-days electronic voting ma- 8085, the 8-bit address used is duplicated specific candidate. If one does not need
chines are being used effectively. on lower (AD0-AD7) as well as higher (A8- all the 48 switches, only the required
The confidence of the voter in A15) address bus. number of switches need to be wired. The
its flawless working is gradually building The system runs with a clock fre- remaining keyboard switches can be done
up and these machines are thus becom- quency of 1.79 MHz (i.e. half the crystal away with. In this unit, LED D4 is used
ing quite popular throughout the coun- oscillator frequency of 3.58 MHz). Auto to indicate that the system is ready for
try. (Please note that the design being reset facility is incorporated in this sys- accepting the next (one) vote.
presented here is not intended to resemble tem for avoiding corruption of count dur-
that of electronic voting machines used ing interruption in power supply. This is
by the Election Commission. If any re- achieved by using the latching property Operating Procedure
semblance is noticed between the two, it of SCR. A battery backup (3x1.5V UM3 1. Switch ‘on’ the power, using switch
is totally unintended.) Features of the type) is provided for RAM chip to retain S53.
electronic voting machines include avoid- the latest counts. 2. Press ‘start’ button.
ance of invalid votes and reduction of The control and processing unit com- 3. A software-based security feature
counting time and the consequent expen- prises the 8085 microprocessor, memory has been added in this system which re-
diture incurred on manpower deployment. (EPROM and RAM), and some function quires one to enter the password digits
switches. To get an overview of the vot- via the keyboard for getting access to the
ing machine, we shall start with the ex- machine for its operation. (The maximum
Hardware description planation of the functional switches. length of password is seven digits, but it
The voting machine circuit being described Start switch (S48). When the circuit
PARTS LIST
here is designed around Intel’s basic 8085 is initially powered on, it is in reset state
Semiconductors:
microprocessor. It has two main units: due to the auto reset facility. If you want to
IC1 - 8085A microprocessor
(i) control and processing unit, and activate the system, press the ‘start’ but- IC2 - 74LS373 octal latch
(ii) keyboard and display unit. ton. This causes the SCR to conduct and IC3 - 74LS138 decoder/
Keyboard and display are interfaced take RS pin 36 of 8085 to logic ‘high’. As a demultiplexer
through a general-purpose programmable result 8085 microprocessor becomes ac- IC4 - 27C32 EEPROM
IC5 - 6116A RAM
peripheral interface (PPI) IC 8255. The tive. In this state, the microprocessor will IC6 - 82C55 programmable
system monitor programs are stored in execute the booting program (starting at peripheral interface
2732 EPROM. RAM 6116 is used for stor- location/address 0000H). IC7 - 74LS47, BCD to 7-segment
ing counts and a portion of it is also used Clear switch (S52). This switch is decoder/driver
as stack. IC 74LS373 (octal D-type latch) IC8 - 7805, +5V regulator
used for clearing the previous count in
T1-T4 - BC547 npn transistor
is used for segregating the lower order memory. When pressed, the RST 5.5 in- D1, D3 - 1N4001 rectifier diode
address bits from multiplexed address/ terrupt starting at location 002CH is ac- D2, D4 - Colour LED
data bus of 8085. Two of the higher order tivated. Here the vector (0100H) pointing SCR1 - BT169
bits are decoded by 74LS138 to generate to the sub-routine for clearing the memory Resistors (all ¼W, ±5% metal carbon film,
chip select signals for IC4 through IC6. contents is stored. unless stated otherwise)
The address/address range for each de- Display switch (S50). This switch R1-R3 - 330-ohm
R4-R11 - 3.3-kilo-ohm
vice is shown in Table I. Please note that activates RST 7.5 interrupt (location R12 - 47-ohm
during I/O read/write instructions in µP 003CH) containing vector for executing R13, R22, R23 - 2.2-kilo-ohm
‘display routine’ used for displaying the R14 - 680-ohm
TABLE I R15-R21 - 68-ohm
count of the votes polled by any candi-
Address Map of Devices Used date. If one wants to see the count of a Capacitors:
Address (Hex) Device specific candidate, ‘display’ switch is C1 - 10pF ceramic disc
0000-01FF EPROM pressed first, followed by the depression C2 - 0.1µF ceramic disc
8000-80FF RAM of the switch on the keyboard allocated to Miscellaneous:
}
C0 Port A Xtal - 3.58MHz crystal
C1 Port B the specific candidate.
of 8255 S53 - On/off switch
C2 Port C Count switch (S51). This switch ac- S0-S52 - Tactile switch
C3 Control port tivates RST 6.5 interrupt (location 0034H, P21 - Piezo buzzer
Here we have used ports B and A as output containing the jump address 00B6 for DIS1-DIS4 - LT542 common-anode
ports and port C as input port. count subroutine) for activating the mi- display
- 4.5V battery
croprocessor to accept only one vote for a
59
CONSTRUCTION
60
Fig. 1: Schematic diagram of the electronic voting machine.
CONSTRUCTION
her vote.)
7. Now, the voter can
cast his/her vote by press-
ing the appropriate key-
board switch allocated to
the candidate of his/her
choice. The acceptance of
the vote by the system is
acknowledged by a beep
sound as well as the dis-
play of the ‘ ’ symbol in
the display and ‘off’ condi-
tion of LED D4.
8. Steps 6 and 7 have
to be repeated for casting
a fresh vote.
9. If the count of any
particular candidate’s
votes (count) is needed to
be displayed, press ‘dis-
play’ switch and then the
switch corresponding to
the specific candidate on
the keyboard.
10. Reset the system.
11. Switch ‘off’ the sys-
tem.
Software description
The system programs are
stored in the EPROM. The
entire software is divided
into five modules, namely,
booting, display, clearing
memory, counting, and
keyboard.
The operation of each
module can easily be un-
derstood with reference to
the flowcharts.
Booting. This module
initialises the stack pointer
Fig. 2: Flow chart for the various software programs 8255 PPI, verifies the
password entered via the
can be changed by adjusting some values display of symbol ‘[’ and the glowing of keyboard, and initialises the interrupts.
in the system software.) At present, only LED D4 would mean that the system is Display. This module uses the inter-
three-digit password is used. If the pass- ready for accepting one vote. (Please note rupt service subroutine at RST 7.5. This
word digits entered via keyboard equal that the ‘count’ switch is placed is used for displaying the count (votes)
the password stored in the EPROM, LED under the control of electoral staff so polled by each of the candidates.
D2 glows to give access for operation of that it is satisfied with the identity of the Clearing memory. This module is in-
the machine. voter before allowing him/her to cast his/ voked via interrupt service subroutine RST
4. If the entered password is incor- 5.5. It is used to clear the count memory.
rect, press RESET button (S49) and pro- TABLE II Counting. This module uses the in-
ceed again from the first step. Start Address Map of Hardware Interrupts terrupt service subroutine RST 6.5. It ac-
5. Clear the previous content of count Address (hex) Interrupt tivates the microprocessor to accept only
memory by pressing ‘clear’ button (S52). 0024 TRAP one vote. If the count of any candidate
Clearance of memory is indicated by sym- 002C RST 5.5 exceeds ‘9999’, it will produce a continu-
bol ‘:’ in the display. 0034 RST 6.5 ous beep sound and display ‘ ’, and then
6. Now press ‘count’ switch S51. The 003C RST 7.5
onwards the system will not be ready for
61
CONSTRUCTION
62
CONSTRUCTION
accepting any further vote. Thus, the maxi- to a maximum of seven digits. The pass- plied by 4 and converted into hex format,
mum number of votes that can be regis- word should be decided before burning the and then stored in consecutive memory
tered against any one candidate should program in the EPROM. Password check- locations starting from 00F9H. For ex-
not exceed 9999. This is the limitation in ing is performed during execution of boot- ample, if the PW is 1, 4, 8, the length is
the present design. ing program. For entering the password, loaded as 03 in register C and the data is
Keyboard. This module is used for the same keyboard switches are used that as follows:
checking key closure and generating the otherwise represent specific candidates. EPROM Hex Conversion PW
binary value corresponding to the closed For the setting of password (PW), the location data digit
00F9 ß 04 ß 04H ß 04 ß 4x1 1
switch. length of PW is chosen first and then it is 00FA ß 10 ß 10H ß 16 ß 4x4 4
loaded into register C using instruction 00FB ß 20 ß 20H ß 32 ß 4x8 8
‘MVI A, length’ in the booting program. An actual-size, single-sided PCB for
Password security The digits of the password are stored in the circuit shown in Fig. 1 is given in
This voting machine has a password op- memory locations 00F9H to 00FFH. Each Fig. 3, while its component layout is given
tion. The length of the password is limited of the PW digits chosen has to be multi- in Fig. 4.
Software Listings
Address Opcode Mnemonics Comments Address Opcode Mnemonics Comments
004E DE C1 OUT C1
Booting Program 0050 11 7F 01 LXID 017F
0000 31 FF 80 LXI SP, 80FF Initialise SP 0053 1B DCX D
0003 3E 89 MVI A, 89 Initialise 8255 0054 7A MOV A, D
0005 D3 C3 OUT, C3 Port A, B = input, Port C = output 0055 B3 ORA E
0007 11 F9 00 LXI D, 00F9 Load Stored Password (PW) 0056 C2 53 00 JNZ 0053
000A 0E 03 MVI C, 03 Password length = 3 digits 0059 23 INX H
000C C5 PUSH B 005A 78 MOV A, B
000D D5 PUSH D 005B 07 RLC
000E AF XRA A Makes contents of Acc. zero 005C 47 MOV B, A
000F 67 MOV H, A Make H reg contents zero 005D D2 4C 00 JNC 004C
0010 CD 70 00 CALL 0060 E1 POP H
KEYBOARD 0061 C3 49 00 JMP 0049
0013 D1 POP D
0014 C1 POP B Keyboard subroutine
0015 1A LDAX D Load Acc. from mem loc pointed by 0070 D3 C1 OUT C1 Display the mode
DE 0072 CD 20 01 CALL DELAY(O/P contents of Acc. thro Port B)
0016 BD CMPL 0075 FB EI
0017 C2 23 00 JNZ 0023 If PW is incorrect, stop execution 0076 IE 00 MVI E, 00 Scan the keyboard
001A 13 INX D 0078 3E 80 MVI A, 80
001B 0D DCR C 007A 06 06 MVI B, 06
001C C2 0C 00 JNZ, 000C 007C 07 RLC
001F 3E C8 MVI A, C8 If PW is right, enable the inter- 007D 6F MOV L, A
rupts and glow the LED (D2) to 007E B4 ORA H
0021 30 SIM indicate that the system is 007F D3 C0 OUT C0
0022 FB EI energised 0081 DB C2 IN C2
0023 76 HLT 0083 0E 08 MVI C, 08
0085 0F RRC
RST 5.5 (contains vector for memory clearing subroutine) 0086 DA 9C 00 JC 009C
002C 00 NOP 0089 1C INR E
002D C3 00 01 JMP Jump to Interrupt Secvice 008A 16 7F MVI D, 7F
MEMCLEAR Subroutine MEMCLEAR 008C 15 DCR D
008D C2 8C 00 JNZ 008C
RST 6.5 (contains vector for count subroutine) 0090 0D DCR C
0034 00 NOP 0091 C2 85 00 JNZ 0085
0035 C3 B6 00 JMP COUNT Jump to Interrupt Service 0094 7D MOV A, L
Subroutine COUNT 0095 05 DCR B
0096 C2 7C 00 JNZ 007C
RST 7.5 Display subroutine 0099 C3 76 00 JMP 0076
003C 00 NOP 009C F3 DI
003D 00 NOP 009D 7B MOV A, E If closed key is sensed, multiply
003E 31 FF 80 LXI SP, 80FF Initialise SP 009E 07 RLC the key number by 4
0041 3E 1E MVI A, 1E Load data byte for displaying 009F 07 RLC
0043 26 00 MVI H, 00 display mode indicator ‘ ’ 00A0 6F MOV L, A
0045 CD 70 00 CALL 00A1 3E 80 MIV A, 80
KEYBOARD Check key closure 00A3 67 MOV H, A
0048 FB EI 00A4 D3 C0 OUT CO Generate a beep
0049 E5 PUSH H 00A6 CD 20 01 CALL DELAY
004A 06 10 MVI B, 10 Scan the display 00A9 AF XRA A
004C 7E MOV A, M 00AA D3 C0 OUT CO
004D B0 ORA B 00AC C9 RET
63
CONSTRUCTION
www.electronicsforu.com
a portal dedicated to electronics enthusiasts
64
C I RC ICR CUUII TT I ID D
EAS
EAS
of copper or brass strips (6mm wide and
1mm thick) which are shaped into rings
T
he water-tank level meter de- available material, it can be fabricated to tags, and some epoxy cement is applied
scribed here is very simple and meet one’s own specific requirements. around the joints and tags to avoid corro-
useful for monitoring the water The common ground reference elec- sion by water. The common ground refer-
level in an overhead tank (OHT). The wa- trode ‘X’ is an aluminium conduit of 15mm ence wire ‘SG’ is taken from tag ‘T’. The
ter level at 30cm intervals is monitored outer diameter and 3-metre length, to ca- cable’s individual wires from S1 to S10
and continuously indicated by LEDs ar- ter to a 3-metre deep overhead tank. Insu- and SG are cut and matched in length for
ranged in a meter-format. When all the lating spacer rings ‘Y’ (10mm length, a neat layout. The other ends of the cable
LEDs are ‘off’, it indicates that the OHT is 15mm dia.) are fabricated from electrical are connected to the PCB terminal points
empty. When the water level reaches the wiring conduits of 15mm inner diameter. S1 to S10 and SG respectively. No sepa-
top limit, the whole LED-meter begins to These are pushed tightly over the alumi- rate ground is needed.
flash. num conduit at preferred places, say 30cm The electronics portion is simple and
The height at which the level-sensing apart. If the pieces are too tight, they can straightforward. A long piece of veroboard
electrodes are fitted is adjustable. Thus, be heated in boiling water for softening can hold all the parts including the power
the minimum and maximum level settings and then pushed over ‘X’. supply section. For easy installation, the
may be varied as desired. The range of the The sensor electrodes ‘Z’ are made out LEDs can be set at the track side of the
meter can also
be enlarged to
cater to any
level.
No special
or critical com-
ponents are
used. CMOS
ICs are used to
limit the idle
current to a
minimum level.
Even when
all the LEDs
are ‘on’, i.e. wa-
ter reaches the
top level, the
demand on the
power supply is
reasonably low.
Further, the ex-
tremely high in-
put resistance
of the Schmitt
inverter gates
reduces the in-
put current and
thus minimises
the erosion of
electrodes.
The princi-
pal part of the
device is its wa-
ter-level sensor
assembly. By
using easily
65
CIRCUIT IDEAS
board, in a single line, so that they may tors R14 through R23 via emitter-collec- cessively.
be pushed through the cutouts in the front tor path of transistor T2. The LED D1 is The novel feature of this circuit is that
panel of the enclosure from inside. thus lit up. whenever the water level is below the first
The water level at 30cm intervals is Similarly, other LEDs turn ‘on’ suc- sensor, all the LEDs are ‘off’ and the qui-
monitored by corresponding sensors, caus- cessively as the water level rises. As soon escent current is very low. Thus, a power
ing the input to the concerned inverters as the water in OHT reaches the top level, ‘on’/‘off’ switch is not so essential. Even
(normally pulled ‘high’ via resistors R1 the output of gate N10 goes to logic 1 and when the LED-meter is fully on, the cur-
through R10) to go ‘low’, as soon as water causes flashing-type LED D11 to start rent drawn from the power supply is not
reaches the respective sensors. flashing. At the same time, transistor T1 more than 120 mA. A heat-sink may, how-
On initial switching ‘on’ of the power conducts and cuts off alternately, in syn- ever, be used for transistor T2, if the tank
supply, when the tank is empty, all the chronism with LED D11’s flash rate, to is expected to remain full most of the time.
electrodes are open. As a result, all the ground the base of transistor T2 during A power supply unit providing unregu-
inverter inputs are ‘high’ (via the pull-up conduction of transistor T1. As a result, lated 6V DC to 15V DC at 300mA current
resistors R1 to R10) and their outputs are transistor T2 also starts cutting ‘off’ dur- is adequate.
all ‘low’. Thus, all the LEDs are ‘off’. As ing conduction of transistor T1, to make Caution. A point to be noted is that
soon as the water starts filling the tank, the LED meter (comprising LEDs D1 water tends to stick to the narrow space
the rising water level grounds the first through D10) flash and thus warn that at the sensor-spacer junction and can
sensor. The logic 1 output of first inverter the water has reached the top level. When cause a false reading on the LED-meter.
gate N1 causes conduction of transistor the water level goes down, the reverse This can be avoided if the spacers are
T2 to extend ground to one side of resis- happens and each LED is turned ‘off’ suc- made wider than 10 mm.
mitter section.
PHONE BROADCASTER
The low-power FM transmitter sec-
tion comprises oscillator transistor T3, coil
S.C. DWIVEDI
L1, and a few other components. Transis-
tor T3 works as a common-emitter RF
ANJAN NANDI oscillator, with transistor T2 serving as
an electronic ‘on’/‘off’ switch. The audio
H
ere is a simple yet very useful The switching voltage of the circuit de- signal available across the telephone lines
circuit which can be used to pends on zener breakdown voltage (here automatically modulates oscillator fre-
eavesdrop on a telephone con- 24V) and switching voltage of the transis- quency via transistor T2 along with its
versation. The circuit can also be used as tor T1 (0.7V). Thus, if we adjust preset series biasing resistor R3. The modulated
a wireless telephone amplifier. VR1 to get over 24.7 volts, it will cause RF signal is fed to the antenna. The tele-
One important feature of this circuit the zener to breakdown and transistor T1 phone conversation can be heard on an
is that the circuit derives its power di- to conduct. As a result collector of transis- FM receiver remotely when it is tuned to
rectly from the active telephone lines, and tor T1 will get pulled towards negative FM transmitter frequency.
thus avoids use of any external battery supply, to cut off transistor T2. At this Lab Note: During testing of the cir-
or other power supplies. This not
only saves a lot of space but also
money. It consumes very low cur-
rent from telephone lines without
disturbing its performance. The
circuit is very tiny and can be
built using a single-IC type
veroboard that can be easily fitted
inside a telephone connection box
of 3.75 cm x 5 cm.
The circuit consists of two sec-
tions, namely, automatic switching
section and FM transmitter section.
Automatic switching section
comprises resistors R1 to R3, preset
VR1, transistors T1 and T2, zener D2, stage, if you lift the handset of the tele- cuit it was observed that the telephone
and diode D1. Resistor R1, along with pre- phone, the line voltage drops to about 11V used was giving an engaged tone
set VR1, works as a voltage divider. When and transistor T1 is cut off. As a result, when dialed by any subscriber. Addi-
voltage across the telephone lines is 48V transistor T2 gets forward biased through tion of resistor R5 and capacitor C6 was
DC, the voltage available at wiper of pre- resistor R2, to provide a DC path for tran- found necessary for rectification of the
set VR1 ranges from 0 to 32V (adjustable). sistor T3 used in the following FM trans- fault.
66
CIRCUIT IDEAS
I
n this circuit, a simple calculator, in minal A and B are combined using a tion). The COB starts generating clock
conjunction with a COB (chip-on- bridge, comprising diodes D1 to D4, to pulses of 1 Hz. Transistor T1 conducts
board) from an analogue quartz obtain 1Hz clock pulses. These clock once every second, and thus ‘=’ button in
clock, is used to make a telephone call pulses are applied to the base of transis- calculator is activated electronically once
meter. The calculator enables conversion tor T1. The collector and emitter of tran- every second. The calculator display
of STD/ISD calls to local call equivalents sistor T1 are connected across calculator’s starts from 1.25, advancing every second
and always displays current local call- ‘=’ terminals. as follows:
meter reading.
The circuit is simple and presents an
elegant look, with feather-touch operation.
It consumes very low current and is fully
battery operated. The batteries used last
more than a year.
Another advantage of using this cir-
cuit is that it is compatible with any type
of pulse rate format, i.e. pulse rate in
whole number, or whole number with
decimal value. Recently, the telephone de-
partment announced changes in pulse rate
format, which included pulse rate in whole
number plus decimal value. In such a
case, this circuit proves very handy.
To convert STD/ISD calls to local calls, The number of pulses forming an 1.25, 1.5, 1.75, 2.00, 2.25, 2.50, and
this circuit needs accurate 1Hz clock equivalent call may be determined from so on.
pulses, generated by clock COB. This COB the latest telephone directory. However, After finishing the call, immediately
is found inside analogue quartz wall clocks the pulse rate (PR) found in the directory slide switch S1 to ‘off’ position (pulse set
or time-piece mechanisms. It consists of cannot be used directly in this circuit. For position) and note down the local call
IC, chip capacitors, and crystal that one compatibility with this circuit, the pulse meter reading from the calculator display.
can retrieve from scrap quartz clock rate applicable for a particular place/dis- If decimal value is more than or equal to
mechanisms. These can be purchased tance, based on time of the day/holidays, 0.9, add another call to the whole num-
from watch-repairing shops for less than is converted to pulse rate equivalent ber value. If decimal value is less than
Rs 20. (PRE) using the formula PRE = 1/PR. 0.9, neglect decimal value and note down
Normally, the COB inside clock You may prepare a look-up table for only whole numbers.
mechanism will be in good condition. How- various pulse rates and their equivalents To store this local call meter reading
ever, before using the COB, please check (see Table). Suppose you are going to into calculator memory, press ‘M+’ but-
its serviceability by applying 1.5V DC make an STD call in pulse rate 4. Note ton. Now local call meter reading is stored
across terminals C and D, as shown in down from the table the pulse rate equiva- in memory and is added to the previous
the figure. Then check DC voltage across lent for pulse rate 4, which is 0.25. Please local call meter reading. For continuous
terminals A and B; these terminals in a note that on maturity of a call in the tele- display of current local call meter read-
clock are connected to a coil. If the COB phone exchange, the exchange call meter ing, press ‘MRC’ button and slide switch
is in good condition, the multimeter needle immediately advances to one call and it S1 to ‘on’ (start/standby position). The cur-
would deflect forward and backward once
every second. In fact, 0.5Hz clock is avail- LOOKUP TABLE
able at terminals A and B, with a phase Pulse rate (PR) 2 2.5 3 4 6 8 12 16 24 32 36 48
difference of 90o. The advantage of using Pulse rate
this COB is that it works on a 1.5V DC eqlt. (PRE) 0.500 0.400 0.333 0.250 0.166 0.125 0.083 0.062 0.041 0.031 0.027 0.020
source. Note: Here PRE is shown up to three decimal places. In practice, one may use up to five
The clock pulses available from ter- or six decimal places.
67
CIRCUIT IDEAS
rent local call meter reading will blink ‘on’. So, in the idle condition, the ‘=’ but- culator as terminals E and F. Affix COB on a gen-
once every second. ton is activated electronically once every eral-purpose PCB and solder the remaining compo-
In prototype circuit, the author used second by transistor T1, to keep the cal- nents neatly. For giving the unit an elegant look,
TAKSUN calculator that costs around Rs culator continuously ‘on’. purchase a jewellery plastic box with flip-type cover
80. The display height was 1 cm. In this Useful hints. Solder the ‘=’ button (size 15cm x 15cm). Now fix the board, calculator,
calculator, he substituted the two button- terminals by drilling small holes in its and batteries, along with holder inside the jewellery
type batteries with two externally con- vicinity on PCB pattern using thin cop- box. Then mount the box on the wall and paste the
nected 1.5V R6 type batteries to run the per wire and solder it neatly, such that look-up table inside the box cover in such a way that
calculator for more than an year. the ‘=’ button could get activated electroni- on opening the box, it is visible on left side of the box.
The power ‘off’ button terminals were cally as well as manually. Take the cop- Caution. The negative terminals of battery A
made dummy by affixing cellotape on con- per wire through a hole to the backside and battery B are to be kept isolated from each other
tacts to avoid erasing of memory, should of the PCB, from where it is taken out of for proper operation of this circuit.
someone accidentally press the power ‘off’ the calculator as terminals G and H.
button. This calculator has auto ‘off’ fa- At calculator’s battery terminals, sol-
cility. Therefore, some button needs to be der two wires to ‘+’ and ‘–’ terminals.
pressed frequently to keep the calculator These wires are also taken out from cal-
SIMPLE ELECTRONIC
S10 is also placed together with other switches so
that any stranger trying to operate the lock fre-
quently presses the switch S10, thereby resetting the
CODE LOCK
circuit many times. Thus, he is never able to turn the
S.C. DWIVEDI relay ‘on’. If necessary, two or three switches can be
connected in parallel with S10 and placed on the key-
board panel for more safety.
REJO G. PAREKKATTU A 12V power supply is used for the
circuit. The circuit is very simple and can
T
he circuit diagram of a simple elec- pressed simultaneously. Capacitor C2 and be easily assembled on a general-purpose PCB. The
tronic code lock is shown in fig- resistor R3 are provided to prevent noise code number can be easily changed by changing the
ure. A 9-digit code number is used
to operate the code lock.
When power supply to the circuit is
turned on, a positive pulse is applied to
the RESET pin (pin 15) through capaci-
tor C1. Thus, the first output terminal
Q1 (pin 3) of the decade counter IC (CD
4017) will be high and all other outputs
(Q2 to Q10) will be low. To shift the high
state from Q1 to Q2, a positive pulse must
be applied at the clock input terminal (pin
14) of IC1. This is possible only by press-
ing the push-to-on switch S1 momentarily.
On pressing switch S1, the high state
shifts from Q1 to Q2.
Now, to change the high state from Q2
to Q3, apply another positive pulse at pin
14, which is possible only by pressing switch
S2. Similarly, the high state can be shifted
up to the tenth output (Q10) by pressing
the switches S1 through S9 sequentially
in that order. When Q10 (pin 11) is high,
transistor T1 conducts and energises relay
RL1. The relay can be used to switch ‘on’
power to any electrical appliance.
Diodes D1 through D9 are provided during switching action. connections to switches (S1 to S9).
to prevent damage/malfunctioning of the Switch S10 is used to reset the circuit
IC when two switches corresponding to manually. Switches S1 to S10 can be
‘high’ and ‘low’ output terminals are mounted on a keyboard panel, and any
68
CIRCUIT IDEAS
LATCH-UP ALARM
Simultaneously, the LED inside opto-
coupler glows and the phototransistor
conducts. As a result, trigger transistor
USING OPTO-COUPLER
T1 gets base bias via phototransistor and
S.C. DWIVEDI
resistor R6. The alarm sounds
continuously until reset switch S2 is
pressed. When switch S2 is pressed, tran-
PRADEEP G. sistor T1 is switched ‘off’ to bring pin 4
of IC1 to logic ‘low’ and the alarm
T
he latch-up alarm described here is disabled.
is based on single IC NE555,
configured as an astable
multivibrator. The timing components are
selected such that the oscillation fre-
quency of the multivibrator lies within
the audio range. Instead of a flip-flop
stage, an opto-coupler (MCT2E) is used
for latching of the alarm.
Under normal condition, pin 4 of IC1
is pulled to ground via resistor R2, and
its output at pin 3 is held ‘low’. When
switch S1 is pressed momentarily, tran-
sistor T1 conducts to bring reset pin 4 of
555 to logic ‘high’. As a result, IC1 is
activated and the alarm starts to sound.
T
he UM5506B is a highly integrated
voice processor CMOS IC with in-
built ADM (adaptive delta modu-
lation) capability. The chip integrates an
analogue comparator, a 10-bit D/A con-
verter, a low-pass filter, an op-amp, and
a 96-kilobit static RAM. It has an on-chip
amplifier for sound recording and direct
speaker driving capability.
Although 28 pins/pads are shown
in the figure, its COB version mounted
on a PCB, as tested at EFY Lab, had only
16 lines coming out of the COB. These
lines, after proper identification, have
been indicated with asterisk (*) marks in
Fig. 2. Very few external components are
needed for its use in applications such as
greeting cards or toys. The tested PCB
measured 3 cm x 5.25 cm and required voice signals picked up by the condenser pin ends the power-down mode and ini-
only 3-volt supply for operation. mic are converted into digital signals us- tiates a record cycle. Recording continues
The IC, along with external compo- ing ADM algorithm and stored in its in- as long as this pin is held ‘low’, provided
nents, as shown in Fig. 2, can be used for ternal SRAM. During play mode, the digi- memory is not completely filled. If
recording of sound for a recording length tal data is converted back into analogue memory is full or the pin is ‘high’, it en-
of 6 seconds. During record mode, the signals and played back through the ters the power-down mode.
69
CIRCUIT IDEAS
S2 (PLAYL). Pressing
(grounding) this pin ends the
power-down mode and ini-
tiates the play cycle. The
stored/recorded message is
played until finished or this
pin is taken ‘high’.
S3(PLAYE). Pressing
(grounding) this pin momen-
tarily ends the power-down
mode and enters the play
mode. Subsequent taking of
this pin ‘high’ has no effect.
However, pressing this pin
once more finishes the play
mode and the chip enters
the power-down mode.
The action is analogous to
the falling-edge trigger
mode.
S4 (PLAY/RPT). Press-
ing (grounding) this pin ends
the power-down mode and
enters the play mode. The chip will com- ter the power-down mode. and play-mode active period. A beep is
plete the recorded message and then keep LED1 connected to BUZY pin lights produced in the speaker to indicate start
repeating the message as long as it is up to indicate end of power-down of record cycle and also that the memory
kept pressed. When released, it will en- mode and remains ‘on’ during record is full. ❏
70
May
2000
CONSTRUCTION
DIGITAL NUMBER
ches designated ‘S0’ through ‘S9’ are con-
nected to the ten Q outputs (pins 3, 2, 4,
7, 10, 1, 5, 6, 9, and 11 respectively) of
RUPANJANA this IC.
M
any electronic video games are matic diagram of digital number shooting Q0 through Q9 outputs of IC3 respectively
available in the market. But game is shown in Fig. 2. The Schmitt trig- must become ‘high’. For this purpose, the
for those who may prefer to as- ger input NAND gates N1 and N2 of IC ‘carry out’ (pin 5) of IC2 is connected to
semble the game themselves, a digital CD4093 (IC1) are used for producing clock the reset pin 15 of IC3 through a
number shooting game circuit is described pulses for random number generation. differentiator circuit comprising resistor
here. NAND gate N2, in combination with ca- R4 and capacitor C3.
A train of single-digit random num- pacitor C2 and resistor R2, forms an oscil- During the transition from 9 to 0, the
bers appears on a 7-segment display, and lator to produce pulses. NAND gate N1 state of ‘CO’ pin 5 changes from ‘low’ to
the player has to shoot a number by press- and its associated components comprising ‘high’ and the differentiator circuit pro-
ing a switch corresponding to that num- capacitor C1 and resistor R1 form another duces a sharp pulse to reset IC3. Thus, in
ber before it vanishes. If he shoots the oscillator, whose frequency is ten times every ten pulses, any timing difference, if
number, he scores ten points which are less than of the former oscillator. present, is corrected. Resistor R3 (470k)
displayed on the scoreboard. Successful The pulses from the two oscillators connected in parallel to capacitor C3
shooting is accompanied by a beep sound. are ANDed by NAND gate N2 to get ran- quickly discharges it during the low state
dom clock pulses. The output frequency of ‘CO’ pin 5 of IC2.
from gate N2 (pin 4) varies due to phase Control pulse generator. NAND
The circuit difference between the two oscillator fre- gate N3, along with its external compo-
Fig. 1 shows the block diagram of the quencies and the period of ‘on’ state of nents, forms another oscillator of very low
whole circuit. Blocks 1, 2, and 3 consti- output from gate N3 (pin 10).
tute the random number generator. Block The prototype was carefully watched PARTS LIST
4 controls the ten triggering switches and for consecutive 150 random numbers gen- Semiconductors:
block 5 checks for any foul play. The score- erated by IC2 (and displayed on DIS.1). IC1 : CD4093 Schmitt trigger
board is constituted by blocks 6 and 7, No repetition in the order of the numbers quad two-input NAND
while block 8 is meant for audio indica- was witnessed but, interestingly, at times, gate
IC2, IC5, IC6 : CD4033 decade counter/
tion. the same number was repeated thrice. decoder/7-segment LED
Block 9 controls the speed of the num- Random number generator and display driver
ber displayed, the digital counter, the switch controller. The output of gate N2 IC3 : CD4017 decade counter/
switch controller, and the foul play (pin 4) is connected to pin 1 of decade decoder
IC4 : CD4027 dual JK flip-flop
checker. counter/decoder/7-segment LED driver T1, T2 : BC547 npn silicon
Clock pulse generator. The sche- CD4033 (IC2). This IC counts and drives transistor
the 7-seg- DIS.1-DIS.4 : LT543 common-cathode,
ment dis- 7-segment LED display
play DIS.1. Resistors (all ¼watt, ±5% carbon film,
The control unless stated otherwise)
pulse pro- R1,R2,R4,R6-R9 : 100-kilo-ohm
R3 : 470-kilo-ohm
duced by R5 : 1-mega-ohm
gate N3 ac- R10-R12 : 1-kilo-ohm
tivates this VR1 : 1-mega-ohm pot
display. Capacitors:
T h e C1 : 0.1µF ceramic disk
clock pulses C2 : 0.01µF ceramic disk
C3 : 0.001µF ceramic disk
also go to C4 : 0.22µF ceramic disk
d e c a d e C5 : 100µF, 16V electrolytic
counter/de- Miscellaneous:
coder IC PZ1 : Piezo buzzer, continuous
CD4017 type
(IC3, pin S0-S10 : Push-to-on switch
14). This IC S11 : On/Off switch
: DC IN socket
Fig. 1: Block diagram of the digital number shooting game controls the
72
CONSTRUCTION
Fig. 2: Circuit diagram of the digital number shooting game
73
CONSTRUCTION
74
CONSTRUCTION
EDI
PC INTERFACED AUDIO
DWIV
S.C.
S
ounds of various kinds have always put from IC2(a) is the required audio sig-
fascinated human beings. Many de-
Hardware nal that has to be processed and ampli-
vices have been invented for re- The circuit functions as an 8-bit mono fied to feed the speaker. The part follow-
cording and playing back the sounds— player, i.e. the sound files (with .WAV ing the I-V converter is the bass- and
from magnetic tapes to DVD (digital ver- extension) with sound quantised to eight treble-control circuit employing RC-type
satile disc), from Adlib cards to high-per- bits or 256 levels can be played. In variable low-pass and high-pass filters
formance sound cards with ‘surround case of files with 16-bit quantisation, these connected to the input of audio amplifier
sound’ capability. For personal comput- are re-quantised as discussed under ‘Soft- built around the second op-amp inside
ers (PCs), there is a wide variety of such ware’ subheading. Thus, only eight bits LF353 [IC2(b)].
devices. A modern PC, generally, has a are sent to the card through the printer The frequency response of the filters
‘Sound Blaster’ card installed in it. If your port. can be varied using potentiometers VR1
PC does not have a sound card, here is Since there is no duplex communica- and VR2. The low frequencies or bass can
a low-cost audio playback circuit with tion necessary between the player card be cut or boosted with the help of poten-
bass, treble, and volume controls to cre- and the PC, it is sufficient to use the eight tiometer VR1. Similarly, high frequencies
ate your own music player. output data lines of the port 378H (pins 2 or treble can be cut or boosted with the
The playback device ‘M-player’ (i.e. through 9 of 25-pin D-connector). This 8- help of potentiometer VR2. At low fre-
media player) described here uses mini- bit digital output is converted into an ana- quencies, capacitors C2, C3, and C4 act
mal hardware to achieve a moderately logue signal using DAC 0808 (IC1) from as open circuits and the effective feed-
good-quality audio playback device. National Semiconductor. back is through 10k resistors (R4, R5,
The software that accompanies the hard- The output current from the DAC and R6) and potentiometer VR1.
ware is meant for a PC running under varies with the input digital level The audio amplifier IC2(b) acts as an
MS-DOS or a compatible operating sys- (represented by bits D0 through D7), inverting amplifier and the amplification
tem. This device can play a simple 8-bit the reference voltage (Vref), and the value (or attenuation) of the low-frequency bass
PCM (pulse code modulation) wave file of series resistor R1 connected to Vref signals depends on the value of potenti-
with some special effects. The PC is con- pin 14 of DAC0808 IC. The output cur- ometer VR1. The frequency f1 at which C
nected to the device through the PC par- rent Io (in mA) is given by the relation- = C2 = C3 becomes effective is given by
allel port. ship: the equation:
75
CONSTRUCTION
76
CONSTRUCTION
Program Listing
MPLAYER.CPP cprintf(“%c”,205); delay(75);
#include “Sounds.h” for(j=y1+1;j<=y2-1;j++){ gotoxy(3,13);cprintf(“ ”);
void DisplayTip(char *string) gotoxy(x1,j); delay(75);
{ cprintf(“%c”,186); gotoxy(3,14);cprintf(“ ”);
text_info tinf; gotoxy(x2,j); delay(75);
if(strlen(string)<75) cprintf(“%c”,186); gotoxy(3,15);cprintf(“ ”);
{ } delay(75);
gettextinfo(&tinf); gotoxy(x1,y1);cprintf(“%c”,201); gotoxy(3,16);cprintf(“ ”);
textbackground(LIGHTGRAY);textcolor(RED); gotoxy(x2,y1);cprintf(“%c”,187); delay(75);
gotoxy(2,25); gotoxy(x1,y2);cprintf(“%c”,200); gotoxy(3,17);cprintf(“ ”);
for(int i=0;i<75;i++) cprintf(“ ”); gotoxy(x2,y2);cprintf(“%c”,188); return;
gotoxy(2,25); if(caption!=NULL){ }
cprintf(string); textcolor(WHITE); void MenuInitialise(void)
textattr(tinf.attribute); gotoxy(x1+2,y1); {
gotoxy(tinf.curx,tinf.cury); cprintf(“%s”,caption); int i;
} } // The FILE menu option
return; textattr(tinfo.attribute); Menu[MNU_FILE].nextMenu=MNU_EFFECT;
} return; Menu[MNU_FILE].prevMenu=MNU_OPERATION;
void Window(int x1,int y1,int x2,int y2,char } Menu[MNU_FILE].Child=FALSE;
*caption,int BackCol,int TextCol) void DrawScreen(void) Menu[MNU_FILE].num_items=4;
{ { for(i=0;i<4;i++)
text_info tinfo; textbackground(LIGHTGRAY);textcolor(BLACK); {
int i,j; clrscr(); Menu[MNU_FILE].Enabled[i]=TRUE;
gettextinfo(&tinfo); Window(1,2,80,24,NULL,BLUE,WHITE); Menu[MNU_FILE].subMenu[i]=NONE;
textbackground(BackCol);textcolor(TextCol); gotoxy(1,1);cprintf(“ File Effects Operation”); Menu[MNU_FILE].String[i]=(char *)malloc(15);
for(j=y1;j<=y2;j++){ textcolor(RED); Menu[MNU_FILE].Tip[i]=(char *)malloc(50);
gotoxy(x1,j); gotoxy(3,1);cprintf(“F”); Menu[MNU_FILE].OptionID[i]=1+i;
for(i=x1;i<=x2;i++) gotoxy(12,1);cprintf(“E”); }
cprintf(“ ”); gotoxy(24,1);cprintf(“O”); Menu[MNU_FILE].Enabled[1]=FALSE;
} textbackground(BLUE);textcolor(LIGHTBLUE); strcpy(&(Menu[MNU_FILE].String[0][0]),“Open”);
gotoxy(x1+1,y1); gotoxy(3,10);cprintf(“ ”); strcpy(&(Menu[MNU_FILE].String[1][0]),“Save”);
for(i=x1+1;i<=x2-1;i++) delay(75); strcpy(&(Menu[MNU_FILE].String[2][0]),“-”);
cprintf(“%c”,205); gotoxy(3,11);cprintf(“ ”); strcpy(&(Menu[MNU_FILE].String[3][0]),“Exit”);
gotoxy(x1+1,y2); delay(75); strcpy(&(Menu[MNU_FILE].Tip[0][0]),“Open the
for(i=x1+1;i<=x2-1;i++) gotoxy(3,12);cprintf(“ ”); *.wav file”);
77
CONSTRUCTION
78
CONSTRUCTION
RemoveMenu(MenuID); } ButtonDisplay(45,7,ENABLE_NOTACTIVE,“Cancel”);
return(0); void ButtonDisplay(int x1,int y1,char state gotoxy(x,y);
} char *caption) break;
else { case 1:
{ text_info tinfo; _setcursortype(_NOCURSOR);
if(prevMenu!=NONE) gettextinfo(&tinfo); ButtonDisplay(25,7,ENABLE_ACTIVE,“ Ok ”);
{ int i; break;
RemoveMenu(MenuID); if(state==ENABLE_NOTACTIVE) textcolor case 2:
return(ShowMenu(prevMenu)); (YELLOW); ButtonDisplay(45,7,ENABLE_ACTIVE,“Cancel”);
} if(state==ENABLE_ACTIVE) textcolor(WHITE); ButtonDisplay(25,7,ENABLE_NOTACTIVE,“
} if(state==DISABLE) textcolor(LIGHTGRAY); Ok ”);
break; textbackground(CYAN); break;
case RIGHT_ARROW: gotoxy(x1,y1);cprintf(“ %s ”,caption); }
if(subMenu[CurSelect]!=NONE) textbackground(LIGHTGRAY);textcolor(YELLOW); ch=getch();
{ cprintf(“%c”,220); if(ch==0) ch=getch()+300;
RetVal=ShowMenu(subMenu[CurSelect]); gotoxy(x1+1,y1+1);for(i=0;i<8;i++)cprintf(“%c”,223); ch+=300;
if(RetVal!=0) textattr(tinfo.attribute); switch(ch)
{ } {
RemoveMenu(MenuID); void ButtonPushed(int x1,int y1,char *caption) case TAB:
return(RetVal); { Control=(++Control)%3;
} text_info tinfo; break;
} gettextinfo(&tinfo); case ESCAPE:
else int i; _setcursortype(_NOCURSOR);
{ textbackground(LIGHTGRAY);textcolor(WHITE); ButtonPushed(45,7,“Cancel”);
if(nextMenu!=NONE) gotoxy(x1,y1);cprintf(“ ”); ch=1; Control=2;
{ gotoxy(x1,y1+1);cprintf(“ ”); break;
RemoveMenu(MenuID); textbackground(CYAN); case ENTER:
return(ShowMenu(nextMenu)); gotoxy(x1+1,y1);cprintf(“ %s ”,caption); _setcursortype(_NOCURSOR);
} delay(250); ButtonPushed(25,7,“ Ok “);
} gotoxy(x1,y1);cprintf(“ %s ”,caption); ch=1;Control=1;
break; textbackground(LIGHTGRAY);textcolor(YELLOW); break;
case DOWN_ARROW: cprintf(“%c”,220); case SPACE:
textbackground(LIGHTGRAY); gotoxy(x1,y1+1);cprintf(“ ”);for(i=0;i<8;i++) if(Control==2){_setcursortype(_NOCURSOR);
if(Enabled[CurSelect]) cprintf(“%c”,223); ButtonPushed(45,7,“Cancel”);ch=1;}
textcolor(BLACK); textattr(tinfo.attribute); if(Control==1){_setcursortype(_NOCURSOR);
else } ButtonPushed(25,7,“ Ok ”);ch=1;}
textcolor(BROWN); BOOL DisplayDialog(char mode) break;
gotoxy(StartX+1,StartY+CurSelect+1); { case BACK_SPACE:
cprintf(“ ”); int Control=0,ch; if(Control==0 && i>0)
for(j=0;j<longLength+1;j++) int x=29,y=5,i=0,N=0; {
if(j<strlen(String[CurSelect])) char TempStr[40];TempStr[0]=0; gotoxy(—x,y);
cprintf(“%c”,String[CurSelect][j]); switch(mode) cprintf(“ ”);
else { i—;
cprintf(“ ”); case FILE_OPEN: Window(10,3,70,9,“Open TempStr[i]=0;
CurSelect++; File”,LIGHTGRAY,YELLOW);break; gotoxy(29,5);
if(CurSelect==num_items) CurSelect=0; case FILE_SAVE: Window(10,3,70,9,“Save cprintf(“%s”,TempStr);
while(String[CurSelect][0]==’-’) File”,LIGHTGRAY,YELLOW);break; }
{ case PLAYBACK_RATE: Window(10,3,70,9,” break;
if(CurSelect==num_items) Playback Rate”,LIGHTGRAY,YELLOW);break; default:
CurSelect=0; } ch-=300;
else ButtonDisplay(25,7,ENABLE_NOTACTIVE,“ if(ch<300 && i<N)
CurSelect++; Ok ”); {
} ButtonDisplay(45,7,ENABLE_NOTACTIVE,“Cancel”); TempStr[i++]=(char)ch;
break; textbackground(LIGHTGRAY);textcolor(YELLOW); TempStr[i]=0;
case UP_ARROW: gotoxy(13,5); gotoxy(29,5);
textbackground(LIGHTGRAY); if(mode==FILE_OPEN || mode==FILE_SAVE) cprintf(“%s”,TempStr);
if(Enabled[CurSelect]) { x++;
textcolor(BLACK); cprintf(“Enter Filename: ”); }
else strcpy(TempStr,sFileName); break;
textcolor(BROWN); N=39; }
gotoxy(StartX+1,StartY+CurSelect+1); } if(ch==1) break;
cprintf(“ ”); else }
for(j=0;j<longLength+1;j++) { textbackground(BLUE);textcolor(WHITE);
if(j<strlen(String[CurSelect])) cprintf(“Playback Rate : ”); for(ch=3;ch<=9;ch++)
cprintf(“%c”,String[CurSelect][j]); strcpy(TempStr,sPlayBackRate); }
else N=5; gotoxy(10,ch);
cprintf(“ ”); } for(i=10;i<=70;i++)
CurSelect—; textbackground(BLUE);textcolor(WHITE); cprintf(“ ”);
if(CurSelect<0) CurSelect=num_items-1; cprintf(“ ”); }
while(String[CurSelect][0]==’-’) gotoxy(29,5);cprintf(“%s”,TempStr); if(Control==1)
{ i=strlen(TempStr); {
if(CurSelect<0) x+=i; if(mode==FILE_SAVE || mode==FILE_OPEN)
CurSelect=num_items-1; for(;;) strcpy(sFileName,TempStr);
else { if(mode==PLAYBACK_RATE)strcpy(sPlayBackRate,
CurSelect—; switch(Control) TempStr);
} { return(TRUE);
break; case 0: }
} _setcursortype(_NORMALCURSOR); return(FALSE);
} textbackground(BLUE);textcolor(WHITE); }
79
CONSTRUCTION
80
CONSTRUCTION
www.electronicsforu.com
a portal dedicated to electronics enthusiasts
81
C I RC ICR CUUII TT I ID D
EAS
EAS
S
tepper motors are widely used (IC1) with decoded outputs is used here anti-clockwise direction.
where precision and accuracy are as a sequence generator (similar to the To use external clock pulses, simply
the primary considerations during running-light effect). As we need only four disconnect pin 14 of CD4017B from pin 8
rotation or positioning. Microprocessors or outputs, the fifth output (pin 10) is con- of CD4069B and then connect external
microcontrollers are often employed for nected to the RESET pin (pin 15). The clock pulses to pin 14 of CD4017B. Each
controlling
their operation.
But it may not
always be con-
venient or nec-
essary to use
microcon-
trollers, as it
would make the
gadget unnec-
essarily cost-
lier.
Here is a
simple and low-
cost circuit to
drive a stepper
motor on full
power for any
number of
whole steps.
The present cir-
cuit is intended
to drive four-winding stepper motors, but four outputs, in conjunction with four npn pulse drives the motor by one step, which
one can easily modify it for other types. power transistors, function as half-power may normally be 1.8o or 3.6o, as shown on
The popular decade counter CD4017 full-step drivers. In order to get full power, the label plate of the motor.
eight diodes (8 x 1N4148) are used. Truth To reverse the direction of rotation,
TABLE I Table I depicts the half-power operation, one should interchange terminals A with
Half-Power Operation while truth Table II depicts the full-power B and C with D simultaneously.
Step Supply to coils operation. The colours of motor terminal wires,
number A B C D The use of hex inverter IC2 (CD4069) shown in the diagram, are those of the
1 On Off Off Off gives two benefits: stepper motor used in head-drive of a
2 Off On Off Off 1. The inversion through NOT gates 1.2MB floppy disk drive unit, operating
3 Off Off On Off
4 Off Off Off On
allows the use of pnp power transistors on 12V with a 3.6o/step, which the author
5 Repetition On Off Off Off (4 x BD140), which make it possible to has used in his prototype.
| | | | | ground the common terminal of the mo- Notes: 1. Heat-sinks may not be re-
| | | | | tor. This is useful in many applications. quired for the power transistors.
2. The two unused inverter gates (N1 2. Cost of the circuit is less than
TABLE II and N2) are handy to use as clock gen- Rs 100.
Full-Power Operation erator, in conjunction with preset VR1 and 3. Supply voltage for the circuit is
Step Supply to coils capacitor C1. Varying the preset allows equal to the operating voltage of the mo-
number A B C D the change in clock frequency and hence tor (i.e. between 3V and 12V).
1 On On Off Off the speed of the motor. 4. RPM of motor = , where
2 Off On On Off
If one does not know the sequence of f is the frequency of clock pulses and d
3 Off Off On On
4 On Off Off On motor terminals to be connected to termi- the angular displacement in degrees per
5 Repetition On On Off Off nals A through D of the circuit, then first step.
| | | | | connect any one terminal of motor to ter-
| | | | | minal A of the circuit and connect com-
82
CIRCUIT IDEAS
ELECTRONIC DIGITAL
stage consists of a digital counter based
on 4-digit counter IC 74C926. When light
from any source falls on junction of the
TACHOMETER
infrared module, its output goes low. This
S.C. DWIVEDI output is connected to pin 2 of NE555
(configured as a monostable) to trigger it.
The output pulses from pin 3 are con-
nected to clock pin 12 of 74C926. Hence,
ADITYA U. RANE
on receipt of every pulse, the count of IC
74C926 increments by one. For checking
T
achometer is nothing but a simple stripe is pasted on the rotating part of the revolutions in a predetermined time
electronic digital transducer. It the machinery. The reflected light from period, a stopwatch may be used. Before
finds many applications in our the contrasting stripe falls on the junc- counting starts, depress reset switch S1
83
CIRCUIT IDEAS
LIGHT-OPERATED LIGHT
SWITCH S.C.
DWIV
EDI
from the lamp (not from the torch) keeps
LDR’s resistance low. So, the lamp re-
mains continuously ‘on’. Once the lamp is
PRADEEP G. ‘on’, it can be switched ‘off’ again by in-
terrupting the light falling on LDR, by
either waving hand in front of it or by
H
ere is a light-operated, remote- interrupting
controlled solidstate switch to power supply to
operate a lamp. During darkness, the circuit for a
the resistance of LDR shoots up to meg- moment.
ohm range. Thus, the triac does not get RFC emplo-
gate drive and hence it does not conduct. yed here can be
When LDR is illuminated by means made by winding
of a torch-light beam, the resistance of about 15 turns of
LDR suddenly decreases (below 10-kilo- 18 SWG wire
ohm). This causes the triac to conduct over an insulated
and switch ‘on’ the lamp. Light received ferrite rod.
84
CIRCUIT IDEAS
CONTROLLER
that the more precise the timer, the more
precise will be the power being controlled.
S.C. DWIVEDI
In this circuit, the time period of
mains waveform is divided into 20 equal
PRATAP CHANDRA SAHU parts. So, there is a time interval of 1 ms
between two consecutive steps. The sam-
pling voltage is unfiltered full-wave and
S
CRs and Triacs are extensively one divides the angle described during one is obtained from the diode bridge at the
used in modern electronic power complete cycle of the sinewave (2π = 360o) output of the power transformer. The
controllers—in which power is con- into equal parts, then time period T of timer is reset at every zero crossing of
trolled by means of phase angle variation the wave will be divided into identical full wave and set again instantly for the
of the conduction period. Controlling the equal parts. Thus, it becomes fairly easy next delay time. This arrangement helps
phase angle can be made simple and easy to set the different programmable tim- the timer to be set for every half of mains
if we set different firing times correspond- ings synchronised with the AC mains wave—when the positive half of the mains
ing to different firing angles. The design sinewave at zero crossing. The main ad- waveform starts building up, the timer is
given here is a synchronised program- vantage of such an arrangement, as al- set for that half and as it begins to cross
zero, it gets reset and set again
for negative half, when the
negative half begins to build up.
The process is repeated. Here,
instead of using two zero cross-
ing detectors—one for each half
of mains wave—a single detec-
tor is used to perform both the
functions. This is possible be-
cause the sampling wave for
negative half is inverted by the
rectifier diode bridge.
The 18V AC from power
transformer is fed to the four
diodes in bridge configuration,
followed by the filter capacitor
which is again followed by a
three-terminal voltage regula-
tor IC LM7812. The voltage so
obtained drives the circuit. The
unfiltered voltage is isolated
from the filter capacitor by a
diode and is fed to zener diode
D8, which acts as a clipper to
clip voltage above 6 volts.
This voltage is fed to the
mable timer which achieves this objec- base of transistor T1, which is wired
tive. as zero crossing detector. When base
The following equation for a sinewave voltage reaches the threshold, it con-
shows how firing time and the phase angle ducts. It thus supplies a narrow posi-
are related to each other: tive pulse which resets the timer at
θ = 2πft or θ∝t every zero crossing.
Here, θ is the angle described by a A 32.768kHz crystal is used to
sinewave in time t (seconds), while f is get stable output of nearly
the frequency of sinewave in Hz. Time 1 kHz (1,024Hz) frequency after five
period T (in seconds) of a sinewave is stages of binary division by
equal to the reciprocal of its frequency, an oscillator-cum-divider IC CD4060.
i.e. T = 1/f. The 32.768kHz crystal is used be-
The above equation indicates that if cause it can be found in unused
85
CIRCUIT IDEAS
quartz clocks and is readily reaches the desired time interval, the cor-
available in the market. But use responding output of CD4017 inhibits the
of a 1kHz crystal using a quad- counter CD4017 (via pole of rotary switch
NAND IC CD4093 as clock gen- and diode D6) and fires the Triac. Tran-
erator, as shown in Fig. 2, is bet- sistor T2 here acts as a driver transistor.
ter as it provides the exact time The reset pin of 4017 is connected to zero
interval required. In that case, crossing detector output to reset it at ev-
CD4060 oscillator/divider is not ery zero crossing. (The load-current wave-
required. forms for a few positions of the rotary
The CD4017B counter-cum- switch, as observed at EFY Lab, are
decoder IC then divides this shown in Fig. 3.)
1kHz signal into ten equal in- The circuit can be used as power con-
tervals, which are programmed troller in lighting equipment, hot-air oven,
via the single-pole, 10-way ro- universal single-phase AC motor, heater,
tary switch. Once the delayed output etc.
W
hile travelling by a train or bus, sistor T1 gets forward biased to extend (Pin6) (Pin1)
we generally lock our luggage the positive supply to the alarm circuit. X X Police siren
using a chain-and-lock arrange- In idle mode, the power consumption of VDD X Fire-engine siren
ment. But, still we are under tension, ap- the circuit is minimum and thus it can be VSS X Ambulance siren
prehending that somebody may cut the used for hundreds of travel hours. “-” VDD Machine-gun sound
chain and steal our luggage. Here is a To enable generation of different Note: X = no connection; “-” = do not care
simple circuit to alarm you when
somebody tries to cut the chain.
Transistor T1 enables supply to
the sound generator chip when the
base current starts flowing through
it. When the wire (thin enameled
copper wire of 30 to 40 SWG, used
for winding transformers) loop
around the chain is broken by some-
body, the base of transistor T1,
which was earlier tied to positive
rail, gets opened. As a result, tran-
86
June
2000
C O N S T R U C T I O N
T
his article is dedicated to the use of a discharge tube to which a high The discharge tube is supplied air
good health of EFY readers in electric field is applied so as to break from an air-group, which is built into the
the year 2000 and beyond. It de- down the oxygen present in the air. This unit. The unit produces ozonated air at a
scribes an ozone generator for portable phenomenon occurs at or near a field pressure head of 15-20 cm of water via
(and portable1) use. strength of 25 kV/cm, and the resulting its outlet. So the exit tube can be let into
Ozone gas is now-a-days used for discharge that takes place is known as water containers with water up to a level
treatment of drinking water, disinfec- corona. The corona has a light bluish of 10-15 cm.
tion, and air-purification. What one re- glow. It is in this corona field that oxy- Another advantage of this unit is
quires is a small and handy unit to be gen becomes ozone (O3). that it is light in weight (less than a
plugged into mains to get ozonated air Ozone has tendency to revert back to kilogram) and carries a very simple con-
at suitable pressure flowing out from a its original form in about 10-20 minutes, trol and a microammeter showing the
tube It can then be let into environment in the atmosphere. Therefore, it is nec- ozone concentration. It employs a high
or bubbled through water or any other essary in any ozone application to gener- voltage of over 5 kV at a high frequency
polluted liquid. But the gadget must be ate ozone as and when requied for use of 15 kHz to 20 kHz, which would not
completely safe to work with. since it cannot be kept stored the way cause a lethal shock. Shock voltages are
Ozone generators invariably make chlorine is stored (in cylinders). Chlo- not cause a lethal shock. Shock voltages
rine is used in our cit- are not dangerous at these high frequen-
ies to disinfect drink- cies, while at 50 Hz these high voltages
ing water supply. It is are quite dangerous.
highly carcinogenic be- Commercial ozone generators make
cause when it comes use of mains 50Hz frequency and are
into contact with rem- thus very dangerous while assembling.
nants of pesticides in Extreme care is required to be exercised
our foodstuff (veg- by the user while diagnosing any prob-
etables), it generate lem with such apparatus. Ozone genera-
Fig. 1: Airflow through cylindrical space of discharge tube halomethanes, which tor at the higher frequencies used here
88
C O N S T R U C T I O N
89
C O N S T R U C T I O N
90
C O N S T R U C T I O N
circuit has a high-voltage winding for small cut made int he box with drill and PARTS LIST
the EHT of the picture tube. This EHT is fret saw. Semiconductors:
connected to the electrode (aluminium The meter has a top which can be IC1 (N1-N5) - CD4069 hex inverter
foil) of the ozone discharge tube. easily removed and replaced, as it is IC2 (N6-N7) - CD4011 quad 2-input
The LOT used should be two-limb snug fit. Removal of the meter top ex- Nand gate
T1 - 2N2222 np transistor
type, i.e, the low-voltage windings should poses the meter scale, which can be re- T2 - 2N2907 pnp transistor
be on the left limb of the ferrite core, and drawn in per cent of 0-1 gm/hour O3. T3 - IRF840 n-channel
the EHT winding (primary and second- The meter shows the discharge cur- MOSFET
D1-D4, D9 - 1N914 detector diode
ary), which is generally epoxy potted, on rent through the ozone-generating tube
D5-D6, D8, D11 - 1N4007 rectifier diode
the right limb. The LOT should have an The earth side of the discharge tube D10 - BA159 switching diode
external EHT diode and not an inter- (aluminium tube) is connected through D7 - 12V, 1W zener
nally wired EHT diode, as is common in a 1-kilo-ohm, 1W resistor to ground. The D12 - 1N4001 rectifier diode
D13 - Green LED
colour television LOTs. The reason be- EHT wire is connected to the electrode
ing that only AC voltage is needed here. Resistors (all 1/4-watt, +_ 5% carbon,
(aluminium foil) on top of the glass tube
unless stated otherwise):
Further, it is necessary to remove any The 1-kilo-ohm resistor develops a volt- R1, R4 - 100-kilo-ohm
coupling between the two limbs, which age in approximate proportion to the R2, R6, R10 - 10-kilo-ohm
may be present in the LOT windings. A ozone that would have been generated. R3 - 110-ohm
R5, R15, R17 - 1-kilo-ohm
connection from the left limb to the right A series combination of 4.7-kilo0-ohm R7 - 2.2-ohm, 10 watt fusible
limb is used to increase the mutual cou- resistor and a diode (1N4001) supply resistor
pling. In the circuit presented here that current to the meter coil. R8 - 10-kilo-ohm, 10-watt
coupling leads to over-currents in the LED indicator (Fig. 6). The indica- R9 - 6.8-kilo-oh,m
R11 - 15-ohm
event of any discharge tube sparking, tor LED on panel gets its current through R12 - 100-ohm, 10-watt
thereby damaging the IRF840 instantly. a single turn wound on the top limb of the R13, R14 - 47-ohm, 10-watt
It is therefore necessary to cut off the ferrite transformer. The current is recti- fusible resistor
connection linking the two limb windings fied by a 1N4003 diode and filtered by a R16 - 4.7-kilo-ohm
VR1 - 10-kilo-ohm preset
before installation. Preferably, a 1,00- 10uF, 16V capacitor which supplies the VR2 - 1-kilo-ohm preset
ohm, 2#W resistor may be wired in the current through 1-kilo-ohm series resis- VR3 - 1-kilo-ohm potmeter
place of this cut, if an improved perfor- tor to the LED. The glowing of the LED Capacitors:
mance of ozone generation is desired. indicates that the circuit is working. C1 - 3300pF ceramic disk
Lab. note. During testing of EFY Lab. Note: At EFY Lab, about eight C2, C7 - 0.1uF ceramic disk
C3 - 100p, 400V electrolytic
Lab, transformer stamped as LOT 2070 turns of insulated wire around top limb
C4, C5 - 0.47uF, 400V polyster
obtained from the market was found to of LOT were used. C6 - 100uF, 35V electrolytic
be single limbed and could generate about AC input. The AC mains supply is C8 - 3.3 kpF, 300V polyster/
34kV peak voltage at 120V AC input. at 230V AC and has a fuse of 500 mA in mica
C9 - 10u, 16V electrolytic
Therefore a double-limbed Leader brand series. A switch can be wired in series
transformer 2095 was procured and used Misellaneous:
with the same, though the same is not
X1 - LOT 2070 EHT
after removal of the encased TV20 recti- shown in the circuit here. (Please note transformer (without
fier diode, in a manner exactly as de- that at EFY, 12V AC input was used as EHT diode) or Leader
scribed by the authors. This transformer mentioned earlier.) brand LOT 2095 (diode
could produce about 30kV peak with AC to be removed)
- Al tube, length=20cm,
input of 120V. The corona discharge
across EHT secondary was prominent
Testing diameter=1cm
- Glass tube, length =
with an air-gap of up to 125 cm. At only Prior to operation of the circuit board 17cm, diameter=1.2cm
80V AC input to the circuit, 100pA space for ozone generation, it is required to - HT electrode
- Aluminium full
current was measured using the meter- test the circuit properly. This can be - M-seal, small packet
ing circuit described below. done as follows: - Teflon tape, two rols
The metering circuit (Fig. 5). This 1. The low-voltage pulse generation - Cork, two numbers
- VU meter
employs a simple low-cost 100uA meter part has to be tested first. For this, in - Short glass tube
used as VU-meter in audio amplifiers place of the mains-derived 12-volt sup- - 1.5cm length, dia=5
and is freely available. Either the edge- ply, a separate 12V supply, derived using mm, 2 numbers
mounting type or the plain type may be an external 12-0-12 volts, 1-amp trans- - Flexible polythene
pipe 5mm diameterm,
used. It has a former, and a 7812 voltage regulator, can one metre length
clear front be used. The two oscillators should have - Aquarium pump
plastic case of frequencies in the specified range and F1 - Fuse, 500mA :
DC IN socket
25 sq. cm which the presets should be able to adjust them
is easily over the range mentioned. Otherwise, 2. Then, using a CRO, the pulse train
mounted on the slight alteration of resistor values may should be observed at the junction of two
front side of the be needed. The 3300pF capacitor used bipolar transistors. Next, MOSFET IRF
Fig. 6: LED indicator plastic box, should be of good ceramic or polyester 840 is connected in the circuit.
circuit with a suitable type, with a rating of 100V or more. 3. Now apply 12V supply to the end
91
C O N S T R U C T I O N
of the LOT winding, in place of the mains R14, rated 10W, got red-hot if voltage rotated over a gas burner to soften the
rectified 200V DC, as shown in Fig. 2. was increased beyond 160 V AC. ends of the tube. It should now be made
For testing, one is not required to use Construction of the discharge tube chamfered on to the metal tube, such
230V directly at all. The same in Fig. 2. (Fig. 7). A simple method for construct- that, at the edges, the glass tube fits the
For testing, one is not required to use ing the discharge tube is presented here, metal tube with no gap. Still, the glass
230V directly at all. The same 12V, or which is suitable for any hobbyist. An tube should be able to slide over the
the unregulated 12V prior to the 7812 aluminium tube of 20cm length and about aluminium tube.
regulator, can be connected. In Fig. 2, 1cm diameter is taken. Antenna scrap After the glass tube is so positioned
the BA159 anode is shown connected to tube can be used, provided the same does over the metal tube, the ends of the
the mains rectified supply at the posi- not have kinks, bends, or burrs. Fig. 7 glass tube are taped using Teflon tape.
tive terminal of the 100uF, 400V electro- shows the construction of the discharge The tube assembly, with the glass enve-
lytic capacitor. But, for the present, con- tube. This aluminium tube is blocked on lope taped, is held at its edge, leaving
nect the unregulated 12V (may be 16V the inside with a small amount of M-seal about 15 cm free at either end, and
or slightly more) to the circuit at the compound, so that no air can pass di- clamped to the wall of the plastic box, as
anode of BA159. rectly through its middle hole. shown in Fig. 8. Clamps meant for TV
4. After switching 'on' the supply, M-seal comes in a pack of two parts. antennae, which are made of plastic
observe the voltage on the EHT wind- The sealing compound is prepared as mouldings, can be used for this purpose.
ing, which comes from the LOT, on a DC and when required, bu taking equal quan- Preparation of the hot electrode.
multimeter kept at its maximum range tities of the two and mixing them to- The hot electrode, to which a voltage
(say, 500 or 1,000V DC). The meter gether throughly. One of the compounds greater than 6,000 volts is applied at
should show a deflection of above 500V. is black and the other is of cream colour. high frequency, is made by closely wrap-
5. The presets in the circuit can be The two are taken, each about 1 cc, and ping plain aluminium foil around the
adjusted to tune the ferrite transformer, then mixed will. This mixture is inserted outer side of the glass tube. The foil is
for this voltage to be a maximum. Then, into the tube with a pencil and spread to wrapped leaving 1 cm uncovered area on
adjust the 1-kilo-ohm potentiometer VR3 attach to the inside wall of the aluminium either ends of the tube. The foil is to be
so that it shows the possibility of vary- tube, blocking any air path. Then, two taped for tightness on the outer glass,
ing the voltage over a limited range, side holes of 2mm diameter are made on using cellulose tape, and a piece of Teflon-
above a threshold value. the tube at the two ends, about 33 cm insulated wire connected to the alu-
6. Now, the 12V transformer supply from each end. These holes can be on the minium foil brought out. This wire is
can be disconnected. The 12V low-voltage opposite faces of the aluminium tube. connected to the EHT lead from the LOT
generation part has to be separately To provide the discharge gap, a on the circuit board.
tested. For this, remove the connection to thinwalled glass tube, commonly used as Assembling the unit. The unit is
the LOT from the MOSFET. Also remove chemistry test tube, is required. It should easy to assemble. First, the circuit board
the CMOS ICs from sockets. Then, on the have an inner diameter about 1.2-1.5 mm is fixed on the bottom of the box with
PCB, one can easily check for zener volt- greater than thet of the aluminium tube, plastic bushes and screws. If screws are
age of 12V. If this voltage is less than 12 i.e., if a 10mm outer dia aluminium tube not needed externally, the bushes can be
volts, adjust the value of 82-ohm series is taken, a glass tube of 11.5 mm inner pasted on to the box. Then, clamps are
resistor to a lesser value, say, 68-ohm. diameter should be used. This will en- fixed for discharge tube. Polythene tubes
Lab. note. At EFY, this part of the sure the best performance with an air (transparent plastic) are fitted to the
circuit has been modified, and it is pos- gap of 0.75 mm all around. If the gap is 0.6 glass tube ends.
sible to get correct 12V output at AC mm, it is still better, but then the metal At the bottom of box, the air pump,
input voltage of 120 volts. Only the modi- tube should be extremely perfect. with its outer plastic casing removed, is
fied circuit is included in Fig. 2. The glass tube is cut such that it fixed to the bottom with a screw. The
The circuit will ordinarily work even covers the length of the aluminium tube, inside of the diaphragm pump is shown
at 200-volt mains, but not below that. except for about 1.5 cm at each end. in Fig. 8. The casing of the pump is not
The mains input can go up to 240V, but Thus if a 20cm long aluminium tube is needed for two reasons: to save space
not more. taken, the glass tube will be 17 cm long. needed for fixing it within the bread box,
Lab note. During testing it was ob- The metal tube should be able to go and the vibrator part is now accessible.
served that fusible resistors R13 and freely in it Now, the glass tube may be A small plastic sheet is fixed by applying
glue (Araldite) to
the vibrating ar-
mature, so that it
serves as a
simple fan for the
inside. The mains
supply is con-
nected to the
PCB in parallel
with the supply
Fig. 7: Construction details of discharge tube to the air-pump.
92
C O N S T R U C T I O N
But now this connection is removed and known quantity of KI solution and bubble put of 120V AC after changing some of
only the pump is made to work. the ozonated air from ozone generator the component values, including LOT,
The end of the aquarium air-pump, through it, for a definite time (one at EFY Lab. The changed components/
which produces air under pressure, is minute). The free liberated iodine can be values have been incorporated into the
connected by a s short length of tube to estimated by titration experiment with final circuit shown in Fig. 2. Since higher
the corked glass tube of the discharge thiosulphate. Thus, by knowing how AC voltage (greater than 20 kV) was
tube assembly. The other end of the tube much iodine has been liberated, one can available, we could increase the separa-
is fixed to another similar polythene tube find how much ozone has been absorbed tion between the aluminium and glass
of adequate length (say, one metre). in the solution by quantitative analysis. tubes appreciably.
Now, after allowing the air-pump to This gives the gas output form the tube 1. Water disinfection. The impure
work, one must check whether there is in mg/litre. The gas output can be foud water can be disinfected by bubbling
adequate draft of air through the tube by finding the time taken to replace the ozone through it for a time so that esti-
connected to the air-pump, without any 1 litre of water by the bubbling gas. mated 4 mg/litre is dissolved.
leakage. Any air leakage prior to tube After estimating the output of the unit, 2. Air purification. You can purify
entry or through the Teflon tape seals, marks are made on the meter. This is a the air of your room by letting out
or through the inner metal tube, can be prototype marking which can be followed ozonated air upward into it for five min-
easily detected with figers or soap bubble in other units of similar design. utes, with a fan running.
test. The leaks have to be plugged 3. Mosquito repulsion. Same as
and all air that comes out of the pump above, but please shut the windows soon
should go through the annular gap of the
Usage after switching 'off' the ozone generator.
discharge path and exit through the out- The unit can be used where a 230V AC This operation is to be done in he morn-
let tube. mains supply outlet is available. The ozone ing to drive away the mosquitoes and in
After this check, the meter connec- generated can be let into air or bubbled the early evening at around 5 pm to
tion is made from the board's 1-kilo-ohm through the solution or water being prevent them from coming in. The opera-
shunt discharge resistor R15, with se- treated using ceramic diffusers (available tion may be repeated at midnight when
ries diode D11 and current limiting re- from aquarium equipment shops). The malaria mosquitoes normally attack.
sistor R16. The meter is fixed, as stated time rating of this unit is very short. Sine 4. Bleaching. The stains of ink on
earlier, to the from small edge of the there is no fan employed for cooling, both clothes can be bleached by applying ozone
box, which also accommodates the LED the discharge tube and circuit board tran- gas. On bubbling ozone into the diluted
and ozone output control potmeter. The sistor may quickly heat up The tested ink contained in a test tube, the water
LED is wired along with diode D12, re- rating at ambient temperature of 25o Cis becomes clear within a short time.
sistor R17, and capacitor C9 as shown in 5 minutes.. This tim is sufficient for all 5. Pollutant treatment. Ozone in
Fig. 6. the applications described below. large quantities can be used for treating
The lid, on the outside, may be pasted Lab note: The circuit could be con- polluted water in industry, along with
with the warnign label: “DANGER—DO tinuously kept 'on' with reduced AC in- bacterial treatment. The BOD (biologi-
NOT OPEN WHEN IN USE”. cal oxygen demand) can be
After the whole assembly is checked brought down to 30 with
and mains supply is given, one can watch ozone only.
the meter reading and green LED on the 6. Mouth washing.
panel. The glowing LED indicates that You may ozonate 200 cc of
the circuit, along with LOT, is working water and use it for gar-
and the meter shows that the there is a gling.
discharge. The sound of the air-pump 7. Vegetable clean.
wil be heard of course, but one can also Only ozonated water
hear the hissing corona sound distinctly. should be used for cleaning
If lights are 'off', a blue glow may also be vegetables like cabbage, to-
seen on watching from the end of the matoes, and carrot. Chlori-
glass. A smell like that of rotten fish nated water is harmful.
from the tube indicates presence of ozone. 8. Skin wound heal-
The meter reading needs calibration now. ing. An exposure to the
ozone gas quickly heals
skin wounds and rashes.
Calibration You may apply ozonated
There are two ways ot do the calibra- olive oil to speed up heal-
tion. One is by using an ozone gas ing.
analyser, which is an expensive instru- There are may other
ment. So, the other method, which is uses of ozone which one can
economical, is described here. try. The gas should not,
Potassium iodide (KI) solution is con- however, be inhaled di-
verted to iodine gas by ozone. Taken a Fig. 8: Photograph of author’s prototype rectly, continuously. G
93
C O N S T R U C T I O N
D
uring a conference where speak- tactile switches S2 and S3, with slide In this circuit, IC5 (CD4060B, a 14-
ers are allotted different time switch S1 in 'set' position. Once the time stage binary counter with internal os-
slots for completing their duration is preset, the same is displayed cillator) is used for generation of the
speech, it is essential to use a suitable in 7-segment LED displays (DIS.1 and basic timing pulses. Presets VR1 and
conference timer which could be pro- DIS.2). VR2 are required to be adjusted for ob-
grammed for the given time slot. It As soon as the designated speaker taining approximately 1 Hz (1.0666 Hz,
should not only provide indication as to starts speaking, switch S1 is flipped to be more precise) pulses from pin 7
when the allotted time slot. It should from 'set' position to 'start' position. The (Q4) of IC5, while the pulses from pin
not only provide indication as to when displayed time will start decrementing 15 (Q10) are available at the rate of one
the allotted time is over, but also about once a minute until it becomes 00, i.e pulse per minute. For countdown timer
the leftover time at any given instant.
The conference timer presented here is
designed to incorporate all such facili-
ties and is expected to prove quite use-
ful.
This conference timer is just a 2-
digit (minutes) countdown timer which
can be preset from 01 minute to 99 min-
utes. The time duration is preset using
PARTS LIST
Semiconductors:
IC1, IC2 - CD4511B, BCD-to-7-
segment latch/decoder/
driver
IC3,IC4 - CD4510 BCD up/down
counter
IC5 - 4060B 14-stage counter/
divider/oscillator
T1-T4 - BC547 npn transistor
T5 - SL100 npn transistor
D1-D8 - 1N4007 rectifier diode
D9 - 5.1V zener
LED1 - Red LED
DIS1, DIS2 - LTS543 common-
cathode display
Resistors (all 1/4-watt, +_5% carbon, unless
stated otherwise):
R1-R14 - 470-ohm
R16-R18
R24, R28, R31 - 100-kilo-ohm
R19 - 100 ohm
R20, R27 - 33-kilo-ohm
R22, R23 - 10-kilo-ohm
R25, R30 - 22-kilo-ohm
R29 - 22-kilo-ohm
R26 - 470-ohm
VR1 - 50-kilo-ohm preset
VR2 - 1-mega-ohm preset
Capacitors:
C1 - 180pF ceramic disk
C2 - 47pF, 25V electrolytic
C3 - 001uF ceramic disk
C4 - 0047uF ceramic disk
Miscellaneous:
RL1 - Relay 6G, 100-ohm
S1 - DPDT slide switch
S2, S3 - Tactile switch
S4 - SPDT slide switch
PB - Piezo buzzer
Fig. 1: Circuit diagram of conference timer
94
C O N S T R U C T I O N
(CD4510B). They convert the ference timer while its down counting
BCD code to 7-segment posi- mode is used for normal timer opera-
tive logic output code to dis- tion.
play the equivalent decimal When presetting, the carry 'pout' pin
digits. While displaying deci- 7 of IC3 and carry 'in' pin 5 of IC4 are
mal digits 9 and 6, their tails not cascaded, to permit presetting of
are not displayed. The store tens and units digits independently (us-
function available in these ICs ing push-to-on tactile switches S2 and
is not used in this circuit and S3, respectively). In countdown mode
hence the store pin 5 of IC1 carry 'out' pin 7 of IC3 and carry 'in'
and IC2 is made permanently pin 5 of IC4 are cascaded for 2-digit
Fig. 2: Appliance ‘on/off’ switching application for timer low. countdown timer operation. For preset-
ting function, 1Hz (approx.) pulses
are used, while for normal cas-
caded countdown operation of the
timer, pulse rate of one-pulse-per-
minute is used. As stated earlier,
these two types of pulses are
available from pins 7 and 15, re-
spectively, of IC5.
Transistor T2 is used to stop
or activate the IC5 binary
counter. When transistor T2 is in
'cut-off'' state, its collector volt-
age goes 'high'. As a result, the
positive supply rail is extended
to pin 11 of IC5 via resistor R23
and diode D6 to stop IC5 from
counting further. When transis-
tor T2 conducts, its collector volt-
age goes low and counter IC5 be-
comes active. The stop and run
functions of IC5 binary counter
are used during countdown opera-
tion only. While presetting, the
IC4 binary counter will be in run-
ning condition.
When slide switch S1 is slided
to 'set' position, pin 10 of both IC3
and IC4 is taken 'high' to select
the countup mode for presetting
th timer. As the same time, tran-
sistor T12 gets forward biased and
conducts. As a result, its collec-
tor as well as pin 5 of IC4 go 'low'.
Pin 5 of IC3 is permanently low
Fig. 3: Actual-size, single-sided PCB layout Fig. 4: Component layout for the PCB and both these ICs are not cas-
caded. The one-pulse-per-minute
operation, this pulse (one-per-minute) CD4510B is a divided-by-10 BCD up/ (from pin 15 of IC5) is no longer avail-
is simultaneously applied to pin 15 of down counter. This counter increments able to diode D3-D4 junction, while 1Hz
IC3 and IC4 through switch S1 (in start or decrements by one count for every pulse (available from pin 7 of IC5 ) may
position), and diodes D3 and D4. For low-to-high transition of the clock pulse be applied to hte clock input in 15 of
presetting this timer, bounceless pulses applied to its clock pin15, depending on IC3 or IC4 by pressing the respective
are required at clock pin 15 of both IC3 the logic level at its pin 10. Thus, when tactile switches S2 and S3. For preset-
and IC4. For this reason 1Hz pin 10 of IC3 and IC4 are held high, the ting the timer, depress tactile switch
(bounceless) pulses available from pin 7 counters increment by one count for ev- S2 and S3 until desired count is dis-
of IC5 are used to preset the timer. ery clock pulse, and when they are held played in unt and tens digit (DIS.1 and
IC1 and IC2 (CD4511B), 7-segment low, the counters decrement by one DIS.2). When desired digit has been dis-
latch and driver, accept BCD input code count for every clock pulse. The up played in DIS.1 or DIS.2, immediately
from up/down counters IC3 and IC4 counting mode is used to preset the con- release switch S2 and S3, as the case
95
C O N S T R U C T I O N
may be. Due to conduction of diode D7, pin 15 of both ICs (IC3 and IC4) through disturbance in timer setting.
transistor T2 will be ‘on’ state and thus diodes D3 and D4. Now the digits dis- This circuit, apart from using as a
binary counter (IC5) is in runing played in DIS.1-DIS.2 combination start conference timer, may be converted into
condingion. At the same time, ‘auto re- decrementing once every minute. When programmable 2-digit 'on' or 'off' timer
set’ transistor T4 will also be in ‘on’ digits displayed in DIS.1-DIS.2 become to switch 'on'/'off' any electrical or elec-
state, with its collector pulled low. Thus, '00', carry 'out' pin 7 of both IC3 and tronic appliance after 1 minute to 99
IC5 will continue to operate normally. IC4goes 'low' and transistor T2 does not minutes duration by incorporating ad-
When slide switch S1 is slided from conduct. As a result, collector of tran- ditional add-on circuit shown in Fig.2.
‘set’ position to ‘start’ position, the red sistor T2 goes 'high' and the binary During 'on'/off timer operation, the dig-
LED1 immediately glows. Transistor T4 counter stops counting. Simultaneously, its displayed in DIS.1-DIS.2 help one to
goes to 'cut-off' and its collector tran- transistor T3 conducts and activates the know the exact leftover time to switch
sits from 'low' to 'high' state. The high- buzzer (functioning in interrupted ‘on’ ‘off’ the appliance. When using this
going spike is coupled through capaci- mode). Thus, interrupted beep sound is circuit as ‘off’ timer, slide switch S4 to
tor C3 to reset pin 12 of IC5. Thus, IC5 heard from the buzzer, indicating that ‘off’ position and, for ‘on’ timer opera-
is reset and starts counting from begin- preset time duration has ended. Pin 7 tion, slide switch S4 to 'on' position.
ning. During this operation, pin 10 of of both IC3 and IC4 goes 'low' during When displayed digits become '00', the
both IC3 ad IC4 are held low to select display of digits '00' in DIS.1 and DIS.2 relay will be energised to turn 'on'/'off'
countdown mode of operation. Transis- During display of any digits other than the load.
tor T1 goes to 'cut-off' state. Thus carry '00', the carry 'out' pin 7 of either IC3 The actual-size, single-sided PCB for
'out' pin 7 of IC3 and carry 'in' pin 5 of or IC4 will be high or both may be 'high'. the circuit in Fig.1 is shown in Fig. 3,
IC4 are cascaded through resistor R16. When the timer is in countdown mode, while its component layout is given in
The one-pulse-per-minute is applied to do not press switch S2 or S3 to avoid Fig. 4. G
96
C I RC ICR CUUII T
T I D E A S
IDEAS
counter IC. Since only one of its out-
puts is high at any instant, only one
SELECTOR
Q4 (pin 10) to the reset pin. Capacitor
RUPANJANA
C5 in conjunction with resistor R6 forms
a power-on-reset circuit for IC2, so that
on initial switching ‘on’ of the power
supply, output Q0 (pin 3) is always
PRABHASH K.P.
‘high’. The clock signal to CD4017 is pro-
vided by IC1 (NE555) which acts as an
T
he add-on circuit presented here channel A is selected, the audio from astable multivibrator when transistor
is useful for stereo systems. This the tape recorder will be present at the T1 is in cut-off state.
circuit has provision for connect- output. After the tape is played com- IC5 (KA2281) is used here for not
ing stereo outputs from four different pletely, or if there is sufficient pause only indicating the audio levels of the
sources/channels as inputs and only one between consecutive recordings, the cir- selected stereo channel, but also for for-
of them is selected/ connected to the cuit automatically switches over to the ward biasing transistor T1. As soon as
output at any one time. output from the radio receiver. To a specific threshold audio level is de-
When power supply is turned ‘on’, manually skip over from one (selected) tected in a selected channel, pin 7 and/
channel A (A2 and A1) is selected. If no active channel, simply push the skip or pin 10 of IC5 goes ‘low’. This low
audio is present in channel A, the cir- switch (S1) momentarily once or more, level is coupled to the base of transistor
cuit waits for some time and then se- until the desired channel inputs gets T1, through diode-resistor combination
lects the next channel (channel B), This selected. The selected channel (A, B, C, of D2-R1/D3-R22. As a result, transis-
search operation continues until it de- or D) is indicated by the glowing of cor- tor T1 conducts and causes output of
tects audio signal in one of the chan- responding LED (LED11, LED12, IC1 to remain ‘low’ (disabled) as long as
nels. The inter-channel wait or delay LED13, or LED14 respectively). the selected channel output exceeds the
time can be adjusted with the help of IC CD4066 contains four analogue preset audio threshold level.
preset VR1. If still longer time is switches. These switches are connected Presets VR2 and VR3 have been in-
needed, one may replace capacitor C1 to four separate channels. For stereo cluded for adjustment of individual au-
with a capacitor of higher value. operation, two similar CD4066 ICs are dio threshold levels of left stereo chan-
Suppose channel A is connected to used as shown in the circuit. These ana- nels, as desired. Once the multivibrator
a tape recorder and channel B is con- logue switches are controlled by IC action of IC1 is disabled, output of IC2
nected to a radio receiver. If initially CD4017 outputs. CD4017 is a 10-bit ring does not change further. Hence, search-
97
C I R C U I T I D E A S
ing through the channels continues un- switch S1 is used to skip a channel even ily extended up to ten, by using addi-
til it receives an audio signal exceeding if audio is present in the selected chan- tional 4066 ICs.
the preset threshold value. The skip nel. The number of channels can be eas-
WATER TEMPERATURE
ture starts increasing above approxi-
mately 30o C, LEDs from LED1 through
LED8 of the bargraph start glowing one
CONTROLLER
after the other. When temperature is
RUPANJANA
around 30oC, only LED1 would be ‘on’.
For temperature greater than 97dig C,
all display LEDs will be ‘on’.
To detect the temperature of water,
VIJAY D. SATHE commonly used resistance-temperature
detector (RTD) PT100 is used. It is con-
T
he circuit presented here controls bargraph. When the temperature of wa- nected to one of the arms of a Wheat-
the temperature of water as well ter is 0o C, none of the bargraph dis- stone bridge as shown in the figure RTD
as indicates it on an LED play LEDs glows. But as the tempera- PT100 has a resistance of 100 ohms
98
C I R C U I T I D E A S
when surrounding temperature is 0dig the RTD in boiling water and slightly creasing. Gradually, the buzzer goes
C. (To cater to resistance tolerances and adjust preset VR2 such that the output ‘off’, as output of IC5(d) goes ‘low’. When
calibration, resistor R6 (22-ohm) and 1- of IC3 becomes 6V. Respeat the above temperature goes below 80oC, output
kilo-ohm preset VR1 were added at EFY two steps four to five times. of IC5(b) goes ‘low’ to turn ‘off’ transis-
lab. During testing.) Ideally, at 0oC, the To control the temperature of wa- tor T1 and relay RL1. As a result, the
bridge has to be in balanced condition ter, ‘on’/’off’ type controller is used. power supply provided to relay RL2 (via
and, for other temperatures, the bridge Lower threshold point is set at 97oC. RL1 N/O contacts) is cut off and relay
will be unbalanced. The unbalanced volt- An electric heater coil is used for heat- RL2 de-energises. This will again turn
age of the bridge is converted into suit- ing the water. When power supply is ‘on’ the mains electric power supply to
able value in the range 0V to 5V (corre- switched ‘on’, the heater starts heating the heater coil. Once again, the tem-
sponding to temperatures 0oC to 100oC, the water. When temperature reaches perature of water starts increasing and
respectively) by the instrumentation 80oC, output of IC5(b) goes ‘high’. This the cycle repeats to maintain water tem-
amplifier formed by op-amps IC1 turns ‘on’ relay driver transistor T1 to perature within the limits 80oC to 97oC.
through IC3 (uA741). Output of instru- energise relay RL1. In this state, relay This controller can be used to con-
mentation amplifier is given to voltage RL2. Relay RL2 in energised state cuts trol the temperature of water in water
compactors for driving the display off power supply to the heater coil. Re- heaters, boilers, etc. The lower and up-
LEDs. lay RL2, once energised, remains so due per threshold points can be changed by
Before using this circuit, the follow- to the latching arrangement provided connecting the base terminals of tran-
ing adjustments have to be made. First, by its second pair of contacts. Simulta- sistors T1 and T2 to different output
immerse the RTD in ice water (0oC) neously, the buzzer also sounds, due to terminals of voltage comparators (IC4
and adjust preset VR1 such that the forward biasing of transistor T3. and IC5). Base terminals of transistors
bridge becomes balanced and the out- Since the supply to the heater is cut- T1 and t2 are meant for lower and up-
put of IC3 becomes )V. Next, immerse off, the temperature of water starts de- per threshold points, respectively.
RAJESH KAMBOJ
T
he circuit of emergency light pre- D1 and D2 from a full-wave rectifier, tor C2 and resistor R3. Transformer X2
sented here is unique in the and capacitor C1 filters the rectified is ferrite core type. Its winding details
sense that it is automatic, com- voltage. The output of filter is about are shown in Fig. 2. While core details
pact, reliable, low-cost, and easy to as- 12V DC, which is connected to the col- are shown in Fig. 3. Resistor R3 pro-
semble for anyone. The circuit consists lector of transistor T1 provides a fixed vides DC bias to the base of transistor
of four sections, namely, battery charg- bias of 8.2V. Thus, transistor T1 works T2, while capacitor C2 couples the posi-
ing section, inverter section, changeover as a regulator and provides a constant tive AC feed-back from winding L1 to
section, and low battery voltage indica- voltage for charging the lead-acid bat- the base of transistor T2 to sustain the
tion section. tery. LED1 indicates the charging of bat- oscillations. The AC power developed
In the battery charging section, 230V tery. across primary winding L2 is trans-
AC mains is converted to 9V AC using The inverter section comprises ferred to secondary winding L3, which
step-down transformer X1. The diodes transformer X2, transistor T2, capaci- ultimately lights up the fluorescent
tubes.
T h e
changeover
section uses
diodes D3
and D4 as an
automatic
switch. In the
presence of
AC mains
supply, diode
D3 keeps
transistor T2
in its cut-off
state, while
diode D4 pro-
99
C I R C U I T I D E A S
WITH SECRECY
to the line.
MANUJ PAUL To receive a call at an end where
the instrument is not connected to
O
ften a need arises for connec- the line, you just have to flip the
tion of two telephone instru- toggle switch at your end to re-
ments in parallel to one line. ceive the call, and act as usual to
But it creates quite a few problems in have a conversation. As soon as the
their proper performance, such as over position of the toggle switch is
loading and overhearing of the conver- changed, the line gets transferred
sation by an undesired person. In order to the other telephone instrument.
to eliminate all such problems and get Mount one DPDT toggle switch,
a clear reception, a simple scheme is one telephone ringer, and one tele-
presented here (Fig. 1). phone terminal box on two wooden
This system will enable the incom- electrical switchboards, as shown in
ing ring to be heard at both the ends. Fig. 3. Interconnect the boards us-
The DPDT switch, installed with each ing a 4-pair telephone cable as per
of the par- Fig. 1. The
allel tele- system is
phones, ready to
connects use. Ensure
you to the that the two
line in one lower leads
position of of switch S2
the switch are con-
and discon- nected to
nects you in switch S1
the other after rever-
position of sal, as
the switch. shown in
At any one the figure.
time, only L a b .
one tele- Note: The external ringer for the project
phone is as shown in Fig. 2., was designed/fab-
connected ricated at EFY Lab.
100
C I R C U I T I D E A S
T
he circuit described her is dif-
ferent form conventional door
bell circuits in the sense that it
can produce two different tones-one of
a lower frequency and the other of a
much higher frequency.
The circuit uses a timer IC 555,
which has been wired in free-running
mode. When switch S1 is depressed, the
circuit oscillates at around 1.5 kHz, re-
sulting in a higher frequency note. When
switch S2 is depressed, transistor T1 is
turned 'on' and thus it shunts resistor
R2 across capacitor C2. As a result, the
circuit now oscillates at approximately
150 Hz and a tone of much lower fre-
quency is generated.
The circuit can be conveniently em-
ployed as a doorbell for two separate near the re-spective doors. range of potentiometer VR1. A trimpot
doors at the same floor level. Doorbell The circuit can be assembled on a can be used as VR1 for convenience of
switches S1 and S2 can be mounted general-purpose PCB and housed inside assembly.
A
major drawback of some pest transformer X1. Transformer X1 is wound SWG while secondary winding comprises
repellers is that their power out- over ferrite core (UU or CC core). Pri- 40 turns of 24 SWG wire. Adjust potenti-
put is low and hence their effec- mary winding consists of 150 turns of 28 ometer VR1 for maximum effectiveness.
tiveness suffers. The pest repeller cir-
cuit described here generates powerful
ultrasonic signals to repel pests. In ad-
dition to the ultrasonic frequency oscil-
lator, separate push-pull power ampli-
fier and transformer are used to boost
ultrasonic signals.
Ultrasonic frequency oscillator is 2
built around IC CD4047, which provides
complementary outputs. These comple-
mentary outputs are amplified by tran-
sistors T1 and T2 (BD139) to drive
transistorised push-pull power amplifier
stage comprising power transistors T3
and T4 (2N3055).
The output of the power amplifier is
coupled to a tweeter, through output
101
July
2000
CONSTRUCTION
SATELLITE TV RECEIVER
(c) The electromechanical arrange-
ment to move the dish in the horizontal
S.C. DWIVEDI
and vertical planes to track the satellite.
(This arrangement is generally used in a
S. DAS GUPTA dish of 3.7 metre and above sizes.)
(d) LNB mounting arrangement.
Base structure should be strong
S
atellite TV reception has gained covered by a satellite downlink antenna) enough to withstand the entire load of
much popularity in India over measured in terms of effective isotropic the dish. To withstand the wind load dur-
the last three decades, specially af-
ter the live telecasting of the Gulf
war by CNN. Both the S-band and C-band
satellite signals are available to India.
C-band signals are beamed from various
satellites like Asiasat, Aralisat, and
Insat 2B.
In India, the C-band reception is much
more popular compared to the S-band.
The popular satellite programmes which
can be received on C-band include Star
TV, Zee TV, PTV2, CNN, ATN, Sun TV,
and Doordarshan. Besides, programmes
from Russia, China, France, and Saudi
Arabia are also available on C-band chan-
nels, although their language is a bar-
rier.
103
CONSTRUCTION
104
CONSTRUCTION
Another important
parameter of the LNB is
its noise temperature.
The noise equivalent tem-
perature of most of the
good-quality LNBs ranges
from 26 oK to 40 o K (K
stands for kelvin). The
picture on a 26oK LNB
will show less noise com-
pared to that of a 40oK
LNB, especially when the
received signal is weak.
Theoretically, the noise
power is related to the
temperature as follows:
Noise power = KTB
watts
where K is the
Boltsman’s constant =
1.381 x 10-23 T is tempera-
ture in oK; and B is the
system bandwidth in Hz.
A coaxial cable con-
nected between the LNB
and receiver serves two
purposes: (i) it feeds +18V
DC to the LNB, to power
the amplifier and con-
verter circuits inside
LNB, and (ii) the con-
verted frequency (950
MHz to 1,450 MHz) is fed
from LNB to ‘C-band’ re-
ceiver.
C-band receiver.
The main function of the
receiver is to select a par-
ticular channel from the
converted block of fre-
quencies (between 950
and 1450 MHz) and re-
trieve the audio and video
signal information. The
Fig: 4: Circuit diagram of C-band satellite receiver
105
CONSTRUCTION
10 of IC1.
Audio IF fre-
quency can be
varied by varying
the voltage of
VCO (voltage-con-
trolled oscillator)
of the IC. The
VCO voltage is
controlled with
the help of
potmeter VR2,
which is con-
nected to pin 13 of
IC1 and acts as
an audio IF fre-
quency-controller.
Fig. 5: Power supply unit Varactor diode D1
(MV2109) is con-
band from channel 2 to channel 12) to PARTS LIST nected across pins 12 and 13 through ca-
operate the domestic receiver directly. Semiconductors: pacitors C9 and C11.
The block diagram of a satellite re- IC1 - NE564 phase locked loop Audio bandwidth can also be adjusted
IC2 - NE592 video amplifier
ceiver is shown in Fig. 3(a). IC3 - NE555 timer
The coaxial cable from LNB is con- IC4, IC7 - 7805, 5V regulator Capacitors:
nected to the tuner (which contains RF IC5 - 7818, 18V regulator C1, C7, C11, C18
IC6 - 7812, 12V regulator C21, C27 - 1kpF ceramic disc
and IF modules) through ‘F’ socket. To
T1 - T6 - 2SC2458 npn transistor C28, C29, C44
simplify the design for an average con- C2, C3, C4,26 - 56pF ceramic disc
D1 - MV2109 varicap diode
structor, the Mitsumi TSU2-EOIP tuner D2, D5, D6 - 1N4148 switching diode C5, C6, C9, C13
is used in the circuit. Pinout of the tuner D3, D4 - OA79 detector diode C15, C31 - 0.01µF ceramic
are shown in Fig. 3(b) while its specifica- D7 - D14 - 1N4007, 1-amp silicon diode C8 - 1µF, 25V electrolytic
LED - Red LED C10 - 27pF ceramic disk
tions are given in Table II. It is a C12 - 18pF ceramic disk
Resistors (all 1/4W, ± 5% carbon, unless
readymade tuner with tunable range from stated otherwise) C14, C16,C24 - 22µF, 25V electrolytic
950 MHz to 1450 MHz, giving baseband R1, R3, R11 - 220 ohm C17 - 68pF ceramic disk
output directly with audio sub-carrier. R2, R16, R20 C19, C20 - 150pF ceramic disk
The tuner module is tuned with a volt- R27 - 1 kilo-ohm C22 - 10pF ceramic disk
R4, R19 - 1.8 kilo-ohm C23 - 0.1µF ceramic disk
age (VT) between 0 and 20V and requires C25 - 220µ/25V electrolytic
R5 - 390 ohm
no high/low band switch. It has a termi- R6 - 1.2 kilo-ohm C30 - 0.22µF ceramic disk
nal for applying the supply voltage for R7, R8, R12 C32 - 100µF, 25V electrolytic
LNB, which is carried to the LNB via the R17, R35 - 2.2 kilo-ohm C33 - 68µF, 25V electrolytic
R9 - 120 ohm C34 - 2200µF, 50V electrolytic
down lead, coaxial cable type RG-8 or C35 - 3300µF, 50V electrolytic
R10 - 5.6 kilo-ohm
RG-11. The module itself is fed +12V and R13, R14, R15 C43 - 10 kpF ceramic disk
+5V DC for its operation. The complete R25,R26, R39 - 10 kilo-ohm C37-C40, C45
circuit diagram of the receiver is shown R18 - 180 ohm C46, C36 - 0.1µF, 400V, ceramic disk
in Fig. 4. R21, R33 - 100 ohm C41 - 33 µF, 40V electrolytic
R22, R24 - 150 ohm C42 - 100 µF, 25V electrolytic
The baseband output from the tuner
R23 - 330 ohm Miscellaneous:
module is fed to the audio stage, video R28 - 470 ohm - VU meter (250µA)
stage, and signal-strength indication cir- R29 - 82 ohm - Mitsumi tuner (TSU2-
cuit. R30 - 47 kilo-ohm EOIP)
Audio section. It consists of three R31 - 270 ohm - PCB
R32 - 1.5 kilo-ohm - Chassis, knobs, on/off
stages: sound intermediate frequency
R34 - 8.2 kilo-ohm switch
(SIF) stage, sound driver stage, and sound R36 - 120 kilo-ohm - Heat-sink for regulators
output stage. R37, R44 - 82 ohm L1, L2, L3 - 4.7µH inductor (fixed)
The audio signal from the baseband R38 - 100 kilo-ohm L4 - 2.2µH inductor (fixed)
output of tuner module is separated with R40, R41 - 560 ohm - 3-pin screw type connector
R42 - 15 ohm for motorised feed horn pulse
the help of an LC (inductance-capacitance) R43 - 68 ohm X1 - 230V AC primary to
tuned wave-trap circuit comprising capaci- VR1, VR2, 17V AC, 1-amp and
tors C1 through C4 and inductors L1 VR7, VR8 - 4.7 kilo-ohm linear 24V AC, 1-amp secondary
through L3. SIF signal is fed to pin 6 potentiometer transformer
VR3, VR4, S1 - DPDT rocker switch
(limiter section) of IC1 (NE564). The posi-
VR5, VR6 - 4.7 kilo-ohm presets S2 - On/off switch
tive DC voltage is fed to pins 1, 3, 9, and
106
CONSTRUCTION
107
CONSTRUCTION
97
CONSTRUCTION
TABLE III
Testing
IC1 (NE 564)
Pin no: 1 2 3 4 5 6 7 8 After completion of assembly and con-
Voltage (V): 7.5 1.5 1 6.5 6.5 3 1 0 struction, check the +12V and +18V DC
Pin no: 9 10 11 12 13 14 15 16 from power-supply regulator, before con-
Voltage (V): 1 4.5 1 2 2 4 1.5 0.5 necting it to the PCB. Now connect both
IC2 (NE592) the supplies to PCB and check that +18V
Pin 1 2 3 4 5 6 7 8 8 10
Volt 9V 0V 9V 8.5V 0V 0V 9V 9V 0V 12V
is available at the input ‘F’ socket of tuner
Pin 11 12 13 14 module. Then connect the dish/LNB lead
Volt 8.5V 8.5V 0V 9V to the tuner and connect the audio and
Transistors video output from receiver either to the
Base Emitter Collector modulator or to the audio- and video-in-
T1 3.2V 3.2V 7V put terminals of the TV set.
T2 7V 7V 12V
T3 8.2V 8.2V 12V
Switch ‘on’ the receiver and adjust
T4 7V 7V 12V channel-selection potentiometer VR1 to
T5 7V 7V 12V select the desired channel. Audio can be
T6 2V 0V 2V fine tuned using potmeters VR1 and VR2.
Audio amplitude can be adjusted with the
Fig. 8 with component side serving as help of potmeter VR3. Picture contrast is
a ground plane. From component to be adjusted using potmeter VR4.
side, copper foil has been etched In case the receiver does not work
from around all holes except properly, refer to the circuit diagram and
those connected to ground. Ac- check its connections. Check thoroughly
tual-size solder-side track layout all the connections and resolder if you
is shown in Fig. 6. Component find any dry joints. Finally, check the volt-
layout for the PCB is shown in ages at the pins of IC5 and transistors,
Fig. 7. The author’s prototype is as given in Table III, for any major
shown in Fig. 8. discrepencies. ❏
109
CONSTRUCTION
NUMBER LOCK
IC4 is at logic 0 and as a result IC1 is
disabled.
RUPANJANA In enabled state, the monostable IC1
generates an output pulse when switch
JUNOMON ABRAHAM S1 (marked zero) is momentarily pressed.
This output pulse from IC1 is used as a
clock pulse for counter IC2 and shift reg-
M
ost of the code lock/number lock Please note that its reset pin 4 is con- ister IC5. While IC2 counts on high-to-
circuits presented in EFY so far nected to output A = B (OA=B) pin 3 of low transition of the clock, IC5 shifts on
have been based on discrete comparator IC4 (CD4585). Thus, as long low-to-high going transition of the clock.
TTL and/or CMOS ICs.
This circuit is based on
a familiar EPROM
27C32, wherein the re-
quired code is stored. It
is a number lock, which
can be programmed to
any coded number. The
length of the number
can also vary.
To make a code-
lock for a particular
number (octal, decimal,
or hexadecimal), that
number is first con-
verted to its binary
equivalent. It is then
entered bit-by-bit into
consecutive memory lo-
cations of EPROM 2732
(IC3), starting with the
MSB and ending with
the LSB (D0). Assume
that the required num-
ber is 12 (hex). Its
equivalent binary num-
ber is 00010010. This
binary number is en-
tered into the EPROM
at memory locations Fig. 1: Complete circuit diagram of number lock
starting with 001(hex),
as shown in Table I. The first memory as 4-bit Hence, to synchronise the operation of IC2
TABLE I
location is always loaded with binary byte magni- and IC5, the clock pulse to IC2 is inverted
Memory Data by the transistorised inverter stage
XXXXXXX0 (here, X means “do not care”). tude of
address Hex Binary
The data is stored in consecutive loca- (Hex) Equivalent input A around transistor T1.
tions, starting with location 001H, as 000 X0 XXXXXXX0 to IC4 is At power on, IC2 is reset due to power-
stated earlier. 001 X0 XXXXXXX0 equal to on-reset circuit built using capacitor C3
002 X0 XXXXXXX0 4 - b i t and resistor R5. Hence, all its outputs
003 X0 XXXXXXX0 m a g n i - (including O0 through O5 connected to
Description 004 X1 XXXXXXX1
addresses A0 through A5 of EPROM IC3)
005 X0 XXXXXXX0 tude of
The circuit comprises six ICs, inclu- 006 X0 XXXXXXX0 the other are initially at logic 0. In other words,
ding the EPROM and the voltage regula- 007 X1 XXXXXXX1 input B initial address selection for EPROM is
tor. IC1 is a timer NE555, which is 008 X0 XXXXXXX0 (to IC4), 000H, since address lines A6 through A11
configured as a monostable flip-flop. Note: X means do not care its output of EPROM 27C32 are permanently
110
CONSTRUCTION
www.electronicsforu.com
a portal dedicated to electronics enthusiasts
111
CONSTRUCTION
ally via IC5 with the help of switches S1 parator goes ‘low’ and it inhibits IC1. switch S3.
(marked zero) and S2 (marked one). A Thus, further data would not get entered Please note that for locking, the cir-
‘zero’ is entered by momentarily depress- in the absence of clock pulse from IC1. If cuit need not play any role. The locking
ing switch S1 alone, and a ‘one’ is en- data at each location of EPROM keeps operation could be performed manually.
tered by depressing switch S1 momen- matching with the data input via switches Only for opening of the lock, this code
tarily, after holding switch S2 in the S1 and S2, the output of comparator lock may be used. However, you are at
pressed condition. (at pin 3) will continue to stay ‘high’ to liberty to use the lock the other way
The ‘D0’ bit of EPROM and ‘O0’ bit of keep IC1 enabled until all the bits of the around.
shift register (CD4035) are compared by code have thus been compared. At the An actual-size, single-sided PCB for
magnitude comparator (CD4585). If the end of the code, the tap A will be at logic the circuit of Fig. 1 is shown in Fig. 2,
two data bits are equal, the output of com- 1, to energise relay RL1. If you have while Fig. 3 shows its component layout.
parator remains ‘high’ and it does not in- by mistake entered wrong code via One may extend/modify the circuit by
terrupt/inhibit the operation of switches S1 and S2, you can try again by utilising other seven unused data bits of
monostable IC1 (NE555). However, if switching ‘off’ and then switching ‘on’ EPROM as well (presently only bit D0
there is a mismatch, the output of com- the circuit once again, using ‘on’/‘off’ has been used in this circuit). ❏
112
C I RC ICR CUUII TT I ID D
EAS
EAS
M
ost of the power-supply failure transistor T1. Since, in the absence of sistor T1 (BC558) may pass some collec-
indicator circuits need a sepa- mains supply, the base of transistor is tor-to-emitter leakage current, causing a
rate power-supply for them- pulled ‘low’ via resistor R8, it conducts continuous murmuring sound from the
selves. But the alarm circuit
presented here needs no ad-
ditional supply source. It em-
ploys an electrolytic capacitor
to store adequate charge, to
feed power to the alarm cir-
cuit which sounds an alarm
for a reasonable duration
when the mains supply fails.
During the presence of
mains power supply, the rec-
tified mains voltage is stepped
down to a required low level.
A zener is used to limit the
filtered voltage to 15-volt
level. Mains presence is indicated by an and sounds the buzzer (alarm) to give a buzzer. In that case, replace it with some
LED. The low-level DC is used for charg- warning of the power-failure. low-gain transistor.
ing capacitor C3 and reverse biasing With the value of C3 as shown, a good- 2. Piezo buzzer must be a continuous
switching transistor T1. Thus, transistor quality buzzer would sound for about a tone version, with built-in oscillator.
T1 remains cut-off as long as the mains minute. By increasing or decreasing the To save space, one may use five small-
supply is present. As soon as the mains value of capacitor C3, this time can be sized 1000µF capacitors (in parallel) in
power fails, the charge stored in the ca- altered to serve one’s need. place of bulky high-value capacitor C3.
pacitor acts as a power-supply source for Assembly is quite easy. The values of
COB AND CALCULATOR RUPANJANA (EFY Lab note: Please note that
COBs used in different clocks may give
different outputs—frequency as well as
ANANDAN M.A. polarity—which may necessitate reversal
of diodes, use of additional transistor in-
T
he heart of this circuit is a COB requirement (about 6 mA for a low-power verter stage, and modification of key op-
which is used in quartz clocks. SCR) for the SCR, to maintain it in ‘on’ eration sequence of calculator.)
SCR1 is used for ‘start’ and ‘stop’ state. By placing the LED in the vicinity The voltage developed across resistor
operations. LED1 used in the circuit of LCD, one can read the display even R4 provides forward bias for transistor T1.
serves two purposes. It provides the path during darkness. The positive going out- Transistor T1 conducts and switches ‘on’
to satisfy the minimum holding current put pulses from the two points of the COB the optocoupler, whose output (across col-
www.electronicsforu.com
a portal dedicated to electronics enthusiasts
113
CIRCUIT IDEAS
DIAL A VOLTAGE
source is moved from one pair of points
RUPANJANA to another.
As shown in the diagram, a total of
RATHINDRA NATH BISWAS 31 resistors are required to provide
settability to within 0.01V. There are a
I
n a conventional voltage-divider set- vides precision DC voltages from 0 to 10 total of three such dials. Each dial has
up, the fixed voltage is applied across volts, in steps of 0.01V, can be easily and ten resistors, except the last one (dial III),
the entire network and the output economically built using a circular volt- which contains eleven resistors. Dial 1
is taken from across a selectable tap. Al- age divider. In this simple divider arrange- has ten resistors, having a value of 1 kilo-
though this approach provides precision ment, the points across which the output ohm each. It is marked from 0 to 9 volts
voltage out-
put, it in-
volves com-
plex switch-
ing and un-
usually
large num-
ber of resis-
tors. Thus, it
is not eco-
nomical, as
precision re-
sistors are
quite expen-
sive.
A bridge
that pro-
114
CIRCUIT IDEAS
A
ll of you must have observed a around, closing them, and then doing it sequence of this counter is shown in
dancing peacock, spreading out all over again. The author has attempted Table I. The free running oscillator built
its beautiful feathers, turning to reproduce a similar effect using a set around IC1, a popular timer NE555, gen-
115
CIRCUIT IDEAS
TABLE I gins to count in a particular se- your thumb and forefinger to resemble a
Johnson Counter Count Sequence quence, as shown in Table I. When- dancing peacock.
D C B A Decimal LED’s LIT ever the output of a flip-flop goes The countdown sequence of the
MSB LSB Count Upon Count high, the associated transistor con- counter will be initiated upon the arrival
0 0 0 0 0 Nil nected at its output saturates. It of the next clock pulse, which causes the
0 0 0 1 1 L1 to L3 drives current through the array of count to read 1110. At this stage, the ar-
0 0 1 1 3 L1 to L7
0 1 1 1 7 L1 to L11 LEDs connected as collector load, ray of LEDs at the centre of the display
1 1 1 1 15 L1 to L15 thereby causing them to turn ‘on’. panel will be turned ‘off’. The counter then
1 1 1 0 14 L4 to L15 Upon arrival of first clock pulse, counts down to 1100 upon the arrival of
1 1 0 0 12 L8 to L15 the LSB will be set. The counter will the next clock when the array of LEDs
1 0 0 0 8 L12 to L15
0 0 0 0 0 Nil
now count 0001. This means that adjacent to the centre array (on both
the array of LEDs at the centre of sides) will also be turned ‘off’. In this man-
erates approximately 1Hz waveform. The the display panel will be lit. When the ner, the counter continues to count down
output of IC1 serves as the clock input next clock pulse arrives, logic 1 will also till the contents read 0000, when the
for the counter built around IC2 and IC3. be copied to its preceding flip-flop and the whole array of LEDs are turned ‘off’ and
The circuit can be reset by momen- counter will read 0011. As a result, the one full cycle is completed. The counter
tarily depressing switch S1. When the cir- array of LEDs adjacent to the centre ar- then starts the counting sequence all over
cuit is powered on, capacitor C1 will be ray (on both sides) will be lit. In this fash- again.
initially uncharged, with the result that ion, the count progresses upwards till it The circuit can be assembled on a gen-
all the flip-flops are cleared. Now, as the reaches 1111, when all the arrays of LEDs eral-purpose PCB. The LEDs can be
capacitor starts charging toward the posi- will be lit. Now the wings of the peacock stacked into an array as per the pattern
tive rail, the clear inputs of all the flip- are fully spread. At this stage, you may shown in the figure. The circuit requires
flops go to logic 1 (and stay there) and manually swing the display board both both +5V and +12V DC supplies. The cir-
the flip-flops are enabled. The counter be- ways, holding it at its centre bottom by cuit can be used as a festival display.
A
n overload condition in an inverter an overload shutdown facility, while those setting the system or running around in
may permanently damage the incorporating this feature come with a darkness to reset the system at night.
power transistor array or burn off price tag. • It permanently shuts down the in-
the transformer. Some of the domestic in- The circuit presented here is an over- verter and continues to give audio warn-
verters sold in the market do not feature load detector which shuts down the in- ing, in case there are more than three
Fig. 1
116
CIRCUIT IDEAS
V
ery often when enjoying music or (opto-coupler) conducts and capacitor C1 tains necessary voltage for continuously
watching TV at high audio level, gets charged and, in turn, transistor T1 forward biasing transistor T1 so that the
we may not be able to hear a tele- gets forward biased. As a result, transis- relays are not energised during the nega-
phone ring and thus miss an
important incoming phone call.
To overcome this situation, the
circuit presented here can be
used. The circuit would auto-
matically light a bulb on ar-
rival of a telephone ring and
simultaneously mute the mu-
sic system/TV audio for the du-
ration the telephone handset
is off-hook. Lighting of the
bulb would not only indicate
an incoming call but also help
in locating the telephone dur-
ing darkness.
On arrival of a ring, or
when the handset is off-hook,
the inbuilt transistor of IC1
117
CIRCUIT IDEAS
tive half cycles and off-period of ring sig- no more available and thus relays RL1 energisation of DPDT relay RL3 opens
nal. Once the handset is picked up, the through RL3 are deactivated. the leads going to the speakers and thus
relays will still remain energised because As shown in the figure, the energised mutes both audio speakers. Use ‘NC’ con-
of low-impedance DC path available (via relay RL1 switches on the light, while tacts of relay RL3 in series with speakers
cradle switch and handset) for the in-built energisation of relay RL2 causes the path of music system and ‘NC’ contacts of RL2
diode of IC1. After completion of call when of TV speaker lead to be opened. (For in series with TV speaker. Use ‘NO’ con-
handset is placed back on its cradle, the dual-speaker TV, replace relay RL2 with tact of relay RL1 in series with a bulb to
low-impedance path through handset is a DPDT relay of 6V, 200 ohm.) Similarly, get the visual indication.
118
August
2000
CONSTRUCTION
DISPLAY SCHEMES FOR INDIAN quence. Here, the direct eye-to-finger re-
LANGUAGESPART I
flex does not take place, because there is
a thinking process involved. For example,
for typing ‘hoom’, he has to know the
grammer to split that into a ‘ha’, a ‘oo’,
(HARDWARE AND SOFTWARE) and an ‘mm’. Thus the typist does not
pick up speed even after considerable
practice, and as a result fatigue sets in
K. PADMANABHAN, S. ANANTHI, K. CHANDRASEKHARAN, quickly for him.
AND P. SWAMINATHAN As mentioned earlier, the Indian lan-
guages have more characters than those
F
or displaying text of Hindi, En- ters involved in most of the Indian lan- in the English language. The well-known
glish, or any other Indian language guages, in contrast to a mere 52 (2 x 26) ASCII codes for English are just 128 in
on a TV-like screen, as may be characters in English language. In spite of number, including several control charac-
required for public announcements or for the fact that Hindi, or for that matter ters and punctuation marks. Each code
educative programs etc, presently there Tamil or Telugu etc, have to deal with a occupies one byte and hence the total code
are two possible ways: large number of basic consonants, which space is 7FH for the complete English set.
1. Use a personal computer (PC), with combine, singly or doubly, with a similarly With our Indian languages, we have var-
all its hardware, such as the hard disk, large set of vowels, the four-row keyboard ied sets of characters. Consonants are quite
monitor etc, and develop or buy a suit- deals with all of them adequately to en- many, and therefore it is not easy to ac-
able software to display such text on its sure fast typing. Our trained typists are commodate all characters within the same
screen using its keyboard. able to make up to 40 strokes per minute set space of 128. For this purpose, the
2. Develop a dedicated low-cost mi- (approximately 15 words per minute) in author proposed a scheme of forming such
croprocessor based system employing a the most intricate of Indian languages. ASCII-like codes for Hindi as well as other
CRT controller circuit, with suitable firm- Today, there is both a concern and Indian languages, which occupy a space of
ware for each of the languages. talk in several circles, e.g. computer, tele- 128 bytes only for each. Based on the stan-
This article provides the software for communications, and other hi-tech indus- dard typewriter format for English, Hindi,
use with a PC based system as well as tries, to develop a new type of keyboard Tamil etc, a method for typing text of
use of a dedicated microprocessor based layout for Indian languages, with the aim these and other languages, all simulta-
system, complete with circuitry and firm- of making the software development task neously, is described in this article.
ware programs. Incidentally, it introduces easy enough. In this context, phonetic key- This proposed scheme of coding would
an important aspect concerning coding of boards have been proposed and are also not cause any disturbance to the present
text characters for Indian languages and in vogue already, with a great deal of soft- typists of these languages. They do not
provides an efficient solution. The soft- ware available commercially. These key- have to undergo fresh training for using
ware developed for both the above boards do not make use of hook charac- the proposed keyboard.
schemes of display is based on the pro- ters, but then such a keyboard is not well The method of making the ASCII code
posed simplified coding solution. suited for training. set for any Indian language is based on
Generally, typewriting is a process the typist’s existing keyboard. For ex-
based on direct eye-to-limb reflex signal ample, in English, the letter ‘d’ has its
ASCII codes and Indian languages generation, with little thinking going on code as 64H. So, the code for the Hindi
The typewriter for the English language, deep down in the brain. If the typist looks letter ‘ka’ (d) is also 64 hex. For Tamil
along with its mechanism, has been al- at a letter ‘hu’, he presses the ‘ha’ key ASCII code 64 hex is used for ‘na’, and so
ready adopted for almost all of our In- first, and as he sees a hook ‘oo’ below it, on… for the other languages. A table of
dian languages with practically no change he strikes the corresponding hook key, such codes for the three languages Hindi,
in its layout. The positions of keys and and so on. Thus the process can be speeded English, and Tamil is shown in Table I.
their operation remain unchanged. It has up with practice and is not easily forgot- Character generator for Indian
the same four rows of keys, including shift ten. We know of language typists, who languages. While characters of any lan-
and space keys, with top row for numer- even after 30 years of work, continue to guage need a character generator, which
als, and so on. type as fast as they did when they were puts dots in a rectangular matrix to de-
The combination vowels in Indian lan- young. Some of them can even talk while pict the shape of the character on the
guages such as ‘oo’ are made as separate typing without missing anything. screen, the English language, in its sim-
‘hook’ characters, which upon stroke are Now, consider the phonetic keyboard plest form of display, manages to write
non-space-moving. Persons involved in typist. He has to split each letter men- all its characters within a 5 x 7 matrix.
development and adoption of the English tally into its vowel and consonant parts; Therefore, within an 8 x 8 matrix, there
keyboard have cleverly tackled the prob- find out the consonant key and the hook is enough gap to allow for inter-character
lem of typing the large number of charac- key, and then press them in proper se- and inter-row space. But, in Hindi and
120
CONSTRUCTION
Fig. 1(a): Schematic diagram of 8085 microprocessor based multilingual display system (memories and decoder portion)
121
CONSTRUCTION
Fig. 1(b): 6845 character and video generator portion of multilingual display system
The character generator is just a list the high address for Hindi starts at page rect addresses and dot codes are pro-
of dots for the characters in an order. It 10 and it goes up to page17 (with each posed to be issued in EFY-CD during
does not necessarily require any hard- page comprising 256 bytes). In page 10, Sept. 2000.
ware. Though such a list of dots, if stored locations 00 through 7F are used for stor- It means that the actual code is start-
in this order in an EPROM, can be a hard- ing the low addresses while 80 through ing from the address 14 B4 (1000 + 04B4).
ware component. In the PC based design, FF are used for storing high addresses So, this is indirect addressing mode.
this is just a file containing the dot pat- for each character. Accordingly for ‘d’, the The actual hex values of the dots for
terns, while in the design using a dedi- low address is stored at 10 64 and the each of the twelve lines (in 18 bytes) for
cated CRT controller with a microproces- high address at 10 E4 (1064 + 80 = 10E4). ‘d’ are stored at consecutive locations,
sor, this is actually a hardware compo- If we have a look at the hex contents of starting with address 14B4, as stated ear-
nent, i.e. an EPROM. these two locations, we shall find: lier.
Addressing mode for character gen- Address Data Comments This indirect addressing scheme is
erator file scheme. Let us take letter ‘d’ 10 64 B4 LS Byte of Address used because it enables us to use differ-
in Hindi, which has the ASCII-equivalent 10 E4 04 MS Byte of Address ent types of fonts later, by just pointing
code of 64 hex. We need a high address Note: The page/location-wise hex to a different address table. Also, the ad-
and a low address as usual. Supposing contents of file containing these indi- dress table corresponds to the ASCII code,
122
CONSTRUCTION
123
CONSTRUCTION
TABLE I: ASCII Key Codes for English, Hindi, and Tamil languages
124
CONSTRUCTION
Program in BASIC for Computer Based Display for English, Hindi, Tamil, etc Languages
dim C(3,2048),ad(3,257),d(12),q(8) if N= 123 then hook=1 :goto 23 x=S*12: y=Row*16+l
open “chtamil2” for random as #1 len=1 if N=43 then hook =1:goto 23 101 i=i+1
field #1, 1 as A$ if N= 59 then hook=1:goto 23 if i >= 12 then 201
cls hook=0 n=n\2
total%= LOf(1) end if goto 10
for lan%=1 to 3 if lang%=3 then gosub 400 201 s=s-1
for i%= 0 to 255 ‘total% ‘ if N= 8 then s=s-1 : goto 300: ‘hook=1: for j%=0 to 11
get #1 ‘get one byte goto 23 ‘pset(x,y),0
rem pick and store the address for all 256 ‘if n=28 then s=s+1:goto 300 if q(11-j%)=1 then pset(x,y),0
codes ‘if n=30 then row=row+1:goto 2 x=x+1
a= asc(a$) hook =0 next
‘ print a; 23 n1= ad(lang%,n) :n5=n1 ‘t$=input$(1)
ad(lan%,i%) = a n2=ad(lang%,n+128) return
rem low address in 00-7F and high add. in 80 n3=(n2-1)*256 +n1 500 rem language selection
-FF N1=(n3): lang%=1
n=n+1 j=0: for i1= 0 to 17 step 3 return
next i=i1 510 lang%=2:return
for i%= 3 to 1024*2 -254’total% -256 d(j) = 16*c(lang%,n1+i) + C(lang%,n1+i+1)\ 16 520 lang%=3:return
get #1 d(j+1) =256*(c(lang%,n1+i+1) mod 16) + REM HINDI HOOKs
‘? i%-3,asc(a$) c(lang%,n1+i+2) 400 if n=45 then hook=1:goto 630
c(lan%,i%-3)= asc(a$) j=j+2 if n=61 then hook=1:goto 23 ‘; The sanskrit
next next i1 :j=0 hook for word ends
next lan% for i = 0 to 11 if n=81 then hook=1: goto 23 ‘ ; The adjunct to
CLOSE #1 ‘?i; hex$(d(i)) “Pa” to make “PPa”
lang%=2 next :’ ?n,n5,n2 if n=113 then hook=1 :goto 610 ‘; The u hook
on key(1) gosub 500:key(1) on for l =0 to 11 as in Pushpa
on key(2) gosub 510:key(2) on n= d(l):i=0 :k%=15 if n=65 then hook=1 :goto 23 ‘; the “n” part of
on key(3) gosub 520:key(3) on gosub 10 ‘put pixels “Gend”
ON KEY(11) GOSUB 540: KEY(11) ON next l if n=83 then hook=1 : goto 23 ‘; the Ttha part
ON KEY(12) GOSUB 550: KEY(12) ON s=s+1 of kuttha
ON KEY(13) GOSUB 560: KEY(13) ON gosub cur if n=87 then hook=1: goto 23 ‘; The OOm
ON KEY(14) GOSUB 570: KEY(14) ON goto 2 symbol as in hoom
690 CLS: locate 10,15: ?”Type F1 key for ‘put cursor if n=90 then hook=1: goto 23 ‘;as in “rka”,
Tamil, F2 for English and F3 Hindi” cur: the top “rr”
? “Want small or large size font ? Press S or x=s*12:y=row*16+11 if n=119 then hook=1:goto 620 ‘; oo as in Koo
L” for jj%=1 to 10 if n=97 then hook=1: goto 23 ‘;dot top as in
ad$= input$(1) pset(x+jj%,y),15 :next “mm”
if ad$=”S” then screen 12 : goto 700 return if n=115 then hook=1:goto 23 ‘; The “Ey”
if ad$=”L” then screen 2: goto 700 end hook as in “Gend”
goto 690 rem given a number <256*8 put pixels if n=122 then hook=1: goto 23 ‘; “Pna” as in
700 cls: s=0:row=0 10 r = n mod 2 APna
i=0 ‘? r ; return
s=1:R=1:L=0 q(i)=r 540 gosub remcur:ROW=ROW-1 :RETURN
hook=0 x=S*12: y=Row*16+l 550 GOSUB REMCUR :S=S+1: RETURN
2 if lang%=2 then hook=0 100 i=i+1 560 GOSUB REMCUR: S=S-1:RETURN
if hook=1 then s=s-1 if i >= 12 then 200 570 GOSUB REMCUR: ROW=ROW+1:
if s<0 then row=row-1: s=40 n=n\2 RETURN
21 A$=inPUT$(1): ‘got a key goto 10 600 rem hindi 13th line hook points
N= ASC(A$) 200 for j%=0 to 11 610 x= s*12: y= row*16+12
‘locate 20,51 :print n if q(11-j%)=0 then pset(x,y),15 i =3
‘goto 2 x=x+1 pset(x+i,y),15: i=8:pset(x+i,y),15:goto 23
REM remove old cursor next 620 x=s*12: y=row*16+12
x=s*12:y=row*16+11 return i =12
for jj%=1 to 10 300 for l =0 to 12 pset(x+i,y),15
pset(x+jj%,y),0 :next x=s*12: y =row *16+l goto 23
if S>40 then s=0 :Row=Row+1 for j% = 1 to 12 630 x=s*12: y=row*16+12
if n=8 then s=s-1:gosub 300 ‘backspace ‘ n= 4096 : i=0 i=12:
if N=32 then s=s+1:gosub cur: goto 2 ‘space pset (x+j%,y),0 pset(x+i,y),15:goto 23
if N=10 then row = row + 1 :goto 2 ‘return ‘gosub 40 ‘put pixels REMCUR:
if N=13 then row=row +1:s=0: goto 2 ‘line feed next j% x=s*12:y=row*16+11
if lang%=1 then next l for jj%=1 to 10
REM This is for TAMIL HOOK characters goto 2 pset(x+jj%,y),0 :next
if N=80 then hook=1 :goto 23 40 r = n mod 2 RETURN
if N=112 then hook=1 :goto 23 ‘? r ;
if N=91 then hook=1 :goto 23 q(i)=r
dot patterns for the four languages is re- integrated single board within a cost of
quired to be present in the working di-
Dedicated display unit design Rs 2,000. The TV display of a 36cm (14-
rectory for the PC based program to work. A unit of this type is a low-cost solution inch) monitor costs less than Rs 1,000 to-
This file is also proposed to be issued for a public display. The circuits described day, and the same video signal can be
with Sept. 2000 EFY-CD. in this section can be assembled on an used for multiple positions.
125
CONSTRUCTION
This involves a simple 8085 micropro- PARTS LIST The RAM chip 6264 (8k memory) is
cessor and an additional CRT controller. Semiconductors: used in the circuit. However, only 1k
The dedicated CRT controller chip 6845 IC1 - 8085 8-bit microprocessor (1000-13FF) of its address space is
has been popular ever since it was first IC2, IC21 - 74LS373 octal transparent utilised. So, its ‘high’ address pins A11
latch
used by the IBM in its display controller IC3, IC4 - 2764 8k byte EPROM and A12 are permanently made ‘high’.
cards. The circuit of this board is shown IC5 - 6264 8k byte RAM A chip-select 1 (CS1) is obtained from
in Figs 1(a) and 1(b). It comprises: IC6 - 74LS245 octal transceiver pin 6 of the 74156 IC, which covers 1400-
IC7 - 74LS156 dual 2-line to 4-line
1. Video generation circuitry includ- decoder 17FF address range. This goes to select
ing dot and character clocks. IC8 - 74LS365 8-line to 1-line the video RAM 62256. Though a 62256 of
2. Pixel or video RAM. multiplexer 32k memory is used, only 16k is actually
IC9 - 74LS75 4-bit latch
3. Character dot pattern EPROM for IC10, IC13 - 74LS02 quad NOR gate utilised. Its pin 1 is made permanent
four languages IC11 - 74LS04 hex inverter ‘high’. This chip select uses the address
4. 8085 firmware on EPROM for four IC12, IC14 - 74LS00 quad NAND gate lines A0 to A5 having an address range
IC15 - 74LS132 quad NAND
languages Schmitt trigger
of just 64 bytes, just the low order memory
5. 6845 CRT controller IC. IC16 - 6845 CRT controller of the video RAM.
Fig. 1(a) shows the 8085 microproces- IC17, IC18 - 74LS157 quad 2-line to 1-line A chip-select 2 (CS2) signal is used to
sor and its signals. Crystal of 4 MHz be- data selector select a 74LS373 latch used with the video
IC19 - 74LS244 octal bus buffer/
tween its pins 1 and 2 provides the clock driver RAM circuit. This is used to supply the
for the processor to tick and work. Reset IC20 - 62256, 32k byte static RAM high order addresses (A6 through A13) to
pin 36 is connected to get itself reset upon IC22 - 74LS165 parallel-in shift the video memory.
register
power on. Manual resetting is also pos- IC23 - 74LS190 synchronous decade An additional chip-select 3 (CS3) sig-
sible using reset switch S1. The address- counter nal is used for accessing the 6845 CRT
cum-data signal lines AD0-AD7 are con- T1 - BC148B npn transistor controller to program its mode of opera-
D1 - 1N4148 switching diode
nected to a 74LS373 latch to separate the LED1-LED4 - Red LEDs tion, so as to get a raster of 312 lines and
address signals A0-A7, using the ALE Resistors (all ¼-watt, ±5% carbon, unless 50 Hz frame frequency.
pulse from pin 30 of 8085. The data-bus stated otherwise): In the earlier design by the authors,
R1-R5 - 1-kilo-ohm
connects to all devices such as EPROMs, R11-R16,
an ASCII keyboard had been used. This
RAM, and the 74245 bidirectional trans- R6, R17 - 4.7-kilo-ohm ASCII keyboard used a dedicated key-
ceiver. Some of the data lines are also R7-R10, board controller IC, and the keys were
R22-R23 - 220-ohm
connected to output port (at I/O address R18, R19 - 10-kilo-ohm
wired in the fashion of the typewriter
80) using a 7475 IC for providing four R20 - 220-kilo-ohm keys, making use of switches fixed on to
bits of outputs (D0’ to D3’). The input R21 - 680-ohm a plain PCB and wiring the contacts to
port (also at I/O address 80) employing a VR1 - 470-ohm preset the IC as per its data sheet. There are
Capacitors:
74365 caters to six bits of input. The PC C1, C3 - 1 µF, 16V electrolytic ICs for making such an ASCII keyboard.
keyboard data and clock signals are con- C2 - 22 pF ceramic disk The AY3-5376 is one such IC. The ASCII
nected to data bus via two of its input Miscellaneous: code for the key pressed is output as a 7-
XTAL1 - 4 MHz crystal
lines. PCKBD - Keyboard interface connector bit code by this IC.
The Address decoder is a 74156, which In this new design, the authors have
has open collector outputs. It enables one four languages. This too is a 2764, and the used an IBM PC (AT) keyboard. The au-
or two of the chip select decoded signals to chip select signal ranges only 2k, but the thors have given such a PC keyboard for
be combined by just joining them (in wired- total 8k range is for storing four language their Home Computer Project (Refer EFY
OR fashion). Using the address lines A12, dot patterns, each in one 2k range. Thus Electronics Projects, Vol. 11). This was a
A11, and A10, the decoder provides eight the selection of the range/language is done keyboard of the older type, the XT key-
chip select signals for the address ranges by signals from the 7475-output port bits board, but now the freely available (for
as shown in the figure. Each output cov- D0’ and D1’, which are wired to A11 and Rs 300) AT keyboard has been employed
ers a 1k memory range. Thus pins 9 and A12 address lines of the 2764 character for the current design.
10 (shorted) serve as the chip select signal generator EPROM, which can be selected The keyboard is labeled with English,
for EPROM1 covering a 2k memory ad- using the function keys as explained be- Hindi, and Tamil characters, as per the
dress space. (Although we use 2764, an 8k low. standard typewriter format. The format
EPROM actually since now-a-days only The input port 80H, using 74365, is for Hindi and Tamil characters are shown
8k EPROM ICs are easily available and for reading the language selection made. in Fig. 3.
easily programmable while 2k capacity The language is selected by pressing keys The 8085 generates the control sig-
EPROMs are almost obsolete and difficult F1 through F4 on the PC’s keyboard. This nals IO/M, WR, RD (active low signals).
to program—we need 25V programming causes bits D0 and D1 to be output on These are used in conjunction with
pulse etc.) The address range for EPROM- the 7475 output ports to indicate the se- 74LS02 and 74LS00 gates shown in
1 is 0000-07FF. Similarly, pins 11 and 12 lection by two of the LEDs wired at its Fig. 2(a) to obtain separate read and write
are joined together to provide address output. Two other bits, D4 and D5 of this control signals for memory or input-out-
range from 0800-0FFF. This is the chip input port, are connected to the data and put, i.e. MR, MW, IOR, IOW for use in
select signal for the second ERPOM, which clock pins of the IBM PC keyboard con- the circuit.
stores the character dot patterns for the nector. To be continued next month
126
CONSTRUCTION
8085 µP-KIT BASED pin ZIF socket and two hex buffer 7407
ICs. The +5V supply needed for the inter-
face circuit (and ground) is obtained from
SIMPLE IC TESTER
the kit’s power supply itself. The total
cost of the interface circuit would be less
RUPANJANA than Rs 300.
Both the 8255s have been configured
S. RAJKUMAR for mode ‘0’ operation (which is a basic
input/output mode) with registers A and
B as output and register C
A
ll electronic laboratories in engi- TABLE I (both upper and lower half)
neering colleges and other insti- Control Words as input. The required con-
tutions need a digital IC tester to S.No. Port A Port C Port B Port C Control Word trol word for the mentioned
verify the serviceability of frequently used (Upper) (Lower) (Hex) configuration is 89 hex. The
digital ICs, e.g., ICs 7400 (NAND), 7408 1 O O O O 80 characteristics of mode ‘0’
(AND), 7432 (OR), 7486 (EXOR), 7404 2 O O O I 81 operation of 8255 are:
(Hex Inverter), 7407 (Buffer) etc. The 3 O O I O 82 1. Two 8-bit ports
4 O O I I 83
truth tables of all such ICs are available 5 O I O O 88
referred to as registers A
in digital IC data books. Based on their 6 O I O I 89 and B respectively.
truth tables one can write suitable sub- 7 O I I O 8A 2. Two 4-bit ports
routines to test them using an 8085 mi- 8 O I I I 8B referred to as C register
croprocessor kit and a minimal of inter- 9 I O O O 90 (lower-comprising bits C0
10 I O O I 91
face circuitry. An 8085 microprocessor kit, 11 I O I O 92 through C3) and C register
having requisite peripheral devices, is nor- 12 I O I I 93 (upper–comprising bits C4
mally available in most electronic labs, 13 I I O O 98 through C7).
and as such one does not have to buy 14 I I O I 99 3. Ports configured as
15 I I I O 9A
costly IC testers for testing simple type 16 I I I I 9B
output have latched outputs
of ICs, as mentioned above. while input ports are not
Note: O = Output; I = Input
It is assumed that the kit has at least latched.
two 8255 PPI (programmable peripheral tion of the interface circuit required for 4. Any port can be made input or out-
interface) ICs whose input/output ports testing of the digital 14-pin ICs using 8085 put. There are 16 possible input/output
have been extended via suitable connec- microprocessor kit is shown in Fig. 1. The configurations. (Please refer Table I for a
tors, for external usage. The configura- interface circuit comprises simply a 14- summary of the configurations and the
control word required to be used during
initialisation of an 8255 for each configu-
ration.) Control word can also be formed
with the help of Fig. 2.
The hex buffer/driver IC 7407 has
open collector outputs. The outputs of ‘IC
under test,’ which is placed in the ZIF
socket, are combined with those of 7407
in a wired-OR (actually wired-AND) fash-
ion. To realise this function, a logic 1 is
always output on the 7407 gates connected
to output pins of ‘IC under test.’ All pos-
sible logic input combinations are given
to input pins of ‘IC under test’, while logic
1 is placed at all its output pins via 8255’s
registers A and B, through IC 7407 buff-
ers. For each input combination, the logic
state of the ZIF socket pins (as modified
by the ‘IC under test’) is read (after a
short delay) via ‘C’ registers of the two
8255s. The expected results for each com-
bination of inputs, for above-mentioned
ICs, are shown in Table II in hex digits.
Fig. 1: Circuit for interfacing IC under test to 8255 PPIs on 8085 microprocessor kit These are stored in memory, in consecu-
127
CONSTRUCTION
128
CONSTRUCTION
www.electronicsforu.com
9285 C3EB92 JMP GOOD ; OR JMP GOOD1
;NOR GATE CHECK
9290 0E00 TYPE3: MVI C,00H ; SET GATE INPUTS
9292 79 LP3: MOV A,C
9293 07 RLC
9294 F601 ORI 01H ; SET GATE OUTPUT 1
9296 47 MOV B,A
9297 CDB192 CALL PROCESS
929A 0C INR C ; NEXT INPUT COMBINATION
929B 79 MOV A,C
929C FE04 CPI 04H ; CHECK IF ALL INPUT COMBINATION ARE OVER
929E C29292 JNZ LP3
92A1 C3EB92 JMP GOOD ; OR JMP GOOD1
92B1 3E89 PROCESS: MVI A,89H ; (8255 CONTROL WORD FOR CONFIGURING REG.
; A & B AS O/P AND REG. C (LOWER 4 BITS &
92B3 D30B* OUT 0BH ; UPPER 4 BITS) AS I/P)
92B5 D313* OUT 13H
92B7 78 MOV A,B
92B8 D308* OUT 08H ;OUTPUT THE COMBINATION FROM PORT A(A8255)
92BA D309* OUT 09H ;OUTPUT THE COMBINATION FROM PORT B(A8255)
92BC D310* OUT 10H ;OUTPUT THE COMBINATION FROM PORT A(B8255)
92BE D311* OUT 11H ;OUTPUT THE COMBINATION FROM PORT B(B8255)
92C0 16FF MVI D,FFH ; DELAY
92C2 15 LP4: DCR D
92C3 C2C292 JNZ LP4
92C6 DB0A* IN 0AH ; READ DATA INTO PORT C OF A8255
92C8 E63F ANI 3FH ; DON’T CARE FOR BIT 7 & 8
92CA BE CMP M ; COMPARE RESULT WITH DATA IN MEMORY
92CB C2DA92 JNZ BAD ; OR JMP BAD1
92CE 23 INX H
92CF DB12* IN 12H ; READ DATA INTO PORT C OF B8255
92D1 E63F ANI 3FH ; DON’T CARE FOR BIT 7 & 8
92D3 BE CMP M ; COMPARE RESULT WITH DATA IN MEMORY
92D4 C2DA92 JNZ BAD ; OR JMP BAD1
92D7 23 INX H
92D8 C9 RET
;RESULT DISPLAY USING 8279(BAD)
92DA 3E04* BAD: MVI A,04H
92DC D301* OUT 01H
92DE 3E7F* MVI A,7FH ; 7 SEG CODE-B
92E0 D300* OUT 00H
92E2 3E77* MVI A,77H ; 7 SEG CODE-A
92E4 D300* OUT 00H
92E6 3E3F* MVI A,3FH ; 7 SEG CODE-D
92E8 D300* OUT 00H
92EA 76 HLT
;RESULT DISPLAY USING 8279(GOOD)
92EB 3E04* GOOD: MVI A,04H
92ED D301* OUT 01H
92EF 3E3D* MVI A,3DH ; 7 SEG CODE-G
92F1 D300* OUT 00H
92F3 3E5C* MVI A,5CH ; 7 SEG CODE-O
92F5 D300* OUT 00H
92F7 3E5C* MVI A,5CH ; 7 SEG CODE-O
92F9 D300* OUT 00H
92FB 3E3F* MVI A,3FH ; 7 SEG CODE-D
92FD D300* OUT 00H
92FE 76 HLT
@ ;RESULT DISPLAY USING UTILITY SUBROUTINE OF KIT AT EFY(BAD)
9370 31FF9F BAD1: LXI SP,9FFFH
9373 210094 LXI H,9400H
9376 3E00 MVI A,00H
9378 0600 MVI B,00H
937A CD160B CALL OUTPT ; (UTILITY SUBROUTINE IN THE KIT TO
; DISPLAY ACC CONTENT)
937D 76 HLT
@ ;RESULT DISPLAY USING UTILITY SUBROUTINE OF KIT AT EFY(GOOD)
129
CONSTRUCTION
130
C I RC ICR U
CUIT IDEAS
IT IDEAS
T
he circuit presented here can be pose may cost more than Rs 10,000 in the IC2 is coupled via transistor T3 to
used in PCOs for displaying the market. The comparative disadvantages optocoupler IC3. The output of this
actual bill. The overall cost of this of the presented circuit are as follows: optocoupler is used to bridge the ‘=’ but-
circuit is less than Rs 200 while a com- 1. The calculator used along with this ton on a calculator (such as Taksun
mercial equipment serving similar pur- circuit is required to be switched ‘on’ make), which has the effect of pressing
manually before making a call. the ‘=’ button of the calculator.
2. Certain manual entries have to Considering that pulse rate for a spe-
be made in the calculator; for example, cific town/time/day happens to be Rs 1.26
for a pulse rate of Rs 1.26, number 1.26 per pulse, then before maturity of the call
is to be entered after switching ‘on’ the one enters 1.26 followed by pressing of ‘+’
calculator followed by pressing of ‘+’ key twice. Now, if a total of ten billing
button twice. However, possibility ex- pulses have been received from exchange
ists for automating these two functions for the duration of the call, then on
by using additional circuitry. completion of the call, the calculator dis-
In telephony, on-hook condition is play would show 12.60. The telephone op-
represented by existance of 48V to 52V erator has to bill the customer Rs 14.60
across the line. Similarly, the off-hook (Rs 12.60 towards call charges plus Rs
condition is represented by the line volt- 2.00 towards service charges).
age dropping to a level of 8V to 10V For tuning of the PLL circuit around
(depending upon the length of the local IC2, lift the handset and inject 16kHz tone
lead line from telephone exchange to across the line input points. Tune IC2 to
the subscriber’s premises as well as upon centre frequency of 16 kHz with the help
the impedance of telephone instrument). of preset VR1. Proper tuning of the PLL
Handset is normally lifted either for will cause LED1 to glow even with a very
dialing or in response to a ring. low-amplitude 16kHz tone.
In the circuit shown in Fig. 1, when EFY Lab note. Arrangement used for
the handset is off-hook, the optocoupler simulating a 16kHz pulsed tone is shown
MCT2E (IC1) conducts and forward bi- in Fig. 2. Push-to-on switch is used for
ases transistor T1, which, in turn, for- generation of fixed-duration pulse for
ward biases transistor T2 and energises modulating and switching on a 16kHz os-
relay RL1. In energised condition of re- cillator.
lay, the upper set of relay contacts con- For more details regarding pulse rates,
nects the positive supply rail to PLL pulse codes, etc, readers are advised to go
(phase-locked loop) IC2 (LM567) pin 4, through the tariff rates and pulse code
while the lower set of relay contacts information given in the beginning pages
couples the positive telephone lead to of telephone directories, such as MTNL,
input pin 3 of LM567 via capacitor C1 Delhi directory, Vol. I. One may also dial
and resistor R3. 183 for getting more details.
The nega-
tive telephone
lead is perma-
nently capaci-
tively coupled
via capacitor
C2. As soon as
call matures,
16kHz tone
pulses would
be pumped
into the tele-
phone line by
131
CIRCUIT IDEAS
SUNISH P.
F
ig. 1 shows a muting circuit, which termines the ‘on’/‘off’ muting delay.
makes use of IC LB1403. Sig- Higher the value of this capacitor,
nal from any pre-
amplifier, such as HA1032,
LA3161, or LA3160, is con-
nected to the base of am-
plifier transistor T1. Vari-
able resistor VR1 is used
to control the gain of in-
put signal.
Comparator 2 output
at pin 2 of LB1403 is used
for generation of muting
signal at the emitter (point
A) of transistor T2, which
can be directly connected
to muting pin 4 of ampli-
fier employing IC LA4440.
As long as the audio input
to the circuit of Fig. 1 is
below a certain level (say,
150 mV peak to peak), the output at point greater will be the muting delay period. tive polarity voltage for muting. The addi-
A will be high (the value measured at Slight circuit modification will be tional circuit to be connected at point A in
EFY Lab was around 4.5V). Once the in- needed if this circuit is used with STK that case is shown in Fig. 2.
put crosses this threshold level, the out- series amplifiers, such as STK 4141, 4142,
put will be around 0V. Capacitor C4 de- 4152, and 4191, because they need nega-
2-LINE INTERCOM-CUM-TELEPHONE
LINE CHANGEOVER CIRCUIT
and then press switch S1. As a result,
buzzer PZ2 sounds. Simultaneously, the
S.C. DWIVEDI side tone is heard in the speaker of hand-
set of phone 1. The person at phone 2
J. SRINIVASAN could then lift the handset and start con-
versation. Similar procedure is to be fol-
T
he circuit presented here can be phone. This problem is obviated in the lowed for initiation of the conversation
used for connecting two telephones circuit presented here. from phone 2 using switch S2. In this
in parallel and also as a 2-line in- Under normal condition, two tele- mode of operation, a 3-pole, 2-way slide-
tercom. phones (telephone 1 and 2) can be used switch S3 is to be used as shown in the
Usually a single telephone is con- as intercom while telephone 3 is connected figure.
nected to a telephone line. If another tele- to the lines from exchange. In changeover In the changeover mode of operation,
phone is required at some distance, a par- mode, exchange line is disconnected from switch S3 is used to changeover the tele-
allel line is taken for connecting the other telephone 3 and gets connected to tele- phone line for use by telephone 2. The
telephone. In this simple parallel line op- phone 2. switch is normally in the intercom mode
eration, the main problem is loss of pri- For operation in intercom mode, one and telephone 3 is connected to the ex-
vacy besides interference from the other has to just lift the handset of phone 1 change line. Before changing over the ex-
132
CIRCUIT IDEAS
A
myriad of circuits have appeared cuit blending three features, namely, un- de-energised under two conditions: first,
in EFY for protection of refrig- der-/over-voltage protection, switch ‘on’ if the input is below 170V threshold volt-
erators and air-conditioners delay, and regulation. age (being controlled by trimpot VR1), and
against voltage fluctuations and brown- The circuit with commonly available second, due to the initial shunting effect
outs. Here is a useful and economic cir- components is a combination of familiar of capacitor C6 at the base junction of
133
CIRCUIT IDEAS
transistor T2. The transistor T2 will be bucking point. The output is isolated when tion of transistor T2, on resumption af-
enabled only when the charging capaci- the input reaches prohibitive voltage (say ter a power failure or an over-voltage
tor raises its base potential to overcome 270V), over-voltage sensing being con- condition, repeatability of on-delay is
the reverse bias voltage at its emitter. trolled by trimpot VR3 to saturate tran- taken care of.
Thus, capacitor C6 and resistor R6 deter- sistor T4, which, in turn, cuts off relay By selecting the current rating of re-
mine the duration of the on-delay, which RL1 via transistors T5 and T6. As a con- lay contacts (5A or 30A) and auto-trans-
is approximately three minutes for the sequence, no output is available from the former (500VA or 4000VA), the circuit can
given values. auto-transformer. be adapted suitably for a refrigerator or
As soon as relay RL1 energises due to The resistor R8 discharges the tim- air-conditioner to obtain a regulation of
the switching action of transistor T2, the ing capacitor C6 when RL1 energises. 200V to 240V for an input variation of
boosted voltage appears at the output. The This is done to ensure that when capaci- 170V to 270V.
adjustment of trimpot VR2 controls the tor C6 is connected back to the base junc-
T
his circuit is an add-on unit for this arrangement of diodes, the need for stage comprising transistor T2. The out-
radio receivers that lack band-po- another decimal-to-BCD converter IC and put of transistor T2, as amplified by tran-
sition display. The circuit pre- associated parts is obviated. Switches S1 sistor T1, is connected to pin 4 of IC1.
sented here can show up to nine bands. through S9 are actually parts of existing Thus turning ‘on’/‘off’ of display is con-
It also incorporates a
novel feature to make
the display dance
(blink) with the audio
level from the receiver.
The power-supply for
the circuit can also be
derived from the radio-
set.
The conversion of
selected channel to
BCD format is
achieved using diodes
D1 through D15 in con-
junction with resistors
R4 to R7. The voltages
developed across these
resistors (R4 through
R7) serve as logic in-
puts to BCD inputs of
BCD to 7-segment de-
coder IC1 (CD4511).
When all switches are
in ‘off’ state, the volt-
age across resistors R4
through R7 is logic
zero, but when any of the switches S1 band-switch of the radio. Usually, one or trolled by the pulsating voltage developed
through S9 is slided to ‘on’ position, the two changeover contacts would be found from audio output of radio.
output across these resistors changes to extra in the modular pushbutton-type The power-supply regulator stage is
output proper BCD code to represent the band-switches of the radios. needed only when radio power-supply is
selected channel. This BCD code is con- IC1’s display blanking pin 4 is con- greater than 6V DC.
verted to 7-segment display by IC1. By nected to a display-blinker-control circuit
134
September
2000
CONSTRUCTION
LANGUAGESPART II
CRT controller circuit using discrete
CMOS ICs, which was successfully tested.
Later, at the behest of EFY (proposing
use of dedicated chips to make it a
(HARDWARE AND SOFTWARE) standalone compact project), the authors
developed the present modified circuit us-
ing the 6845 CRT controller itself.
K. PADMANABHAN, S. ANANTHI, K. CHANDRASEKHARAN, Once programmed, the 6845 CRTC
AND P. SWAMINATHAN generates the vertical and horizontal sync
signals for the raster at pins 39 and 40,
T
he 6845 is a programmable CRT dress line A0. When A0 and CS3 are low respectively. The 6845 also provides MA0-
controller, which can be pro- (selected), the program code accesses the MA13 signals for addressing the video
grammed so as to generate a ras- first register. If A0 is high and CS3 is low, memory. The video memory is used here
ter with the desired number of horizontal the second of the two registers is accessed. to store the dot patterns for the data dis-
and vertical raster lines [refer Fig. 1(b)]. In addition, the 6845 has 16 internal reg- played on the TV screen. The video
For detailed explanation of its program- isters. The selection of the internal regis- memory address lines and raster address
ming method for an application using ters for writing is done via the first regis- lines have been used as under:
6845 CRTC, you can refer chapter 16 of ter while the second register is written MA0-MA5 (6 lines) .. To choose one of
the book ‘Learn to Use Microprocessors’ with the data to be transferred into the 64 character slots in every character row.
published by EFY. selected register. RA0-RA3 (4 lines) .. To select one
There are two registers in the 6845, Here, we need 16 lines for a character among the 16 lines on each such row.
which are selected with the help of ad- slot. The width of each character slot is MA6-MA9 (4 lines) .. To select one of
only 8, be- the 16 character rows on screen.
cause that is During each character row, the 16 row
what the lines are selected using RA0-RA3 signals,
shift register which are sequentially incremented from
can handle. 0 to 15. This mode of wiring the CRT
But our mul- controller to the video memory is not the
tilingual usual one. It is unlike the one referred to
characters in chapter 16 of ‘Learn to Use Micropro-
themselves cessors’ book mentioned earlier. There,
are written the MA0, MA1, … lines address the video
in a font of RAM, but the video RAM data goes to the
size 12 x 16. character generator. The character gen-
Therefore erator gets the RA0-RA3, to let it know
the charac- which line of the character the data is to
ters classifi- be output at any instant—because there
cation for the are many lines of dots for each character.
6845 does Here the character generator is not used,
not really but the video RAM directly stores the dot
mean the ac- points of the display text. They are writ-
tual charac- ten by the program into the video RAM.
ters shown, Here RA0-RA3 are the four line-count sig-
because we nals L1 to L4 for the 16 lines, which are
have to use the heights of each Indian language char-
one-and-a- acter (here it includes English as well).
half charac- The four row-count signals MA6-MA9
ter slots for are used here for generating 16 rows of
each of the text per screen. At the end of the 64th
multilingual character byte (representing 43rd charac-
character. ter) display, the display enable signal is
This was blanked. This is to cater to the horizontal
the problem flyback period. The sync signal for the
faced earlier video output is obtained by combining the
while at- H-sync and V-sync outputs from pins 39
Fig. 4: Video RAM storage flowchart tempting use and 40 of CRTC via two resistors (of 10k
136
CONSTRUCTION
137
CONSTRUCTION
Basic principles
The basic principles of Indian language
display software are summarised below
while a flowchart for storage of pixel data
Fig. 6: Actual-size, solder-side track layout in the video RAM is given in Fig. 4.
1. Multiple language fonts are stored
are extended by buffer IC 74LS244 to the data to reach the address lines A6-A13 of in an 8k or bigger memory space, if nec-
RAM high address lines if CS1 is low. If the video RAM chip. In this way, the video essary. EPROM occupies 2k locations for
CS1 goes high, the buffer is tri-stated at RAM is addressable by both the CRTC each font of a language. Thus, four lan-
its output, allowing the latch (74LS373) 6845 circuitry as well as the 8085, when guage fonts can be stored using 8k
138
CONSTRUCTION
139
CONSTRUCTION
space-moving characters in the standard This can be written into an EEROM fixed on the board.
typewriters of the Indian languages. Par- (using any 8085 kit or the one published
ticularly in Hindi, there are multiple in Nov. ’99 issue of EFY) and is fixed into
hooks, such as in ‘hoom’. In the type- the board, and then the LEDs on the left
Conclusion
writer, the hook characters do not advance bottom of the board wired at the 7475 The two designs, the first one based on a
(move space) after they are typed. The (IC9) outputs would indicate the No. 5 as simple PC and the second one based on
program checks the code, and if it is a they glow. dedicated hardware/software using com-
hook code, it does not write immediately If this is not observed, one has to puter keyboard, for display of Indian lan-
the dots corresponding to that hook into check for proper connections from the guage text on a monitor and TV screen
the video memory, but waits for the suc- data lines to the 7475, connections to the respectively are illustrative of the tech-
ceeding keyboard stroke(s) for a non-hook 74156 address decoder, and the gate sig- niques of video display and software pro-
character to follow before shifting the cur- nals to pins 4.13 of the 7475 as per gramming for Indian languages. The
sor. Thereupon, the program combines the Fig. 1. former is useful in an industrial or office
dot pattern of the hook characters with Further, the connections to the video environment, while the latter can be used
that of the following main character, and RAM 62256 through the buffer IC 74244 in public display systems.
then places the net dot pattern into the and 74157 (pair of ICs 17 and 18) should The main intention of this article
video memory. be checked for their correctness. When is not merely to show the design of either
3. Since memory contains only 8 bits the CPU 8085 is writing to the video RAM, the dedicated display unit or the program
per location, one-and-a-half memory lo- the 74157 (pair) connects A0-A5 address on PC for typing multilingual text, but to
cations are assigned for each character lines of the 8085 to those of the video demonstrate the coding scheme for Indian
shown on screen, thus providing 12 dots RAM. Then, pin 1 of the 74157 ICs should languages with just 128 8-bit codes in-
per horizontal row in TV format. (This be pulsing low. stead of the currently talked about 16-bit
is more like the computer format.) In Thus, the following program to write codes. Further, the coding scheme sug-
this way, even characters start at a to 1800H in a loop would check for pulse gested here does not disturb existing typ-
memory byte and extend up to the next at pin 1 of 74157 and a high pulse at pins ists of the 11 Indian languages, for which
byte (its higher order nibble). Odd num- 1 and 19 of 74244. When the IC 74244 is typewriters already exist.
bered characters start at the right nibble passing the 6845 signals, the IC 74373 is The memory saving is a vital factor
(lower order nibble) of a byte and extend in tri-state condition because its pin 1 is when one uses such codes for the Indian
to the next complete byte (refer Fig. 4). then high. languages like English. Presently, all such
With 64 bytes on each horizontal row, P: MVI A,55 Indian text is treated on a computer or on
up to 43 characters can be shown per STA 1800H the Internet as graphic patterns only and
row. The hardware caters to a 64 x 16 LDA 1800H consumes large memory space. If 1k of
character display comprising 512 x 256 OUT 80H memory is taken for one page of screen
pixels. HLT with coding like this, it would take 8k in
The control software in the 8085 board Or, in place of HLT, a loop may be an ordinary graphics mode. When archives
for the entire unit does the job of reading executed as under: of text are to be kept in databases, the
the keyboard, selecting the language, writ- JMP P ASCII-like coding is the best.
ing the key code into video RAM, and The above short programs will enable With program PIXEL.bas or with the
doing minor editing as well. the checks to be made. dedicated display unit using IBM PC-
A double-sided PTH PCB is required 2. Another program to initialise compatible keyboard, one can type in
for assembling the circuit. The actual-size the 6845 as per the routine given in the three languages using the ASCII-like
component-side and solder-side track lay- listing is to be entered in the EEROM codes.
outs for the PCB are shown in Figs 5 and and then tested for proper H sync and Note: The following softwares pertain-
6, respectively. Fig. 7 shows the compo- V sync signals from pins 39 and 40 of ing to this project, which could not be
nent layout. 6845. issued with September EFY-CD due to
3. The video clock signals and the unavoidable circumstances, will now be
video output should be checked for proper included in October EFY-CD:
Testing the board random display raster. 1. Pixel6.BAS
The board may be tested by a sequence of 4. Another program for checking 2. Pixel6.EXE
small programs written into the control ERASE memory should be entered into 3. Chtamil2
EEROM. Verifications are done as per the the EEROM and then tested for the era- (The above files pertain to computer
guidelines given below: sure of clear screen of the raster. based display scheme).
1. The first thing to test is whether 5. The keyboard program should be 4. Tam.LST
the data bus and address lines are func- tested as per the KBD routine. 5. Tam.EPR
tional and the output port 80H is also Only after successful testing of 6. Chtamil3
functional. Here is a simple program for the board as per above-mentioned guide- (The files at sl. no. 4 and 5 pertain to
the same: lines, the full program as per the listing control program and its hex dump for con-
MVI A,55H given in Appendix 1 should be pro- trol EPROM while file at sl. no. 6 con-
OUT 80H grammed into control EPROM at its high- tains hex code for character generator
HLT est 2k address range (1800-1FFF) and EPROM.
140
CONSTRUCTION
both 2764 ICs (IC3 and IC4) as 11 through 74LS165 (IC22) (i.e. pin 11/13 of IC23 to
Errata for Part I of the article 13 and 15 through 19. go to pin 2 while pin 14 of IC23 to go to
1. Refer Fig. 1(a). Please renumber data 2. Refer Fig. 1(b). Interchange con- pin 1 of IC22).
pins 9 through 11 and 13 through 17 of nections between pin numbers 1 and 2 of
141
CONSTRUCTION
142
CONSTRUCTION
0294 DA A5 02 JC RIG_NIB ;if flag set go to start writing from right 0336 2F CMA
nible 0337 B0 ORA B ;OR with ‘hook’ dots
;LEFT NIBBLE ROUTINE 0338 2F CMA
0297 3E FF LEFT_NIB: MVI A,FFH 0339 77 MOV M,A
0299 13 INX D 033A 23 INX H
029A 1A LDAX D 033B 13 INX D
029B E6 0F ANI 0FH 033C 7D MOV A,L
029D 06 F0 MVI B,F0H 033D FE 24 CPI 24H ;36 nibbles
029F B0 ORA B 033F C2 32 03 JNZ PB
02A0 12 STAX D 0342 CD 1A 01 CALL VDUST ;store it
02A1 1B DCX D 0345 37 STC
02A2 C3 6F 02 JMP NXTL 0346 3F CMC ;clear carry flag
;RIGHT NIBBLE 0347 C9 RET
02A5 1A RIG_NIB: LDAX D ;HINDI HOOK CHAR. FILL (MULTIPLE HOOKS)
02A6 E6 F0 ANI F0H 0348 CD E5 00 HI_HO_
02A8 06 0F MVI B,0FH CHFI: CALL NIBST
02AA B0 ORA B 034B 21 00 11 PQ1: LXI H,1100H
02AB 12 STAX D 034E 11 50 11 LXI D,1150H
02AC 13 INX D 0351 7E PP1: MOV A,M
02AD 3E FF MVI A,FFH 0352 12 STAX D
02AF 12 STAX D 0353 13 INX D
02B0 1B DCX D 0354 23 INX H
02B1 C3 6F 02 JMP NXTL 0355 7D MOV A,L
;COMPARE HOOK CHARACTER (TAMIL) 0356 FE 24 CPI 24H
02B4 FE 50 CHOOKT: CPI 50H ;HOOK CHARACTER( ) 0358 C2 51 03 JNZ PP1
02B6 CA D0 02 JZ NM ;JUMP- NON-MOVING CHARC. 035B CD 12 04 CALL KBD
02B9 FE 70 CPI 70H ;HOOK CHAR ( ) 035E F5 PUSH PSW
02BB CA D0 02 JZ NM 035F CD E5 00 CALL NIBST
02BE FE 5B CPI 5BH 0362 21 00 11 LXI H,1100H
02C0 CA D0 02 JZ NM 0365 11 50 11 LXI D,1150H
02C3 FE 7B CPI 7BH 0368 7E PP2: MOV A,M
02C5 CA D0 02 JZ NM 0369 2F CMA
02C8 FE 2B CPI 2BH 036A 47 MOV B,A
02CA CA D0 02 JZ NM 036B 1A LDAX D
02CD 37 STC 036C 2F CMA
02CE 3F CMC 036D B0 ORA B ;OR WITH HOOK DATA
02CF C9 RET 036E 2F CMA ;OF PREVIOUS KEY
02D0 37 NM: STC ;CARRY SET FOR HOOK 036F 77 MOV M,A
CHARACTER 0370 23 INX H
02D1 C9 RET 0371 13 INX D
;COMPARE HOOK CHARACTER FOR HINDI 0372 7D MOV A,L
02D2 FE 2D HIHOCK: CPI 2DH 0373 FE 24 CPI 24H
02D4 CA 11 03 JZ NH 0375 C2 68 03 JNZ PP2
02D7 FE 3D CPI 3DH 0378 F1 POP PSW
02D9 CA 11 03 JZ NH 0379 CD D2 02 CALL HIHOCK ;Hindi hook character check
02DC FE 51 CPI 51H 037C F5 PUSH PSW
02DE CA 11 03 JZ NH 037D CD 8A 03 CALL ROW13FIL ;For some characters 13th line has a
02E1 FE 71 CPI 71H few dots
02E3 CA 11 03 JZ NH 0380 F1 POP PSW
02E6 FE 41 CPI 41H 0381 DA 4B 03 JC PQ1
02E8 CA 11 03 JZ NH 0384 CD 1A 01 CALL VDUST
02EB FE 53 CPI 53H 0387 37 STC
02ED CA 11 03 JZ NH 0388 3F CMC
02F0 FE 57 CPI 57H 0389 C9 RET
02F2 CA 11 03 JZ NH ;13th LINE FILLING FOR SOME HINDI HOOKS
02F5 FE 77 CPI 77H 038A F5 ROW13FIL:PUSH PSW
02F7 CA 11 03 JZ NH 038B FE 71 CPI 71H ;HOOK CODE
02FA FE 5A CPI 5AH 038D CA 9C 03 JZ HOOKU
02FC CA 11 03 JZ NH 0390 FE 77 CPI 77H
02FF FE 61 CPI 61H 0392 CA AA 03 JZ HOOKV
0301 CA 11 03 JZ NH 0395 FE 2D CPI 2DH
0304 FE 73 CPI 73H 0397 CA B8 03 JZ HOOKW
0306 CA 11 03 JZ NH 039A F1 POP PSW
0309 FE 7A CPI 7AH 039B C9 RET
030B CA 11 03 JZ NH 039C 21 00 11 HOOKU: LXI H,1100H ;Fill hook data at 1100 -01
030E 37 STC ;NON-HOOK CHAR. 039F 3E E0 MVI A,E0H ;Hook dot for 13th line
030F 3F CMC ;CLEARS CARRY FLAG 03A1 77 MOV M,A
0310 C9 RET 03A2 23 INX H
0311 37 NH: STC ;SETS CARRY FLAG FOR 03A3 3E 7F MVI A,7FH
0312 C9 RET ; HOOK CHARACTER 03A5 77 MOV M,A
;HOOK CHARACTER FILL ROUTINE(OTHER THAN HINDI) 03A6 2B DCX H
0313 CD E5 00 HIHKFIL: CALL NIBST ;store nibbles of chra. code in 03A7 C3 C6 03 JMP K
;1100h - 1124h 03AA 21 00 11 HOOKV: LXI H,1100H
0316 21 50 11 QA: LXI H,1150H 03AD 3E FF MVI A,FFH ;FFEF, one dot
0319 11 50 11 LXI D,1150H ;Aux. store 03AF 77 MOV M,A ;for “Hoo”- hook
031C 7E PA: MOV A,M ;store all data in aux. store 03B0 23 INX H
031D 12 STAX D 03B1 3E EF MVI A,EFH
031E 23 INX H 03B3 77 MOV M,A
031F 13 INX D 03B4 2B DCX H
0320 7D MOV A,L 03B5 C3 C6 03 JMP K
0321 FE 24 CPI 24H 03B8 21 00 11 HOOKW: LXI H,1100H
0323 C2 1C 03 JNZ PA 03BB 3E FC MVI A,FCH ;FCFF, two dots
0326 CD 12 04 CALL KBD 03BD 77 MOV M,A
0329 CD E5 00 CALL NIBST ;get pixel data in 1100h - 1124h 03BE 23 INX H
032C 21 00 11 LXI H,1100H 03BF 3E FF MVI A,FFH
032F 11 50 11 LXI D,1150H 03C1 77 MOV M,A
0332 7E PB: MOV A,M 03C2 2B DCX H
0333 2F CMA ;compliment it as data 03C3 C3 C6 03 JMP K
0334 47 MOV B,A ;were entered like that 03C6 CD CA 03 K: CALL THIRL ;call thirteenth line fill
0335 1A LDAX D 03C9 F1 POP PSW
143
CONSTRUCTION
144
CONSTRUCTION
04F1 77 MOV M,A 0750 FF FF 2C FF .DB FFH, FFH, 2CH, FFH, 5BH,2BH,FFH,FFH, FFH,
04F2 04 INR B FFH,0DH,5DH, FFH,21H,FFH,FFH
04F3 13 INX D 0754 5B 2B FF FF
04F4 78 MOV A,B 0758 FF FF 0D 5D
04F5 FE 10 CPI 10H 075C FF 21 FF FF
04F7 C2 EB 04 JNZ IP 0760 FF FF FF FF .DB FFH, FFH, FFH, FFH, FFH,FFH,08H,FFH, FFH,
04FA C9 RET 31H,FFH,34H, 37H,09H,FFH,FFH
04FB 55 40 46 09 TABL .DB 55H,40H,46H,09,12H,08H,10H,11H,0,10H,0,0BH, 0764 FF FF 08 FF
EINIT: 0,0,0,0 0768 FF 31 FF 34
04FF 12 08 10 11 076C 37 09 FF FF
0503 00 10 00 0B 0770 30 FF 32 35 .DB 30H, FFH, 32H, 35H, 36H,38H,FFH,FFH, FFH,
0507 00 00 00 00 FFH,33H,2DH, 2BH,39H,FFH,FFH
;CLEAR SCREEN ROUTINE 0774 36 38 FF FF
050B C5 CLEAR: PUSH B 0778 FF FF 33 2D
050C E5 PUSH H 077C 2B 39 FF FF
050D 0E 00 MVI C,00 0780 TABLE2:
050F 0D A1: DCR C 0780 FF FF FF FF .DB FFH,FFH,FFH,FFH,FFH,FFH,FFH,FFH
0510 CA 28 05 JZ A2 0784 FF FF FF FF
0513 26 14 MVI H,14H 0788 FF FF FF FF .DB FFH,FFH,FFH,FFH,FFH,FFH,FFH,FFH
0515 2E 00 MVI L,00 078C FF FF FF FF
0517 79 MOV A,C 0790 FF FF FF FF .DB FFH, FFH, FFH, FFH, FFH, 51H, 21H, FFH,FFH,
0518 32 00 18 STA 1800H FFH,5AH,53H,41H,57H,40H,FFH
051B 3E FF A3: MVI A,FFH 0794 FF 51 21 FF
051D 77 MOV M,A 0798 FF FF 5A 53
051E 2C INR L 079C 41 57 40 FF
051F 7D MOV A,L 07A0 FF 43 58 44 .DB FFH, 43H, 58H, 44H, 45H, 24H, 33H, FFH, FFH,
0520 FE 80 CPI 80H 20H, 56H, 46H, 5AH, 52H, 25H, FFH
0522 C2 1B 05 JNZ A3 07A4 45 24 33 FF
0525 C3 0F 05 JMP A1 07A8 FF 20 56 46
0528 E1 A2: POP H 07AC 5A 52 25 FF
0529 C1 POP B 07B0 FF 4E 42 48 .DB FFH, 4EH, 42H, 48H, FFH, 59H, 36H, FFH, FFH,
052A C9 RET FFH, 4DH, 4AH, 55H, 26H, 2AH,FFH
0700 .ORG 700H 07B4 FF 59 36 FF
0700 TABLE1: 07B8 FF FF 4D 4A
0700 FF FF FF FF .DB FFH,FFH,FFH,FFH,FFH,FFH,FFH,FFH 07BC 55 26 2A FF
0704 FF FF FF FF 07C0 FF 2C 2B 49 .DB FFH, 2CH, 2BH, 49H, 4FH,29H,28H,FFH, FFH,2EH,
0708 FF FF FF FF .DB FFH,FFH,FFH,FFH,FFH,FFH,FFH,FFH 2FH,FFH, 2BH,50H,5FH,FFH
070C FF FF FF FF 07C4 4F 29 28 FF
0710 FF FF FF FF .DB FFH,FFH,FFH,FFH, FFH,71H,31H,FFH,FFH,FFH, 07C8 FF 2E 2F FF
7AH,73H,61H,77H,32H,FFH 07CC 2B 50 5F FF
0714 FF 71 31 FF 07D0 FF FF 22 FF .DB FFH, FFH, 22H, FFH, 7BH,2BH,FFH,FFH, FFH,
0718 FF FF 7A 73 FFH,0D,5DH, FFH,21H,FFH,FFH
071C 61 77 32 FF 07D4 7B 2B FF FF
0720 FF 63 78 64 .DB FFH, 63H, 78H, 64H, 65H, 34H, 33H, FFH, FFH, 07D8 FF FF 00 5D
20H, 76H, 66H,7AH,72H,35H,FFH 07DC FF 21 FF FF
0724 65 34 33 FF 07E0 FF FF FF FF .DB FFH, FFH, FFH, FFH, FFH,FFH,08H,FFH, FFH,
0728 FF 20 76 66 31H,FFH,34H, 37H,09H,FFH,FFH
072C 7A 72 35 FF 07E4 FF FF 08 FF
764 0730 FF 6E 62 68 .DB FFH, 6EH, 62H, 68H, FFH, 79H, 36H, FFH, FFH, 07E8 FF 31 FF 34
FFH, 6DH, 6AH, 75H, 37H, 38H,FFH 07EC 37 09 FF FF
0734 FF 79 36 FF 07F0 30 FF 32 35 .DB 30H, FFH, 32H, 35H, 36H,38H,FFH,FFH, FFH,FFH,
0738 FF FF 6D 6A 33H,2DH, 2BH,39H,FFH,FFH
073C 75 37 38 FF 07F4 36 38 FF FF
0740 FF 3C 6B 69 .DB FFH, 3CH, 6BH, 69H, 6FH,30H,39H,FFH, FFH,3EH, 07F8 FF FF 33 2D
3FH,FFH, 3BH,70H,2DH,FFH 07FC 2B 39 FF FF
0744 6F 30 39 FF 0800
0748 FF 3E 3F FF END ❏
074C 3B 70 2D FF
145
CONSTRUCTION
A
versatile digital code lock circuit ample, one can arrange to store an eight ing power failures. In this mode, the static
is presented here, which can have hex-digit secret code as first two digits in RAM chip retains data, while consuming
up to 32-digit long secret code. 1st page, next three digits in 8th page, very little power with as low a current as
The length of the secret code can be eas- next one digit in 3rd page, and the last 0.03 mA to 0.6 mA—depending upon the
ily varied by changing the position of two digits in 14th page. chip used. For example, HM611L-5 will
jumpers. The available options are to draw 0.03 mA at 2V Vdd (in power-down
PARTS LIST
make the code 2-, 4-, 8-, 16-, or 32-digit mode), as per databook. This gives a long
Semiconductors:
long. When the keyed-in code matches IC1 - 74C922 hexadecimal life to the battery.
with the stored secret code, a relay gets keyboard encoder Address counter. IC8 (74HC4040) is
energised. The contacts of the relay may IC2 - 74HC244 octal tri-state buffer a 12-stage binary counter, in which the
IC3 - 74HC688 8-bit comparator
be used appropriately to operate, lock, or five least significant address lines A0
IC4, IC7 - 74HC132 quad 2-input
unlock any device or appliance, as desired NAND gate with Schmitt through A4 (for addressing 32 locations)
by the user. trigger input are sequentially selected on receipt of
The circuit makes use of a RAM to IC5 - 6116 2k x 8-bit SRAM clock pulses. Selection for the required
IC6, IC8 - 74HC4040 12-stage binary
store and output the stored code to en- number of hex digits to be used as secret
counter
able in-situ coding and changing of the IC9 - 74LS32 quad 2-input OR gate code can be made by jumpering one of
code easily. To retain the contents of RAM IC10 - 74LS74 dual J-K Flip-Flop the output pins (7, 6, 5, 3, or 2) of IC8 to
in case of power failure and to save power, IC11 - 7805 regulator 5V pin 2 of IC9 (74LS32), using jumper JPN1
T1 - BS170 n-channel MOSFET
a 4.5V battery backup arrangement is pro- for obtaining 2-, 4-, 8-, 16-, or 32-digit
T2 - BC548B npn transistor
vided, so that the system may operate in D1, D2, D5 - 1N4148 switching diode long secret code, respectively.
power-down mode with the battery cater- D3, D4 - 5.1V, 0.25W zener diode Keyboard encoding. 16-key key-
ing to the retention of only the RAM’s D6 - 1N4001 rectifier diode board encoder IC1 74C922 from National
D7, D8 - 1N4007 rectifier diode
contents. Thus, the power supply to the Semiconductor is used in conjunction with
LED1 - Red LED
circuit can be switched off to minimise LED2 - Yellow LED a 16-digit keypad for encoding the pressed
the power consumption to about 0.6 mA. LED3 - Green LED key data. It comprises an internal oscilla-
Capacitors: tor for clock generation for its own use
C1, C3 - 1µF, 10V tantalum and an inbuilt key debounce circuitry. Ca-
The Circuit C2 - 100nF ceramic disk pacitors C2 and C3 connected to its pins
C4 - 470nF ceramic disk
Memory organisation. A 6116 static C5 - 10µF, 10V electrolytic
6 and 5 determine the key scanning fre-
RAM (2048 x 8-bit) IC5 is used in the C6 - 2200µF, 25V electrolytic quency and debounce period, respectively.
circuit with A9 and A10 address pins con- C7 - 100nF, ceramic disk This chip gives a 4-bit data output
nected to the ground. Thus, here we are Resistors (all ¼-watt, ±5% carbon, unless from pin 14 through 17, corresponding to
effectively using an address space of 512 stated otherwise): a pressed key. Whenever a key is pressed,
locations only. This address space of 512 R1 - 100-kilo-ohm DA (data available) output pin 12 goes to
R2, R3, R5,
locations is further divided into 16 pages R7, R10, R11- 10-kilo-ohm
logic 1, to indicate availability of fresh
of 32 locations each. Page selection is done R4 - 1.5-kilo-ohm data at its output pins (14 through 17).
using 4-way DIP switch S2 in the circuit. R6, R8, R9 - 470-ohm This pin 12 reverts to its logic low state
Thus, in each page, an address space of R12 - 27-ohm when the pressed key is released. The
R13 - 2.7-kilo-ohm
32 is available for storing the secret code. RN1 - 4x10-kilo-ohm resistor net-
data outputs of IC1 are tri-state. Its out-
Each digit of the code comprises a hex work (5-pin SIP) put enable (OE) pin 13 is grounded
digit, which can be stored as a nibble, Miscellaneous: through resistor R2 to keep this chip in
requiring only 4-bit data space. It is stored RL1 - 12V, 500-ohm relay, PCB enabled state. The DA output signal at
as data bits D4 through D7 in each loca- mountable its pin 12 is used for the following func-
tion. Data bits D0 through D3 are not S1 - SPDT switch tions via the gates of quad NAND Schmitt
S2 - 4-way DIP switch
used and the corresponding pins are S3 - Push-to-on switch
IC4 and IC7:
therefore pulled to ground via 10-kilo-ohm BZ1 - 12V DC buzzer with inbuilt (a) As a clock for 12-stage binary
resistor R3. Thus, maximum length of a oscillator counter IC8 (74HC4040) via Schmitt
code can be up to 32 hex digits. One can, X1 - 230V AC primary to 12V-0- NAND gates N1 and N8, which advances
12V, 500 mA secondary
however, keep one’s secret code spread transformer
the counter by one count for every clock.
over all the 16 pages randomly. For ex- (b) For sounding of buzzer BZ1 and
146
CONSTRUCTION
Operational
mode control
circuitry
The R1-C1 combi-
nation around mode
switch S1 functions
as a bounce elimi-
nator. Switch S1 is
a secret code verifi-
cation and registra-
tion mode selector
switch.
Register mode.
When switch S1
is kept in register
mode, logic ‘0’
output of gate N4
enables second
section of octal 3-
state buffer IC2
Fig. 1: Schematic diagram of versatile digital code lock (74HC244) via pin
lighting of LED1 via Schmitt NAND gates responding to the pressed key has been 19 (OE2). At the same time, OE and WE
N7, N5, and N6 to provide audio-visual generated for further processing. pins of RAM are taken to logic 1 and logic
indication to the effect that the data cor- Auto-reset circuit. IC9 (74LS32) is a 0 states, respectively, to enable writing
147
CONSTRUCTION
data corre-
www.electronicsforu.com
written into se-
quential loca-
tions of the se-
lected page/
pages
Operate/
Fig. 2: Power supply for the code lock verify mode.
In operate/
of data into the RAM, while 8-bit com- verify mode position of switch S1, the
parator IC3 is disabled. Thus, the key- state of OE2 (pin 19) of IC2, and OE*
board data (corresponding to a pressed and WE signals (at pin 20 and 21 of
key) at the output of IC1, buffered by IC2, RAM 6116) is reverse of that at register
is present at D4 through D7 pins of RAM mode. Thus, RAM is selected for reading
(IC5). This data gets stored at an address the data corresponding to the address se-
corresponding to the selected page, via 4- lected via counter IC8. At the same time,
way DIP switch S2, and its location is IC3 (74HC688), an 8-bit comparator (con-
determined by outputs Q1 through Q5 of figured here as a 5-bit comparator), is
12-bit counter IC8. enabled. It will compare the entered digit
If the first key-press operation occurs of secret code with the SRAM contents
soon after pressing reset switch S3, the at the location selected by counter IC8,
first data gets entered at address ‘0’ of assuming that before the start of verifi-
the selected page. On release of the key, cation operation, counter IC8 is reset with
the counter (IC8) increments by one (ad- the help of reset switch S3 so that first
dress also increments by one), as a result address selected is ‘0’.
of clock pulse applied to its pin 10. Hence, When data is entered via keypad for
the next key-pressed data will get writ- verification, i.e. to open or close the lock,
ten at the incremented address. Thus, address of SRAM (IC5) will be
148
CONSTRUCTION
Operation
1.Afterassemblingthecircuit,recheckalltheconnec-
tionsandapplypowerwithoutputtingtheICsintotheir
bases.Verifythesupplyandgroundpinvoltagesatall
theICbases.Thenplug-inallthechipsintotheirbases,
afterturning‘off’thepower.
2. Put switch S1 in ‘register mode’
position. Decide a secret code. Suppose it
is a 4-digit long code; select a page using
4-way DIP switch S2.
3. Use jumper JPN1 to extend pin 6
of IC8 to pin 2 of IC9 and jumper JPN2
to extend pin 6 of IC6 to pins 3/pin 11 of
Fig. 4: Component layout for the PCB IC10.
4. Turn ‘on’ power and press reset
incremented automatically whenever a entered digits correctly, IC6 will provide switch S3 momentarily. Now press the
pressed key is released (as during regis- a pulse at one of its output pins (i.e. 7, 6, keypad key corresponding to the first digit
ter operation). If the data entered via 5, 3, or 2), depending upon the selected of your secret code. LED1 will light up
keyboard is found equal on comparison secret code length. Pin 7 will give this and buzzer will sound briefly. Then enter
with stored data, the output (OA=B) pin pulse for 2-digit length, pin 6 for 4-digit the rest of the three digits of your secret
19 of magnitude comparator IC3 will go length, pin 5 for 8-digit length, pin 3 for code one-by-one in a similar way.
to logic low for the period the keypad 16-digit length, and pin 2 for 32-digit 5. Flip switch S1 to ‘operate/verify’
key is kept pressed. On release of the length of secret code. One of these out- position, since secret code registration is
key, pin 19 will come back to its previ- puts has to be jumpered to pins 3 and 11 over. You have to remember the switch
ous state (logic 1), thus creating a pulse. of IC10 using jumper JPN2. In fact, the S2 combination (i.e. page number) and
During logic 0 state at pin 19 of IC3, identical output pins of IC6 and IC8 have the secret code. To open or close the lock,
LED2 will glow to indicate correctness of to be connected to pins 3/11 (shorted) of make sure that switch S2 is in the same
the code entered. When this LED goes IC10 and pin 2 of IC9, respectively, position as used during secret code regis-
‘off’, you may enter the next digit of the through jumpers JPN2 and JPN1. tration. Now press reset switch S3 mo-
secret code. If LED2 does not flash, it IC10 (74LS74) is a dual J-K flip-flop mentarily and enter secret code digits
means that the digit you entered was chip, in which both the flip-flops are con- one-by-one. On entry of each secret code
not the right one. Now press reset switch figured to work in toggle mode. Both the digit correctly, you will get a confirma-
S3, and start entering the secret code flip-flops get same trigger input through tion signal through flashing of LED2. Af-
from the first digit onward again. This pins 3 and 11 respectively. One of the ter entering all digits, the lock will re-
kind of error and reset operation will, flip-flops drives LED3 connected to Q1 spond (relay will energise). If the code
however, not effect the lock status. (pin 5), while output Q2 at pin 9 con- entered was correct, then LED3 will light
Pin 19 of IC3 is connected to clock nected to the base of transistor T2, up. If secret code has not been entered
input pin 10 of IC6 (74HC4040). In verifi- through resistor R11, drives relay RL1, correctly, re-enter the same after press-
cation mode, whenever a correct digit of whose contacts may be used for switch- ing reset switch S3. Switch S1, along with
secret code is entered, LED2 will flash ing ‘on’/‘off’ supply to a lock or appliance. the whole circuit, must be kept hidden
and IC3 will generate a pulse at its pin One could even use it for locking/unlock- while in use, except for the keyboard and
19. This pulse will advance the counter ing of mains supply to any appliance. switches S2 and S3.
IC6, until the auto-reset function (depen- When the lock is in ‘open’ state (i.e. RL1
dent on position of jumper JPN1) is in- energised), LED3 will be ‘on’. LED3, when
voked by current count value of IC8. If ‘off’, will mean ‘closed’ state of the lock.
all the digits of secret code match the The whole circuit (excluding keypad)
149
C I RC ICR CUUII TT I ID D
EAS
EAS
DECODER/DRIVER
Displayed Hex Displayed Hex
character input character input
RUPANJANA 0 00 L 15
1 01 M 16
2 02 N 17
JUNOMON ABRAHAM 3 03 O 18
4 04 P 19
5 05 Q 1A
D
otmatrix display is suitable for ter is that, for each character, a corre- 6 06 R 1B
displaying alphanumeric charac- sponding bit pattern is stored in an 7 07 S 1C
ters and symbols. Dedicated EPROM. When we supply a particular bi- 8 08 T 1D
9 09 U 1E
dotmatrix display driver ICs are available, nary number, corresponding to the input
A 0A V 1F
but these are costly and not easily avail- hex digits shown in Table I, bitmap of the B 0B W 20
able commercially. It would therefore be character shown against that number gets C 0C X 21
wise to make your own dotmatrix display, transferred to the dotmatrix display. For D 0D Y 22
using easily available common ICs. One example, for letter ‘Z’, you are required to E 0E Z 23
F 0F + 24
speciality of the circuit design presented enter hex 23 (referred as page address), G 10 – 25
here is that you can yourself decide the i.e. 010 on address lines A9 through A7, H 11 ÷ 26
size and shape of the characters. Further, and 0011 on address lines A6 through A3. I 12 x 27
you can design it for any language. Addresses A2 through A0 (location ad- J 13 = 28
K 14
The principle of displaying a charac- dresses) are supplied by oscillator-cum-
150
CIRCUIT IDEAS
counter IC nected to a decoder (4028) to drive the lected letter are consecutively scanned.
CD4060, re- columns of the display. The rows are con- This process repeats itself at a fast rate.
petitively nected to the data outputs D0 through Due to persistence of vision, one sees a
outputting D7 of the EPROM. Thus, when a memory steady display of the corresponding
the required location is addressed, its data is output memory map.
bit pattern, on the corresponding column. The eight Table III shows the data needed to be
correspond- memory locations corresponding to the se- stored in specific EPROM locations. It ca-
ing to bit pat-
tern for ‘Z’ in TABLE III
Address Data Address Data Address Data Address Data Address Data Address Data
this case.
Fig. 2: LED pattern for letter ‘A’ [0] [7] [E] [L] [S] [Z]
Let us 000 3C 038 C1 070 FF 0A8 FF 0E0 62 118 81
001 42 039 82 071 91 0A9 01 0E1 91 119 83
TABLE II 002 81 03A 84 072 91 0AA 01 0E2 91 11A 85
Address
055
056
057
48
XX
Hexdata
1F
1F
28
151
CIRCUIT IDEAS
ters only to numerics, capital English let- display. You can also use this line for con- pages, their address being equal to the
ters, and some symbols. You are at lib- verting it into a blinking display by con- ASCII value of that character. Moreover,
erty to store bit patterns for any other necting it to a suitable output pin of it is possible to display characters of any
data, in any other style, in the EPROM. counter CD4060. language and, if needed, the size of the
The input ‘BI’ indicating blanking in- You can also adapt the circuit for re- display can also be modified by using some
put (actually this is the OE signal of sponding to ASCII input values by stor- additional hardware.
EPROM) can be used for blanking the ing the character bit pattern in memory
D
uring summer nights, the tem- after some time, and to slow later on. It can be seen that initially the fan
perature is initially quite high. After a period of about eight hours, the shall get AC supply directly, and so it
As time passes, the temperature fan/cooler is switched off. shall run at top speed. When output Q2
starts dropping. Also, after a person falls Fig. 1 shows the circuit diagram of becomes high and Q1 becomes low, relay
asleep, the metabolic rate of one’s body the system. IC1 (555) is used as an astable RL1 is turned ‘off’ and relay RL2 is
decreases. Thus, initially the fan/cooler multivibrator to generate clock pulses. switched ‘on’. The fan gets AC through a
needs to be run at full speed. As time The pulses are fed to decade dividers/ resistance and its speed drops to medium.
passes, one has to get up again and again counters formed by IC2 and IC3. These This continues until output Q4 is high.
When Q4 goes
low and Q5 goes
high, relay RL2 is
switched ‘off’ and
relay RL3 is acti-
vated. The fan
now runs at low
speed.
Throughout
the process, pin
11 of the IC is
low, so T4 is cut
off, thus keeping
T5 in saturation
and RL4 ‘on’. At
the end of the
cycle, when pin 11
(Q9) becomes
high, T4 gets
saturated and T5
to adjust the speed of the fan or the cooler. ICs act as divide-by-10 and divide-by-9 is cut off. RL4 is switched ‘off’, thus
The device presented here makes the counters, respectively. The values of ca- switching ‘off’ the fan/cooler.
fan run at full speed for a predetermined pacitor C1 and resistors R1 and R2 are so Using the circuit described above, the
time. The speed is decreased to medium adjusted that the final output of IC3 goes fan shall run at high speed for a com-
high after about eight hours. paratively lesser time when either of Q0
or Q1 output is high. At medium
speed, it will run for a moderate
time period when any of three out-
puts Q2 through Q4 is high, while
at low speed, it will run for a much
longer time period when any of the
four outputs Q5 through Q8 is high.
If one wishes, one can make the
152
CIRCUIT IDEAS
fan run at the three speeds for an there are separate windings for separate
equal amount of time by connecting speeds. Such coolers do not use a rheo-
three decimal decoded outputs of IC3 stat type speed regulator. The method of
to each of the transistors T1 to T3. connection of this device to such coolers
One can also get more than three is given in Fig. 4.
speeds by using an additional relay, The resistors in Figs 2 and 3 are the
transistor, and associated compo- tapped resistors, similar to those used in
nents, and connecting one or more manually controlled fan-speed regulators.
outputs of IC3 to it. Alternatively, wire-wound resistors of suit-
In the motors used in certain coolers able wattage and resistance can be used.
G
enerally, when an equipment in- arm it is only 2V. So
dicates no power, the cause may current flows through
be just a blown fuse. Here is a the second arm, i.e.
circuit that shows the condition of fuse through the green
through LEDs. This compact circuit is LED, causing it to
very useful and reliable. It uses very few glow; whereas the red
components, which makes it inexpensive LED remains off.
too. When the fuse
Under normal conditions (when fuse blows off, the supply
is alright), voltage drop in first arm is 2V to green LED gets
+ (2 x 0.7V) = 3.4V, whereas in second blocked, and because
only one
LED is
in the
circuit,
the red LED glows. In case of red and green colour can be used. Simi-
of power failure, both LEDs larly, only one diode in place of D1 and
remain ‘off’. D2 may be used. Two diodes are used to
This circuit can be easily increase the voltage drop, since the two
modified to produce a siren LEDs may produce different voltage
in fuse-blown condition (see drops.
Fig. 2). An optocoupler is
H
ere is an inexpensive auto cut- as a standalone circuit between set limits for a
off circuit, which is fabricated the mains supply and the load, or period equal to
using transistors and other dis- it may be inserted between an ex- the ‘on’ time
crete components. It can be used to pro- isting automatic/manual stabiliser delay period.
tect loads such as refrigerator, TV, and and the load. The on-time
VCR from undesirable over and under line The on-time delay circuit not delay period is
voltages, as well as surges caused due to only protects the load from switch- presetable for 5
sudden failure/resumption of mains power ing surges but also from quick Fig. 1: Power seconds to 2
supply
supply. This circuit can be used directly changeover (off and on) effect of minutes dura-
153
CIRCUIT IDEAS
www.electronicsforu.com
a portal dedicated to electronics enthusiasts
154
CIRCUIT IDEAS
T
he logic signals to step, run, and tarily. The run command occurs if the but- erations). The Q output of A1 is also fed to
halt a computer or other appro- ton is held down for a time exceeding about ‘D’ input of module A3 (the run-and idle
priate digital devices or system 300 ms. latch). At the same time, the active low Q
may be generated by this circuit, which This time (300 ms) represents an ex- output of A1 triggers the step one-shot
is operated by just a single pushbutton. cellent compromise between circuit speed A4, yielding the step function.
The only active devices used are a dual and accuracy. If this duration is made The sequence of events discussed above
also describes
the initial por-
tion of the run
command,
whereby the
step pulse can
be used to
manually ad-
vance a
computer’s
program
counter by 1.
The run pulse
can be used to
instruct the
computer to
rapidly ex-
ecute succeed-
ing steps auto-
matically. The
Q* output of
A2 moves high
much shorter, the 300 ms after the pushbutton is depressed.
circuit may fail to The positive going (trailing) edge of this
differentiate be- pulse then clocks the state of the
tween the step and pushbutton (as detected by A1) into A3.
run commands, and If the circuit/computer is in run mode,
may generate the then pressing of the button will cause the
run command when circuit to halt the computer by clocking
the step command is in a logic ‘0’ (synchronously available at
desired, or vice data input pin) to the run-and-idle latch
versa. Also, repeat- A3. Note that the step pulse generated at
edly pressing the the start of the halt sequence, as shown
button rapidly to ini- in the timing diagram, is of no conse-
one-shot and a dual flip-flop ICs. tiate step functions will generate the run quence, since when the step is received,
The step command is generated each command if the duration is set for much the machine is already in the run mode
time the pushbutton is depressed momen- more than 300 ms. Finally, the device will and will override that command.
www.electronicsforu.com
a portal dedicated to electronics enthusiasts
155
October
2000
CONSTRUCTION
MOSFET-BASED 50Hz
may need to be suitably adjusted.
The output of the astable
S.C. DWIVEDI
multivibrator is given to pin 5 of the
SINEWAVE UPS-CUM-EPS
bistable multivibrator wired around IC
PARTS LIST
Semiconductors:
IC1 - NE555 timer
IC2 - 7473 dual JK-flip-flop
R.V. DHEKALE AND S.D. PHADKE IC3 - 7812 regulator, 12V
IC4 - DB107 bridge rectifier, 1A
IC5 - TL062 dual op-amp
M
ost of the UPS (uninterrupted interruption in operation of a computer IC6, IC7 - µA741 op-amp
power supplies) available in or continuity of the play mode of a VCR D1,D2, D5,
the market internally use a fre- and TV is caused. The complete schematic D6, D7 - 1N4148 switching diode
D3, D3',
quency ranging from 100 Hz to 50 kHz. diagram of the circuit is shown in Fig. 2. D4, D4’ - 1N5408 rectifier diode, 3A
The regulation of output voltage is done When mains is present and is within D8 - Rectifier diode, 16A–(TO3)
using the pulse width modulation tech- the specified limits, the same is fed to the ZD1-ZD7 - 5.1V, 1W zener diode
T1-T3 - BEL187 npn transistor
nique, which produces a quasi-square load. At the same time, battery is charged. TR - BT136 triac
waveform output from the inverter trans- If mains voltage goes below 170 volts (or SCR1 - BT169 SCR
former. Such an output waveform produces mains power fails) or above 270 volts, sys- M1-M6 - IRF250 MOSFET
lots of noise, which is not desirable for a tem changes over from mains to back-up LED1-LED6 - 3mm LED
Resistors (all ¼-watt, ±5% carbon, unless
computer and other sensitive equipment. mode. In the back-up mode, battery volt- stated otherwise):
This voltage waveform can drive a com- age of 12V DC is converted into 230V AC RA - 220-ohm
puter, but not the tubelight, fan, EPBAX, and applied to the load within 1 milli- RC - 4.7-ohm, W/W 20W
R1, R3-R6, R8
TV, VCR, etc properly. The advantage of- second. R12-R15, R18
fered by a UPS is that its changeover pe- However, if battery voltage drops be- R20, R21 - 1-kilo-ohm
riod is quite low, so that the computer or low 10V DC, or output voltage goes below R2 - 100-ohm, 1W
- 4.7-kilo-ohm
any other sensitive load is not interrupted 225V AC, there will be a visual and au- R7 - 4.7-ohm
during the mains failure. dible indication of low-battery state. Dur- R9 - 220-ohm
EPS (emergency power supply) of vari- ing this warning period, one can save the R10, R11 - 68-kilo-ohm
ous brands, providing 50Hz squarewave data and switch off the computer safely. R16 - 100-ohm
R17 - 470-ohm
output, can drive the computer, tubelight, But during the low-battery indication, if R19, R23 - 1.2-kilo-ohm
TV, VCR, fan, etc, but considerable noise the computer or load is not switched off, R22 - 39-kilo-ohm
is produced from the EPS or the load. it remains on back-up mode. After the PR1 (RB)
PR2, PR3, - 22-kilo-ohm preset
Another drawback of an EPS is that its end of back-up time, system switches off PR6 - 10-kilo-ohm preset
changeover period is relatively high, so automatically, due to activation of PR4, PR5 - 1-Meg-ohm preset
the computer may get reset or continuity battery’s deep discharge cut-out circuit, Capacitors:
of the play mode of the VCR may get which reduces the power consumption C1 - 0.01µF ceramic disk
C2 - 3 x 0.47µF, 600V polyester
interrupted on mains failure. from the battery to a negligible value (only C3, C13 - 0.1µF ceramic disk
90 mA). C4-C7 - 1000µF, 16V electrolytic
Inverter control circuit. It uses the C8 - 100µF, 25V electrolytic
The circuit basic squarewave (astable multivibrator)
C9 - 2200µF, 40V electrolytic
C10 - 0.47µF, 25V electrolytic
A 50Hz sinewave offline UPS-cum-EPS oscillator employing IC 555, with 5.1V C11, C12 - 0.22µF polyester
circuit is presented here which produces supply voltage derived from 12V battery Miscellaneous:
F1 - 5A cartridge fuse
a sinewave output with very low noise by using 5.1V zener ZD3 in series with a F2 - 16A cartrige (slow-blow) fuse
level. It drives the equipment/load (< 250 resistance. Astable multivibrator is de- X1 - Primary 9-0-9V/20A
watts), which normally operates on 230V, signed for a frequency of 100 Hz, which Sec. 230V section (1A),
50Hz AC. Changeover period of this sys- can be varied above or below 100 Hz us- Sec. 600V section (300mA
used as L1) transformer
tem is less than 1 millisecond so that no ing preset PR1. The frequency ‘f’ of astable X2 - 230V AC primary to 16V-0-
multivibrator is given by the relation- 16V, 3A secondary trans-
ship: former.
X3 - 230V AC primary to 0-12V,
500mA secondary transformer
SW1 - DPDT switch, 5A
SW2 - SPDT slide switch
where RB = In-circuit resistance of pre- CB - MCCB 4A
set PR1. BZ1 - Piezo buzzer
L1 - 1 Henry (part of X1, 600V tap-
If RA=220 ohms and RB=15 kilo- ping)
ohms, then f=100 Hz. Due to the L2, L3 - 100 µH (20T, 22SWG, air-core,
tolarance of the component values, ob- 8mm dia.)
RLY - 57DP-12-2C2 O/E/N 12V, 150-
served frequency may not be exactly ohm (2-changeover) relay
Fig. 1: Proposed front and rear panal layouts
157
CONSTRUCTION
Fig. 2: Schematic diagram of MOSFET-based sinewave inverter optional circuit of no-load/over-load protector (within dotted lines)
to the base of
transistor T2
through diode
D2 and series
resistor R4.
Transistors T1
and T2 act as
MOSEFT driv-
ers.
Power out-
put stage. The
collector of tran-
sistor T1 is con-
nected to the
gates of
MOSFETs M1
through M3 (re-
ferred to as
bank 1), while
that of transis-
tor T2 is con-
nected to the
gates of
MOSFETs M4
through M6
(referred to
as bank 2).
MOSFETs M1
through M3 are
connected in
parallel—gates
of MOSFETs M1
through M3 and
those of
MOSFETs M4
through M6 are
made common.
Similarly, drains
and sources of
MOSFETs in
each bank are
paralleled as
158
CONSTRUCTION
159
CONSTRUCTION
160
CONSTRUCTION
inverting terminal voltage of the compara- 225V AC. This enables the user to take
www.electronicsforu.com
be varied above and below the 5.1V refer- the UPS system keeps operating in the
ence voltage applied to the inverting in- inverter mode, the battery voltage will
put of IC5(b), using preset PR3. drop eventually to prohibitively low level
Preset PR2 is adjusted such that when (say, 5 volts). If such condition occurs fre-
AC mains voltage goes below 170 volts, quently, the life of the battery will be con-
the voltage at inverting input of compara- siderably reduced. To remove this draw-
tor IC5(a) goes below 5.1 volts, so that its back, it is necessary to use battery deep-
output goes high. As a result, transistor discharge cut-out circuit. If battery volt-
T3 conducts and its collector voltage (con- age goes below 9.5 volts, this circuit will
nected to the gate of triac TR) drops to cause the UPS to shut down, which pre-
0.7 volt, and hence the triac cuts off. This vents the battery from further discharge.
causes relay RLY to de-energise and the This circuit is also built around op-
system changes over to back-up mode of amp µA741 (IC7) working as a compara-
operation. Glowing of LED3 indicates the tor. Voltage at non-inverting input of IC7
under-voltage condition. is 5.1 volts, which is kept constant by ze-
Similarly, preset PR3 is adjusted such ner diode ZD6 and resistor R20. Preset
that when mains voltage goes above 270V PR5 is adjusted in such a way that if bat-
AC, the voltage at non-inverting input of tery voltage goes below 9.5 volts, IC7 out-
the conparator IC5(b) goes above 5.1 volts, put would go high to turn on SCR. Once
so that its output goes high to eventually SCR conducts, the supply voltage for con-
cut-off the triac, and the system again trol circuit drops to near 0V. As a result,
operates in the backup mode. The over- the control circuit is unable to produce gate
voltage indication is shown by glowing of drive pulses for the two MOSFET banks
LED4. and the inverter stops producing AC out-
This means that as long as the mains put.
voltage is within the range of 170V AC to Suppose the mains supply is not avail-
270 V AC, the voltage at the collector of able and you want to switch on the UPS
transistor T3 is 12 volts, and hence triac on load (say, computer). If battery deep-
TR conducts fully and relay RLY activates. discharge cut-out is set for a battery volt-
As a result, the system remains on mains age of 9.5 volts, this means that you want
mode. Diodes D6 and D7 act as 2-input to ‘cold’ start the UPS. On initial switch-
wired-OR gate for combining the outputs ing ‘on’ of the UPS, the starting current
from the two comparators and prevent requirement from the battery is quite high
the output of one comparator going into to cause a drop in battery voltage, due to
the output terminal of other comparator. which battery deep-discharge cut-out cir-
Zener diode ZD6 is used to limit the gate cuit would be activated and inverter is
voltage of the traic to 5.1 volts. not switched ‘on’. To overcome this prob-
Low-battery indicator. This circuit lem, 100µF capacitor C8 is connected
is wired around op-amp µA741 (IC6), across gate-source terminals of SCR. It
which functions as a comparator here. provides necessary delay for the battery
Battery voltage is applied across pins 7 current/voltage to settle down to its stable
and 4. Voltage at non-inverting input of value after switching on.
IC6 is maintained constant at 5.1 volts Reverse battery protection. A 16A
by zener diode ZD5 and series resistor to 20A diode (D8) in conjunction with fuse
R17. Voltage at the inverting input of IC6 F2 provides reverse battery protection, in
can be varied above and below 5.1 volts case battery is connected with reverse po-
using preset PR4. Preset PR4 is adjusted larity. In case of reverse polarity, fuse F2
in such a way that if battery voltage goes will blow and battery supply to the cir-
below 10V, the voltage at inverting input cuit will be immediately switched off.
goes below 5.1 volts, so that output volt- Protection against no-load. An op-
age at pin 6 of IC6 goes high (about 10 tional circuit for ‘no load‘ condition, dur-
V). Hence, LED5 glows and produces in- ing which the output voltage may shoot
termittent sound from the buzzer, indi- up to 290V AC or more, is shown in Fig. 2
cating low-battery status. (within dotted lines). The rectifier and fil-
At the beginning of the indication, the ter used are identical to that of under-
output voltage of inverter would be around voltage or over-voltage protection circuit,
161
CONSTRUCTION
162
CONSTRUCTION
nent-side and
solder-side
track layouts for
the PCB are
shown in Figs 5
and 6, respec-
tively. Fig. 7
shows the com-
ponent layout
scheme. The
wiring diagram
for the chassis
and panel-
mounted com-
ponents con-
nected to the
PCB via connec-
tors (and few di-
rectly to pads) is
shown in Fig. 8.
The pads for
a few compo-
nents are not
existing in the
PCB using ex-
isting pads/
tracks. The
same may have
to be mounted
externally using
the available
pads in accor-
Fig. 8: Wiring diagram of chasis/panel mounted components to the PCB dance with the
163
CONSTRUCTION
D
igital to analogue conversion is a A DAC can be classified into one of the
process wherein the analogue code). D to A converters (DACs) find ex- following three types:
output voltage or current is a tensive application in analogue input-out- 1. Current output. Here the output
function of the digital input word (binary put (I/O) systems, waveform generators, is a current proportional to the input digi-
signal processors, motor- tal word.
speed-controllers, voice 2. Voltage output. Here the output
synthesisers, attenuators, is a voltage proportional to the input digi-
etc. tal word.
DACs are characteri- 3. Multiplying output. In this type
sed by the following two of DAC the output voltage or current is a
main performance criteria: function of input digital word multiplied
1. Resolution. It is de- by the reference input (i.e. the voltage
fined as the smallest in- applied or current fed into its reference
cremental change in the terminal).
164
CONSTRUCTION
PARTS LIST
Semiconductor:
IC1 - PIC16C84, microcontroller
D1-D5 - 1N4148 switching diode
LED1-LED5 - 0.3-inch dia red LED
Resistors (all ¼-watt, ±5% carbon, unless
stated otherwise):
R1, R15-R23 - 10-kilo-ohm
R2-R6 - 560-ohm
R7-R14 - 20-kilo-ohm
Capacitors:
C1, C2 - 27pF ceramic disk
Miscellaneous:
XTAL - 3.575545MHz crystal
S1 - Push-to-on switch
165
CONSTRUCTION
Application
A waveform generator using
R-2R and a low-power CMOS
microcontroller PIC16C84 (by
Microchip Technology Inc.,
USA) is presented here. All
standard waveforms such as
sine, square, tri-wave, forward
and reverse ramp are success-
fully generated using the R-
2R DAC, in conjunction with
the above-mentioned
microcontroller. Waveforms
other than sine are generated
quite easily. The sine wave,
however, needs a different ap-
proach, which makes use of
lookup-table technique.
The circuit of the function
generator is shown in Fig. 5.
The 8-bit data is sent to the
DAC by the microcontroller,
through one of its ports. The
desired function/waveform is
selected with the help of a
push-to-on switch. The selec-
tion is also indicated by a cor-
responding LED. To keep the
application as simple as pos-
sible, only fixed-frequency
waveform generation is de-
scribed in this article.
PIC16C84 microcont-
roller is a CMOS device from
Microchip, which is used here
in conjunction with an R-2R
Fig. 8: Software flowcharts for generation of various waveforms DAC to realise a function gen-
The low-cost R-2R ladder-type DAC hook it up to your parallel port and start erator, as stated earlier. The important
(Fig. 2) requires no power supply at all, working. features of this device are reproduced in
nor any active components such as buff- Fig. 3 shows the transfer function or Table II.
ers, op-amps, and storage registers. Its the linearity behaviour of the DAC of Fig. Besides this, the device has some code
linearity is very good. Just give the digi- 2, while Table I compares the cost of a protection bits which, once enabled, will
tal input and take the analogue output. typical low-cost, 8-bit integrated chip not allow access to the program memory.
It is incredible! At a cost of Rs 5 only for (along with power supply and other parts) These bits are actually programmed into
8-bit resolution or Re 1 only per bit above with that of R-2R, 8-bit DAC of Fig. 2. the program memory, but user access to
8 bits, you can practically implement any The R-2R DAC can be used for most of it is not available. (Note. For more infor-
application, which may otherwise require the applications. An R-2R network can mation on EEPROM programming of
an integrated circuit. You do not have to also be used in conjunction with an op- PIC16C84, datasheet DS30189D in PDF
bother about control signals, memory, or amp. A 3-bit application circuit of the format, available on Microchip Website,
I/O mapping of your micro-system. Just same is shown in Fig. 4. can be used.)
www.electronicsforu.com
a portal dedicated to electronics enthusiasts
166
CONSTRUCTION
www.electronicsforu.com
100(64) 187(BB) 19(13) also be downloaded from the Microchip
117(75) 177(B1) 6(6)
134(86) 164(A4) 2(2) Website ‘microchip.com’.
150(96) 150(96) 0(0) The Mplab IDE comes with editor, as-
164(A4) 134(86) 2(2) sembler, and programmer software to sup-
177(B1) 117(75) 6(6)
187(BB) 100(64) 19(13) port Microchip’s device programmers and
194(C2) 88(58) 29(1D) a software simulator. It also supports pro-
198(C6) 71(47) 41(29) grams written in ‘C’ language.
208(D0) 55(37) 55(37)
198(C6) 41(29) 71(47)
For the present device (PIC 16C84),
194(C2) 29(1D) 88(58) the author has used Microchip PICSTART
PLUS development programmer. The soft-
The 8-bit port-B of this device has ware for the same, in PDF format, is also
been used as an output port, which is available on the Internet.
directly connected to the DAC. The 5-bit
port-A has been used both to input key-
press data and to output display data to Operation
the LEDs. Actually, the I/O pins on this As stated earlier, the present circuit can
port are time-shared/multiplexed between produce all standard waveforms. After
the keys and the LEDs. This means the power-up, by default the circuit produces
same lines are used at one time for read- squarewave signal. The LED marked
ing the keys and at another time for out- ‘square’ also lights up to indicate that
putting data to drive the LEDs directly. function. When the ‘select’ key is pressed
The time-sharing is so fast that the dis- once, the output changes to tri-wave. The
play through LEDs appears to be stable, waveforms are selected sequentially on
or any key closure is detected error-free. every depression of the ‘select’ switch and
The circuit works on 5V power supply, then repeated. Tested frequency range is
which can be derived from a 9V PP3 bat- 1 Hz to 100 Hz (all waveforms).
tery (or any other source capable of sup- Sinewave generation. For wave-
plying 7. 5V to 9V DC) by using commonly forms other than sinewave, the data to
available 7805 regulator. The current drain the DAC changes in binary ascending or
of the circuit is less than 10 mA. descending order. But since sine function
Although the circuit of Fig. 5 can be is not a linear function, each data is pre-
easily assembled using a general-purpose defined and a value table is used in this
PCB, a proper actual-size single-sided case. The value for each step of the
PCB for the same is given in Fig. 6 along sinewave is read and sent to the output
with its component layout in Fig. 7. port. The resolution depends upon the
number of steps. The higher the step-
count, the greater is the resolution, or
Software vice-a-versa. A simple look-up table (val-
The waveform generation technique is ues at 10o intervals), comprising 36 values
pretty easy and one can implement it
with any other microprocesor or TABLE IV
microcontroller system (e.g. 8085, Address Bank 0 Bank 1 Address
(Hex) registers registers (Hex)
8032, Z80, 6800, etc). The program 00 Indirect Indirect 80
flowcharts for generation of various 01 TMR0 Option 81
waveforms are shown in Fig. 8. One 02 PCL PCL 82
can write one’s software for the pur- 03 Status Status 83
04 FSR FSR 84
pose. However, source program for 05 Port Tris 85
generation of various waveforms us- 06 Port Tris 86
ing the circuit of Fig. 5, employing 07 — Not implemented — 87
08 EEdata Eecon1 88
PIC16C84 microcontroller, is given in 09 Eeaddr Eecon2 89
Appendix ‘A’. 0A Pclath Pclath 8A
For programming PIC 0B Intcon Intcon 8B
microcontroller, including the com- 0C General-purpose RAM 8C
| area starts |
plete development of a system, Mi- | Bank 1 RAM not implemented |
crochip offers an integrated develop- | |
ment environment (IDE) software 2F RAM ends AF
167
CONSTRUCTION
APPENDIX ‘A’
Assembly language program for implementation of function generator using PIC16C84
ERRORLEVEL –302 MOVF FN_STATUS,W ; MOVWF TRISA ;
INCLUEDE <P16C84.INC> XORLW SQR ; BCF STATUS,RP0 ;
BTFSC STATUS,Z ; MOVF PORT_A,W ;
PCL equ 0x02 ; GOTO SQR_WAVE ; ANDLW 0x1C ;
STATUS equ 0x03 ; ; XORLW 0x1C ;
FSR equ 0x04 ; MOVF FN_STATUS,W ; BTFSC STATUS,Z ;
PORT_A equ 0x05 ; XORLW TRI ; RETLW 0 ;
PORT_B equ 0x06 ; BTFSC STATUS,Z ; ;
EEDATA equ 0x08 ; GOTO TRI_WAVE ; MOVF PORT_A,W ;
EEADDR equ 0x09 ; ; ANDLW 0x1C ;
PCLATH equ 0x0A ; MOVF FN_STATUS,W ; MOVWF KEY ;
INTCON equ 0x0B ; XORLW P_RAMP ; ;
INDF equ 0x00 ; BTFSC STATUS,Z ; KEY_LUP
OPTION_REG equ 0x81 ; GOTO PRAMP ; MOVF PORT_A,W ;
TRISA equ 0x85 ; ; ANDLW 0x1C ;
TRISB equ 0x86 ; MOVF FN_STATUS,W ; XORLW 0x1C ;
EECON1 equ 0x88 ; XORLW N_RAMP ; BTFSS STATUS,Z ;
EECON2 equ 0x89 ; BTFSC STATUS,Z ; GOTO KEY_LUP ;
; GOTO NRAMP ; ;
; RAM 0x0C TO 0x2F (36 BYTES) ; CHK_FN
; GOTO NORMAL ; MOVF KEY,W ;
RP0 equ 0x05 ; ; XORLW FN_KEY ;
FN_KEY equ 0x18 ; SQR_WAVE BTFSC STATUS,Z ;
SQR equ 0x01 ; MOVLW 0XFF ; GOTO FN_CHANGE ;
TRI equ 0x02 ; MOVWF PORT_B ; ;
P_RAMP equ 0x04 ; CALL DELAY_ON ; RETLW 0 ;
N_RAMP equ 0x08 ; CLRF PORT_B ; ;
FN_STATUS equ 0x0C ; CALL DELAY_OFF ; FN_CHANGE
KEY equ 0x0D ; GOTO NORMAL ; RLF FN_STATUS,F ;
TEMP1 equ 0x0E ; ; MOVF FN_STATUS,W ;
TEMP2 equ 0x0F ; TRI_WAVE BTFSS FN_STATUS,4 ;
FN_VAL equ 0x10 ; HI RETLW 0 ;
ON_DELAY equ 0x11 ; MOVF FN_VAL,W ; CLRF FN_STATUS ;
OFF_DELAY equ 0x12 ; MOVWF PORT_B ; INCF FN_STATUS,F ;
; XORLW 0xFF ; RETLW 0 ;
;——————————————————- ; BTFSC STATUS,Z ; ;
; ORG 0x00 ; GOTO LO ; ;———————————————————- ;
START INCF FN_VAL,F ; ;
CLRF STATUS ; GOTO HI ; DELAY_ON
CLRF INTCON ; LO ; BCF STATUS,RP0 ;
BSF STATUS, RP0 ; MOVF FN_VAL,W ; MOVLW 0x1F ;
MOVLW B’10000000’ ; MOVWF PORT_B ; MOVWF 0N_DELAY ;
MOVWF OPTION_REG ; XORLW 0 ; DL1
CLRF TRISB ; BTFSC STATUS,Z ; DECF ON_DELAY,F ;
BCF STATUS, RP0 ; GOTO NORMAL ; MOVF ON_DELAY,W ;
CLRF PORT_B ; DECF FN_VAL,F ; BTFSC STATUS,Z ;
CLRF PORT_A ; GOTO LO ; RETLW 0
CLRF EEDATA ; ; GOTO DL1 ;
CLRF EEADDR ; PRAMP ;
INCF FN_STATUS ; MOVF FN_VAL,W ; DELAY_OFF
CLRF FN_VAL ; MOVWF PORT_B ; BCF STATUS,RP0 ;
MOVLW 0Xff ; INCF FN_VAL,F ; MOVLW 0x1F ;
; GOTO NORMAL ; MOVWF OFF_DELAY ;
;——————————————————- ; ; DL2
; NRAMP DECF OFF_DELAY,F ;
NORMAL MOVF FN_VAL,W ; MOVF OFF_DELAY,W ;
CALL KEY_SEEK ; MOVWF PORT_B ; BTFSC STATUS,Z ;
; DECF FN_VAL,F ; RETLW 0 ;
SHOW_FN GOTO NORMAL ; GOTO DL2 ;
BSF STATUS, RP0 ; ; ;
CLRF TRISA ; ;———————————————————- ; ;———————————————————- ;
BCF STATUS, RP0 ; ; ;
MOVF FN_STATUS,W ; KEY_SEEK END ;
MOVWF PORT_A ; BSF STATUS,RP0 ; ;
; MOVLW 0x1F ; ;*************************************** ;
covering complete 360 o, is shown for for sinewave generation as shown in internal RAM area of microcontroller,
this purpose. The look-up table (Table III) Fig. 8. along with their addresses, are shown in
is to be implemented as per the flowchart Various registers implemented in the Table IV.
168
C I RC ICR CUUII T
T I D E A S
IDEAS
POWER SUPPLY
Two separate heat sinks are to be pro-
S.C. DWIVEDI
vided for the two transistors (BU208D).
The filter capacitor for mains should be
of at least 47µF, 350V rating. It is better
DEEPU P.A. to use a 100µF, 350V capacitor. If the
output is short-circuited by less than 8-
T
he SMPS described here is suit- age rating of capacitors C7 and C8 should ohm load, the SMPS would automatically
able for high-wattage stereos and be at least twice the secondary output of turn off because of the absence of base
other similar equipment. The cir- each secondary section. BY396 rectifier current.
cuit employs two high-voltage power tran- diodes shown on the secondary side can The hfemin (current amplification fac-
sistors (BU208D) which have built-in re- be used for a maximum load current of 3 tor) of BU208D is 2.5. Thus, sufficient
verse-connected di-
odes across their
collectors and emit-
ters. It can supply
about 250-watt out-
put.
The circuit
uses a ferrite core
transformer of
14mm width,
20mm height, and
42mm length of E-
E cores. An air gap
of 0.5 mm is re-
quired between E-
E junction. Good
insulation using
plastic-insulating
sheets (Mylar) is to
be maintained be-
tween each layer of
winding. amperes. base current is required for fully satu-
The number of primary turns required Two feedback windings (L1 and L2) rated operation, otherwise the transistors
is 90 with 26 SWG wire. The secondary using two turns each of 19 SWG wire are get over-heated.
winding employs 17 SWG wire (for 4A wound on the same core. These windings At times, due to use of very high value
load current). Each turn of the secondary are connected to transistors T1 and T2 of capacitors C7 and C8 (say 2200µF or
develops approximately 2 volts. The with a phase difference of 180o, as shown so) on the secondary side or due to low
reader can decide about the output volt- by the polarity dots in the figure. First load, the oscillations may cease on the
age and the corresponding secondary wind the primary winding (90 turns us- primary side. This can be rectified by in-
turns, which would work out to be half ing 26 SWG wire) on the former. Then creasing the value of capacitor C6 to
the desired secondary voltage. The volt- wind the two feedback windings over the 0.01µF.
T
he circuit shown here displays on the toilet door and operated using a cated by bold lines in the figure). These
the message ‘toiLEt’ or ‘bUSY’, reed switch and a ferrite magnet pair, segments are permanently lit. ‘A’ rail is
using just six 7-segment common- suitably fixed on toilet door and its frame, connected to segments that make up the
anode displays. Such a display can be fixed such that the reed switch is closed when word ‘toiLEt’ and ‘B’ rail for the word
169
temporarily ground operated (or micro-switch operated) reed switch is
either rail ‘A’ or rail open and the display indicates ‘toiLEt’. Now to make
‘B’ (but not both), the message changeover to ‘bUSY’, when someone
and check whether goes inside and locks the door, the switch needs to
the display shows be closed on closure of the toilet door. One may also
‘bUSY’. The last two displays are not used in the ‘toiLET’ and ‘busy’. Use a 9V DC adapter use other methods to achieve the same results.
word ‘bUSY’. Rails ‘A’ and ‘B’ are active low for the as the power supply source and stabilise it
common-anode displays used here. Segments that are through a 7805 regulator.
to be always ‘off’ are left disconnected and are shown Normally, switch S1 is open and transistor T1
as hollow lines. Those segments which are either lit is forward biased. T1 conducts and thus rail ‘A’ goes
during ‘toiLEt’ display (pulled ‘low’ via bus ‘A’) or to near 0V, to display the word ‘toiLEt’. If switch S1
during ‘bUSY’ display (pulled ‘low‘ via bus ‘B’) are is closed, T1 switches ‘off’ and turns ‘on’ transistor
shown shaded in the figure. T2 to take point ‘B’ to near ground potential, and thus
Connect a +5V supply rail to the common anode the display changes over to indicate the word ‘bUSY’.
pin of all the displays. To test the circuit at this stage, Thus, when toilet door is open, the magnetically-
FEATHER-TOUCH
The switches are removed and the above-
mentioned wires (live, neutral, L1, L2,
L3, and L4) are connected to the circuit,
A
n ordinary AC switchboard con- By momentary depression of a switch, the regulator used for supplying 5V to IC2
tains separate switches for switch electrical appliance will be ‘on’/‘off’, inde- and IC3 (7476 ICs). These ICs are dual J-
ing ‘on’/’off’ electric bulbs, pendently. K flip-flops. The four J-K flip-flops being
tubelights, fans, etc. A very simple, inter- To understand the principle and de- used in toggle mode toggle with each clock
esting circuit presented here describes a sign of the circuit, let us consider an ex- pulse. The clock pulses are generated by
feather-touch switchboard which may be isting switchboard consisting of four the push-to-on switches S1 through S4
used for switching ‘on’/‘off’ four or even switches. One live wire, one neutral wire, when these are momentarily depressed.
more devices. The membrane or micro- and four wires for four switches are con- When a switch is momentarily depressed,
switches (push-to-on type) may be used nected to the switchboard, as shown in its corresponding output changes its ex-
with this circuit, which look very elegant. the illustration below the circuit diagram. isting state (i.e. changes from ‘high’ to
170
C I R C U I T I D E A S
‘low’ or tion with the four relay driver transistors an IC ULN 2004 which has an array of
v i c e SL100. The wires earlier removed are con- seven Darlingtons for driving the relays.
versa). nected to this circuit. On the switch panel So two more micro-switches and relays
The out- board, the micro-switches are connected, may be connected in a similar fashion.
puts of and under the board the connections are This circuit can be assembled on a
flip-flops wired as suggested above. general-purpose PCB and the total cost
drive the Relays RL1 though RL4 are 9V, SPST- should not exceed Rs 300. It is suggested
c o r r e - type micro-relays of proper contact rat- that the circuit, after assembly on a PCB,
sponding ings. may be housed in a box of proper size,
relays, in The circuit may be expanded for six which may be fitted on the wall in place
conjunc- switches by using one more IC 7476, and of a normal switchboard.
T
he circuit presented here is that 0 to 5) upon each successive clock edge
of a digital fan regulator, and is reset to 000 upon next clock. The
variable to provide five speed lev- count sequence of the counter has been
els as catered for in ordinary fan regula- summarised in Table I.
tors. The circuit makes use of easily avail- Each flip-flop is configured to toggle
able components. An optional 7-segment TABLE I
display with its associated circuitry has Displayed Counter IC4’s active Relay
been provided to display your choice of count count low output activated
fan speed. 0 000 Q0 NIL
The heart of the circuit is a modulo-6 1 001 Q1 RL1
2 010 Q2 RL2
binary counter, built around IC2 and IC3 3 011 Q3 RL3
(IC 7476) which are dual JK flip-flops. 4 100 Q4 RL4
The counter counts up in a straight bi- 5 101 Q5 RL5
0 000 Q0 NIL
nary progression from 000 to 101 (i.e. from
171
counter upon every depression of switch regulators with rotary speed regulation. sion of switch S1 up to the count 101.
S1. Upon the arrival of first clock edge, the The outputs of the counter also go to When switch S1 is depressed once again,
counter advances to 001. The outputs of IC6 (IC 7447), a BCD to 7-segment code normally the counter should read 110. But
the counter go to IC4 (IC 74138), which is converter, which, in turn, drives a 7-seg- the two most significant bits of the counter
a 3-line to 8-line decoder. When IC4 re- ment LED display. When switch S1 is de- force the output of NAND gate (IC7) to
ceives the input address 001, its output Q1 pressed once again, the counter advances go low to reset the counter to 000. The
goes low, while other outputs Q0 and Q2 to count 010. Now, the output Q2 of IC4 counter now begins to count through its
through Q7 stay high. The output Q1, af- goes low, while Q0, Q1 and Q3 through normal sequence all over again, upon ev-
ter inversion, drives transistor T1, which Q7 go high or remain high. This forces ery key depression.
actuates relay RL1. Now power is deliv- transistor T2 to saturation and actuates The circuit does not provide the facil-
ered to the fan through the N/O contact relay RL2. The display indicates the ity to memorise its previous setting once
RL1/1 of relay RL1 and the tapped resistor counter output in a 7-segment fashion. it is powered off or when there is a mains
RT. For the tapped resistor RT, one can use The counter proceeds through its nor- failure.
the resistance found in conventional fan mal count sequence upon every depres-
www.electronicsforu.com
a portal dedicated to electronics enthusiasts
172
C I R C U I T I D E A S
TELEPHONE RINGER
for the ringing to start after the switch is
closed. The circuit used also has a provi-
sion for applying a drive voltage to the
U
sing modulated rectangular multivibrator starts generating pulses. If constant voltage is to be sent to the called
waves of different time periods, this switch is placed in the power supply party for ringing.
the circuit presented here pro- path, one has to wait for a longer time
duces ringing tones similar to those
produced by a telephone.
The circuit requires four astable
multivibrators for its working. There-
fore two 556 ICs are used here. The
IC 556 contains two timers (similar
to 555 ICs) in a single package. One
can also assemble this circuit using
four separate 555 ICs. The first
multivibrator produces a rectangular
waveform with 1-second ‘low’ dura-
tion and 2-second ‘high’ duration. This
waveform is used to control the next
multivibrator that produces another
rectangular waveform.
A resistor R7 is used at the col-
lector of transistor T2 to prevent ca-
pacitor C3 from fully discharging
when transistor T2 is conducting. Pre-
set VR1 must be set at such a value
that the two ringing tones are heard
in one second. The remaining two
multivibrators are used to produce
ringing tones corresponding to the
ringing pulses produced by the pre-
ceding multivibrator stages.
When switch S1 is closed, tran-
sistor T1 cuts off and thus the first
www.electronicsforu.com
a portal dedicated to electronics enthusiasts
173
November
2000
CONSTRUCTION
S
erial communication between two dred metres, using a laser diode module efficiency visible LEDs, which light up at
PCs has been covered earlier too in place of infrared LEDs. 1 mA, is needed. The electrical pulses sent
in EFY. However, two separate ICs The laser module used is easily avail- by the COM port are now converted into
(1488 and 1489) were used in those able as laser pointer (having about 5 mW corresponding modulated pulses of IR
projects (for TTL to RS-232C and vice- power output). It is to be used with its light.
versa level conversion), using wireless ra- three battery cells removed and positive Receiver. The IR signals are detected
dio wave technology. This level conversion supply terminal soldered to the casing and by a photodiode (D1). (A photodiode is re-
required use of three different voltages, 0V point to the contact inside the laser verse biased and breaks down when IR
i.e. +12V, -12V and +5V. module. light falls on its junction.) The detected
Here is a novel circuit using MAXIM Assemble the two prototypes on PCBs TTL level (0/5V) signals are coupled to
Corporation’s IC MAX232, which needs or breadboards and connect them to COM- pin 10 of MAX 232 IC. These TTL levels
only a single power supply of 5V for 1 (or COM-2) port of each PC. Point the are converted to ±9V levels internally (as
level conversion. Fig. 1 shows the in- laser beam of one module to fall on the per Table 1) and output at pin 7.
ternal functional diagram of MAX232 photodiode of the module connected to the A visible LED1 at pin 7 of MAX232
IC. The communication over the short other PC, and vice versa. IC indicates that the signals are being
distance of 2 to 3 metres is established Load PROCOMM or TELIX serial com-
using infrared diodes, as shown in Fig. 2. munication software and set the port pa- TABLE I
The range could be increased up to hun- rameters to 9600 n 8 1 (here, 9600 refers Max 232 Conversion Levels
to the baud rate, n stands for TTL +5V to -9V RS 232
PARTS LIST parity-none, 8 represents bits per charac- TTL 0V to +9V RS 232
Semiconductors: RS 232 +9V to 0V TTL
ter, and 1 indicates number of stop bits) to
IC1 - MAX232A +5V powered RS 232 -9V to 5V TTL
multichannel RS232 establish the communication. File trans-
driver/receiver fer is also possible. The pro-
IC2 - NE555 timer totype was tested (by the
IC3 - IR RXR module; Siemens author) between speeds of
SFH-506-38 or Telefunken
TS0P-1838 1200 and 9600 bauds, in-
T1 - BC547 npn transistor cluding file transfer between
T2 - BC548 npn transistor the two PCs. The software
D1 - 1N4148 diode program for the purpose
LED1-LED3 - Red LED
was written in ‘C’ language.
IRLED1,
IRLED2 - Infrared light emitting The source code of the pro-
diode gram is given on page 49 for
Resistors (all ¼-watt, ±5% carbon, unless COM-1 port.
stated otherwise):
R1,R2 - 47-ohm
R3,R4 - 4.7-kilo-ohm Circuit
R5,R9 - 1-kilo-ohm
R6 - 1.2-kilo-ohm Transmitter. Data signals
R7 - 10-ohm transmitted through pin 3
R8 - 330-ohm of 9-pin (or pin 2 of 25-pin)
R10 - 2.2-kilo-ohm
R11 - 10-kilo-ohm
‘D’ connector of RS232 COM
VR1 - 4.7-kilo-ohm preset port are sent to pin 8 of
Capacitors: MAX232 and it converts
C1-C5 - 1µ, 25V electrolytic these EIA (Electronic In-
C6 - 470µ, 25V electrolytic dustry Association) RS232C
C7,C8 - 0.01µ ceramic disk compatible levels of +9V to
Miscellaneous: 0/5V TTL levels, as given in
- 9/25-pin ‘D’ connector
Table I. The output pin 9 of
(male/female)
MAX232 IC drives the pnp
Note: Parts List pertains to circuit in Fig. 3.
transistor SK100 and pow- Fig. 1: Internal functional diagram of IC MAX232
175
CONSTRUCTION
Testing
Assemble two transceiver modules and
connect each of them, using 3-core cables,
to Com-1 ports of the two PCs. Place
them 15 to 20 cms apart so that the IR
LEDs of each module face the photodiode
detector of the other.
Power ‘on’ both the circuits to oper-
Fig. 2: Communication between two PCs for a short range using IR diodes, or longer distance ate at stabilised 5V DC. You may alter-
using laser natively use a 7805 regulator IC with a
9V DC source to ob-
tain regulated 5V
supply.
Check if the
MAX232 IC is work-
ing properly by test-
ing pin 2 for 9 to 10V
positive supply and
pin 6 for
-9V supply. MAX232
(refer Fig. 1) uses
1µF, 25V capacitors
C1-C5 as a charge
pump to internally
generate ±9V from 5V
supply. Generally, de-
fective MAX232 ICs
will not show a volt-
age generation of +9V
and -9V at pins 2 and
6, respectively. Re-
place ICs, if required.
Although 1µF, 25V ca-
pacitors are recom-
mended in the
Fig. 3: Modified circuit diagram for PC-to-PC communication using 38kHz modulated pulses datasheet, the circuit
works well even with
received. Pin 7 is also connected to pin 2 (receiver pin) of 9-pin (or pin 3 of 25- 10µF, 25V capacitors, which are easily
pin) ‘D’ connec- available.
TABLE II tor used for the With both the PCs and supply to the
DB 9 Pin DB25 Pin Signal Direction Description serial port in the transceiver modules ‘on’, throw some light
1 8 In DCD (data carrier detect) PC, so that the
2 3 In RX (receiver data) data may be TABLE III
3 2 Out TX (transmit data) read. The optical Base Address for the Communication Ports
4 20 Out DTR (data terminal ready)
5 7 — GND (signal ground) signals received Communication Base address port
6 6 In DSR (data set ready) by the photo- COM1 03F8H
7 4 Out RTS (request to sent) diodes are in fact COM2 02F8H
8 5 In CTS (clear to send) converted to COM3 03F8H
9 22 In RI (ring indicator) COM4 02F8H
electrical pulses
176
CONSTRUCTION
with the torch on the photodiode. LED1 ered ‘on’, use a short jumper wire from TABLE V
should flicker at the burst frequency rate +5V and touch it at pin 8 of MAX232 IC to AL Register Bits
of the transmitter. This proves that the IR simulate a positive pulse. LED2 should Bit
signals are being detected by photodiodes turn ‘off’ and IRLEDs and LED3 should 7 6 5 4 3 2 10 Use
and converted into RS232-compatible lev- turn ‘on’ if the wiring is correct. IRLEDs X X X • • • •• Baud-rate code
els by the MAX232 and output at pin 7 of would also be glowing, although one can- • • • X X • •• Parity code
MAX232 ICs is available for the PC to not see them glowing. Remove the link • • • • • X •• Stop-bit code
• • • • • • XX Character-size code
read the pulses. wire from +5V to pin 8 of MAX232 IC and
To test the transmitter side, discon- connect back the ‘D’ connector to PC’s TABLE VI
nect the module from COM-1 (or COM-2) COM-1 (or COM-2) port. Baud Rate
port of the PC, and with the device pow- Run a simple communication software Bit Bits per
like PROCOM 7 6 5 Value second
TABLE IV or TELIX. Set
0 0 0 0 110
8250 Registers: Offset from Base Address the baud rate, 0 0 1 1 150
Offset LCR Bit 7 Meaning Read/write parity, bits per 0 1 0 2 300
0 0 Transmitter holding register (THR) Write character, and 0 1 1 3 600
[when written to port] stop bits to 1 0 0 4 1200
0 0 Receiver data register (RDR) Read 1 0 1 5 2400
9600, n, 8, 1, 1 1 0 6 4800
[when read from port]
0 1 Baud rate divisor--low byte (BRDL) Read/write
respectively, 1 1 1 7 9600
1 0 Interrupt enable register (IER) Read/write and send a few
1 1 Baud rate divsior--high byte (BRDL) Read/write characters from TABLE VII
2 x Interrupt identification register (IIR) Read only the keyboard Parity
3 x Line control register (LCR) Read/write through COM-1
4 x Modem control register (MCR) Read/write Bit
5 x Line status register (LSR) Read only (or COM-2) 4 3 Value Meaning
6 x Modem status register (MSR) Read only port. You 0 0 0 None
should be able 0 1 1 Odd Parity
to see LED3 1 0 2 None
1 1 3 Even Parity
flickering for a
few seconds, in- current. If you
TABLE VIII
dicating data use a laser
Stop Bits
transmission. beam, as ex-
Connect Bit
plained earlier,
2 Value Meaning
both PCs to the remove the
circuits and set 0 0 One IRLEDs and the
0 1 Two
the software to device will
chat mode. You TABLE IX track up to 10
should be able Character Size metres with-
to transfer data Bit out any data
between the 1 0 Value Meaning loss.
PCs, as if a 0 0 0 Not used
cable was con- 0 1 1 Not used
nected. 1 0 2 7-bit* Hints
Fig. 4: Actual-size, single-sided PCB for the circuit in Fig. 3 1 1 3 8-bit
Depending 1. Aligning
on the sensitiv- the laser beam is a problem, but once it
ity setting and is aligned carefully and fixed, the data
power/angle of transmission and reception would be er-
IRLEDs, in- ror-free. Transmitter and receiver align-
crease the dis- ment routines have been included in this
tance to about software program to aid in the alignment
35 cms (12 process.
inches) and try 2. Ordinary clear photodiodes should
again for better be used for detector. If you use dark-red
distance. plastic-encapsulated diodes, you may have
For more problems, as these react only to very bright
power, use natural light or infrared light.
metal-can type EFY Lab Note. While testing, we did
IRLEDs and re- face problems with red plastic-encapsu-
duce the value lated diodes as well as clear Darlington
of resistor R7 detectors (GE’s L14F1), probably because
Fig. 5: Component layout for the PCB for more drive of various light sources in the room caus-
177
CONSTRUCTION
178
CONSTRUCTION
179
CONSTRUCTION
TABLE X in Table III. The offset ad- Meaning of each of the bits of line status
Line Status Register Bits dress of the registers used register is given in Table X. Its bit 0 is
in serial communication is set when a byte is logged in the receiver
given in Table IV. buffer register and cleared when the byte
For serial port is read by the CPU. Its bit 6 is set when
initialisation, the program both the transmitter holding register and
makes use of BIOS interrupt the transmitter shift register are empty.
14H service 00H. It Presently, the software program is
initialises the serial port meant for COM-1 port initialised for 600
pointed to by the contents of bauds. It can be changed for 1200, or 2400,
ing corruption of the data. Finally, we dx register (0 for Com-1 and 1 for Com-2 or 4800, etc by changing the contents of
succeeded, after modification of the cir- port). The contents of ‘al’ register ‘al’ register in the initialisation function
cuit as shown in Fig. 3. We were able to initialise the specific communication port to 83H, or A3H, or C3H, etc in place of
flawlessly transfer files, from about 5- for baud rate, parity, stop-bit code, and 63H. Similarly, for using COM-2 port,
metre distance, between two 386-based character-size code as per Table V (and change all register addresses starting with
PCs. We included a 38kHz modulator in expanded in Tables VI through IX re- OX3f.. to OX2f.. etc in the program.
the transmitter section and used IR re- spectively). With the information included in the
ceiver module, which includes a bandpass The transmitter holding register tables and some knowledge of ‘C’ pro-
filter and demodulator for 38kHz carrier. (THR) and receiver data register (RDR) gramming, the readers would be able to
Please refer to the author’s circuit idea both at address Base+0 (the former be- understand the program with the help of
captioned ‘Proximity Detector’ in this is- ing write(only) and latter being read comments already included at various
sue for the working principle etc. For bet- (only)) act as buffers during transmis- places in the program. The executable file
ter understanding of the software pro- sion and reception, respectively, of a char- as well as the source code will also be
gram given by the author, we have in- acter. The other most important register, included in the CD available (optionally)
cluded certain additional information in which is referred to in the software pro- with EFY Dec. 2000 issue.
the succeeding paragraphs. gram frequently, is the line status regis- The source code as well as executable
The base addresses for the serial ter (LSR) at Base+5 (i.e. 03FDH for files are proposed to be included in next
communication ports in a PC are shown COM-1 port or 02FDH for COM-2 port). month’s EFY-CD. ❏
www.electronicsforu.com
a portal dedicated to electronics enthusiasts
180
CONSTRUCTION
T
he 8051 microcontroller, first de- follows: ports/registers.
veloped by Intel, finds many ap- — 8-bit CPU with register A (accu- One of the important parts of the
plications in small development mulator) and register B. 8051 CPU is its oscillator section. The
systems such as speed control of DC — 16-bit program counter (PC). oscillator section is present on the chip
motors, timers, process-control applica- — 16-bit data pointer (DPTR). itself, only quartz crystal has to be con-
tions, and tem-
perature con-
trollers. One
of its simple
applications as
multi-effect
chaser lights is
described in
this project.
Here the
microcontroller
8051 controls
the switching
sequence of
eight triacs
(TR1 through
TR8) via the
buffer transis-
tors T1 through
T8, as shown
in the sche-
matic diagram
of Fig. 1. Each
triac, in turn,
may be used to
control a series
of bulbs (with a
total voltage
drop of 230V
AC and the cur-
rent drawn
through BT136
triacs not ex-
ceeding 4 amp).
Features
of 8051 micro-
controller. The
heart of the cir-
cuit is the 8051
microcontroller.
Some of the im-
portant fea-
tures of the
controller are as Fig. 1: Schematic diagram of multi-effect chaser lights
181
CONSTRUCTION
TABLE I cussed relates to its input-out- P2. Port P2 happens to be the high-
Pins Use put (I/O) ports. The 8051 has order address lines, i.e. A8-A15. This port
P3.0 (RXD) Receive data serially a total of four 8-bit ports, can be used for interfacing I/O devices. It
P3.1 (TXD) Transmit data serially namely, P0, P1, P2, and P3. should be noted that port 2 is changed
P3.2 (INT0) External interrupt zero P0. The P0 port may be momentarily by the address signals when
P3.3 (INT1) External interrupt one
P3.4 (T0) I/P pin for timer 0 used as input, output, or as supplying the byte of a 16-bit address.
P3.5 (T1) I/P pin for timer1 combined low-order address P3. Port 3 functions in a fashion simi-
P3.6 (WR) External memory write pulse and a bidirectional data bus lar to that of port 1. Each pin of port P3
P3.7 (RD) External memory read pulse for external memory, which is performs different operations as shown
nected externally between pins 18 and 19. an alternate function. in Table I.
The crystal frequency should range be- P1. Port P1 does not have any alter-
tween 1 MHz and 16 MHz for proper func- nate function. It means that these pins
tioning of the controller. If this frequency are used for interfacing input-output de-
Hardware
is taken below 1 MHz, there is a chance vices like ADC, DAC, 7-segment displays, The controller is interfaced with the
of losing data of its internal RAM. LCD, keyboard, etc. external memory (EPROM) via the oc-
Pin 31 happens to
be the external access
pin for the controller.
If this particular pin
is grounded, 8051
fetches program from
the externally con-
nected ROM/EPROM.
And if it is connected
to Vcc, it starts execut-
ing the program from
the internal ROM that
has 4k address space
(0000H-0FFFH). For
8031, there is no inter-
nal ROM present, and
hence this pin has to
be grounded for its
proper operation.
When internal
ROM is used, and if the
program exceeds the 4k
Fig. 2: PCB layout for the circuit
internal ROM address
space, then after the
last address 0FFFH, it
starts executing the
program from exter-
nally connected ROM/
EPROM. The exter-
nally connected ROM/
EPROM can be in-
creased up to 64k, i.e.
0000H-FFFFH. In the
case of RAM, the same
can be extended up to
64k.
It should be noted
that the 8051 is
organised such that
data memory and pro-
gram memory can be
two entirely different
physical memory enti-
ties. Another impor-
tant aspect to be dis- Fig. 3: Component layout for the PCB
182
CONSTRUCTION
tal ‘D’
www.electronicsforu.com
Fig. 4: Output code format from Fig. 6: Hex code for Fig. 3
purpose
port P1
of using
74LS373
is to de-
multi-
Fig. 5: Output code format for Fig. 7: Hex code for setting P1.0 and P1.7 bit
setting only P1.0 plex the
address
lines and the data lines. Hence, after troller can read instruction byte from
de-multiplexing, AD0-AD7 forms two the program memory.
sets of lines—address lines A0-A7 and Under the program control, 8051
data lines D0-D7. The higher-order ad- provides the output to port P1, which
dress lines A8 to A15 are directly avail- is further coupled to the base of driver
able from 8051 pins. transistors T1 through T8 (BC547). A
During the memory access cycle, port logic 1 at any of the output pins of port
P0 first outputs lower bytes of 16-bit P1 will drive the corresponding LED as
memory address and then the same port well as the gate of the triac. The corre-
acts as bidirectional data bus to read a sponding triac therefore fires to drive
byte of memory, whereas port P2 provides the lamp/lamps connected between its
the higher byte of memory address dur- terminal A2 and the neutral line (N). If
ing the read cycle. It is further seen that you use, say, 12V lamps, you may con-
the lower-order address byte of port P0 nect about 20 lamps in series. If each
gets latched into external register of 74373 lamp is of 25-watt (passes about 2A
(IC2) to save the particular byte. The ALE current) rating, you may connect two
(Address latch enable) pulse provides the rows of 20 such bulbs across A2 termi-
precise timing to the 74LS373 for latch- nal of each triac and neutral line. The
ing the low-order address. software program determines the trig-
If the memory access is meant for gering sequence of the triacs to provide
the program memory, the PSEN signal the lighting effects.
goes low and enables the EPROM to
output the code on the data bus. The
purpose of using PSEN (program store
Software
enable) is that it provides the output As mentioned earlier, lighting of bulbs
signal for the program memory/code is controlled by port P1 output code
memory. When this signal goes low, con- format. During the execution of the pro-
gram, the code stored from memory lo-
PARTS LIST cation 0023H up 007CH (total locations
Semiconductors:
IC1 - 8051 microcontroller are thus 59H or 89 decimal) will get
IC2 - 74373 octal ‘D’ type latches loaded into the accumulator one by one
IC3 - 2764 EPROM 8-kbytes and will get transferred to port P1. If
IC4 - 7805 regulator +5V the format of these codes or their se-
T1-T8 - BC547 npn transistors
TR1-TR8 - BT 136, triac
quence is changed, the output too will
LED1-LED8 - Red LED get altered in same manner. Please note
Resistors (all ¼-watt, ±5% carbon, unless that outputting logic 1 from any pin
stated otherwise): (equivalent to setting a specific bit) will
R1-R16 - 560-ohm switch ‘on’ the corresponding triac (and
R17 - 47-ohm
R18 - 10-kilo-ohm the series of bulbs connected across its
Capacitors: terminals A2 and N), whereas output-
C1, C2 - 30pF ceramic disk ting logic 0 from the same pin of port
C3 - 100µF, 16V electrolytic P1 (equivalent to clearing/resetting the
C4, C5 - 10µF, 25V electrolytic
Miscellaneous:
specific bit) will switch it ‘off’. The out-
XTAL - 12MHz quartz crystal put code format from port P1 is shown
L1-L8 - L1 through L8 could each in Fig. 4.
be a series of bulbs with to- Example 1: If there is a requirement
tal voltage-drop of 230V AC to set only P1.0 bit, the output format
- Heat-sink
S1 - Push-to-on switch from port P1 will be as shown in Fig. 5.
For converting the above format to
183
CONSTRUCTION
Add. Code Label Mnemonics Comments Add. Code Label Mnemonics Comments
ORG 0000H ;ROM starting address 003F 01 DB 01H
0000 E4 CLR A ;Clear contents of accumulator 0040 11 DB 11H
0001 759000 MOV P1,#00H ;Clear port 1 (off all LEDs) 0041 22 DB 22H
0004 900023 MOV DPTR,#0023H ;Moving immediate DPTR 0042 44 DB 44H
;with 0023 (starting address of 0043 88 DB 88H
;O/P codes) 0044 44 DB 44H
0007 7B00 LABEL2: MOV R3,#00H ;Clearing the contents of 0045 22 DB 22H
register R3 0046 11 DB 11H
0009 E4 LABEL1: CLR A ;Clear accumulator 0047 33 DB 33H
000A 2B ADD A,R3 ;Adding the contents of 0048 77 DB 77H
;accumulator and register R3 0049 FF DB FFH
000B 0B INC R3 ;Incrementing the contents of 004A 77 DB 77H
;register R3 by 1 004B 33 DB 33H
000C 93 MOVC A,@A+DPTR ;Copy the code byte, found at 004C 11 DB 11H
;ROM address formed by adding 004D 81 DB 81H
;A dn the DPTR, to A 004E 42 DB 42H
000D F590 MOV P1,A ;Move the content the contents 004F 24 DB 24H
;of accumulator to port 1 0050 18 DB 18H
000F 1116 ACALL DELAY ;Calling delay 0051 24 DB 24H
0011 BB59F5 CJNE R3,#59H, ;compare the contents of regis- 0052 42 DB 42H
LABEL1 ;ter R3 with 59H and jump to 0053 81 DB 81H
;labell if not equal else continue 0054 C3 DB C3H
0014 80F1 SJMP LABEL2 ;Short jump to label2 0055 E7 DB E7H
0016 7801 DELAY: MOV R0,#01H ;Move immediate register R0 0056 FF DB FFH
;with 01H 0057 E7 DB E7H
0018 7900 LABEL5:MOV R1,#00H ;Move immediate register R1 0058 C3 DB C3H
;with 00H 0059 81 DB 81H
001A 7A00 LABEL4:MOV R2,#00 ;Move immediate register R2 005A 01 DB 01H
;with 00H 005B 02 DB 02H
001C DAFE LABEL3:DJNZ R2,LABEL3 ;Decrement the content of 005C 04 DB 04H
;register R2 till it becomes zero 005D 08 DB 08H
001E D9FA DJNZ R1,LABEL4 ;Decrement R1 till zero 005E 10 DB 10H
0020 D8F6 DJNZ R0,LABEL5 ;Decrement R0 till zero 005F 20 DB 20H
0022 22 RET ;Return 0060 40 DB 40H
0023 01 DB 01H ;DB(Define Byte) is 0061 80 DB 80H
0024 02 DB 02H ;the assembler directive 0062 40 DB 40H
0025 04 DB 04H 0063 20 DB 20H
0026 08 DB 08H 0064 10 DB 10H
0027 10 DB 10H 0065 08 DB 08H
0028 20 DB 20H 0066 04 DB 04H
0029 40 DB 40H 0067 02 DB 02H
002A 80 DB 80H 0068 01 DB 01H
002B 40 DB 40H 0069 03 DB 03H
002C 20 DB 20H 006A 0C DB 0CH
002D 10 DB 10H 006B 30 DB 30H
002E 08 DB 08H 006C C0 DB C0H
002F 04 DB 04H 006D 30 DB 30H
0030 02 DB 02H 006E 0C DB 0CH
0031 01 DB 01H 006F 03 DB 03H
0032 03 DB 03H 0070 0F DB 0FH
0033 07 DB 07H 0071 F0 DB F0H
0034 0F DB 0FH 0072 FF DB FFH
0035 1F DB 1FH 0073 00 DB 00H
0036 3F DB 3FH 0074 FF DB FFH
0037 7F DB 7FH 0075 00 DB 00H
0038 FF DB FFH 0076 FF DB FFH
0039 7F DB 7FH 0077 AA DB AAH
003A 3F DB 3FH 0078 55 DB 55H
003B 1F DB 1FH 0079 AA DB AAH
003C 0F DB 0FH 007A 55 DB 55H
003D 07 DB 07H 007B AA DB AAH
003E 03 DB 03H 007C 55 DB 55H
normal hex level, you have to apply 8421 maximum count is restricted to FFH lighting effect. The complete program
logic (Fig. 6) and you get 01H. (255 decimal). Since we are comparing listing is given in the box above.
Example 2: To set P1.0 and P1.7, the contents of register R3 with 59H, An actual-size, single-sided PCB for
you have to output 81H from port P1 when register R3 reaches that count, the circuit in Fig. 1 is shown in Fig. 2
(Fig. 7). the compare instruction gets satisfied and its component layout is shown in
In the software program, total codes and it jumps to label 2 (in the program). Fig. 3. It is important that neutral and
to be displayed are 007CH–0023H = In case you wish to extend the codes to phase (live) lines of 230V AC are not
0059H, as mentioned earlier, and hence be output from port P1, the loaded count interchanged, because only the neutral
59H is loaded in the main program at at memory location 0012H has to be al- line is required to be grounded to PCB
memory location 0012H. Further, reg- tered correspondingly. The program, common ground and not the live line.
ister R3 being an 8-bit register, the when run, produces an eye-catching ❏
184
C I RC ICR CUUII T
T I D E A S
IDEAS
N
ormally, chargers available in avoid relay chattering. It is designed for and D6 in the common leads of IC2 and
the market do not have any a window of about 1V. During charging, IC3 respectively provide added protec-
sort of control except for a ro- when the battery voltage increases be- tion to the regulators.
tary switch that can select different tap- yond 13.64V, the relay cuts off and the The float charging section, compris-
pings on a rheostat, to vary the charg- float charging section continues to work. ing regulator 7812, transistors T3 and
ing current. This type of control is not When battery voltage goes below 11.66V, T4, and few other discrete components,
adequate because of the irregular fluc- the relay is turned on and direct (fast) becomes active when the battery volt-
tuations in the mains supply, rendering charging of the battery takes place at age goes above 13.64V (such that the
the control ineffective. around 3A. relay RL1 is de-energised). In the
A simple circuit intended for auto- In the Schmitt trigger circuit, resis- energised state of the relay, the emit-
matic charging of lead-acid batteries is tors R1 and R2 are used as a simple ter and collector of transistor T4 remain
presented here. It is flexible enough to voltage divider (divide-by-2) to provide shorted, and hence the float charger is
be used for large-capacity inverter bat- battery voltage sample to the inverting ineffective and direct charging of bat-
teries. Only the rating of transformer input terminal of IC1. The non-invert- tery takes place.
and power
transistor
needs to
be in-
creased.
T h e
circuit has
been basi-
cally de-
signed for
a car bat-
t e r y
(about 40
Ah rat-
i n g ) ,
w h i c h
could be
used for
lighting
two 40W
tubelights.
The circuit
includes
Schmitt
trigger re-
lay driver,
f l o a t
charger,
and bat-
tery volt-
age moni-
tor sec-
tions.
T h e
Schmitt
trigger is
incorpo-
rated to
185
C I R C U I T I D E A S
The reference terminal of regulator cause of a drop in diode D7 you effec- age level in bar graph like fashion.
(IC3) is kept at 3.9V using LED2, LED3, tively get 13.8V at the positive terminal Regulator 7805 is used for generating
and diode D6 in the common lead of IC3 of the battery. When Schmitt trigger reference voltage. Preset VR1 (20 kilo-
to obtain the required regulated output switches ‘on’ relay RL1, charging is at ohm) can be used to adjust voltage lev-
(15.9V), in excess of its rated output, high current rate (boost mode). The fast els as indicated in the circuit. Here also
which is needed for proper operation of charging path, starting from transformer a potmeter arrangement using resistors
the circuit. This output voltage is fed to X2, comprises diode D5, N/O contacts of R7, R8, and R9 is used as ‘divide by 3’
the base of transistor T3 (BC548), which relay RL1, and diode D7. circuit to sample the battery voltage.
along with transistor T4 (2N3055) forms The circuit built around IC4 and IC5 When voltage is below 10V, the buzzer
a Darlington pair. You get 14.5V output is the voltage monitoring section that sounds to indicate that the safe dis-
at the emitter of transistor T4, but be- provides visual display of battery volt- charge limit has been exceeded.
TEMPERATURE MEASUREMENT
enough.
A simple way to make a TH1 Cu
thermistor is to take a 1meg-ohm, 2W
INSTRUMENT
resistor as a former and wind 2 metres
of 46 SWG enameled copper (Cu) wire
(5.91ohm/metre) over it. This gives a 12-
S.C. DWIVEDI
ohm value. Terminate wire ends on re-
ANANTHA NARAYAN sistor leads.
For calibration, you will need a DMM/
I
f wires of two dissimilar metals are resistors (MFRs) of 1 per cent tolerance, DPM and a millivolt source (as shown in
joined at both the ends and the jun- as this is an instrumentation applica- the figure below). First connect source
ction formed at one of the ends is tion. Power supply should be a stable between terminals TC+ and TC–, then
heated more than the other junction, a +5V, -5V supply, for which one can use set source to 0.00 mV (verify with DMM
current flows in the circuit due to See- 7805 and 7905 regulators. for zero). The output across +out and –
beck thermal emf. This effect is used in out termi-
thermocouple (TC) temperature sensors. nals must
The Peltier effect is converse of the be in mV
Seebeck effect, which means that if a (use DMM),
current is forced through junctions of represent-
dissimilar metals, one junction starts ing the
getting hot while the other starts get- room tem-
ting cold, depending on direction of the perature
applied emf. This effect is used to make (RT). For
small portable refrigerators. example, if
It is known that one of the junc- RT is 30 oC
tions is the sensing or hot junction (Tmes) (use a glass
and the other junction is the terminat- thermom-
ing or cold junction (Tref). The voltage eter), +out
between terminals ‘a’ and ‘b’ is propor- should be
tional to Tmes - Tref (as given in the Table The input terminals TC+ and TC– 30mV. At
I). The formula being Vab = a(Tmes-Tref), should go to a 4-way barrier terminal 0mV in-
where a is the Seebeck coefficient of block. Two extra terminals are used to put, adjust
the thermocouple. mount TH1 Cu thermistor. This forms VR1 till
In the circuit, use only metal film an isothermal block, which is good 30mV is
Table I read at
+out ter-
MV Thermocouple Temperature in oC Remarks minal.
0 0 As cold junction is not zero but is at room This is
2.585 50 temperature (RT), add RT to temperature.
5.268 100
10.777 200
16.325 300
21.846 400 Example
27.338 500 Feed 10.777mV between the TC+ and TC-
33.096 600 terminals. If RT is 30oC, reading on 2V DPM
Reference junction or cold junction at 0oC. will be 230 counts i.e. 230mV.
186
C I R C U I T I D E A S
‘zero cal’. Now increase mV input to 21.85 line atmosphere. Gain Av = (Rf+Ri)/Ri. Here Rf is R7
(corresponding to 400oC). Then vary VR2 6. It corrodes/rusts in acidic and and Ri = R5+R6+VR2 (in circuit-value).
till +out terminal is at 430mV (temp. oxidising atmosphere. Design of TH1 cold junction com-
+RT). This is ‘gain cal’. Now, as VR1 and 7. Colour codes of wires are negative- pensation copper thermistor
VR2 are interdependent, you may have red and positive-white. 1. J Type TC output changes by
to repeat ‘zero cal’ and ‘gain cal’ a few 8. J type is popular because of low 0.052mV per oC as per Table I. Copper
times till you get the above values. price and high mV output. has a temperature coefficient of 0.0042
Properties of J thermocouple and 9. J type TC is used in rubber/plas- ohm per ohm/oC. For example, for a cop-
design aspects of gain block used in the tic forming and for general purpose. per wire of 12 ohms, it is 12x0.0042=0.05
temperature measurement instrument ohm/oC.
are summarised below: Design of gain block 2. For R1 of 5k, current through TH1=
J Thermocouple (ANSI Symbol ‘J’) 1. Minimum input from thermo- 5V/5k=1mA. Change of voltage across
1. J is a thermocouple made of iron couple is as low as 1 to 2 mV. Hence TH1 with temperature is 0.05x1mA =
(positive) and constantan (negative). ultra-low offset (<100µV) op-amp OP07 0.05 mV/deg.
2. Constantan is an alloy of copper is used. 3. This rate is the same as that of J
and nickel. 2. Inputs may be subjected to wrong type thermocouple and hence it simu-
3. Full range of use is from – 200oC connections or high voltage. Use of resis- lates cold junction.
to +700oC. tor R2 limits current and zener ZD1 Lab Note. During lab testing the
4. It is practical to use it only from clamps voltage to a safe level. value of VR1 had to be very much in-
0oC to 400oC. 3. Gain required is 400mV/21.8mV, creased. However, as per author, it
5. It is useful in reducing and alka- which is approximately 18 at 400ºC. should be kept at 1 kilo-ohm only.
T
his circuit consists of two parts low-power (1.2-watt) audio amplifier ing due to its base pulled to the posi-
as shown in the figure. The up- TBA820M, which after amplification is tive supply rails via resistors R3, R5,
per circuit should be assembled fed into a 4-ohm loudspeaker. (The com- and R4. Therefore collector of transis-
in a box along with regulated 9V power bination of resistor R9 and capacitor C7 tor T1 is at near ground potential, and
supply (not shown in figure), while lower
circuit may be assembled on a small gen-
eral-purpose PCB and fixed inside the
doorbell switch enclosure. Connect points
A and B of one module to the similar
points of the other, using a simple 2-
core electric cable. The polarity need not
be adhered to, because the bridge recti-
fier used inside the switch circuit auto-
matically ensures proper polarity.
In the normal condition, any voice
or sound in the vicinity of the door,
where the lower circuit (module 2) is
installed, will be heard on module 1
inside your home. However, as soon as
the door bell switch is pressed by some-
one, a distinct bell sound will be heard
in the loudspeaker, inside the house.
With switch S1 in open condition,
module 2, which is a simple condenser
mic amplifier, amplifies the sound/au-
dio in its vicinity and the audio output
is available across points A and B. In
module 1, this audio is developed across
preset VR1, which acts as a volume
control. The audio from the wiper of
the preset is coupled to the input of
187
C I R C U I T I D E A S
hence the melody generator UM66 (IC1) its collector high. The voltage at collec- that if there are strangers outside the
does not get any power supply and is tor of transistor T1, after limiting by door, conversing before gaining entry
thus off. zener ZD1 to 3V, serves as power sup- by pressing the bell switch, you can
When bell switch S1 is pushed ply for melody generator UM66. The eavesdrop and hear their conversation
(closed), the audio output from output of melody generator is directly to guess their intentions.
module 1 is shorted to ground and at coupled to the input of audio amplifier Lab Note. This circuit can be easily
the same time transistor T1 base is and hence only melody is reproduced in modified to act as door-phone cum door-
pulled to ground via resistor R3. As a the speaker, when switch S1 is pushed. bell. So try it out!
result, transistor T1 is cut off, to pull The main advantage of this bell is
S
everal circuits have been pub- five. Effects like ‘curtain opening and Initially when output Q0 of IC1 is
lished in earlier issues of EFY closing’ and ‘peacock feathers spreading high, the output of flip-flop formed by
for producing eye-catching light- and closing’ can be produced. Wiring of NOR gates N3 and N4 goes high, thus
ing effects, such as lighting up of char- the same is shown in separate figures. triggering triac-1 through driving tran-
acters one-by-one and their going off Each line is lit up by 6-volt or 12-volt sistor T1. In the same way, when Q1 to
one-by-one in same direction, i.e. first bulbs connected in series for 230V AC Q4 outputs go high sequentially, corre-
character goes off first and so on (first- operation and controlled via triacs. LEDs sponding triacs get triggered and all the
in first-out, or FIFO). In the present cir- can also be used with proper driving five groups of bulbs light up. The first
cuit, an attempt is made for changing circuits. (Please ensure that sum of volt- part of the sequence is over.
this sequence, i.e. the first character to age drop across the series-connected When output Q5 of IC1 become high,
go off last (last-in first-out, or LIFO). bulbs is equal to around 230V.) the flip-flop formed by NOR gates N11
Easily available ICs are used and Flip-flops formed by NOR gates are and N12 is toggled and the output
the number of characters is limited to used for controlling the sequence. NOR is pulled to logic 0, removing the neces-
188
C I R C U I T I D E A S
sary drive
given to triac-
5. Similarly,
when outputs
Q6 through
Q9 become
high, triac-4
through triac-
1 go off one
by one and
the earlier lit
up bulbs go
off last. The
second part
of the se-
quence is also cycle repeats itself endlessly.
over and then the
PROXIMITY DETECTOR
T1 that shorts the charging capacitor
as long as the output from IR receiver
RUPANJANA module is available (active low).
This setup can be used to detect
K.S. SANKAR proximity of an object moving by. Both
transmitter and receiver can be
T
his proximity detector is con- mains ‘on’ as long as the infrared sig- mounted on a single breadboard/PCB,
structed using an infrared diode nals are being received. but care should be taken that infrared
detector. Infrared detector can When no more signals are received, receiver is behind the infrared LED, so
be used in various equipment such as the mono goes ‘off’ after a few seconds that the problem due to infrared leak-
burglar alarms, touch-free proximity (the delay depends on timing resistor- age is obviated.
switches for turning on a light, and sole- capacitor combination of R7-C5). The de- An object moving nearby actually
noid-controlled valves for operating a wa- lay obtained using 470kilo-ohm resistor reflects the infrared rays from the in-
ter tap. Briefly, the circuit consists of and 4.7µF capacitor is about 3 seconds. frared LED. As the infrared receiver
an infrared transmitter and an infra- Unlike an ordinary mono, the capacitor has a sensitivity angle of 60o, the IR
red receiver (such as Siemens SFH506- in this mono is allowed to charge only rays are sensed within this lobe and
38 used in TV sets). when the reception of the signal has the mono in the receiver section is trig-
The transmitter part consists of two stopped, because of the pnp transistor gered. This principle can be used to
555 timers (IC1 and IC2) turn ‘on’ the light, using
wired in astable mode, as a relay, when a person
shown in the figure, for comes nearby. The same
driving an infrared LED. automatically turns ‘off’
A burst output of 38 kHz, after some time, as the
modulated at 100 Hz, is re- person moves away.
quired for the infrared de- The sensitivity de-
tector to sense the trans- pends on the current-lim-
mission; hence the set-up iting resistor in series with
as shown is required. To the infrared LED. It is ob-
save power, the duty cycle served that with in-circuit
of the 38kHz astable resistance of preset VR1
multivibrator is main- set at 20 ohms, the object
tained at 10 per cent. at a distance of about 25
The receiver part has cms can be sensed.
an infrared detector com- This circuit can be used
prising IC 555 (IC3), wired for burglar alarms based
for operation in on beam interruption, with
monostable mode, followed the added advantage that
by pnp transistor T1. Upon the transmitter and re-
reception of infrared sig- ceiver are housed in the
nals, the 555 timer (mono) same enclosure, avoiding
is turned ‘on’ and it re- any wiring problems.
189
December
2000
CONSTRUCTION
I
n this innovative project, a simple
amplifier of de-
electronic bell system using com-
monly available ICs is presented for sired wattage
may be used for
use in educational institutes. This
simple and easy-to-fabricate project has the bell. In the
prototype, the
the following features:
• It sounds the bell automatically author used an
audio tape re-
after every period of 40 minutes.
• It displays in digital form the cur- corded with the
usual sound of
rent time and period number of the class
going on. brass bell, with
tape recorder/
• The system automatically switches
off after the last period (11th period). The player of 150
digital clock showing the current time, watts rating,
driving four 20-
watt speaker
PARTS LIST units. It was
Semiconductors: found adequate
IC1 - 7805 +5V regulator
IC2 - 7474 dual ‘D’ flip-flop
for the campus
IC3 - MM5369 oscillator/driver of any educa-
IC4 - MM5387/LM8361 clock chip tional institute.
or equivalent The readers
IC5, IC6 - CD4026 decimal up-counter
may, however,
with 7-segment driver
IC7-IC10 - CD4017 decade counter use any other
T1, T2 - BC107 npn transistor sound system
T3, T4 - 2N2222 npn switching according to
transistor Fig. 1: Block diagram of the electronic bell system their require-
D1-D8 - 1N4001 rectifier diode
LED1, LED2 - Red LED ments.
Resistors (all ¼-watt, ±5% carbon, unless
however, continues working as usual. Part III consists of the period counter
stated otherwise): and display. It displays the current pe-
R1, R2 - 2.2-kilo-ohm riod in progress. The number of pulses
R3, R44, R50 - 1.5-kilo-ohm The principle received at 40-minute intervals are
R4 - 4.7-kilo-ohm
Fig. 1 shows the block diagram of the counted by this counter circuit and the
R5, R6, R45
R46, R48 - 10-kilo-ohm system, which has three parts. Part I display unit displays the period number.
R7-R43 - 330-ohms has the usual digital clock comprising One additional relay circuit is used
R47 - 56-kilo-ohm quartz crystal oscillator cum frequency so that the power supply given to parts
R49 - 20-mega-ohm divider IC MM5369, clock chip MM5387, II and III of the system is automati-
Capacitors: and 7-segment common-cathode displays. cally interrupted at the end of the elev-
C1, C4 - 100µF, 25V electrolytic
C2 - 30pF ceramic disk
The 1Hz pulse (i.e. one pulse per enth period. Next day the system has
C3 - 30pF trimmer sec.) is taken from the digital clock and to be reset, and the cycle repeats.
Miscellaneous: used in part II of the circuit. The accu-
S1-S4 - Tactile switch (SPST) racy of the system depends on this 1Hz
S5 - Tactile switch (DPDT) pulse, obtained from the standard digi- The circuit
XTAL - 3.57945MHz crystal tal clock circuit. In part II of the sys- Fig. 2 shows the detailed circuit diagram.
RL1-RL2 - 12V, 200-ohm relay (SPST)
DIS.1-DIS.6 - LT543 common-cathode tem, the 1Hz pulse is used to obtain The clock circuit of part I of the system is
7-segment display one pulse after every 40 minutes, by designed using 3.58MHz quartz crystal,
- Power amplifier with employing a four-stage counter circuit. MM5369 crystal oscillator and divider
loudspeaker The pulses obtained at 40-minute in- (IC3), MM5387 clock chip (IC4), four com-
191
CONSTRUCTION
192
CONSTRUCTION
193
CONSTRUCTION
www.electronicsforu.com
a portal dedicated to electronics enthusiasts
194
CONSTRUCTION
ANSWERING MACHINE
80V AC (modulated pulses), as shown
in Fig 5.
S.C. DWIVEDI Ring detection circuit comprises an
input sensing section followed by
monostable multivibrator and decade
B.B. MANOHAR
counter. In the input sensing section,
capacitor C1 is used for DC blocking
T
his project is intended to provide the recorder and player. The ‘on’ time while 1N4007 diode D1 is used to rec-
you with a simple recording and can be set as per length of the message tify the AC ringing voltage. The poten-
answering machine, which in the to be recorded/played; say, two to three tiometer formed by resistors R2 and
absence of the subscriber/owner of the minutes. R3 (shunted by base-to-emitter resis-
telephone instrument, responds to the 4. Simulate off-
incoming calls and also records them hook state of the tele-
automatically. phone, which is ini-
tially in on-hook con-
dition.
Description The schematic dia-
To understand the overall working of gram incorporating
the system, refer to its block diagram the control circuitry,
shown in Fig. 1. The incoming telephone including power supply
line pair is terminated into the ring de- and relays, is shown in
tection unit comprising a monostable Fig. 2. The line dia-
flip-flop followed by a ring counter to gram, including all ac-
detect the incoming calls. After count- cessories used in the
ing a predetermined number of rings, it system, is shown in
triggers a timer (another monostable Fig. 3.
flip-flop) via an inverter. The output of Normally, the tele-
the timer is used for energisation of a phone lines (in on-
set of relays, which initiate the follow- hook position of the Fig. 1: Block diagram of telephone recording/answering machine
ing actions:
1. Switch
on AC power
to the tape re-
corder.
2. Switch
on DC voltage
to the tape
player.
3. Reset
the ring
counter in the
ring detector
section to
make it ready
for the next in-
coming call/
ring. However,
any fresh call/
ring will be ig-
nored as long
as the timer
output stays
‘high’. The
timer output
also controls
the ‘on’ time of Fig. 2: Circuit diagram of telephone recording/answering machine
195
CONSTRUCTION
196
CONSTRUCTION
197
CONSTRUCTION
www.electronicsforu.com
a portal dedicated to electronics enthusiasts
198
C I R C U I T I D E A S
T
his circuit uses only one octal D- junction of D0 and Q0 (marked ‘A’ in To switch off channel 1, ‘off’ switch
type latch, IC 74LS373, and some the figures) at low level, even after S9 of channel 1 is pressed to apply
associated circuitry to control releasing ‘on’ switch S1. This low level logic high to point ‘A’. Because
eight different gadgets. To control more
devices, identical circuits, in multiples,
can be used. The circuit incorporates
the following features:
(a) Individual ‘on/off’ control for all
channels.
(b) Emergency ‘off’ control for all
channels.
(c) Immediate ‘on’ control for all
channels.
(d) LED indication for ‘on’ channels.
(e) Optional push-to-on buttons or
tactile switches.
When one presses the ‘on’ switch
(S1) of channel 1, a logic low is applied
to data input pin D0. The same level
appears on the data output pin Q0,
because latch-enable pin LE (active
high) is connected to Vcc, and the out-
put-enable OE (active low) is pulled
down using resistor R9. At the same
time, Q0 output is fed back to D0
input, which thus keeps the common
199
C I R C U I T I D E A S
of the feedback from Q0 to D0, point emergency off switch S17 to disable all If all the channels are to be switched
‘A’ remains high even after releasing the outputs of IC1. In this state, the on simultaneously, a ‘low’ logic level
the ‘off’ switch. As a result, relay outputs of IC1 are in high impedance is applied via diodes D17 through
RL1 is deactivated and LED1 also goes state, and as all transistor bases are D24, to data inputs D0 to D7, by
off. almost ‘open’, all the relays get deacti- pressing switch S18 to activate all the
In case of emergency, press the vated. relays.
GENERATOR
ICs. The squarewave signal is fed at
RUPANJANA pin 1 of IC1 (CD 4024). IC1 is a 7-bit
counter, but here only 6 bits are made
use of. The first four bits are fed as a
J. CHOUDHURY signal bus to IC3 (CD4066) quad bilat-
eral switch through IC2 (CD4077B) that
M
any electronic devices depend case of static squarewave-to-sinewave contains four exclusive NOR gates. It
upon the shape of the signals. converter, in low frequency range, we converts the 4-bit signal bus to ‘up
It is very easy to produce can get accurate sine wave, but in high mode’ and ‘down mode’ hexadecimal sig-
squarewave signals from sine wave, frequency range the shape will not be a nals, simultaneously. The converted sig-
but reproducing sinewave signals from true sine wave. Here is a solution to nal bus switches on and off the ladder
the square wave is quite difficult. In that problem. switches inside CD4066. As a result,
the net resistance of lad-
der varies. This varying re-
sistance varies the charg-
ing and discharging cur-
rent of capacitor C1 in the
feedback path of IC5
(LM741).
The charging and dis-
charging mode is controlled
by IC4 (CD4011). In fact,
capacitor C1 works as an
integrator. The sinewave
producing circuit needs 64-
bit squarewave pulse for
360o sine wave. A missing
pulse in this 64-bit se-
quence produces ramp.
In this circuit, all ICs
except IC5 are CMOS ICs
and hence the current con-
sumption is very low.
The value of capacitor
C1 may be calculated from
the relationship: C1 = 0.27/
f0 µF. The value shown in
the circuit is for 50Hz out-
put frequency. The shape
of the sinewave output
may be corrected using
presets VR1 and VR2.
(EFY Lab note. Spikes
were noticed in the output
waveform while operating
with higher frequencies in
the kilohertz range.)
200
C I R C U I T I D E A S
A
TTL logic probe is an indispens- D3-D4 should be added or deleted as
able tool for digital circuit level. At power-on,
troubleshooting. Various meth- the output of
ods can be used to design a logic probe. NAND gate N2
The most common designs employ op- goes low. This is
amps, logic (OR, NOT, XOR) gates, and the default state of
transistors. the gate. The out-
The circuit presented here uses put of gate N2 goes
NAND logic gates of Hitachi HD series low (indicated by
IC HD74LS00, which is a quad-NAND glowing of LED2)
IC. Special technique has been employed during the follow-
to obtain three-state operation using ing situations:
just a single IC. 1. Power to the
Gate N1 is wired such that when the probe is switched
output of gate N1 is at logic ‘0’ (i.e. when ‘on’.
its input is at logic ‘1’), LED1 will glow, 2. The probe’s
to indicate high state of the point being tip is floating, i.e.
when it is neither
S. No. TIP level Output in contact with a
1. Ground/logic 0 LED3 ON point at logic ‘0’ nor at logic ‘1’ state. necessary; for example, when using
2. Vcc/logic 1 LED1 ON 3. The probe tip is in contact with a HD74LS00, one diode D2 is required.
3. Floating/or connected TTL output that is in high impedance • Use another diode in series with
to high impedance LED2 ON
state. D2 if the LED indication overlaps the
The LED indications for various tip float indicator.
probed. Gate N3 is wired to light LED3 levels are summarised in the accompa- (EFY Lab note. The probe was
when the output of gate N3 is high or nying table. found to work properly only with
when the point being tested is at logic ‘0’ This logic probe is very well suited HD74LS00.)
FOR HAMS
sistor T2. The carrier is further amplified
by transistor T1, which also acts as a
S.C. DWIVEDI buffer between the carrier oscillator and
the balanced modulator. The working
YUJIN BOBY VU3PRX frequency of the transmitter can be
changed by using crystals of different
T
his circuit of AM transmitter is In this transmitter we remove the frequencies. For multi-frequency opera-
designed to transmit AM (am- carrier and transmit only the two side tion, selection of different crystals can be
plitude modulated) DSB (double bands. The effective output of the cir- made using a selector switch. The level of
sideband) signals. A modulated AM sig- cuit is three times that of an equivalent the carrier coupled to the DBM can be
nal consists of a carrier and two sym- AM transmitter. adjusted with the help of preset VR2.
metrically spaced side bands. The two Opamp IC 741 is used here as a The output of the DBM contains only
side bands have the same amplitude microphone amplifier to amplify the the product (of audio and carrier) fre-
and carry the same information. In fact, voice picked up by the condenser mi- quencies. The DBM suppresses both the
the carrier itself conveys or carries no crophone. The output of opamp is fed input signals and produces double side
information. In a 100% modulated AM to the double balanced modulator band suppressed carrier (DSBSC) at its
signal 2/3rd of the power is wasted in (DBM) built around four 1N4148 diodes. output. However, since the diodes used
the carrier and only 1/6th of the power The modulation level can be adjusted in the balanced modulator are not fully
is contained in each side band. with the help of preset VR1. matched, the output of the DBM does
201
C I R C U I T I D E A S
contain some residual carrier. This is sets VR1 and VR2. using 24SWG enameled copper wire.
known as carrier leakage. By adjusting The DSBSC signal available at the Proper heat-sink should be provided for
the 100-ohm preset (VR2) and trimmer output of the balanced modulator is am- SL100B transistor used as final power
(C7) you can anull the scarier leakage. plified by two stages of RF linear am- amplifier.
To receive DSB signals you need a plifiers. Transistor 2N2222A (T3) is used Range of the order of a few
beat frequency oscillator to reinsert the as an RF amplifier, which provides kilometres can be easily achieved by
missing carrier. If you don’t have a beat enough signal amplification to drive the proper choice of site, type of antenna
frequency oscillator, or want to trans- final power amplifier around transistor (such as a resonant half-wave dipole of
mit only AM signal, adjust preset VR2 SL100B. The output of the final power length 20 metres for 7.05 MHz fre-
to leak some carrier so that you can amplifier is connected to the antenna. quency) and proper matching of trans-
receive the signals on any ordinary ra- All coils are to be wound on ferrite mitter to the antanna. Use good-qual-
dio receiver. In AM mode 100% modu- balun core (same as used in TV balun ity shielded wire of short length to con-
lation can be attained by adjusting pre- transformer of size 1.4 cm x 0.6 cm) nect the crystals.
T
he circuit presented here pro- this, radio hobbyists can choose a suit- this purpose.
vides the simplest way to mea- able site for the erection of antennae Though electronics hobbyists hav-
sure earth conductivity. Using that require good grounding; for ex- ing a flair for gardening can measure
ample, a the salinity or the fertility of soil to be
vertical an- used for their special plants, using the
tenna that method described here, it however
uses radial needs a lot of experimentation and
g r o u n d study.
plane. This The circuit presented here employs
circuit is a simple AC measurement technique.
also useful The efficiency of the circuit and results
for selecting improve as the frequency of AC in-
a suitable creases. With regular mains voltage
site to carry source of 230 volts, 5-amp current ca-
out the pacity, and 50Hz frequency available,
earthing of the measurements result in 25 per cent
202
C I R C U I T I D E A S
accuracy, which is quite reasonable and thor used copper probes.) Conductivity = 21xV1/V2 millimhos/
adequate for some practical applications. The ends of the probes are connected metre (m /m)
The bulb (which is 230V, 100W, fila- securely to the wires by means of bat- Please note:
ment type) shown in the figure is tery terminal lugs (generally • For poor soil with very little
mounted on a wooden box with a bulb used in automobiles) or power supply moisture and bio-fertility, the conduc-
holder. Connection to the mains supply terminals (used in UPS, DC-AC tivity ranges from 1 to 8 millimhos per
is obtained using long wires, which are converters, etc). The probes P2 and metre.
terminated into a 3-pin power plug that P3 can be fixed on hylam strips • For average soil, the values range
ensures non-reversibility of live and measuring 75cm(20-inch)x5cm(2-inch)x from 10 to 20 millimhos per metre.
neutral leads. The bulb drops the volt- 5mm(0.2-inch). Hylam strips are gener- • For fertile and good conductive
age to a safer level at the terminating ally available from switchboard dealers. soil, the conductivity ranges from 80 to
probe. Resistor R1 limits the current. To measure the conductivity ( ), 100 millimhos per metre.
Voltage V1 is measured across resistor the probes are driven into the ground, • For very saline soil, or salt water
R1 using AC voltmeter. as shown in the figure, and the circuit with very good conductivity, the
The probes, which are equidistant is powered with adequate safety mea- values might be as high as 5,000
from each other (about 45.7 cm, or 18- sures against any electric hazard. Volt- millimhos per metre.
inches, apart) have a height (below ages V1 across resistor R1 and V2 Caution. It should be noted that
ground level) of about 30.5 cm (12 across probes P2 and P3 are measured the polarity of the AC (phase and
inches) and a diameter of 1.25 cm (or and noted. neutral) leads should never be reversed,
½-inch). The probes may be made of The earth conductivity is then cal- to prevent any dangers to human/ani-
iron, stainless steel, or copper. (The au- culated as: mal lives.
T
o better understand the circuit, The circuit can be easily assembled that every data pin has its own ground
one needs to have some knowl- on a breadboard. It is very important return pin. There are other pins for vari-
edge of electronics, computer that you work with the smallest stepper ous other functions. We have used only
programming, and the computer’s par- motor available in the market, such as four data pins and a ground pin.
allel port. the one used in
You will of course need a computer, a floppy drive.
12-volt power supply (preferably a bat- If you go in for
tery eliminator), stepper motor, ULN2003 the large ones
chip, and some connecting wires. used in CNC
machines,
there is a
chance of dam-
aging the PC’s
parallel port.
The second
thing to men-
tion is that the
colours of the
wires of the
stepper motor
are non-stan-
dard.
The paral-
lel port of the
PC is the most
flexible way of
getting the
203
C I R C U I T I D E A S
The functions of the various pins are the step resolution of the TABLE I
given in Table I. Pins 2 through 9 are motor. On continuous appli-
Pin No Signal Direction Register Hardware
data pins. Here, we will use data pins 2 cation of the same signal, (D-type 25) In/Out Inverted
to 5, corresponding to data bits D0 the shaft stays in the same 1 Strobe In/Out Control Yes
through D3 of port 378(hex) for LPT1 position. Rotation occurs 2 D0
or 278(hex) for LPT2. Also, pin 25 is only when the signal is thru thru Out Data —
used as the ground pin. changed in a proper se- 9 D7
The PC’s parallel port cannot sink quence. There are three 10 Ack In Status
much current. At the most, it can modes of operation of a step- 11 Busy In Status Yes
handle a few milliamperes. So, if the per motor, namely, single- 12 PE In Status —
parallel port is connected directly to an coil excitation mode, dual- 13 Select In Status —
electrical device, it will damage the par- coil excitation mode, and
14 AFeed Out Control Yes
allel port. Thus, we need a current am- half-step modes.
15 Error In Status —
plifier in between the parallel port and • Single-coil excita-
16 Initialise Out Control —
the electrical device. The ULN2003, tion. Each coil is energised
used precisely for this purpose, has an successively in a rotary 17 SLCT Out Control Yes
(Printer)
array of Darlington transistor pairs. A fashion. If the four coils are
18 thru 25 Ground — — —
Darlington configuration is a way of assumed to be in a horizon-
connecting two transistors in order to tal plane, the bit pattern will be 0001, stepper motor coils involved measuring
amplify current to many times the in- 0010, 0100, 1000, and 0001. the windings’ resistance as well as their
put current value. • Dual-coil excitation. Here, two continuity in ohmsx1 scale, using any
The stepper motor has various ad- adjacent coils are energised successively good multimeter. The resistance of in-
vantages over other motors, as far as in a rotary fashion. The bit pattern will dividual coils with respect to the middle
controlling by a computer is concerned. be 0011, 0110, 1100, 1001, and 0011. points will roughly be half the resistance
It includes high precision of angular • Half-step mode. Here, the step- of the combined coil pairs (L1 and L2
movement, speed of rotation, and high per motor operates at half the given or L3 and L4 in the figure). After hav-
moving and holding torque. It comes in step resolution. The bit pattern is 0001, ing identified the coils in this fashion,
various flavours. We are dealing with 0011, 0010, 0110, 0100, 1100, 1000, 1001, connect them to the circuit as shown in
unipolar permanent magnet stepper and 0001. the figure. Now, if the sequence of input
motor that has four coils arranged as Two software control programs, one to the coils happens to be wrong, the
follows: for DOS and another for Linux, are in- shaft, instead of moving (clockwise or
Terminals 1 and 2 are common ter- cluded here. The program for DOS can anti-clockwise), will only vibrate. This
minals (connected to ground or the posi- be used to run the motor in full- or can be corrected by trial and error, by
tive supply) and the other four termi- half-step mode, or in single-coil or interchanging connection to the coils.
nals are fed to the appropriate signals. double-coil excitation mode. The output waveforms for full-step
When a proper signal is applied, the (EFY Lab note. The method used single-coil mode, as seen on the oscillo-
shaft turns by a specific angle, called at EFY for correct identification of the scope, are shown in the figure.)
DOS PROGRAM
#include <conio.h> unsigned int i=0; outportb(0x378,halfstep_val[i%sizeof(halfstep_val)]);
#include <dos.h> while(!kbhit()) #endif
#define FULLSTEP_SINGLECOIL { delay(10);
//#define FULLSTEP_DOUBLECOIL #ifdef FULLSTEP_SINGLECOIL i++;
//#define HALFSTEP outportb(0x378,fullstep_singlecoil_val[i%sizeof if(i==65535u) i=0;
unsigned char fullstep_singlecoil_val[]={1,2,4,8}; (fullstep_singlecoil_val)]); }
unsigned char fullstep_doublecoil_val[]={3,6,12, #elif defined(FULLSTEP_DOUBLECOIL) outportb(0x378,0);
9}; outportb(0x378,fullstep_doublecoil_val[i%sizeof }
unsigned char halfstep_val[]={8,12,4,6,2,3,9}; (fullstep_doublecoil_val)]); Compile and run the program under any com-
void main() #elif defined(HALFSTEP) piler like turboc for dos or Borland C++.
{
LINUX PROGRAM
#include <sys/io.h> unsigned int i=0; #endif
#include <unistd.h> if(ioperm(0x378,1,1)==-1) exit(1); usleep(5000);
#include <stdlib.h> while(1) i++;
//#define FULLSTEP_SINGLECOIL { if(i==65535u) i=0;
//#define FULLSTEP_DOUBLECOIL #ifdef FULLSTEP_SINGLECOIL }
#define HALFSTEP outb(fullstep_singlecoil_val[i%sizeof(fullstep_ outb(0,0x378);
unsigned char fullstep_singlecoil_val[]={1,2,4,8}; singlecoil_val)],0x378); }
unsigned char fullstep_doublecoil_val[]={3,6,12, #elif defined(FULLSTEP_DOUBLECOIL) Compile and run the program as follows:
9}; outb(fullstep_doublecoil_val[i%sizeof(fullstep_ #gcc – O6 – o motor motor.c
unsigned char halfstep_val[]={8,12,4,6,2,3,9}; doublecoil_val)],0x378); #./motor
void main() #elif defined(HALFSTEP) The – O6 flag is necessary for using the ‘outb’
{ outb(halfstep_val[i%sizeof(halfstep_val)],0x378); function.
204
The End