Battery + USB Power
We wanted to make our Feather boards easy to power both when connected to a computer as well as via battery.
There's two ways to power a Feather:
- You can connect with a USB cable (just plug into the jack) and the Feather will regulate the 5V USB down to 3.3V.
- You can also connect a 4.2/3.7V Lithium Polymer (LiPo/LiPoly) or Lithium Ion (LiIon) battery to the JST jack. This will let the Feather run on a rechargeable battery.
When the USB power is powered, it will automatically switch over to USB for power, as well as start charging the battery (if attached). This happens 'hot-swap' style so you can always keep the LiPoly connected as a 'backup' power that will only get used when USB power is lost.
The above shows the Micro USB jack (left), LiPoly JST jack (top left), as well as the 3.3V regulator and changeover diode (just to the right of the JST jack) and the LiPoly charging circuitry (to the right of the Reset button).
There's also a CHG LED next to the USB jack, which will light up while the battery is charging. This LED might also flicker if the battery is not connected, it's normal.
Power Supplies
You have a lot of power supply options here! We bring out the BAT pin, which is tied to the LiPoly JST connector, as well as USB which is the +5V from USB if connected. We also have the 3V pin which has the output from the 3.3V regulator. We use a 500mA peak regulator. While you can get 500mA from it, you can't do it continuously from 5V as it will overheat the regulator.
It's fine for, say, powering an ESP8266 WiFi chip or XBee radio though, since the current draw is 'spikey' & sporadic.
Measuring Battery
If you're running off of a battery, chances are you wanna know what the voltage is at! That way you can tell when the battery needs recharging. LiPoly batteries are 'maxed out' at 4.2V and stick around 3.7V for much of the battery life, then slowly sink down to 3.2V or so before the protection circuitry cuts it off. By measuring the voltage you can quickly tell when you're heading below 3.7V.
To make this easy we stuck a double-100K resistor divider on the BAT pin, and connected it to D9 (a.k.a analog #7 A7). You can read this pin's voltage, then double it, to get the battery voltage.
#define VBATPIN A7 float measuredvbat = analogRead(VBATPIN); measuredvbat *= 2; // we divided by 2, so multiply back measuredvbat *= 3.3; // Multiply by 3.3V, our reference voltage measuredvbat /= 1024; // convert to voltage Serial.print("VBat: " ); Serial.println(measuredvbat);
This voltage will 'float' at 4.2V when no battery is plugged in, due to the lipoly charger output, so its not a good way to detect if a battery is plugged in or not (there is no simple way to detect if a battery is plugged in)
Average Power Draw w/SD Card
The average power draw of the ATSAMD21 + regulator circuitry is 11mA. Both the red and green LED each draw 1mA if you light them up.
Say you are running this sample sketch which logs the analog voltage on A0 to an SD card file once a second.
You'll draw 11mA or so for 100ms during the delay(100) line. Since we blink the pin #8 LED, we'll also get a 11mA blip for about 10ms. The data for the SD card is buffered which means that whenever we reach 512 bytes of log file that needs to be written, the SD card will actually write the data. When this happens you'll see a 50mA pulse for 10ms. If you use flush() to write the log file, this pulse will be much longer, as you have to write the file as well as the file table sectors. Your 50mA spike could end up being 500ms or longer. So basically, keep your file writes to a minimum if you can avoid it!
ENable pin
If you'd like to turn off the 3.3V regulator, you can do that with the EN(able) pin. Simply tie this pin to Ground and it will disable the 3V regulator. The BAT and USB pins will still be powered.
Alternative Power Options
The two primary ways for powering a feather are a 3.7/4.2V LiPo battery plugged into the JST port or a USB power cable.
If you need other ways to power the Feather, here's what we recommend:
- For permanent installations, a 5V 1A USB wall adapter will let you plug in a USB cable for reliable power
- For mobile use, where you don't want a LiPoly, use a USB battery pack!
- If you have a higher voltage power supply, use a 5V buck converter and wire it to a USB cable's 5V and GND input
Here's what you cannot do:
- Do not use alkaline or NiMH batteries and connect to the battery port - this will destroy the LiPoly charger
- Do not use 7.4V RC batteries on the battery port - this will destroy the board
The Feather is not designed for external power supplies - this is a design decision to make the board compact and low cost. It is not recommended, but technically possible:
- Connect an external 3.3V power supply to the 3V and GND pins. Not recommended, this may cause unexpected behavior and the EN pin will no longer work. Also this doesn't provide power on BAT or USB and some Feathers/Wings use those pins for high current usages. You may end up damaging your Feather.
- Connect an external 5V power supply to the USB and GND pins. Not recommended, this may cause unexpected behavior when plugging in the USB port because you will be back-powering the USB port, which could confuse or damage your computer.
Page last edited August 23, 2024
Text editor powered by tinymce.