geekabit

lightbulb

Alarm clock switches computer on

project , author Maarten Tromp, published , 514 words.

My student room was a single room. I had a huge self-assembled computer with killer specs, but it was so noisy I couldn't sleep with it powered on. So in the evening I would power down the computer, go to sleep, and in the morning, get out of bed and power it up again. Now how can we automate this?

Alarm clock with connector on the side
Alarm clock with connector on the side

If my computer were to power up automatically in the morning, that would save me one step. The BIOS had an option for that, but it could only power up on the same time every day. Since my schedule was somewhat irregular, I needed a more flexible solution. There is however a device that knows exactly when I should be getting out of bed; my alarm clock. So why not switch the computer on when the alarm sounds?

I opened up the alarm clock. There were fewer parts inside than I had expected; transformer, buttons, display, piezo speaker and a black blob chip. Given the options I choose to use the piezo speaker as trigger. I mounted a 3.5 mm (1/8 in) jack chassis in the side of the alarm clock and wired it in parallel with the piezo speaker. From there I ran a wire to the computer.

Inside the computer I connected the wire directly to a TIL111 optocoupler from the parts bin. The optocoupler output was connected in parallel with the power button. If I recall correctly this was all the circuitry there was. No smoothing, no debouncing, no current limiting, just a single optocoupler. Now if everything would go according to plan, the alarm clock would drive the optocoupler as well as the piezo speaker, tricking the computer into thinking that someone had pressed the power button.

The setup worked first try! Since that day I woke up to the sound of my alarm clock and my pc. And since I could not sleep with the computer powered on there was nothing else to do than get out of bed. Talk about win-win.

However, as I found out later, snoozing the alarm would trigger another alarm 9 minutes later. This would simultaneously be transferred to my computer which registers it as another power button press and starts to power down again. This was clearly not the intent.

To counter this effect I could wire the alarm clock to the wake-on-lan port on the network card instead of the power button. This would provide the power up functionality, without the power down side-effect.

But before I got around to do this something else happened. I had replaced the hard disk with a new one with larger capacity. But the old hard disk, being some big old server SCSI disk, was the main reason the computer was so noisy. With the computer much more silent I could sleep with it powered on. There was no more need for the alarm clock power switch.

Soon after that I started to work on a script that would play music in the morning and then slowly but steadily increase the volume to get me out of bed.