I need to measure the battery capacity using an ATmega32 microcontroller.
Hello everyone
I need to measure the battery capacity using an ATmega32 microcontroller. What is the best method or sensor to use? And How can I account for the battery's discharge rate and voltage drop over time in my measurements?
I would
I'm a bit stuck and would appreciate any guidance
Solution:Jump to solution
Use an analog-to-digital converter (ADC) pin on the ATmega32 to measure the battery voltage. You'll need a voltage divider circuit to scale the voltage to the ADC's input range (0-5V).
6 Replies
Solution
Use an analog-to-digital converter (ADC) pin on the ATmega32 to measure the battery voltage. You'll need a voltage divider circuit to scale the voltage to the ADC's input range (0-5V).
You can also use this IC for your battery power monitoring in your system
https://www.ti.com/product/INA219
INA219 data sheet, product information and support | TI.com
TIβs INA219 is a 26-V 12-bit I2C output digital power monitor. Find parameters, ordering and quality information
Thank you, i want to ask too if can I measure the current drawn from the battery as well? Would I need an additional sensor or circuit for that?"
The current drawn is dependent on the load the board is carrying at a given time. First check the IC datasheet if it's able to perform that function, if not I can give another recommendation
If it's okay to ask again π
, Does the method change based on the type of battery I am using, like Li-ion vs. NiMH?
It won't really change, you just have to check the sensor datasheet if it has a in specifications on the battery type. If not you could go ahead