Annoying Beeper
Intro: Annoying Beeper
Play a prank on your friends (enemies?) by hiding a high-pitched beeper which sounds off at random time intervals. This instructable uses minimal parts. All that is required is:
1. The ability to beep at random intervals
2. Minimal parts needed (simplicity/elegance of design)
3. I wanted to use a microcontroller (because I recently started the journey of learning about microcontrollers)
This project was inspired by an article in MAKE magazine about making a similar device with a 555 timer chip.
After making my prototype, I searched instructables.com and found the Raven, which is a similar beeping thing using a microcontroller. I decided to add my instructable because it uses less parts and has random intervals.
- battery
- microcontroller
- speaker
1. The ability to beep at random intervals
2. Minimal parts needed (simplicity/elegance of design)
3. I wanted to use a microcontroller (because I recently started the journey of learning about microcontrollers)
This project was inspired by an article in MAKE magazine about making a similar device with a 555 timer chip.
After making my prototype, I searched instructables.com and found the Raven, which is a similar beeping thing using a microcontroller. I decided to add my instructable because it uses less parts and has random intervals.
STEP 1: Parts Required
Besides the 3 basic components, I used a couple of other parts to help assembly. Here is a full parts list required for my final version:
I made this entire project from parts I had in the house. You can use almost any battery(s) that has a voltage within the microcontroller's range (1.8-5.5 Volts for the ATtiny13). The higher the voltage, the louder the beep.
Almost any small speaker will work. You may want to experiment with different small speakers. I chose the speaker with the plastic membrane because it didn't make a click noise at the end of the beep like some other small speakers.
You can adapt the source code for other microcontrollers. It would potentially only require a change to the timer register settings.
Skills Required:
- ATtiny13 microcontroller (Sparkfun.com)
- AA batteries (3)
- Battery Holder with switch (Digikey part # SBH-331AS-ND)
- 8-pin socket for microcontroller
- Speaker (small 8 Ohm or piezoelectric buzzer)
- Silicon adhesive (RTV)
I made this entire project from parts I had in the house. You can use almost any battery(s) that has a voltage within the microcontroller's range (1.8-5.5 Volts for the ATtiny13). The higher the voltage, the louder the beep.
Almost any small speaker will work. You may want to experiment with different small speakers. I chose the speaker with the plastic membrane because it didn't make a click noise at the end of the beep like some other small speakers.
You can adapt the source code for other microcontrollers. It would potentially only require a change to the timer register settings.
Skills Required:
- Basic soldering skills - Soldering Tutorial
- Programming microcontroller - AVR Tutorial
STEP 2: Prototyping
The easiest way to test your circuit is to use a prototyping breadboard. You can also program the microcontroller while on the breadboard. Once it was working, I put it on a tiny breadboard so I could take it to work and try it out.
Connect the speaker to the ATtiny13: Pins 4 & 5
Connect the battery to ATtiny13: Pin 8 (+) & Pin 4 (-)
So Pin 4 has the negative battery terminal and one speaker wire (doesn't matter which one). Pin 5 connects to the other speaker wire, and pin 8 connects to the positive side of the battery.
I realize that the reset pin (pin1) should be pulled high, but it works without doing that, and this project makes no attempt to be formally correct.
Note that if you wanted better quality sound, you could put a resistor-capacitor low-pass filter on the output pin inline with the speaker. But for this project, we want an annoying sound anyway.
The prototype made me realize that the sound was not very loud. It still might work well for you in a quiet environment (office?). To increase the volume, I changed the battery from 3V (CR2032) to 4.5 volts (3 AA).
Connect the speaker to the ATtiny13: Pins 4 & 5
Connect the battery to ATtiny13: Pin 8 (+) & Pin 4 (-)
So Pin 4 has the negative battery terminal and one speaker wire (doesn't matter which one). Pin 5 connects to the other speaker wire, and pin 8 connects to the positive side of the battery.
I realize that the reset pin (pin1) should be pulled high, but it works without doing that, and this project makes no attempt to be formally correct.
Note that if you wanted better quality sound, you could put a resistor-capacitor low-pass filter on the output pin inline with the speaker. But for this project, we want an annoying sound anyway.
The prototype made me realize that the sound was not very loud. It still might work well for you in a quiet environment (office?). To increase the volume, I changed the battery from 3V (CR2032) to 4.5 volts (3 AA).
STEP 3: Firmware
1. Download beep.zip, and extract.
2. Open a command window in that directory.
3. "make program-beep" to program the ATtiny13
You can change the minimum/maximum time between beeps, the beep frequency, and duration by changing the parameters near the top of the source file beep.c. The files in the zip file have the following parameter values:
secMin = 180; // Minimum number of seconds until beep
secMax = 600; // Maximum number of seconds until beep
freq = 6000; // Frequency of beep in Hz
msDuration = 1000; // Duration of beep in milliseconds (1000 = 1 sec)
So it beeps at 6kHz for 1 second every 3 to 10 minutes.
Feel free to experiment with different values. However, extreme values could cause unexpected results. Let me know what values work well for you.
Note that since Pin 4 is used for the programmer and for one of the speaker wires, you must disconnect the speaker from pin 4 when programming.
If you need more information on this step, see this tutorial.
2. Open a command window in that directory.
3. "make program-beep" to program the ATtiny13
You can change the minimum/maximum time between beeps, the beep frequency, and duration by changing the parameters near the top of the source file beep.c. The files in the zip file have the following parameter values:
secMin = 180; // Minimum number of seconds until beep
secMax = 600; // Maximum number of seconds until beep
freq = 6000; // Frequency of beep in Hz
msDuration = 1000; // Duration of beep in milliseconds (1000 = 1 sec)
So it beeps at 6kHz for 1 second every 3 to 10 minutes.
Feel free to experiment with different values. However, extreme values could cause unexpected results. Let me know what values work well for you.
Note that since Pin 4 is used for the programmer and for one of the speaker wires, you must disconnect the speaker from pin 4 when programming.
If you need more information on this step, see this tutorial.
STEP 4: Final Assembly
Now that you have it working, put it all together and package it.
1. Solder parts together
2. Use Silicon adhesive to hold it together and provide strain relief for the connections/wires.
I used a chip socket so I could remove the chip and reprogram the beep parameters (interval, frequency, and duration). So that the socket sits flat on the battery case, I bent the used pins (4, 5, and 8) horizontal, and cut off the other socket pins.
Your choice of battery and speaker might depend on how you want to use it. I originally wanted a very small package so I could hide "anywhere". I had considered using 1.5 button cell batteries (3), but I couldn't think of an easy way to make a battery holder. I ended up liking the 3 AA solution. The case is the right size to mount the microcontroller and the speaker.
It also works well to attach Velcro. I found during testing that hiding it on the underside of a table or desk was convenient. The 3 AA case allows me to connect both sides of the Velcro, remove the tape covering the sticky side, and slap it under a table. Then when I want to retrieve it, I can simply reach under the table and rip it away (leaving the 'hook' side of the Velcro still under the table).
Have fun, show us a picture of your beeper, and tell us the story of your victim.
1. Solder parts together
2. Use Silicon adhesive to hold it together and provide strain relief for the connections/wires.
I used a chip socket so I could remove the chip and reprogram the beep parameters (interval, frequency, and duration). So that the socket sits flat on the battery case, I bent the used pins (4, 5, and 8) horizontal, and cut off the other socket pins.
Your choice of battery and speaker might depend on how you want to use it. I originally wanted a very small package so I could hide "anywhere". I had considered using 1.5 button cell batteries (3), but I couldn't think of an easy way to make a battery holder. I ended up liking the 3 AA solution. The case is the right size to mount the microcontroller and the speaker.
It also works well to attach Velcro. I found during testing that hiding it on the underside of a table or desk was convenient. The 3 AA case allows me to connect both sides of the Velcro, remove the tape covering the sticky side, and slap it under a table. Then when I want to retrieve it, I can simply reach under the table and rip it away (leaving the 'hook' side of the Velcro still under the table).
Have fun, show us a picture of your beeper, and tell us the story of your victim.
30 Comments
Tinker Man Mick 4 years ago
Heres a link to mine if you wanna see it
https://youtu.be/GDIneVfaBU8
john.r.griswold 9 years ago
I will pay for someone to build one. I need to install in a police chiefs vehicle. ASAP evil grin
holidayv 10 years ago
darkforest 12 years ago
samirsky 12 years ago
godofal 13 years ago
wouldnt adding a simple NPN transistor in between the attiny, the batteries and the speaker make the volume *much* higher??
samirsky 13 years ago
* I am still learning about electronics
* I like the simplicity of just a chip with only power and output (speaker) (see these projects )
* It is loud enough for the 'victim' to hear, and yet not be able to locate
godofal 13 years ago
or at least, it might
my watch for instance has a pretty loud beep for its alarm, but you can't hear where its coming from
i *think* (no expert, so not sure) that thats becouse normally a sound is a wave form and a beep is more monotonous
we hear where a sound is coming from by the slight delay from when it reaches the ears, and a beep might be monotonous enough so that the delay doesnt work
or something like that, and im amazed if anyone would figure out my crappy explanation xD
im still learning too, but thats what sites like this are here for ^^
Drasa 13 years ago
Maybe if we set the time between the beeps to 1 second, duration to 5 milisecond, we could get something like the C4 from Counter-Strike, right?
astrong0 13 years ago
samirsky 13 years ago
More information of programming the micro-controller can be found in this tutorial (it is how I learned to program a micro-controller): http://www.ladyada.net/learn/avr/
astrong0 13 years ago
astrong0 13 years ago
bclamore 13 years ago
VerticalX 13 years ago
VerticalX 13 years ago
"make: *** No rule to make target `minipov.hex', needed by `all'. Stop.
Build failed with 1 errors and 0 warnings..."
I modified the Beep.c file to increase the max wait to 15 minutes (from the original 10 minutes).
Usining the original "makefile" file I receive the above error when building in AVR Studio 4.18.
Thanks!
samirsky 13 years ago
You should type: "make program-beep"
If you only type "make", you will get the error you describe.
This is an artifact of the fact the I used the same make file for several projects. When you simply type "make" it tries to build ALL of the projects. Since you do not have the other projects (minipov for example), you get that error.
rvolk169 13 years ago
How do I control the limits of the timer -- that is, can I make it beep randomly between, say, 3 and 9 seconds?
samirsky 13 years ago
unsigned int secMin = 180; // Minimum number of seconds until beep
unsigned int secMax = 600; // Maximum number of seconds until beep
Lamppis 14 years ago