Using Arduino library for HPM dust sensor and Particle Photon

I am new to Arduino/Particle and I am trying to connect a HPM dust sensor to my Photon board.

You can find the data sheet for the sensor here:

I plan to use the library for Arduino, available at:

Anyone have advice on how to translate the Arduino code to Particle, any pitfalls I need to avoid?

Since I am a complete freshman, I have not even figured out out how to import the code to the Particle IDE…

With the most recent Particle system most libraries that don’t use µC specific code will usually just build out the box.

To “import” the lib for a first stab, hit the (+) icon top right corner of the Web IDE window. This will provide you with two new file tabs, rename them as needed and copy/paste the original code into the .h and .cpp file respectively.

Thanks, very helpful! Yes that worked smoothly. However, the Arduino code make a reference to SoftwareSerial.h which Particle could not find. Has Particle something comparable that I could use?

There is a ParticleSoftSerial lib which should be a drop-in substitute.

Or simply use the Serial1 hardware port which Arduino doesn’t have.

1 Like

@Latsbben Did you end up getting the HPM Dust sensor working with the Photon?

How well does it work if so?

Hi!
Apologies for the slow turn around, this project has been a bit on the back-burner.

I ended up connecting the Honeywell sensor to an adafruit feather, not a particle chip. And it worked. The sensor is very sensible though, so when presenting the results it will probably be useful to make some kind of averaging the readings over a period.

I am currently exploring connecting an air quality sensor from Omron to a photon and might return with some questions about that later. It will be interesting see whether the Omron and the Honeywell sensors are giving different results, as the latter has an internal fan (and costs twice as much).