Close
0%
0%

ATTiny Low Power Prank

A pranking device to annoy your friends... or perhaps an entire college campus.

Similar projects worth following
This is a small device that plays a short 8-bit tune (never gonna give you up) every 30-40 minutes. It takes advantage of the ATTiny85’s watchdog sleep/interrupt function to greatly reduce power consumption. If the device were to play a 5-second tune every 30-40 minutes, its battery could theoretically last for a year or more.

When pranking, it can be hard to find a good balance between humor, price, and not pissing people off too badly. How do you create something that will draw people’s attention while at the same time not causing a significant disruption? I decided I wanted to create a device to accomplish such a task.

The first iteration of prototyping for this device began about a year ago with me gutting out the insides of a USB flash drive and soldering in an ATTiny and a very small piezo element. When it was plugged into a computer, it would play a tune. It was miserably quiet though.

My second iteration involved using a ‘differential drive’ for the piezo (using two io pins and alternating between high and low on each to double the amplitude). This made the USB device considerably louder.

After all this, I left this project behind for a few months until one day I read about low power sleep modes on the ATTiny. I realized if I used a coin cell battery I could make my device self-contained.

In my project's final phase, I use a larger piezo (a 30mm piezo from Adafruit).  I then hot glued the ATTiny and coin cell snugly onto the back and soldered all the connections together. This resulted in a small, easily concealable, and cheap ($2) pranking device. I then proceeded to make about 15 of these and hid them around my university's campus in various lounges and public spaces

Even though it looks like (and is) a mess of solder, flux, and hot glue. It gets the job done for cheap!

SleepMusicPiezo.ino

Arduino file for the ATTiny85. Note: some of the example music I include is a little off key, my ear is admittedly not the best.

ino - 6.70 kB - 12/23/2017 at 04:42

Download

  • 1 × ATTiny85 Microprocessors, Microcontrollers, DSPs / ARM, RISC-Based Microcontrollers
  • 1 × 30mm Piezo Speaker
  • 1 × CR 2032 Coin Cell Batteries and Battery Accessories / Batteries
  • 1 × Soldering Flux
  • 1 × Hot Glue & Solder

  • 1
    Programming the ATTiny85

    Use some method to load the sketch onto the ATTiny85 (I used arduino as ISP)

    ATTiny85 Arduino as ISP tutorial

    Here is my setup using an Arduino Nano:

  • 2
    Coin Cell

    Hot glue the coin cell to the back of the piezo:

  • 3
    ATTiny Pins

    Since we will only be using 5V, GND, 1, and 0 pins on the ATTiny, you can cut off the pins that we won't be using:

View all 6 instructions

Enjoy this project?

Share

Discussions

Jonas wrote 09/27/2018 at 04:50 point

Nice. I like that you used a low memory use tune.

I pulled a similar thing on my girlfriend a few years ago. Unlike your elegant solution, I recorded a short phrase "hungry" and played that back when she walked by the fishtank. Same deal, sleep timer ATTiny85, mini JST battery but in a mini altoids tin with a PIR sticking out the side. There's just enough memory to play a short terribly digitized phrase hex encoded on the ATTiny85.. 

PIR sensor triggered the sound if it was awake at the right time. It would sleep a while but wake up quite often to try to catch someone walking by. The random bit was that it wouldn't trigger every time you walked by because it might not be awake at that moment, but every so often. Yours is definitely smaller and more consealable. I think I got several weeks of use before having to recharge. Always a hit, at least to the prankster. 

Good resource for ATTiny85 audio here: http://www.technoblogy.com/show?QBB

  Are you sure? yes | no

ActualDragon wrote 04/17/2018 at 14:00 point

what a savage, i love it

  Are you sure? yes | no

Dr. Cockroach wrote 04/17/2018 at 13:53 point

I love it. Gotta try this out some time :-)

  Are you sure? yes | no

Lolucoca wrote 01/05/2018 at 09:24 point

Oh, I'm so gonna make a couple of these and hide them in the IT department! 

  Are you sure? yes | no

Jarrett wrote 12/25/2017 at 01:46 point

Hah, that was you? Awesome.

It can be kinda risky to get caught planting electronic devices with power sources all around these days.

For rev 2, there's nothing wrong with getting a couple hundred manufactured and leaving them in a basket somewhere public with a sign that says "Free! Take one!"

  Are you sure? yes | no

Similar Projects

Does this project spark your interest?

Become a member to follow this project and never miss any updates