SDS011 PM sensor

Hi all

Hopefully someone can help I’m a mechanical engineer so no use with node-red/programming great start I know however for a project I’m working on I’m desperate to get two SDS011 sensors up and running which will show me live data of pm 2.5 and pm10 at two different points in my experiment.

I’m using a raspberry pi with usb connection to the SDS sensor; I’ve come across many node red SD011 nodes as serial inputs but can’t seem to get any data from the sensor the one I’m currently trying is found here https://flows.nodered.org/flow/d39bb5c3963b1cc97146fda04b271e80

Basically what I’m looking for is an idiots guide to using this node flow, I’m using node red via the PC and Tight VNC viewer

When I click on the debug node I get no data not sure what is wrong but would really appreciate some help with this

Thanks in advance

Have you set the serial port node to actually point to the serial port you are using ? (there should be no need to click on the debug - as long as that is "open"/green then data should just appear if available.

Hi dceejay

Thanks for the reply, I tried using dmesg which comes back with usb 1-1.1.2: ch341-user converter now attached to ttyUSB0 however I’m not that sure what I’m looking at so in Node red I clicked on the serial in node, edit serial-port node and selected search which shows /dev/ttyUSB0

Cheers

ok - that should be ok. and the baud rate is set correctly ?

(One way to test is to test it outside on node-red - ie stop node-red and use something like picocom (install by sudo apt install picocom) to give you a serial terminal -start it like

picocom /dev/ttyUSB0 -b 9600

to start at 9600 baud etc... - you should see data coming out (if that other flow is to be believed) - if not then maybe need to check the manual for the sensor to find out how to get it to send data.

PS - exiting picocom is ctrl a x

Hi
Yeah I believe the baud rate is correct at 9600 data bits is set to 8 parity none stop bits 1
Which I believe is correct, data sheet

Just a question if the sensor is reading correctly should I see data in the dashboard on the right side on node red ? I’m just not seeing any data

Thanks again

well I guess that is what the flow is trying to do yes. - but as I said may be worth checking outside of Node-RED first..
Then restart Node-RED and try adding a debug direct to the serial node to check it is at least sending data.

I have managed to get readings before using a script I copied and used in geany which worked, however I have tried this again and get the error: you do not have permission code
127

Did you stop Node-RED first ? You can only have one thing talking to the serial port at a time..

Hi dceejay

Ive referred to using my laptop to run node red and access the usb device however i'm now not able to select the usb device search in, serial in node, is there a node to use with a windows machine?

Serial works fine on Windows. However, the naming convention is different. They are referred to as "COM Ports" and listed as COM1:, COM2:, etc rather like "drive letters".

So see what ports are currently active, open device manager, then turn on "show hidden devices".