How To: Sensirion SPS30

by JackSoldano in Circuits > Sensors

3622 Views, 1 Favorites, 0 Comments

How To: Sensirion SPS30

Untitled-2.jpg

The goal of this guide is to demonstrate how to setup & use the SENSIRON SPS30 Module with an Arduino in the most simple way possible!

Supplies

To replicate my example you will need...

  1. SENSIRON SPS30
  2. Arduino Nano
  3. Cables/Connectors
  4. Arduino IDE

What Is the SENSIRION

SPS30_TechSpecs.PNG
SPS30Diagram.drawio.png
SPSDSDiagram.PNG

The SENSIRION SPS30 is a Air quality sensor that uses Laser Scattering to detect particulate,

This works as shown in the attached diagram,

  1. Blower Fan pulls in ambient air
  2. Air flows through a laser diode channel
  3. Partials in the air cause the laser light to scatter & hit the light sensor
  4. The non-scattered laser light gets absorbed into a special surface which avoid any additional scattering
  5. Air is exhausted out of the unit.

An MCU processes the data measured by the light sensor to determine the size of the particles.

How to Wire Up

SPS30_Wire_Diagram.jpg
SPS30_HardwareConnector.PNG

The SPS30 module can be connected in either UART or I2C communication mode.

These modes can be selected using the SEL pin, SEL > GND = I2C while SEL > Floating (Not connected) = UART

For this demonstration I will be using the sensor in I2C mode,

The pin connections will be

SPS30 | Arduino

GND > GND

SEL > GND (Selects I2C Mode)

SCL > A5

SDA > A4

VDD > 5V

Code & Test

Arduino IDE Navigate to Libs.PNG
SPS30Lib.PNG
SPS30_Data.PNG
BAUD.PNG

Before you can program the Arduino, you will need to get the "sensirion-sps" Library, to do so first open the Library Manager as shown below,


In the Library Manager search for "sensirion-sps" and install the latest version.


Download the attached SPS30_Example.ino for the code used in the project,

*Note that the BAUD rate is set to "115200" not the standard "9600" see the attached BAUD select image for how to change this in the Arduino IDE.


Once successfully programmed the Arduino will be writing to the serial communication port every 15 seconds with the sensor reading, in the format shown above, this is all the 10 available outputs.

Downloads

Additional Comments

SPS30Modes.PNG

Power Consumption

This module as you might expect can draw a lot of power as it has a laser diode and a fan inside of it, that means that while it is running with everything active it is drawing around 5mA @ 5V meaning in this state the module is drawing 25mW. While this is quite low for a device with supply power this could be problematic for a low power battery application.

Luckily Sensirion have considered this already and published a report on how to optimse for this here.

The big take away from this is to only enable the fan for short pulses as that is the main power draw, we can do this with the Arduino library with the following commands,

  • sps30_start_measurement(); This will enable the fan, we should call this before measuring and give the sensor a few seconds before beginning a measurement


  • sps30_stop_measurement(); This command stops the fan, bringing the current draw down to <1mA once the measurement is done run this before going into "Sleep" mode.

Thanks for Reading

I hope this short guide has been helpful, if you have any questions please leave a comment or direct message me!