navigationGo.pngQuick Navigation
allprojects32.pngAll projects

favoriteStar32.pngTop projects
Alan numitron clock
Clapclap 2313/1386
SNES Pi Webserver
USB Volume/USB toys
Smokey amp
Laser cutter
ardReveil v3
SNES Arcade cabinet
Game boy projects
Home Presence Detector


navigationMail.pngContact me

3flags.pngWho's Alan?

Rand Nerd Tut
Datasheet Lib
Reddit Elec
Carnet du maker (fr)
ATmel blog (defunct)

dust counter

I found these 5USD dust sensor (counter is a big word in fact) on eBay and tried it. Since I do woodworking as a second hobby, having a sensor to make sure I'm now brownlungig myself into pneumonia. So one stone two birds.



That cheap module has a IR led and sensor that is calibrated to return a voltage that is function of the volume of dust in the air. I put a small led bar in front since I'm not interrested by the value, an indication of the air quality is enough for me.

Points of interrest

  • The usage of that small sensor
  • The rest is pretty much ballpark, no additional challenge.


    Bill of materials

  • GP2Y1010AU0F Compact Optical Dust Sensor Smoke Particle Sensor
  • DMC16117A 16x1 LCD with strange behavior
  • An Arduino because I have too much of them
  • GP2Y1010AU0F Dust Sensor how to use

    On mine, the connector wire colors are (looking at the plug on the sensor, wires bottom, left to right):
  • White: V-LED
  • Blue: LED-GND => GND
  • Green: LED
  • Yellow: S-GND
  • Black: V0
  • Red: VCC

  • The dust sensor wiring schema from the doc
    Voltage to dust density approximation

    Datasheet vs. homemade approximation
    I decided to use 2 linear approximations, using 5V:
  • The blue one Y = 6 X + 0.6
  • The orange one Y = 0.5 X + 3.25
  • And use one or the other depending where you are:
    /* Takes the voltage (in V) read and return the dust density based on the graph provided in the Datasheet
    float voltage2DustDensity (float pVoltage) {
      if (pVoltage <= 0.6) {
        return 0;
      if (pVoltage <= 3.4) {
         linear regression calulated from key values at (v=0.6 dust=0) and (v=3 dust=0.4)
         x = (y  - b) / a
        return (pVoltage - 0.6)/6.0;  
       voltage > 3.4 same with [0.5;3.5] and [0.8;3.65]
       x = (y  - b) / a
      return (pVoltage - 3.25)/0.5;  


    Follow the schematic from the datasheet for the Dust sensor. The board is a WordClock board because it was proper in term of size. The Led bar is linked via a bunch of 1k ohm resistors to pins 27 to 15 (arduino A4 to 9), and the Dust sensor pin connected to A5 for reading and 8 (arduino) for driving the LED.

    Source code

    It's an arduino script because I was too lazy to write it properly in C in Atmel Studio. Code is here on GitHub.


    Mounted on its holder, backk has a scavended Liion battery, a Liion charger and a boost converter to 5v


    Helpful sources

    People who had problem with this LCD:
  • People who had problem with the dust sensor:
  • Datasheet on Sparkfun
  • Inspiration

    All content on this site is shared under the MIT licence (do what u want, don't sue me, hat tip appreciated) ~ Formerly known as (AlanFromJapan [2009 - 2019])