I recently got a Dust sensor from a company and it says that the voltage out corresponds to the concentration of dust in the air. How can I use the GPIO pins to get the voltage reading?

The voltage is lower than 4 volts as well.

  • 2
    You need to put an ADC between the sensor and your Pi, since the Pi does not have analog inputs or outputs. Mar 11, 2017 at 17:57
  • How do you do that?
    – Allan Cao
    Mar 11, 2017 at 18:01
  • Here is the manual for the sensor: waveshare.com/w/upload/0/0a/Dust-Sensor-User-Manual-EN.pdf
    – Allan Cao
    Mar 11, 2017 at 18:02
  • 2
    You'll need to do a lot more research. Two ADCs that I frequently use are the MCP3008 and ADS1115. You can search the Internet for either one of those, combined with "Raspberry Pi", and optionally with a specific programming language.
    – stevieb
    Mar 11, 2017 at 18:51
  • I too searched for the same. Now am trying with ADC MCP3008. Hope it will work. or try allaboutcircuits.com/projects/…
    – Ben Sujin
    Jun 15, 2018 at 13:20

2 Answers 2


Use an ADC (analogue-digital converter) like the MCP3008. Easy to get readings with Python:

from gpiozero import MCP3008

dust = MCP3008()

while True:

You can use dust.voltage if you need the voltage itself, or use dust.value to get a normalised value (0-1). See the gpiozero docs and this guide to using ADCs (including wiring).


I found several tutorials online for connecting analog inputs to a Raspberry Pi. I'd recommend the Adafruit site. I noticed that one of the chips they used was about the same price as an small Arduino, which has 5 analog inputs. There are many online tutorials to show you how to communicate between and Arduino and Raspberry Pi.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.