pyupm_hka5 module

class pyupm_hka5.HKA5(uart, set_pin, reset_pin)[source]

Bases: object

API for theDFRobot Laser PM2.5 Sensor.

ID: hka5

Name: Laser Particulate Matter (PM) Sensor

Category: gaseous

Manufacturer: dfrobot

Connection: uart gpio

Link:https://www.dfrobot.com/wiki/index.php/DFRobot_LM35_Linear_Temperature_Sensor_(SKU:DFR0023) This driver was tested with a DFRobot Laser PM2.5 Sensor. It connects to a UART at 9600 baud. This is the only baud rate supported. It optionally supports Reset and Set/Sleep gpios as well.

C++ includes: hka5.hpp

enable(enable)[source]

void enable(bool enable)

Enable or disable the device. When disabled, the device enters a low power mode and does not emit data. You must have initialized and connected the Set pin for this function to work.

enable: true to enable the device, false otherwise.

getPM1()[source]

unsigned int getPM1()

Return the last read PM 1.0 value. The value is in micrograms per cubic meter (ug/m3). You must have called the update() function before calling this function.

The value in ug/m3

getPM10()[source]

unsigned int getPM10()

Return the last read PM 10.0 value. The value is in micrograms per cubic meter (ug/m3). You must have called the update() function before calling this function.

The value in ug/m3

getPM2_5()[source]

unsigned int getPM2_5()

Return the last read PM 2.5 value. The value is in micrograms per cubic meter (ug/m3). You must have called the update() function before calling this function.

The value in ug/m3

reset()[source]

void reset()

Reset the device. You must have initialized and connected the Reset pin for this function to work.

update()[source]

void update()

Query the device and store the latest values. You must call this function before calling any of the get*() functions.