A "Clap On Clap Off" switch is an interesting concept that could be used in home automation. It works as a switch which makes devices On and Off by making a clap sound. Although its name is “Clap switch”, but it can be turned ON by any sound of about same pitch of Clap sound. The main component of the circuit is the Electric Condenser Mic, which has been used as a sound sensor. Condenser Mic basically converts sound energy into electrical energy, that in turns used to trigger 555 timer IC, through a Transistor. And triggering of 555 ic works as a Clock pulse for D-type flip-flop and would turn ON the LED, which will remain ON until the next clock pulse means until the next Clap/sound. So this is the Clap Switch which will turn ON with first Clap and turn OFF with the second Clap. If we remove the D-type Flip flop from the circuit, the LED will be turned OFF automatically after some time and this time will be 1.1xR1xC1 seconds, which I have explained in my previous circuit of clap switch. For better understanding, I recommend to study the previous circuit before study this one.
Working Explanation
Here we are using Electric Condenser Mic for sensing the sound, transistor to trigger the 555 timer IC, 555 IC to SET & RESET the D-type flip flop and D-type flip flop to remember the logic level (LED ON or OFF) until next Clap/sound.
Components
Condenser Mic
555 Timer IC
Transistor BC547
Resistors (1k, 47k, 100k ohm)
Capacitor (10uF)
IC7474 more precisely DM74S74N (D-type flip flop)
LED and Battery (5-9v)
Circuit Diagram and Explanation
You can see the connections in above "clap on clap off circuit diagram". Initially the transistor is in OFF state because there is not enough (0.7v) base-emitter voltage to turn it ON. And the point A is at high potential, and point A is connected to Trigger pin 2 of 555 IC, as a result Trigger pin 2 is also at high potential. As we know that, to trigger the 555 IC through Trigger PIN 2, the voltage of the PIN 2 must be below Vcc/3. So at this stage no output at OUT PIN 3, means no clock pulse for D-type Flip-flop (IC 7474), thereby no response from D-type Flip-flop, and so LED is OFF.
Now when we produce some sound near condenser mic, this sound will be converted into electrical energy and it will raise the potential at the Base, which will turn the Transistor ON. As soon as the transistor becomes ON, the potential at Point A would become low and it will trigger the 555 IC because of the low voltage (below Vcc/3) at Trigger Pin 2. So the output PIN3 will be high and a positive clock pulse will be applied to D-type Flip-flop, which makes Flip-flop to respond and LED will turn ON. This SET state of flip flop will remain as it is until the next clock pulse (next Clap). Detailed working of D-type Flip-flop has been given below.
Here we are using 555 timer IC in Monostable Mode, whose output (PIN 3 of 555 IC) has been used as a clock pulse for D-type Flip-flop. So the clock pulse will be HIGH for 1.1xR1xC1 seconds and then it would become LOW. You can learn 555 IC operations through some 555 timer circuits HERE.
Working of D-type Flip-flop
Here we are using Positive Edge Triggered D-type flip-flop, which means this flip flop only responds when clock pulse would go from LOW to HIGH. OUTPUT Q will be shown according to state of INPUT D, at the time of the Clock pulse transition (Low to High). Flip flop remembers this OUTPUT state Q (Either HIGH or LOW), until the next positive clock pulse (Low to High). And again shows the OUPUT Q, according to the input state D, at the time of clock pulse transition (LOW to HIGH)
D-type Flip-flop is basically the advanced version of S-R flipflop. In S-R flipflop, the S=0 and R=0 is forbidden, because it is making the flip-flop behaving unexpectedly. This problem is resolved in D-type Flip-flop, by adding a Inverter between both the inputs (see the diagram) and the second input is given by the Clock pulse to both the NAND gates. Inverter is introduced to avoid same logic levels at both the inputs, so that “S=0 and R=0” condition never occurs.
D-type Flip-flop doesn’t change its state while clock pulse is low, because it gives the output logic level “1” at NAND gates A and B, which is the input for NAND gates X and Y. And when both the inputs are 1 for NAND gates X and Y, then output don’t change (remember S-R flip-flop). The conclusion is that it will not change its state while clockpulse is LOW, regardless of INPUT D. It only change when there is transition in Clock pulse from LOW to HIGH. It won’t change during the HIGH and LOW period. We can deduce the truth table for this D-Flip-flop:
Clk |
D |
Q |
Q' |
Description |
↓ » 0 |
X |
Q |
Q' |
Memory |
↑ » 1 |
0 |
0 |
1 |
Reset Q » 0 |
↑ » 1 |
1 |
1 |
0 |
Set Q » 1 |
IC 7474
We have used IC DM74S74N of 7474 series. IC DM74S74N is the Dual D-type Flip-flop IC, in which there are two D-type Flip-flops, which can be either used individually or as a master-slave toggle combination. We are using one D-type Flip-flop in our circuit. Pins for first D flip-flop are the left side and for second flip flop are at right side. Also there are PRE and CLR pins for both the D-type Flip-flops which are active-low pins. These pin used to SET or RESET the D-type Flip-flop respectively, regardless of INPUT D and Clock. We have connected both to Vcc to make them inactive.
After understanding the D-type Flip-flop and IC DM74S74N, we can easily understand the use of D-type Flip-flop in our circuit. When we first triggered the 555 IC by first Clap, the LED glows as we get Q=1 and Q’=0. And it will remain ON until the next trigger or next positive clock pulse (LOW to HIGH). We have connected Q’ to to INPUT D, so when LED is glowing, Q’=0 is waiting for Second Clock pulse, so that it can be applied to the INPUT D and makes Q=0 and Q’=1, which in turns TURN OFF the LED. Now Q’=1 is waiting for next clock pulse to make the LED turn ON by applying Q’=1 to INPUT D, and so on this process will continue.
To test this circuit you need to clap loudly as this small condenser mic don’t have long range. Or you can directly hit at the mic lightly (like I have done in the video).
Some Important Points
- If circuit doesn’t works at first, then connect the CLR (PIN1 of IC DM74S74N) to the ground to RESET the flip-flop, then again connect to Vcc as shown in circuit.
- We can modify this circuit using Relay to control the Electronic devices (120/220V AC).
- Control PIN 5 of 555 Timer IC should be connected to Ground through a 0.01uF capacitor.
- We should use a 220 ohm resistor to connect LED.
Comments
To operate 220v appliances,
To operate 220v appliances, you need to interface Relay in place of LED. Check this article for using Relay module. Basically you need to connect Input of Relay module (I/P) to the Q (5) output of D type flip flop.
Will this work if i use a 6V
Will this work if i use a 6V source?
How can i adjust the
How can i adjust the sensitivity of the microphone?
By using the proper value of
By using the proper value of Pull-Up resistor with your Mic, refer datasheet. Or use variable resistor and try different values. Or use different Microphone.
clap switch
Can I use BC548 /BC 557 transistor in place of BC547
Yes you can use. There
Yes you can use BC548. But don't use BC557 as it is a PNP transistor and we are using NPN here.
not working
i used 74f74pc ic and im having problem , when i connect battery ,light gets onn and remain on what should i do ???
YOU LEFT PINS 8 , 9 , 10 ,11,
YOU LEFT PINS 8 , 9 , 10 ,11, 12, 13 OF DM74S74N
Yes, we left those PINs as we
Yes, we left those PINs as we are only using one D type Flip Flop (out of two) inside the IC. Please check the PIN diagram and description.
thank you abhishek for reply
thank you abhishek for reply i really appreciate you , please let me know on more thing , i used f74f74pc ic . when i connect 9v battery so led(Red) remain onn , mean without any clap it gets on .. am i using wrong ic ???
This particular circuit is
This particular circuit is quite complex to design. Either you need to use three mic at distance or you need to cut out the one mic after trigger. You should try to do this using Microcontroller, or use IC4017 but latter will increase the complexity. Share here if you achieve this.
Thanks
Pls can I use 74Ls174 ic for
Pls can I use 74Ls174 ic for my clap on clap off switch? If yes how can I connect to pins
Although 74LS174 consists six
Although 74LS174 consists six D-type Flip Flop but it doesn't have Q' (Q bar) at the output, which is required in this circuit to be fed back into D input. You can use 74LS174, but circuit need to be modified accordingly and may need to use a NOT gate at output Q to generate Q bar. Better use 74LS175, it has four D type Flip flop with both Q and Q bar.
Yes because its an ic that
Yes because its an ic that you can use in the circuit and that is the alternate for that ic
Thank u very much!!. Its now
Thank u very much!!. Its now I understand what d flip flop ic is all about. But honestly maddy am still new to this system. So hw am I to create a nor gate. Or may be I shud go read about logic gates
Not working
Hi, i made the same circuit as yours, same components, eneverything. My Flip Flop starts overheating when i connect de 1 with 4 and after VCC.
Please help
Circuit Doesnt Works...I have couple of Questions
It doesn't work...Can you pls tell me where to put R2. And do I have to do the following steps as you mentioned:
•Control PIN 5 of 555 Timer IC should be connected to Ground through a 0.01uF capacitor.
•We should use a 220 ohm resistor to connect LED.
Pls help. I am stuck after making the whole circuit.
Regards
Rashid Qureshi
Ignore R2 and these two steps
Ignore R2 and these two steps are not necessary.
You can get it from local
You can get it from local electronics market or can order online, the detail about the IC is explained in above comment.
Plz solution
i used MC74ACT74N ic and im having problem , when i connect battery ,light gets onn and remain on
Check the datasheet of
Check the datasheet of MC74ACT74N and do the connections accordingly. Then try using 10k pull up resistor for condenser mic. Also check all the above comments if they solve your problem.
Hi. I used 74LS74AP and the
Hi. I used 74LS74AP and the connections are the same as DM74S74N but my problem is when I connect the battery the LED is on and remains on even after I clap. Can you help me please? Thank you very much.
its already without relay. I
its already without relay. I think you want to ask, that whether it will work with relay. Yes, you can interface Relay to control AC appliances like here Remote Controlled Light Switch. And this is a single cable, not connected anywhere, it is just banded, and the band has been cut in the image. Follow Circuit Diagram, instead of image.
I made the same circuit like
I made the same circuit like you with SN74S74N (same dataseet), when i connect to battery the led is off and when i clap led get on and remains on even after i clap again.
Circuit-Not working
Hi. I am trying to do this circuit without D flip flop so I'm taking output directly from PIN3. But the circuit is not working. No value is changing on base of transistor when clap..
You mean this one: Simple
You mean this one: Simple Clap Switch, its working please check.
I made the same circuit like
I made the same circuit like you with SN74S74N (same dataseet), when i connect to battery the led is off and when i clap led get on and remains on even after i clap again. what should i do?
LED is lit up even without clapping
I made the same circuit with DM74LS74AN. What changes can i do so that the circuit will work?
yes, it should but better use
yes, it should but better use 9v battery as shown or some 5v source.
thanks alot , is there an
thanks alot , is there an equivalent of IC DM74S74N? coz i have searched for it and failed to get
I want to use a 741 op
I want to use a 741 op-amplifier, beacause the elctret mic is not working properly so can you please give me the full circuit diagram after adding the op-am in the circuit. Thanks :)
I used ic 74AC74PC, but the
I used ic 74AC74PC, but the led remains "on" and does not respond to clap.
please reply ASAP.
Check datasheet 74AC74PC and
Check the datasheet of 74AC74PC and do the connections accordingly.
2N3904 Transistor
Can I use a 2N3904 NPN Transistor instead of the BC547?
Thanks 4 sharing the circuit.
Thanks 4 sharing the circuit. Its working fine. But mic is not working from distance. How it can be connected to house hold appliance
Yes you can control household
Yes you can control household appliances by using Relay in place of LED. Check this Link for "How to use Relay"
Clap sound
Is it ponsible to include the remote control system in the circuit of the clap sound? If yes how should I do it?
You can try this circuit
You can try this circuit Remote Controlled Light Switch
I guess S=0 and R=0 state is
I guess S=0 and R=0 state is there in SR flipflop. The S=1 and R=1 state gives invalid results instead.
Do we have any specific
Do we have any specific condenser mic used for clap switch?
It works, but..
Thank you for your diagram.
It works, but...
but it works in reversed way.
I mean that, when I clap, it turn off. then after 3 sec, it turn on again.
Please do some fix, mate !
Ic problem
Is it possible to use a cd4027be IC and can it be possible to use a 2n222 transistor instead.
check its datasheet whether
check its datasheet whether It have all the pins needed in the circuit.
clock pulse
how do we supply the clock pulse.and is it -ve edge trigered
Clock Pulse is being supplied
Clock Pulse is being supplied by 555 Timer IC here and its +ve edge triggered.
usinng of d type ic
sir, can I use d type flip flop M74LS74P in this circuit???
How to use in AC current circuit
I want to use this sweech in AC circuit to on/off my fan then how to use this sweech.
Use Relay to operate AC
Use Relay to operate AC appliances like here Automatic Staircase Lights using PIR Sensor and Relay
Pleaae help me
Plz help me
I have alredy made but When testing
when I clamp the sound The LED is turned On but when I clamp again the LED is not become completly off .Meaning that instead of it must trun off but LED get alittle supply voltage so the LED is lighting alittle in Off mode
Please help me
What to do if I want clap on
What to do if I want clap on and off circuit to use for 220V aupply,i.e.how to connect relay?
about relay
how to introduce the relay in this circuit?do you have a diagram for that?
@Anshul @shahrukh: You can
@Anshul @shahrukh: You can use Relay module and learn about using the Relay in circuit here.
Kindly can you please create
Kindly can you please create a video with step by step instructions on how to create a clap on clap off switch. Email it on my email []
Is it okay to use SN74LS74N?
Is it okay to use SN74LS74N? And how do i introduce the relay on the circuit? Do i ned to parallel a diode between gnd and output on flipflop?
Yes its a Good Idea, as 4017
Yes its a Good Idea, as 4017 can also latch the output check this one: Toggle Switch
hey, i have make a simulation
hey, i have make a simulation on your circuit...but it is not working...the led does not turn on...are there any mistake on your circuit...Please reply ASAP
Instead of a condensor mic,
Instead of a condensor mic, can you use a loud speaker?
The data sheet for the D flip
The data sheet for the D flip flop says the IC has a max voltage of 5.25 V. How does this work with a 9V source?
Electrical impulse
I have to snap 3-4 times as current flowing to the base of transistor i.e electrical impulses released by mic are too less!! what should I do?
Increase sensitivity of mic
U can increase the sensitivity of the mic by connecting a 100 nF capacitor with the positive of the kick and the other end to theBase of the transister also connect 2 10 k ohm resister one from the capacitor to Vcc and the others from collector of the transister to Vcc ,also connect a 1m resister from the Base of the transister (i.e from one end of the capacitor) to the Vcc . And continue the output from the collector to ic 1 as shown above. It worked for me!
Can you please elaborate your
Can you please elaborate your statement? I hope it will work
Please help
I did everyrhing as the circuit diagram 3 times but when i connect battery the led remains on and does not switch off even if i clap. The 7474 also becomes warm.
i made clap on off switch but it doesnt off
i made the circuit but the light is not being off after being on
once
can I use ic 74ac74pc instead
can I use ic 74ac74pc instead of ic Dm74s74n in this circuit
Check if your IC has two D
Check if your IC has two D-type flip flop, if yes then you can use it.
Clap ON/OFF s/w to drive Motor
I am using the same circuit. Its working fine with LED and Buzzer at the output. Now I am trying to drive a Motor through driver IC ULN2803. The Motor turns on but turns off immediately before receiving the second clap. Do I need to do anything different then this.The Motor is 6v Dc 100rpm Motor.
clap switch
I connected the components as instructed but when I clap the led doesn't even turn on, what could be the possible reasons?
its doesnt work
i follow all the step and use all the component that being mention,but the led light up already after a battery is being supply to the circuit. it does not required any clap. please help me. i need to do this for my final year project. any idea?
Gcb board structure of above circuit
Sir can share Gcb board structure of above project
Yes you can replace the LED
Yes you can replace the LED with a relay driver circuit and control the relay
Which transistor can use for
Which transistor can use for relay driver according to tis circuit
You can use the normal BC547
You can use the normal BC547 transistor.
where is you R2 Resistor in your diagram?, because in the list of your resistors they are 4 resistor which is 1k, 10k, 47k, and 100k, so where is 10k or R2?