Sharp GP2Y1051 dust sensor

The previous Sharp GP2Y1010 dust sensor was already a successful optoelectronic product due to its small factor, simplicity and low cost. The 1051 update comes with some important improvements to make this an even better product, while using the exact same enclosure shape and size.
dust_sensor_gp2y1051_1 dust_sensor_gp2y1051_2 dust_sensor_gp2y1051_3

The connector

It’s the same 6 pin connector, but the pins are reassigned due to the new functionality:
dust_sensor_gp2y1051_pinout
This new model makes using the sensor much easier. To access the readings only 3 wires are needed, two for power and one for UART serial communication (GND, VCC and TX). The previous electrolytic capacitor needed for the pulsing IR led is now built in. There is also a microcontroller to handle the detection algorithm and the serial interface.

Reading the output

To check the output I connected the sensor to my computer, with an USB to UART adapter based on a CH340 chip. The sensor’s baudrate is 2400bps.
gp2y1051_uart_usb
This concluded all required setup and we immediately got the dust measurements over the serial connection:
gp2y1051_data

According to the datasheet, the sensor outputs sequences of 7 bytes, starting with 0xAA and ending in 0xFF. I saved the data to a local file, so my code uses that via fread, but the calculations are the same:

uint8_t buf[7];
fread(buf, 1, 7, f);
if (buf[6] == 0xFF && (buf[5] = (buf[4] + buf[3] + buf[2] + buf[1]))) {
	float vo = (buf[1] * 256.0 + buf[2]) / 1024.0 * 5.00;
	printf("vo:%2.2f pm2.5:%3.2f ug/m^3\n", vo, vo * 700.0);
}

We use the first two bytes to compute the voltage level returned by the photocell. Notice that the 5.00 constant should match your Vcc level. The dust quantity expressed in micrograms per cubic meter of air, is obtained multiplying the vo with 700. Byte number 5 is a checksum, merely the sum of the first 4 bytes, and byte 6 is always 0xFF. Use this to make sure the data received from the sensor is correct.
Here’s an output example:
vo:0.02 pm2.5:13.67 ug/m^3
vo:0.01 pm2.5:6.84 ug/m^3
vo:0.01 pm2.5:6.84 ug/m^3
vo:0.00 pm2.5:3.42 ug/m^3
vo:0.01 pm2.5:6.84 ug/m^3
vo:0.01 pm2.5:6.84 ug/m^3
vo:0.01 pm2.5:10.25 ug/m^3
vo:0.01 pm2.5:10.25 ug/m^3
vo:0.01 pm2.5:6.84 ug/m^3
vo:0.01 pm2.5:10.25 ug/m^3
vo:0.01 pm2.5:10.25 ug/m^3
vo:0.00 pm2.5:3.42 ug/m^3
vo:0.01 pm2.5:6.84 ug/m^3
vo:2.06 pm2.5:1442.38 ug/m^3
vo:2.06 pm2.5:1442.38 ug/m^3
vo:2.06 pm2.5:1442.38 ug/m^3
vo:3.39 pm2.5:2375.49 ug/m^3
vo:3.39 pm2.5:2375.49 ug/m^3
vo:3.39 pm2.5:2375.49 ug/m^3
vo:3.39 pm2.5:2375.49 ug/m^3
vo:0.17 pm2.5:116.21 ug/m^3
vo:0.17 pm2.5:116.21 ug/m^3
vo:0.01 pm2.5:6.84 ug/m^3
vo:0.01 pm2.5:6.84 ug/m^3
vo:0.01 pm2.5:10.25 ug/m^3
vo:0.01 pm2.5:6.84 ug/m^3
vo:0.00 pm2.5:3.42 ug/m^3
vo:0.01 pm2.5:6.84 ug/m^3
The high figures (2375.49 ug/m^3) were produced by inserting an opaque object via the air channel. The low values were recorded in normal conditions.

Datasheet details

VCC: 4.8 – 5.2V
Standby supply current: 20mA
Detectable dust concentration: 30 – 1500ug/m3
Operating Temperature Range: -10 to +65°C
Output Method: UART
Minimum particle diameter: 0.3 um
Dimensions: 48(W) × 32(H) × 7.6(D) [mm]
Humidity Range: 95%rh or less

This article has 7 Comments

  1. Hi these are some of the data bytes I received. FF AA 00 00 00 4A 4A FF AA 00 00 00 4A 4A FF AA 00 00 00 4A 4A However you mentioned that the sharp is sending 6 bytes of data in sequence, but it seems like there are 7 bytes including the 0xFF byte. Also I did not get how you carried out the calculations for the checksum as looking at your data the addition of bytes 4,3,2,1 doesn’t equal byte 5 .

  2. Hi Radu
    Is there any chance to power up with 3.3 V as you did in the previous Sharp sensor ?

    thanks

  3. Hi there,
    I’m curious about the multiplication of 700. In the data sheet K(Constant) = 3.5 typically. Looking at the graph this relation (vo & ugm3) can been seen in the top most line of the graph. Am I missing something? shouldn’t it be Vo / 0.0035 to obtain um/m^3
    Regards Mark.

  4. Sorry sorry,
    K = 0.35 (v / milligram per m^3)
    Data sheet Translation
    Dust concentration is calculated : Ud = A * Vout
    ( Where Ud is the concentration of dust , bits ug / m3;
    Vout of the output signal of the sensor , the unit is V;
    A is a proportionality factor )

    0.35 * Vo will not work compared to the graph but Vo / 3.5 will. For example 0.375V / 3.5 = 0.10714.. mg/m^3. This matches the graph. or you could say Vo * 0.285714286
    You still have to multiply by 1000 to get to ug/m^3. So 107.14ug/m^3.
    Again 0.875 volts / 3.5 = 0.25 mg/m^3. See graph.
    Anyone, what do you think?
    Data Sheet
    https://www.taiwaniot.com.tw/wp-content/uploads/2016/04/GP2Y1051AU0F_ch_data.pdf

Leave a Reply