|The Beeper Project||Back to the HahnTronix Web Page|
What is the Beeper Project?
The beeper project was a design I did as an entry for a Microchip design contest (De$igning for Dollar$) back in 1997. It was designed to use very little power, wake up from time to time, and beep in an annoying fashion. When the microcontroller is in sleep mode, the circuit draws less than 10 microamps. Since it is designed to wake up every few hours for only a few seconds, it will run off a small battery for several months. Take a look at the project description link near the bottom of this page for more details.
I built it for my sister's fiance, Jim. He wanted it to play an elaborate practical joke on a friend. I designed the PCB and built him a few samples. At one point I was working for a company that made pager watches. I programmed a couple of these things to make a sound just like the pager. You should have seen people trying to figure out who's pager was going off when one of my beepers sounded.
Somebody in Microchip's sales department was briefly interested in my design as a demo board for the PIC12C508. Once I started getting prices for small quantifies of the parts needed to build it, they lost interest. Even people who make microcontrollers are surprised when a simple project like this costs several dollars to build.
The schematic file you can download below can be modified a bit:
The schematic shows a PIC12C508 used as the microcontroller. You can use about any 8 pin PIC in it's place. The C code you can download below was written for the PIC12F675.
You can replace the crystal X1, with a resistor and a capacitor on GP5 This will allow you to run the beeper at a lower frequency, and would free up another IO pin if you are using a PIC12F675. You can also run the PIC off it's internal oscillator, but the accuracy is mediocre.
You can power the beeper with a 3 volt lithium coin cell. Running on a CR2430 coin cell the beeper should run for over 6 months, maybe as long as a year.
The resistor labeled R1 is optional. This resistor was added to help with any ESD (Electro Static Discharge) issues.
The resistor labeled R5 is needed if you are using a PIC12F675. For some reason Microchip dropped the on-chip pullup resistor from pin 3 when they made the PIC12F675.
The C source code file you can download has a few features not mentioned in the source:
If you hold down SW1 while plugging in a battery, you will go into a configuration mode. The are two phases to this. During the first phase you may select the beep pattern. During the second phase you may select the sleep duration. The beep pattern and sleep duration you choose are writen to on-chip EEPROM. If you do not hold down SW1 while plugging in the battery, the beep pattern and sleep duration will be read from eeprom. Read the source code for more details.
I've added code that supports a piezo sensor attached to GP0. Connect the sensor in parallel with a 4.7 megohm resistor between pin 7 and ground. If you are not using the sensor and wish to reduce current draw while sleeping, attach a 10K resistor from pin 7 to ground. The piezo will wake the PIC from sleep if it is given a good sharp jolt.
You are welcome to copy any part of this project you like for personal use. If you would like to use any part of this project for commercial purposes, please contact me.