Gravity SEN-0460 PM Sensor

I recently bought a SEN-0460 PM sensor. I’ve set it up as shown below:

(I apologise for the mess, I’m currently testing a few things)

Essentially, I have Vcc to 5.04V, ground to ground, green to SDA and blue to SCL, as followed from:

(under connection diagram)

I have copied and pasted the code from the Gravity github repo linked here:

My issue is that I am able to record number of particles (a copy and paste of gainparticlenum.ino from examples in the github repo). However, I cannot return any values for PM1.0, PM2.5, PM10 other than 0 (using a copy and paste of gainconcentration.ino from examples in the github repo).

For my project, I specifically need concentration of PM2.5 and PM10 in ug/m^3. I don’t know why it’s only returning zero, in air PM10 should be about 20 and PM2.5 should be about 10. (the room I’m measuring in is quite dusty so I expect both to be higher). The values from gainparticlenum.ino respond to a lighter being waved near it so I don’t know why PM2.5 and PM10 are returning 0.



Hi Jack,

How strange, can you please copy through your code inside three backticks above and below (```) as well as a screenshot of the results that you’re getting back? That seems like quite unusual behavior from these sensors.

Hi Bryce
If you look back to 02/10/22 you will see that Jack had exactly the same problem with another sensor, namely PMS5003.

I find it hard to believe that 2 different sensors would exhibit the exact same problem. I have no experience with these sensors or the coding involved so can’t really comment but experience tells me you should be looking at something Jack is doing or the code. Could it be that the info from the sensor is becoming corrupted and the sketch or system returns a default “0” when it receives info it doesn’t understand.

Just posted this as an observation hoping it may help. As I said I am inexperienced in this señor and its handling so you guys will have to sort the detail.
Cheers Bob
PS. Could it be the I2C is prone to interference with his long “rats nest” (a general term for a bench lash up) of wires and a bit of a tidy up and shorten the I2C connections could improve things.

1 Like

Hi Robert,
That PMS5003 was indeed faulty, which was determined after I sent the sensor back and the tech team received the same results as myself.

1 Like
 * @file gainparticlenum.ino
 * @brief Get the current number of PM in 0.1L of air
 * @copyright   Copyright (c) 2010 DFRobot Co.Ltd (
 * @license     The MIT License (MIT)
 * @author      PengKaixing(
 * @version  V1.0.0
 * @date  2021-11-23
 * @url
#include "DFRobot_AirQualitySensor.h"

#define I2C_ADDRESS    0x19
  DFRobot_AirQualitySensor particle(&Wire ,I2C_ADDRESS);

void setup() {
  //Sensor init, initialize I2C, determined by the communication method currently used
    Serial.println("NO Deivces !");
  Serial.println("sensor begin success!");
  //Get sensor version number
  uint8_t version = particle.gainVersion();
  Serial.print("version is : ");

void loop() {
   *@brief Get the number of 0.3um PM in 0.1L of air
   *@param PARTICLENUM_0_3_UM_EVERY0_1L_AIR 
   *@n     PARTICLENUM_0_5_UM_EVERY0_1L_AIR 
   *@n     PARTICLENUM_1_0_UM_EVERY0_1L_AIR 
   *@n     PARTICLENUM_2_5_UM_EVERY0_1L_AIR 
   *@n     PARTICLENUM_5_0_UM_EVERY0_1L_AIR 
   *@n     PARTICLENUM_10_UM_EVERY0_1L_AIR   
  uint16_t num = particle.gainParticleNum_Every0_1L(PARTICLENUM_0_3_UM_EVERY0_1L_AIR);
  Serial.print("The number of particles with a diameter of 0.3um per 0.1 in lift-off is: ");
  uint16_t concentration = particle.gainParticleConcentration_ugm3(PARTICLE_PM1_0_STANDARD);
  Serial.print("PM1.0 concentration:");
  Serial.println(" mg/m3");

Output: (was having issues uploading a screenshot so this is taken from my phone)

Hi All
The calculation required to convert particles per 0.1L to milligrams per cubic metre would not be returning “0” by any chance would it??? This must be occurring in the library as I don’t see it happening anywhere else. So maybe a library bug??
On another note 245 particles per 0.1L is a very large number of particles per cubic metre. If the “uint16_t” restricts everything to 16 bit numbers this will be drastically overflowed, this would depend on where the conversion to milligrams takes place. I don’t know how this overflow works but if it returns a “0” this might account for your problem. The sensor appears to be returning the particles per 0.1L OK.
Cheers Bob

The particles per 0.1L measurement is total number of particles > 0.3 um. I don’t know if it’s possible to convert that value to number of particles > x um/m^3. Any advice is appreciated though.


Hi Jack
There are 1000000 litres in 1 cubic metre so 245 particles per 0.1L = 2,450,000,000 per cubic metre. The measurement you are displaying as “0” is mg/m3 which I interpret as milligrams per cubic metre. Maybe that is wrong. The conversion has to be calculated somewhere although just how you convert the number of particles >0.3 µm to mg without knowing the mass of a particle is beyond my brain power. All seems pretty iffy. Might be why it comes back as “0”.
Cheers Bob

1 Like

Hi All
Sincere apologies. Must be having a senior’s moment (I am allowed to have those) and got the decimal points in the wrong place.

There are 10000 litres in 1 cubic metre so 24,500,000 particles. A much smaller number but the rest still applies.
Cheers Bob
Dammit wrong again. should read 2,450,000.

Today I noticed readings which were not completely zeroes. I think i must just have no small dust particles floating around in my room. Fan spins and i’m able to get data, so i’m going to call it functional and move on to the rest of my project.
Cheers for all the help though.


Hi Jack

According to your text you are looking at particles >3µm (greater than 3µm) so “0” would imply you have no big bits floating around.
I just had a closer look at your sketch and interestingly the symbol “>” (greater than) does not appear Where did it come from?
Your result says you had 245 particles per 0.1 in lift off whatever “lift off” means. I am not familiar with this sensor so don’t know but I was curious as to how one arrives at a figure of “µgm3” or as you print “mg/m3” without knowing the particle mass. There is no calculations in the sketch so must be done in the library or in the sensor. There even may be a “standard” conversion factor. who knows??
Cheers Bob


Agreed. I’ve used these sensors before, if you have a dusty old book or similar laying around you can often brush or shake it near the sensor and watch the particle count go through the roof briefly. I’m not a huge fan of the term ‘Air-Quality’ sensor which is a bit of a misnomer, as there are many factors to consider when it comes to measuring the ‘Air Quality’ (namely eVOC compounds, particulate matter, eCO2, smog due to high VOCs, etc.)

But yes, if you’re seeing very few large particles in a relatively well ventilated area when using this sensor, that is quite normal.