Introduction: The Raven, High-pitched Torture

Picture of The Raven, High-pitched Torture

This is a little device that I designed for the simple purpose of being discreetly annoying. It waits for a predetermined amount of time, and then it starts emitting high-pitched beeps. I have programmed mine to take advantage of an interesting property of sound. That is, in general most people above the age of 25-30 can't hear very high-pitched tones (say, 17 KHz for instance). This means if you were to (hypothetically of course) place it in a classroom, it would start bugging the heck out of the students while the teacher/professor will (most likely) be completely unaware of the source of the disturbance.

Step 1: Parts

Not all of the parts I used here are necessarily required. For example, you could use a resonator instead of a crystal, or hypothetically neither. But I won't be going into detail about alterations, if you change something I'll assume you know what your doing. If you don't know what you are doing, you might want to stick to what I've outlined here until you are a little more comfortable with AVR's.

In this project I used an ATtiny25 microcontroller, a handy little chip. I picked this one for this project because it's small and has 2 timers, which will make the programming easy. In order to complete this project you'll need a programmer, there are lots of methods on the internet for programming AVR's (look up "AVR programming" on instructables or google). I personally use the USBtinyISP that Ladyada sells.

Except for the AVR you can proabaly scalvange most of this stuff from old electronics. I needed to make an order to Digi-Key anyway, so I just got this stuff there.

What you need:
*I used a 3.6 V lithium battery, you can use something else, just as long as the voltage is between 3 and 5.5 volts (the weaker the battery, the more quiet the speaker will be).
**You don't need the IC socket, but it will make it very difficult to reprogram the AVR afterwards if you don't use one.

Step 2: Prepare the Circuit

Picture of Prepare the Circuit

Now that we have all of the parts, we can start putting things together. I recommend you put everything together on a breadboard first, this will make it easier to program the microcontroler and you can get a feel for how the circuit works before soldering anything together.

The parts should be placed according to the schematic I have attached, it's a pretty simple design. The big block in the center is the AVR, and the number beside all of the wires coming out of it corresponds to a pin. To figure out which pin is which, look at the microcontroller. You should notice a little circular indent beside one of the corner pins, this marks pin one. You count the pins going around the chip in a counter-clockwise direction starting here. In the picture the part marked G1 is the battery, C3 is the 0.1 uF capacitor, C1 and C2 are the 18 pF capacitors, Q1 is the crystal, and SP1 is the speaker. All of the GND's connect together (to the negative terminal of the battery).

Step 3: Program

Picture of Program

Once you have put the circuit together you need to program the microcontroller with the attached program. Because build environments can vary wildly based on you choice of operating system, programmer, and software, I won't get into setting that up here (For some help, you might want to check out Ladyada's page on this topic). For the purposes of this tutorial I'll assume you are using the same sort of setup in the above link, the USBtinyISP programmer, and a linux (or unix-like) operating system. If you are using a different setup (especially if you are using a different programmer) you will likely have to edit the Makefile (again, too much to get into here, try reading the comments in the file).

Once you have everything set up, and the programmer attached, it's time to program. I have found that the speaker can't be attached while programming, so you should unhook that for this step. It is also very important that the crystal be attached (along with the 2 18 pF capacitors), as it will become necessary after burning the fuses.

DO NOT perform the next step (burn-fuse) if you are not using the crystal, once you do the AVR will require a crystal to operate. If you burn the fuses and you don't have a crystal your out of luck until you can get one.

Now, we need to burn the AVR's fuses (see a tutorial on AVR's for more information, and the above warning). To do so, run this command from within the same directory you have the files: main.c and Makefile.

make burn-fuse

If you are programming this thing some other way, the fuse values are:
lfuse: 0xFD
hfuse: 0xDF

Next run the next two commands to compile the program and program the AVR:
make program

If you want you can run this command to clean up the excesses files that were created by the make command:
make clean

And there you go! Hopefully there weren't any errors and your AVR is programmed and ready to go. By default the AVR will wait for 15 minutes before doing it's thing, then beep for 1 second every 10 minutes for an hour. The beep frequency will be 17 KHz (quite high pitched). Check out the main.c file for more information and to change these values. I made sure to add lots of comments.

Step 4: Finish Up and Enjoy!

Picture of Finish Up and Enjoy!

Now it is just a matter of fixing everything together a little more permanently. I used a little prototyping PCB I got from Radioshack a while back, you can use anything you want. A word of caution tough, this circuit doesn't have an on/off switch. I originally wasn't sure if I would be able to retrieve this after I... tested... it, so I didn't bother including one. It would be a good idea to add one, because at the moment the only way to turn it off is to remove the IC from the socket (and every time you do that you risk bending/breaking the leads).

When you finish with that, it's time to test out your new toy. Have fun!

Credit goes to Ladyada (Limor), who's site has been extremely helpful getting me started with AVR microcontrollers.

Step 5: Enhancements

This is a very simple device, and is open to many easy modifications and enhancements. One such enhancement would be to add an on/off switch. You might also consider adding some sort of control that will allow you to vary the timing and delays of the beeping. Perhaps a potentiometer, or some jumper pins.

One good modification would be to find a way to increase the speakers volume. You could, for instance, drive the speaker with 2 AVR pins. Alternating which pin is on and off to provide the maximum possible voltage amplitude range to the speaker. You could also have the speaker go off at random intervals to provide maximum annoyance while making it even harder to locate.

I'll leave the details up to you, get creative and have fun!


vitell (author)2010-09-27

What's the battery life likely to be?

codongolev (author)2010-05-07

why did you use a crystal?

J-Five (author)2009-07-26

Quoth the raven NEVER MORE!!!

muttyfutty (author)J-Five2009-09-04

and my soal from the shadow that lies floating on the floor shall be lifted, NEVERMORE!!!

J-Five (author)muttyfutty2009-09-04

Poe lived between 1809 to 1849 for that time period he was old.

muttyfutty (author)J-Five2009-09-04

Yep, but he wrote dam well!

geeklord (author)2008-10-23

Could someone make a circuit without out an AVR?

awang8 (author)geeklord2009-01-06

You might be able to use a 555 timer chip... I'm not sure.

bman22 (author)awang82009-04-01

there was annother device similar to this on instructables, i think the author called it the annoy-a-thing. it uses a 555 cmos timer.

awang8 (author)bman222009-04-07

Yes, it is called the Annoy-a-Thing, but that emits a regular beep while this one emits a high-pitched kids-and-dog's-only beep.

muttyfutty (author)awang82009-09-04

if you used 2 555 timers you could beep at high pitch

raykholo (author)geeklord2009-03-11

a totally far stretched idea that might work would be to use a chain of relays with some sort of delay in between them, and resistors to route different voltages into the speaker... this would actually be more useful in creating a melody player... and its probably gonna be kind of big...

animaster (author)2009-05-22

can i use an Attiny 13?

Hungry_Myst (author)animaster2009-05-22

Yes, but you will need to modify the code as, to my knowledge, the Attiny 13 only has 1 hardware timer (where the Attiny 25 has 2).

bman22 (author)2009-04-01

i tried this using a tiny2313 i had lying around, besides the fact that the code was a bit to complicated for what i was trying to, i found the tiny2313's internal oscillator didn't seem right or something. Instead of doing the 17khz i jumped straight to telling it to do 20khz, having read that that is the upper bound of the human ear, and that the average adult couldn't hear it. Well, either the oscillator was off, or the 20khz was the upper bound of the adult ear. i had to set it to about 35khz to get it high enough. I actually put mine in a remote control, and used a uni-directional whistle chip instead of the usual piezo speaker. Now i can point it at people and drive them nuts!

sotsirh194 (author)2009-03-08

What would be an example of code just to make a 38Khz square signal and nothing else with a 1Mhz internal timer. I don't quite understand the code above.

Hungry_Myst (author)sotsirh1942009-03-10

>Here< is a very comprehensive guide to AVR timers that I found extremely helpful.

Wesley666 (author)2009-01-27

Would it be possible to use an oscillator instead of a crystal?

Hungry_Myst (author)Wesley6662009-01-27

Yes, tough you would need to use different settings for the fuse bits, and if the frequency was different you might need to modify the source code a bit. Depending on what your doing, you might not need either. I used a crystal because I wanted really precise timing over long periods of time.

Wesley666 (author)Hungry_Myst2009-01-27

OK thanks

DaNerd11 (author)2008-07-26

ok, lets have a scenario here, there are a bunch of teens in your front yard destroying it, sitting in the bushes, kicking up the grass and the flowers because you live in a crummy area. This happens a few times every week and you are very angry, you have tried calling the police but they dont do anything, they just come over and tell the kids to leave and go back to eating their doughnuts (sp?) What do you do? hmm, the mosquitoe sounds like a great idea now eh?

Hungry_Myst (author)DaNerd112008-07-26

Unless you, or any of your neighbors have kids or are younger then 30 or so (the range of people who can hear it is very erratic), or if they have pets (especially dogs). I would liken this to putting a blow-horn in your front yard. Great if you can't hear it, but you have to take the people your living around into consideration. There are adults who can hear this thing, just like there are plenty of kids/teens who can't (one of my roommates last year can't hear it). There are better ways to solve this problem.

wierd idiot (author)Hungry_Myst2008-10-27

put a remote switch on it. problem solved. along come the kids, on goes the mosquitoe.

DaNerd11 (author)Hungry_Myst2008-07-26

well, from that scenario, tell me a better way to solve it.

Hungry_Myst (author)DaNerd112008-07-27

I didn't say I have a solution, you'll just have to be creative. But you also need to take into account all of the people who might be affected by what you do.

DaNerd11 (author)Hungry_Myst2008-07-27

well if u cant come up with a solution then i geuss there is no other one, eh?

Hungry_Myst (author)DaNerd112008-07-27

That logic doesn't work. Just because you can't come up with a better idea doesn't mean there isn't one. There are plenty of solutions to this problem; but here isn't the place to discuss them. I'm simply saying that this isn't a solution. What if your neighbors have kids/teens? Something like this could easily give them headaches/migraines, and would likely keep them up at night. Imagine if your neighbor set up something like this and you could hear it. What if the people you were trying to discourage got ticked off at your tactics and decided to trash your property all the more? This is meant to keep kids from loitering somewhere, not to ward them off completely. What if they used earplugs? In any case, here isn't a good place for a debate, so this will be my last comment on the matter.

DaNerd11 (author)Hungry_Myst2008-07-28

fine, and also, have u ever heard those mosquitoe ringtones and stuff, earplugs wouldnt do anything, and thats a ringtone, whos point was i just proving?

geeklord (author)2008-10-15

is it possible to make one without the AVR?

Hungry_Myst (author)geeklord2008-10-15

Maby, but that would require an entirely different instructable with a very different circuit (assuming you didn't use a microcontroller).

geeklord (author)Hungry_Myst2008-10-15

well I should probably learn how to use a crystal first.Any help?

Hungry_Myst (author)geeklord2008-10-16

The crystal basically just sets the speed of the microcontroller. In this case I have a 4.194304 MHz crystal, so the AVR will have a clock rate of 4.194304 MHz.

geeklord (author)Hungry_Myst2008-10-16

that means nothing to me.....does the crystal have a delay of some sort causing the speaker to vibrate at the right pitch or what?

Hungry_Myst (author)geeklord2008-10-17

The important bit here isn't really the crystal, it's the AVR. The AVR does everything, the crystal basically just sets the speed at which it runs.

geeklord (author)Hungry_Myst2008-10-17


Saint_Awesome (author)geeklord2008-10-17

It has to do with frequency. When excited the crystal has a frequency it likes to resonate at and this value is used to set the speed of the microcontroller.

swirlycurly (author)2008-10-08

haha, i made one but it is more expensive than this. I will probably just crank out about 5 of these and sell them to all of my friends. They will love this.

junits15 (author)2008-09-12

could I just hook this up without the integrated circuit and use the oscillator to determine the frequency

Pumpkin$ (author)2008-09-02

the Annoy-a-Tron?

DaNerd11 (author)2008-07-24

whats this mosquitoe thing?

joechump (author)DaNerd112008-07-24

Mosquito is a device that can be installed in public spaces where young people hang out and generally harass/irritate residents. It might be on top of a lamppost for example. Only kids can hear the noise (as explained below) so they generally disperse. Personally I think it's brrrrilliant! Have to disagree with Croistoir as no-one is forcing anyone - kids can freely move away, and it causes no damage so I think torture is a strong word. I would love one of these as the kids in my street are always damaging property and climbing on my shed! I know not all kids are bad but let them hang out in the park or in their own gardens, not mine.

hcold (author)joechump2008-09-01

A public place is for everyone, not just those you don't like the look of.

DaNerd11 (author)hcold2008-09-01

but they shouldnt have the right to be in a public place if they are terrorizing the people/animals/property in the public place.

hcold (author)DaNerd112008-09-01

Terrorising is a strong word, but, this is, as is common, as case of a few bad eggs among the many okay eggs. Punishing everyone for what the few do. It's also discriminatory towards age groups, which is a human right (that is, not to be discriminated on via age).

DaNerd11 (author)hcold2008-09-02

well, kinda got a point...... damn... hate it when i lose.....

RaNDoMLeiGH (author)joechump2008-08-06

Oh, now that's a great idea. We have some.. youth... who have started hanging out on the corner. They're not from this neighborhood, we think they're casing it for the chance to rob someone. Make it a little harder for them to stay. I'd like to build a thingum that has an EMP triggered by high decibel levels. Use the magnetron from a microwave, aim it at the corner, and when the punks come driving through at 2am with their crappy music blaring, ZAP!! muhahaha I'm not used to working with high voltage so I'm a bit chicken to put one together, but the basics (not including the decibel meter alteration) are in one of the Evil Genius Electronics books. Anyone out there do it, please shoot me an email so I can add you to my "god" list. Make sure you get some video.

DaNerd11 (author)RaNDoMLeiGH2008-08-07

im not saying stuff that you could possibly might be able to geusstimate about, if theyre tearing up ur lawn, thats a good time to use it, not if u SUSPECT that they MIGHT rob a house because they are STANDING on the street, who knows, maybe they all just moved here?

RaNDoMLeiGH (author)DaNerd112008-08-30

Well we have seen them using binoculars to look in people's windows, I think that's a good enough reason to distrust them and want them to go away. They're not dressed as if they live in this neighborhood, but rather they are walking/biking from several blocks away. And I have seen them lounging around with their homies at those houses, so... my suspicions are pretty reasonable, really.

RaNDoMLeiGH (author)RaNDoMLeiGH2008-08-30

I will add that when they look in MY windows with binoculars they are likely to see me looking back at them with my spotting scope. ha ha!

DaNerd11 (author)RaNDoMLeiGH2008-08-30


About This Instructable




More by Hungry_Myst:The Raven, high-pitched tortureControl your iRobot Create with a Palm Pilot[Idea] Air Mouse
Add instructable to: