Interfacing Sensirion, SPS-30, Particulate Matter Sensor With Arduino Duemilanove Using I2C Mode
by Ozgur__Y__ in Circuits > Arduino
7495 Views, 2 Favorites, 0 Comments
Interfacing Sensirion, SPS-30, Particulate Matter Sensor With Arduino Duemilanove Using I2C Mode
![20200621_142523.jpg](/proxy/?url=https://content.instructables.com/F14/5XWI/KBP31O75/F145XWIKBP31O75.jpg&filename=20200621_142523.jpg)
![serial.PNG](/proxy/?url=https://content.instructables.com/FMB/MLK1/KBP31QPB/FMBMLK1KBP31QPB.png&filename=serial.PNG)
When I was looking into interfacing SPS30 sensors, I realized that most sources were for Raspberry Pi but not that many for Arduino. I spend a little time to make the sensor work with Arduino and I decided to post my experience here so that it could be useful for other users. The interface is very easy, no soldering is necessary if you have the correct cable. You just plug in five leads into Arduino board to make the sensor work. Also the libraries are already available.
After you gather the components, carefully examine and look at what cables, connectors, etc. you have. In this project I followed the I2C connection mode.
Supplies
- SPS30 Sensirion Particulate Matter Sensor and connector cable.I got mine here.
- Arduino Duemilanove (any kind of Arduino should work as long as you determine SCL and SDA pins)
- USB cable for Arduino
Connect Your Sensor to Arduino for I2C Mode
![f9cfec14e2ffa4820ec8ec7c5044ee73.png](/proxy/?url=https://content.instructables.com/FMN/HU0U/KBP31N2I/FMNHU0UKBP31N2I.png&filename=f9cfec14e2ffa4820ec8ec7c5044ee73.png)
![interface.PNG](/proxy/?url=https://content.instructables.com/FYT/NZVQ/KBP31NJT/FYTNZVQKBP31NJT.png&filename=interface.PNG)
![20200621_142541.jpg](/proxy/?url=https://content.instructables.com/F3R/IDO3/KBP31O79/F3RIDO3KBP31O79.jpg&filename=20200621_142541.jpg)
![20200621_142628.jpg](/proxy/?url=https://content.instructables.com/FWP/AV8P/KBP31O7L/FWPAV8PKBP31O7L.jpg&filename=20200621_142628.jpg)
Each Arduino might have different connections. As I mentioned before, I used the I2C mode (not UART). The sensor can be directly powered by Arduino's 5V pin.
Do the connections as shown in schematics. For Duemilanove the pins are (as shown in the figure):
SDA--> ADC4
SCL--> ADC5
Make sure that the SPS30's Pin 4 ("Interface select") is connected to GND, on power-up of the sensor, otherwise the sensor works in UART instead of I2C mode and this driver will not detect the sensor.
Install Libraries for Your Arduino IDE
I followed the instructions here:
Program
Again just follow the instructions for usage:
The program used is sps30.ino file from the Github site.
Downloads
Plotting Output
If you do not do anything, the program can be seen outputting in the serial monitor.
I tried plotting it first, by editing the program simply disabling the line mentioned.
Downloads
Serial Monitor Setting
Just edit the line and set it back to serial monitor. Of course, each time you need to upload your code with new changes.