Saturday, April 25, 2015

Arduino UPS / Battery Shield

We just picked up a LIPO shield from Adafruit, which allows us to battery power our projects.

The shield contains a optional 2Ah LIPO battery, and recharges from a mini usb cable (same as a Kindle).

You can power your project from the shield on battery power, or plug in the cable, and it charges the battery and acts like a online UPS, powering your project. LED's show power on, charging, charged, and low battery status, and you can monitor battery voltage on one of your analog pins.

All we had to install was the extended headers, and the optional power switch (finally, you can power off the arduino). Stack the shield, plug in the battery and a usb cable for charging when necessary, and you are set to go.

Take it solar with

We used a Ada Fruit RGB I2C LCD Shield
Make sure you download the Adafruit Libraries for the LCD.

// set up the voltage monitor
// select the input pin for the battery voltage. 
//Make sure you solder the correct pad on the bottom 
//of the power boost shield.
int sensorPin = A2;    
// variable to store the value coming from the battery
int sensorValue = 0;  

//measure your AREF pin and replace our 
//measured value of 4.77v
float stepVolt = 4.77/1024.0; 

// include the library code:
#include <Wire.h>
#include <Adafruit_MCP23017.h>
#include <Adafruit_RGBLCDShield.h>

// The shield uses the I2C SCL and SDA pins. On classic Arduinos
// this is Analog 4 and 5 so you can't use those for analogRead() anymore
// However, you can connect other I2C sensors to the I2C bus and share
// the I2C bus.
Adafruit_RGBLCDShield lcd = Adafruit_RGBLCDShield();

// These #defines make it easy to set the backlight color
#define RED 0x1
#define YELLOW 0x3
#define GREEN 0x2
#define TEAL 0x6
#define BLUE 0x4
#define VIOLET 0x5
#define WHITE 0x7

void setup() {
  // Debugging output
  // set up the LCD's number of columns and rows: 
  lcd.begin(16, 2);
  lcd.print("Battery Voltage");

void loop() {
 sensorValue = analogRead(sensorPin); 


  1. What pin did you solder on to the powerboost shield?

    1. If you look at the code, I used A2, but you can choose whichever of the analog inputs you want. Just make sure code and solder bridge match.


Related Posts Plugin for WordPress, Blogger...