Can't read HM-3301 values with grove.i2c

Grove is a modulated, ready-to-use tool set.
Much like Lego, it takes a building block approach to assembling electronics.

Moderators: lily.li, violet, jeremy882, crail.lyu969

bill.yu
Junior-7
Junior-7
Posts: 733
Joined: Mon Apr 02, 2018 11:05 am

Re: Can't read HM-3301 values with grove.i2c

Post by bill.yu » Tue Jul 09, 2019 6:33 pm

Hi there~

For hardware, you can connect the vcc to 3.3v, gnd to gnd, scl to scl and sda to sda as well.

For software, Please follow below instructions to read the data.

1. Enable I2C through sudo raspi-config

2. Set I2C frequency as 20khz, by adding the content : dtparam=i2c_arm_baudrate=20000 @ end of config.txt.

Code: Select all

sudo vim /boot/config.txt
3. Install dependienies

Code: Select all

pip install smbus2
4. Run the python code

Code: Select all

cd ~
wget https://raw.githubusercontent.com/Seeed-Studio/grove.py/master/grove/grove_PM2_5_HM3301.py
python grove_PM2_5_HM3301.py
5. Here is the output. thanks.

Code: Select all

PM1.0 Standard particulate matter concentration Unit:ug/m3 = 36
PM2.5 Standard particulate matter concentration Unit:ug/m3 = 48
PM10  Standard particulate matter concentration Unit:ug/m3 = 55
PM1.0 Atmospheric environment concentration ,unit:ug/m3 = 28
PM2.5 Atmospheric environment concentration ,unit:ug/m3 = 41
PM10  Atmospheric environment concentration ,unit:ug/m3 = 51



PM1.0 Standard particulate matter concentration Unit:ug/m3 = 36
PM2.5 Standard particulate matter concentration Unit:ug/m3 = 48
PM10  Standard particulate matter concentration Unit:ug/m3 = 55
PM1.0 Atmospheric environment concentration ,unit:ug/m3 = 28
PM2.5 Atmospheric environment concentration ,unit:ug/m3 = 41
PM10  Atmospheric environment concentration ,unit:ug/m3 = 51



PM1.0 Standard particulate matter concentration Unit:ug/m3 = 36
PM2.5 Standard particulate matter concentration Unit:ug/m3 = 48
PM10  Standard particulate matter concentration Unit:ug/m3 = 55
PM1.0 Atmospheric environment concentration ,unit:ug/m3 = 28
PM2.5 Atmospheric environment concentration ,unit:ug/m3 = 41
PM10  Atmospheric environment concentration ,unit:ug/m3 = 51



PM1.0 Standard particulate matter concentration Unit:ug/m3 = 36
PM2.5 Standard particulate matter concentration Unit:ug/m3 = 48
PM10  Standard particulate matter concentration Unit:ug/m3 = 55
PM1.0 Atmospheric environment concentration ,unit:ug/m3 = 28
PM2.5 Atmospheric environment concentration ,unit:ug/m3 = 41
PM10  Atmospheric environment concentration ,unit:ug/m3 = 51

doccie
Pre-kindergarten
Pre-kindergarten
Posts: 4
Joined: Fri Jun 14, 2019 4:51 pm

Re: Can't read HM-3301 values with grove.i2c

Post by doccie » Tue Jul 09, 2019 8:42 pm

Hi Bill,

Thanks for the fast work! I'll try it out tonight and get back to you with my results.

doccie
Pre-kindergarten
Pre-kindergarten
Posts: 4
Joined: Fri Jun 14, 2019 4:51 pm

Re: Can't read HM-3301 values with grove.i2c

Post by doccie » Thu Jul 11, 2019 4:47 pm

Works like a charm. Looks like my values are relatively low, so I'd have to test with another sensor to see how they stack up.
But at least the sensor is producing consistent output now. :)

Thanks for the help!

funkihoo
Pre-kindergarten
Pre-kindergarten
Posts: 4
Joined: Thu Jun 13, 2019 9:42 am

Re: Can't read HM-3301 values with grove.i2c

Post by funkihoo » Fri Jul 12, 2019 3:16 pm

Hi everyone,

Sorry for not posting lately, quite busy.

Thank you Bill for the module !

I tested it and it works great on my side too :)

Post Reply