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:


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: -


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: -


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


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:


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



<p>Hi! :) I made an AMATURE pcb design (diptrace) of Great Scott's project (with relay included).</p><p>Please do &quot;DOUBLE CHECK&quot; if I made any unnecessary connections. </p>
<p>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?</p>
<p>I can't find code for attiny</p>
<p>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?</p>
I have a question. What is the red squares?
<p>I made it! I also added a light dimmer (simple triac dimmer), controlled by the knob. Fun and cool project!</p>
<p>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 </p>
<p>Be creative with your code ;)<br>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.</p>
<p>Hello, would you mind sharing the shematics or a link to the circuit?</p>
<p>Here you go! Just to be clear: it's an AC dimmer :)</p>
<p>so you can change the brightness of your light with this? any other uses?</p>
Hey Thomas can you send me your schematics if possible please? On matetah@gmail.com
<p>The schematic is the same greatscott used. The dimmer schematic is in a reply under this one.</p>
<p>Hey Scott,</p><p>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 ...</p><p>I am really desprate so a qick hint, what might cause the problem would be really nice.</p><p>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.</p><p>I hope you havent moved on from this thread to a new project ...</p><p>Gru&szlig; Nicholas Ber</p><p>If any furthe information is necessary, just ask.</p>
<p>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. </p>
<p>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...</p><p>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.</p><p>Thank you in advance</p>
<p>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</p>
<p>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 ? </p>
<p>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.</p>
<p>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 ?</p>
<p>greeting scott </p><p>this is a really cool project as always and i'll try to make it</p><p>i'm kinda beginner and i have a silly question about the arduino sketch </p><p>&quot;digitalWrite(transistorpin, !digitalRead(transistorpin));&quot;</p><p>this line </p><p>does it reverse the pin status when we add &quot;!&quot; before the digital read ?<br>thank you so much for ur work</p>
<p>Yes it does.</p>
<p>Hey Great Scott! What are you using to do you board layout design with? it looks so nice :3</p>
<p>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 &quot;build the circuit&quot; 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.</p>
<p>Muss mann sich eigentlich die &quot; Pro Version &quot; kaufen um den Sketch als PDF zu erhalten denn bei mir geht es irgindwie nicht :( da steht dann immer Anzeige von PDF nicht m&ouml;glich ung&uuml;ltiges Dateiformat und das habe ich schon auf mehreren Ger&auml;ten versucht kannst du mir bitte helfen freu mich schon auf morgen :) </p>
<p>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?</p><p>It doesn't deliver here, and the ones that do won't get here in time.</p><p>Thanks!</p>
<p>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.</p>
<p>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</p>
Is always funny to create!
<p>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.</p>
Can I use ne5532 instead of ne5534
<p>Should work</p>
Can I use ne5532 instead of ne5534
Can I use ne5532 instead of ne5533
Can I use 555 timer instead of ATtiny 85
<p>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</p><p>-Harry</p>
<p>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 &micro;C. </p>
<p>do you have to make any differences with the wiring if you want to replace the ATtiny85 with an arduino nano?</p>
What materials are used for making arduino shield
What things are used in making arduino shield
I will make it and send image to you
<p>Can i use ATtiny13 instead of ATtiny85?</p>
<p>Hi Scott,</p><p>ich finde deine Videos Klasse! ich bin noch ein Anf&auml;nger auf dem <br>Gebiet der Elektronik und kenne mich mit den Basics aus. Ich freue mich immer <br>auf ein neues Video von dir und bin froh, dass ich aus jedem etwas lernen kann. <br>Dieses Projekt interessiert mich sehr und ich w&uuml;rde es sehr gerne versuchen zu <br>bauen. Ich habe bereits ein ,,China&quot; Arduino Uno und Nano, mit denen ich <br>schon erste Versuche gemacht habe. Ich bin gerade am sammeln und bestellen der Teile <br>und h&auml;tte da ein paar Fragen:</p><p>1: gibt es irgendwelche Kriterien f&uuml;r das Mikrofon? ich hab <br>folgendes bei C rausgesucht. <a href="http://www.conrad.de/ce/de/product/710832/Mikrofonkapsel-KPCM-Serie-Betriebsspannung-45-VDC-Empfindlichkeit-43-dB-3-dB-Frequenzbereich-100-10000-Hz" rel="nofollow">http://www.conrad.de/ce/de/product/710832/Mikrofon...</a> </p><p>2: Ich w&uuml;rde lieber ein Uno oder Nano verwenden, da ich mir <br>nicht sicher bin ob ich das mit dem Attiny85 hinbekomme. Ich bin mir jetzt <br>nicht ganz sicher welche Pins ich jetzt f&uuml;r dieses Projekt brauche. Nach etwas <br>googlen und vergleichen mit deinem Schema habe ich folgendes Bild gefunden und <br>denke das PB3=A3 und PB2=A2 sind. Wenn ich falsch liege korrigiert mich bitte!!</p><p>und 3: Reicht der 5V Output vom Arduino aus um die restliche <br>Schaltung mit Strom zu versorgen, oder ist der zu schwach? </p><p>Ich w&uuml;rde mich um jegliche Art von Hilfe freuen </p><p>Gr&uuml;&szlig;e Henry</p>
<p>1. Sollte gehen 2. Nutze einfach A2 und Pin 3 des Arduino Uno. Wie es halt im Code definiert ist. 3. F&uuml;r den Verst&auml;rker ja. F&uuml;r das Relais w&uuml;rde ich eine andere Spannungsquelle nutzen. </p><p>Ich w&uuml;rde dir auch empfehlen nicht gleich Netzspannung zu schalten als Anf&auml;nger. Mann kann z.B. mit der Schaltung auch 12V f&uuml;r ein LED Band schalten.</p>
<p>Vielen Dank f&uuml;r deine schnelle Antwort </p>
Hi Scott, I am making this project right now, but I cant get the code working properly. Can you take a look at the code, because the code is different than the piece of code shown in the project video. Thanks alot, again!

About This Instructable




Bio: Awesome Electronics Tutorials, Projects and How To´s
More by GreatScottLab:DIY Arduino Soldering Station Make Your Own GPS SMS Security Tracking System DIY Portable LED Panel 
Add instructable to: