Skip to content

Generic embedded C driver to work with Sensirion's SEN5x environmental sensor modules via I2C

License

Notifications You must be signed in to change notification settings

jdownin/embedded-i2c-sen5x

 
 

Repository files navigation

Sensirion Embedded I2C SEN5x Driver

This is a generic embedded driver for the Sensirion SEN5x sensor modules. It enables developers to communicate with the SEN54/SEN55 sensor module on different hardware platforms by only adapting the I2C communication related source files.

Supported sensors

  • SEN50 (only particulate matter signals available)
  • SEN54 (no NOx signal available)
  • SEN55 (full feature set)

Getting started

Connecting the Sensor

Your sensor has the five different connectors: VCC, GND, SDA, SCL, SEL (the sixth connector will not be used for now).

Pin Name Description Comments
1 VCC Supply Voltage 5V ±10%
2 GND Ground
3 SDA I2C: Serial data input / output TTL 5V and LVTTL 3.3V compatible
4 SCL I2C: Serial clock input TTL 5V and LVTTL 3.3V compatible
5 SEL Interface select Pull to GND to enable I2C interface
6 NC Do not connect

Implement the I2C Interface

So we need to adjust two files according to your platform.

Edit sensirion_i2c_hal.c

This file contains the implementation of the sensor communication, which depends on your hardware platform. We provide function stubs for your hardware's own implementation. Sample implementations are available for some platforms: sample-implementations. For Linux based platforms like Raspberry Pi you can just replace the unimplemented HAL template with the implementation in sample-implementations/linux_user_space/:

cp sample-implementations/linux_user_space/sensirion_i2c_hal.c ./

Edit sensirion_config.h

Skip this part for Linux based platforms since everything is already setup for this case.

Otherwise you need to check if