In The Air – Week 7

For this week’s post, I experimented with the Sharp GP2Y1010AU0F dust sensor which I plan to use in my project.

Sensor info

The Sharp GP2Y1010AU0F dust sensor uses an IR LED and detector to provide information on the dust concentration in the air.
The output of the sensor is analog and provides a voltage which can be used to correlate the dust concentration. (See paragraph “Measurements” in this post)

DSCN3116 DSCN3117

In the pictures above, you can see a disassembled sensor with both the LED and detector crossing paths at the ventilation hole.

The sensor is also low power, with a typical supply current of 11mA and maximum supply current of 20 mA (at 5V).


An example circuit is provided in the datasheet. It provides the function of every pin and indicates the need of an RC circuit on the LED input.

Screen Shot 2014-12-11 at 20.38.13 Screen Shot 2014-12-11 at 20.41.41

I didn’t have the exact same values available, so I used the closest I could find.

To be able to test the sensor, I soldered breadboard friendly headers on the sensor cable.

sensor-pin-order photo 2

The test setup:

photo 4

The white cone contains a fan used to create an airflow to the sensor. I plan on 3D printing a more compact version so that it will fit inside the build.

In the circuit above, the fan is always on. This will not be the case in the final solution: the fan should be turned on before sampling, and turned off after it.
Through testing, I will need to find the best timing between turning the fan on and sampling, as initially, turning the fan on might give different results (dust on fan blowing through sensor).


Based on the datasheet information on sampling timing, I made a quick Arduino sketch i order to test the sensor and the circuit.

Screen Shot 2014-12-11 at 20.11.39 Screen Shot 2014-12-11 at 20.35.28

The resulting sketch is as follows:

int sensorPin = A0;
int sensorValue = 0;

int ledPin = 2;

int delaySampling = 280; // wait 280 us before sampling after turning on LED
int delayLed = 40; // wait 40 us after sampling before turning off LED
int delayCycle = 10000 - delaySampling - delayLed; // 10ms cycle

void setup() {

  pinMode(sensorPin, INPUT);
  pinMode(ledPin, OUTPUT);

  digitalWrite(ledPin, HIGH); // turn LED off

void loop() {
  digitalWrite(ledPin, LOW); // turn LED on
  delayMicroseconds(delaySampling); // wait before sampling

  sensorValue = analogRead(sensorPin); // sample
  delayMicroseconds(delayLed); // wait before turning LED off

  digitalWrite(ledPin, HIGH); // turn LED off
  delayMicroseconds(delayCycle); // wait for end of cycle

  Serial.print("Sensor Value: ");

  float voltage = sensorValue * (5.0 / 1023.0);

  Serial.print("Voltage Value: ");



I performed two measurements for initial testing.

The first test, was to use the sensor as is, measuring the dust concentration in the room.
The second, was to trigger an extreme condition using a smoking matchstick.

Screen Shot 2014-12-11 at 22.07.00

The change in value is clearly indicating the smoke was detected. Looking further in the datasheet, following graph is provided.

Screen Shot 2014-12-11 at 22.14.26

The maximum value in the graph matches the result when using the smoking matchstick, meaning a density larger than 0.6mg/m3.
As for the dust, it would seem there is an approximate concentration of 0.05mg/m3 in the room I was testing.

I’ll be testing the sensor further and porting the Arduino code to the Launchpad (which should be straightforward with Energia ?!).
I’m curious to see the results when measuring in different rooms (who has the dirtiest room).

© Frederick Vandenbosch, 2014-2021. Unauthorised use and/or duplication of this material without express and written permission from this blog’s author and owner is strictly prohibited. Excerpts and links may be used, provided that full and clear credit is given to Frederick Vandenbosch with appropriate and specific direction to the original content.