Arduino, Sensoren, Z-Wave, Bluetooth und mehr - SmartHome.Work - Lösungen für zu Hause

Direkt zum Seiteninhalt

Particulate Matter Sensor SPS30 and Arduino

SmartHome.Work - Lösungen für zu Hause
Veröffentlicht von in Sensors · 22 Januar 2019
Tags: SPS30sensor
Sensirion SPS30 Particulate Matter Sensor - how to use with Arduino

The original sample program https://github.com/Sensirion/embedded-sps need for I2C a buffer of min. 60bytes, that's why most Arduino test implementations will not work at first.

Solution:
Change in Wire.h the following line: #define BUFFER_LENGTH 64   (was 32 before)
Additional:
If you have a twi.h in your installation - change here too:
#define TWI_BUFFER_LENGTH 64  (was 32 before)

Then use the attached small program for testing.

If you cannot change the line - you can read out the first 5 values only - see in source code the marked line.
Use instead of the 60 bytes the 30 bytes option.

You will get the right values after some minutes of self calibration.

If any questions tell me ;)

Sample file: sps30-i2c-mini.ino



Kein Kommentar

Copyright 2021 Michael Prüfer
Copyright 2018 Michael Prüfer
Zurück zum Seiteninhalt