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 conversion values

    Scheduled Pinned Locked Moved Discussion
    adcadc accuracylopy4sensor
    4 Posts 3 Posters 271 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.
    • A Offline
      Alephus
      last edited by

      Good evening

      Ive been trying to figure out own to properly obtain some values from a gas sensor (MQ131) into my lopy4 over ADC but ive been getting values that are a bit off and i wanted to make sure im doing things right:

      Sensor Vcc is connected to an external 5v psu
      Sensor GND is connected to ground on Lopy4

      First, this sensor output is betwen 0~4,6v so i know that i wont be able to get all values from ADC even at attn of 11

      But even so when measuring sensor output, im getting, for example 0,22v and lopy actually says im getting about 0,33v.

      So my question is: how can i actually measure this sensor output in this configuration?

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

        @Alephus Loyp Just scale them properly. You may also take the raw ADC readings and do the conversion yourself. But I would add a voltage divider between you gas sensor and the ADC input, such that the input never gets a value > 3.3V. That divider could for instance constist of a 10k (between ADC Input and GND) and 4.7 K (between ADC input and sensor output) resistor, with an additional 10nF capacitor between ADC input and GND. The scaling factor would then be 1.47 (if you read 1V, the actual output value is 1.47 V).

        1 Reply Last reply Reply Quote 0
        • M Offline
          mrks tsk
          last edited by

          voltage_divider.JPG

          @robert-hh I have made Expansion Board 3.1 -style voltage divider like this on my breadboard but I'm still a little bit uncertain where to place that little 10nF capacitor. Can you help me?

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

            @mrks-tsk The capacitor has to be placed between ADC input and GND. In your diagram at the VBATT side.

            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