Grove Laser PM2.5 Sensor(HM3301)

Hello, I have a problem with my MKR1010 and the basic sketch for the Laser PM2.5 Sensor.

The message is the following:

In file included from /var/folders/sp/mw2crk5j39911gchgyz2nlg40000gn/T/arduino_modified_sketch_537739/basic_demo.ino:32:0:

/Users/…/Arduino/libraries/Grove___Laser_PM2_5_Sensor_HM3301-1.0.2/Seeed_HM330X.h:77:58: error: ‘u32’ has not been declared

HM330XErrorCode IIC_read_bytes(u8 start_reg,u8 *data,u32 data_len);

Can you help me please ?

All the best.


Hi there

maybe you need to update the library of Grove Laser PM2.5 Sensor(HM3301). :smiley:

I did it, I have newest version 1.0.2. MKR1010 is a new generation of Arduino board for WiFi IoT applications I compiled the basic sketch for the sensor choosing in the Arduino IDE older board (arduino Uno, Arduino Yun) without error. It is a specific software error for the MKR Arduino board generation. Any ideia ?


Hi there

we updated our library of Grove Laser PM2.5 Sensor(HM3301) for compatibility of mkr1000. and you can get it by updating the library of Grove Laser PM2.5 Sensor(HM3301).you can find link by visiting <LINK_TEXT text=“ … sor_HM3301”></LINK_TEXT> :smiley: .

Many thanks for the fast reply. Now it works fine. All the best.

Hello, I have a question about the HM3301 sensor.

Do you know if I can separate the data reading to activate different outputs depending on the 6 values?

I want to compare a fixed value and activate an output if the reading data is surpassed.

Can you help me?

All the best.


Hi Hansen, I am currently using ESP 32 board and connecting it to HM3301. I got exactly the same error message as Filippo. I used Arduino online editor, which should include the latest library of HM 3301, and I have double-checked your link to Github. Could you please help me with it? Thank you.