One night, I was trying to draw a circuit on a chalkboard, but it became too dark to see. The next day I bought a new lamp, only to find that the board gave off too much glare. I needed a light I could easily adjust. I could have just installed a dimmer, but where's the fun in that? As an engineer, I like to do projects that use a little electronics, a bit of mechanics and some software.
My friends and I had been talking about those old '80s commercials for the Clapper, and it occurred to me that I could make a circuit that would dim the lights when I clapped my hands. The one I made is relatively inexpensive and a lot more functional than the original—it's even got a Party mode that can pulse the light along with the beats of the music from my stereo.
Pretty much any lamp will do, but a DC-powered LED one works best. Direct-current lamps run at around 12 volts, one tenth the power of regular AC lights, which also require different circuitry and carry the risk of a nasty shock.
THE CIRCUIT BOARD
- A Darlington transistor manages brightness by switching the light off and on an imperceptible 40,000 times a second. The longer the "on" duration, the brighter it looks.
- An Electret condenser microphone, like the one in a cellphone, picks up the claps you intend—and the clangs, bangs and crashes you don't. Note: You'll need to ground the mic's negative lead and connect the positive one to the operational amplifier input. If the leads aren't labeled (+) and (–), check the product manual to see which one is which.
- The sound is amplified up to 100 times in the first stage of the op-amp, filtered to weed out highfrequency noises like a vacuum cleaner, and sent to the comparator stage, which distinguishes claps from non-claps by comparing the volume and pitch with a preset threshold.
- The wheel on the potentiometer controls the gain, or amount of amplification. Turn it down if the device is too sensitive.
- The signal moves from the op-amp to the microcontroller, the brains that run the clapper software. Once a clap is registered, the microcontroller listens for its next cue. A second clap within 1.2 seconds toggles the lamp on or off. Three claps start the lamp ramping up to maximum brightness and then back down to its dimmest point, until a fourth clap locks the light level in place. Four consecutive claps puts the device in Party mode, modulating the lamp's brightness to the beats from your speakers. (To stop Party mode, you'll need to flip a switch on the circuit board or the wall switch.)
Download WinAVR for Windows or AVRDude for Mac, both of which are free, to get the clapper software from your computer to the programmer, which sends it to the microcontroller via a six-pin ISP connector.
Time: 5 hours
Difficulty: 3 out of 5
For a full list of illustrated instructions, click through to the next page.
Can you give us the link for the lamp? It seems the only ones that I can find are $100+... :/
i have gotten it to program on a bread board, the led lamp and blue led light flicker when programing, but after it is done programing everything goes dark and it refuses to run the program again. does anybody know what is going wrong?
I am currently building this circuit and found that R9 is on the schematics but not on the build of materials.
Also, I question the schematics of the 6 pin connection for the AVR Programmer. The Schematic does not seem to match with the picture of the bottom of the board.
Can anyone confirm the schematic is correct or not?
Has anyone got this working without modifying the Schematic?
I agree. The schematic does not match the picture
I found the pin connections for the SIP connector to hook up the AVR Programmer and it does not match up with the Schematic. I will post the correct connections if anyone is interested. This could have something to do with the problem bokred is having in the comments above.
If you have got this to work, please post the working schematic. Please provide as much detail as you can. Pictures of the intermediate steps welcome.
I have not had time to complete the project, but I did swap email with Pete Mills the author of the project and determined the following:
1) R9 is missing from the BOM. It is a6K8 resistor
2) The drawing of the AVR SIP is not a physical representation of the actual pin outs as it would be sitting on the circuit board. The Pin identifiers such as MISO, MOSI, SCK, etc. are correct if you follow that name to the associated name on the ATTINY85 but do not use the pin the name is next to on the schematic.
3) The names associated with the pins on the ATTINY85 are correct on the schematic.
4) The physical lay out of the AVR SIP is as follows:
PIN 1 - PIN 2
MISO * - * VTG
SCK * - * MOSI
RST * - * GND
This info is from the AVR Programmer documentation so I hope it is correct. If you look closely at the picture of the bottom of the board you can see the connections are as shown above.
Hope that helps! Please, Post a note if you get it working!
Just programmed my Clapper and it works great!
Pete, thanks for the plans and the help!