How to get battery level if I use Linear Regulator?

⚠️
Hi there.. thanks for coming to the forums. Exciting news! we’re now in the process of moving to our new forum platform that will offer better functionality and is contained within the main Dialog website. All posts and accounts have been migrated. We’re now accepting traffic on the new forum only - please POST any new threads at//www.wsdof.com/support. We’ll be fixing bugs / optimising the searching and tagging over the coming days.
9 posts / 0 new
Last post
daniel59
Offline
Last seen:1 year 5 months ago
加入:2016-01-08 04:34
How to get battery level if I use Linear Regulator?

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:
MT_dialog
Offline
Last seen:2 months 3 weeks ago
工作人员
加入:2015-06-08 11:34
Hi daniel59,

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

daniel59
Offline
Last seen:1 year 5 months ago
加入:2016-01-08 04:34
Hi 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

MT_dialog
Offline
Last seen:2 months 3 weeks ago
工作人员
加入:2015-06-08 11:34
Hi daniel59,

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

daniel59
Offline
Last seen:1 year 5 months ago
加入:2016-01-08 04:34
Hi 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

MT_dialog
Offline
Last seen:2 months 3 weeks ago
工作人员
加入:2015-06-08 11:34
Hi 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

daniel59
Offline
Last seen:1 year 5 months ago
加入:2016-01-08 04:34
Hi 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

MT_dialog
Offline
Last seen:2 months 3 weeks ago
工作人员
加入:2015-06-08 11:34
Hi daniel59,

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

daniel59
Offline
Last seen:1 year 5 months ago
加入:2016-01-08 04:34
Hi MT_dialog,

Hi MT_dialog,

Thank you, I'll try it.

Best regards,
Daniel