Introduction: Arduino "Annoy-a-tron!"

I've been admiring the Annoy-a-tron over at ThinkGeek for a while now, but I never really wanted to buy something that I knew I could challenge myself with building.  Although this is nowhere near as tiny and discreet as the real Annoy-a-tron, it functions very similarly and is still small enough to hide in a plethora of places.  My Arduino-powered Annoy-a-tron features random intervals of silence and high-frequency sound to confuse your victim more-so than a constant sound or a consistent interval.

Remember to comment, rate, and VOTE!

Step 1: The Extensive Supplies List

Here's what you'll need in terms of physical objects in order to start annoying the heck out of people:
- an Arduino (or really any microcontroller that can use the Arduino IDE's language)
- a piezo element or speaker capable of high frequencies in the 14-20kHz range

You'll also need a computer running Arduino IDE 18, a cable to interface between the computer and microcontroller (USB in many cases), and an external power source for the microcontroller (I use a 9V battery).  Inconspicuous enclosure optional.

Step 2: Can We Build It?

 Yes we can!

Alright, so at this point we need to plug the speaker into one of the Arduino's digital I/O pins and ground.  In my code, I have selected pin 13 for the (+) lead, but if you have something against that number (superstitious?), then go ahead and plug it in somewhere else.  Actually, plug it in elsewhere if you want the sound to be louder, because pin 13 has a 1k-ohm resistor built in.  After plugging in to the digital pin, plug the (-) lead of the speaker into one of the GND pins on your board.

Hooray, you've succeeded at winning the mission!
Wait, not so fast. We still need to upload code...

(Props to Fritzing for the sweet diagram below)

Step 3: Code Time!

 The code I wrote is rather self-explanatory because of the notes I put next to each line, but essentially what it is doing in its current state is playing an 18kHz tone for somewhere between 0.5 and 3 seconds (decided "randomly"), then waiting between 10 and 30 seconds (also "randomly") before starting over.  I'm not a code master by any means, so if somebody would like to share how to improve the code, that would be great.

Please note: The "Tone" feature is a new addition to Arduino 18, so if you don't have it, you'll need to download it from arduino.cc, or work your way around this issue.

The code is as follows, and you should be able to copy and paste it straight into the Arduino IDE...

long randNumber; //establishes randNumber
long randNumber1; //establishes randNumber1

void setup ()
{
}

void loop ()
{
  randNumber = random(500, 3000); //randNumber is between .5 and 3 seconds
  tone(13, 18000); //plays a 18kHz tone on digital I/O pin 13
  delay(randNumber); //continues to play tone to the time of randNumber
  noTone(13); //stops playing tone on pin 13
  randNumber1 = random(10000, 30000); //randNumber1 is between 10 and 30 seconds
  delay(randNumber1); //continues silence to the time of randNumber1
}

Step 4: Let Madness Ensue!

After uploading code to your Arduino, you'll need to unplug it from your computer's power and instead use a more portable source of energy.  I prefer the classic 9-volt battery, but I suppose there are other methods of power...

Next it's time to find a comfy and secret place for your creation.  Consider your surroundings.  Be aware that this will probably not work anywhere where it is loud because nobody will be paying attention anyway.  No matter where you are, under a desk is always a pretty good bet, but if anybody looks under the desk, don't expect them to ignore the circuit board with blinking lights and a speaker.  Hiding it in something "analog" (i.e. not a digital electronic) is probably better because, well, it's unexpected.

Comments

author
dan321 made it! (author)2016-07-16

Where can I get a piezoelectric, buzzer or speaker capable of producing 80kHz?

author
mykiscool made it! (author)2012-01-13

Great tutorial simple, straightforward and it works well. The only thing I would suggest for you since the device is meant to be an annoying thing make the tone 80khz instead of 18khz it is a much more annoying high pitched squeal.

author
dillonxti made it! (author)dillonxti2014-08-31

you can't hear 80khz; humans can only hear 20hz to 20khz

author
mykiscool made it! (author)mykiscool2014-08-31

That's what I had it set to on my arduino anyways. I could hear it. Maybe my speaker or arduino isn't the actual frequency. Also some noises you normally can't hear you can hear if they're loud enough.

author
dillonxti made it! (author)dillonxti2016-03-10

you are only hearing harmonics of 80khz not really 80khz

the harmonics playing from this fundamental are 10khz, 20 khz, and 40khz(can't be heared).

author
TechP1 made it! (author)2015-10-12

Thanks ... It's annoying!!!

author
kwetiaw made it! (author)2015-01-16

made one on arduino uno. lets see if this thing works.Thanks!

IMAG1143.jpg
author
Inventorlewis made it! (author)2014-05-31

Awesome Idea! I eddied the code and made some simple additions to crerate random tones too! Here is my code:

long randNumber; //establishes randNumber

long randNumber1; //establishes randNumber1

long RandTone; //creates a random tone

void setup ()

{

}

void loop ()

{

randNumber = random(10, 3000); //randNumber is duration of tone

RandTone = random(1000, 15000);

tone(13, RandTone); //plays a tone on digital I/O pin 13

delay(randNumber); //continues to play tone to the time of randNumber

noTone(13); //stops playing tone on pin 13

randNumber1 = random(10000, 300000); //randNumber1 is duration between tones

delay(randNumber1); //continues silence to the time of randNumber1

}

author
EdDruino made it! (author)2012-01-04

you don't need 4 pics to show how to connect a speaker to the arduino...Nice code by the way....

author
geeklord made it! (author)2010-04-28

Reminds me of the Annoy-a-Tron clone I made with an Attiny24v not too long ago. It was pretty sweet; I got the current consumption down to 15uA @ 5v, but I don't think that's even that great for something like this. There are ways to put an Arduino into power down mode; someone should try that and see what kind of results they get with an Arduino.

author
Mr.Fuzz made it! (author)2010-04-01

THIS IS AMAZING THANKS!!!!!

author
Radioactive_Legos made it! (author)Radioactive_Legos2010-04-01

 No problem :)
Remember to rate and vote please!

About This Instructable

19,109views

38favorites

License:

Bio: A Bay Area native interested in electronics, mechanics, and robotics, and automobiles. Formerly the electronics captain of Team 100 in the FIRST Robotics Competition, I ... More »
More by Radioactive_Legos:Lithium Polymer Etiquette: A Comprehensive Guide to Working with LiPoElectrically Insulated Altoids TinIncredible DIY iPhone Macro
Add instructable to: