Sunday, August 2, 2009

Simple power down

This circuit adds a power down function to analog I/O ports (for example, the AD7769 and AD7774). Moreover, the diodes ordinarily needed to protect the devices against power-supply missequencing can be
In the circuit, MOSFETs Q1 and Q2 switch the +5- and +12-V supplies, respectively, in a sequence controlled by two cross-coupled CD4001 CMOS NOR gates (U1C and U1D). The sequence in which power isapplied is important: The controlled circuits may be damaged anytime Vcc exceeds Vdd+0.3V. Consequently, the NOR gates must be powered from a 12-V supply throughout the power-down sequence. [...]

Arduino Perpetual Pendulum

Basic Idea

I wanted to set up a pendulum with a small magnet on its end, place an electromagnet beneath where the pendulum would swing, and then energize the electromagnet briefly from time to time to "nudge" the pendulum so that it would swing "forever". (Note that the electromagnet works best if under the swing of the pendulum, not at the end of the swing, mounted so that it would be hit by the pendulum if it were to swing just a little "too far".)

That's about all there is to it! The project is almost that simple. Why bother to make one? To be sure I could, and the spot I have in mind for this toy is a two story high atrium, and a suitable pendulum gently swinging back and for there will, I think, look rather nice. And be a relaxing sight.


Definition: Reed switch: Usually two tiny metal leaves in a sealed glass tube, arranged so that when a magnet is near, the leaves come together and electricity will flow through the device. When there is no magnet nearby, the leaves spring apart, and no electricity flows. Usually a single pole, single throw switch.

If, in addition to the electromagnet, you also put reed switches under the arc through which the pendulum swings, then you can use their closures (as the pendulum and its magnet swing over them) to time when the electromagnet is energized. If it isn't turned on and off at the right times, you don't get good results. You might think that one reed switch would do... but using only one gives rise to problems. (You might want to try to figure out what they are before the answer is given farther down the page.)

If your skills are up to it, I suspect that using LEDs and phototransistors to detect the pendulum passing a certain point would give better results. But I used reed switches, and made them work.

I would suggest putting the switches and the electromagnet near the point the pendulum would be over if it were hanging, still, not swinging. This has pros and cons, which I invite you to explore for yourself, if only in your mind. Be sure the reed switch nearest the electromagnet is not so near that turning on the electromagnet will cause the reed switch to close.

The following diagram should merely recap what you already know. The green arrows (pointing down) represent the five wires which lead away from the pendulum/ switches/ electromagnet to the place where you have the Arduino and other electronic elements. Don't be tempted to combine the two "earth" wires. (More on this later.) "SWouter"and "SWinner" are just shorthand names for the two switches.

Picture of mechanical elements

Building it... mechanical....

You cannot spend too much time making sure you have a good pendulum. If it isn't well mounted, so that it will swing consistently, you will spend the rest of the time you spend on this project being annoyed. In other words you don't want the setup of switches and electromagnet I had in the prototype!!

Setup of switches and electomagnet I had in the prototype!!

(The blurred vertical at the left is the pendulum, the vertical on the right supports the pendulum.)

The longer your pendulum is the better, within reason.

A heavy weight near the bottom will be helpful. It will help if the center of the weight's gravity coincides with the center of the magnet mounted on the end of the pendulum. (If this is not done, the pendulum will try to twist when the electromagnet pulls on the pendulum magnet.)

I used quite a dinky disk magnet, and mounted it "flat", i.e. with the flat faces horizontal when the pendulum is at rest. Having said that, it is a modern (strong) "dinky" magnet, and I was lucky enough to have a good electromagnet to hand. Neither is a critical element, just use the best of each that you can obtain easily.

The precise positioning of the two reed switches and the electromagnet is critical to the satisfactory working of this toy. You will do yourself a favor if you mount them in a way that facilitates fine adjustments. One of the advantages of the broken- light- beam approach to detecting the pendulum's position accurately, with less effort on the mechanical side, become easier. The spacing between the two reed switches isn't critical... you will probably get away with anything that isn't silly. Put them far enough apart, though, that there will be at least a little time when neither is activated when the pendulum is between them.

Both the Coriolis effect and forces arising from elements in the design can deflect the swing of the pendulum from a nice simple "back and forth" in one plane. So mount your pendulum such that it resists any attempts to deviate.

How you hang the pendulum is up to you; I doubt you need my help, but I've posted a few ideas on the page the link will take you to, if you are interested.

Building it... electrical/ electronic....

The following gives you most of what you need....

Picture of circuits

N.B.: I would love to build the whole thing with just one power supply, and it "should" be possible. However, there's something called "field collapse" which you need to know about. Consider the electromagnet in this project. When you connect it to a voltage, electro-magnetism builds up around the electromagnet. When you dis-connect the voltage, that magnetism "collapses" in on the coil, and gives rise to a pulse of high voltage. That much I know and understand. That is why the diode (D2) is present. It is inserted the way it is so that no electricity flows through it when the voltage from PSU2 is applied across the electromagnet. (You'll cause all sorts of problems... unless PS2 is short circuit friendly... if you connect things up with the diode the wrong way 'round.) When the voltage from PSU2 is removed, the role of the diode is to "drain off" the voltage arising from the collapsing field. All of that logic also applies to D1, by the way. Whenever you have a relay in a circuit, you put a diode across the coil thus. 1N4004s work well... just be sure to use something like that, capable of handling significant current. Some of the small "signal" diodes may not be up to the strain.

Continuing the story of why there are two power supplies (PSUs): Years ago, I set out to built a computer controlled model railway. I had a PIC (poor man's Arduino) programmed to control the voltage supplied to the train track. That voltage went into the motor of the train. A motor is, in many ways, just a special electromagnet. And I "blew up" (permanently fried) a number of PICs. I never did figure out why I was destroying my PICs. I looked into a number of things, I took great care, I built protection into everything... and still I destroyed PICs.

You "should" be able to build something like my Perpetual Pendulum without needing two power supplies... but I didn't want to risk damaging my Arduino, hence my cautious, two PSU, design.

One of the LEDs (LEDspare) isn't used at all. You don't need the LEDs for the project to work... but the visual indication of what the Arduino is "seeing" and "doing" can be very useful during troubleshooting, and "costs" nothing. If you decide to dispense with one or more of the LEDs, you can still run the program just as published below.

Electromagnet: I was lucky... I had a nice 12volt solenoid in my junk box. I left its actuator in place, taped to the retracted position. That made a nice iron core to focus the magnetism. I put the current through the coil so that the magnet on the end of the pendulum is attracted to the electromagnet when it is energized. This was to avoid having the pendulum pushed sideways, out of a nice straight arc. If your electromagnet is repelling your magnet, you only have to reverse the connections to the electromagnet. Be sure to do it "downstream" (distal from) the diode... you want to reverse the direction of current flow through the coil, but still present the voltage to the diode as before.

If you have to build your own electromagnet, be careful that the load it places on PSU2 isn't too high. Another component that will be under some strain is the relay. The electromagnet will be energized again and again and again. And when it is energized, there will be what amounts to a brief almost short circuit across the contacts... high current. If your pendulum stops working after a few days or weeks, the relay is the first thing I'd check, assuming that the swing of the pendulum still takes it over the reed relays properly.

There's no reason to site the Arduino right next to the pendulum. The five wires between the electromagnet and the two switches and everything else can be quite long.

So! that's about all I have to say about the system. Here's the software. (There will be a few comments on the software after it....)

ver 29 May 08

Hardware: 3 LEDs for data output:
LEDInnerRS: Announces state of reed switch nearest center
of pendulum swing
LEDOuterRS: Announces state of reed switch farthest from
center of pendulum swing
LEDElectMag: Announces state of output to relay

One output line to control relay to control electromagnet

Two inputs from reed switches.


#define LEDOuterRS 13 //no ; here.
#define LEDInnerRS 11 //no ; here.
#define LEDElectMag 9 //no ; here.
#define LEDSpare 7 //no ; here.

#define SWInner 10 //no ; here.
#define SWOuter 12 //no ; here.

#define ElectMag 8 //no ; here. This output will be used
// to turn electromagnet on.

//Set up values for the variable LastSwitched
#define inner 0 //no ; here. Not "necessary" but makes code
#define outer 1 //no ; here. more readable
int LastSwitched = 0;

void setup()


digitalWrite(SWInner, HIGH);//Turn on internal pull up resistor
digitalWrite(SWOuter, HIGH);

void MagnetOnBriefly()
/*The LED is not a necessary element, just helpful in
diagnostic work.*/

void loop()
if (digitalRead(SWOuter)==HIGH)
if (digitalRead(SWInner)==HIGH)
if (LastSwitched==outer){MagnetOnBriefly();};
}//End "loop"

==== Discussion of program.... ====

Remember the conundrum set earlier? "Why two switches?"

For the sake of discussion... it didn't happen, really!.... let's imagine that at first I only one switch. Why can't we trigger the electromagnet each time the pendulum goes over it?

You'd be half right. Assuming things are arranged as in the first diagram, and assuming you've wired things so that an energized electromagnet attracts the pendulum, then yes, you want to energize the electromagnet when the pendulum is swinging left- to- right.... which it will be doing half of the time it passes over the switch But! What about the times when the pendulum is swinging away from the electromagnet! You don't want to "call it back" at those times, do you?

By having two switches, you can ask where the pendulum was a moment ago. Do yourself a little table showing the sequence of "switch ons" you get from the two switches as the pendulum swings. Assuming a pretty wide swing, you'll see that the switch that is on goes...

I(nner), O(uter), O, I, I, O, O, I, I....

The right time to turn the electro-magnet on briefly is when the inner switch is on immediately after the outer switch has been on.

Just as a little aside: In this project (and most Arduino work, as far as I'm aware) we are working with the states of the inputs at specific moments. In some electronic control work, we are able to look for and work with "edges", instead of what we're doing here, working with "levels". "Edges" occur when the state of an input changes. A change from low to high is called a rising edge, and the other change is a falling edge. While working with edges is nice in some ways, they are nasty in others. In particular, edges are very brief, so you usually have a way to ask "has an edge occurred since I last asked?" In our Perpetual Pendulum project, we only concern ourselves with levels, and we check and re-check the states of the inputs so often that there will not be a case where one goes high and then low again so quickly that we won't have looked at least once during the brief (in human, but not computer, terms) time it was high.

=== Further discussion... ===

To get you Perpetual Pendulum working well, you'll have to adjust the following to get what is right for whichever you chose to change first....

  • Position of electromagnet
  • Position of inner switch
  • Position of outer switch
  • Length of debounce delay*
  • Length of time electro-magnet is switched on

Re- the "debounce delay", marked "*" in the list above. It is the one inside the "loop" function. To be honest with you, I'm entirely quite sure why this delay is needed... but it does make a difference to the way the program performs. I suspect it prevents the program from "seeing" the switch close more than once for one pass of the pendulum overhead... although 40ms seems an awfully short time to accomplish this. It works, so I used it!

The length of time the electomagnet is switched on is controlled by the delay in the "MagnetOnBriefly" function. Too long, and when the pendulum is swinging widely, the electro-magnet will limit the swing, as it will pull back on the pendulum after the pendulum has swung past the electro-magnet, and is trying to go out on its swing to the right. If the electromagnet is not on for a long enough period, the magnet on the pendulum will be relatively far away from the electro-magnet for the whole time it is energized. And therefore the attraction between the two will only be minimal.

=== Further discussion.... ===

You may have found the....

#define inner 0 //no ; here. Not "necessary" but makes code
#define outer 1 //no ; here. more readable

... unexpected. During the program's execution, we need to know which switch was last seen to close. As far as the program is concerned, "0" is a code standing for the inner switch, and "1" is a code standing for the outer switch. We store, say, 0 in the variable "LastSwitched" when the inner switch is seen to close. Once we've done that, we only need to say "if LastSwitched==0...." to set up something to happen if the last switch seen to close was the inner switch.

Because of my defines, we can use the words "inner" and "outer" in place of "0" and "1". The English equivalents for the numerical codes are a little easier for our gray cells to process.

With "inner" and "outer" defined, we can say things like "LastSwitched=inner" and "if (LastSwitched==inner)..."

=== Further discussion.... ====

The heart of the program, shown below, is deceptively simple. If you take out everything except the two lines starting "if", can you rebuild the code to do what has to be done? It would be an excellent challenge for a programming class. I'm not even sure that it is "perfect"... but it does work. I did get some odd behavior for a while (before the delay was added). That odd behavior might also have stemmed from the electro-magnet's magnetism "spilling over" and causing one or both reed switched to close.

Heart of program.....

  if (digitalRead(SWOuter)==HIGH)
if (digitalRead(SWInner)==HIGH)
if (LastSwitched==outer){MagnetOnBriefly();};


=== Things which might be fun.... Count swings

Add some code so that the number of swings is counted. The easy thing to do would be to put an accumulator in the "MagnetOnBriefly" function... but this is not a good answer! (If you want to pursue one of the other extensions which I'm going to mention in a moment.

It will probably be simplest to count the instances of SWinner being on immediately after SWouter being on.

Once you have started counting the swings, if you want to connect an LCD panel (or other means of output) to the Arduino you can list that, just to amaze people, and/ or try to display a time of day derived from the time-keeping capability of the pendulum. Of course you then have to introduce ways of setting the time of day at the start. All beyond what amuses me... but easy enough to do! (Speaking of "amaze": I have an anemometer (wind speed sensor) which may have turned 10 million times since it's counter was last reset. This figure is a little worrying... the counter's figure sometimes "jumps" due to electrical noise... but the program that monitors it has executed 610,000 passes though its main loop since the last time... not long ago... the program was reset, so who knows?)

=== Things which might be fun.... Auto-restart

From time to time "things" happen. The cat plays with the pendulum, there's a power outage, whatever.

The software given above works while it works, but if things go wrong, the pendulum will stop swinging, and not start again without human intervention. In particular, if for some reason the outer switch doesn't close for a few swings, the electro-magnet doesn't energize for a few swings, and before long the swings are too short for the magnet to reach the outer switch and we are headed towards a dead pendulum.

It would not be beyond the wit of programmer-kind to include some extra code which would "do things" when the outer switch wasn't being closed. The normal system, with its feedback circuit, allows for optimal swinging. But an alternative, "crude", system might be able to get the pendulum swinging well enough for the feedback-driven alternative to start working again.

If such a system were built, then a solar powered (see below), runs-just-when-the-sun-is-out version of the Perpetual Pendulum becomes do-able.

=== Things which might be fun.... Alternate power

Depending on the match (or lack thereof) between your electro-magnet and it's PSU, the strain of supplying adequate voltage to the electro-magnet may be over-stressing the PSU.

You could solve this, and perhaps also get better overall performance, by using PSU2, through a resistor, to charge a capacitor. The electro-magnet would then be powered by the charge in the capacitor when the relay closed.

Picture of capacitor managed power

Such a circuit will "save up" electricity in the capacitor, and "deliver" it in a burst when the contacts of the relay close.

If you had enough photovoltaic solar cells to generate a suitable voltage, it wouldn't matter if the current supplied was weak. Of course, the system would need a night light or other to see it through the night.

With the capacitor circuit, a new problem arises. How often do you close the contacts on the relay? The fun of design work is in imagining and exploring the alternatives, weighing up their pros and cons.

The "close how often" question has many possible answers.

If your power supply, though weak, is at least constant (i.e. not solar power!), you could program the system to zap the electro-magnet once every, say, five swings. Or more or less, depending on your PSU.

If you want to get fancier, you could monitor the voltage marked V-CAP on the diagram. As the capacitor charges up, that voltage will rise. Now... if you have overcome the problems discussed previously about keeping the voltages in the Arduino strictly separate from the power for the electro-magnet, you could monitor V-CAP with one of the Arduino's analog inputs.

You could also, with a transistor or so, put an extra "switch" in series with the contacts of the relay. The Arduino would "ask" for an electro-magnet pulse on every swing of the pendulum, but the transistor(s) would prevent that from happening until there was adequate charge in the capacitor. Again, this would tap into V-CAP to know when the capacitor ware adequately charged.

If the solar power idea is attractive, you can combine a few things for a "full" answer....

I'd still go with two power supplies... one for the Arduino, one for the electro-magnet. Each would involve, in essence, the circuitry found in emergency lights. During the day, solar cells would be used to charge batteries. Voltage regulators would allow power to pass to the Arduino and electro-magnet as needed, and "extra" electricity would be passed for storage to the batteries to see the system through the night.

FM Wireless Microphone by BC557

FM Wireless Microphone by BC557

July 27th, 2009

FM Wireless Microphone has been a very popular project with beginners and experienced constructors alike. It has been used inside guitars and as the basis of a remote control system. I do however, receive many requests for a higher powered circuit and better microphone sensitivity. Now I can introduce the new FM Wireless Microphone (v5), which also has a better frequency stability, over 1Km range (under ideal conditions) and is good on microphone sensitivity. This has been achieved by adding an RF amplifier buffer (with 10dB gain) and an AF preamplifier to boost the modulation a little.

AM-CW ham bands transmitter

This is a small transmitter is a good stable QRP transmitter, which has many uses, from the HF bands AM transmitter, radio control models, or AM / CW ham-band transmitter. Circuit is almost ridiculously simple, and construction is even simpler. It is basically a single transistor oscillator with very low output impedance, suitable for driving the base of another transitory stage amplifier. Oscillator uses a single coil and crystal. The coil is tuned to a frequency output, which may correspond to the crystal frequency, or harmonics.

Wednesday, July 29, 2009

Simple Car Battery Charger

This very simple circuit uses a transformer ,two diodes , a capacitor and an ammeter.
To charge a battery just connect the + and - terminals of the circuit to the corresponding terminals of the battery.
When the battery is not charged, the ammeter reading shows 1-3 amps.
When the battery is fully charged the ammeter reads Zero or nearly zero, after which the battery should be removed from the
The circuit is a full wave rectifier using 2 diodes for rectification. The capacitor is used for smoothing.
I think the circuit works fine without the capacitor since the battery itself acts a BIG capacitor. But when you are using the
circuit to supply 12V (as a battery eliminator) the capacitor needs to be present.
Care should be taken NOT to reverse the + and - terminals while connecting it to the battery.

Automatic Speed Controller for fans & Coolers

During summer nights, the temperature is initially quite high. As time passes, the temperature starts dropping. Also, after a person falls asleep, the metabolic rate of one’s body decreases. Thus, initially the fan/cooler needs to be run at full speed. As time passes, one has to get up again and again to adjust the speed of the fan or the cooler.The device presented here makes the fan run at full speed for a predetermined time. The speed is decreased to medium after some time, and to slow later on. After a period of about eight hours, the fan/cooler is switched off.Fig. 1 shows the circuit diagram of the system. IC1 (555) is used as an astable multivibrator to generate clock pulses. The pulses are fed to decade dividers/counters formed by IC2 and IC3. These ICs act as divide-by-10 and divide-by-9 counters, respectively. The values of capacitor C1 and resistors R1 and R2 are so adjusted that the final output of IC3 goes high after about eight hours.The first two outputs of IC3 (Q0 and Q1) are connected (ORed) via diodes D1 and D2 to the base of transistor T1. Initially output Q0 is high and therefore relay RL1 is energised. It remains energised when Q1 becomes high. The method of connecting the gadget to the fan/cooler is given in Figs 3 and 4.

It can be seen that initially the fan shall get AC supply directly, and so it shall run at top speed. When output Q2 becomes high and Q1 becomes low, relay RL1 is turned ‘off’ and relay RL2 is switched ‘on’. The fan gets AC through a resistance and its speed drops to medium. This continues until output Q4 is high. When Q4 goes low and Q5 goes high, relay RL2 is switched ‘off’ and relay RL3 is activated. The fan now runs at low speed.Throughout the process, pin 11 of the IC is low, so T4 is cut off, thus keeping T5 in saturation and RL4 ‘on’. At the end of the cycle, when pin 11 (Q9) becomes high, T4 gets saturated and T5 is cut off. RL4 is switched ‘off’, thus switching ‘off’ the fan/cooler.Using the circuit described above, the fan shall run at high speed for a comparatively lesser time when either of Q0 or Q1 output is high. At medium speed, it will run for a moderate time period when any of three outputs Q2 through Q4 is high, while at low speed, it will run for a much longer time period when any of the four outputs Q5 through Q8 is high.If one wishes, one can make the fan run at the three speeds for an equal amount of time by connecting three decimal decoded outputs of IC3 to each of the transistors T1 to T3. One can also get more than three speeds by using an additional relay, transistor, and associated components, and connecting one or more outputs of IC3 to it.
In the motors used in certain coolers there are separate windings for separate speeds. Such coolers do not use a rheostat type speed regulator. The method of connection of this device to such coolers is given in Fig. 4.
The resistors in Figs 2 and 3 are the tapped resistors, similar to those used in manually controlled fan-speed regulators. Alternatively, wire-wound resistors of suitable wattage and resistance can be used.

Alternating Flasher

This circuit uses three easily available 555 timer ICs. All three work as astable multivibrators. The first 555 has an on period and off period equal to 1 sec. This IC controls the on/ off periods of the other 2 555s which are used to flash two bulbs through the relay contacts.
The flashing occurs at a rate of 4 flashes per second.
The diodes are used to protect the 555 ICs from peaks. The relays should have an impedance greater than 50ohms i.e, they should not draw a current more than 200mA.
The flashing sequence is as follows:
The bulb(s) connected to the first relay flashes for about 1 sec at a rate of 4 flashes per second. Then the bulb(s) connected to the second relay flashes for 1 sec at a rate of 4 flashes per second. Then the cycle repeats.
The flashing rates can be varied by changing the capacitors C3 and C5. A higher value gives a lower flashing rate.
Note that the values of C3 and C5 should be equal and should be less than that of C1.
The value of C1 controls the change-over rate ( default 1sec). A higher value gives a lower change-over rate.
If you use the normally open contacts of the relay, on bulb will be OFF while other is flashing,and vice versa.
If normally closed contacts are used, one bulb will be ON while the other is flashing

Audio Light Modulator

Audio light modulations add to the enjoyment of music during functions organised at home or outdoors. Presented here is one such simple circuit in which light is modulated using a small fraction of the audio output from the speaker terminals of the audio amplifier. The output from the speaker terminals of audio amplifier is connected to a transformer (output transformer used in transistor radios) through a non-polarised capacitor. The use of transformer is essential for isolating the audio source from the circuit in The sensitivity control potentiometer VR1 provided in the input to transistor T1 may be adjusted to ensure that conduction takes place only after the AF exceeds certain amplitude. This control has to be adjusted as per audio source level. The audio signal Proper earthing of the circuit is quite essential. The diode bridge provides pulsating DC output and acts as a guard circuit between the mains input and pulsating DC output. Extreme care is necessary to avoid any electric shock

Automatic Room Lights

An ordinary automatic room power control circuit has only one light sensor. So when a person enters the room it gets one pulse and the lights come ‘on.’ When the person goes out it gets another pulse and the lights go ‘off.’ But what happens when two persons enter the room, one after the other? It gets two pulses and the lights remain in ‘off’ state. The circuit described here overcomes the above-mentioned problem. It has a small memory which enables it to automatically switch ‘on’ and switch ‘off’ the lights in a desired fashion. The circuit uses two LDRs which are placed one after another (separated by a distance of say half a metre) so that they may separately sense a person going into the room or coming out of the room. Outputs of the two LDR sensors, after processing, are used in conjunction with a bicolour LED in such a fashion that when a person gets into the room it emits green light and when a person goes out of the room it emits red light, and vice versa. These outputs are simultaneously applied to two counters. One of the counters will count as +1, +2, +3 etc when persons are getting into the room and the other will count as -1, -2, -3 etc when persons are getting out of the room. These counters make use of Johnson decade counter CD4017 ICs. The next stage comprises two logic ICs which can combine the outputs of the two counters and determine if there is any person still left in the room or not. Since in the circuit LDRs have been used, care should be taken to protect them from ambient light. If desired, one may use readily available IR sensor modules to replace the LDRs. The sensors are installed in such a way that when a person enters or leaves the room, he intercepts the light falling on them sequentially—one after the other. When a person enters the room, first he would obstruct the light falling on LDR1, followed by that falling on LDR2. When a person leaves the room it will be the other way round. In the normal case light keeps falling on both the LDRs, and as such their resistance is low (about 5 kilo-ohms). As a result, pin 2 of both timers (IC1 and IC2), which have been configured as monostable flip-flops, are held near the supply voltage (+9V). When the light falling on the LDRs is obstructed, their resistance becomes very high and pin 2 voltages drop to near ground potential, thereby triggering the flip-flops. Capacitors across pin 2 and ground have been added to avoid false triggering due to electrical noise. When a person enters the room, LDR1 is triggered first and it results in triggering of monostable IC1. The short output pulse immediately charges up capacitor C5, forward biasing transistor pair T1-T2. But at this instant the collectors of transistors T1 and T2 are in high impedance state as IC2 pin 3 is at low potential and diode D4 is not conducting. But when the same person passes LDR2, IC2 monostable flip-flop is triggered. Its pin 3 goes high and this potential is coupled to transistor pair T1-T2 via diode D4. As a result transistor pair T1-T2 conducts because capacitor C5 retains the charge for some time as its discharge time is controlled by resistor R5 (and R7 to an extent). Thus green LED portion of bi-colour LED is lit momentarily. The same output is also coupled to IC3 for which it acts as a clock. With entry of each person IC3 output (high state) keeps advancing. At this stage transistor pair T3-T4 cannot conduct because output pin 3 of IC1 is no longer positive as its output pulse duration is quite short and hence transistor collectors are in high impedance state. When persons leave the room, LDR2 is triggered first followed by LDR1. Since the bottom half portion of circuit is identical to top half, this time with the departure of each person red portion of bi-colour LED is lit momentarily and output of IC4 advances in the same fashion as in case of IC3. The outputs of IC3 and those of IC4 (after inversion by inverter gates N1 through N4) are ANDed by AND gates (A1 through A4) are then wire ORed (using diodes D5 through D8). The net effect is that when persons are entering, the output of at least one of the AND gates is high, causing transistor T5 to conduct and energise relay RL1. The bulb connected to the supply via N/O contact of relay RL1 also lights up. When persons are leaving the room, and till all the persons who entered the room have left, the wired OR output continues to remain high, i.e. the bulb continues to remains ‘on,’ until all persons who entered the room have left. The maximum number of persons that this circuit can handle is limited to four since on receipt of fifth clock pulse the counters are reset. The capacity of the circuit can be easily extended for up to nine persons by removing the connection of pin 1 from reset pin (15) and utilising Q1 to Q9 outputs of CD4017 counters. Additional inverters, AND gates and diodes will, however, be required

Emergency Light

The circuit of automatic emergency light presented here has the following features: 1. When the mains supply (230V AC) is available, it charges a 12V battery up to 13.5V and then the battery is disconnected from the charging section. 2. When the battery discharges up to 10.2V, it is disconnected from the load and the charging process is resumed. 3. If the mains voltage is available and there is darkness in the room, load (bulb or tube) is turned on by taking power from the mains; otherwise the battery is connected to the load. 4. When the battery discharges up to 10.2V and if the mains is not yet available, the battery is completely disconnected from the circuit to avoid its further discharge. The mains supply of 230V AC is stepped down to 18V AC (RMS) using a 230V AC primary to 0-18V AC, 2A secondary transformer (X1), generally used in 36cm B&W TVs. Diodes D1 through D4 form bridge rectifier and capacitor C5 filters the voltage, providing about 25V DC at the output. Charging section includes 33-ohm, 10-watt resistor R2 which limits the charging current to about 425 mA when battery voltage is about 10.2V, or to 325 mA when battery voltage is about 13.5V. When the battery charges to 13.5V (as set by VR2), zener diode D17 goes into breakdown region, thereby triggering triac TR1. Now, since DC is passing through the triac, it remains continuously ‘on’ even if the gate current is reduced to zero (by disconnecting the gate terminal). Once the battery is fully charged, charging section is cut-off from the battery due to energisation of relay RL2. This relay remains ‘on’ even if the power fails because of connection to the battery via diode D10. S4, a normally closed switch, is included to manually restart the charging process if required. Battery disconnect and charging restart section comprises an NE555 timer (IC2) wired in monostable mode. When the battery voltage is above 10.2V (as indicated by red LED D15), zener diode (D16) remains in the breakdown region, making the trigger pin 2 of IC2 high, thereby maintaining output pin 3 in low voltage state. Thus, relay RL3 is ‘on’ and relay RL4 is ‘off.’ But as soon as the battery voltage falls to about 10.2V (as set by preset VR1), zener diode D16 comes out of conduction, making pin 2 low and pin 3 high to turn ‘on’ relay RL4 and orange LED D13. This also switches off relay RL3 and LED D15. Now, if the mains is available, charging restarts due to de-energisation of relay RL2 because when relay RL4 is ‘on,’ it breaks the circuit of relay RL2 and triac TR1. But if the mains supply is not present, both relays RL3 and RL1 de-energise, disconnecting the battery from the remaining circuit. Thus when battery voltage falls to 10.2 volts, its further discharge is eliminated. But as soon as the mains supply resumes, it energises relay RL1, thereby connecting the battery again to the circuit. Light sensor section also makes use of a 555 timer IC in the monostable mode. As long as normal light is falling on LDR1, its resistance is comparatively low. As a result pin 2 of IC3 is held near Vcc and its output at pin 3 is at low level. In darkness, LDR resistance is very high, which causes pin 2 of IC3 to fall to near ground potential and thus trigger it. As a consequence, output pin 3 goes high during the monostable pulse period, forward biasing transistor T3 which goes into saturation, energising relay RL5. With auto/bypass switch S2 off (in auto mode), the load gets connected to supply via switch S3. If desired, the load may be switched during the day-time by flipping switch S2 to ‘on’ position (manual). Preset VR3 is the sensitivity control used for setting threshold light level at which the load is to be automatically switched on/off. Capacitors with the relays ensure that there is no chattering of the relays. When the mains is present, diode D8 couples the input voltage to regulator IC1 whereas diode D10 feeds the input voltage to it (from battery) in absense of mains supply. Diode D5 connects the load to the power supply section via resistor R5 when mains is available (diode D18 does not conduct). However, when mains power fails, the situation reverses and diode D18 conducts while diode D5 does not conduct. . The load can be any bulb of 12 volts with a maximum current rating of 2 amperes (24 watts). Resistor R5 is supposed to drop approximately 12 volts when the load current flows through it during mains availability . Hence power dissipated in it would almost be equal to the load power. It is therefore desirable to replace R5 with a bulb of similar voltage and wattage as the load so that during mains availability we have more (double) light than when the load is fed from the battery. For setting presets VR1 and VR2, just take out (desolder one end) diodes D7, D10 and D18. Connect a variable source of power supply in place of battery. Set preset VR1 so that battery-high LED D15 is just off at 10.2V of the variable source. Increase the potential of the variable source and observe the shift from LO BAT LED D13 to D15. Now make the voltage of the source 13.5V and set preset VR2 so that relay RL2 just energises. Then decrease the voltage slowly and observe that relay RL2 does not de-energise above 10.2V. At 10.2V, LED D15 should be off and relay RL2 should de-energise while LED D13 should light up. Preset VR3 can be adjusted during evening hours so that the load is ‘on’ during the desired light conditions

Automatic Dual output Display

This circuit lights up ten bulbs sequentially, first in one direc- tion and then in the opposite direction, thus presenting a nice visual effect. In this circuit, gates N1 and N2 form an oscillator. The output of this oscillator is used as a clock for BCD up/down counter CD4510 (IC2). Depending on the logic state at its pin 10, the counter counts up or down. During count up operation, pin 7 of IC2 outputs an active low pulse on reaching the ninth count. Similarly, during count-down operation, you again get a low-going pulse at pin 7. This terminal count output from pin 7, after inversion by gate N3, is connected to clock pin 14 of decade counter IC3 (CD4017) which is configured here as a toggle flip-flop by returning its Q2 output at pin 4 to reset pin 15. Thus output at pin 3 of IC3 goes to logic 1 and logic 0 state alternately at each terminal count of IC2. Initially, pin 3 (Q0) of IC3 is high and the counter is in count-up state. On reaching ninth count, pin 3 of IC3 goes low and as a result IC2 starts counting down. When the counter reaches 0 count, Q2 output of IC3 momentarily goes high to reset it, thus taking pin 3 to logic 1 state, and the cycle repeats. The BCD output of IC2 is connected to 1-of-10 decoder CD4028 (IC4). During count-up operation of IC2, the outputs of IC4 go logic high sequentially from Q0 to Q9 and thus trigger the triacs and lighting bulbs 1 through 10, one after the other. Thereafter, during count-down operation of IC2, the bulbs light in the reverse order, presenting a wonderful visual effect

Light Flasher

This is a very basic circuit for flashing one or more LEDS and also to alternately flash one or more LEDs.
It uses a 555 timer setup as an astable multivibrator with a variable frequency.
With the preset at its max. the flashing rate of the LED is about 1/2 a second. It can be increased by increasing the value of the capacitor from 10uF to a higher value. For example if it is increased to 22uF the flashing rate becomes 1 second.

There is also provision to convert it into an alternating flasher. You just have to connect a LED and a 330ohm as shown in Fig.2 to the points X and Y of Fig.1. Then both the LEDs flash alternately.

Since the 555 can supply or sink in upto 200mA of current, you can connect upto about 18 LEDS in parallel both for the flasher and alternating flasher (that makes a total of 36 LEDs for alternating flasher).

Programmable Digital Code Lock

A programmable code lock can be used for numerous applications in which access to an article/gadget is to be restricted to a limited number of persons. Here is yet another circuit of a code lock employing mainly the CMOS ICs and thumbwheel switches (TWS) besides a few other components. It is rugged and capable of operation on voltages ranging between 6 and 15 volts. The supply current drain of CMOS ICs being quite low, the circuit may be operated even on battery.
The circuit uses two types of thumbwheel switches. switch numbers TWS1 through TWS8 are decimal-to-BCD converter type while switch numbers TWS9 through TWS16 are 10-input multiplexer type in which only one of the ten inputs may be connected to the output (pole). One thumbwheel switch of each of the two types is used in combination with IC CD4028B (BCD to decimal decoder) to provide one digital output.Eight such identical combinations of thumbwheel switches and IC CD4028 are used. The eight digital outputs obtained from these combinations are connected to the input of 8-input NAND gate CD4068.For getting a logic high output, say at pole-1, it is essential that decimal numbers selected by switch pair TWS1 and TWS9 are identical, as only then the logic high output available at the Specific output pin of IC1 will get transferred to pole-1. Accordingly, when the thumbwheel pair of switches in each combination is individually matched, the outputs at pole-1 to pole-8 will be logic high.This will cause output of 8-input NAND gate IC CD4068b to change over from logic high to logic low, thereby providing a high-to-low going clock pulse at clock input pin of 7-stage counter CD4024B, which is used here as a flip-flop (only Q0 output is used here).The output (Q0) of the flip-flop is connected to a relay driver circuit consisting of transistors T1 and T2. The relay will operate when Q0 output of flip-flop goes low. As a result transistor T1 cuts off and T2 gets forward biased to operate the relay.Switch S1 is provided to enable switching off (locking) and switching on (unlocking) of the relay as desired, once the correct code has been set.
With the code set correctly, the NAND gate output will stay low and flip-flop can be toggled any number of times, making it possible to switch on or switch off the relay, as desired. Suppose we are using the system for switching-on of a deck for which the power supply is routed via the contacts of the relay. The authorised person would select correct code which would cause the supply to become available to the deck. After use he will operate switch S1 and then shuffle the thumbwheel switches TWS1 through TWS8 such that none of the switches produces a correct code. Once the code does not match, pressing of switch S1 has no effect on the output of the flip-flop.Switches TWS9 through TWS16 are concealed after setting the desired code. In place of thumbwheel switches TWS1 through TWS8 DIP switches can also be used

Ultrasonic Pest Repeller

It is well know that pests like rats, mice etc are repelled by ultrasonic frequency in the range of 30 kHz to 50 kHz. Human beings can’t hear these high-frequency sounds. Unfortunately, all pests do not react at the same ultrasonic frequency. While some pests get repelled at 35 kHz, some others get repelled at 38 to 40 kHz. Thus to increase the effectiveness, freque- ncy of ultrasonic oscillator has to be continuously varied between certain limits. By using this circuit design, frequency of emission of ultrasonic sound is continuously varied step-by-step automatically. Here five steps of variation are used but the same can be extended up to 10 steps, if desired. For each clock pulse output from op-amp IC1 CA3130 (which is wired here as a low-frequency square wave oscillator), the logic 1 output of IC2 CD4017 (which is a well-known decade counter) shifts from Q0 to Q4 (or Q0 to Q9). Five presets VR2 through VR6 (one each connected at Q0 to Q4 output pins) are set for different values and connected to pin 7 of IC3 (NE555) electronically. VR1 is used to change clock pulse rate. IC3 is wired as an astable multivibrator operating at a frequency of nearly 80 kHz. Its output is not symmetrical. IC4 is CD4013, a D-type flip-flop which delivers symmetrical 40kHz signals at its Q and Q outputs which are amplified in push-pull mode by transistors T1, T2, T3 and T4 to drive a low-cost, high-frequency piezo tweeter. For frequency adjustments, you may use an oscilloscope. It can be done by trial and error also if you do not have an oscilloscope. This pest repeller would prove to be much more effective than those published earlier because here ultrasonic frequency is automatically changed to cover different pests and the power output is also sufficiently high. If you want low-power output in 30-50 kHz ultrasonic frequency range then the crystal transducer may be directly connected across Q and Q outputs of IC4 (transistor amplifier is not necessary

Simple IF Signal Generator

Here is a versatile circuit of IF signal generator which may be of interest to radio hobbyists and professionals alike.Transistors T1 and T2 form an astable multivibrator oscillating in the audio frequency range of 1 to 2 kHz. RF oscillator is built around transistor T3. Here again a 455kHz ceramic filter/resonator is employed for obtaining stable IF. The AF from multivibrator is coupled from collector of transistor T2 to emitter of transistor T3 through capacitor C3. The tank circuit at collector of transistor T3 is formed using medium wave oscillator coil of transistor radio, a fixed 100pF capacitor C5 and half section of a gang capacitor (C6).
The oscillator section may be easily modified for any other intermediate frequency by using ceramic filter or resonator of that frequency and by making appropriate changes in the tank circuit at collector of transistor T3. Slight adjustment of bias can be affected by varying values of resistors R6 and R7, if required

Audio Light Modulator

Audio light modulations add to the enjoyment of music during functions organised at home or outdoors. Presented here is one such simple circuit in which light is modulated using a small fraction of the audio output from the speaker terminals of the audio amplifier. The output from the speaker terminals of audio amplifier is connected to a transformer (output transformer used in transistor radios) through a non-polarised capacitor. The use of transformer is essential for isolating the audio source from the circuit in The sensitivity control potentiometer VR1 provided in the input to transistor T1 may be adjusted to ensure that conduction takes place only after the AF exceeds certain amplitude. This control has to be adjusted as per audio source level. The audio signal Proper earthing of the circuit is quite essential. The diode bridge provides pulsating DC output and acts as a guard circuit between the mains input and pulsating DC output. Extreme care is necessary to avoid any electric shock.

Tuesday, July 28, 2009

PC based Frequency Meter

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

Simple Analog to Digital Converter

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

Control electrical appliances using PC

Here is a circuit for using the printer port of a PC, for control application using software and some interface hardware. The interface circuit along with the given software can be used with the printer port of any PC for controlling up to eight equipment .
The interface circuit shown in the figure is drawn for only one device, being controlled by D0 bit at pin 2 of the 25-pin parallel port. Identical circuits for the remaining data bits D1 through D7 (available at pins 3 through 9) have to be similarly wired. The use of opto-coupler ensures complete isolation of the PC from the relay driver circuitry.
Lots of ways to control the hardware can be implemented using software. In C/C++ one can use the outportb(portno,value) function where portno is the parallel port address (usually 378hex for LPT1) and 'value' is the data that is to be sent to the port. For a value=0 all the outputs (D0-D7) are off. For value=1 D0 is ON, value=2 D1 is ON, value=4, D2 is ON and so on. eg. If value=29(decimal) = 00011101(binary) ->D0,D2,D3,D4 are ON and the rest are OFF.

/*program to control devices using PC parallel port
The devices are controlled by pressing the keys 1-8
that corresponds to each of the 8 possible devices

#define PORT 0x378 /* This is the parallel port address */

char val=0,key=0;
char str1[]="ON ";
char str2[]="OFF";
char *str;
printf("Press the approriate number key to turn on/off devices:\n\n");
printf("Here Device1 is connected to D0 of parallel port and so on\n\n");
printf("Press \"x\" to quit\n\n");
printf("Device1:OFF Device2:OFF Device3:OFF Device4:OFF\n");
printf("Device5:OFF Device6:OFF Device7:OFF Device8:OFF");

while(key!='x' && key!='X')
printf("Value in hex sent to the port:");

case '1':


case '2':


case '3':


case '4':


case '5':


case '6':


case '7':


case '8':
printf("%x",(unsigned char)val);




Infrared beam barrier/ proximity sensor

This circuit can be used as an Infrared beam barrier as well as a proximity detector.
The circuit uses the very popular Sharp IR module (Vishay module can also be used). The pin nos. shown in the circuit are for the Sharp & VIshay modules. For other modules please refer to their respective datasheets.
The receiver consists of a 555 timer IC working as an oscillator at about 38Khz (also works from 36kHz to 40kHz) which has to be adjusted using the 10K preset. The duty cycle of the IR beam is about 10%. This allows us to pass more current through the LEDS thus achieving a longer range.
The receiver uses a sharp IR module. When the IR beam from the transmitter falls on the IR module, the output is activated which activates the relay and de-activated when the beam is obstructed. The relay contacts can be used to turn ON/OFF alarms, lights etc. The 10K preset should be adjusted until the receiver detects the IR beam.

The circuit can also be used as a proximity sensor, i.e to detect objects in front of the device without obstructing a IR beam. For this the LEDs should be pointed in the same direction as the IR module and at the same level. The suggested arrangement is shown in the circuit diagram. The LEDs should be properly covered with a reflective material like glass or aluminum foils on the sides to avoid the spreading of the IR beam and to get a sharp focus of the beam.
When there is nothing in front of them, the IR beam is not reflected onto the module and hence the circuit is not activated. When an object comes near the device, the IR light from the LEDs is reflected by the object onto the module and hence the circuit gets activated.

If there still a lot of mis-triggering, use a 1uF or higher capacitor instead of the 0.47uF.

Car anti theft wireless alarm.

This FM radio-controlled anti- theft alarm can be used with any vehicle having 6- to 12-volt DC supply system. The mini VHF, FM transmitter is fitted in the vehicle at night when it is parked in the car porch or car park. The receiver unit with CXA1019, a single IC-based FM radio module, which is freely available in the market at reasonable rate, is kept inside. Receiver is tuned to the transmitter's frequency. When the transmitter is on and the signals are being received by FM radio receiver, no hissing noise is available at the output of receiver. Thus transistor T2 (BC548) does not conduct. This results in the relay driver transistor T3 getting its forward base bias via 10k resistor R5 and the relay gets energised. When an intruder tries to drive the car and takes it a few metres away from the car porch, the radio link between the car (transmitter) and alarm (receiver) is broken. As a result FM radio module gene-rates hissing noise. Hissing AC signals are coupled to relay switching circ- uit via audio transformer. These AC signals are rectified and filtered by diode D1 and capacitor C8, and the resulting positive DC voltage provides a forward bias to transistor T2. Thus transistor T2 conducts, and it pulls the base of relay driver transistor T3 to ground level. The relay thus gets de-activated and the alarm connected via N/C contacts of relay is switched on. If, by chance, the intruder finds out about the wireless alarm and disconnects the transmitter from battery, still remote alarm remains activated because in the absence of signal, the receiver continues to produce hissing noise at its output. So the burglar alarm is fool-proof and highly reliable.

4 in 1 Burglar Alarm

I n this circuit, the alarm will be switched on under the following four different conditions: 1. When light falls on LDR1 (at the entry to the premises). 2. When light falling on LDR2 is obstructed. 3. When door switches are opened or a wire is broken. 4. When a handle is touched. The light dependent resistor LDR1 should be placed in darkness near the door lock or handle etc. If an intruder flashes his torch, its light will fall on LDR1, reducing the voltage drop across it and so also the voltage applied to trigger 1 (pin 6) of IC1. Thus transistor T2 will get forward biased and relay RL1 energise and operate the alarm. Sensitivity of LDR1 can be adjusted by varying preset VR1. LDR2 may be placed on one side of a corridor such that the beam of light from a light source always falls on it. When an intruder passes through the corridor, his shadow falls on LDR2. As a result voltage drop across LDR2 increases and pin 8 of IC1 goes low while output pin 9 of IC1 goes high. Transistor T2 gets switched on and the relay operates to set the alarm. The sensitivity of LDR2 can be adjusted by varying potentiometer VR2. A long but very thin wire may be connected between the points A and B or C and D across a window or a door. This long wire may even be used to lock or tie something. If anyone cuts or breaks this wire, the alarm will be switched on as pin 8 or 6 will go low. In place of the wire between points A and B or C and D door switches can be connected. These switches should be fixed on the door in such a way that when the door is closed the switch gets closed and when the door is open the switch remains open. If the switches or wire, are not used between these points, the points should be shorted. With the help of a wire, connect the touch point (P) with the handle of a door or some other suitable object made of conducting material. When one touches this handle or the other connected object, pin 6 of IC1 goes ‘low’. So the alarm and the relay gets switched on. Remember that the object connected to this touch point should be well insulated from ground. For good touch action, potentiometer VR3 should be properly adjusted. If potentiometer VR3 tapping is held more towards ground, the alarm will get switched on even without touching. In such a situation, the tapping should be raised. But the tapping point should not be raised too much as the touch action would then vanish. When you vary potentiometer VR1, re-adjust the sensitivity of the touch point with the help of potentiometer VR3 properly. If the alarm has a voltage rating of other than 6V (more than 6V), or if it draws a high current (more than 150 mA), connect it through the relay points as shown by the dotted lines. As a burglar alarm, battery backup is necessary for this circuit. Note: Electric sparking in the vicinity of this circuit may cause false triggering of the circuit. To avoid this adjust potentiometer VR3 properly.

Melody generator for greeting cards

This tiny circuit comprising of a single 3 terminal IC UM66 can be built small enough to be placed inside a greeting card and operated off a single 3V flat button cell.
There is not much to the circuit. The UM66 is connected to its supply and its output fed to a transistor for amplification. You can either use a 4ohm speaker or a " flat" piezoelectric tweeter like the one found in alarm wrist watches.
If you use the piezo, then it can be connected directly between the output pin 1 and ground pin 3 without the transistor.
The UM66 looks like a transistor with 3 terminals. It is a complete miniature tone generator with a ROM of 64 notes, oscillator and a preamplifier. When it first came into market, it was programmed for the "Jingle bells" tune. Now they come with a wide variety of different tunes.

Water Level Indicator with alarm

This circuit not only indicates the amount of water present in the overhead tank but also gives an alarm when the tank is full.
The circuit uses the widely available CD4066, bilateral switch CMOS IC to indicate the water level through LEDs.
When the water is empty the wires in the tank are open circuited and the 180K resistors pulls the switch low hence opening the switch and LEDs are OFF. As the water starts filling up, first the wire in the tank connected to S1 and the + supply are shorted by water. This closes the switch S1 and turns the LED1 ON. As the water continues to fill the tank, the LEDs2 , 3 and 4 light up gradually.
The no. of levels of indication can be increased to 8 if 2 CD4066 ICs are used in a similar fashion.

When the water is full, the base of the transistor BC148 is pulled high by the water and this saturates the transistor, turning the buzzer ON. The SPST switch has to be opened to turn the buzzer OFF.
Remember to turn the switch ON while pumping water otherwise the buzzer will not sound!

Rain Alarm

This circuit gives out an alarm when its sensor is wetted by water.
A 555 astable multivibrator is used here which gives a tone of about 1kHz upon detecting water.
The sensor when wetted by water completes the circuit and makes the 555 oscillate at about 1kHz.

The sensor is also shown in the circuit diagram.
It has to placed making an angle of about 30 - 45 degrees to the ground. This makes the rain water to flow through it to the ground and prevents the alarm from going on due to the stored water on the sensor.
The metal used to make the sensor has to be aluminium and not copper. This is because copper forms a blue oxide on its layer on prolonged exposure to moisture and has to be cleaned regularly.
The aluminium foils may be secured to the wooden / plastic board via epoxy adhesive or small screws.
The contact X and Y from the sensor may be obtained by small crocodile clips or you may use screws.

Theft preventer alarm

This circuit utilising a 555 timer IC can be used as an alarm system to prevent the theft of your luggage, burglars breaking into your house etc. The alarms goes ON when a thin wire, usually as thin as a hair is broken.
The circuit is straightforward. It uses a 555 IC wired as an astable multivibrator to produce a tone of frequency of about 1kHz which gives out a shrill noise to scare away the burglar.
The wire used to set off the alarm can be made of a thin copper wire like SWG 36 or higher.
You can even use single strands of copper form a power cable.

The circuit operates on a wide range of voltages from 5V to 15V.
The speaker and the circuit could be housed inside a tin can with holes drilled on the speaker side for the sound to come out.

Power supply failure alarm

Most 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 supply fails.
This circuit can be used as an alarm for power supplies in the range of 5V to 15V.
To calibrate the circuit, first connect the power supply (5 to 15V) then vary the potentiometer VR1 until the buzzer goes from on to off.
Whenever the supply fails, resistor R2 pulls the base of transistor low and saturates it, turning the buzzer ON.

TV remote control Blocker

Just point this small device at the TV and the remote gets jammed . The circuit is self explanatory . 555 is wired as an astable multivibrator for a frequency of nearly 38 kHz. This is the frequency at which most of the modern TVs receive the IR beam . The transistor acts as a current source supplying roughly 25mA to the infra red LEDs. To increase the range of the circuit simply decrease the value of the 180 ohm resistor to not less than 100 ohm.

It is required to adjust the 10K potentiometer while pointing the device at your TV to block the IR rays from the remote. This can be done by trial and error until the remote no longer responds.

JAM(Just A Minute) Circuit

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