Forum >Gravity: PM2.5 Air Quality Sensor data meaning issue

Gravity: PM2.5 Air Quality Sensor data meaning issue

userHead Giovanni.Briguglio 2025-02-04 00:20:20 1253 Views2 Replies

Hello,

 

I bought a Gravity: PM2.5 Air Quality Sensor and I connected it to a Raspberry Pi 4. By means of I2C interface I recognized that there are several addresses from which taking data. I checked the datasheet but I did not find any protocols from which understanding data. I tried one of those addresses but data changes rapidly and greatly… Can you help me to understand how to get the correct values?

 

Thanks 

2025-02-25 14:39:37

Have you tried downloading the driver and examples from github?

https://github.com/DFRobot/DFRobot_AirQualitySensor/tree/master

The examples there seem very straightforward, so I would try one. 

The initialization code for both examples is the same:

```
I2C_1       = 0x01               # I2C_1 Use i2c1 interface (or i2c0 with configuring Raspberry Pi file) to drive sensor
I2C_ADDRESS = 0x19               # I2C Device address, which can be changed by changing A1 and A0, the default address is 0x54
airqualitysensor = DFRobot_AirQualitySensor(I2C_1 ,I2C_ADDRESS)
```

That should create an object you can query to get measurements.  

For example, you might try (in Python)

```
pm1_standard_reading = airqualitysensor.gain_particle_concentration_ugm3(PARTICLE_PM1_0_STANDARD)
print(pm1_standard_reading)
```

Which should give you the sensors reading of that value.

Hope that's helpful.

 

 

userHeadPic sean.catheroy
sean.catheroy wrote:

PS - You shouldn't need to worry about finding the device on I2C - seems like DFRobot has taken care of that for you if you use the driver they provide.

2025-02-25 14:41:37
1 Replies