adafruit_pm25
¶
CircuitPython library for PM2.5 Air Quality Sensors
- Author(s): ladyada
Implementation Notes¶
Hardware:
Works with most (any?) Plantower UART or I2C interfaced PM2.5 sensor.
- PM2.5 Air Quality Sensor and Breadboard Adapter Kit - PMS5003
- PM2.5 Air Quality Sensor with I2C Interface - PMSA003I
- Adafruit PMSA003I Air Quality Breakout
Software and Dependencies:
- Adafruit CircuitPython firmware for the supported boards: https://github.com/adafruit/circuitpython/releases
- Adafruit’s Bus Device library: https://github.com/adafruit/Adafruit_CircuitPython_BusDevice
adafruit_pm25.i2c
¶
I2C module for CircuitPython library for PM2.5 Air Quality Sensors
- Author(s): ladyada
Implementation Notes¶
Hardware:
Works with most (any?) Plantower I2C interfaced PM2.5 sensor.
Software and Dependencies:
- Adafruit CircuitPython firmware for the supported boards: https://github.com/adafruit/circuitpython/releases
- Adafruit’s Bus Device library: https://github.com/adafruit/Adafruit_CircuitPython_BusDevice
-
class
adafruit_pm25.i2c.
PM25_I2C
(i2c_bus, reset_pin=None, address=18)¶ A module for using the PM2.5 Air quality sensor over I2C
Parameters: Quickstart: Importing and using the PMSA003I Air quality sensor
Here is one way of importing the
PM25_I2C
class so you can use it with the namepm25
. First you will need to import the libraries to use the sensorimport board import busio from adafruit_pm25.i2c import PM25_I2C
Once this is done you can define your
busio.I2C
object and define your sensor objecti2c = busio.I2C(board.SCL, board.SDA, frequency=100000) reset_pin = None pm25 = PM25_I2C(i2c, reset_pin)
Now you have access to the air quality data using the class function
adafruit_pm25.PM25.read
aqdata = pm25.read()
adafruit_pm25.uart
¶
UART module for CircuitPython library for PM2.5 Air Quality Sensors
- Author(s): ladyada
Implementation Notes¶
Hardware:
Works with most (any?) Plantower UART or I2C interfaced PM2.5 sensor.
Software and Dependencies:
- Adafruit CircuitPython firmware for the supported boards: https://github.com/adafruit/circuitpython/releases
-
class
adafruit_pm25.uart.
PM25_UART
(uart, reset_pin=None)¶ A driver for the PM2.5 Air quality sensor over UART
Parameters: - uart (UART) – The
busio.UART
object to use. - reset_pin (Pin) – Pin use to reset the sensor.
Defaults to
None
Quickstart: Importing and using the PMS5003 Air quality sensor
Here is one way of importing the
PM25_UART
class so you can use it with the namepm25
. First you will need to import the libraries to use the sensorimport board import busio from adafruit_pm25.uart import PM25_UART
Once this is done you can define your
busio.UART
object and define your sensor objectuart = busio.UART(board.TX, board.RX, baudrate=9600) reset_pin = None pm25 = PM25_UART(uart, reset_pin)
Now you have access to the air quality data using the class function
adafruit_pm25.PM25.read
aqdata = pm25.read()
- uart (UART) – The