problem measuring battery voltage
-
hello,
i measure the battery voltage from pin16 using lopy 4/exp Board 3.0r.
here is a code for demonstration.adc = ADC() p_bat = adc.channel(pin='P16', attn=ADC.ATTN_11DB) vol_bat = p_bat.voltage() * 3.05 #factor from voltage dividervol_bat is about 6050 mV everytime i measure it but it should be 4100.
did someone have the same problem? how can i fix it? -
@apo1997 use another factor than 3.05. This factor is related to the voltage divider on the expansion board. For board V2, 3.05 was about right. For board 3, the factor should be close to 2. Since you also gave to correct for the ADC variation, you can use your own factor. In this case 2.067.
-
ty :).
In the official documentation the values of the voltage divider are 155kOhm and 56kOhm for board 3. Can you text me the correct values ?
-
@apo1997 There was a thread about it. That told 1M Ohm/1M Ohm.
Edit: look here: https://forum.pycom.io/topic/3776/adc-use-to-measure-battery-level-vin-level/13 -
This post is deleted! -
even in this post the most recent answer i found is:
Pycom Expansion board v3.0: 115 kΩ / 56 kΩ
Pycom Expansion board v3.1: Undocumented, probably like v3.2? (yes, prooved)
Pycom Expansion board v3.2: 1 MΩ / 1 MΩSo this post is wrong too about the 3.0 version i am using.
These threads are from 2018. We are living in 2020 in few months and pycom still didnt corecct it in their official documentation, thats weird.But ty for your answers, 2.067 is a very precise factor for my application!
-
@apo1997 said in problem measuring battery voltage:
even in this post the most recent answer i found is:
Pycom Expansion board v3.0: 115 kΩ / 56 kΩ
Pycom Expansion board v3.1: Undocumented, probably like v3.2? (yes, prooved)
Pycom Expansion board v3.2: 1 MΩ / 1 MΩSo this post is wrong too about the 3.0 version i am using.
These threads are from 2018. We are living in 2020 in few months and pycom still didnt corecct it in their official documentation, thats weird.But ty for your answers, 2.067 is a very precise factor for my application!
Hi, have you even got any offical documentation for the v3.1 of the expansion board? I'm also interested in a circuit diagram of the expansion board. I have strange things happening depending if the board is powered via USB or battery, but I'd really want a circuit diagram to first try and rule out a mistake on my side, before I try and log a "bug"... Also explaining my issue would be much easier if I had the right info...
Hello! It looks like you're interested in this conversation, but you don't have an account yet.
Getting fed up of having to scroll through the same posts each visit? When you register for an account, you'll always come back to exactly where you were before, and choose to be notified of new replies (either via email, or push notification). You'll also be able to save bookmarks and upvote posts to show your appreciation to other community members.
With your input, this post could be even better 💗
Register Login