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 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!


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


  • 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?



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