1. Home
  2. Knowledge Base
  3. energyShield 2 Pro
  4. Getting Started – energyShield 2 Pro

Getting Started - energyShield 2 Pro

Quick Start Guide

  1. First thing, you need to make sure that the power switch is in the OFF position. If it is not, the logic circuitry will lock when the battery is connected.
  2. Plug the battery into the battery connector. If you need to remove it, use fingernails or small tool to grab the white plastic connector. Do not pull on the wires or bend them excessively. Doing so may cause damage.
  3. If you are going to be using the energyShield to power a board like the Intel Galileo, PCDuino, etc. you may need to route the 5V output to the Vin pin. This can be done by cutting the trace in the 5V:5V solder jumper and soldering the 5V:Vin jumper. Be sure to double check your requirements before making this change.
  4. If you are using an Arduino that is not an R3 or later (no SDA or SCL pins), you will need to solder the SDA:A4 and SCL:A5 solder jumpers. This will connect SDA and SCL to the A4 and A5 pins to accommodate an older Uno or Duemillanove.
  5. The solar panel/barrel jack voltage feedback is, by default, connected to A0. It can be disconnected but cutting the trace in the VADP:A0 solder jumper and it can be connected to A3 by soldering the VADP:A3 solder jumper.
  6. When connecting the energyShield 2 Pro to your project, follow these safety steps to prevent shorts or damage.
    1. Turn off the energyShield 2 Pro.
    2. Connect the energyShield 2 Pro to you Arduino style board or other project.
    3. Ensure that all connections are correct (i.e. shield is stacked properly).
    4. Now you may turn on the energyShield 2 Pro to power your project.

NS_energyShield2 Arduino Library Quick Start

This is a quick start guide. For a complete reference, see the eS2 Arduino Library Reference.

First, download the NS_energyShield2 library from the NightShade GibHub (Download Latest Revision). Extract the NS_energyShield2 folder into the libraries folder inside your Arduino sketch folder. This is typically Documents/Arduino/libraries on Windows. Now, restart the Arduino IDE and you are ready to begin.

When you begin writing your Arduino sketch, you must first include the library header files NS_energyShield2.h and Utilities.h. This can be done by manually inserting the following two lines at the top of your program or by clicking Sketch → Include Library → NS_energyShield2.

#include <NS_energyShield2.h>
#include <NS_eS2_Utilities.h>

Next, you have to create a global NS_energyShield2 object. This is done before the setup() and loop() functions.

#include <NS_energyShield2.h>
#include <NS_eS2_Utilities.h>

NS_energyShield2 es2;

void setup() {

}

void loop() {

}

The last step that you must take in every sketch written with the NS_energyShield2 library is to call begin() in the setup().

#include <NS_energyShield2.h>
#include <NS_eS2_Utilities.h>

NS_energyShield2 es2; 

void setup() { 
   es2.begin(); // Initializes the energyShield 2 
} 

void loop() { 

} 

Now, if you are using a solar panel for charging you should put the setVMPP() command immediately after begin(). If you want a custom LOW battery LED setting, you should set the batteryAlert() soon after begin(), because begin() sets the alert to 10%.

#include <NS_energyShield2.h>
#include <NS_eS2_Utilities.h> 

NS_energyShield2 es2; 

void setup() { 
   es2.begin(); // Initializes the energyShield 2 
   es2.setVMPP(17500); // Set solar panel VMPP regulation to 17.5V
   es2.batteryAlarm(20); // Set battery "LOW" LED to 20%
} 

void loop() { 

} 

Now you can use any function in the energyShield 2 Pro library including functions like voltage(), current(), readClock(), and sleepSeconds().

Go ahead a browse the energyShield 2 Pro Arduino Library - Reference page and explore all of the functions and data available to you.

More Information

 

Was this article helpful?

Related Articles