Beep


Example Image
About

This started as a goofy prank on a good friend. The original was built on a breadboard and electrical taped to a 9v battery. The battery life was only a few days, but it was tons of fun hiding it on each other.

The need for a smaller, more durable, and much more power efficient toy is how this came to be. It's just a coincidence it's a decent platform for AA powered ATtiny projects too.

How to Assemble

First, some explanations of all the holes and pads on the PCB. There's two ATtiny footprints on the board, labeled U1 and U2. The idea behind these are so you can use either the 8-DIP through hole ATtiny or the 8-SOIC surface mount ATtiny, but you shouldn't populate both on the same board.

The five pairs of pads labeled R1 through R5 are where the 600ohm resistors get soldered; these connect the ATtiny pins to the base of the 3904 transistors. Speaking of, the trio of pads labeled Q1 through Q5 are where the 3904 transistors get soldered. These transistors will handle up to 200mA each, conveniently marked on the edge of the board as a reminder.

The two rows for four solder holes labeled J1 and J2 are directly connected to the ATtiny pins; these are low current (<=40mA) pins, useful for programming or connecting sensors to. The banks of holes labeled J3 through J7 are the high power pins that connect to the transistors. Each row (J3, J4, etc) is capable of 200mA, so if you need to run ten 30mA LEDs, split them into two groups of five and power them with two different channels. The two holes nearest the 'J' designators are connected to +V, while the two furthest from the 'J' designators are connected to the transistors. This is a standard low side transistor switch.

On the backside of the PCB are two pairs of battery terminals, labeled BT1 and BT2, these are where the AA batteries get installed. There's no reverse polarity protection on the board, so the orientation of the batteries is drawn on the PCB. Putting the batteries in backward will destroy your ATtiny, so be sure the batteries are installed correctly.

All there is to assembly is soldering the parts where they go. If you don't need all five channels you can save time and only solder the parts required for the channels you need, as shown in the main picture above. In order for Beep.ino to work, be sure to solder a piezo buzzer in the D0 channel.

How to Program

The tricky part is programming. The easiest way is to use an Arduino Uno:

  1. Program the Uno with ArduinoISP.ino
  2. Download Beep.ino from the Example Arduino Code section of this page and open in in the Arduino IDE
  3. Wire Uno pin 13 to Beep pin D2,A1 (in row labeled J1, not J5)
  4. Wire Uno pin 12 to Beep pin D1 (in row labeled J1, not J6)
  5. Wire Uno pin 11 to Beep pin D0 (in row labeled J1, not J7)
  6. Wire Uno pin 10 to Beep pin Reset
  7. Wire Uno pin GND to Beep pin 0V
  8. Wire Uno pin 5V to Beep pin +V
  9. Install the ATtiny board via ArduinoIDE's Boards Manager
  10. Set the Board to the appropriate type (probably ATtiny85)
  11. Set Programmer to "Arduino as ISP"
  12. Press the Upload button
  13. Rejoice as the board does its power up beeps!
  14. Disconnect all pins from the beep board
  15. Pop in two AA batteries
  16. Rejoice once again as the board does its power up beeps, but on battery power this time!
Example Arduino Code

Beep.ino is the arduino code for the periodic beep. This will chirp the buzzer similar to a smoke detector with a dying battery. The chirps aren't consistent of course, otherwise it'd be easy to time the period and eventually find the Beep. To aid in stealth, it instead chirps randomly between 8 seconds and several hours, making it impossible to predict the next chirp.

I did the math on this once, using this code the ATtiny sips power, giving it an estimated ~20 years of battery life. It's unfortunate the AA batteries will corrode and fail long before that though. Still, a pretty decent ROI considering the decades of entertainment for $7 worth of parts.

MorseCodeTaunt.ino is a similar idea, but instead of smoke alarm chirps, this will chirp out short sentences in morse code. The idea being you can set it to say some silly 5th grade quips, anything more than 15 characters gets kinda tedious to listen to. The main drawback is only 100,000 of the people on the planet will understand it. This script lacks all the power saving features that Beep.ino has; implementing those is left as an exercise for the reader.

Hardware Files

Here will be the information for the hardware. Included is the schematic so you can see how it works, as well as the PCB production files if you want to make your own, and a bill of materials so you know which components you'll need.

Order a preconfigured PCB via PCBWay Shared Projects (coming soon).