# Computing stuff tied to the physical world

## The PWR vs the +3V pin

In AVR, Hardware on Jan 25, 2012 at 00:01

JeeNodes and plugs use 6-pin headers with the following pin assignment:

(there’s usually a big printed dot near the PWR pin for orientation)

There has been some confusion about what PWR is w.r.t. +3V and how to use it, so let me elaborate a bit.

First: “+3V” is the main regulated power reference for most chips and circuits. And to make it more complicated: it’s actually 3.3V, not 3.0V. The “+3V” label merely identifies the pin (VCC would be too confusing).

The ATmega on the JeeNode, as well as most (but not all) chips on attached plugs run on this 3.3V voltage level. It is also the reference level for all digital I/O (0 = 0V, 1 = 3.3V), as well as for the ADC when used for analog inputs (1023 steps of 3.22580645161 millivolt each).

As for the other supply pin: “PWR” is usually a higher voltage from which +3V is derived.

There’s a voltage regulator on the JeeNode which can take any input voltage on “PWR” up to about 13V as input and which produces the 3.3V regulated voltage on the “+3V” pin.

The JeeNode regulator has some limits: it’s can’t supply more than 250 mA and it can’t dissipate more than about 600 mW. It’ll shutdown if either of these are exceeded (and it’ll get damaged if you feed it more than 13V). These figures are fairly limiting: if you run a JeeNode off 12V on the PWR pin, then it actually won’t be able to supply more than 70 mA. With 5V on the PWR pin, the limit will be current, not power dissipation, i.e. 250 mA max.

That’s for a JeeNode with through-hole components, i.e. an MCP1702 regulator in a TO-92 package. With the JeeNode SMD and JeeNode USB, you get even less power from the regulator: at most about 250 mW of heat dissipation. That’s 150 mA @ 5V, and only 28 mA @ 12V. In short: the JN SMD and JN USB are not really meant to be powered from more than 5V – or at least not without an extra external regulator (on the plus side: the MCP1703 supports up to 16V on the PWR pin). Note also that the JeeNode USB doesn’t support more than 7V on the PWR pin, due to limitations of the on-board LiPo charger – but that should not be an issue since it’s really only meant to be powered from 5V via USB.

As you can see, there are several limiting factors as to what voltage is supported on the PWR pin. Keep in mind that JeeNodes were designed for ultra-low power consumption, and the regulator was selected for its extremely low idle current draw, not its “high-end” characteristics.

But that’s not all…

One trap for the unwary is with the JeeNode USB: it doesn’t actually feed 5V to the PWR pin when connected to USB but only 4.2V. This is due to the LiPo charger circuit, which allows a LiPo battery to be connected between PWR and GND. With a LiPo battery, the JeeNode USB becomes a very convenient stand-alone unit: low-power untethered operation while not connected to USB, and automatic LiPo charging while connected to USB. It even has a voltage divider on board to monitor the LiPo battery voltage (tied to PC6, i.e. analog 6 in Arduino-speak).

The trouble here is that when you connect plugs to the JeeNode USB, you won’t get the full 5V you might expect. This affects all those plugs which don’t run entirely off +3V but expect some higher voltage on PWR.

And here’s another tricky situation…

With the AA Power Board, you can run JeeNodes off a single AA cell. In this case, there isn’t a voltage higher than 3.3V anywhere in the circuit – so what to do with the PWR line? Well, there’s a solder jumper on the AA board to let you decide: it’s normally open, but you can connect it to either +3V or to the battery “+” (i.e. 1.2..1.5V). Obviously, this setup will be even less suited for plugs which expect a higher voltage than 3.3V to operate.

As you see, the +3V pin is solidly specified as always being 3.3V, but the PWR pin level can be all over the map.

The following plugs are especially affected:

• the LCD Plug will work, when used with a 3.3V display (as shipped by JeeLabs), but will only be suitable with 5V displays if PWR carries 5V

• the Graphics Board assumes that PWR is 5V, because the display needs it (it’ll probably still work with 4.2V, but PWR should not be above 5V)

Most plugs will be fine, though, since they only use the +3V supply. The only issue here is to make sure that the total current consumption off +3V is not too high.

Using a JeeNode with an unregulated power supply

The maximum allowed voltage on the PWR pin is about 13V. Unfortunately, many 12V power bricks are fairly badly calibrated, and often deliver substantially more than 12V under no-load conditions. You could easily damage the JeeNode’s on-board regulator with a cheap 12V power brick – better use a 5V or 9V brick.

If you do want to power a JeeNode off 12V (perhaps you need 12V on the rest of the circuit for LEDs, relays, or motor power), then the best approach is to insert a 5V regulator and feed that 5V level to PWR. This can easily be done with a “7805” regulator chip, which is available from many electronics parts sources.

1. An alternative to the “7805” is to use a zener diode in series (cathode to the positive supply). Chose a standard value around Vminsupply -3.8volts to give the on board LDO some headroom to work and work out the power in the zener as Vmaxsupply-3.3 * Imaxload.

The higher wattage zeners come in a stud mounted package which can dissipate plenty with/without a small heatsink, leading to longer life for continuous duty (note that the stud connection needs insulating from ground).

See here for using this technique with a “12v” Lead-acid battery source.

2. I can recommend old mobile phone switching power supplies (or “chargers”) for powering a JeeNode where 5V is needed. At work we had a box full of Sony Ericsson units rated for 150-500mA@5V and I reckon most people have something similar lying around. Simply cut off the proprietary plug and install a basic crimp header style plug.

3. @ltj, good suggestion if you have a mains supply accessible. Since they are designed for mobile phone use, the EMI emissions are usually good {at least in the GHz range ;-) }. Some designs are not good with small or zero load – worth connecting a suitable LED and dropper directly across the charger output if there is not one built in. (And you thought the designer put it there for your convenience…)

4. Well, that’s good to know, I was about to start a project with a 12V relay, a 12V power supply and a jeenode. I think I’ll thrown a 5V regulator into the soup as well then.

5. I just got a new JeeNode USB (with the 4.4 bootloader) – and the +3 pins on each header supply just 3.0v! (its a rock solid, exact 3.0v.) An identical JeeNode USB obtained last month (with the older bootloader) has (I assumed correct) 3.3v at each +3 pin on the headers (again rocky steady, exact 3.3v)… Using the same USB as power in each case. Of course the change messed up the reading from a TMP37, which I fixed by putting 3.0v as ref voltage in the sketch. Is this correct, have you changed it to 3.0v in this JeeNode release?

• Drat, no that’s a problem with one of the production batches – see http://forum.jeelabs.net/node/593 – feel free to return it and I’ll put a 3.3V unit on there.