Help with PM sensor

I’m helping my son with a school project - particulate matter sensor controlled by an Arduino UNO.

Don’t have the model of the sensor now but can provide all the details.

Have connected everything and uploaded code provided by the sensor supplier to the Arduino.

There is voltage on outputs from the sensor and the Arduino board is running, but we don’t have any readable output. Am unsure if this is a hardware or software problem.

All code is available.

Would someone be willing to take a look at the code? Also, as we have the electronics night tomorrow, could I bring it there to get help?

Any help and advice would be much appreciated. Thanks!

I can’t come to electronics night but if you’re using the Arduino serial monitor then you might also need to check the baud rate. I think the default is normally 9600 but look at the code as it might be different and the dropdown option should match. Hope that helps.

Yes - bring it to electronics night!

1 Like

It might be worth sharing the code via gist or pastebin or similar.

https://gist.github.com/

Thank you! I could not come to last week’s electronics night but will come this coming week if we can’t figure it out.

Thanks! Here is the code in pastbin https://pastebin.com/bGyFqBQ2

The baud rate for sensor to Arduino is set to 115200 as per instructions. We tried 9600 baud too but that did not help. That said it does seem like a comms problem of some kind as there is signal coming from the sensor.

Have you wired the serial to the sensor as
rx to tx (pin 2 to tx on the sensor)
tx to rx (pin 3 to rx on the sensor)
Sorry for the obvious question, but this is a common mistake…

Also double check your connections are good, if you’re using Dupont connectors they’re often not reliable.

It’s also probably worth trying this example from Adafruit, it may work. Change it to use serial rather than i2c.

https://learn.adafruit.com/pm25-air-quality-sensor/arduino-code

Thank you! I will try this at the electronics night tonight.

I’ll see you there

That worked, thanks! Tx and Rx on the Arduino were connected in the wrong order :slight_smile:

2 Likes

Have to leave early - son’s homework :slight_smile: but thank you very much for the help, I will see you at one of the other Electronics nights!