Arduino Accurate Voltage Measurement for cells stacked in series

Discussion in 'Embedded Systems and Microcontrollers' started by element14, May 23, 2015.

  1. element14

    Thread Starter New Member

    May 23, 2015
    3
    0
    I need to monitor voltages of Li-Ion cells stacked in series and appropriately operate protection circuitry using Arduino.

    1. First I ran into the problem of using <10kOhm resistors for a voltage divider as per the ATmega328 datasheet because when I tried to use large value resistors the readings were jumping a lot even though I took mode of 5 analog readings in the software...

    2. Then there is this problem of fluctuating Vcc of the arduino which is used as Vref for analog measurements...So, I decided to switch to the internal 1.1V which actually turned out to be 1.085V for my board....this gave nice results when I measured across each ResistorDivider separately...but when I try to measure the voltages of all the cells in series at the same time and subtracting them in the software to get each cell's voltage...1st two cell voltages were fine...but the third was always problematic(no issue in the code...one time it gave correct readings)...i tried to change the Arduino board..double checked all connections...but still it gave abnormal readings....although the same resistor divider when checked separately was working correctly for 3 cells....

    3. I decided to use a difference amplifier...used an LM324N opamp and made a difference amplifier...but the problem is even though I connected 0-9V at its across its rails..and tried to measure a cell that has voltage of 3.66V...the output pin of the 324N gave 3.33V.....so I thought maybe it gives an output of (3.66-3.33)= 0.33V....but for the other cell this subtraction factor changed....

    SO0o... what should I do.. should I use precision resistors or some Precision Difference Amp like INA154 or INA133 (would they give accurate output voltages when I have enough supply on the rails)??

    I am stuck with this voltage measurement problem! :-x

    PS: also tried to use the AREF pin...I connected it to 5V from a LM7805..but as soon as I ran it dropped down to 3.XX..How can I provide the AREF pin with a precise voltage reference?
     
  2. ErnieM

    AAC Fanatic!

    Apr 24, 2011
    7,386
    1,605
    Too many random details. Do you have a schematic of what you are trying to measure?
     
  3. element14

    Thread Starter New Member

    May 23, 2015
    3
    0
    Here is a simple schematic attached (resistors values are those calculated for 1.1V AREF)....and also a screen shot of the readings I got before with taking Vcc as AREF (when it was working fine....Serial monitor) and the recent readings that are messed up for cell3 in [2nd row,1st column...LCD] and so it also disturbs cell4 as I measure each cell's voltage by subtracting from the previous pick off point in the code...

    Note that now it doesnt matter..either Vcc or internal 1.1V as AREF...the problem is still there.....The Voltage Divider formed by R2 & R6...when I connect a string of 3 cells in series directly across it and measure voltages...they are fine...but when I try to measure all the cells as shown in the schematic...cell3 gives abnormal readings.....!
     
  4. ErnieM

    AAC Fanatic!

    Apr 24, 2011
    7,386
    1,605
    Your schematic only shows connections for reading voltages. Your data looks fine for these.

    Where did current measurements come from?
     
  5. element14

    Thread Starter New Member

    May 23, 2015
    3
    0
    I am using differential voltage measurement, so:
    cell1 = pickoffpoint1
    cell2= pickoffpoint2 - pickoffpoint1
    cell3= pickoffpoint3 - pickoffpoint2
    cell4= pickoffpoint4 - pickoffpoint3

    The lcd display is showing the readings that are recently measured...For the voltage divider formed by R2 and R6, when I measure the voltage across R6 with a Multimeter, I get 0.83V... so in the software after converting it back to 0.83V ... I multiply it by (8.2+6.8)/6.8 which equals 10.83V...that is the combined voltage of 3 cells (cell1+2+3) in series ...but even though the code is absolutely fine...I can't get 10.83V rather some 12.45V or 15V sometimes?? What could have gone wrong with ADC measurements?

    Cell1 and cell2 voltage values are fine but the next measurement is abnormal!
     
  6. ErnieM

    AAC Fanatic!

    Apr 24, 2011
    7,386
    1,605
    Ahhh... "current" has a meaning of "present time."

    You need to show your work, show how you do these calculations from reading the A2D to the final answer (just before you send to the LCD).
     
Loading...