Sound operated Remote Control

An infrared or wireless remote control has the disadvantage that the
small, handy, remote transmitter is often lost. A sound operated switch
has the advantage that the transmitter is always with you. This project
offers a way to control up to four latching switches with two claps of
your hand. These switches may be used to control lights or fans - or
anything else that does not produce too loud a sound.

To prevent an occasional loud sound from causing malfunction, the circuit
is normally quiescent. The first clap takes it out of standby and starts
a scan of eight panel mounted l.e.d's. Each of four switches have two
l.e.d's - one for "on" and the other for "off". A second clap when the
appropriate lamp is lit activates that function. For example, if you clap
while the led labelled "Gizmo 1 on" becomes lit then Gizmo 1 turns on (if
it is already on, nothing happens).

How it works

A condenser microphone as used in tape recorders is used to pick up the
sound of your claps. The signal is then amplified and shaped into a pulse
by three inverters contained in a cmos hex inverter type 4069.

 A clock generator built from two inverters supplies clock pulses to a
counter, type 4017. Eight outputs of this IC drive leds. These outputs
also go to the J and K inputs of four flip-flops in two ICs type 4027.
The clock inputs of these flipflops are connected to the pulse shaped
sound signal.

Additional circuitry around the 4017 ensure that it is in the reset
state, i.e., count 0, after reaching count 9 and that the reset is
removed only when a sound signal is received.

The outputs of the four flip-flops are buffered by transistors, and fed
via leds to the gates of four triacs. These triacs switch the mains
supply to four loads, usually l.e.d's. If small lamps are to be
controlled they may be directly driven by the transistors.

If this circuit is to be active, i.e., scanning, all the time, some
components around the 4017 may be omitted and some connections changed.
But then it should be noted that the circuit is then no longer immune to
an occasional, spurious, loud sound.

Circuit description

The condenser microphone usually available in the market has two
terminals. It has to be supplied with power for it to function. Any
interference on this supply will be passed on to the output. So the
supply for the microphone is smoothed by R2, C1 and fed via R1.

CD4069UBE is a "hex unbuffered inverter". This IC contains six similar
inverters. When the output and input of such an inverter is connected by
a resistor, it functions as an inverting amplifier.

C2 couples the signal developed by the microphone to one stage in this
IC, U1, connected as such an amplifier. The output of U1 is directly
connected to the input of the next stage, U2. C3 couples the output of
this to U3, which is connected as an adjustable level comparator. U4 is
connected as a led driver to help in setting the sensitivity.

PI Supplies a variable bias to U3. If the wiper of P1 is set towards the
negative supply end the circuit becomes relatively insensitive (i.e.,
requires a thunderous clap in order to operate). As the wiper is turned
towards R4, the circuit becomes progressively more sensitive. The sound
signal supplied by U2 is added to the voltage set by P1 and applied to
the input of U3. When this voltage crosses half supply voltage, the
output of U3 will go low. This output is normally high since the input is
held low by P1.

This output is used for two things: it releases the reset state of IC2
via D1. It also feeds the clock inputs of the four flipflops contained in
IC3 and IC4. In the quiescent state, IC2 is reset and its "0" output is
high. C4 is charged positively and holds this charge due to the
connection by R5 to this output.

IC2 is a decade counter with fully decoded outputs. It has ten outputs
labelled 0 to 9 and they go successively high one at a time when the
clock input is fed with pulses. IC3 & IC4 are dual JK flip-flops. In this
circuit they store the state of the four switches, and control the output
through transistors and triacs.

At the first clap, the output of U3 goes low. D1 is forward biased and it
conducts, discharging C4. The reset input of IC2 goes low, releasing its
reset state. All the J and K inputs of the four flip-flops are low and so
they do not change state even though their clock inputs receive pulses.

U5 and U6 are connected as a slow clock generator. This supplies a square
wave to the clock input of IC2. The period of this clock is directly
proportional to the product of R6 and C5. The clock may be speeded up by
reducing the value of C5, or slowed down by increasing it. When the reset
input of IC2 is low, each pulse causes IC2 to advance by one count. Its
outputs go high successively, lighting up the leds connected to them, and
pulling high the J and K inputs of the four flip-flops one by one. R8
limits the current through leds 1 to 8 to about 2mA. Larger currents
might cause malfunction due to the outputs of IC2 being pulled down below
the "1" state input voltage. High efficiency leds should preferably be
used here.

If a second clap is detected while the J input of a particular flip-flop
is high its Q output will go high, regardless of what state it was in
previously. Similarly if its K input was high, the output will go low.
(If both J and K are high the output will change state at each clock
pulse.) Thus although all flip-flops receive the clap signal at their
clock inputs, only the one selected by the active output of IC2 will
change state. R9 and C6 ensure that the flip-flops start in the off state
when power to the circuit is switched on by providing a positive pulse to
the reset inputs when power is applied. The pre-set inputs are not used
and are therefore connected directly to ground.

When, after eight clock pulses, output 8 of lC2 becomes high, diode D2
conducts, charging C4, resetting IC2, and making its 0 output high. And
there it stays, awaiting the next clap.

The four Q outputs of IC3 and IC4 are buffered by NPN transistors, fed
through current limiting resistors and leds to indicate the status of the
loads, to the gates of four triacs. Four lights operating on the mains
may thus be controlled. For demonstrations, it might be better to drive
small lamps (drawing less than 100 mA at 12V) directly from the emitters
of the transistors. In this case the triacs, leds and their associated
current limiting resistors may be omitted.

It has to be noted that one side of the mains has to be connected to the
negative supply line of this circuit when mains loads are to be
controlled. This necessitates safe construction of the circuit such that
no part of it is liable to be touched. The advantage is that it may be
mounted out of reach of curious hands since it does not need to be
handled during normal operation.

Construction

Experienced constructors would prefer to plug everything in, apply power,
and then start troubleshooting once they see smoke rise from the ruins of
their circuit. Less experienced people would be well advised to go about
it in a less drastic, more systematic way.

The first step would be to get together all the components. Decide on
whether to use low voltage or mains operated loads and vary your purchase
list accordingly. Transistor BC547 is rated at 200mA maximum collector
current and so, to be on the safe side the lamps will have to be 100mA,
12V. The current drawn from the supply when four such lamps light
simultaneously will be 400mA, which is nearly the maximum rating of the
transformer specified. Anyway it is advisable to start with the low
voltage version and then upgrade to mains operation once you are sure
everything else is working satisfactorily.

CMOS lCs are used in this circuit for implementing the amplifying and
logic functions. Using a dedicated supply is recommended because the
integrated circuits will be damaged if the supply voltage is too high or
of the wrong polarity. An external power supply may get connected up the
wrong way around, or be inadvertently set to too high a voltage.

Therefore it is a good idea to start by constructing the power supply
section. For a start, the transformer and the circuit board may be
fastened to an insulated base for testing. One side of the 12-0-12V
transformer will have two leads coming out. These two go to the mains.
Securely insulate the mains connections because the human body is highly
intolerant of even momentary contact with the mains voltage. Use of a
mains connector block is recommended for mechanical rigidity of the mains
connection. The other side of the transformer will have three leads. This
is the low voltage output. The centre lead is connected to the negative
supply line (this is referred to as "gnd" or common) and the other two go
to the two diodes. Do not connect the circuit common to the neutral line
of the mains at this stage.

The diodes are polarised, i.e, have a "head" and "tail", and so, should
be connected the right way around. The end of the diodes having a band
should point towards the capacitor, C7. This capacitor also is polarised.
The positive lead will usually be longer, and the negative lead marked on
the side of the capacitor body by a minus symbol and arrow. Take care.
Reverse connecting this capacitor may cause it to explode with a loud
sound, scattering its contents far and wide, and scaring members of your
family so much that you may be coerced into signing up and ratifying an
Electronics Circuit Non Proliferation Treaty.

The power supply consists of the transformer, the two diodes D3 & D4 and
the capacitor, C7. It is possible to connect it up so that the output is
24V instead of the required 12V. So check up that the supply voltage is
correct. If you have no access to a meter use a 12V bulb. It will light
at normal brilliance when connected across the positive and negative
supply lines. If it gives up the ghost with a brilliant flash you have
mixed up the transformer connections. Rectify and buy a new bulb. Next,
the sockets for the integrated circuits may be fitted. You need one 14
pin and three 16 pin IC sockets, Check again, with the bulb, that the
supply voltage is indeed present across pins 7 & 14 on the 14 pin socket,
and across pins 8 & 16 on the 16 pin sockets.

The eight leds (1 to 8) and resistor R8 may next be fitted. The 4.7
kilohm resistor is identified by the colours yellow, violet, red followed
by the tolerance band which would be either gold or silver, The resistor
is not polarised, and may be fitted whichever way you like, The leds
will, however, only light up if fitted the right way around. The longer
lead is positive and goes to the ICs. The other lead connects to R8. The
leds may be checked for correct operation by applying power, and probing
the appropriate pins of the 4017 and 4027 sockets with a wire connected
to the positive supply line. Led1 will light up when pin 2 of socket 2 is
probed. It will also light when pin 6 of socket 3 is probed. All eight
leds should thus be checked for correct operation, by probing the
appropriate pins of both sockets, before proceeding further. Errors such
as reversed leds and faulty solder Joints are easy to catch now. It will
be much difficult later, because the number of components to be suspected
in case of malfunction go up as we proceed with constructing the circuit.

When you have succeeded in making the eight leds light up you may connect
led 9 and the associated resistor, R10. Check that this led lights up
when the appropriate pin of IC1 socket is connected to Vcc. This led is
fitted for help in initial setting up and may later be removed.

The four transistors, emitter resistors (R1 1 to R18) and leds (10 to
13)may next be fitted. If you are using triacs, you may choose to mount
them later. The supply may again be switched on and correct operation of
the output stages verified by connecting each transistor base to
positive. The leds should light when the connection is made, and turn off
when it is removed. These leds are run at about 20 mA, and will therefore
be much brighter than leds 1 ... 8.

All other components, except the condenser microphone, should next be
connected. Take care to fit the two diodes, D1 and D2 the right way
around. C1 is also a polarised capacitor and so should be the right way
up although it won't explode if reversed. After a visual check that
everything has been fitted the way it is in the circuit diagram discharge
C7 by short-circuiting it, Insert IC1 into its socket. It is possible to
fit it the wrong way around and then it usually goes dead when power is
applied. So check that it is the right way up.

Link pins 2 and 14 of the socket for IC2 with a piece of wire. This
connects the output of the clock generator to led1.. When power is
applied this led should flash at a steady rate. If it does not, you have
to do some troubleshooting before proceeding further. For the clock to
work properly, IC1, R6, R7 & C5 have to be good. In particular, C5 has to
be a low leakage type. Electrolytic capacitors may not be used in this
position. Remove the wire link.

If the clock is working, you may turn your attention to the amplifier.
Led9 should be off, and flash when the terminals of C2 are touched with a
wet finger (this is the classic Wet Finger Test). Pre-set P1 may need to
be adjusted until Ied9 just turns off. The output of U2 will be at about
half the supply voltage. The output of U3 would normally be high.
Otherwise, you have to suspect (and try replacing) IC1, R3, C2 & C3. The
voltage at the input of U3 should be variable by adjusting P1 (if not,
the culprit is possibly R4 or PI or C3). If these check out all right,
then the mic can be connected in place. The microphone has two terminals,
one of which is connected to its body. This terminal has to be connected
to circuit ground, and the other, to the junction of R2 & C2. These wires
are preferably kept short (one or two cm) to avoid noise pickup. With the
microphone connected, a loud sound (a clap) should result in Ied9
blinking. Adjust P1 so that this led stays off on the loudest of
background noises and yet comes on at your clap.

The work is now practically over. Switch off, discharge the power supply
capacitor and fit IC2. Check that it is the right way around. Switch on,
stand back and watch as leds 1 to 8 light up in sequence, one by one, one
at a time, once. A clap should start the sequence. It is an error if a
clap does nothing, or if they light up without the clap signal. P1 may
need to be readjusted. If nothing happens, check the orientation of
diodes D1 & D2 and that C4 is good. Also check that pin 13 (inhibit) of
IC2 is connected to ground, and that the clock is reaching pin 14.

If the clap-to-start feature is not required, it may be disabled by
omitting D1, D2, R5 & C4 and connecting a wire link in place of D2. Then
IC2 will be alive and kicking all the time.

Next, IC3 and IC4 may be fitted (discharge C7!), and the operation of the
complete circuit checked. Leds 10 to 13 monitor the states of the four
l.e.d's. If any l.e.d does not respond the problem is most probably a
defect 4027, or a bad joint. Swap the two ICs to find Out. And that's it.
The triacs may be fitted, and the circuit tried out with mains operated
loads. Take all necessary precautions against electric shock during such
tests. Do not touch the circuit when mains is connected to it. Use an
insulated tool for adjusting P1. The circuit should preferably be fitted
into a plastic case before connection to the mains is attempted. If any
triac does not seem to be working, check that it has been connected the
right way around. Switch off and unplug before touching the circuit, or
our next project might be one constructor short!

Front Panel

That the electronics works is all very well, but most people would tend
to judge your work by its external appearance. It is not too difficult to
make a presentable front panel using commonly available materials and
tools. A method of construction is suggested.

A transparent panel backed by a translucent film on which legends are
printed is common in electronic equipment. This is usually back lit by
l.e.d's to indicate the status of operation, A translucent sheet, e.g.
tracing paper, is used to draw and mark the front panel legends. A
stencil and Indian ink may be used or you may use a printer. A Perspex or
similar sheet may be cut to size and drilled for fitting leds 1 to 8.
Then the paper is stuck to the Perspex sheet and the leds fitted. Leds 10
to 13 are fitted some distance behind the panel such that they illuminate
the lettering on it, Thus the leds run at a low current (1 to 8) are
viewed directly while those at a high current are used for back lighting.

The entire circuit should be housed in a plastic cabinet. Use of a mains
connector strip for connecting to the mains and the loads will be a great
help when, after some time, you wish to make changes to the wiring. It is
worthwhile using a pot with a plastic spindle for P1 if you are building
this circuit into a substantial cabinet. This avoids having to dismantle
the cabinet each time the sensitivity has to be adjusted.

Calibration & Operation

There isn't much to calibrate. Preset (or Pot) P1 is adjusted such that
any momentary sound causes Ied9 to light, while the background noises do
not. Using it involves clapping twice, once to wake it up, and then once
again to turn on or off the desired load. Good Luck.



