cancel
Showing results for 
Search instead for 
Did you mean: 

Monitoring individual cells of battery pack (on NUCLEO-L432KC)

binary_jam
Visitor

Greetings,

Being rather new to designing/connecting electronics components, I got some questions regarding battery monitoring.

Setup:
NUCLEO-L432KC, driven by regular AA NiMH batteries in 3S configuration. Voltage is regulated by a small board based on a TI TPS63802 buck-boost-converter, which ensures a stable 3.3V output for the Nucleo board. The MCU is running stable with this power supply, everythings works out so far.

Task:
Now there's monitoring of the individual battery cells on the table. With three cells, three ADC inputs are required (if you don't do some switching outside of the MCU). The NiMH cells in question are rated at 1.2V nominal, with close to 1.4V when at full charge. Thus, if you measure the voltage after each cell, it would result to 1.2V, 2.4V and 3.6V nominal (or 1.4V, 2.8V and 4.2V max).

Gathered intel:
I understand that the ADC can only measure voltages between 0 and VREF, which equals to the 3.3V input voltage.
Regarding the measurement of <3.3V battery pack nodes, there's contradictory information on the web on how to connect this. Some say that you'd just connect the 1.2V/2.4V nominal from the battery pack directly to the ADC pin on the MCU. Others say, that you'd need at least some resistor to reduce the current flow (without specifying further).
Regarding the total package voltage, a divider is required (because 3.6V/4.2V is greater than 3.3V). From what I could gather, I would go with a high resistance divider with a filter cap. I understood, that high ADC sample times would be required, maybe even taking multiple measurements and taking an average. The setup for measuring the total pack voltage would look like this:

binary_jam_0-1768081496974.png

Questions:

  • How to connect the first two batteries of the pack to the ADC? Simply wire it up? Put some resistors in series? Maybe even some more components, to make it safe for the MCU?
  • Does the divider for measuring the total pack voltage look sound? Using a capacitor or not seemed to be a major discussion point.

Thanks in advance for your feedback! I'm happy to provide more information if required.

3 REPLIES 3
TDK
Super User

> How to connect the first two batteries of the pack to the ADC? Simply wire it up? Put some resistors in series? Maybe even some more components, to make it safe for the MCU?

Batteries are giant capacitors. No need for an RC filter here--wire it directly.

Wiring it through a series resistor has some safety advantages in case something gets shorted upstream, but it's not needed otherwise.

 

> Does the divider for measuring the total pack voltage look sound? Using a capacitor or not seemed to be a major discussion point.

The total divider has some issues:

  • At 4.2 V battery voltage, output to the ADC pin would be 3.5 V, which is too high. Increase the 200 kOhm or reduce the 1 MOhm. The total impedance is about 1 MOhm which is about the max you'll get away with.
  • The capacitor as you have it wired does nothing--both sides are connected to each other. It should be wired between the ADC pin and GND.

A capacitor isn't required but won't hurt things. It's not an important decision here and there is no correct answer. I would not add one if it were my design.

See:

How to optimize the ADC accuracy in the STM32 MCUs - Application note

especially "Workaround for high impedance sources"

If you feel a post has answered your question, please click "Accept as Solution".

Thanks for your valuable input!

 


@TDK wrote:

> How to connect the first two batteries of the pack to the ADC? Simply wire it up? Put some resistors in series? Maybe even some more components, to make it safe for the MCU?

Batteries are giant capacitors. No need for an RC filter here--wire it directly.

Wiring it through a series resistor has some safety advantages in case something gets shorted upstream, but it's not needed otherwise.

Okay, well. If it provides safety advantages, I could go for it. What resistance are we talking about here? Would it have impacts on measurement accuracy as well?

 

> Does the divider for measuring the total pack voltage look sound? Using a capacitor or not seemed to be a major discussion point.

The total divider has some issues:

  • At 4.2 V battery voltage, output to the ADC pin would be 3.5 V, which is too high. Increase the 200 kOhm or reduce the 1 MOhm. The total impedance is about 1 MOhm which is about the max you'll get away with.
  • The capacitor as you have it wired does nothing--both sides are connected to each other. It should be wired between the ADC pin and GND.

Oof. I made the mistake of calculating the resistor values with nominal cell voltage. I've updated the schematic in my original post. 240K and ~800K should give around 3.2V with 4.2V input. But now that I think of it again, I might change them a little more to have a bigger safety margin.

 


See:

How to optimize the ADC accuracy in the STM32 MCUs - Application note

especially "Workaround for high impedance sources"


Thanks also for linking the document. I actually read that sheet before. But to be brutally honest, I didn't understand all of it, because my past focus and experience was in software. Nevertheless, I'll consult it again.

Look up RIN for the ADC on the datasheet, it's probably in the 50 kOhm region, so adding another 10 kOhm isn't changing things but will reduce the injected current if the pin gets shorted to something outside of the range.

Consider making the board and then doing some tests with various components removed or changed to verify the accuracy is not significantly affecting.

If you feel a post has answered your question, please click "Accept as Solution".