Here’s a fun experiment…
After yesterday’s improved power-down current results, I wanted to find out how much power it really takes to send out a bunch of small packets. No acks, just periodically sending out a packet and sleeping.
Trouble is, I didn’t want to wait for a battery to run down, since that would take months or even years. Bit long to get results for this weblog, eh?
So instead, I used this little chap:
It’s a super-capacitor which can handle up to 5.5V and has a capacity of 0.47 Farad! That’s like putting a thousand 470 µF caps in parallel. Amazing stuff, in an even more amazingly small package.
Here’s a JeeNode, fitted with this new power source, to give you an idea of just how small this thing is:
The next step was to design a small sketch to test this. Here’s what I came up with:
Some of the code left out for brevity. Full source code can be found here.
What this demo does is send out a packet with a 2-byte payload, then sleep for approximately 1 second, then send again, etc. Until power runs out.
Sure enough, packets started coming in every second:
OK 4 0 0 OK 4 1 0 OK 4 2 0 OK 4 3 0 [...]
I expected it to send out say 100 packets or so, before the charge in the 0.47 F supercap would run out.
Guess how far it went…
[...] OK 4 178 28 OK 4 179 28 OK 4 180 28 OK 4 181 28
That’s packet number … clickety, clickety … 28 * 256 + 181 = 7349 !!!
In other words, the JeeNode was able to send out well over 7000 packets, i.e. two hours of packets sent once a second.
This is fantastic. I think the secret – apart from the 3 µA powerdown mode – is that the RFM12B + RF12 driver require very little time to start up, send off a packet, and go back to sleep again. There is no ACK involved, the RFM12B is hardly ever in reception mode.
With real-world use, I expect power requirements to be considerably higher. First of all, a Room Board will draw around 50 µA, due to the on-board PIR sensor. And second, I’m going to want to use ACKs for at least the motion detector reports, so that the system has a robust mechanism for reporting motion whenever it is detected. This means putting the RFM12B in receive mode for a few milliseconds, waiting for the ACK. And repeating this process a few times if that ACK isn’t immediately received.
But still … over 7000 packets without a battery!
Update – with one packet per 5 seconds, the charge lasted 4523 packets, i.e. just over 6:15.
Update #2 – with one packet per 60 seconds, 771 packets got sent out, that’s 12:51 hours … looks like the self-discharge of the supercap is eating up the remaining energy.