Wake-On-Radio when Wake-On-Lan is not an option, and something on saving power
March 11, 2012
As some of you might already know, I have been working on a Wake-On-Radio system. Some of you will find it boring since it's not about robot building, but on the other hand a few of the sub systems could be useful in a robot... You decide!
I am a grumpy old UNIX sysadmin. I have a few Linux machines running as servers, and a bunch more if we count in friend's machines. I hate to loose systems or data when disks fails. Backups! Daily!
In my workshop, I have an old PC running with Debian Linux and a bunch of large disks. Every morning "something" powers this machine up and it then pulls backup data from all the servers and stores the data on the disks.
This "something" used to be a Wake-On-Lan signal sent from another machine. But when I plugged the server through a power-meter and saw a 8W standby power usage I got annoyed. 8W at 24 hours at 365 days is 70kWh. Here in Denmark a kWh costs approx DKK2, ~ $0.35, which on a year will cost me more than $20. Every year! I would rather buy robot parts for those dollars. Ok, some of the time the machine is powered up and I should subtract that time, but you get the picture.
Now I have built a circuit with a radio controlled solid-state relay and put it in front of my backup server, and connected a radio transmitter to the machine which used to send the Wake-On-Lan signal. The radio transmits a pulse to the receiver, which activates the relay. This wakes the server, which now feeds the relay through 5V I took from an usb port. After 10 seconds the radio stops transmitting and the receiver stops holding the relay, but now its pulls through the USB power. When the backups are all done, a poweroff command kills the 5V to the USB, which now releases the relay, and we are back at 0W.
The transmitter is an old unused mailbox detector. I un-soldered the vibration sensor and hooked it up to an unused parallel port and am now able to control the transmitter from software. The transmitter is based on the HX2262 encoder and then a pretty standard 433MHz can.
The receiver circuit is based on a small 433MHz receiver module and an ATtiny13A to do the decoding and 10 second relay pulse generation.The receiver circuit is primarily battery powered. It consumes 1.6mA, powering the radio and uC. 1.6mA will drain the 3AAA cells soon or later. The solution here was to make the uC enter powerdown mode and then only wake up every 8th second to power up the radio to listen for signals, if nothing heard, powerdown again. In powerdown mode, the chip only consumes a few uA. Now my battery will last "forever"
Since the receiver is powered off most of the time and only listening every 8th second I simply send the Wake-On-Radio signal for 10 seconds. Damn simple, if you ask me.
In the process, I have learned a bunch of new things:
- SMD soldered the ATtiny13A
- Programming the ATtiny13A, interrupts, power modes, timers, development environment on my linux desktop
- decoding radio signals with my home made Logic State Analyzer (LSA)
- something about cheap 433MHz radio modules
I must say that I'm amazed about that ATtiny13A chip. So small and yet so powerful. And really low power usage. Will run at low voltages too. I have already ordered a few more on ebay, less than a dollar a piece.