Introduction: Turn Your Lights on With Clapping?!

Wouldn't it be nice to turn on your lights without getting off the couch? In this project I am going to show you how to build a simple Arduino clap circuit which can turn on and off all kinds of AC appliances. Let's get started!

Step 1: Watch the Video!

The video gives you an overview on how to build this project. But I am going to present you more detailed information in the following steps to make your life easier.

Step 2: Order Your Parts!

Here you can find a list of all the components with example sellers:

Ebay:

1x ATtiny85: http://rover.ebay.com/rover/1/711-53200-19255-0/1?...

1x NE5534: http://rover.ebay.com/rover/1/711-53200-19255-0/1?...

2x IC Socket: http://rover.ebay.com/rover/1/711-53200-19255-0/1?...

1x Electret Microphone: http://rover.ebay.com/rover/1/711-53200-19255-0/1?...

1x 20kΩ Potentiometer: http://rover.ebay.com/rover/1/711-53200-19255-0/1?...

1x Knob: http://rover.ebay.com/rover/1/711-53200-19255-0/1?...

1x Resistor Kit (various): http://rover.ebay.com/rover/1/711-53200-19255-0/1?...

1x 100nF Capacitor: http://rover.ebay.com/rover/1/711-53200-19255-0/1?...

1x 1N4002 Diode: http://rover.ebay.com/rover/1/711-53200-19255-0/1?...

1x BC 637 NPN Transistor: http://rover.ebay.com/rover/1/711-53200-19255-0/1?...

1x FRS1B-S-DC05 Relay: http://rover.ebay.com/rover/1/711-53200-19255-0/1?...

1x Power Supply 230V/5V 500mA: http://rover.ebay.com/rover/1/711-53200-19255-0/1?...

1x AC Socket (Input): http://rover.ebay.com/rover/1/711-53200-19255-0/1?...

1x AC Socket (Output): http://rover.ebay.com/rover/1/711-53200-19255-0/1?...

Bridge Wire: -

Shielded Wire: -

AC Wire: -

Amazon.com:

1x ATtiny85: http://amzn.to/1hPDkQp

1x NE5534: http://amzn.to/1NzwvOP

2x IC Socket: http://amzn.to/1MCbdj0

1x Electret Microphone: http://amzn.to/1MCbkuU

1x 20kΩ Potentiometer: http://amzn.to/1MCbAKp

1x Knob: http://amzn.to/1hPDCGP

1x Resistor Kit (various): http://amzn.to/1NzwL0l

1x 100nF Capacitor: http://amzn.to/1hPDF5u

1x 1N4002 Diode: http://amzn.to/1MCbLFz

1x BC 637 NPN Transistor: http://amzn.to/1hPDM0S

1x FRS1B-S-DC05 Relay: -

1x Power Supply 230V/5V 500mA: -

1x AC Socket (Input): http://amzn.to/1MCbX7H

1x AC Socket (Output): http://amzn.to/1LmTI4r

Bridge Wire: -

Shielded Wire: -

AC Wire: -

Amazon.de:

1x ATtiny85: http://amzn.to/1E9ubfB

1x NE5534: http://amzn.to/1MHZjp7

2x IC Socket: http://amzn.to/1Nzv6aZ

1x Electret Microphone: http://amzn.to/1E9unLZ

1x 20kΩ Potentiometer: http://amzn.to/1E9up6B

1x Knob: http://amzn.to/1E9uzeb

1x Resistor Kit (various): http://amzn.to/1E9uEhN

1x 100nF Capacitor: http://amzn.to/1PpxLCz

1x 1N4002 Diode: http://amzn.to/1E9uKGd

1x BC 637 NPN Transistor: -

1x FRS1B-S-DC05 Relay: -

1x Power Supply 230V/5V 500mA: -

1x AC Socket (Input): http://amzn.to/1FIc7b5

1x AC Socket (Output): http://amzn.to/1MHZZeh

Bridge Wire: http://amzn.to/1Ppyh3B

Shielded Wire: -

AC Wire: http://amzn.to/1E9vmvw

Amazon.co.uk:

1x ATtiny85: http://amzn.to/1E9xqDR

1x NE5534: http://amzn.to/1PpzAzw

2x IC Socket: http://amzn.to/1NzxoqD

1x Electret Microphone: http://amzn.to/1Nzxpem

1x 20kΩ Potentiometer: http://amzn.to/1Nzxv5E

1x Knob: http://amzn.to/1NzxxKR

1x Resistor Kit (various): http://amzn.to/1NzxNJR

1x 100nF Capacitor: http://amzn.to/1MI20Hp

1x 1N4002 Diode: http://amzn.to/1PpzVSG

1x BC 637 NPN Transistor: http://amzn.to/1MI21Lw

1x FRS1B-S-DC05 Relay: -

1x Power Supply 230V/5V 500mA: -

1x AC Socket (Input): http://amzn.to/1PpAdcc

1x AC Socket (Output): http://amzn.to/1NJmZGM

Bridge Wire: http://amzn.to/1PpAcFf

Shielded Wire: http://amzn.to/1E9ynfm

AC Wire: http://amzn.to/1NJn8Kv

Visit your local hardware store to get your screws, nuts and different connectors.

Step 3: Build the Circuit!

Here you can find the schematic and veroboard layout to create your own clap circuit. I recommend to build it firstly on a breadboard to test the circuit before moving it over to a stripboard.

Step 4: Program the ATtiny85!

Use the given sketch to program your ATtiny85. If you don't know how to do this with an Arduino Uno then have a look at my previous video about the subject:

Step 5: Get the Wiring Done!

With the help of the pictures you should be able to see which wire connects to which connector. As I mentioned in the video 230V can kill you, be careful!

Step 6: Success!

You did it. You just created your own clap circuit!


Feel free to check out my YouTube channel for more awesome projects:

http://www.youtube.com/user/greatscottlab

You can also follow me on Facebook, Twitter and Google+ for news about upcoming projects and behind the scenes information:

https://twitter.com/GreatScottLab

https://www.facebook.com/greatscottlab

Comments

author
ShermS1 (author)2017-08-16

Also I had built a similar circuit, I was happy to see I built it close to this one, my code is a little different, but same Idea. I happened to be looking at Op Amp information and ran across this. I'm surprised I did not see it earlier, since I do watch GreatScott and I'm glad he shares.. This is great for people starting out.. Also I did not use AC, I used it for solar lighting at 12v. But this is a great way to start, I would just suggest isolating Mains voltage more.. But I love it..

author
RaghavT7 (author)2017-08-08

Please tell me

author
ShermS1 (author)RaghavT72017-08-16

I love nano's as much as I love the Attiny85's.. But it will be a waste of pins, but if that is all you have, I would use pins 25 and 26 (they match the Attiny 85's A2 A3 the best). Hope that helps..

author
RaghavT7 (author)2017-07-17

Hey, I want to use Arduino nano on the place of ATtiny85. Can you please tell me about wiring?

author
AMSR1 (author)2017-04-14

Hi! :) I made an AMATURE pcb design (diptrace) of Great Scott's project (with relay included).

Please do "DOUBLE CHECK" if I made any unnecessary connections.

PCB.dipTop view.png
author
pauly.linus (author)2017-04-05

I have a problem. My electret mic is much smaller and i dont see any other peaks on the oscilloscope than mains received by my oscilloscope cabel as antenna. Any idea how i can get peaks as well?

author
shivakumar1995 (author)2017-02-21

I am using this to amplify the signal of my CT and convert it to a DC signal. what i realised was that the output is staying at 5 volts even when there is no signal. Why is this happening?

author
SamS430 (author)2017-01-28

I have a question. What is the red squares?

author
ThomasVDD made it! (author)2015-09-16

I made it! I also added a light dimmer (simple triac dimmer), controlled by the knob. Fun and cool project!

IMG_9183.JPGIMG_9187.JPG
author
Kiddybrain (author)ThomasVDD2016-10-18

happy u could make it work . please can u tell me how i can maybe use 3 claps to turn it on instead of 2 ? and i wanna use different amount of claps to turn on different devices .. can u help me on that please ? any information u know . please do tell me

author
ThomasVDD (author)Kiddybrain 2016-10-19

Be creative with your code ;)
A very easy way would be to check if the signal has passed a certain threshold, then wait some time and check again. This can be done several times for more claps.

author
KrunoslavH (author)ThomasVDD2015-12-31

Hello, would you mind sharing the shematics or a link to the circuit?

author
ThomasVDD (author)KrunoslavH2016-01-03

Here you go! Just to be clear: it's an AC dimmer :)

Dimmerpng.png
author
HaythamL (author)ThomasVDD2016-07-27

so you can change the brightness of your light with this? any other uses?

author
KrunoslavH (author)ThomasVDD2016-01-04

Thanks!

author
heritier (author)ThomasVDD2016-03-22

Hey Thomas can you send me your schematics if possible please? On matetah@gmail.com

author
ThomasVDD (author)heritier2016-03-23

The schematic is the same greatscott used. The dimmer schematic is in a reply under this one.

author
GreatScottLab (author)ThomasVDD2015-09-17

Awesome!

author
NicholasB24 made it! (author)2015-10-19

Hey Scott,

i have an big problem with the micophone setup. I assembeld it exactly like as in 1:11 of your video shown (powerd with an Arduino), and even after switching the polarity of the micophone my multimeter just picks what seems like random noise or just nothing up. And after amplifiing it is of course still random crap ...

I am really desprate so a qick hint, what might cause the problem would be really nice.

PS: I use the microphone you recomended for German Amazon (http://www.amazon.de/gp/product/B00LUUH9QW/) and i tried all of them to eliminate the chance, that one micophone just could be broken.

I hope you havent moved on from this thread to a new project ...

Gruß Nicholas Ber

If any furthe information is necessary, just ask.

20151019_150437.jpg20151019_150642.jpg20151019_150650.jpg
author

Your multimeter is not fast enough to show you the clap amplitudes. You need something like an oscilloscope to see them. Or try your Arduino with its analogRead function. That should be fast enough.

author

no, sadly that doesnt fix the problem, even with a delay of 1 millisecond, like in your sketch the value is more or less constant, the signal diffrence of 500 - 870 after amplification, like in your sketch is definitly not happening...

I must seem like an total idiot to you, but i would be really happy if this thing would finally work. It is really sobering to wait that long time on parts, and then nothing works. Like i said i will answer you any further questions, so please ask them if you need them.

Thank you in advance

author
Kiddybrain (author)NicholasB242016-10-18

please ddi u get it to finally work ? i wanna make this same project but am a beginner. maybe i can as u for some help

author
Kiddybrain (author)2016-10-13

halo please i wanna make this too but what i wanna do is that for example when i clap my hands 3 times the light turns on , and when i clap 2 times another device turns on. please is it possible and can u help me with that ?

author
Janeks246 made it! (author)2016-10-01

Made it! Managed to make it small enough to fit it where the switch was. For now it's hold on by a piece of tape, but i will cover it up soon with something nicer. You just wake up in the morning, two claps and lights in the room go on! Thanks for a great instructable Scott. Now all of my friends are jealous.

20161001_121620.jpg20161001_121706.jpg
author
GreatScottLab (author)Janeks2462016-10-05

Awesome!

author
goldenshuttle (author)2016-09-14

great project. I only suggest you edit your posting because this long list of suppliers is like overmarketing, ..You are an experimenter not a salesman...if you are on an affiliate program, then this sounds like an overkill..I am even surprised how this website moderator did not notice or take any action, maybe he/she should pay attention to keep the website to the point...it is a looooooong tasteless list , don t you agree ?

author
tayebm (author)2016-04-09

greeting scott

this is a really cool project as always and i'll try to make it

i'm kinda beginner and i have a silly question about the arduino sketch

"digitalWrite(transistorpin, !digitalRead(transistorpin));"

this line

does it reverse the pin status when we add "!" before the digital read ?
thank you so much for ur work

author
MrNXT45. (author)tayebm2016-08-25

Yes it does.

author
mozzie00 (author)2016-06-23

Hey Great Scott! What are you using to do you board layout design with? it looks so nice :3

author
aseelb95 (author)2016-06-22

Hi, I am totally new to electronics and I really want to start, since I've been putting it off or discouraging myself for so long. I thought that making one cool project successfully will give me the confidence I need, and so I've been looking for one. All of Scott's projects look really really cool to me, but I get slightly overwhelmed after reading their instructions, especially the "build the circuit" step. Is starting with one of them a bad idea? If yes, what do you recommend starting with? What was your first electronics project? I really wanna become on of you cool tech DIYer's.

author
Der G (author)2016-06-18

Muss mann sich eigentlich die " Pro Version " kaufen um den Sketch als PDF zu erhalten denn bei mir geht es irgindwie nicht :( da steht dann immer Anzeige von PDF nicht möglich ungültiges Dateiformat und das habe ich schon auf mehreren Geräten versucht kannst du mir bitte helfen freu mich schon auf morgen :)

author
HannaK10 (author)2016-05-26

Hi, my friend and I are trying to make this project for school but we live in the US. Is there another way to make this without using the FRS1B-S-DC05 Relay?

It doesn't deliver here, and the ones that do won't get here in time.

Thanks!

author
Quexisispro (author)2016-05-08

Hey! I've built this circuit (the only different thing is that I'm using an arduino uno instead of attiny85) and the problem I have is that the arduino activates the relay on every clap, instead of two claps. Do you have any idea why this is happening? I've tried different microphones and also hooked the 6th pin of the NE5534 to my oscilloscope and everything works fine - I got a 4-5 volt burst on every clap. The arduino is connected like this - 6th pin of NE5534 to A2 pin of the arduino and transistor's 2nd pin is connected to the 3th digital pin of the arduino. Also I'm using the code that you provided.

author
Quexisispro (author)Quexisispro2016-05-09

I also tried the same setup but instead of arduino uno i used an arduino nano, the results are the same...My relay turns on and off on every sound

author
AndreaG62 made it! (author)2016-04-17

Is always funny to create!

temp_-455675575.jpg
author
pepperthecat (author)2016-04-16

Could I use this in the UK with RGB LED lights but with the English plug connections? Its for a project and this would make it work well.

author
Guransh Singh (author)2016-04-13

Can I use ne5532 instead of ne5534

author

Should work

author
Guransh Singh (author)2016-04-13

Can I use ne5532 instead of ne5534

author
Guransh Singh (author)2016-04-13

Can I use ne5532 instead of ne5533

author
Guransh Singh (author)2016-03-10

Can I use 555 timer instead of ATtiny 85

author

No

author
hazza_ob (author)GreatScottLab2016-03-20

Why not? it would be very easy to create a latching circuit with the 555 timer, and by setting a certain thresh hold voltage you could use the amplified output of the microphone to toggle the latching circuit and furthermore a relay. Correct me if im wrong but i feel like this may work

-Harry

author
GreatScottLab (author)hazza_ob2016-03-21

For a one clap circuit that triggers with every loud sound it surely does work. You could of course add more components to get the same functionality as the ATtiny circuit but in this case it would be much simpler to use this small µC.

author
Jøran Reinås (author)2016-03-17

do you have to make any differences with the wiring if you want to replace the ATtiny85 with an arduino nano?

author
Guransh Singh (author)2016-03-13

What materials are used for making arduino shield

author
Guransh Singh (author)2016-03-13

What things are used in making arduino shield

author
Guransh Singh (author)2016-02-25

I will make it and send image to you

author
nhatnamt (author)2016-01-31

Can i use ATtiny13 instead of ATtiny85?

author
_hen101_ (author)2015-09-20

Hi Scott,

ich finde deine Videos Klasse! ich bin noch ein Anfänger auf dem
Gebiet der Elektronik und kenne mich mit den Basics aus. Ich freue mich immer
auf ein neues Video von dir und bin froh, dass ich aus jedem etwas lernen kann.
Dieses Projekt interessiert mich sehr und ich würde es sehr gerne versuchen zu
bauen. Ich habe bereits ein ,,China" Arduino Uno und Nano, mit denen ich
schon erste Versuche gemacht habe. Ich bin gerade am sammeln und bestellen der Teile
und hätte da ein paar Fragen:

1: gibt es irgendwelche Kriterien für das Mikrofon? ich hab
folgendes bei C rausgesucht. http://www.conrad.de/ce/de/product/710832/Mikrofon...

2: Ich würde lieber ein Uno oder Nano verwenden, da ich mir
nicht sicher bin ob ich das mit dem Attiny85 hinbekomme. Ich bin mir jetzt
nicht ganz sicher welche Pins ich jetzt für dieses Projekt brauche. Nach etwas
googlen und vergleichen mit deinem Schema habe ich folgendes Bild gefunden und
denke das PB3=A3 und PB2=A2 sind. Wenn ich falsch liege korrigiert mich bitte!!

und 3: Reicht der 5V Output vom Arduino aus um die restliche
Schaltung mit Strom zu versorgen, oder ist der zu schwach?

Ich würde mich um jegliche Art von Hilfe freuen

Grüße Henry

as.jpg

About This Instructable

60,249views

424favorites

License:

Bio: Awesome Electronics Tutorials, Projects and How To´s
More by GreatScottLab:Make Your Own ESCDIY Short Circuit (Overcurrent) ProtectionMake Your Own Photovoltaic Off-Grid System
Add instructable to: