Author Options:

Small hourly beep charm Answered

I want to make a very small charm that will play a short beep sequence alarm every hour. It does not need a stop button for the alarm, just beep a few times then be silent for another hour. I'm thinking attiny, speaker, battery. Or something along those lines. Or is this simpler with a 555 (I've never used one before)? I have used attiny for lights, but never anything with sound. Can anybody point me in the right direction for code and also a good place to buy tiny inexpensive speakers? Thanks so much!


I just remembered, the common name for a quartz-timed clock, made to interface with a microprocessor, is:

"real time clock" module, or "RTC"

I decided to look at SparkFun.com's site, just because I know they sell a lot of Arduino compatable modules. I found two of them, one based on Maxim's DS1307, another based on DS3234. One requires I2C for to read data from the timer, and the other requires SPI.



By the way, please do not consider this an endorsement to buy anything from SparkFun, because I do not know for sure if they are the best place to buy something like this.

Actually, a place I have not checked yet, is the Let's Make search... for "real time clock"


I mean it seems like, if we could find some existing instructables, using these RTC modules, that would be a place to find some nitty-gritty details about using these.

I am impressed that you are familiar with the ATTiny, but not with the 555.

Anyway, I think the two main complications of this project idea are, (1) a way to store and playback some short melody, (2) a way to accurately measure hours of time.

For the first one, I suggest looking for projects in which an ATTiny has been made to play a melody. A Let's Make search for "attiny melody"


might turn up something you can use.

For the second one, accurate timing, I think you want some kind of timer module that uses a quartz crystal. Actually it may be possible to do this with the ATTiny; i.e. set it up so that its own clock, is using a quartz crystal oscillator. If that is possible, the secrets revealing how to do it are probably in the datasheet somewhere. I mean, by default, the ATTiny uses some kind of internal clock, but I do not know how accurate it is. Again the details about that are probably in the datasheet.

By the way, the reason I think a quartz oscillator is desirable for the timing, is because of, what do you call it? Maybe, "drift", is a good word. I mean, the fact that a clock becomes less accurate the longer it is left running.


As an example, suppose the RC (resistor+capacitor) circuit, that forms the time base for the 555 is accurate to 1%, which corresponds to a drift of 1 s every 100s, and 36s every 3600 s = 1 h, and 864s every 86400s = 1 day. Which is a drift of almost a quarter of an hour every day, which is awful, for timekeeping purposes.

I am not sure if the ATTiny's internal oscillator is much better than this, for measuring long spans of time, like hours, or days.

There might exist quartz clocks, like in module form, that would be easy to connect to a microprocessor like ATtiny.

It might also be possible to just use a digital watch with an hourly chime, and have one of the inputs of the ATTiny listen to that.

Regarding your question about cheap speakers, probably the cheapest place is the Chinese eBay sellers, although depending on where you live in the world, an order from them will take weeks, or months, to ship.

If it turns out you need small quantities of a part, like just one or two, and you have a DollarTree(r),


or similar dollar store, in your town, there is often cheap (1 USD per unit) junk sold there that can be taken apart for parts. E.g. the dollar store earbud headphones contain two, tiny, like 32 ohm? speakers. I do not recall the exact impedance of these, but is something like this. Also at the dollar store, I have seen a tape-on, door-alarm, gizmo that contained a single, piezo-type speaker. I have also seen noise-making toys, like toy firetruck, policecar, etc, sold at the dollar store, that obviously contain some kind of speaker, be it a piezo, or voicecoil style.

555 if your not worried about accuracy. Could be very small

Search for the data sheet it's a cheap ic and easy to use.


4 months ago

The 555 always has a longer time for the first so called hour and the capacitor resistor are temperature sensitive when you take it off for the night..

Do the crystal tiny and a piezo disc for your beep sound.. Just loop some nested counters for delay and drive the piezo disc from two opposed outputs at a square wave that makes a pleasing tone.. Use the lowest frequency crystal to reduce battery drain for extended battery life..