Mega Pro Mini - Read voltages of batteries become inaccurate after 20hrs or so

Hi Guys,

Been working on a project for a while now, and I am seeing some strange results in voltage readings. I am using a Mega Pro Mini to read voltages of batteries in series, I am using voltage dividers to step down the voltages to ensure it is safe for the arduino and also to get a high has possible voltage reading/resolution for batteries between 3 and 4.2 voltages.

What I am see is when I first power up the Arduino, all voltages of each of the batteries read stable and correct. Then after about 20 hours or so of running the program (Im using Blynk to see results) the voltage readings of the cells in series start to jump around like crazy, for example, all cells read 4.05 voltages, then slowly over time for a few seconds I get a reading of 4.02 on some of the cells, then after 20hours or longer it then reads 1.2v or 3 or any random number breifly, then evently it never reads the correct voltages anymore. It is clearly degrading over times.

I am using a 9 voltage power supply and using AREF with a 5v input by using a LM7805 for my reference voltage (multi meter reads a stead 4.99vs even when my voltage readsings go nuts).

If then power cycle my aruino, all readings return to normal untill 20 hours or so pass the symptons return.

Im also powering an ESP8266 unit of my Arduino, the mah draw from it should be within spec of what the Arduino can provide at 3.3vs, how-ever I have noticed the 3.3 and 5.0 voltage regulators get pretty hot, ive put heatsinks on them and run a fan to cool the entire system.

Is there anything obvious I should check or something I should be doing?

thanks!

Nic

update to this, getting my strange voltage readings now after a few hours now, typically the fan would only go on when X temp is detected by sensor I have on the unit. I'm now forcing the fan on all the time to see if it is temperature related.

If you are using a very weak voltage divider, it may well cause instability. What resistor values are you using? You have the required capacitors around the LM7805 ?
Maybe supply a schematic.

I thought that the ESP’s input are 3.3v tolerant and not 5v for V-ref ?

Steveiboy:
I thought that the ESP’s input are 3.3v tolerant and not 5v for V-ref ?

yeah Im using the 3.3v on the Arduino to power the ESP. Rhe AREF is being fed from a LM7805 for stable and constant 5v reading to be used as a reference for the analog pins when reading the battery cell voltages

It would really help if you could provide a schematic so that it is easier to understand your situation. I am curious about the need for a fan just to monitor battery voltages. Something is not right and with a schematic we can probably figure it out quickly.

On a side note, I worked on a project with the brand new Nano 33 IOT board doing something similar to what you are doing. In the end, I scrapped using that board as it did not give me very stable readings (but it was not after a long time, it was right away so in a way different). My Uno and regular Nano had much more robust performance when it came to that. I never investigated the root cause but I might do that one day by hooking it all up to an oscilloscope to study the voltage levels over time.

Good luck!!

6v6gt:
If you are using a very weak voltage divider, it may well cause instability. What resistor values are you using? You have the required capacitors around the LM7805 ?
Maybe supply a schematic.

Will try and put together a schematic to help with this;
These are the resistor values Im using for the voltage dividers for measuring the 7x batteries in series;
//Resister kOhm used for each pack
float B1R1 = 9100;
float B1R2 = 7500;
float B2R1 = 20000;
float B2R2 = 13000;
float B3R1 = 36000;
float B3R2 = 10000;
float B4R1 = 75000;
float B4R2 = 13000;
float B5R1 = 75000;
float B5R2 = 10000;
float B6R1 = 75000;
float B6R2 = 10000;
float B7R1 = 91000;
float B7R2 = 10000;

From top down its the first battery, so 3.0 to 4.2 for each pack, where the 7th pack is 21 to 29 (approx) voltage, I have code that subtracks pack 2 from 1 to get pack 2 voltages so on and so forth, all works well and is accurate, untill a few hours now it seems. The resistors I am using gives me the highest posible voltage range to measure which translate to the resolution the Arduino can measure.

For the LM7805, it is just coming directly of the PSU, it provides9v and then gives me 5v for AREF, no power is being drawn off the LM7805 as its just AREF, would this still need a capacitor?

thanks heaps!

amaruk:
It would really help if you could provide a schematic so that it is easier to understand your situation. I am curious about the need for a fan just to monitor battery voltages. Something is not right and with a schematic we can probably figure it out quickly.

On a side note, I worked on a project with the brand new Nano 33 IOT board doing something similar to what you are doing. In the end, I scrapped using that board as it did not give me very stable readings (but it was not after a long time, it was right away so in a way different). My Uno and regular Nano had much more robust performance when it came to that. I never investigated the root cause but I might do that one day by hooking it all up to an oscilloscope to study the voltage levels over time.

Good luck!!

Will get a schematic soon, it might help me realise a mistake also!
There is allot of other things the system does, just havnt detailed it here. The board is in a vented box with temperature sensors, so when temp reachs 40 degrees the fan turns on to cool.
Other components that I have built in is a voltage/power disipation method for each of the 7x batteries. So when 4.15v voltage is reached for any of the packs (from being charged from solar MPPT) it starts disipating voltage/power through 2x resistors @ 500mAh of current (each pack as its own resistors/SSR), this is done to top balance my lithium power wall each day.
When disipation occurs fans autmatically turn on to cool the resistors and the large heat sinks attached to them. This switch is done through solid state relays, which ensure the voltage/power dispation systems are 100% eletrically isolated from the rest of the system.
The issues that I am seeing occur regardless if I am balancing or not, currently nothing is hooked up other than the voltage monitoring/dividers to try and disagnose.
I also have 2x shunts which measure power draw and solar charge, this is done through an ADS1015 using the analog pins 0 to 3 in voltage difference mode. This also isnt connected during my troubleshooting steps here;
I’ve got another Arduino Pro Mega mini, will program that up, connect it and see if same results, the system is designed on a PCB where all the sensors, arduino, ads and esp can be pulled out of connector pins incase some dies down the line.
cheers, nic

hksmonaro:
LM7805 [..] would this still need a capacitor?

Yes, always. 10 µF will do.

Erik_Baas:
Yes, always. 10 µF will do.

So does this go on the regulated 5v output?

Yes, between that and GND.

Erik_Baas:
Yes, between that and GND.

So just like this, but I only need on the output 5v + gnd (right have side capacitor)


Do you recon this could be a cause, or just what you need to have on an LM7805?
Cheers,

quick update, been running on my spare Arduino, so far so good. No drop in voltage readings on the 7 battery packs, all very stable with only a 0.001 - 0.006 mV variation!

Link above shows voltage delta between all 7x packs in series, when I get the weird readings this jumps like crazy! Looking good :slight_smile: