Test Software 1 Used Battery Capacity V,A,W

For the first program I used an Arduino mega with an LCD screen to read out volts, amps and watts (see program below).  I hooked to a small wood test cart I build.  This cart uses an over 150 watt hour lithium ion battery with 24 cells.  It also uses a perminent magnet DC worm gear motor.  The program is contained inside the next program below.  Below you can see the test cart and the program read out.  Please also see the video below.


Img 4275Img 4274

Img 4276


The next program I made was used to test the capacity of used lithium ion cells (please find the program below).  I am building the full scale prototype car battery from over 500 used laptop cells.  It is very important to test the capacity of cells when building a large battery so that you do not stress the cells.

I used the Arduino and LCD screen to display the voltage of the battery, the amps and mah.  I used a low resistant resistor (.2 ohm) to measure the current using the voltage drop.  I used a transistor (2N2222) and a relay to disconnect the battery when its voltage was low.  Two 12V car light bulbs (50 cents each) were used as the load.

Video below.

Img 4188

Img 4192

Img 4249



The program


  The LCD circuit:
 * LCD RS pin to digital pin 12
 * LCD Enable pin to digital pin 11
 * LCD D4 pin to digital pin 5
 * LCD D5 pin to digital pin 4
 * LCD D6 pin to digital pin 3
 * LCD D7 pin to digital pin 2
 * LCD R/W pin to ground
 * 10K resistor:
 * ends to +5V and ground
 * wiper to LCD VO pin (pin 3)
 This code is in the public domain.

// include the library code:
#include <LiquidCrystal.h>

// initialize the library with the numbers of the interface pins
LiquidCrystal lcd(12, 11, 5, 4, 3, 2);

double V= A1;

 double A= A2;
 double mah=0;
 int off=6;

void setup() {
  // set up the LCD's number of columns and rows:
  lcd.begin(16, 2);
  pinMode(off, OUTPUT); //pin to open switch

void loop() {

  // (note: line 1 is the second row, since counting begins with 0):
  lcd.setCursor(0, 0);
  double Vo = analogRead (V);
   double Volts= ((Vo/204.6)*3); //calculate volts
   double amps= analogRead (A);
   double Amps= ((((amps)/204.6)/.2)*1.07); //correction //amps from voltage drop across a .2 ohm resistor, 1.07 is a correction factor after testing
   double Watts=(Volts*Amps);
   mah=mah+((Amps)/.36); //mah calculates and adds up every 10 second loop
  lcd.print("V= ");
  lcd.print(" A= ");
  lcd.setCursor(0, 1);
  lcd.print("mAH= ");
  delay(10000); // 10 second deslay
  if((Volts)<1.5)  //disconnect circuit when voltage is under 1.5V, when load is removed voltage will come back over 3V
  digitalWrite(off, HIGH); //which stays on (open) until reset

Add a comment

You're using an AdBlock like software. Disable it to allow submit.