Hi all,
I found that the Battery Level driver get Battery Level by its voltage, but if I use Li-on battery with a 3.3v Linear Regulator, the voltage is always 3.3v.
Is there any method to get the battery level?
Thanks,
Daniel
Device:
Hi daniel59,
The battery driver will return the ADC measurement from the internal channel that the 580 has for the VBAT3V supply (ADC_CHANNEL_VBAT3V), if you would like to measure the battery level on the battery itself, you could try to use one of the external channels that ADC has in order to do so. Just be aware that the reference measurement ADC voltage is 1.2V and with the attenuator used you can measure up to 3.6V.
Thanks MT_dialog
Hi MT_dialog,
So what will happen if the battery is at 4.2v? return 3.6v or go error?
Best regards,
Daniel
Hi daniel59,
No it will just return the maximum value that the ADC can measure, meaning with the attenuator at 3.6V, it wont return an error.
Thanks MT_dialog
Hi MT_dialog,
Thank you for your answer. So I need to do is to connect battery's positive to P0[0:3]?
Best regards,
Daniel
Hi daniel,
To start with, it is not suggested to apply a pin to a 4.2V source, since that value surpasses the absolute maximum ratings of the pin on the 580 (please check the datasheet). Regarding how to connect the battery to the ADC, yes this a way to do it, and also you will have to connect the ground as well in order to measure the voltage of a battery.
Thanks MT_dialog
Hi MT_dialog,
I see, datasheet shows the recommended voltage on a pin is 3.3v while I use 3.3v as my battery voltage.
But how can I decrease the voltage goes into the pin?
Best regards,
Daniel
Hi daniel59,
If you would like to measure the voltage on the battery (since as far as i understand this is your concern) you could use an extenral voltage divider in order to do so, and use the ADC without the attenuator in order to measure the 4.2V that the battery has as output.
Thanks MT_dialog
Hi MT_dialog,
Thank you, I'll try it.
Best regards,
Daniel