PMS7003 Sensor - TTY/UART scrambled output [solved]
-
Hello,
I've bought a PMS7003 air sensor from alliexpress and I connected to RaspberryPI UART and I get scrambled output
Any idea?
Thanks
-
@kernelpanic Output like that in most cases means that your arduino is set to communicate on a different baud rate than what you have your terminal set for. Look at the sketch you are using in the setup() method and see what value is in this statement:
Serial.begin(9600);
In this case, the baud rate is being set to 9600bps (bits per second). When you open your terminal program, you should select the same baud rate prior to opening the com port. If those two numbers do not match you can see output similar to what you are seeing.
-
@kernelpanic according to http://download.kamami.pl/p564008-PMS7003 series data manua_English_V2.5.pdf (page 13) pms7003 sends data in a binary format, which is not human readable.
-
I connected first time on the RaspberryPI UART and I get scrambled output, I thought that is something wrong with RaspberryPI UART and I've bought a CP2102 USB to UART Bridge Controller and I get the same output.
The baudrate of the image that I shown is 9600 - this is the command that I use to get the output: screen /dev/ttyUSB0 9600 or cat -v < /dev/ttyUSB0
Perhaps the sensor is broken? have anyone this sensor or PMS5003, what output do you get when use screen or cat?
-
@kernelpanic the senson't output is not designed to be human readable.
-
@mfalkvidd I know that, but I should see 01010101 or [0x42, 0x4d] output not scrambled data
-
@kernelpanic if you want to view the data in binary or hex, you'll need to pass it through a program (such as hexdump or xxd). 0x42 is the character B. 0x4D is the character M.
-
Ok, you are right, the sensor it's working good, I just have to code to get the output.
I've found https://github.com/rjaros87/pm-home-station on github, it has a windows app and i tested there.Air purifier OFF
After 5 minutes of Turbo on Sharp KC-A50EU W
And here when I hit a puff from my electronic cigarette
Great!
-
@kernelpanic very cool, thanks for sharing the graphs. Nice to see that your purifier is able to clean the air.
-
I found a Python script that output the PM2.5 and all for Python and I can use it with RaspberryPI - https://github.com/MarkJB/python-pms7003/blob/master/pms7003.py - Thanks @MarkJB (github)
Can you set the thread to [SOLVED] ? Thanks
-
@kernelpanic done. If you want to do it yourself next time, just click edit on your first post and edit the field at the top.