The other day, I found a Lithium battery in a local shop, which has just about the right size and properties for use with a JeeNode USB:
Found it here, for €9 … so it won’t break the bank.
The nice bit, apart from its size, is that it is fully enclosed and isolated, with two contacts which are easy to solder:
Do read that warning, and then proceed anyway :)
What you see above, is the battery with a bit of solder applied to each terminal. Next, I attached some wires:
I used two-sided tape to permanently fasten the battery to the JeeNode USB’s back side. Note that the headers were already soldered on, with all the extruding pins clipped to get a slightly flatter surface:
The ground wire didn’t need insulation after all, since it connects right next to where the battery is. The positive wire was connected to PWR on port 3, to leave the PSI header free if it ever needs to be hooked up later.
And that’s all there is to it:
There is no switch to disconnect the LiPo, so the JeeNode USB can run down the battery if it’s not running a good power-saving sketch. But who needs a switch anyway, when you can do it in software, right? Just upload this:
When run, the JeeNode will power off completely. This code has been added as “powerdown_demo.pde” sketch in the Ports library.
For proper use, sketches running on a LiPo-powered JeeNode USB should periodically measure the current LiPo voltage via the ADC6 pin, which is tied to a voltage divider. For this to work, the voltage should not have dropped below about 3.4V, so that the ATmega still gets a properly regulated 3.3V as AREF to compare with. The voltage on ADC6 is always half the voltage on the PWR pin. So what every sketch needs to do, is to occasionally measure the voltage, and once it reaches 3.4V, shut down completely using something like the above code.
So there it is – another JeeNode, ready to go … to recharge it, I just plug it into USB!