Welcome to the Pycom forum Forum
    • \[\[global:header.categories\]\]
    • \[\[global:header.recent\]\]
    • \[\[global:header.tags\]\]
    • \[\[global:header.popular\]\]
    • Login

    Explore Pybytes | Official Documentation | Report a Firmware Bug/Issue | GitHub

    ADC Accuracy

    Scheduled Pinned Locked Moved LoPy
    adclopy
    3 Posts 2 Posters 2.2k Views 3 Watching
    Loading More Posts
    • Oldest to Newest
    • Newest to Oldest
    • Most Votes
    Reply
    • Reply as topic
    Log in to reply
    This topic has been deleted. Only users with topic management privileges can see it.
    • D Offline
      dbrgn
      last edited by

      I'm trying to measure input voltage using a voltage divider.

      When measuring the voltage on the ADC pin with a multimeter, I get 0.8V. According to the docs, the input range is 0-1.1V, right? In that case this should give me a 12bit ADC reading of 2979, but the actual reading is 3231. That's off by 0.06V (which corresponds to 0.3V when measuring higher voltages using an 1:5 voltage divider).

      This is how I'm initializing the ADC:

      pin_adc = adc.channel(pin='P20')
      

      Am I doing something wrong?

      robert-hhR 1 Reply Last reply Reply Quote 0
      • robert-hhR Offline
        robert-hh @dbrgn
        last edited by

        @dbrgn No. The ADC is simply bad. And the real range is something like .07V - 1.05V, but slightly varying between device, some non-linearity and a huge amount of noise. See also the discussion in the espressif forum , e.g. here:
        https://esp32.com/viewtopic.php?f=19&t=2881&p=13739&hilit=ADC+linear#p13739
        If you need as precise ADC, use an external ADC, e.g. from analog devices, like ADS1115 (I2C) or ADS1118 (SPI).

        1 Reply Last reply Reply Quote 1
        • D Offline
          dbrgn
          last edited by

          Ouch. That's probably something that should be documented by Pycom. Thanks for the link!

          1 Reply Last reply Reply Quote 0

          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
          • 1 / 1
          • First post
            Last post

          Pycom on Twitter

          Pycom