Library for HPMA115C0-03/HPMA115C0-04

Updated: Oct 20

The Honeywell HPM Series Particulate Matter Sensor is a laser-based sensor which detects and counts particles using light scattering.

The detection concentration range is 0 µg/m3 to 1,000 µg/m3. A laser light source illuminates a particle as it is pulled through the detection chamber. As particles pass through the laser beam, the light reflects off the particles and is recorded on the photo or light detector. The light is then analyzed and converted to an electrical signal to calculate particle concentration.

The Honeywell particle sensor provides information on the particle concentration for given particle concentration range.


Technical Specification of HPMA115C0-03/HPMA115C0-04


HPM Series Operation



Connector Pinout


Library for HPMA115C0-03/HPMA115C0-04


Library for HPMA115C0-03/HPMA115C0-04 has been developed with the help of

More information about Zekeng you can find HERE.

The library repository can be found HERE.

Description

Arduino Library for Honeywell's Particle Sensor (HPMA115C0-003 / HPMA115C0-004)


Documentation

The documentation of HPMA115C0-003 / HPMA115C0-004 can be found in the docs folder in the repository or in this link.


Commands

  • Read Particle Measuring Results - 0x68, 0x01, 0x04, 0x93

  • Start Particle Measurement - 0x68, 0x01, 0x01, 0x96

  • Stop Particle Measurement - 0x68, 0x01, 0x02, 0x95

  • Stop Auto Send - 0x68, 0x01, 0x20, 0x77

  • Enable Auto Send - 0x68, 0x01, 0x40, 0x57


Functions

  • Init --StartParticleMeasurement --DisableAutoSend

  • ReadParticleMeasurement -- ReadCmdResp

  • StartParticleMeasurement

  • StopParticleMeasurement

  • DisableAutoSend

  • EnableAutoSend


Example

HPMA115C0-003 / HPMA115C0-004 are measuring PM1.0, PM2.5, PM4.0 and PM10.

NOTE: The delay before initialization should be minimum 2000ms otherwise the sensor is going to auto send mode and it is not received commands anymore.


/**
/**
 * @file example.ino
 * @author Dimitar Rangelov
 * @date June 2020
 * @brief Example using HPMA115C0 sensor library on a Feather 32u4
 * @license MIT
 */

#include <hpma115C0.h>
#include <SoftwareSerial.h>

//Create an instance of software serial
SoftwareSerial hpmaSerial(10, 11);  // Feather TX, Feather RX

//Create an instance of the hpma115C0 library

HPMA115C0 hpma115C0(hpmaSerial);

void setup() 
{
  Serial.begin(115200);
  hpmaSerial.begin(9600)            // Default sensor baud rate - 9600
  delay(2000);                      // The delay should be 2000-5000 ms 
  Serial.println("Starting...");
  hpma115C0.Init();
}

void loop() 
{
  uint32_t pm1_0,pm2_5,pm4_0,pm10;
  if (hpma115C0.ReadParticleMeasurement(&pm1_0,&pm2_5,&pm4_0,&pm10))
  {
    Serial.println("PM 1.0: " + String(pm1_0) + " ug/m3" );
    Serial.println("PM 2.5: " + String(pm2_5) + " ug/m3" );
    Serial.println("PM 4.0: " + String(pm4_0) + " ug/m3" );
    Serial.println("PM 10: " + String(pm10) + " ug/m3" );
  }
  delay(1000);
}
48 views
  • Dimitar Rangelov linkedin blog
  • Dimitar Rangelov github blog
  • Dimitar Rangelov facebook blog
  • Dimitar Rangelov instagram blog

ʕ•ᴥ•ʔ  Dimitar Rangelov Blog © 2020 | Sharing is Caring | About me ʕ•ᴥ•ʔ