Home

Awesome

Overview of Sensirion's GitHub Repositories

Reference DriversArduinoPythonRaspberry PiDeveloper Community

Table of Contents

  1. Preface
  2. Reference Drivers and Examples
    1. Repositories
    2. Concept
    3. Example use
  3. Arduino Drivers and Examples
  4. Python Packages
  5. RaspberryPi Drivers and Examples
  6. Third party repositories provided by our developer community
    1. Linux Kernel drivers
    2. From Paul van Haastrecht
    3. Sparkfun
    4. Adafruit
    5. Seeedstudio
    6. Rust packages
    7. Node packages

Preface

The goal of this page is to help users navigate the various driver offerings by Sensirion.

«Platform independent drivers requiring minimal porting efforts»

Sensirion is offering reference driver implementations that are meant to support customers in their product designs. These are tested extensively, and cover most of the common functionality of our sensors. They are also written in a platform independent way, to enable easy porting to new platforms. Because of that, they tend to be a bit more complex than a simple platform specific library, but offer peace of mind for the user to freely move to a different hardware platform with minimal adjustments. These drivers are described in the Reference Drivers and Examples section below.

Reference Drivers

«Platform specific prototyping starters»

We are also offering some platform specific libraries and code snippets to boost your prototyping activities. We have an extensive set of Arduino drivers and examples and Python packages, which can be used to communicate with our sensors via the Sensirion SensorBridge (Sensirion Evaluation Kit) .

We also offer some preconfigured and simplified variations of the reference drivers for the RaspberryPi platform. See the section RaspberryPi Drivers and Examples

ArduinoRaspberryPiPython

«Thank you to the open source community»

Lastly, there's a few third party repositories that we wanted to include. Please note that Sensirion is creating these projects and therefore being listed there is not an official endorsement, but there's really great work out there by our community that we wanted to share with you!

Community Picks

Finally, feel free to report any issues you have with the drivers on the respective GitHub repository. If you have questions beyond the drivers we're sharing here - for example anything that's related to the sensors themselves, rather than the drivers - the best way to get help is to use the contact form on the Sensirion website.

For more information, please also check out or Developer Website.

Reference Drivers and Examples

Generic drivers for all platforms from small-scale embedded-systems to full-scale Operating Systems.

Repositories

ProductFunctionBusRepository
Gas Index AlgorithmAlgorithm providing Index output signals from the SGP40/41 raw signalsI2Cgas-index-algorithm
SCDCarbon Dioxide (CO2)I2Cembedded-scd
SCD30Carbon Dioxide (CO2)I2Cembedded-i2c-scd30
SCD4XCarbon Dioxide (CO2)I2Cembedded-i2c-scd4x
SDPDifferential PressureI2Cembedded-i2c-sdp
SEN44Multi Sensor Environmental NodesI2Cembedded-i2c-sen44
SEN44Multi Sensor Environmental NodesUARTembedded-uart-sen44
SEN5xMulti Sensor Environmental NodesI2Cembedded-i2c-sen5x
SFA3XFormaldehydeI2Cembedded-sfa3x
SFMGas Flow MeterI2Cembedded-sfm
SFM3003Gas Flow MeterI2Cembedded-i2c-sfm-sf06
SFM3012Gas Flow MeterI2Cembedded-i2c-sfm-sf06
SFM3019Gas Flow MeterI2Cembedded-i2c-sfm-sf06
SFM3119Gas Flow MeterI2Cembedded-i2c-sfm-sf06
SFM4300Gas Flow MeterI2Cembedded-i2c-sfm-sf06
SGPMetal-Oxide (MOX) GasI2Cembedded-sgp
SGP40Metal-Oxide (MOX) GasI2Cembedded-i2c-sgp40
SGP41Metal-Oxide (MOX) GasI2Cembedded-i2c-sgp41
SHTHumidity and TemperatureI2Cembedded-sht
SHT3xHumidity and TemperatureI2Cembedded-i2c-sht3x
SHT4xHumidity and TemperatureI2Cembedded-i2c-sht4x
SPSParticulate MatterI2Cembedded-sps
SPSParticulate MatterUARTembedded-uart-sps
STC3xCarbon Dioxide (CO2)I2Cembedded-i2c-stc3x
STSTemperatureI2Cembedded-sts
STS3xTemperatureI2Cembedded-i2c-sts3x
STS4xTemperatureI2Cembedded-i2c-sts4x
SVM4xMetal-Oxide (MOX) GasI2Cembedded-i2c-svm4x
SVM4xMetal-Oxide (MOX) GasUARTembedded-uart-svm4x
SLF3xLiquid FlowI2Cembedded-i2c-sf06-lf
LD20Liquid FlowI2Cembedded-i2c-sf06-lf

Shared code can be found here https://github.com/Sensirion/embedded-common

Concept

Our reference drivers are our suggested starting point to implement stable products. They are tested intensively, and we provide support to our customers in case they face unexpected behaviour of the code.

It is implemented in a platform independent way, by means of a small "Hardware Abstraction Layer" (HAL) which abstracts the interface level commands (I2C, delay functions etc.) from the sensor readout protocols and timing. Because of that, the drivers can be ported to new platforms rather easily.

We currently support a range of sample implementation. At the time of writing this document, the following platforms are supported:

The complete list of implementations is availble in the embedded-common repository.

Example use

To build a driver, there's three steps that need to be completed:

  1. Download the release zip file from GitHub
  2. Configure your platform, or build your own platform support file
  3. Compile example / integrate into your application

As an example, for the SHTC1 humidity sensor for Linux user space:

  1. Download the latest release zip file from https://github.com/Sensirion/embedded-sht/releases and unzip
  2. Copy embedded-common/i2c/sample-implementations/linux_user_space/sensirion_i2c_hal.c to embedded-common/i2c/, thereby overwriting the empty sample implementation provided as starting point for new platform support.
  3. type make shtc1_example_usage

After that, you should have an executable called shtc1_example_usage that will read out the SHTC1 sensor. Run it with ./shtc1_example_usage. Depending on the permissions on the I2C device file (which is defined as #define I2C_DEVICE_PATH "/dev/i2c-1" in the provided sample implementation) you might have to add your user to the respective group or run as root with sudo ./shtc1_example_usage.

Arduino Drivers and Examples

To simplify developing on the Arduino platform, we offer a range of dedicated libraries. Those are available directly though the Library Manager in the Arduino IDE or here on GitHub, so installation is just a few mouse clicks away.

The code can be found in the following repositories:

ProductFunctionBusRepository
Gas Index AlgorithmAlgorithm providing Index output signals from the SGP40/41 raw signalsI2Carduino-gas-index-algorithm
SCD30Carbon Dioxide (CO2)I2Carduino-i2c-scd30
SCD4XCarbon Dioxide (CO2)I2Carduino-i2c-scd4x
SDPDifferential PressureI2Carduino-i2c-sdp
SDPDifferential PressureI2Carduino-sdp
SEN44Multi Sensor Environmental NodesI2Carduino-i2c-sen44
SEN44Multi Sensor Environmental NodesUARTarduino-uart-sen44
SEN5xMulti Sensor Environmental NodesI2Carduino-i2c-sen5x
SFA3XFormaldehydeI2Carduino-i2c-sfa3x
SFA3XFormaldehydeUARTarduino-uart-sfa3x
SFM3000Gas Flow MeterI2Carduino-i2c-sfm3000
SFM3003Gas Flow MeterI2Carduino-i2c-sfm-sf06
SFM3012Gas Flow MeterI2Carduino-i2c-sfm-sf06
SFM3019Gas Flow MeterI2Carduino-i2c-sfm-sf06
SFM3119Gas Flow MeterI2Carduino-i2c-sfm-sf06
SFM4300Gas Flow MeterI2Carduino-i2c-sfm-sf06
SFM6000Gas Flow MeterUARTarduino-uart-sfx6xxx
SFC6000Mass Flow ControllerUARTarduino-uart-sfx6xxx
SGP40Metal-Oxide (MOX) GasI2Carduino-i2c-sgp40
SGP41Metal-Oxide (MOX) GasI2Carduino-i2c-sgp41
SHTHumidity and TemperatureI2Carduino-sht
SHT3xHumidity and TemperatureI2Carduino-i2c-sht3x
SHT4xHumidity and TemperatureI2Carduino-i2c-sht4x
STS3xTemperatureI2Carduino-i2c-sts3x
STS4xTemperatureI2Carduino-i2c-sts4x
SLF3xLiquid Flow MeterI2Carduino-liquid-flow
SPSParticulate MatterI2Carduino-sps
STC3XCarbon Dioxide (CO2)I2Carduino-i2c-stc3x
SVM4xMetal-Oxide (MOX) GasI2Carduino-i2c-svm4x
SVM4xMetal-Oxide (MOX) GasUARTarduino-uart-svm4x
SLF3xLiquid FlowI2Carduino-i2c-sf06-lf
LD20Liquid FlowI2Carduino-i2c-sf06-lf

Shared code can be found here: Arduino Core

Finally, we offer some snippets to bootstrap our flow sensor based prototypes (SLG, SLI, SLS, SLQ-QTxxx, LG16-xxxxD, LS32, LPG10, LD20 and SLF3x): Arduino Liquid Flow Snippets

Want to understand every single step of your Arduino driver in one file? Check the Arduino Snippets and learn it from scratch.

Python Packages

The python packages work with our I2C and UART (SHDLC) sensors when attached to a compatible system. Compatible means, that the system provides an I2C Interface (e.g. a Raspberry Pi on Linux) for I2C sensors, or a COM-Port/Character device for UART (SHDLC) sensors. The Python drivers also work for I2C sensors attached with a SensorBridge

ProductFunctionBusRepository
SensorBridgeUSB to I2C GatewayUSBpython-shdlc-sensorbridge
Gas Index AlgorithmAlgorithm providing Index output signals from the SGP40/41 raw signalsI2Cgas-index-algorithm
SCD30Carbon Dioxide (CO2)I2Cpython-i2c-scd30
SCD4xCarbon Dioxide (CO2)I2Cpython-i2c-scd
SDPDifferential PressureI2Cpython-i2c-sdp
SFA3XFormaldehydeUARTpython-shdlc-sfa3x
SFC5XXXMass Flow Controller for GassesUARTpython-shdlc-sfc5xxx
SFC6000Mass Flow ControllerUARTpython-uart-sfx6xxx
SFM3003Gas Flow MeterI2Cpython-i2c-sfm-sf06
SFM3012Gas Flow MeterI2Cpython-i2c-sfm-sf06
SFM3019Gas Flow MeterI2Cpython-i2c-sfm-sf06
SFM3119Gas Flow MeterI2Cpython-i2c-sfm-sf06
SFM4300Gas Flow MeterI2Cpython-i2c-sfm-sf06
SFM6000Gas Flow MeterUARTpython-uart-sfx6xxx
SGP4XMetal-Oxide (MOX) GasI2Cpython-i2c-sgp4x
SHTHumidity and TemperatureI2Cpython-i2c-sht
SHT3xHumidity and TemperatureI2Cpython-i2c-sht3x
STCCarbon Dioxide (CO2)I2Cpython-i2c-stc
SVM4xMetal-Oxide (MOX) GasI2Cpython-i2c-svm4x
SVM4xMetal-Oxide (MOX) GasUARTpython-shdlc-svm4x
SLF3xLiquid FlowI2Cpython-i2c-sf06-lf
LD20Liquid FlowI2Cpython-i2c-sf06-lf
SEN5xMulti Sensor Environmental NodesI2Cpython-i2c-sen5x

Raspberry Pi Drivers and Examples

The Raspberry Pi drivers are Reference Drivers, which we configured for Raspberry Pi and should work out of the box. See the corresponding README.md files for detailed setup and installation instructions.

Learn how to port any Reference Drivers to Raspberry Pi by reading this section.

ProductFunctionBusRepository
Gas Index AlgorithmAlgorithm providing Index output signals from the SGP40/41 raw signalsI2Cgas-index-algorithm
SCD30Carbon Dioxide (CO2)I2Craspberry-pi-i2c-scd30
SCD4XCarbon Dioxide (CO2)I2Craspberry-pi-i2c-scd4x
SDPDifferential PressureI2Craspberry-pi-i2c-sdp
SEN44Multi Sensor Environmental NodesI2Craspberry-pi-i2c-sen44
SEN44Multi Sensor Environmental NodesUARTraspberry-pi-uart-sen44
SEN5xMulti Sensor Environmental NodesI2Craspberry-pi-i2c-sen5x
SFA3XFormaldehydeI2Craspberry-pi-i2c-sfa3x
SFA3XFormaldehydeUARTraspberry-pi-uart-sfa3x
SGP40Metal-Oxide (MOX) GasI2Craspberry-pi-i2c-sgp40
SGP41Metal-Oxide (MOX) GasI2Craspberry-pi-i2c-sgp41
SHT3xHumidity and TemperatureI2Craspberry-pi-i2c-sht3x
SHT4xHumidity and TemperatureI2Craspberry-pi-i2c-sht4x
STS3xTemperatureI2Craspberry-pi-i2c-sts3x
STS4xTemperatureI2Craspberry-pi-i2c-sts4x
STC3XCarbon Dioxide (CO2)I2Craspberry-pi-i2c-stc3x
SVM4xMetal-Oxide (MOX) GasI2Craspberry-pi-i2c-svm4x
SVM4xMetal-Oxide (MOX) GasUARTraspberry-pi-uart-svm4x
SLF3xLiquid FlowI2Craspberry-pi-i2c-sf06-lf
LD20Liquid FlowI2Craspberry-pi-i2c-sf06-lf
SFM3003Gas Flow MeterI2Craspberry-pi-i2c-sfm-sf06
SFM3012Gas Flow MeterI2Craspberry-pi-i2c-sfm-sf06
SFM3019Gas Flow MeterI2Craspberry-pi-i2c-sfm-sf06
SFM3119Gas Flow MeterI2Craspberry-pi-i2c-sfm-sf06
SFM4300Gas Flow MeterI2Craspberry-pi-i2c-sfm-sf06
SFM6000Gas Flow MeterUARTraspberry-pi-uart-sfx6xxx
SFC6000Mass Flow ControllerUARTraspberry-pi-uart-sfx6xxx

Third party repositories provided by our developer community

:warning: Please note that libraries listed in this section are not maintained by Sensirion, and are not supported by Sensirion.

Note that this list does not claim to be complete. If you would like to have your repository listed here, please submit a pull request or file an issue containing the github URL. Thanks!

Linux Kernel drivers

While our reference drivers above support Linux' userspace I2C interface, there's also the option to build them into the kernel. Some of those drivers were authored by Sensirion (and are now maintained as part of the Linux kernel). The following drivers are available:

Via HWMON interface

Via IIO interface

From Paul van Haastrecht

Sparkfun

Adafruit

Seeedstudio

Rust packages

Sensirion HDLC

SPS30 UART

SPS30 I2C

SHTCX Driver

SHT3x Driver

SGP30 Driver

Node packages

Sensirion HDLC

Node package which uses Node SerialPort and RXJS to implement Sensirion HDLC.