Reading battery voltage with ads1115 adc

Thread Starter

benassve

Joined Nov 1, 2023
10
Hello, im a student and i want to make automatic battery sorter, which sorts batteries by their voltage. Voltage needs to be measured in milivolts range. I mean one group of batteries for example VTC6 needs to be in sorted in groups from 3.591V-3.594, next group is 3.595V-3.598 and so on...
Im going to do measurements with ads1115 in diferential mode, but i do not fully understant how this mode, only that it can use all 16 bits of adc for max accuracy. And this mode helps to reduce noise
As i understant i need to connect + of the battery to Ain3 and - of the battery to Ain2. + of the battery would go through voltage divider to scale the voltage down, because im using 3.3V as Vdd. Using this method i should get readings from 0V to +Bat
1702840516345.png
So my questions are:
1. Will this design work, if not how to change it?
2. How could i improve this design?
 

crutschow

Joined Mar 14, 2008
38,316
You can increase the resolution of your measurement by measuring just the battery voltage differences, not the total voltage.
This can be done by connecting the AIN3 input to a stable IC reference voltage set to slightly below the minimum battery voltage you want to measure, and AIN2 to the battery plus terminal with the minus terminal to ground.

To remove any effects of reference voltage drift, you could add an analog multiplexer to measure the reference voltage periodically before you do the battery measurement.
 

Thread Starter

benassve

Joined Nov 1, 2023
10
You can increase the resolution of your measurement by measuring just the battery voltage differences, not the total voltage.
This can be done by connecting the AIN3 input to a stable IC reference voltage set to slightly below the minimum battery voltage you want to measure, and AIN2 to the battery plus terminal with the minus terminal to ground.

To remove any effects of reference voltage drift, you could add an analog multiplexer to measure the reference voltage periodically before you do the battery measurement.
Thank you for quick reply. So if I add voltage reference of 3 Volts to Ain3 pin the measurment would be done between 3V and the Bat+ value which is bigger than 3 volts. Using this method all ADC steps would be divided between those two values?

As you suggested i should measure voltage of reference voltage IC output with same ADC connecting output of that IC to Ain1 and gnd to Ain0 and use measured value in calculations of battery voltage?
 

Ian0

Joined Aug 7, 2020
13,097
You will need a reliable method of connecting the batteries. With that level of accuracy, small changes in contact resistance will make big variations in the numbers that you measure.
 

Thread Starter

benassve

Joined Nov 1, 2023
10
You will need a reliable method of connecting the batteries. With that level of accuracy, small changes in contact resistance will make big variations in the numbers that you measure.
I was going to use few gold plated probes (like needles) hooked up to wire. Servo motors would push those probes to battery test point
 

Irving

Joined Jan 30, 2016
4,996
An Analog Devices ADR4533BRZ is a 0.02% reference with 2ppm temp drift giving a reference voltage of 3.3v +/- 660uV for a very reasonable $10

This would allow a measurement of 3.300v - 3.812v to 16bit resolution (ADC set to 0.512v FSR) with a precision of +/- 660uV

Board layout (and battery contacts as stated above) will be critical to acheiving repeatable measurements.

A mechanical jig, with pogo probes soldered directly to a PCB should give a good result.
 

Irving

Joined Jan 30, 2016
4,996
What type of cell and form factor are they? What is the purpose of batching them?

[Edit] Ah, VT6C are Sony 18650 LiPo
 
Last edited:

eetech00

Joined Jun 8, 2013
4,704
If im not mistaken external adc’s is better than those in microcontrollers and can give more accurate results
Not necessarily.
There are so many PIC micro-controllers to choose from I recommend you to consult Microchip support to help you make a choice.
Explain to them everything you want to do with this project.
They are very good at this (I've used them a few times).
 

Papabravo

Joined Feb 24, 2006
22,058
There is literally no point in having a 24-bit A/D converter if the 8 least significant bits return a randomly distributed value each time you take a reading. How would you resolve such an ambiguity without putting the whole thing in a temperature-controlled oven. Just FYI, those things are not cheap.
 

eetech00

Joined Jun 8, 2013
4,704
There is literally no point in having a 24-bit A/D converter if the 8 least significant bits return a randomly distributed value each time you take a reading. How would you resolve such an ambiguity without putting the whole thing in a temperature-controlled oven. Just FYI, those things are not cheap.
What 24bit adc?
I'm thinking 16bit or less.
 
Last edited:

nsaspook

Joined Aug 27, 2009
16,250
They once were expensive, not any more. You can buy a 24-bit ADC breakout for $6.
https://www.adafruit.com/product/4538

The OP needs micro-volt resolution for some reason to measure and sort batteries by a few mill-volts. A dubious process IMO but easily possible today on the cheap if there is a precision voltage reference to calibrate it with with.
https://www.nuvoton.com/export/resource-files/NAU7802 Data Sheet V1.7.pdf
The Nuvoton NAU7802 is a precision low-power 24-bit analog-to-digital converter (ADC), with an onboard low-noise programmable gain amplifier (PGA), onboard RC or Crystal oscillator, and a precision 24-bit sigma-delta (Σ-Δ) analog to digital converter (ADC). The NAU7802 device is capable of up to 23-bit ENOB (Effective Number Of Bits) performance. This device provides a complete front-end solution for bridge/sensor measurement such as in weigh scales, strain gauges, and many other high resolution, low sample rate applications.
 

Papabravo

Joined Feb 24, 2006
22,058
What 24bit adc?
I'm thinking 16bit or less.
I think you missed the point – hyperbole for effect. It was an example that I chose to illustrate the futility of going for overkill on a personal project. The illusion of the uninformed would be that the 24-bit A/D was more accurate, but if the 8 LSB's behave like a random number generator that you've paid a good bit of coin for, and it is something which has no value to you in your quest. I could make the same argument with a 10-bit and a 16-bit device. I agree that using a micro with an embedded A/D has a number of attractive features about it.
 

nsaspook

Joined Aug 27, 2009
16,250
I think you missed the point – hyperbole for effect. It was an example that I chose to illustrate the futility of going for overkill on a personal project. The illusion of the uninformed would be that the 24-bit A/D was more accurate, but if the 8 LSB's behave like a random number generator that you've paid a good bit of coin for, and it is something which has no value to you in your quest. I could make the same argument with a 10-bit and a 16-bit device. I agree that using a micro with an embedded A/D has a number of attractive features about it.
I think you're pessimistic about what's possible today with just a little effort and a little coin with modern hardware and DSP (hardware in the ADC chip).
https://forum.allaboutcircuits.com/threads/super-moon-shine.100322/post-898360
20-bit solid, usable resolution from an old (2013 era) ADS1220 is possible without much trouble. The latest technology devices are better.
1702864883818.png
 
Last edited:

Papabravo

Joined Feb 24, 2006
22,058
This is still a free country, and you CAN design whatever you want if it makes you happy. If you know what you want, then by all means have at it and don't bother wasting time asking for advice. I really don't care what you decide to do.
 

Irving

Joined Jan 30, 2016
4,996
Not going to get into the issues of 24bit v 16bit, other than to say there will be noise in the system, and the average over several readings will be needed to reduce the impact of that.

However I do question the value of sorting cells into voltage groups without knowing the actual SoC. These cells have a nominal voltage of 3.7v, which is the approx voltage they tend to drop to on-load after initial discharge at the 20C rate (from around 4.1 - 4.2v at 100% SoC). They will sit at or near that voltage for a considerable period of time until down to around 20% SoC when the voltage drop starts to increase rapidly until around 3v at <5% SoC. The only way this selection makes any useful sense is, after fully charging using a correct CC/CV process to establish 100% SoC, they are discharged accurately, at a known fixed rate for a specific period of time and under carefully controlled environmental conditions, to establish a known SoC, eg 70% at which to evaluate them. Even then I don't see the benefit of sorting into 5mV groupings - what purpose does that solve?
 

MrChips

Joined Oct 2, 2009
34,628
You will need a reliable method of connecting the batteries. With that level of accuracy, small changes in contact resistance will make big variations in the numbers that you measure.
The effect of contact resistance at zero load current is zero. I would be more concerned with contact potential with dissimilar metals.
 
Top