Always reading same battery voltage



  • @bucknall

    Sorry, can only post every 600s.

    I am using pymakr (I know it isn't a good idea). What other options do I have to check?

    But even when writing the value to a text file, without the usb, it is giving me the same value.



  • Hi @mmarkvoort,

    Are you trying to measure the voltage while you have the board powered over USB, i.e. using the REPL to check?



  • @livius

    When using the code that was given in the forum post (which uses attenuator 1) + changing to what you said (so changing it to 3).
    I get this:
    Mean of ADC readings (0-1023) = 1509.5199584960937
    Mean of ADC readings (0-1400 mV) = 2063.7967586517333
    Variance of ADC readings = 27.4036669731140
    10* * 6 * Variance/(Mean**2) of ADC readings = 12.0000004768372

    When I use the adc from docs.
    I get:
    1520 and the next read 1530.

    It does change something, but still doesn't look good to me.

    Does the USB cable matter?



  • @mmarkvoort

    try use attenuator (i do not know why it is not documented)

    apin=adc.channel(pin='P13', attn=3)
    

    do you use it like in post you link?


Log in to reply
 

Pycom on Twitter