DIY 空气质量检测器

Yu
2 min readApr 20, 2018

--

准备

材料:
树莓派 Raspberry Pi 3 (2也可以)
攀藤科技PMS5003 G5 和 转接板

接线:

配置树莓派环境

sudo systemctl stop serial-getty@ttyAMA0.service
sudo systemctl disable serial-getty@ttyAMA0.service
sudo systemctl stop serial-getty@ttyS0.service
sudo systemctl disable serial-getty@ttyS0.service
sudo vi /boot/cmdline.txt
# Remove the line: console=serial0,115200
sudo vi /boot/config.txt
# Add a line:
enable_uart=1
sudo reboot

参考

写程序驱动

运行此脚本以得到结果。参考

后期可用此工具集成到个人网站中,定时任务中等。

和检测站对比

从空气质量查询网站 查找,单看 PM2.5数据 和 我本机测试的基本没区别,至于转换成AQI的数值,可能因为国内外的标准区别而不同。

参考:
配置 Raspberry Pi 3 的参数 — Configuring The GPIO Serial Port On Raspbian Jessie and Stretch Including Pi 3
程序 — Raspberry Pi 读取攀藤G3 PM2.5

--

--

Yu
Yu

No responses yet