Computing stuff tied to the physical world

Putting the JNµ to sleep

In AVR, Hardware, Software on Jan 18, 2012 at 00:01

The Sleepy::loseSomeTime() code in the Ports library was never tested on a JeeNode Micro. Turns out that only a minor library difference kept it from working (the arduino-tiny library has its own version of millis(), etc):

Screen Shot 2012 01 14 at 23 55 34

So now, the JNµ can be put to sleep as well. Here’s the jouleTest sketch I used, tweaked to run on the JNµ as well:

Screen Shot 2012 01 14 at 23 55 09

And sure enough, about once every 10 seconds it shows that familiar packet-transmit current consumption:


The blue line is the AC-coupled supply voltage, a 3x AA Eneloop battery pack in this case. It supplies about 3.8V, but when running off a 1000 µF cap, it looks like this continues to work down to 1.8V (well below the RFM12B’s minimum 2.2V specs) – although with only about half the transmit power by then.

This current use fingerprint is almost identical to the ATmega328 running this same code. Not surprising really, since it’s the RFM12B which determines most of the power consumption, not the ATmega vs ATtiny difference.


  1. Nice work JC! I’ve been avoiding looking at the power consumption of the JNu. Now I don’t need to avoid it any longer :-)

  2. Indeed nice work. Did you or indeed could you take a look at the millis performance when the pre-scaler is used. I think the millis timer doesn’t understand when the pre-scaler slows the clock down.

    • John, that’s normal behavior – the Arduino millis() logic doesn’t take the pre-scaler into account. When pre-scaling by say 16, you’ll have to use delay(1) to delay by 16 ms, for example. This is a limitation of the Arduino run-time library.

      This does not apply to Sleepy::loseSomeTime() – this one is pre-scaler independent.

Comments are closed.