ADC voltage reference
-
Hi to all,
I'm using a gpy with a pytrack 2 and I'm trying to calibrate it getting the voltage reference to P22. So, I run these commands:
from machine import ADC
adc = ADC()
adc.vref_to_pin('P22')but when I go measure the voltage on P22 with a voltmeter I get almost 3V. That is not I expected, should be around 1,1V.
So, anyone can help me about where I'm wrong?
-
@lolloz Pytrack 2 uses P21 and P22 as SDA and SCL for the sensors, which means that the have a pull-up resistor connected. And P6 is used by the GPY LTE modem.
So you cannot use vref_to_pin() in that set-up. Since you need a multimeter anyhow, you can get the calibration value by measuring a known voltage with multimeter and the internal adc, get the default vref and calculate the vref value from ratio of externally to internally measured voltage. -
@robert-hh thank you so much for your quickly answer.
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