Debugging my wife's alarm clock

Monday, October 21, 2024

My wife's alarm clock has been acting up lately. Sporadic at first but then every day, it wouldn't blare in the morning at the set time. Instead, when it was supposed to go off it would... reset itself. The time would start flashing in that "I'm confused because the power went out" sort of way.

Not very useful. You want the alarm to wake you up, not give you a new morning chore.

I volunteered to try to fix it: I'm pretty handy, and I've done some basic electronics repair before. (Desperate times called for desperate measures, and I got that coffee grinder working again with just a little soldering.) Before opening it up, I pointed out that there's a battery. We reproduced the issue first, then changed the battery, and confirmed that that was the culprit1!

But that left the question of why it's doing that. It probably isn't using the battery for power all the time, since it's plugged in. And it does get its timekeeping from the wall—well, more on that later. You can even hear a 60 Hz hum from it if you listen closely, just like our AC frequency in North America.

I wanted to open it up, but there's this warning on it. It says not to open it, and elsewhere it says "no user serviceable parts inside." I could get shocked if I open this.

So I just ignored that, and I took it apart and started poking around2 :D

My opening hypothesis was that something had broken—maybe a capacitor, maybe just a bad solder joint—and when the alarm went off it somehow cut mains power and used the battery instead, resetting it. This turned out to be not it.

First, let's appreciate how simple this whole thing is. The alarm clock boils down to one integrated circuit, one 7-segment display panel, a transformer, and a pile of wires, resistors, capacitors, and that sort of thing. Pretty neat, and definitely not something you see in many new products these days (this is over a decade old).

Poking around inside I didn't see any obvious damage, and there wasn't anything disconnected that should be connected. I started to wonder if this was just... how it was designed.

The IC powering the alarm is the LM8560, and its datasheet tells us a lot! It's responsible for storing the time and handling the alarm clock's functionality, including snooze and time setting. And it turns out that yes, the clock is using the wall for timekeeping, which is more reliable than many other sources of time3. And it also has a crystal oscillator built-in which keeps the time when the mains power fails for at least 3 cycles, or 1/20th of a second.

So, uh, what's happening here? My best guess is that when the alarm goes off it's supposed to pull voltage from the battery to power the buzzer, but when the battery is dead, it pulls from AC and manages to drop voltage for the entire IC. This leads it to trigger the "I lost power" display flash and also reset the time to 12:00, which doesn't happen when the battery is present and power is lost.

This isn't reproducible by removing the battery entirely, either. If you take it out, the clock loses all ability to function and just resets constantly. So having a mostly drained battery seems to be doing a little work so that it resets once but then resumes normal functioning (until the next time it tries to go off).

Another neat thing did happen after my debugging session. I set the clock on the steps to take back upstairs, and a few minutes later I heard it go off. Without being plugged in, everything is working (sans display, which does require mains power), and... it sounds better? With AC present, the buzzer sounds distorted and grungy. When it's just on battery, it sounds very clean. This makes me want to find a kit to play with analog synths.

I can't say I'm a big fan of the design of this clock. It is plugged into the wall, but has a load-bearing 9V battery! If anyone knows for sure why this alarm clock does this weird thing with a load-bearing battery, I'd love to learn more!

Update 10/27: A few readers have pointed out to me that it's likely a bad capacitor, which cap it is, and how to test that and/or fix it! I'll try that out this week and update further.

But I should probably go put her alarm clock back now...


1

Always reproduce issues before you try to fix them. If you don't know how to reproduce it, you don't know how to check that it's fixed!

2

While I did this, I do generally know what I'm doing around mains power and am taking that risk for myself. Don't do this without proper training and safety precautions. The effects of high voltage can be quite shocking.

3

The term to look for is time error correction. Most places still do regulate frequency of mains power, but notable exceptions (Russia, China, etc.) exist. Where I am in the US, the goal is 4,320,000 cycles per day, and the error is actively corrected whenever it exceeds 10 seconds cumulatively. We're the most lax region of the US, and that's still going to be accurate enough for most needs.


If this post was enjoyable or useful for you, please share it! If you have comments, questions, or feedback, you can email my personal email. To get new posts and support my work, subscribe to the newsletter. There is also an RSS feed.

Want to become a better programmer? Join the Recurse Center!
Want to hire great programmers? Hire via Recurse Center!