Deicimila on polymer lithium ion batteries

Hi,

I am new to hardware so please be patient if my questions seem obvious or are badly phrased. : )

I am building a wireless RFID reader using a Deicimila, Xbee shield & P*rallax RFID reader. The RFID reader requires 5V and 100mA current. I have it connected to the Arduino's 5V pin, where it works fine when running from USB power. I measure overall current for the project as 184mA (measured at the jumpers).

I am now trying to develop a battery power solution for the project to make it fully wireless. I am looking at two 3.7V Polymer Lithium Ion batteries connected in series to create 7.4V. I would connect this battery pack to the Arduino's Vin and Gnd pins to regulate the voltage.

Does this sound like a viable option? Any better ideas?

Thanks,
rogermm

should work well enough but beware when using lipos, if they discharge below 3v (3.3v to be safe) per cell, they are damaged and can possibly erupt explosively (youtube it). better have a reliable way to monitor battery voltage and cut it off

i'm sure you know this but, keep in mind that parallax rfid reader uses serial (so you could just hook the xbee right up to the parallax reader and read the parallax over the other xbee)

if you were opening a door or something you'd then need a microcontroller on the rfid side....

reading that rfid reader was a bit of a challenge when i was new to the programming (pretty easy now)

here's my original code for a door opener that used a stepper motor and 2 rfid keys

to get u started: (yes i know i didn't need that mosfet! lol i didn't understand stepper library back then)

#include <Stepper.h>
#define STEPS 24
Stepper stepper(STEPS, 10, 12, 11, 13);

int  val = 0; 
char code[10]; 
int bytesread = 0; 


void setup() { 

Serial.begin(2400); // RFID reader SOUT pin connected to Serial RX pin at 2400bps 
pinMode(2,OUTPUT);   // Set digital pin 2 as OUTPUT to connect it to the RFID /ENABLE pin 
digitalWrite(2, LOW);                  // Activate the RFID reader
pinMode(9,OUTPUT);   // stepper mosfet
digitalWrite(9, LOW); 
stepper.setSpeed(1000);
}  


 void loop() { 

  if(Serial.available() > 0) {          // if data available from reader 
    if((val = Serial.read()) == 10) {   // check for header 
      bytesread = 0; 
      while(bytesread<10) {              // read 10 digit code 
        if( Serial.available() > 0) { 
          val = Serial.read(); 
          if((val == 10)||(val == 13)) { // if header or stop bytes before the 10 digit reading 
            break;                       // stop reading 
          } 
          code[bytesread] = val;         // add the digit           
          bytesread++;                   // ready to read next digit  
        } 
      } 
      if(bytesread == 10) {              // if 10 digit read is complete 

        Serial.print("TAG code is: ");   // possibly a good TAG 
        Serial.println(code);            // print the TAG code 

        Validation(code);
    } 
      bytesread = 0; 
           delay(500);                       // wait for 1/2 second 
    } 
  } 
} 



void Validation(char* i){
if( strncmp(i,"0F0302A580", 10) == 0) {
  Serial.println("Authenticated!");
    openLock();
  }
if( strncmp(i,"0415DA2B00", 10) == 0) {
  Serial.println("Authenticated!");
    openLock();
  }
  
} 

void openLock(){
//disable rfid reader
digitalWrite(2, HIGH); 

digitalWrite(9, HIGH);
stepper.step(480);
delay(700);
stepper.step(-480);
digitalWrite(9, LOW);

digitalWrite(2, LOW);

  }

Thanks knuckles904 for your thoughts. Any suggestions on how I can monitor the voltage and cut it off when it reaches 3V?

(I am thinking of using these Lithium Ion Battery - 2Ah - PRT-13855 - SparkFun Electronics batteries. The spec sheet says 2.75V is the 'Discharge cut-off Voltage". Is this what you are referring to?)

Thanks for your suggestions thefatmoop. My code is all sorted (that is the area where I have the least problems. :)) I am however interested in your idea of hooking the reader directly up to the xbee. How would you pull the enable pin on the reader low (to start reading) without the microcontroller?

That's is indeed the cut off voltage. But you sheet mail sparkfun if it has a built-in cuff off circuit. Most LiPo batteries have those but it's not clear if this one has it too.

That's is indeed the cut off voltage. But you sheet mail sparkfun if it has a built-in cuff off circuit. Most LiPo batteries have those but it's not clear if this one has it too.

I have mailed them and the reply is no. They suggest monitoring the discharge with an ADC. Anyone with experience in this area??

thanks

You could also get a discharge control pcb or a "lipo saver", google it or go to your local RC shop.
But you can also use the analog inputs of the arduino. Then the arduino itself can monitor the voltage and shutdown when the batteries are drained. Check the playground for the analog inputs.

Thanks. I will look into that.

Just to confirm, if one is powering the arduino from an external power source which is more than 5V - Deicimila specs recommend 7-12V - one should ONLY use the Vin pin? Is the power jack not an option?

Id second the lipo saver. Its a simple circuit thats well worth the price to keep the lipo from going kablooey. RC sites carry them (lipo is super popular in RC helis and planes) There might even be a diy version floating around on the internet. Can I also assume you have a way to balance the two cells (also very important with lipos)?

Hm, sounds interesting. Powering the arduino from an LiPo battery pack and loading it via usb port would be nice. There are serveral 5V LiPo loader circuits:

http://forum.sparkfun.com/viewtopic.php?p=49595&sid=de0283721530fc4c248c22eb10e06b1c

You could also use an dc/dc stepper to push the 3.3 V up to 5V. And use an 3.3 V arduino:

And here's a link how to build an LiPo saver:

ciao sunny

knuckles904, I am not familiar with cell balancing. Can you provide a little more info on this please?

sunbox, thanks for the links. 5V is insufficient for the project - I have tried Libelium's solar power module (just the board & battery) which uses a 3.7V lithium-ion battery pushed up to 5V. I require the full 5V from the Arduino 5V pin and the Diecimila specs say you need to provide 7-12V (when running from non-usb power) in order to get this. Also the sparkfun USB Lipo charger only charges one 3.7V cell at a time. You cannot use it to charge two cells connected in series - they must be disconnected and charged separately. Not a very functional option. :-/

For the short term, given that this project will be used by people other than myself, I have decided to test out a 7.2V NiMH battery used in RC & robotics. (I have read too much about the instability of lipos.) Anyone with experience monitoring a NiMH battery for end-of-discharge voltage with an Arduino?

The Lipo project will continue as a long-term goal. Thanks for all the help.

Here is a code fragment from an arduino application that uses 5 nickel cells. The battery is connected through a voltage divider that has two 4.7k ohm resistors – so the voltage on the analog input is exactly half the battery voltage.

// the following defines allows the preprocessor to calculate the values without using any runtime floating point
#define VOLTS_FACTOR  102   // analogRead divided by this factor = tenths of volts
#define LOW_VOLTS_WARNING  ((575 * VOLTS_FACTOR) / 100) //1.15v per cell = 5.75v
#define VLOW_VOLTS_ERR     ((550 * VOLTS_FACTOR) / 100) // 1.1v per cell = 5.5v
int  BatteryVolts;     // raw value from analogRead of battery pin, 1024 = 10 volts   

void CheckBattery(){
  BatteryVolts = analogRead(BattVoltsPin); // note BatteryVolts is global and this value is used when DisplayBattery is selected

  if( BatteryVolts < VLOW_VOLTS_ERR) 
     DisplayError(errBattFlat);  // code here to raise alarm that battery is flat !!!

  else if (BatteryVolts < LOW_VOLTS_WARNING)
     DisplayError(errBattLow);   // code here to warn that battery is low
}

CheckBattery should be called periodically.

edit: Btw, I replaced my freeduino voltage regulator with a low dropout version so I could use the 5 cell pack down to below 5.5 volts (my nominal battery voltage is 6 volts).

For your six cell pack, if you use the standard regulator and assume 2 volts dropout, you need to modify the threshold constants to something around:

#define LOW_VOLTS_WARNING ((720 * VOLTS_FACTOR) / 100) //1.2v per cell = 7.2v
#define VLOW_VOLTS_ERR ((700 * VOLTS_FACTOR) / 100) // 1.16v per cell = 7.0v

I hope that helps

heres a good lipo safety site

basically, each cell (2 in your case) needs to be within a certain voltage tolerance of the others to keep one cell from bleeding into another one and causing over/undervoltage problems. Once again, there are commercial balancers available for about 20$ and several diy versions
http://www.shdesigns.org/lionchg.html

The main advantage to Li-poly batteries are their energy density (watts per weight ratio) but they do carry price and safety (over discharge & over charging) concerns that require additional costs and complexity in using them.

Unless one is needing the weight advantage (R/C airborne use) then one is better off with NiMH batteries for typical Arduino applications.

Lefty

mem, thanks very much for the code! what a help. would definitely not have got there on my own.

a follow up question: if we are setting the LOW_VOLTS_WARNING constant to 7.2 (in analog), what voltage should I expect from the fully charged 6 cell pack?

Fresh Nickel batteries will charge to 1.5 volts per cell or even a slightly higher. So you will find the pack is around 9 volts when it comes off the charger, but will quickly drop down to around 8.5 volts or so and then slowly drop from there.

Thanks. Are their any other precautions I should take when connecting an RC-type battery like the NiMH to the arduino?

You might consider using an external fuse. R/C batteries have pretty high short circuit current ratings (low impedenace) and the 'standard' Arduino type boards usually don't fuse the external Vin power.

Lefty