INTELLIGENT SWITCH

T

his intelligent switch circuit enables automatic, switching on of an emergency light system during darkness in the event of mains failure. The mains power failure condition is detected by the section consisting of mains step-down transformer X1 followed by bridge rectifier comprising diodes D1 through D4 and smoothing capacitor C1. If the mains is available then it causes energisation of relay RL1 which has two sets of changeover contacts. The light/darkness condition is detected by the circuit comprising phototransistor FPT100/2N5777 followed by Darlington pair comprising transistors T2 and T3. However, this section will function only when mains supply is not available (i.e. when relay RL1 is in de-energised state) since battery supply (negative lead) path gets completed via lower N/C contact of relay RL1. During daylight, photo transistor conducts and places transistor T2 base near ground potential. Thus Darlington pair remains cut-off and relay RL2
Period Conditions

remains de-energised. However, during darkness, photo transistor is cut-off and therefore transistor T2 receives forward base bias via resistor R1 (connected to positive rail), as resistor R2 is no more grounded (via photo-transistor T1). As a result, relay RL2 gets energised. Thus it would be observed that when mains is absent (relay RL1 de-energised) and it is dark (relay RL2 energised), the switch

During daylight (when mains is present (when mains is absent) During night darkness

[ [

Switch status

(when mains is present) (when mains is absent)

] ]

intelligent switch is ‘off ’. intelligent switch is ‘off ’. intelligent switch is ‘on’.

output path is complete. In any other condition switch output path would get broken. The switch output terminals can be used (in series with supply) to control a lighting system directly or indirectly through another contactor/heavy-duty relay depending upon the load. The working of the intelligent switch is summarised in the table.

200

ELECTRONICS PROJECTS Vol. 19

CIRCUIT

IDEAS
EDI

LONG-RANGe IR TrANSMitter

S.C. DWIV

EFY LAB

M

ost of the IR remotes work reliably within a range of 5 metres. The circuit complexity increases if you design the IR transmitter for reliable operation over a longer range, say, 10 metres. To double the range from 5 metres to 10 metres, you need to increase the transmitted power

IR laser pointer as the IR signal source. The laser pointer is readily available in the market. However, with a very narrow beam from the laser pointer, you have to take extra care, lest a small jerk to the gadget may change the beam orientation and cause loss of contact. Here is a simple circuit that will give you a pretty long range. It uses three infrared transmitting LEDs (IR1

Fig. 1: Circuit of the long-range IR transmitter

Fig. 2: Pin configurations of BC547/557 and BS170

four times. If you wish to realise a highly directional IR beam (very narrow beam), you can suitably use an

through IR3) in series to increase the radiated power. Further, to increase the directivity and so also the power density, you may assemble the IR LEDs inside the reflector of a torch. For increasing the circuit efficiency, a MOSFET (BS170) has been used, which acts as a switch and thus re-

duces the power loss that would result if a transistor were used. To avoid any dip during its ‘on’/‘off’ operations, a 100μF reservoir capacitor C2 is used across the battery supply. Its advantage will be more obvious when the IR transmitter is powered by ordinary batteries. Capacitor C2 supplies extra charge during ‘switching on’ operations. As the MOSFET exhibits large capacitance across gate-source terminals, a special drive arrangement has been made using npn-pnp Darlington pair of BC547 and BC557 (as emitter followers), to avoid distortion of the gate drive input. Data (CMOS-compatible) to be transmitted is used for modulating the 38 kHz frequency generated by CD4047 (IC1). However, in the circuit shown here, tactile switch S1 has been used for modulating and transmitting the IR signal. Assemble the circuit on a general-purpose PCB. Use switch S2 for power ‘on’/‘off’ control. Commer cially available IR receiver modules (e.g., TSOP1738) could be used for efficient reception of the transmitted IR signals. 

W W W. E F Y M AG . CO M

E L E C T RO N I C S F O R YO U • S E P T E M B E R 2 0 0 8 • 1 0 9

LONG-RANGE FM TRANSmIttER

S

everal circuits for constructing FM transmitters have been published in EFY. The power output of most of these circuits were very low because no power amplifier stages were incorporated. The transmitter circuit described here has an extra RF power amplifier stage, after the oscillator stage, to raise the power output to 200-250 milliwatts. With a good matching 50-ohm ground—plane antenna or multi-element Yagi antenna, this transmitter can provide reasonably good signal strength up to a distance of about 2 kilometres. The circuit built around transistor T1 (BF494) is a basic low-power variable-frequency VHF oscillator. A varicap diode circuit is included to change the frequency of the transmitter and to provide frequency modulation by audio signals. The output of the oscillator is about 50 milliwatts. Transistor T2 (2N3866) forms a VHF-class A power amplifier. It boosts the oscillator signals’ power four to five times. Thus, 200-250 milliwatts of power is generated at the collector of transistor T2. For better results, assemble the circuit on a good-quality glass epoxy board and house the transmitter inside an aluminium case. Shield the oscillator stage using

an aluminium sheet. Coil winding details are given below: L1 – 4 turns of 20 SWG wire close wound over 8mm diameter plastic former. L2 – 2 turns of 24 SWG wire near top end of L1. (Note: No core (i.e. air core) is used for the above coils) L3 – 7 turns of 24 SWG wire close wound with 3mm diameter air core. L4 – 7 turns of 24 SWG wire-wound on a ferrite bead (as choke) Potentiometer VR1 is used to set the centre frequency whereas potentiometer

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

ELECTRONICS PROJECTS Vol. 20

he circuit presented here can be used in PCOs for displaying the actual bill. The comparative disadvantages of the presented circuit are as follows: 1. The calculator used along with this circuit is required to be switched ‘on’ manually before making a call. 2. Certain manual entries have to be made in the calculator; for example, for a pulse rate of Rs 1.26, number 1.26 is

T

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

to be entered after switching ‘on’ the calculator followed by pressing of ‘+’ button twice. However, possibility exists for automating these two functions by using additional circuitry. In telephony, on-hook condition is represented by existance of 48V to 52V across the line. Similarly, the off-hook condition is represented by the line voltage dropping to a level of 8V to 10V (depending upon the length of the local lead line (local loop) from telephone exchange to the subscriber’s premises as

to PLL (phaselocked loop) IC2 (LM567) pin 4, while the lower set of relay contacts couples the positive telephone lead to input pin 3 of LM567 via capacitor C1 and resistor R3. The negative telephone lead is permanently capacitively coupled to ground via capacitor C2. As soon as call matures, 16kHz tone pulses would be pumped into the telephone line by the telephone exchange at suitable intervals. This interval depends on the pulse rate of the place called and also the time of the day and whether it’s a working-day or holiday. On receipt of 16kHz pulse, output pin 8 of IC LM567 (which is tuned for centre frequency of 16 kHz) goes ‘low’ for the duration of the pulse. The output of IC2 is coupled via transistor T3 to

from exchange for the duration of the call, then on completion of the call, the calculator display would show 12.60. The telephone operator has to bill the customer Rs 14.60 (Rs 12.60 towards call charges plus Rs 2.00 towards service charges). For tuning of the PLL circuit around IC2, lift the handset and inject 16kHz tone across the line input points. Tune IC2 to centre frequency of 16 kHz with the help of preset VR1. Proper tuning of the PLL will cause LED (D6) to glow even with a very lowamplitude 16kHz tone. EFY Lab note. Arrangement used for simulating a 16kHz pulsed tone is shown in Fig. 2. Push-to-on switch is used for generation of fixed-duration pulse for modulating and switching on a 16kHz oscillator. For more details regarding pulse rates, pulse codes, etc, readers are advised to go through the tariff rates and pulse code information given in the beginning pages of telephone directories, such as MTNL, Delhi directory, Vol. I.

188

ELECTRONICS PROJECTS Vol. 21

LOW CURRENT, HIGh VOlTAGE POWER SUpplY

A

high voltage power supply is a very useful source which can be effectively used in many applications like biasing of gas-discharge tubes and radiation detectors etc. Such a power supply could also be used for protection of property by charging of fences. Here the current requirement is of the order of a few microamps. In such an application, high voltage would essentially exist between a ‘live’ wire and ground. When this ‘live’ wire is touched, the discharge occurs via body resistance and it gives a non-lethal but deterrent shock to an intruder. The circuit is built around a transistorised blocking oscillator. An important element in this circuit is the transformer. It can be fabricated using easily available ferrite core. Two ‘E’ sections of the core are joined face-to-face after the enamelled copper wire wound on former is placed in it. The details of the transformer windings are given in the Table. In this configuration, the primary winding and the feedback winding are arranged such that a sustained oscillations are ensured once the supply is switched on. The waveform’s duty cycle is asymmetrical, but it is not very important in this application. Please note that if the oscillations do not occur at the ‘switch-on’ time, the transformer winding terminals of the feedback or the primary winding (but not both) should be reversed. The primary oscillations amplitude is

TaBLE Details of the Transformer Windings Windings No. of Standard wire turns gauge (SWG) Primary 50 31 Feedback 12 31 Secondary 1650 41

about 24V(p-p). This gets further amplified due to the large step-up ratio of the transformer and we get about 800V(p-p) across the secondary. A simple series voltage multiplier (known as Cockroft-Walton circuit) is used to boost up this voltage in steps to give a final DC voltage of about 2 kV. The output voltage, however, is not very well regulated. But if there is a constant load, the final voltage can be

adjusted by varying the supply voltage. The present configuration gives 2 kV for an input DC voltage of 15 V. Though higher voltages could be achieved by increasing input supply, one word of caution is necessary: that the component ratings have to be kept in mind. If the ratings are exceeded then there will be electrical discharges and breakdowns, which will damage the device.

ELECTRONICS PROJECTS Vol. 20

MAGIC LIGHTS

T

he circuit as shown in the figure employs 14 bi-colour (red and green) LEDs having three termi-

emits green light. And when positive voltage is simultaneously applied to its pins 1 and 3, it emits amber light. The circuit can

BCD to 7-segment latch/decodor/driver ICs. Thus we obtain a total of 14 segment outputs from each of the IC pairs

nals each. Different dancing colour patterns are produced using this circuit since each LED can produce three different colours. The middle terminal (pin 2) of the LEDs is the common cathode pin which is grounded. When a positive voltage is applied to pin 1, it emits red light. Similarly, when positive voltage is applied to pin 3. it

be used for decorative lights. IC1 (555) is used in astable mode to generate clock signal for IC2 and IC3 (CD4518) which are dual BCD counters. Both counters of each of these ICs have been cascaded to obtain 8 outputs from each. The outputs from IC2 and IC3 are connected to IC4 through IC7 which are

consisting of IC4 plus IC5 and IC6 plus IC7. While outputs from former pair are connected to pin No. 1 of all the 14 bi-colour LEDs via current limiting resistors, the ouputs of the latter pair are similarly connected to pin No.3 of all the bi-colour LEDs to get a magical dancing lights effect.

ELECTRONICS PROJECTS Vol. 19

187

MAGNETIC PROXImITY SWITCH

H

tions. The circuit, consists of a reed switch at its heart. When a magnet is brought in the vicinity of the sensor (reed switch), its contacts close to control the rest of the switching circuit. In place of the reed switch, one may, as well, use a general-purpose electromagnetic reed relay (by making use of the reed switch contacts) as the sensor, if required. These tiny reed relays are easily available as they are widely used in telecom products. The reed switch or relay to be used with this circuit should be the ‘normally open’ type. When a magnet is brought/placed in the vicinity of the sensor element for a moment, the contacts of the reed switch close to trigger timer IC1 wired in monostable mode. As

ere is an interesting circuit for a magnetic proximity switch which can be used in various applica-

a consequence its output at pin 3 goes high for a short duration and supplies clock to the clock input (pin 3) of IC2 (CD4013—dual D-type flip-flop). LED D2 is used as a response indicator. This CMOS IC2 consists of two independent flip-flops though here only one

is used. Note that the flip-flop is wired in toggle mode with data input (pin 5) connected to the Q (pin 2) output. On receipt of clock pulse, the Q output at pin 1 changes from low to high state and due to this the relay driver transistor T1 gets forward-biased. As a result the relay RL1 is energised.

ELECTRONICS PROJECTS Vol. 20

CIRCUIT

IDEAS

MEDIUM-POWER FM TRANSMITTER

IVEDI S.C. DW

PRADEEP G.

T

he range of this FM transmitter is around 100 metres at 9V DC supply. The circuit comprises three stages. The first stage is a microphone preamplifier built around BC548 transistor. The next stage is a VHF oscillator wired around another BC548. (BC series transistors are generally used in low-frequency stages. But these also work fine

in RF stages as oscillator.) The third stage is a class-A tuned amplifier that boosts signals from the oscillator. Use of the additional RF amplifier increases the range of the transmitter. Coil L1 comprises four turns of 20SWG enamelled copper wire wound to 1.5cm length of a 4mm dia. air core. Coil L2 comprises six turns of 20SWG enamelled copper wire wound on a 4mm dia. air core. Use a 75cm long wire as the an-

Fig. 2: Pin configurations of transistors BC548 and C2570

tenna. For the maximum range, use a sensitive receiver. VC1 is a frequency-adjusting trimpot. VC2 should be adjusted for the maximum range. The transmitter unit is pow-

Fig. 3: Walkie-talkie arrangement

Fig. 1: FM transmitter

ered by a 9V PP3 battery. It can be combined with a readily available FM receiver kit to make a walkie-talkie set as shown in Fig. 3.

80 • AUGUST 2005 • ELECTRONICS FOR YOU

WWW.EFYMAG.COM

CIRCUIT

IDEAS

MICROMOTOR CONTROLLER

UMAR SUNIL K

V. DAVID sing this circuit, you can control the rotation of a DC micromotor simply by press-

U

connected between the outputs (pin 3) of IC1 and IC2. Closing switch S5 provides power to the circuit. Now, when you press switch S1 momentarily, pin 10 of IC3

tor in conjunction with switch S1. If you press switch S3 after pressing switch S1, pin 3 of IC3 goes high, while its pin 4 goes low. The motor now starts rotating in the forward direction.

ing two push-to-on switches momentarily. The circuit is built around two NE555 ICs (IC1 and IC2) and a quadNAND IC CD4011 (comprising NAND gates N1 through N4). The NE555 ICs (IC1 and IC2) are configured as inverting buffers. IC CD4011 (IC3) NAND gates are configured as bistable flipflop. The DC motor to be controlled is

goes high, while its pin 11 goes low. Since pin 10 of IC3 is connected to reset pin 4 of IC1 and IC2, the high output at pin 10 of IC3 will enable IC1 and IC2 simultaneously. When switch S2 is pressed, pin 10 of IC3 goes low, while its pin 11 goes high. The low logic at pin 10 disables both IC1 and IC2. Switches S3 and S4 are used for forward and reverse motion of the mo-

However, if you press switch S4 after pressing switch S1, the motor will rotate in reverse direction. Note. The complete kit of this circuit can be obtained from Kits‘n’Spares, 303, Dohil Chambers, 46, Nehru Place, New Delhi 110019; Phone: 011-26430523, 26449577; Website: www.kitsnspares.com; E-mail: kits@efyindia.com.

WWW.EFYMAG.COM

ELECTRONICS FOR YOU • APRIL 2005 • 63

CIRCUIT

IDEAS

MUSICAL LIGHT CHASER

IVEDI S.C. DW

DEBARAJ KEOT his music-operated lighting effect generator comprises five sets of 60W bulbs that are ar-

T

ranged in zig-zag fashion. The bulb sets glow one after another depending on the intensity of the audio signal. No electrical connection is to be made between the music system and the

lighting effect generator circuit. You just need to place the gadget near the speakers of the music system. Fig. 1 shows the complete circuit of the musical light chaser, while Fig.

Fig. 1: Circuit diagram of musical light chaser

82 • JANUARY 2005 • ELECTRONICS FOR YOU

WWW.EFYMAG.COM

CIRCUIT

IDEAS

2 shows pin configurations of 9V regulator 7809, triac BT136 and level meter IC LB1403. The circuit is powered by regulated 9V DC. The AC mains is stepped down by transformer X1 to deliver a secondary output of 12V AC at 250 mA. The transformer output is rectified by a full-wave rectifier comprising diodes D1 and D2 and filtered by capacitors C1 and C2. Regulator IC 7809 (IC1) provides regulated 9V power supply to the circuit. Closing switch S1 provides power to the circuit and LED1 glows to indicate that the circuit is ready to work. When you put your music system in front of the condenser microphone of the light chaser, the sound pressure variation is converted into electrical signals by the condenser microphone. These weak electrical signals are amplified by op-amp µA741 (IC2), which is configured as an inverting amplifier. Using preset VR1 you can set the sensitivity of the circuit. The amplified output is fed to IC LB1403 (IC3) at its input pin 8. IC3 is a five-dot LED level meter commonly used in stereo systems for LED bargraph displays. It has a built-in am-

Fig. 2: Pin configuration

plifier, comparators and constant current source at its output pins. Depending on the intensity of the input audio signals, all or some outputs of IC3 go low to drive transistors T1 through T5, which, in turn, fire the corresponding triacs TR1 through TR5 via their gates and multicoloured zigzag bulb sets comprising ZL1 through ZL5 glow. When the audio level is low, only triac T1 is fired and the zig-zag bulb set ZL1 turns on and off sequentially. When the audio level is high, triacs TR1 through TR5 get fired and all the bulb sets (ZL1 through ZL5) turn on and off sequentially. Pin 7 of IC3 is used for selecting the response speed of the lighting. The larger the time constant, the slower the response, and vice versa.

The time constant can be changed by changing the values of resistor R6, variable resistor VR2 and capacitor C7. Here, variable resistor VR2 is used for varying the response speed of the chaser light as desired. When VR2 is set in the minimum resistance position, the response is very fast, and when it is set at the maximum resistance, the response is slow. The complete circuit including the power supply can be constructed on any general-purpose PCB or a small Vero board. Triacs TR1 through TR5 should be kept away from the op-amp and its related components. The metallic parts of the triacs should not touch each other and the other parts of the circuit. After assembling the circuit, house it in a suitable shockproof plastic cabinet. Make some holes in the cabinet for heat dissipation. Note. 1. Some zig-zag lights have a special bulb called ‘master bulb’ for automatic flickering. It should be removed and replaced with a simple non-flickering colour bulb. 2. Never touch any naked part of the circuit when it is connected to the mains.

WWW.EFYMAG.COM

ELECTRONICS FOR YOU • JANUARY 2005 • 83

PARALLEL TELEPHONE WITH SECRECY
ften a need arises for connection of two telephone instruments in parallel to one line. But it creates quite a few problems in their proper performance, such as over loading and overhearing of the conversation by an undesired person. In order to eliminate all such problems and get a clear reception, a simple scheme is presented here (Fig. 1). This system will enable the incoming ring to be heard at both the telephones. The DPDT switch, installed with each of the parallel telephones, connects you to the line in one position of the switch and

O

disconnects you in the other position of the switch. At any one time, only one telephone is connected to the line. To receive a call at the instrument, which is not connected to the line, you just have to flip the

toggle switch at your telephone end to receive the call and have a conversation. As soon as the position of the toggle switch is changed, the line gets transferred to the other telephone instrument. Mount one DPDT toggle switch, one telephone ringer, and one telephone terminal box on two wooden electrical switchboards, as shown in Fig. 3. Interconnect the boards using a 4-pair telephone cable as per Fig. 1. The system is ready to use. Ensure that the two lower leads of switch S2 are connected to switch S1 after reversal, as shown in the figure. Lab. Note: The external ringer for the project as shown in Fig. 2, was designed/fabricated at EFY Lab.

ELECTRONICS PROJECTS Vol. 21

181

PC-BASED 7-SEGMENT ROLLING DISpLAY

It

is very interesting and con venient to be able to control everything while sitting at your PC terminal. Here, a simple hardware circuit and software is used to interface a 7-segment based rolling display. The printer port of a PC provides a set of points with some acting as input lines and some others as output lines. Some lines are open collector type which can be used as input lines. The circuit given here can be used for interfacing with any type of PC’s printer port. The 25-pin parallel port connector at the back of a PC is a combination of three ports. The address varies from 378H-37AH. The 7 lines of port 378H (pins 2 through 8) are used in this circuit to output the code for segment display through IC1. The remaining one line of port 378H (pin 9) and four lines of port 37AH (pins 1, 14, 16, 17) are used to enable the display digits (one a time) through IC2. The bits D0, D1 and D3 of port 37AH connected to pins 1, 14 and 17 of ‘D’ connector are inverted by the computer before application to the pins while data bit D2 is not inverted. Therefore to get a logic high at any of former three pins, we must send logic 0 output to the corresponding pin of port 37AH. Another important concept illustrated by the project is the time division multiplexing. Note that all the five 7-segment displays share a common data bus. The

PC places the 7-segment code for the first digit/character on the data bus and enables only the first 7-segment display. After delay of a few milliseconds, the 7-segment code for the digit/character is replaced by that of the next charter/digit, but this time only second display digit is enabled. After the display of all characters/ digits in this way, the cycle repeats itself

over and over again. Because of this repetition at a fairly high rate, there is an illusion that all the digits/characters are continuously being displayed. DISP1 is to be physically placed as the least significant digit. IC1 (74LS244) is an octal buffer which is primarily used to increase the driving capability. It has two groups of four buff-

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

ELECTRONICS PROJECTS Vol. 20

ers with non-inverted tri-state outputs. The buffer is controlled by two active low enable lines. IC2 (75492) can drive a maximum of six 7-segment displays. (For driving up to seven common-cathode displays one may use ULN2003 described in the previous circuit idea.) The program for rolling display is given in the listing DISP.C above.

Whatever the message/characters to be displayed (here five characters have been displayed), these are separated and stored in an array. Then these are decoded. Decoding software is very simple. Just replace the desired character with the binary equivalent of the display code. The display code is a byte that

has the appropriate bits turned on. For example, to display character ‘L’, the segments to be turned on are f, e and d. This is equivalent to 111000 binary or 38 hex. Please note that only limited characters can be formed using 7-segment display. Characters such as M, N and K cannot be formed properly.

ELECTRONICS PROJECTS Vol. 20

PHONE BROADCASTER

H

ere is a simple yet very useful circuit which can be used to eavesdrop on a telephone conversation. The circuit can also be used as a wireless telephone amplifier. One important feature of this circuit is that the circuit derives its power directly from the active telephone lines, and thus avoids use of any external battery or other power supplies. This not only saves a lot of space but also money. It consumes very low current 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 sections, namely, automatic switching section and FM transmitter section. Automatic switching section comprises resistors R1 to R3, preset VR1, transistors T1 and T2, zener D2, and diode D1. Resistor R1, along with preset VR1, works as a voltage divider. When voltage across the telephone lines is 48V DC, the voltage available at wiper of preset VR1 ranges from 0 to 32V (adjustable). The switching voltage of the circuit depends on zener

breakdown voltage (here 24V) and switching voltage of the transistor T1 (0.7V). Thus, if we adjust preset VR1 to get over 24.7 volts, it will cause the zener to breakdown and transistor T1 to conduct. As a result collector of transistor T1 will get pulled towards negative supply, to cut off transistor T2. At this stage, if you lift the handset of the telephone, the line voltage drops to about 11V and transistor T1 is cut off. As a result, transistor T2 gets forward biased through resistor R2, to provide a DC path for transistor T3 used in the following FM transmitter section. The low-power FM transmitter section comprises oscillator transistor T3, coil L1, and a few other components. Transis-

tor T3 works as a common-emitter RF oscillator, with transistor T2 serving as an electronic ‘on’/‘off’ switch. The audio signal available across the telephone lines automatically modulates oscillator frequency via transistor T2 along with its series biasing resistor R3. The modulated RF signal is fed to the antenna. The telephone conversation can be heard on an FM receiver remotely when it is tuned to FM transmitter frequency. Lab Note: During testing of the circuit it was observed that the telephone used was giving an engaged tone when dialed by any subscriber. Addition of resistor R5 and capacitor C6 was found necessary for rectification of the fault.

ELECTRONICS PROJECTS Vol. 21

167

CIRCUIT

IDEAS

PICNIC LAMP

IVEDI S.C. DW

D. MOHAN KUMAR

Y

ou can take this white LEDbased night lamp on your picnic outings. The lamp has sound trigger and push-to-on facilities and gives ample light during a walk at night. It will also prove useful in locating the door of your tent in the darkness. A click of the fingers will switch on the lamp for three minutes to help you in a strange place. The circuit uses low-power ICs to save the battery power. JFET op-amp TL071 (IC1) amplifies the sound picked up by the condenser microphone. Resistor R1 and low-value capacitor C1 (0.22µF) make the amplifier insensitive to very lowfrequency sounds, eliminating the chance of false triggering. VR1 is used to adjust the sensitivity of the microphone and VR2 adjusts the gain of IC1. The amplified output from IC1 is coupled to trigger pin 2 of IC2, which

is a monostable multivibrator built around low-power CMOS timer IC 7555. Resistor R4 keeps trigger input pin 2 of the monostable normally high in the absence of the trigger input. Timing elements R6 and C4 give a time

white LED (LED1) through ballast resistor R7. The circuit can be easily assembled on a perforated board. Make the circuit assembly as compact as possible to enclose in a small case. Use three

delay of three minutes. Reset pin 4 of IC2 is connected to the positive rail through R5 and to the negative rail through C2 to provide power-on-reset function. The output of IC2 powers the

1.5V pen-light cells to power the circuit. Adjust VR1 and VR2 suitably to get sufficient sensitivity of IC1. Toggle switch S1 can be used to switch on the lamp like a torch.

WWW.EFYMAG.COM

ELECTRONICS FOR YOU • MARCH 2006 • 101

ost of the power-supply failure indicator circuits need a separate power-supply for themselves. But the alarm circuit presented here needs no additional supply source. It employs an electrolytic capacitor to store adequate charge, to feed power to the alarm circuit which sounds an alarm for a reasonable duration when the mains supply fails. During the presence of mains power supply, the rectified 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 LED. The low-level DC is used for charging capacitor C3 and reverse biasing switching transistor T1. Thus, transistor T1 remains cut-off as long as the mains supply is present. As soon as the mains power fails, the charge stored in the capacitor acts as a power-supply source for transistor T1. Since, in the absence of mains supply, the base of transistor is pulled

M

POWER-SUPPLY FAILURE ALARM
‘low’ via resistor R8, it conducts and sounds the buzzer (alarm) to give a warning of the power-failure. With the value of C3 as shown, a goodquality buzzer would sound for about a minute. By increasing or decreasing the value of capacitor C3, this time can be altered to serve one’s need. Assembly is quite easy. The values of the components are not critical. If the alarm circuit is powered from any external DC power-supply source, the mainssupply section up to points ‘P’ and ‘M’ can be omitted from the circuit. Following points may be noted: 1. At a higher DC voltage level, transistor T1 (BC558) may pass some collector-to-emitter leakage current, causing a continuous murmuring sound from the buzzer. In that case, replace it with some low-gain transistor. 2. Piezo buzzer must be a continuous tone version, with built-in oscillator. To save space, one may use five smallsized 1000μF capacitors (in parallel) in place of bulky high-value capacitor C3.

182

ELECTRONICS PROJECTS Vol. 21

C I R C U I T CIR CUIT

I D E A S

IDEAS

POWER-SUPPLY FAILURE ALARM
M.K. CHANDRA MOULEESWARAN
EDI DWIV S.C.

M

ost of the power-supply failure indicator circuits need a separate power-supply for themselves. But the alarm circuit presented here needs no additional supply source. It employs an electrolytic capacitor to store adequate charge, to feed power to the alarm circuit which sounds an alarm for a reasonable duration when the mains supply fails. During the presence of mains power supply, the rectified 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 LED. The low-level DC is used for charging capacitor C3 and reverse biasing switching transistor T1. Thus, transistor T1 remains cut-off as long as the mains supply is present. As soon as the mains power fails, the charge stored in the capacitor acts as a power-supply source for

transistor T1. Since, in the absence of mains supply, the base of transistor is pulled ‘low’ via resistor R8, it conducts

the components are not critical. If the alarm circuit is powered from any external DC power-supply source, the mainssupply section up to points ‘P’ and ‘M’ can be omitted from the circuit. Following points may be noted: 1. At a higher DC voltage level, transistor T1 (BC558) may pass some collector-to-emitter leakage current, causing a continuous murmuring sound from the

and sounds the buzzer (alarm) to give a warning of the power-failure. With the value of C3 as shown, a goodquality buzzer would sound for about a minute. By increasing or decreasing the value of capacitor C3, this time can be altered to serve one’s need. Assembly is quite easy. The values of

buzzer. In that case, replace it with some low-gain transistor. 2. Piezo buzzer must be a continuous tone version, with built-in oscillator. To save space, one may use five smallsized 1000µF capacitors (in parallel) in place of bulky high-value capacitor C3. "

ELECTRONICS FOR YOU ! JULY 2000

hen instruments are designed, an analogue front-end is essential. Further, as most equipment have digital or microcontroller interface, the analogue circuit needs to have digital control/access. The circuit of a programmable attenu-

W

PRECISION ATTENUATOR WITH DIGITAL CONTROL
testing or trials, use 1 per cent 100ppm MFR resistors. The expected errors will be around 1 per cent. To keep parts count (hence cost) to a minimum, the common or ground is used as the positive input terminal and one end of resistor R1 as the negative. Since ¼W resistors can withstand up to 250V, resistors R1 and R2 in series are used for 1 meg-ohm with 500V (max) input limit. These resistors additionally limit the input current as well. Diodes D1 and D2 clamp the voltage across input of op-amp to ±0.5V, thereby protecting the
Truth Table (Control input VS attenuation) X,Y (ON-switch (2) (1) Gain Pair) B A (Attenuation) X0,Y0 0 0 1/1000 X1,Y1 0 1 1/100 X2,Y2 1 0 1/10 X3,Y3 1 1 1

ator with digital control is described here, where digital control can be a remote dip switch, or CMOS logic outputs of a decade counter (having binary equivalent weight of 1, 2, 4, and 8, respectively), or I/O port of a microcontroller like 80C31. The heart of this circuit is the popular OP07 op-amp with ultra-low offset in the inverting configuration. A dual, 4channel CMOS analogue multiplexer switch CD4052 enables the change in gain. An innovative feature of the circuit is that the ‘on’ resistance (around 100 ohms) of CD4052 switch is bypassed so that no error is introduced by its use. Resistors R1 to R6 used in the circuit should be of 0.1 per cent tolerance, 50 ppm (parts per million) if you use 3½digit DPM, i.e. ±1999 counts (approx. 11 bits). But for 4½-digit DPM (approx. 14 bits), you may need to have trimpots (e.g. replace 1k-ohm resistor R6 by a fixed 900ohm resistor in series with a 200-ohm trimpot) to replace R3, R4, R5, and R6 gain selection resistors for proper calibration to required accuracy. However, for

This is so because the op-amp inverts the polarity as it is used in inverting configuration. This does not matter as the equipment will be isolated by the power supply transformer and all polarities are relative. In case you want the common to be the negative, you will have to add some stages (IC4 and IC5 circuitry shown in precision amplifier circuit described later). The OP07 pinout is based on standard single op-amp 741. Any other op-amp like CA3140, TLO71, or LF351 can be used but with offset errors in excess of 1 per cent, which is not tolerable in precision instrumentation. The OP07 has equivalent ICs like μA741 and LM607 having ultra-low offset voltage (<100μV), low input bias current (<10nA), and high input impedance (>100M), which are the key requirements for a good instrumentation op-amp for use with DC inputs. The following design considerations should be kept in mind: (a) Input: 500V max

op-amp. (b) Output The output can be connected to a 7107/ 7135-based DPM or any other analogueto-digital converter or op-amp stage. Use a buffer at the output if the output has to be loaded by a load less than 1 meg-ohm. Use an inverting buffer if input leads have to have polarity where ground is the inverting terminal. (For details, see next circuit.) (c) CD4052 CMOS switch The on-resistance (100-ohm approx.) comes in series with the op-amp output source resistance, which produces no error at output. Caution. The circuit does not isolate, it only attenuates. When high voltage is present at its input, do not touch any part of the circuit. (d) Digital control options (i) A and B can be controlled by I/O port of a microcontroller like 80C31 so that the controller can control gain. (ii) A and B can be given to counters like 4029/4518 to scroll gain digitally. (iii) A and B can be connected to DIP switch. (iv) A and B can be connected to a thumbwheel switch. Notes. 1. Digital input logic 0 is 0V and logic 1 is 5V. 2. All resistors are metal film resistors (MFR) with 1% tolerance, unless specified otherwise. 3. C2 and C3 are ceramic disk capacitors of 0.1μF = 100nF value.

ELECTRONICS PROJECTS Vol. 22

PRECISION DIGITAL AC POWER CONTROLLER
CRs and Triacs are extensively used in modern electronic power controllers—in which power is controlled by means of phase angle variation of the conduction period. Controlling the phase angle can be made simple and easy if we set different firing times corresponding to different firing angles. The design given here is a synchronised programmable timer which achieves this objective. The following equation for a sinewave shows how firing time and the phase angle are related to each other: θ = 2πft or θ∝t Here, θ is the angle described by a sinewave in time t (seconds), while f is the frequency of sinewave in Hz. Time period T (in seconds) of a sinewave is equal to the reciprocal of its

S

frequency, i.e. T = 1/f. The above equation indicates that if one divides the angle described during one complete cycle of the sinewave (2π = 360o) into equal parts, then time period T of the wave will be divided into identical equal parts. Thus, it becomes fairly easy to set the different programmable timings synchronised with the AC mains sinewave at zero crossing. The main advantage of such an arrangement, as already mentioned earlier, is that only the firing time has to be programmed to set different firing angles. It is to be noted that the more precise the timer, the more precise will be the power being controlled. In this circuit, the time period of mains waveform is divided into 20 equal parts. So, there is a time interval of 1 ms between two consecutive steps. The sampling voltage is unfiltered full-wave and is obtained from the diode bridge at the output of the power transformer. The timer is reset at every zero crossing of full wave and

set again instantly for the next delay time. This arrangement helps the timer to be set for every half of mains wave—when the positive half of the mains waveform starts building up, the timer is 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 crossing detectors—one for each half of mains wave—a single detector is used to perform both the functions. This is possible because 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 threeterminal voltage regulator 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 base of transistor T1, which is wired as zero crossing detector. When base voltage reaches the threshold, it conducts. It thus sup-

174

ELECTRONICS PROJECTS Vol. 21

plies a narrow positive pulse which resets the timer at every zero crossing. A 32.768kHz crystal is used to get stable output of nearly 1 kHz (1,024Hz) frequency after five stages of binary division by an oscillator-cum-divider IC CD4060. The 32.768kHz crystal is used because it can be found in unused quartz clocks and is readily available in the market. But use of a 1kHz crystal using a quad-NAND IC

CD4093 as clock generator, as shown in Fig. 2, is better as it provides the exact time interval required. In that case, CD4060 oscillator/divider is not required. The CD4017B counter-cum-decoder IC then divides this 1kHz signal into ten equal intervals, which are programmed via the single-pole, 10-way rotary switch. Once the delayed output reaches the desired time interval, the corresponding output of CD4017 inhibits the counter CD4017 (via

pole of rotary switch and diode D6) and fires the Triac. Transistor T2 here acts as a driver transistor. The reset pin of 4017 is connected to zero crossing detector output to reset it at every zero crossing. (The load-current waveforms for a few positions of the rotary switch, as observed at EFY Lab, are shown in Fig. 3.) The circuit can be used as power controller in lighting equipment, hot-air oven, universal single-phase AC motor, heater, etc.

ELECTRONICS PROJECTS Vol. 21

175

PRECISION 1HZ CLOCK GENERATOR USINg ChIp-ON-BOARD

U

sually the circuits for generation of 1Hz clock for applications in digital clock and counter circuits make use of ICs in conjunction with a crystal and trimmer capacitors, etc. However, similar or better accuracy can be achieved using a chip-on-board (COB) device found inside a digital clock, which is readily available in the market for Rs 15-20. This COB consists of IC, capacitors and quartz crystal, etc which are mounted on its surface. It works on 1.4 volt DC source. This COB can be used to derive 1Hz clock.

clock pulse has a very low amplitude of the order of a few milli-volts which cannot be used to drive the digital circuits directly. This low-level voltage is amplified several times by op-amp IC CA3140. The op-amp CA3140 is connected in a non-inverting mode, and its gain is set by resistors R4 and R3. Capacitor C2 reduces the AC gain and unwanted stray pick-up and thus improves stability of the circuit. The input impedance of IC CA3140 is very high and thus there is no drop

Resistor R1, capacitor C3, diodes D1 and D2 shown in the circuit convert 5V DC into 1.4V DC. A ½Hz clock is available at terminals A and B with a phase difference of 90o. The two outputs, are combined using capacitors C1 and C2 to obtain a complete 1Hz clock. This 1Hz

at the input when 1Hz clock signal of low level is connected across its input terminals from the COB. Amplified 1Hz clock pulse is available at its output pin 6, which is further amplified by transistors T1 and T2 to drive the digital clocks and timers.

Preset VR1 is offset null control used to adjust proper 1Hz pulse at the output terminal ‘E’. Connect one LED in series with 220-ohm resistor between the terminal ‘E’ and ground and adjust preset VR1 till the LED blinks once every second. When using the COB, affix the same on a general-purpose PCB using rubber based adhesive and solder the terminals neatly using thin single-strand wire. Lab Note: The COBs used in different watches may differ somewhat in their configuration. But by trial-anderror one can always find out the appropriate points corresponding to points A, B, C and D. Figure of a second COB used by EFY Lab is shown alongside. The points A and B (on the COB used by us) were observed to have complementary 1Hz outputs and hence anyone (only) could be used as input to opamp CA3140.

ELECTRONICS PROJECTS Vol. 20

PROGRAMMABLE DOOR-BELL WITH FLASHING LEDS

I

C1 (NE555) is used here as a clock generator. It is configured as an astable multivibrator whose frequency can be adjusted with the help of potmeter VR1. The clock pulses obtained from IC1 are fed to pin 14 of IC2 (CD4017) which is a well-known decade counter. Here LEDS have been connected in a rather unusual way. The LEDs flash sequentially from Q0 to Q9. Five presets

of 100k each are connected to each pair of LEDs. IC3 here works as tune generator and the Darlington pair comprising transistors BC547B and SL100B is used to amplify its output. The frequency of IC3 is adjusted by potmeter VR2. Each 100k preset (VR3 through VR7) is adjusted for a different tune depending on individual choice. The 10-LED display

is assembled in such a way that the first vertical column has orange LED1 through LED5 and the second parallel column has green LED10 through LED6, as shown in the figure. The circuit can be easily assembled on a veroboard. Any well-filtered 9V, 250mA DC power supply is suitable. Primary of the supply transformer may be connected to the bell AC outlet points.

192

ELECTRONICS PROJECTS Vol. 19

A

PROGRAMMABLE LED INdiCATOR

lthough IC CD4017 is a decade counter, it can be used in a variety of ways. In this circuit it has been used to program a bicolour LED indicator in 10 different modes which can be selected with a single push-button switch. IC3(555) is used in astable mode to generate square wave and transistor T1 is used to obtain its complementary waveform. IC2 CD4081 is a quad 2-input AND gate. These AND gates and the diode matrix form the logical part of the circuit. IC4 (555) is configured as a monostable flipflop which provides a single clock pulse to IC1 CD4017 for changing the mode by depression of push-to-on switch S1. The use of IC4 avoids switch debouncing problem which causes multiple makes/breaks.
TABLE I Mode Operation
0 1 2 3 4 5 6 7 8 9 Off Red ON Green ON Blinking Green-Yellow-Green-Yellow... Blinking Red Blinking Yellow Blinking Green Yellow ON Blinking Red-Yellow-Red-Yellow... Blinking Red-Green-Red-Green...

Switch S2 is included for resetting the circuit. Instead of just one bicolour LED you can use an array of bicolour LEDs in conjunction with two driver transistors. The bicolour (RED and GREEN) LED has three legs. The middle terminal (pin2) LED is the common cathode pin which is grounded when a positive voltage is ap-

plied to pin1, it emits red light. Similarly, when positive voltage is applied to pin3, it emits green light. And when positive voltage is simultaneously applied to its pin1 and 3, it emits yellowish light. Power supply used is +5V regulated. Various modes of this circuit are summerised in Table I.

Outputs of IC1 can also be selected through a 10-way rotary switch connected to Vcc. Now IC1 can be eliminated. Different indications can be activated for different functions of a device. Construction is very easy and total cost of this circuit is less than Rs 60. Current consumption of the circuit is less than 100mA.

ELECTRONICS PROJECTS Vol. 22

7

PROTECTION FOR YOUR ELECTRICAL APPLIANCES
ere is a very low-cost circuit to save your electrically operated appliances, such as TV, tape recorder, refrigerator, and other instruments during sudden tripping and resumption of mains supply. Appliances like refrigerators and air-conditioners are more prone to damage due to such conditions. The simple circuit given here switches off the mains supply to the load as soon as the power N trips. The supply can be resumed only by manual intervention. Thus, the supply may be switched on only after it has stabilised. The circuit comprises a step-down transformer followed by a full-wave rectifier and smoothing capacitor C1 which acts as P a supply source for relay
H

H

RL1. Initially, when the circuit is switched on, the power supply path to the stepdown transformer X1 as well as the load is incomplete, as the relay is in de-energised state. To energise the relay, press switch S1 for a short duration. This completes the path for the supply to transformer X1 as also the load via closed contacts of switch S1. Meanwhile, the supply to relay becomes available and it gets energised to provide

a parallel path for the supply to the transformer as well as the load. If there is any interruption in the power supply, the supply to the transformer is not available and the relay de-energises. Thus, once the supply is interrupted even for a brief period, the relay is de-energised and you have to press switch S1 momentarily (when the supply resumes) to make it available to the load. Very-short-duration (say, 1 to 5 milliseconds) interruptions or fluctuations will not affect the circuit because of presence of largevalue capacitor which has to discharge via the relay coil. Thus the circuit provides suitable P safety against erratic power supply N conditions.
H

ELECTRONICS PROJECTS Vol. 21

155

CIRCUIT IDEAS

PULSE GENERATOR
A. JEYABAL

I VED DWI . C . S

T

his circuit is very useful while checking/operating counters, stepping relays, etc. It avoids the procedure of setting a switch for the required number of pulses. By pressing appropriate switches S1 to S9, one can get 1 to 9 negative-going clock pulses, respectively. Schmitt trigger NAND gate N1 of IC2, resistor R1, and capacitor C1 are wired to produce clock pulses. These pulses are taken out through NAND gate N3 that is controlled by decade counter CD4017 (IC1). Initially no switch from S1 to S9 is

depressed and the LED is glowing. As pins 5 and 6 of NAND gate N2 are pulled up by resistor R3, its output pin 4 goes low. This disables NAND gate N3 to take its output pin 10 to high state, and no pulse is available. IC1 is a decade counter whose Q outputs normally remain low. When clock pulses are applied, its Q outputs go high successively, i.e. Q0 shifts to Q1, Q1 shifts to Q2, Q3 shifts to Q4, and so on. If any one of switches S1 through S9, say, S5 (for five pulses), is momentarily depressed, pins 5 and 6 of NAND gate N2 go low, making its output pin 4 high, which

fully charges capacitor C2 via diode D. At the same time, this high output of N2 enables NAND gate N3 and clock pulses come out through pin 10. These are the required number of pulses used to check our device. The clock pulses are fed to clock-enable pin 13 of IC1, which starts counting. As soon as output pin 1 (Q5) of IC1 turns high, input pins 5 and 6 of NAND gate N2 will also become high via switch S5 because high-frequency clock allowed five pulses during momentary pressing. This high input of N2 provides low output at pin 4 to disable NAND gate N3 and finally no pulse will be available to advance counter IC1. Before the next usage, counter IC1 must be in the standby state, i.e. Q0 output must be in the high state. To do this, a time-delay pulse generator wired around NAND gate N4, resister R4, diode D, capacitor C2, and differentiator circuit comprising C3 and R5 is used. When output pin 4 of NAND gate N2 is low, it discharges capacitor C2 slowly through resistor R4. When the voltage across capacitor C2 goes below the lower trip point, output pin 11 of NAND gate N4 turns high and a high-going sharp pulse is produced at the junction of capacitor C3 and resistor R5. This sharp pulse resets counter IC1 and its Q0 output (pin 3) goes high. This is represented by the glowing of LED. Ensure the red LED is glowing before proceeding to get the next pulse. Press any of the switches momentarily and the LED will glow. If the switch is kept pressed, the counter counts continuously and you cannot get the exact number of pulses. This circuit costs around Rs 70.

JUNE 2003

ELECTRONICS FOR YOU

CIRCUIT IDEAS

QUALITY FM TRANSMITTER
TAPAN KUMAR MAHARANA

SUN

IL KU

MAR

his FM transmitter for your stereo or any other amplifier provides a good signal strength up to a distance of 500 metres with a power output of about 200 mW. It works off a 9V battery. The audio-frequency modulation stage is built around transistor BF494 (T1), which is wired as a VHF oscillator and modulates the audio signal present at the base. Using preset VR1, you can adjust the audio signal level. The VHF frequency is decided by coil L1 and variable capacitor VC1. Reduce the value of VR2 to have a greater power output. The next stage is built around transistor BC548 (T2), which serves as a Class-A power amplifier. This stage is inductively coupled to the audio-frequency modulation stage. The antenna matching network consists of variable capacitor VC2 and capacitor C9. Adjust VC2 for the maximum transmission of power or signal strength at the receiver.

T

For frequency stability, use a regulated DC power supply and house the transmitter inside a metallic cabinet. For higher antenna gain, use a telescopic antenna in place of the simple wire. Coils L1 and L2

L1: 5 turns of 24 SWG wire closely wound over a 5mm dia. air core L2: 2 turns of 24 SWG wire closely wound over the 5mm dia. air core L3: 7 turns of 24 SWG wire closely

are to be wound over the same air core such that windings for coil L2 start from the end point for coil L1. Coil winding details are given below:

wound over a 4mm dia. air core L4: 5 turns of 28 SWG wire on an intermediate-frequency transmitter (IFT) ferrite core

AUGUST 2004

ELECTRONICS FOR YOU

RAMP CONTROLLED LIGHT

T

he circuit described here can be used for controlling a decorative lamp from zero intensity to maximum intensity in a specified time. Typical applications are for controlling Christmas lamps and serial lampsets etc. The brightness of the lamps is controlled by a continuously running ramp voltage generated by a timer. The circuit features a triac (BT136) controlled by pulses from a UJT (unijunction transistor) relaxation oscillator. Pedestal voltage control is employed for controlling the firing angle. Pedestal voltage is derived from a ramp generator which sets the time period of intensity control. X1 secondary (sec. 2) provides the power supply for the ramp generator section. The 555 timer circuit is configured as astable multivibrator which provides rectangular pulses having required time period which are converted to a positive going ramp by sweep generator transistor T1. This is coupled to the base of transistor T2. The time period of control can be altered by modifying the sweep generator and 555 timer sections. X1 is a step-down transformer having two secondaries. Any centre-tapped

step-down transformer will serve the purpose. However, it is advisable to have a higher voltage rating (9V or 12V) for X1 secondary (sec. 1) for extended control range. Zener diode D12 generates the required trapezoidal waveform for the UJT oscillator from the bridge rectifier output.

Transistor T2 controls the charging time of capacitor C5, thus providing the pedestal voltage control. The pulses generated by the UJT oscillator are coupled to the gate of triac through a pulse transformer (X2). A ferrite core transformer with 1:1 ratio can also be used for X2.

ELECTRONICS PROJECTS Vol. 19

177

CIRCUIT IDEAS

REMOTE-OPERATED MUSICAL BELL
PRADEEP G.

EDI DWIV S.C.

his infrared lightcontrolled 12-tone musical bell can be operated using any TV remote control. It can be operated from up to 10 metres, provided the remote control is directed towards the sensor. The circuit uses the popular 3-lead IR sensor TK1836 to trigger musical bell built around IC UM3481(IC1). (You can also use IC UM3482, UM3483, or UM3484 in place of IC UM3481.) The sensor responds only to 36 kHz. Most TV remote controls transmit this frequency. When any button on the TV remote control is pressed, the sensor’s output

T

pulses low. Transistor T1 conducts to apply a triggering pulse to IC1 at its pin 4. After playing one musical tone, the circuit automatically resets. If you again press any of the remote’s buttons, another music is

heard. This way, twelve different musical tones can be generated. The circuit works off a 5V power supply. Regulator IC 7805, powered from a 912V DC source, provides regulated 5V.

ELECTRONICS FOR YOU

OCTOBER 2003

RUNNING MESSAGE DISPLAY

L

ight emitting diodes are advantageous due to their smaller size, low current consumption and catchy colours they emit. Here is a running message display circuit wherein the letters formed by LED arrangement light up progressively. Once all the letters of the message have been lit up, the circuit gets reset. The circuit is built around Johnson decade counter CD4017BC (IC2). One of the IC CD4017BE’s features is its provision of ten fully decoded outputs, making

clock pulse. The timer NE555 (IC1) is wired as a 1Hz astable multivibrator which clocks the IC2 for sequencing operations. On reset, output pin 3 goes high and drives transistor T7 to ‘on’ state. The output of transistor T7 is connected to letter ‘W’ of the LED word array (all LEDs of a letter array are connected in parallel) and thus letter ‘W’ is illuminated. On arrival of first clock pulse, pin 3 goes low and pin 2 goes high. Transistor T6 conducts and letter ‘E’ lights up. The preceding letter ‘W’

the complete word becomes visible. On the following clock pulse, pin 6 goes to logic 1 and resets the circuit, and the sequence repeats itself. The frequency of sequencing operations is controlled with the help of potmeter VR1. The display can be fixed on a veroboard of suitable size and connected to ground of a common supply (of 6V to 9V) while the anodes of LEDs are to be connected to emitters of transistors T1 through T7 as shown in the circuit. The above circuit is very versatile and

the IC ideal for use in a whole range of sequencing operations. In the circuit only one of the outputs remains high and the other outputs switch to high state successively on the arrival of each

also remains lighted because of forward biasing of transistor T7 via diode D21. In a similar fashion, on the arrival of each successive pulse, the other letters of the display are also illuminated and finally

can be wired with a large number of LEDs to make an LED fashion jewellery of any design. With two circuits connected in a similar manner, multiplexing of LEDs can be done to give a moving display effect.

ELECTRONICS PROJECTS Vol. 20

CIRCUIT

IDEAS

SECRET BELL
D. MOHAN KUMAR any people move through the corridors and steps in multistoried buildings. As most of them are strangers for the inhabitants of the flats, it becomes necessary to verify the identity of the visitor before opening the door as he can be a burglar. This circuit helps you identify the members of your family. It is basically

UMAR SUNIL K

M

a switchless musical bell that activates with a single puff of breath. The condenser mic fitted inside the existing door-bell switch box will trigger the bell on detecting air-pressure changes following the breath. As only the members of your family know the secret of the bell and hence puff out before the hole for the switch box, the door can be opened without fear. The front end of the circuit is a condenser mic amplifier with fixed sensi-

Fig. 1: Secret bell circuit

tivity. Transistor T1 amplifies the signal received from the condenser mic through capacitor C1. When transistor T1 conducts, a short negative pulse triggers the monostable wired around IC1. The monostable time is decided by resistor R7 and capacitor C5. Reset pin 4 of IC1 is made stable by R6 and C3. Resistor R5 acts as a pull-up Fig. 2: Pin configuration resistor for trigof UM66 and BC548/549 ger pin 2 of IC1 to keep the trigger pin high in the standby mode. The high output from IC1 is used to power IC UM66 (IC2). IC2 generates a soft melody on receiving 3 volts at pin 2. Transistor T2 amplifies the music notes. A zener diode maintains the power for IC2 at a safer level of 3 volts. Assemble the circuit on any general-purpose PCB and enclose in a suitable cabinet. The condenser mic should be connected to the circuit using a single-core shielded wire to reduce noise interference. Drill a 1mm hole in the cover of the existing bell switch box and fix the mic inside the box with adhesive. The front side of the mic should face the hole.

94 • DECEMBER 2006 • ELECTRONICS FOR YOU

WWW.EFYMAG.COM

SENSITIVE TEMPERATURE SWITCH

T

his temperature switch has a high sensitivity and is quite reliable. Here, in place of a single transistor, a Darlington pair has been used for switching. At normal room temperature germinum diode D1 (0A79 or equivalent) has a back resistance value of about 10 kiloohms. As a result Darlington pair, comprising transistors T1 and T2. conducts and keeps the anode terminal of diode D2 at ground potential. Consequently, transistor T3 does not get base bias and thus relay RL1 is not activated. But when temperature increases. the back resistance of diode D1 decreases

sharply, which results in cutting off of Darlington pair and forward biasing of transistor T3 via resistor R2 and diode D2. As a result, relay RL1 energises and switches on the alarm. Potmeter VR1 may be adjusted for required sensitivity. This simple circuit can be used as an overheat indicator, fire alarm, or it can be used in a constant temperature circuit for switching on a fan etc. The circuit can be easily assembled on a piece of veroboard. Diode

sensor D1 must be of germanium type and not silicon.

ELECTRONICS PROJECTS Vol. 19

189

CIRCUIT

IDEAS

SHADOW ALARM

EO SANI TH

D. MOHAN KUMAR

his opto-sensitive circuit sounds an alarm whenever a shadow falls on it. So it can be used at night by shopkeepers to protect the valuables in their showrooms. A dim lighting in the room is necessary to detect the moving shadow. Unlike opto-interruption alarms based on light-dependent resistors (LDRs), it does not require an aligned light beam to illuminate the photo-sensor.

T

The non-inverting input of IC1 gets a controlled voltage from potential divider R2 and VR1. In the presence of ambient light, the phototransistor conducts and the inverting input (pin 2) of IC1 gets a lower voltage than its non-inverting input (pin 3). This makes the output of IC1 high, which is indicated by the glowing of LED1. When a shadow falls on the photosensor, the output of IC1 goes low. This low pulse triggers the monostable

and zener diode ZD1 provide 3.1V DC to IC UM3561. The circuit is easy to assemble as it requires only a few low-cost components. Enclose it in a cabinet with the photo-sensor inside. Drill a 5mm hole on the front panel of the cabinet to let ambient light fall on the photosensor. Adjust potmeter VR1 (47k) until LED2 stops glowing and the buzzer stops beeping while LED1 glows. This is the position of VR1 to be main-

The circuit is powered by a 9V PP3 battery and uses the most sensitive photo-sensor L14F1 to detect shadows. It is portable and can be used at any place that is to be monitored. Op-amp µA741 (IC1) is used as a voltage comparator. Its inverting input is biased by the voltage obtained from the junction of 100k resistor R1 and the collector of phototransistor T1.

(IC2) designed for a delay of 51 seconds using R6 and C3. The output of IC2 is used to light up LED2 and activate the alarm. Slide switch S2 is used to select either the buzzer or siren. When it is towards left the buzzer beeps, and when it is towards right IC UM3561 (IC3) activates to give a loud alarm simulating a police siren. Resistor R8

tained for that particular intensity of light. LED1 will continue to glow even when a shadow is detected. The circuit is now ready to use. To test it, move a paper in front of the unit. If LED2 glows along with the beep of the buzzer, it means that the photo-sensor has detected a shadow.

100 • JANUARY 2006 • ELECTRONICS FOR YOU

WWW.EFYMAG.COM

SHORT WAVE AM TRANSMITTER
RAJESH KAMBOJ

T

he main feature of this transmitter is that it is free from the LC (inductor, capacitor) tuned circuit and operates on a fixed frequency of 12 MHz which is extremely stable. An LC based tuned circuit is inherently unstable due to drift of resonant frequency on account of temperature and humidity variations. The circuit is very simple and uses only a few components. The figure shows the complete circuit diagram of the transmitter. Resistors R1 and R2 are used for DC biasing of transistor T1. The capacitor C1 provides coupling between the condenser microphone and the base of transistor T1. Similarly, resistors R3, R4 and R5 provide DC biasing to transistor T2. The oscillator section is a combination of transistor T2, crystal XTAL, capacitor C2, C3 and resistors R3, R4 and R5. The crystal is excited by a portion of energy from the collector of transistor T2 through the feedback capacitor C2. The crystal vibrates at its fundamental frequency and the oscillations occurring due to the crystal are applied to the base of transistor T2 across resistor R4. In this way, continuous undamped oscillations are obtained. Any crystal having

the frequency in short wave range can be substituted in this circuit, although the operation was tested with a 12 MHz crystal. Transistor T1 serves three functions: 1. It provides the DC path for extending +VCC supply to transistor T2. 2. It amplifies the audio signals obtained from condenser microphone. 3. It injects the audio signal into the high frequency carrier signal for modulation. The condenser microphone converts the voice message into the electrical signal which is amplified by transistor T1. This amplified audio signal modulates the carrier frequency generated by transistor T2. The amplitude modulated output is obtained at the collector of transistor T2 and is transmitted by a

loop antenna into space in the form of electromagnetic waves. The antenna can be tuned to a particular frequency varying trimmer C5 and also by changing the length of ferrite rod into the coil. The transmitted signals can be received on any short wave receiver without distortion and noise. The range of this transmitter is 25 to 30 metres and can be extended further if the length of the antenna wire is suitably increased along with proper matching.

ELECTRONICS PROJECTS Vol. 19

179

SHORTWAVE TRANSMITTER

T

his transmitter circuit operates in shortwave HF band (6 MHz to 15 MHz), and can be used for shortrange communication and for educational purposes.

capacitance of gang condenser, the frequency of oscillation can be changed. The carrier RF signal from the oscillator is inductively coupled through the secondary of transformer X1 to the next RF am-

be directly connected to its input without any amplification. The transmitter’s stability is governed by the quality of the tuned circuit components as well as the degree of regu-

The circuit consists of a mic amplifier, a variable frequency oscillator, and modulation amplifier stages. Transistor T1 (BF195) is used as a simple RF oscillator. Resistors R6 and R7 determine base bias, while resistor R9 is used for stability. Feedback is provided by 150pF capacitor C11 to sustain oscillations. The primary of shortwave oscillator coil and variable condenser VC1 (365pF, 1/2J gang) form the frequency determining network. By varying the coil inductance or the

plifier-cum-modulation stage built around transistor T2 that is operated in class ‘A’ mode. Audio signal from the audio amplifier built around IC BEL1895 is coupled to the emitter of transistor 2N2222 (T2) for RF modulation. IC BEL1895 is a monolithic audio power amplifier designed for sensitive AM radio applications. It can deliver 1W power to 4 ohms at 9V power supply, with low distortion and noise characteristics. Since the amplifier’s voltage gain is of the order of 600, the signal from condenser mic can

lation of the supply voltage. A 9V regulated power supply is required. RF output to the aerial contains harmonics, because transistor T2 doesn’t have tuned coil in its collector circuit. However, for short-range communication, this does not create any problem. The harmonic content of the output may be reduced by means of a high-Q L-C filter or resonant L-C traps tuned to each of the prominent harmonics. The power output of this transmitter is about 100 milliwatts.

134

ELECTRONICS PROJECTS Vol. 23

SIMPLE ELECTRONIC CODE LOCK
he circuit diagram of a simple electronic code lock is shown in figure. 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 capacitor 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 pressing the push-to-on switch S1 momentarily. On pressing switch S1, the high state shifts from Q1 to Q2. Now, to change the high state from Q2 to Q3, apply another positive pulse at pin 14, which is possible only by pressing switch S2. Similarly, the high state can be shifted up to the tenth output (Q10) by pressing the switches S1 through S9 sequentially in that order. When Q10 (pin 11) is high, transistor T1 conducts and energises relay RL1. The relay can be used to switch ‘on’ power to any electrical appliance. Diodes D1 through D9 are provided to prevent damage/malfunctioning of the IC when two switches corresponding to ‘high’ and ‘low’ output terminals are pressed simultaneously. Capacitor C2 and resistor R3 are provided to prevent noise during switching action. Switch S10 is used to reset the circuit manually. Switches S1 to S10

T

can be mounted on a keyboard panel, and any number or letter can be used to mark them. Switch S10 is also placed together with other switches so that any stranger trying to operate the lock frequently presses the switch S10, thereby resetting the circuit many times. Thus, he is never able to turn the relay ‘on’. If necessary, two or three switches can

be connected in parallel with S10 and placed on the keyboard panel for more safety. A 12V power supply is used for the circuit. The circuit is very simple and can be easily assembled on a general-purpose PCB. The code number can be easily changed by changing the connections to switches (S1 to S9).

ELECTRONICS PROJECTS Vol. 21

169

CIRCUIT

IDEAS

SIMPLE SHORT-WAVE TRANSMITTER
PRINCE PHILLIPS his low-cost short-wave transmitter is tunable from 10 to 15 MHz with the help of ½J gang condenser VC1, which determines the carrier frequency of the transmitter in conjunction with inductor L1. The frequency trimming can be done with VC2. The carrier is amplified by transistor T4 and coupled to RF amplifier transistor T1 (BD677) through transformer X1*. The transmitter does not use any modulator transformer. The audio output from condenser MIC is preamplified by transistor T3 (BC548). The audio output from T3 is further amplified by transistor T2 (BD139), which modulates the RF amplifier built around transistor T1 by varying the current through it in accordance with the audio signal’s amplitude. RFC1 is used to block the carrier RF signal from transistor T2 and the power supply. The modulated RF is coupled to the antenna via capacitor C9. For antenna, one can use a 0.5m long telescopic aerial. Details of RF choke, inductor L1 and coupling

IVEDI S.C. DW

T

Fig. 1: Simple shortwave transmitter

Fig. 2: Pin configurations of BD139, BD677 and BC548

transformer are given in the figure. EFY Lab. During testing, in place of coupling

transformer X1, we used a readymade short-wave antenna coil with tuning slug (Jawahar make), which worked satisfactorily. We tested the transmitter reception up to 75 metres and found good signal strength.

WWW.EFYMAG.COM

ELECTRONICS FOR YOU • APRIL 2006 • 95

SMART PHONE LIGHT
T he circuit shown here is used to switch on a lamp when the telephone rings, provided that the ambient light is insufficient. in the ambient light and greather than 100 kilo-ohms in darkness, is at the heart of the circuit. The circuit is fully isolated from the power failure or load shedding also. The light switches off automatically after a programmable time period. If required, the lamp lighting period can

The circuit can be implemented using just two ICs. A light dependent resistance (LDR), with about 5 kilo-ohms resistance
ELECTRONICS PROJECTS Vol. 20

phone lines and it draws current only when the phone rings. The lamp can be battery powered to provide light during

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

the DC voltage present at the collector of transistor of the opto-coupler is normally low and it jumps to 5V when there is no light or insufficient light. The 74LS123 retriggerable monostable multivibrator IC is used to generate a programmable pulse-width. The first monostable 74LS123(A) generates a pulse from the trigger input available during ringing, provided its pin 2 input (marked B) is logic high (i.e. during darkness). It remains high for

the programmed duration and switches back to 0V at the end of the pulse period. This high-to-low transition (trailing edge) is used to trigger the second monostable flip-flop 74LS123(B) in the same package. Output of the second monostable is used to control a relay. The lamp being controlled via the N/O contacts of the relay gets switched ‘on.’ The ‘on’ period can be extended by simply pressing pushbutton switch S1. If

nobody attends the phone, the light turns off automatically after the specific time period equal to the pulse-width of the second flip-flop. The light sensitivity of LDR can be changed by changing resistance R3 connected at collector of the transistor in light monitor circuit. Similarly, switch-on period of the lamp can be controlled by changing capacitor C3’s value in the second 74123(B) monostable circuit.

ELECTRONICS PROJECTS Vol. 20

FTWARE S O F TS O W A R E

SECTION

S E C T I O N
Here, the number 128 gives the size of the key in bits. This key size gives a key space (total number of combinations of bits in the key) of 3.4 x 1038 keys, which makes the ‘Brute force attack’ impractical. Higher the key size, tougher it is to crack the ciphertext. In IDEA, eight rounds or iterations of data manipulation are done to generate the final output. The manipulations may consist of one or a combination of the following three operations: Bit-by-Bit exclusive-ORing Addition of integers modulo 216 Multiplication of integers modulo 216 The expression ‘x mod y’ gives the remainder when x is divided by y. The value of y is referred to as the modulus of the expression; for example, 10 mod 3 = 1. The use of these manipulations in a sequential order produces a complex transformation of the input data, making crypt analysis difficult.

CRYPTOGRAPHY
S. SUNDAR
ews item in ‘The Times of India’, Mumbai, on June 27, 1999: “The Indian Institute of Technology, Kanpur, has developed a new-generation cipher code for the Indian navy. The breakthrough would provide a technological edge to defence communication. Christened ‘Trinetra’, the cipher is a modern computer-based code language system which can digitise long, alphabetic messages within seconds.” This article is about cryptography— the science of scrambling data to make it unintelligible to all, except the intended person. It has come to focus recently due to the expanding influence of e-commerce. Almost all the credit card transactions taking place on the Internet or elsewhere make use of cryptography. This concept is also used in ‘secure server’ transactions, where the data is guarded by the use of cryptography. Some of the terms used in this article are explained below: Plaintext is the text or data that is to be encrypted. It is one of the inputs to the encryption algorithm. Key is the password used to decrypt the coded message. Ciphertext is the output of the encryption algorithm. It can be transmitted safely as it is unintelligible without the key. One of the earliest known and simplest methods of encryption is the ‘Caesar Cipher’ method, which involves replacement of each letter in the message with some other letter or numeral. The principle of ‘bit replacement technique’ is

N

that a letter may be replaced by another letter three places (offset or key) down the order; for example, the letter ‘a’ will become ‘d’, and so on. Here, lesser number of keys are possible. Also, the encryption and decryption algorithms are known and the language is understood easily. Because of these factors, an advanced computer using either

Fig. 2: Public-key encryption

parallel processing or distributed computing can crack this method. This type of cracking is termed as ‘Brute Force Attack’ in computer parlance. International Data Encryption Algorithm (IDEA) and Data Encryption Standard (DES) are two algorithms that use the bit-replacement technique explained above. These algorithms, along with compression, are used to send secure e-mail using software programs like PGP (Pretty Good Privacy)—the present standard for encrypted mail. In PGP, the public-key encryption explained in the later part of the article is also used.

Data encryption standard (DES)
In DES, the plaintext ought to be of 64 bits and the key of 56 bits. Longer blocks of plaintext are encrypted in 64-bit blocks. Each block of 64-bit input is passed through 16 iterations, with each iteration producing an intermediate 64-bit value. The iteration is essentially the same complex function that involves a permutation of bits and substitution of one bit pattern by another. A variation of DES, the ‘Triple DES’ that uses two keys and three executions of the algorithm, has gained considerable success. Triple DES employs an encrypt-decrypt-encrypt sequence. There is no cryptographic significance to the use of decryption for the second stage. It only allows users of triple DES to decrypt data encoded by users of the older single DES.

International data encryption algorithm (IDEA)
The Swiss Federal Institute of Technology developed IDEA in 1990. This method uses a 128-bit key; only the powers of two are used as key-size. If the key is too large, the computations involved in encryption and decryption make the working of the algorithm slower; and if it is too small, the algorithm becomes insecure. As with any other bit replacement scheme, there are two inputs, namely, the plain text and the key.
ELECTRONICS FOR YOU T MAY 2000

Public-key encryption
Another commonly used method for encryption is the public-private key encryption. This method uses two passwords, one termed as public key and the other private key. The algorithms used to generate keys are based on mathematical numbers generated by the computer on user’s request, instead of simple bit operations. An analogy of public-key encryption is

Fig. 1: Triple DES 76

SOFTWARE

SECTION

safe with a special type of lock that can be locked/unlocked with one or two different keys. A left key turns the mechanism to the left and a right key turns it to the right. In the unlocked state, the mechanism is in the centre position. If locked with the right key, the only way to unlock it is by using the left key and vice-versa. If ‘A’ wants to send a message to ‘B’, he/she can put the message in the box and lock it

How to distribute the secret key was the most difficult problem for conventional encryption. This problem is eliminated by the public-key encryption, considering that private key is never distributed.

RSA
Ron Rivest, Adi Shamir, and Len Adleman at MIT (Massachusetts Institute of Technology) developed one of the first public-key schemes in 1977. The RSA scheme then reigned supreme as the only widely accepted and implemented approach to public-key encryption. RSA is a cipher in which the plaintext and the ciphertext are integers between 0 and ‘n-1’, for some valued ‘n’. For a long message, the message is broken into blocks. These blocks are log2n bits long. Two high-value prime numbers are multiplied to get ‘n’ so that extracting the value of ‘n’ becomes very difficult. As the public and private keys are dependent on the value of ‘n’, guessing this value is very difficult. Encryption and decryption make use of modular arithmetic. The RSA algorithm for plaintext block M and ciphertext block C with keys ‘e’ and ‘d’ is given below: Key generation Select p,q p and q are both prime Calculate n = p x q Calculate f(n) = (p-1)(q-1) Select integer e gcd(f(n),e)=1; 1<e<f(n) Calculate d d=e-1 mod f (n) Public Key KU = {e,n} Private Key KR = {d,n} Encryption Plaintext: M<n Ciphertext: C = Me (mod n) Decryption Ciphertext: C Plaintext: M = Cd (mod n) The RSA Algorithm C = Me mod n M = Cd mod n = (Me)d mod n = Med mod n Both sender and receiver must know the value of ‘n’ and ‘e’; whereas the value of d is known only to the receiver. Thus, this is a public-key encryption algorithm in which the public key is {e,n} and the private key is {d,n}. For public-key encryption, this algorithm will be satisfactory if the following conditions are fulELECTRONICS FOR YOU T MAY 2000

Fig. 3: Example of RSA algorithm

with the right key. On receiving the message, ‘B’ can unlock the box using the corresponding left key and read the message. The lock will open only when a particular key combination is used. Suppose a group of people wants to share messages using this method. Then everyone in the group buys one’s own safe box and freely supplies the respective right key duplicates but keeps one’s left keys to oneselves. For communication, one can just write the message, put it in the safe, lock it using the right key of the recipient, and pass it to the recipient who uses one’s own left key to unlock it. Thus, the message can be transmitted safely, since apart from the intended recipient no one else would be having the correct left key. A similar technique is used in publickey encryption. In place of a right key, a public key is used while encrypting and, in place of a left key, a private key is used for decrypting. Once a key is lost, the data encrypted using the particular key can’t be recovered. So backup copies of all the keys used must be kept necessarily. Furthermore, these algorithms have the following important characteristics: • It is computationally unfeasible to determine the decryption key with the knowledge of the cryptography and the encryption key. • Either of the two related keys can be used for encryption. With conventional encryption (bit replacement technique as opposed to public-key encryption), a fundamental requirement for two parties to communicate securely was to share a secret key.

filled: • Values of e, d, and n exist such that M = Med mod n, for all M < n. • It should be relatively easy to calculate Me and Cd for all values of M < n. • It should be unfeasible to determine d, even if the values of e and n are known. The third condition would be satisfied only for large values of e and n. Another method, the Secure Hash Function (developed by Ron Rivest, ‘R’ of RSA), is based on public-key encryption. With the advent of Internet, intense research is going on in this field, using diverse technologies which employ distributed networking and the use of the inherently present noise in transmission channel to encrypt data. The five steps involved in this algorithm are detailed below: Step 1: Append padding bits. The message is padded such that the length of the padded message is 64 bits less than an integer multiple of 512 bits. Padding is necessarily done even if the message is already of desired length; for example, even a message of 448 (512-64) bits is made to 960 (512x2-64) bits by padding 512 bits to it. Thus, the number of padding bits lies between 1 and 512. The padding consists of a single -1- bit followed by the necessary number of -0- bits. Step 2: Append length. A 64-bit representation of the length in bits of the original message (before padding) is appended to the result of Step 1. The outcome is a message which is an integer multiple of 512 bits in length. The message is represented in blocks of 512 bits Y0,Y1,Y2,...,YL-1,... So, the total length of the expanded message is L x 512. Step 3: Initialise MD buffer. A 128bit buffer is used to hold intermediate and final results of the hash function. The buffer can be represented as four 32-bit registers (A, B, C, and D). These registers are initialised to the following hexadecimal values: A = 01234567 B = 89ABCDEF C = FEDCBA98 D = 76543210 Step 4: Process message in 512-bit blocks. The heart of the algorithm is the module that consists of four rounds of processing. These rounds may have a similar structure, but each may use a different primitive logical function, like AND, OR, etc. Step 5: Output. After all L 512-bit blocks have been processed, the output
77

SOFTWARE

SECTION

from the Lth stage is the 128-bit message digest. Starting from the simple bit-replacement technique to computer-based code language systems, the science of cryptog-

raphy has indeed come a long way. The Indian system of ‘Trinetra’ can even digitise and encode the voice of a sender. Cryptographers have come up with various schemes considered to be virtually un-

breakable, only to find out later that they were not so. And thus, public-key encryption remains the standard for secure encryption till date.

MORSE TUTOR
YUJIN BOBY
orse tutor is a program written in C++. It can be used for learning or sending Morse code. Morse code uses long (dash) and short (dot) sounds to communicate. The dot is the basic unit and the dash is equal to the length of three dots.

M

Morse code was developed by Samual Morse in 1897. Due to advantages like overriding noise, static and simple transmitter, and low power requirements, it is still used for communication. The program provides character mode, line mode, and file mode of operations. In

character mode, separate characters can be practiced. In file mode, stored messages can be sent. This mode also has provision for creating a new message file. The speed can be set between 5 WPM (words per minute) and 20 WPM, and the tone can be varied betwen 100 Hz and 4,000 Hz using the program. The default speed is 12 WPM and the tone is 700 Hz.

Program Listing in C++
#include<iostream.h> #include<conio.h> #include<dos.h> #include<stdio.h> #include<string.h> #include<stdlib.h> #include<ctype.h> void morse() ; int mnu_one(); void mode_line() ; void mode_file() ; void mode_sett() ; void mode_char() ; char in ; int FREQ=700; // default tone 700 Hz int DOT=50; // default speed 12 wpm void main() { int choice ; while (1) { choice=mnu_one() ; if (choice==1) mode_char() ; else if( choice==2 ) mode_line () ; else if(choice==3) mode_file () ; else if(choice==4) mode_sett () ; else if(choice==5) break ; } clrscr() ; cout<<endl<<“Thank you for using” ; highvideo() ; cprintf(“MORSE TUTOR”) ; normvideo() ; cout<<endl<<“ 73 & Good Bye...” ; cout<<endl<<“de” ; cout<<endl<<“\t\tYUJIN BOBY, Radio VU3PRX” ; cout<<endl<<“\t\tKoilparambil, Arthinkal” ; cout<<endl<<“\t\tKerala, PIN - 688 530” ; cout<<endl<<endl ; } void morse () { char code [8] ; switch (toupper(in)) { case ‘A’ : strcpy (code, “.-”) ; break; case ‘B’ case ‘C’ case ‘D’ case ‘E’ case ‘F’ case ‘G’ case ‘H’ case ‘I’ case ‘J’ case ‘K’ case ‘L’ case ‘M’ case ‘N’ case ‘O’ case ‘P’ case ‘Q’ case ‘R’ case ‘S’ case ‘T’ case ‘U’ case ‘V’ case ‘W’ case ‘X’ case ‘Y’ case ‘Z’ case ‘1’ case ‘2’ case ‘3’ case ‘4’ case ‘5’ case ‘6’ case ‘7’ case ‘8’ case ‘9’ case ‘0’ case ‘-’ case ‘?’ case ‘(‘ case ‘)’ case ‘.’ case ‘=’ case ‘/’ case ‘+’ case ‘:’ case ‘,’ default: : strcpy (code, “-...”) ; break; : strcpy (code, “-.-.”) ; break; : strcpy (code, “-..”) ; break; : strcpy (code, “.”) ; break; : strcpy (code, “ ..-.”) ; break; : strcpy(code,“—.”) ; break; : strcpy(code,“....”) ; break; : strcpy(code,“..”) ; break; : strcpy(code,“.—”) ; break; : strcpy(code,“-.-”) ; break; : strcpy(code,“.-..”) ; break; : strcpy(code,“—”) ; break; : strcpy(code,“-.”) ; break; : strcpy(code,“—”) ; break; : strcpy(code,“.—.”) ; break; : strcpy(code,“—.-”) ; break; : strcpy(code,“.-.”) ; break; : strcpy(code,“...”) ; break; : strcpy(code,“-”) ; break; : strcpy(code,“..-”) ; break; : strcpy(code,“...-”) ; break; : strcpy(code,“.—”) ; break; : strcpy(code,“-..-”) ; break; : strcpy(code,“-.—”) ; break; : strcpy(code,“—..”) ; break; : strcpy(code,“.——”) ; break; : strcpy(code,“..—”) ; break; : strcpy(code,“...—”) ; break; : strcpy(code,“....-”) ; break; : strcpy(code,“.....”) ; break; : strcpy(code,“-....”) ; break; : strcpy(code,“—...”) ; break; : strcpy(code,“—..”) ; break; : strcpy (code,“——.”) ; break; : strcpy(code,“——”) ; break; : strcpy(code,“-....-”) ; break; : strcpy(code,“..—..”) ; break; : strcpy(code,“-.—.”) ; break; : strcpy(code,“-.—.-”) ; break; : strcpy(code,“.-.-.-”) ; break; : strcpy(code,“-...-”) ; break; : strcpy(code,“-..-.”) ; break; : strcpy(code,“.-.-.”) ; break; : strcpy(code,“—...”) ; break; : strcpy(code,“—..—”) ; break; cout<<endl<<“MSG-Switch::Invalid
ELECTRONICS FOR YOU T MAY 2000

character \”; cout<<in<<“\”<<endl; break; } int len=strlen(code) ; for (int i=0; i<len; i++) { sound (FREQ) ; if(code [i]==‘.’) delay(DOT) ; else if(code[i]==‘-’) delay(3*DOT) ; nosound() ; delay (DOT) ; } delay (3*DOT) ; } int mnu_one() { int ch; clrscr() ; gotoxy(30,7) ; cout<<“MORSE CODE TUTOR”; gotoxy(30,8) ; cout<<“~~~~~~~~~~~~~~~~” ; gotoxy(33,9) ; cout<<“l. CHARACTER MODE”; gotoxy(33,10) ; cout<<“2. LINE MODE” ; gotoxy(33,11) ; cout<<“3. FILE MODE” ; gotoxy(33,12) ; cout<<“4. SETTINGS” ; gotoxy(33,13) ; cout<<“5. EXIT” ; gotoxy(30,15) ; cout<<“Enter your choice : ” ; gotoxy(25,19) ; cout<<“A Freeware From VU3PRX” ; gotoxy(50,15) ; cin>>ch ; return ch ; } void mode_line() { int flag=1; char line[80] ; clrscr() ; cout<<“LINE MODE”<<endl ; cout<<“Type ‘*’ to END sending”<<endl ; while(flag) { gets(line) ; int len=strlen(line) ; for (int i=0; i<len; i++) { in=line[i] ; if(in==‘ ’) { delay (6*DOT) ; continue ; } else if(in==‘*’) { flag=0; break; }

78

SOFTWARE

SECTION

morse() ; } } } void mode_file() { FILE *fp ; char fname[10] ; clrscr() ; cout<<“Enter file name : ”; cin>> fname; if ((fp=fopen(fname,“r”)) !=NULL) { while((in=getc(fp)) !=EOF) { if (in==’ ‘) { delay(6*DOT); continue; } morse() ; } } else { char ans ; cout<<endl<<“File not found, Create New (Y/N) ? ” ; cin>>ans ; if((ans==‘y’) || (ans==’Y’)) if((fp=fopen(fname,“w”)) !=NULL) while((ans=getchar() ) !=‘\n’) putc(ans, fp) ; } fclose(fp) ; }

void mode_sett() ; void mode_sett() { int cho ; clrscr() ; cout<<“l. CHANGE FREQUENCY”<<endl ; cout<<“2. CHANGE SPEED”<<endl ; cout<<endl<<“Enter your choice : ” ; cin>>cho ; if(cho==1) { cout<<endl<<“Current Frequency of tone is” <<FREQ<<“Hz”<<endl ; cout<<“The valid frequency range is from 100 Hz to 4000 Hz” ; cout<<endl<<endl<<“Enter the new frequency : ” ; int tmp ; cin>>tmp ; cout<<endl<<endl; if ( (tmp>99) && (tmp<4001) ) { FREQ=tmp ; cout<<“Now the Frequency is changed to” <<FREQ<<“Hz”<<endl; } else cout<<“Error : Invalid frequency range” ; getch() ; } if(cho==2) { int speed ; speed=36000/(DOT*60) ;

cout<<“\nCurrent speed is ”<<speed<< “ Words/Minute”<<endl ; cout<<“The valid Speed is from 5 WPM to 20 WPM ”<<endl ; cout<<“\n\nEnter new speed : ” ; cin>>speed ; if((speed>4) && (speed<21)) { DOT=36000/ (speed*60) ; cout<<“\n\nNow the speed is ”<<speed<< “Words Per Minute” ; } else cout<<“\n\nError : Speed “<<speed<< “WPM not allowed\n” ; getch() ; } } void mode_char() { clrscr() ; cout<<“CHARACTER MODE”<<endl ; cout<<“Type ‘*’ to END sending”<<endl ; while (1) { in=getche() ; if(in==‘ ’) { delay (6*DOT) ; continue; } else if(in==‘*’) break ; morse () ; } }

CONNECT-FOUR GAME
DHAVAL Y. TRIVEDI
onnect-four is a very simple and popular game. Here is the computer version of this game. The game is quite easy and self-explanatory. Online help is provided to avoid any confusion during the game. This game is executable only in QBASIC and it runs only on a system with VGA monitor or a higher system. A 486 or higher system is recommended, as the game will run very slow on a lower system. In this game, two different colours are

C

provided for two players. This game is almost like tick-tack-toe. You have to just

place four pieces of your colour adjacent to each other, as you place in tick-tacktoe. In tick-tack-toe, you can put your piece anywhere. But in connect-four, a piece will be placed at the lowest empty block. The player who places four pieces of his colour in a row, column, or diagonally will win. The software will automatically detect the winner. All the runtime keys are specified in the online help. Save this file as CONNECT4.BAS. If you want to run this game directly from DOS-prompt, make a file CONNECT4.BAT in your directory as follows:
@ECHO OFF CLS QBASIC/RUN CONNECT4.BAS CLS

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

ELECTRONICS FOR YOU T MAY 2000

79

SOFTWARE

SECTION

170 PUT (X, y), cur: X = X + x1: y = y1 IF X < 30 THEN X = 525 ELSE IF X > 525 THEN X = 30 SOUND 190, .5: PUT (X, y), cur GOTO 90 p1: turn = turn - 1 IF X = 30 THEN r1 = r1 - 25: SOUND 990, .5: IF r1 < 25 THEN turn = 6: BEEP: GOSUB play2t: GOTO 90 ELSE LINE (X - 24, r1 + 24)-(X + 29, r1 + 1), turn, BF IF X = 85 THEN r2 = r2 - 25: SOUND 990, .5: IF r2 < 25 THEN turn = 6: BEEP: GOSUB play2t: GOTO 90 ELSE LINE (X - 24, r2 + 24)-(X + 29, r2 + 1), turn, BF IF X = 140 THEN r3 = r3 - 25: SOUND 990, .5: IF r3 < 25 THEN turn = 6: BEEP: GOSUB play2t: GOTO 90 ELSE LINE (X - 24, r3 + 24)-(X + 29, r3 + 1), turn, BF IF X = 195 THEN r4 = r4 - 25: SOUND 990, .5: IF r4 < 25 THEN turn = 6: BEEP: GOSUB play2t: GOTO 90 ELSE LINE (X - 24, r4 + 24)-(X + 29, r4 + 1), turn, BF IF X = 250 THEN r5 = r5 - 25: SOUND 990, .5: IF r5 < 25 THEN turn = 6: BEEP: GOSUB play2t: GOTO 90 ELSE LINE (X - 24, r5 + 24)-(X + 29, r5 + 1), turn, BF IF X = 305 THEN r6 = r6 - 25: SOUND 990, .5: IF r6 < 25 THEN turn = 6: BEEP: GOSUB play2t: GOTO 90 ELSE LINE (X - 24, r6 + 24)-(X + 29, r6 + 1), turn, BF IF X = 360 THEN r7 = r7 - 25: SOUND 990, .5: IF r7 < 25 THEN turn = 6: BEEP: GOSUB play2t: GOTO 90 ELSE LINE (X - 24, r7 + 24)-(X + 29, r7 + 1), turn, BF IF X = 415 THEN r8 = r8 - 25: SOUND 990, .5: IF r8 < 25 THEN turn = 6: BEEP: GOSUB play2t: GOTO 90 ELSE LINE (X - 24, r8 + 24)-(X + 29, r8 + 1), turn, BF IF X = 470 THEN r9 = r9 - 25: SOUND 990, .5: IF r9 < 25 THEN turn = 6: BEEP: GOSUB play2t: GOTO 90 ELSE LINE (X - 24, r9 + 24)-(X + 29, r9 + 1), turn, BF IF X = 525 THEN r10 = r10 - 25: SOUND 990, .5: IF r10 < 25 THEN turn = 6: BEEP: GOSUB play2t: GOTO 90 ELSE LINE (X - 24, r10 + 24)-(X + 29, r10 + 1), turn, BF GOSUB check GOSUB play1t 320 K$ = INKEY$ ON KEY(17) GOSUB ex: ON KEY(18) GOSUB grid KEY 15, CHR$(0) + CHR$(54): ON KEY(15) GOSUB p2: KEY(15) ON: ON KEY(16) GOSUB restart: KEY(16) ON IF LEN(K$) < 2 THEN 320 K = ASC(RIGHT$(K$, 1)) IF K = 75 THEN x1 = -55: y1 = 330: GOTO 400 IF K = 77 THEN x1 = 55: y1 = 330: GOTO 400 GOTO 320 400 PUT (X, y), cur: X = X + x1: y = y1 IF X < 30 THEN X = 525 ELSE IF X > 525 THEN X = 30 SOUND 190, .5: PUT (X, y), cur GOTO 320 p2: turn = turn + 1 IF X = 30 THEN r1 = r1 - 25: SOUND 990, .5: IF r1 < 25 THEN turn = 5: BEEP: GOSUB play1t: GOTO 320 ELSE LINE (X - 24, r1 + 24)-(X + 29, r1 + 1), turn, BF IF X = 85 THEN r2 = r2 - 25: SOUND 990, .5: IF r2 < 25 THEN turn = 5: BEEP: GOSUB play1t: GOTO 320 ELSE LINE (X - 24, r2 + 24)-(X + 29, r2 + 1), turn, BF IF X = 140 THEN r3 = r3 - 25: SOUND 990, .5: IF r3 < 25 THEN turn = 5: BEEP: GOSUB play1t: GOTO 320 ELSE LINE (X - 24, r3 + 24)-(X + 29, r3 + 1), turn, BF IF X = 195 THEN r4 = r4 - 25: SOUND 990, .5: IF r4 < 25 THEN turn = 5: BEEP: GOSUB play1t: GOTO 320 ELSE LINE (X - 24, r4 + 24)-(X + 29, r4 + 1), turn, BF IF X = 250 THEN r5 = r5 - 25: SOUND 990, .5: IF r5 < 25 THEN turn = 5: BEEP: GOSUB play1t: GOTO 320 ELSE LINE (X - 24, r5 + 24)-(X + 29, r5 + 1), turn, BF IF X = 305 THEN r6 = r6 - 25: SOUND 990, .5: IF r6 < 25 THEN turn = 5: BEEP: GOSUB play1t: GOTO 320 ELSE LINE (X - 24, r6 + 24)-(X + 29, r6 + 1), turn, BF IF X = 360 THEN r7 = r7 - 25: SOUND 990, .5: IF r7 < 25 THEN turn = 5: BEEP: GOSUB play1t: GOTO 320 ELSE LINE (X - 24, r7 + 24)-(X + 29, r7 + 1), turn, BF IF X = 415 THEN r8 = r8 - 25: SOUND 990, .5: IF r8 < 25 THEN turn = 5: BEEP: GOSUB play1t: GOTO 320 ELSE LINE (X - 24, r8 + 24)-(X + 29, r8 + 1), turn, BF

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

80

ELECTRONICS FOR YOU T MAY 2000

CIRCUIT

IDEAS

SOLAR BUG

EO SANI TH

D. SOMNATH

ide this solar-powered circuit suitably and see the reaction of your friends to the chirpy sound produced by it every few minutes. In all probability, it will coax them to find out where the sound is coming from. The circuit runs off a miniature solar power panel, which can be taken out from an old calculator such as Citizen CT-500. A panel giving 1.5V to

H

2.5V is required. Note that the circuit can work properly from a panel as

small as 3 cm2. If a digital voltmeter is connected across capacitor C2, a slow build-up of voltage can be observed when the panel is exposed to light. Transistors T1 and T2 form a relaxation oscillator. When C1 charges to 0.6V, transistor T1 conducts and the charge built up in C2 is discharged through the piezobuzzer to produce a short beep. While testing the circuit, the value of resistor R1 can be reduced to, say, 1 kilo-ohm. Use a good-quality buzzer to ensure that the sound produced is loud enough.

WWW.EFYMAG.COM

ELECTRONICS FOR YOU • APRIL 2005 • 67

CIRCUIT

IDEAS

SOLAR LIGHTING SYSTEM
ASHISH AHUJA he world cannot continue to rely for long on fossil fuels for its energy requirements. Fossil fuel reserves are limited. In addition, when burnt, these add to global warming, air pollution and acid rain. So solar photovoltaic systems are ideal for providing independent electrical power and lighting in isolated rural areas that are far away from the

IVEDI S.C. DW

T

ing occurs moments after the voltage across it falls below 12V. Capacitor C1 also filters the rectified output if the battery is charged through AC power. The higher the value of the capacitor, the more the delay in switching. The switching time is to be properly adjusted because the charging would practically stop in the early evening while we want the light to be ‘on’ during late evening. During daytime, relay RL1

ing and the battery is in the charging mode. At night, there will be no generation of electricity. The relay will not energise and charging will not take place. The solar energy stored in the battery can then be used to light up the lamp. A 3W lamp glows continuously for around 6 hours if the battery is fully charged. Instead of a 3W lamp, you can also use a parallel array of serially connected white LEDs and lim-

power grid. These systems are nonpolluting, don’t deplete the natural resources and are cheap in the long run. The aim of this circuit is to demonstrate how we can utilise solar light to electrify the remote areas, i.e., how we can store the solar energy and then use it for small-scale lighting applications. Solar cells generate direct current, so make sure that DPDT switch S1 is towards the solar panel side. The DC voltage from the solar panel is used to charge the battery and control the relay. Capacitor C1 connected in parallel with a 12V relay coil remains charged in daytime until the relay is activated. Capacitor C1 is used to increase the response time of the relay, so switch98 • APRIL 2006 • ELECTRONICS FOR YOU

energises, provided DPDT switch S1 is towards the solar panel side. Due to energisation of relay RL1, the positive terminal of the battery is connected to the output of regulator IC 7808 (a 3terminal, 1A, 8V regulator) via diode D1 and normally-open (N/O) contacts of relay RL1. Here we have used a 6V, 4.5Ah maintenance-free, lead-acid rechargeable battery. It requires a constant voltage of approx. 7.3 volts for its proper charging. Even though the output of the solar panel keeps varying with the light intensity, IC 7808 (IC1) is used to give a constant output of 8V. Diode D1 causes a drop of 0.7V, so we get approx. 7.3V to charge the battery. LED1 indicates that the circuit is work-

iting resistors to provide sufficient light for even longer duration. In case the battery is connected in reverse polarity while charging, IC 7808 will get damaged. The circuit indicates this damage by lighting up LED2, which is connected in reverse with resistor R2. However, the circuit provides only the indication of reverse polarity and no measure to protect the IC. A diode can be connected in reverse to the common terminal of the IC but this would reduce the voltage available to the battery for charging by another 0.7 volt. There is also a provision for estimating the approximate voltage in the battery. This has been done by connecting ten 1N4007 diodes (D2 through D11)
WWW.EFYMAG.COM

CIRCUIT

IDEAS

in forward bias with the battery. The output is taken by LED3 across diodes D2, D3, D4 and D5, which is equal to 2.8V when the battery is fully charged. LED3 lights up at 2.5 volts or above. Here it glows with the voltage drop across the four diodes, which indicates that the battery is charged. If the bat-

tery voltage falls due to prolonged operation, LED3 no longer glows as the drop across D2, D3, D4 and D5 is not enough to light it up. This indicates that the battery has gone weak. Microswitch S1 has been provided to do this test whenever you want. If the weather is cloudy for some

consecutive days, the battery will not charge. So a transformer and full-wave rectifier have been added to charge the battery by using DPDT switch S1. This is particularly helpful in those areas where power supply is irregular; the battery can be charged whenever mains power is available.

WWW.EFYMAG.COM

ELECTRONICS FOR YOU • APRIL 2006 • 99

CIRCUIT

IDEAS
EDI

STAIrCAsE LIgHT WITH AUTO SwITCH-OFF

S.C. DWIV

RAJ K. GOrkHALI

e are all familiar with the electrical wiring arrangement that connects an electrical bulb with two switches: one at the bottom of a staircase and the other at the top. Wiring is done such that either of the two switches can be used to switch the bulb on or off. In such a wiring arrangement, while climbing up the staircase which is in dark, the switch located at the bottom of the staircase is used to switch on the light. After you have climbed the staircase, you use the switch located there to switch off the light. The circuit presented here is an electronic-cum-electrical arrangement to get a similar facility as provided by the hard-wired electrical system, but you need to operate the switch only once. Whereas in the hard-wired arrangement if you forget to switch off the light once you have traversed the staircase, light would remain ‘on,’ wasting energy. In this circuit also, we have two

W

micro-switches—one located at the top and the other located at the bottom of the staircase—that can be pushed and released easily during climb-up from the bottom of the staircase or climbdown from the top of the staircase. With every push and release of either of the two switches, bulb L1 lights up for a preset time period of, say, 40 seconds, which is considered adequate for climbing up or going down the staircase. The bulb goes off automatically after the set 40 seconds. You can change this ‘on’ time by changing the values of resistor R7 and/or capacitor C4 depending upon your requirement. Switches S1 and S2 are the two micro-switches, which provide low inputs to the respective de-bouncing circuits. Each de-bouncing circuit is built around two NAND gates connected back to back. The de-bouncing circuits ensure a clean, bounce-free pulse at the output every time the micro-switch is pressed and released. The outputs from the two de-bouncing circuits are ORed using diodes D1 and D2 (1N4001). So every time you press and release either

of the micro-switches, you get a positive-going pulse at the junction of the cathodes of diodes D1 and D2. These pulses are used to trigger the monostable circuit built around timer IC2. On the trailing edge of the pulse, the output of the monostable goes high for a time period of 40 seconds. This drives relay-driver transistor 2N2222 (T1) wired as a switch. Relay RL1 gets energised and closes N/O contacts of the relay, wired in series with the mains and the bulb (L1). Bulb L1 switches off when the relay gets de-energised after 40-second pulse period. Free-wheeling diode D4 (1N4001) protects transistor T1 against transients during relay switch-off operation. The circuit operates off a 9V battery, which gets connected to the circuit through ‘on’/‘off’ switch S3. You can also use regulated 9V power supply. Assemble the circuit on a generalpurpose PCB and house in a small box. Connect micro-switches S1 and S2 near top and bottom of the staircase through flexible wires and bulb in the middle of the staircase. 

7

W W W. E F Y M AG . CO M

E L E C T RO N I C S F O R YO U • M AY 2 0 0 8 • 7 1

CIRCUIT

IDEAS

STRESS METER

EO SANI TH

D. MOHAN KUMAR

T

his stress monitor lets you assess your emotional pain. If the stress is very high, it gives visual indication through a light-emitting diode (LED) display along with a

cuit. The circuit is very sensitive and detects even a minute voltage variation across the touch pads. The circuit comprises signal amplifier and analogue display sections. Voltage variations from the sensing pads are amplified by transistor BC548

Fig. 1: Circuit of the stress meter

warning beep. The gadget is small enough to be worn around the wrist. The gadget is based on the principle that the resistance of the skin varies in accordance with your emotional states. If the stress level is high the skin offers less resistance, and if the body is relaxed the skin resistance is high. The low resistance of the skin during high stress is due to an increase in the blood supply to the skin. This increases the permeability of the skin and hence the conductivity for electric current. This property of the skin is used here to measure the stress level. The touch pads of the stress meter sense the voltage variations across the touch pads and convey the same to the cir-

(T1), which is configured as a common-emitter amplifier. The base of T1 is connected to one of the touch pads through resistor R1 and to the ground rail through potmeter VR1. By varying VR1, the sensitivity of T1 can be adjusted to the desired level. Diode D1 maintains proper biasing of T1 and capacitor C1 keeps the voltage from the emitter of T1 steady. The amplified signal from transistor T1 is given to the input of IC LM3915 (IC1) through VR2. IC LM3915 is a monolithic integrated circuit that senses analogue voltage levels at its pin 5 and displays them through LEDs providing a logarithmic analogue display. It can drive up to ten LEDs one by one in the dot/

bar mode for each increment of 125 mV in the input. Here, we’ve used only five LEDs connected at pins 14 through 18 of IC1. LED1 glows when input pin 5 of IC1 receives 150 mV. LED5 glows when the voltage rises to 650 mV and LED5 flashes and piezobuzzer PZ1 beeps when the stress level is high. Resistors R4 and R5 and capacitor C2 form the flashing elements. Resistor R3 mainFig. 2: Display panel tains the LED current at around 20 mA. Capacitor C3 should be p l a c e d close to pin Fig. 3: Self-locking straps 3 for proper functioning of the IC. Zener diode ZD1 in series with resistor R6 provides regulated 5V to the circuit. The circuit can be assembled on a small piece of perforated board. Use transparent 3mm LEDs and a small piezobuzzer for audio-visual indications. Enclose the circuit in a small plastic case with touch pads on the back side. Two self-locking straps can be used to tie the unit around your wrist. After tying the unit around your wrist (with touch pads in contact with the skin), slowly vary VR1 until LED1 glows (assuming that you are in relaxed state). Adjust VR2 if the sensitivity of IC1 is very high. The gadget is now ready for use.

WWW.EFYMAG.COM

ELECTRONICS FOR YOU • SEPTEMBER 2005 • 101

TELEPHONE CALL ME TER USING CALCULATOR AND COB
n this circuit, a simple calculator, in conjunction with a COB (chip-onboard) from an analogue quartz clock, is used to make a telephone call meter. The calculator enables conversion of STD/ ISD calls to local call equivalents and always displays current local call-meter reading. The circuit is simple and presents an elegant look, with feather-touch operation. It consumes very low current and is fully battery operated. The batteries used last more than a year. Another advantage of using this circuit is that it is compatible with any type of pulse rate format, i.e. pulse rate in whole number, or whole number with decimal part. Recently, the telephone department announced changes in pulse rate format, which included pulse rate in whole number plus decimal part. In such a case, this circuit proves very handy. To convert STD/ISD calls to local calls, this circuit needs accurate 1Hz clock pulses, generated by clock COB. This COB is found inside analogue quartz wall clocks or time-piece mechanisms. It consists of IC, chip capacitors, and crystal that one can retrieve from scrap quartz clock mechanisms. Normally, the COB inside clock mechanism will be in good condition. However, before using the COB, please check its serviceability by applying 1.5V DC across terminals C and D, as shown in the figure. Then check DC voltage across terminals A and B; these terminals in a clock are connected to a coil. If the COB is in good condition, the multimeter needle would deflect forward and backward once every second. In fact, 0.5Hz clock is available at terminals A and B, with a phase difference of 90o. The advantage of using this COB is that it works on a 1.5V DC source.
Pulse rate (PR) 2 Pulse rate eqlt. (PRE) 2.5 3 4 6

I

The clock pulses available from terminal A and B are combined using a bridge, comprising diodes D1 to D4, to

always be included before counting the calls. For making call in pulse rate 4, slide

obtain 1Hz clock pulses. These clock pulses are applied to the base of transistor T1. The collector and emitter of transistor T1 are connected across calculator’s ‘=’ terminals. The number of pulses forming an equivalent call may be determined from the latest telephone directory. However, the pulse rate (PR) found in the directory cannot be used directly in this circuit. For compatibility with this circuit, the pulse rate applicable for a particular place/distance, based on time of the day/holidays, is converted to pulse rate equivalent (PRE) using the formula PRE = 1/PR. You may prepare a look-up table for various pulse rates and their equivalents (see Table). Suppose you are going to make an STD call in pulse rate 4. Note down from the table the pulse rate equivalent for pulse rate 4, which is 0.25. Please note that on maturity of a call in the telephone exchange, the exchange call meter immediately advances to one call and it will be further incremented according to pulse rate. So one call should
8 12 16 24 32 36 48

LOOKUP TABLE

0.500 0.400 0.333 0.250 0.166 0.125 0.083 0.062 0.041 0.031 0.027 0.020

Note: Here PRE is shown up to three decimal places. In practice, one may use up to five

or six decimal places.

switch S1 to ‘off’ (pulse set position) and press calculator buttons in the following order: 1, ‘+’, 0.25, ‘=’. Here, 1 is initial count, and 0.25 is PRE. Now calculator displays 1.25. This call meter is now ready to count. Now make the call, and as soon as the call matures, immediately slide switch S1 to ‘on’ (start/standby position). The COB starts generating clock pulses of 1 Hz. Transistor T1 conducts once every second, and thus ‘=’ button in calculator is activated electronically once every second. The calculator display starts from 1.25, advancing every second as follows: 1.25, 1.5, 1.75, 2.00, 2.25, 2.50, and so on. After finishing the call, immediately slide switch S1 to ‘off’ position (pulse set position) and note down the local call meter reading from the calculator display. If decimal value is more than or equal to 0.9, add another call to the whole number value. If decimal value is less than 0.9, neglect decimal value and note down only whole numbers. To store this local call meter reading into calculator memory, press ‘M+’ button. Now local call meter reading is stored in memory and is added to the previous local call meter reading. For continuous display of current local call meter reading, press ‘MRC’ button and slide switch S1 to ‘on’ (start/standby position). The current local call meter reading will blink
ELECTRONICS PROJECTS Vol. 21

167

once every second. In prototype circuit, the author used TAKSUN calculator. The display height was 1 cm. In this calculator, he substituted the two button-type batteries with two externally connected 1.5V R6 type batteries to run the calculator for more than an year. The power ‘off’ button terminals were made dummy by affixing cellotape on contacts to avoid erasing of memory, should someone accidentally press the power ‘off’ button. This calculator has auto ‘off’ facility. Therefore, some button needs to be pressed frequently to keep the calculator ‘on’. So, in the idle condition, the ‘=’ but-

ton is activated electronically once every second by transistor T1, to keep the calculator continuously ‘on’. Useful hints. Solder the ‘=’ button terminals by drilling small holes in its vicinity on PCB pattern using thin copper wire and solder it neatly, such that the ‘=’ button could get activated electronically as well as manually. Take the copper wire through a hole to the backside of the PCB, from where it is taken out of the calculator as terminals G and H. At calculator’s battery terminals, solder two wires to ‘+’ and ‘–’ terminals. These wires are also taken out from cal-

culator as terminals E and F. Affix COB on a general-purpose PCB and solder the remaining components neatly. For giving the unit an elegant look, purchase a jewellery plastic box with flip-type cover (size 15cm x 15cm). Now fix the board, calculator, and batteries, along with holder inside the jewellery box. Then mount the box on the wall and paste the look-up table inside the box cover in such a way that on opening the box, it is visible on left side of the box. Caution. The negative terminals of battery A and battery B are to be kept isolated from each other for proper operation of this circuit.

168

ELECTRONICS PROJECTS Vol. 21

TELEPHONE CONVERSAtION REcORDER

T

his circuit enables automatic switching-on of the tape recorder when the handset is lifted. The tape recorder gets switched off when the handset is replaced. The signals are suitably attenuated to a level at which they can be recorded using the 'MICIN' socket of the tape recorder. Points X and Y in the circuit are connected to the telephone lines. Resistors R1 and R2 act as a voltage divider. The voltage appearing across R2 is fed to the 'MIC-IN' socket of the tape recorder. The values of R1 and R2 may be changed depending on the input impedance of the tape recorder's 'MIC-IN' terminals. Capacitor C1 is used for blocking the flow of DC. The second part of the circuit controls relay RL1, which is used to switch on/off the tape recorder. A voltage of 48 volts appears across the telephone lines in on-hook condition. This voltage drops to about 9 volts when the handset is lifted. Diodes D1 through D4 constitute a bridge rectifier/polarity guard. This

ensures that transistor T1 gets voltage of proper polarity, irrespective of the polarity of the telephone lines. During on-hook condition, the output from the bridge (48V DC) passes through 12V zener D5 and is applied to the base of transistor T1 via the voltage divider comprising resistors R3 and R4. This switches on transistor T1 and its collector is pulled low. This, in turn, causes transistor T2 to cut off and relay RL1 is not energised. When the telephone handset is lifted, the voltage across points X and Y falls below 12 volts and so zener diode D5 does not conduct. As a result, base of transis-

tor T1 is pulled to ground potential via resistor R4 and thus is cut off. Thus, base of transistor T2 gets forward biased via resistor R5, which results in the energisation of relay RL1. The tape recorder is switched 'on' and recording begins. The tape recorder should be kept loaded with a cassette and the record button of the tape recorder should remain pressed to enable it to record the conversation as soon as the handset is lifted. Capacitor C2 ensures that the relay is not switched on-and-off repeatedly when a number is being dialled in pulse dialling mode.

ELECTRONICS PROJECTS Vol. 21

TELEPHONE LINE BASED AUDIO MUTING AND LIGHT-ON CIRCUIT

V

ery often when enjoying music or watching TV at high audio level, we may not be able to hear a telephone ring and thus miss an important incoming phone call. To overcome this situation, the circuit presented here can be used. The circuit would automatically light a bulb on arrival of a telephone ring and simultaneously mute the music system/TV audio for the duration the telephone handset is off-hook. Lighting of the bulb would not only indicate an incoming call but also help in locating the telephone during darkness. On arrival of a ring, or when the handset is offhook, the inbuilt transistor of IC1 (opto-coupler) conducts and capacitor C1 gets charged and, in turn, transistor T1 gets forward biased. As a result, transistor T1 conducts, causing energisation of relays RL1, RL2, and RL3. Diode D1 connected in antiparallel to inbuilt diode of IC1, in shunt with resistor R1, provides an easy path for AC current and helps in limiting the voltage across inbuilt diode to a safe value during the ringing. (The RMS value of ring voltage lies between 70 and 90 volts RMS.) Capacitor C1 maintains necessary voltage for continuously forward biasing transistor T1 so that the relays are not de-energised during the negative half cycles and off-period of ring signal. Once the handset is picked up, the

relays will still remain energised because of low-impedance DC path available (via cradle switch and handset) for

The timer IC2 (555) is configured in monostable mode and connected between transistor T1 and relay units provides a

the in-built diode of IC1. After completion of call when handset is placed back on its cradle, the low-impedance path through handset is no more available and thus relays RL1 through RL3 are deactivated. As shown in the figure, the energised relay RL1 contacts switch on the light, while energisation of relay RL2 causes the path of TV speaker lead to be opened. (For dual-speaker TV, replace relay RL2 with a DPDT relay of 6V, 200 ohm.)

holding time of around 0.5 minutes. Similarly, energisation of DPDT relay RL3 opens the leads going to the speakers and thus mutes both audio speakers. Use ‘N/C’ contacts of relay RL3 in series with speakers of music system and ‘N/C’ contacts of RL2 in series with TV speaker. Use ‘N/O’ contact of relay RL1 in series with a bulb to get the visual indication of an incoming call as well as light during off-hook period.

ELECTRONICS PROJECTS Vol. 21

187

TELECOM HEADSEt

A

compact, inexpensive and low component count telecom head-set can be constructed using two readily available transistors and a few other electronic components. This circuit is very useful for hands-free operation of EPABX and pager communication. Since the circuit draws very little current, it is ideal for parallel operation with electronic telephone set. Working of the circuit is simple and straightforward. Resistor R1 and an ordinary neon glow-lamp forms a complete visual ringer circuit. This simple arrangement does not require a DC blocking capacitor because, under idle conditions, the telephone line voltage is insufficient to ionise the neon gas and thus the lamp does not light. Only when the ring signal is being received, it flashes at the ringing rate to indicate an incoming call. The bridge rectifier using diodes D1 through D4 acts as a polarity guard which protects the electronic circuit from any reversal in the telephone line polarity. Zener diode D5 at the output of this bridge rectifier is used for additional circuit protection. Section comprising transistor T1, resistors R2, R3 and zener diode D6 forms a constant voltage regulator that provides a low voltage output of about 5 volts. Dial tone and speech signals from exchange are coupled to the audio amplifier stage built around transistor T2 and related parts, i.e. resistors R7, R6 and capacitor C5. Amplified signals from col-

lector of transistor T2 are coupled to dynamic receiver RT-200 (used as earpiece) via capacitor C7. A condenser microphone, connected as shown in the circuit, is used as transmitter. Audio signals developed across the microphone are coupled to the base of transistor T1 via capacitor C3. Resistor R4 determines the DC bias required for the microphone. After amplification by transistor T1, the audio signals are coupled to the telephone lines via the

diode bridge. The whole circuit can be wired on a very small PCB and housed in a medium size headphone, as shown in the illustration. For better results at low line currents, value of resistor R2 may be reduced after testing.

ELECTRONICS PROJECTS Vol. 20

sing modulated rectangular waves of different time periods, the circuit presented here produces ringing tones similar to those produced by a telephone. The circuit requires four astable multivibrators for its working. Therefore two 556 ICs are used here. The IC 556

U

TELEPHONE RINGER USING TIMER ICs
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’ duration 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 collector of transistor T2 to prevent capacitor C3 from fully discharging when transistor T2 is conducting. Preset VR1 must be set at such a value that two ringing tones are heard in the loudspeaker in one second. The remaining two multivibrators are used to produce ringing tones corresponding to the ringing pulses produced by the preceding multivibrator stages. When switch S1 is closed, transistor T1 cuts off and thus the first multivibrator starts generating pulses. If this switch is placed in the power supply path, one has to wait for a longer time for the ringing to start after the switch is closed. The circuit used also has a provision for applying a drive voltage to the circuit to start the ringing. Note that the circuit is not meant for connection to the telephone lines. Using appropriate drive circuitry at the input (across switch S1) one can use this circuit with intercoms, etc. Since ringing pulses are generated within the circuit, only a constant voltage is to be sent to the called party for ringing. EFY Lab note. To resemble the actual telephone ringing a 400 Hz tone is switched on in the following sequence: 400ms on, 200ms off, 400ms on and 2000ms off and then repeat.

ELECTRONICS PROJECTS Vol. 21

203

CIRCUIT

IDEAS

TELEPHONE-OPERATED CALLING SYSTEM
YOGESH KATARIA (VU3PYF) ual-tone multiple-frequency (DTMF) receiver IC is commonly used in telephone equipment. One common DTMF receiver is Holtek HT9170 used in electronic communication circuits. The Holtek HT9170 series comprises DTMF receivers integrated with digital decoder and bandsplit filter functions. All HT9170 series ICs use digital counting techniques to detect and decode all the 16 DTMF tone pairs into a 4-bit code output. This telephone-operated calling circuit is very helpful for doctors in calling the patients, in banks and in various other situations where persons have to be called or signalled. When you need to call a person amongst many standing outside your cabin, just lift the telephone handset off the cradle and press the respective number. The number of the person called will be displayed and a bell will sound to inform the person that it is his turn.

IVEDI S.C. DW

D

The circuit can also be used in quiz contests and by visually- or hearingimpaired people. It can be used to call a maximum of nine different persons. The circuit is built around DTMF receiver IC HT9170, BCD-to-7-segment decoder/driver 7447, quad 2-input OR gate and common-anode display. Simple melody generator IC UM66 is used to produce melody sound in the loudspeaker through Darlington-pair transistors (T1 and T2). The tone pair DTMF generated by pressing the telephone key is converted into binary values internally in the IC. The binary values are indicated by the glowing of LEDs at the output of IC1. The output of IC1 is connected to: 1. LEDs connected via resistors R15 through R18 at pins 11 through 14, respectively. LED1 indicates the LSB and LED4 indicates the MSB. 2. BCD-to-7-segment decoder/ driver 7447, whose outputs are connected to the common-anode display for displaying the pressed number on

the telephone connected in parallel to the circuit. 3. Gates N1 and N2 to activate the call bell. Here is how the circuit works: Connect the telephone and the circuit in parallel to the telephone line. Connect 6V to the circuit. When you press switch S1, DIS1 shows ‘0.’ Lift the handset off the cradle and dial a number, say, ‘1.’ The output of IC1 becomes A3A2A1A0 = 0001. LED1 glows, the display shows ‘1’ and the call bell sounds. To stop the call bell, put the receiver on the cradle and press switch S1 momentarily. Now DIS1 shows ‘0’ and LED1 stops glowing. For calling other numbers, follow the same procedure: Lift the handset off the cradle and press the desired number (0 through 9). The respective LED will glow, the number will be displayed on DIS1 and the call bell will sound. Now put the handset on the cradle and press S1 momentarily to stop the call bell.

100 • OCTOBER 2006 • ELECTRONICS FOR YOU

WWW.EFYMAG.COM

CMYK

D

TINY DEW SENsOR
same can be procured from authorised service centres of reputed companies. The author used the dew sensor for FUNAI VCP model No. V.I.P. 3000A (Part No: 6808-08-04, reference no. 336) in his prototype. In practice, it is observed that all dew sensors available for video application possess the same electrical characteristics irrespective of their physical shape/size, and hence are interchangeable and can be used in this project. The circuit is basically a switching type circuit made with the help of a popular dual op-amp IC LM358N which is configured here as a comparator. (Note that only one half of the IC is used here.) Under normal conditions, resistance of the dew sensor is low (1 kilo-ohm or so) and thus the voltage at its non-inverting terminal (pin 3) is low compared to that at its inverting input (pin 2) terminal. The corresponding output of the comparator (at pin 1) is accordingly low and thus nothing happens in the circuit. When humidity exceeds 80 per cent, the sensor resistance increases rapidly. As a result, the non-inverting pin becomes more positive than the inverting pin. This pushes up the output of IC1 to a high level. As a consequence, the LED inside the opto-coupler is energised. At the same time LED1 provides a visual indication. The opto-coupler can be suitably interfaced to any electronic device for switching purpose. Circuit comprising diode D1, resistors R8 and R6 and capacitor C1 forms a lowvoltage, low-current power supply unit. This simple arrangement obviates the requirement for a bulky and expensive step-down transformer.

ew (condensed moisture) adversely affects the normal performance of sensitive electronic devices. A low-cost circuit described here can be used to switch off any gadget automatically in case of excessive humidity. At the heart of the circuit is an inexpensive (resistor type) dew sensor element. Although dew sensor elements are widely used in video cassette players and recorders, these may not be easily available in local market. However, the

ELECTRONICS PROJECTS Vol. 20

CIRCUIT IDEAS
touch signal is connected to the counter/ decoder via a resistor and clock input CK is connected to the counter/decoder via a frequency generator. Line frequency signal is taken through R4 at pin 2 of IC TT6061A. At zero crossing, the triac (BT136) triggers to drive a 200W bulb. The 6.8V power supply is taken directly from mains through resistors R1 and R3, diode D3, capacitor C4, and zener diode and fed to power-input pin 3 of the IC. Capacitors C1, C2, and C3 connected between touch input pin 4 and touch plate Pin Assignments of IC TT6061A
Pin No. 1 2 3 4 5 6 7 8 Pin name CK FI VDD TI CI NC VSS AT Function description System clock input 50Hz line frequency Power input pin for VDD Touch input Sensor control input Not connected Power input pin for VSS Angle-trigger output

TOUCH DIMMER
K. KRISHNA MURTY

I VED DWI S.C.

B

y simply touching this touch dimmer you can increase the light intensity of incandescent lamps in three steps. The touch dimmer is built around 8-pin CMOS IC TT8486A/TT6061A specifically manufactured for touch dim-

second touch, the bulb gives medium light. At the third touch, the bulb is driven fully. Another touch puts off the light. Since the IC is highly sensitive, use a long wire to connect the IC to the touch sensor. The circuit uses minimum external components. For touch plate, you can use a simple copper plate of 1cm×1cm or

mer applications. Initially, when mains switch is ‘on,’ the bulb is ‘off’. Now, if you touch the touch plate, the bulb glows dimly. On

even the end of the lead wire. Touch plate is coupled to the touch detector through 820pF, 2kV capacitors C1, C2, and C3 connected in series. Internally IC TT6061A’s

remove the shock potential from the touch plate, so do not replace these capacitors with a single capacitor or with a capacitor of a lower voltage rating. Mains potential exists in the circuit. Needless to say, it is dangerous to touch the circuit when mains is ‘on.’ Note. The IC had been procured by the author from SM Semiconductors, Santacruz (W), Mumbai.

DECEMBER 2003

ELECTRONICS FOR YOU

TOUCH-SENSITIVE MUSICAL BELL WITH TIMER

T

his circuit is built around CMOS IC CD4011 and popular melody generator IC UM66. When touch plates are bridged by hand for a moment. the circuit starts to generate music. After a few seconds the music automatically stops. Maximum supply voltage for this circuit is +5 volts. The IC UM66 can not operate beyond 3.3V voltage. IC 7805 regulator based power supply can be used to power this circuit. Time delay can be changed by chang-

ing values of capacitor C1 and resistor R2. Three silicon diodes connected in series between pin 2 of UM66 IC and positive

5-volt rail keep voltage applied to pin2 of UM66 below 3.2 volts because of the drop of approximately 1.8 volts across them.

ELECTRONICS PROJECTS Vol. 19

185

CIRCUIT

IDEAS

ULTRASONIC PROXIMITY DETECTOR
PRADEEP G. e the humans can hear sound of up to 20kHz frequency only. This proximity detector works at a frequency of 40 kHz. It uses two specially made ultrasonic transducers: One transducer emits 40kHz sound, while the other receives 40kHz sound and converts it into electrical variation of the same frequency. Fig. 1 shows the block diagram of the ultrasonic proximity detector and Fig. 2 shows its circuit. Mount the transducers (transmitter as well as receiver) about 5 cm apart on a piece of

W

general-purpose PCB as shown in Fig. 3 and connect to identical points (‘a’ through ‘d’) of the detector circuit (Fig. 2) via external wires. The 40kHz oscillator is built around transistors T1 and T2. If there is a solid object in front of the ultrasonic transmitter module (TX1), some signals will be reflected back and sensed by the receiver transducer (RX1). The 40kHz ultrasonic signals are converted into 40kHz electric signals by the receiver and then amplified by transistors T3 and T4. The amplified signals are still in the inaudible range, i.e., these can’t be heard. So a frequency-divider stage us-

IVEDI S.C. DW

Fig. 1: Block diagram of ultrasonic proximity detector

ing CMOS decade counter IC4017 (IC1) is used at the output of the amplifier. IC1 divides the input frequency by ’10,’ so the 40kHz signal becomes 4 kHz, which is within the audible range. The 4kHz signals are fed to op-amp IC 741 (IC2), which is wired as an earphone amplifier. This circuit can be used as an electronic guard for the blind. Keep it (along with 9V battery) in their pocket with earphone plugged to their ear. The transducer modules should be directed towards the walking path. If any object comes up in front or n e a r b y , Fig. 3: Transducers mounted they will on the PCB

Fig. 2: Circuit of ultrasonic proximity detector

88 • DECEMBER 2006 • ELECTRONICS FOR YOU

WWW.EFYMAG.COM

CIRCUIT

IDEAS

hear 4kHz sound through the earphone and can change their path accordingly. One thing to be noted here is that while using this device, avoid the company of your pets. The reason is that

pets can hear ultrasonic sound, which will irritate them and they will bark unnecessarily. EFY note. A similar device is used in some cars, such as Skoda’s Laura model, to help the drivers in backing

up and avoid banging against some invisible objects. However, instead of earphones the sound in this case is heard through a speaker and there is also an LCD screen to visually assist the driver.

WWW.EFYMAG.COM

ELECTRONICS FOR YOU • DECEMBER 2006 • 89

UPS FOR CORDLESS TELEPHONES

C

ordless telephones are very popular nowadays. But they have a major drawback, i.e. they cannot be operated during power failure. Therefore usually another ordinary telephone is connected in parallel to the

Fig. 1: Block diagram of UPS.

cordless telephone. This results in lack of secrecy. UPS is a permanent solution to this problem.

out, irrespective of the presence of the AC mains. When the AC mains is present, the same is converted into DC and fed to the inverter. A part of the mains rectified output is used to charge the battery. When the mains power fails, the DC supply to the inverter is from the battery and from this is obtained AC at the inverter output. This is shown in fig.1. The circuit wired around IC CD4047 is an astable multivibrator operating at a frequency of 50 Hz. The Q and Q outputs of this multivibrator directly drive power MOSFETS IRF540. The configuration used is push-pull type. The inverter output is filtered and the spikes are reduced using

Fig. 3: Proposed layout of front and rear panels.

battery, one may use two 6V, 4Ah batteries (SUNCA or any other suitable brand). The circuit can be easily assembled on a general-purpose PCB and placed inside a metal box. The two transformers may be mounted on the chassis of the box. Also,

Fig. 2: Circuit diagram of UPS

Since the UPS is meant only for the cordless telephone, its output power is limited to around 1.5W. This is sufficient to operate most cordless telephones. as these employ only small capacity adapters (usually 9V/12V, 500mA), to enable the operation of the circuit and to charge the battery present in the handset. The UPS presently designed is of online type. Here the inverter is ‘on’ through-

MOV (metal oxide varistor). The inverter transformer used is an ordinary 9V-0-9V, 1.5A mains transformer readily available in the market. Two LEDS (D6 and D7) indicate the presence of mains/battery. The mains supply (when present) is stepped down, rectified and filtered using diodes D1 through D4 and capacitor C1. A part of this supply is also used to charge the battery. In place of a single 12V, 4Ah

the two batteries can be mounted in the box using supporting clamps. The front and back panel designs are shown in the Fig. 3. The same circuit can deliver up to 100W, provided the inverter transformer and charging transformer are replaced with higher current rating transformers, so that the system can be used for some other applications as well.

182

ELECTRONICS PROJECTS Vol. 19

CIRCUIT

IDEAS

VARIABLE POWER SUPPLY USING A FIXED-VOLTAGE REGULATOR IC
DR MAHESH N. JIVANI AND DR NIKESH A. SHAH voltage regulator (also called a ‘regulator’) with only three terminals appears to be a simple device, but it is in fact a very complex integrated circuit. It converts a varying input voltage into a constant ‘regulated’ output voltage. Voltage regulators are available in a variety of outputs like 5V, 6V, 9V, 12V and 15V. The LM78XX series of voltage regulators are designed for positive input. For applications requiring negative input, the LM79XX series is used. Fig. 1 shows the pin configuration of a 5V 7805 regulator. The output voltage of a regulator circuit can be increased

IVEDI S.C. DW

A

Fig. 1: Pin configuration of 7805 regulator

Fig. 2: Circuit for increasing

by using a pair of ‘voltage-divider’ resistors. It is not possible to obtain a voltage lower than the stated rating. You cannot use a 12V regulator to make a 5V power supply, but you can use a 5V regulator to make a 12V supply. Voltage regulators are very robust. These can withstand over-current draw due to short circuits and also over-heating. In both cases, the regulator will cut off before any damage occurs. The only way to destroy a regulator is to apply reverse voltage to its input. Reverse polarity destroys the regulator almost instantly. Fig. 2 shows the circuit for increasing the output voltage of a regulator circuit using a pair of voltage-divider resistors. Let’s assume the value of R1 as 470 ohms, which means that a constant current of 10.6 mA will be available between terminals 2 and 3 of 7805. This constant current plus the regulator standby current of about 2.5 mA will flow through R2 to ground regardless of its value. the output voltage

Common Resistor Combinations for the 7805 Regulator
Vout (approx.) 5V 6V 8V 9V 12V R1 (ohms) 470 470 470 470 470 R2 (ohms) 0 100 220 330 510

Because of this constant 13.1mA current, R2 can now be set to a value that will give constant 7 volts across resistor R2. A resistor value of 533 or 510 ohms (standard value) will give the necessary 7 volts. With 5 volts across R1 and 7 volts across R2, a total of about 12 volts (regulated) will appear across terminal 2 and ground. If a variable resistor is used as R2, the output voltage can be easily fine-tuned to any value greater than 5 volts. The standby current will vary slightly in the regulator 7805, but 2.5 mA will yield good results in the calculations. If an exact voltage (within 0.3 volt) is needed, R2 must be a variable resistor. To make any fixed regulator adjustable, use the following formula:
Vout= Vfixed+R2 Vfixed R1 +Istandby

Fig. 3: Circuit of variable power supply using a 5V regulator

where Vout is the desired output voltage, Vfixed is the fixed voltage of the IC regulator (5 volts) and Istandby is the standby current of the regulator (2.5 mA). For resistor R1, use any value from 470 ohms to 1 kilo-ohm for best results. For variable resistor R2, put any value from the table given here for desired voltage operation. Fig. 3 shows the circuit of a 6V12V variable power supply using a 5V regulator. The 220V AC mains voltage is stepped down by transformer X1 to 9 volts, rectified by
WWW.EFYMAG.COM

96 • NOVEMBER 2006 • ELECTRONICS FOR YOU

CIRCUIT

IDEAS

the bridge rectifier comprising 1N4007 diodes D1 through D4, filtered by smoothing capacitors C1 and C2, and regulated by IC 7805 (IC1). Capacitors C1 and C2 help to maintain a constant input to the regulator. Capacitor C1 should be rated at a minimum of 1000 µF for each ampere

of current drawn and at least twice the input voltage. Wire the 270nF or greater disk (ceramic) capacitor close to the input terminal of the IC, and a 10µF or greater electrolytic capacitor across the output. The regulator ICs typically give 60 dB of ripple rejection, so 1V of input ripple appears as

a mere 1 mV of ripple in the regulated output. Attach the 5-way rotary switch to resistors of different values to get the regulated output as shown in the table. Or, you can use a 1-kilo-ohm potmeter as a variable resistor to get the regulated 5V-12V output.

WWW.EFYMAG.COM

ELECTRONICS FOR YOU • NOVEMBER 2006 • 97

CIRCUIT

IDEAS

VeRSATIle CMOS/TTL LoGIc AND ClocK PRoBe

S.C. DWIV

EDI

EFY LAB

F

or fault diagnosis of any logic circuit, you need a probe that can test the logic level or existence of clock activity. The circuit shown here can be used to test CMOS and TTL logic circuits for logic states and also for the presence of clock activity from a few hertz to more than 10 MHz, at any

point of the logic circuit. Supply for the probe circuit is taken from the circuit under test using alligator clips. In the circuit, LM319 dual-comparator is connected as a window detector. The non-inverting pin of comparator N1 is biased to nearly 2V when switch S1 is in TTL position and 80 per cent of Vcc in CMOS position. The output of N1

goes low only when logic input at the probe tip exceeds the biasing voltage and, as a result, the red LED lights up to indicate logic 1 state at the probe tip. Similarly, the inverting pin of comparator N2 is biased at nearly 0.8V (in TTL position of switch S1) and 20 per cent of Vcc (in CMOS position of switch S1). Only when the input volt-

Test Results
Test conditions TTL (5V) Low High Clock CMOS (12V) Low High Clock <2.5V >9.5V CMOS compatible ≤2.35V >9.5V 1 Hz to 10 MHz or even more Off On Off On Off Momentarily on/off Off Off ‘On’ for 3 seconds Off Off ‘On’ for 3 seconds <0.8V >2V TTL compatible <0.8V ≥2.1V 1 Hz to 10 MHz or even more Off On Off On Off Momentarily on/off Off Off On for 3 seconds Off Off On for 3 seconds Specified level Observed level Red LED Green LED Yellow LED Buzzer sound

age at probe tip is less than the biasing voltage, will its output drop low to light up the green LED to indicate logic 0 state. The probe tip is also connected to the input of CD4049 (N3) via capacitor C1 to pass AC/clock signals. It simply acts as a buffer and couples only the high-to-low going signals at the input/output of the gate to the input of next gate N4. The output of gate N4 is further coupled to gate N5, which is wired as a monostable. A positive feedback from
W W W. E f Y M AG . CO M

9 2 • F E B R UA RY 2 0 0 8 • E L E C T RO N I C S F O R YO U

CIRCUIT

IDEAS

the output of gate N5 to the input of gate N4 ensures that unless capacitor C4 (0.47µF) discharges sufficiently via 4.7-mega-ohm resistor, further clock pulses at the input of N4 will have no effect.

Gate N6 is used for driving a yellow LED (indicating oscillatory input at probe tip), which will be switched on for a brief period. The output of gate N6 is further used to inhibit/enable the oscillator formed by gates N7

and N8. It briefly activates the buzzer to beep during mono period, indicating oscillatory input at the probe tip. Thus we have audio-visual indication during clock/oscillatory input at the probe tip. 

W W W. E f Y M AG . CO M

E L E C T RO N I C S F O R YO U • F E B R UA RY 2 0 0 8 • 9 3

CIRCUIT

IDEAS

VERSATILE POWER SUPPLY

IVEDI S.C. DW

SUNIL KUMAR

sing this circuit, you can obtain the following voltages (approx.) at a current limited to one ampere: 3.3V, 5V, 6V, 9V, 12V and 15V. The AC mains is stepped down by transformer X1 to deliver the secondary output of 18V AC at a maximum current of 1A dependant upon the load. The transformer output is rectified by the bridge rectifier comprising diodes D1 through D4, filtered by capacitor C1 and fed to regulator IC LM317, which is a 3-terminal posi-

U

tive regulator capable of providing 1.2V to 37 volts at 1.5A current to the load. Resistor R13 and selected combinations of resistors R1 through R12 are used to produce approximately 3.3V, 5V, 6V, 9V, 12V and 15V at the output. The desired resistors are selected by switching into conduction one of the six pnp transistors T1 through T6 by grounding the corresponding transistor base using rotary switch S1. For example, to get regulated 3.3V, simply rotate the knob of rotary switch to 3.3V position. Consequently, tran-

sistor T1 is forward biased to switch resistors R1 and R2 (in series) across Adj pin of LM317 and ground to produce 3.3V. Other voltages can be produced in the same way by using rotary switch S1. Capacitor C2 bypasses any ripple in the output. Diode D5 is used as the protection diode. Use a heat-sink for dissipation of heat from IC LM317. The fuse-rated lamp provides protection against short circuit. This 1A rated power supply can be used for testing of various circuit ideas as well as construction projects published in EFY.

84 • FEBRUARY 2006 • ELECTRONICS FOR YOU

WWW.EFYMAG.COM

CIRCUIT

IDEAS

VISUAL AC MAINS VOLTAGE INDICATOR
RAJ K. GORKHALI

IVEDI S.C. DW

Y

ou should not be surprised if someone tells you that the mains voltage fluctuation could be anywhere from 160 volts to 270 volts. Although majority of our electrical and electronics appliances have some kind of voltage stabilisation internally built-in, more than 90 per cent of the faults in these appliances occur due to these power fluctuations. This simple test gadget gives visual indication of AC mains voltage from 160 volts to 270 volts in steps of 10 volts. There are twelve LEDs numbered LED1 to LED12 to indicate the voltage level. For input AC mains voltage of less than 160 volts, all the LEDs remain off. LED1 glows when the voltage

reaches 160 volts, LED2 glows when the voltage reaches 170 volts and so on. The number of LEDs that glow keeps increasing with every additional 10 volts. When the input voltage reaches 270 volts, all the LEDs glow. The circuit basically comprises three LM339 comparators (IC1, IC2 and IC3) and a 12V regulator (IC4). It is powered by regulated 12V DC. For power supply, mains 230V AC is stepped down to 15V AC by stepdown transformer X1, rectified by a bridge rectifier comprising diodes D1 through D4, filtered by capacitor C4 and regulated by IC4. The input voltage of the regulator is also fed to the inverting inputs of gates N1 through N12 for controlling the level of the AC. The LED-based display circuit is

built around quad op-amp comparators IC1 through IC3. The inverting input of all the comparators is fed with the unregulated DC voltage, which is proportional to mains input, whereas the non-inverting inputs are derived from regulated output of IC4 through a series network of precision resistors to serve as reference DC voltages. Resistors R13 to R25 are chosen such that the reference voltage at points 1 to 12 is 0.93V, 1.87V, 2.80V, 3.73V, 4.67V, 5.60V, 6.53V, 7.46V, 8.40V, 9.33V, 10.27V and 11.20V, respectively. When the input voltage varies from 160V AC to 270V AC, the DC voltage at the anode of ZD1 also varies accordingly. With input voltage varying from 160V to 270V, the output across filter capacitors C1 and C2 varies from 14.3V to 24.1V approxi-

WWW.EFYMAG.COM

ELECTRONICS FOR YOU • MAY 2006 • 89

CIRCUIT

IDEAS

mately. Zener ZD1 is used to drop fixed 12V and apply proportional voltages to all comparator stages (inverting pins). Whenever the voltage at the non-inverting input of the comparators goes high, the LED connected at the output glows. Assemble the circuit on a general-

purpose PCB such that all the LEDs make a bargraph. In the bargraph, mark LED1 for minimum level of 160V, then LED2 for 170V and so on. Finally, mark LED12 for maximum level of 270V. Now your test gadget is ready to use. For measuring the AC voltage,

simply plug the gadget into the mains AC measuring point, press switch S1 and observe the bargraph built around LEDs. Let’s assume that LED1 through LED6 glow. The measured voltage in this case is 220V. Similarly, if all the LEDs glow, it means that the voltage is more than 270V.

90 • MAY 2006 • ELECTRONICS FOR YOU

WWW.EFYMAG.COM

M

WATCH-DOG FOR TELEPHONES
an alarm in case of any misuse. In addition it transmits a loud tone through the telephone lines to prevent further misuse. When switch S1 is turned on, the normal (on-hook) telephone line voltage at the output of bridge-rectifier diodes D1 to D4 is approximately 48 volts, which being well above the break-down voltage of zener diode D5, the diode conducts. As a result transistor T2 gets forward biased. This effectively grounds the base of transistor T1 which is thus cut off and the remaining circuit does not get any power supply. In this state, only a small (negligible) current is taken by the circuit, which will not affect the telephone line condition. However, when handset of any telephone connected to the telephone lines is lifted (off-hook), line voltage suddenly drops to about 10 volts. As a result, transistor T2 is switched off and transistor T1 gets forward biased via resistor R1. Now, the astable multivibrator built around timer IC1 starts oscillating and the speaker starts sounding. Output of the astable multivibrator is also connected to the base of transistor T1 through capacitor C5. As a result, only a loud (and irritating) tone is heard in the ear-piece of the unauthorised telephone instrument. This circuit can be constructed on a veroboard using easily available low-cost components and it can be connected to any telephone line without the fear of malfunctioning. No extra power supply is required as it draws power from the telephone line for operation. EFY Note : Please disconnect the gadget when you are yourself using the telephone as it cannot distinguish between authorised and unauthorised operation.

ost of the telephone security devices available in market are simple but quite expensive. These devices provide blinking or beeping type line-tap/misuse indications. Quite often they do not offer guaranteed protection against unauthorised operation. A very simple and unique circuit of a telephone watch-dog to safeguard subscriber telephone lines against any fraud is described here. This little circuit keeps continuous watch over the telephone lines and sounds

184

ELECTRONICS PROJECTS Vol. 19

Sign up to vote on this title
UsefulNot useful