ESP32 reading data from SPS30 PM Sensor #13263
Unanswered
And1DS
asked this question in
Hardware & Peripherals
Replies: 1 comment 3 replies
-
If you did not do so, you can make a simple check for the I2C connection:
It should return a short list containing the number 105 == 0x69. |
Beta Was this translation helpful? Give feedback.
3 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
Hi,
I am trying to read some data from the sensirion SPS30 Sensor via i2c. I can find the sensor on the i2c bus with address 0x69.
The sensor documentation says that there are different transfer types:
To start with i would like to just read some device information. The serial can be retrieved with pointer address 0xD033
According to the doc the read data will return 48 bytes, with Byte# 0,1 containing an ASCII Character, followed by a checksum, Byte# 45,46 containing ASCII caharacter 30 and 31, followed by checksum for bytes 45,46
In my program i use the following code:
when i print data i get the following output:
bytearray(b'\xff\xe1C\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff')
I am not sure if this is the correct way i am supposed to write/read from the i2c? And unfortunately i wasn't able to translate the data back to a readable string which would make sense, sorry for the noob question, can someone point me in to the right direction how to read data from this sensor? thank you
On page 11 of this PDF there is the detailled description of the sensor protocol: https://cdn.sparkfun.com/assets/2/d/2/a/6/Sensirion_SPS30_Particulate_Matter_Sensor_v0.9_D1__1_.pdf
Thanks very much in advance, any help is appreciated!
Beta Was this translation helpful? Give feedback.
All reactions