hello
i have dust sensor SDS011 + USB adapter
https://pl.aliexpress.com/store/product/nova-PM-sensor-SDS011-High-precision-laser-pm2-5-air-quality-detection-sensor-module-Super-dust/421570_32317805049.html
I connect the sensor to raspberry pi, basic to read a sensor I use command:
od --endian=big -x -N10 < /dev/ttyUSB0
so it is giving me for example:
0000000 aac0 8c00 9400 bcf9 d5ab
every packet of data begins “aac0” and rest of the data are converted to useful values (in bash script), basically everything work ok (for graphic representation of data I use RRDtool). But I want compare data from SDS011 with PMS7003. I don’t have any USB adapter so I connect PMS703 to raspberry pi pins.
In PMS7003 datasheet I see that start of the packet of data should be “424d”. First I tryed this command:
sudo od –endian=big -x -N10 < /dev/serial0
but this give me that kind of data:
3500 8200 0a54 008c 000a (first try)
8100 9f00 0a78 0094 000a (second try)
2900 6400 2900 6400 2900 (third try)
I don’t see beginning the data packet “424d”
I tried Python script:
import serial
from time import gmtime, strftime
port = serial.Serial("/dev/serial0", baudrate=9600, timeout=1.5)
data = port.read(32);
PM01 = str(ord(data[5])*256+ord(data[6]))
PM25 = str(ord(data[7])*256+ord(data[8]))
PM10 = str(ord(data[9])*256+ord(data[10]))
print(PM01)
print(PM25)
print(PM10)
but this also give me strange no real value. Why data packet never start from “424d”?