Home

Awesome

Sensirion Raspberry Pi I2C SDP Driver

This document explains how to set up the SDP sensor to run on a Raspberry Pi using the provided code.

<center><img src="images/SDP8xx.png" width="250px"><img src="images/SDP3x.png" width="250px"></center>

Click here to learn more about the SDP3x Sensor Evaluation Kit.

Click here to learn more about the SDP8xx series Sensor Evaluation Kit.

Setup Guide

Connecting the Sensor

Your sensor has the four different connectors: VCC, GND, SDA, SCL. Use the following pins to connect your Sdp:

SdpRaspberry Pi
VCCPin 1
GNDPin 6
SDAPin 3
SCLPin 5
<center><img src="images/sdp8xx-pinout.png" width="900px"></center> <center><img src="images/GPIO-Pinout-Diagram.png" width="900px"></center>

Setting sensor address

Depending on whether you connect a SDP3x or SDP8xx configure the correct i2c address in sdp_i2c.h (SDP_I2C_ADDRESS).

Raspberry Pi

Troubleshooting

Building driver failed

If the execution of make in the compilation step 3 fails with something like

-bash: make: command not found

your RaspberryPi likely does not have the build tools installed. Proceed as follows:

$ sudo apt-get update
$ sudo apt-get upgrade
$ sudo apt-get install build-essential

Initialization failed

Error executing sdp_get_serial_number(): -1
Error executing sdp_read_product_identifier(): -1
Error executing sdp_start_continuous_measurement_with_diff_pressure_t_comp_and_averaging(): -1
Error executing sdp_read_measurement(): -1

then go through the below troubleshooting steps.

Missing I2C permissions

If your user is missing access to the I2C interface you should first verfiy the user belongs to the i2c group.

$ groups
users input some other groups etc

If i2c is missing in the list add the user and restart the Raspberry Pi.

$ sudo adduser your-user i2c
Adding user `your-user' to group `i2c' ...
Adding user your-user to group i2c
Done.
$ sudo reboot

If that did not help you can make globally accessible hardware interfaces with a udev rule. Only do this if everything else failed and you are reasoably confident you are the only one having access to your Pi.

Go into the /etc/udev/rules.d folder and add a new file named local.rules.

$ cd /etc/udev/rules.d/
$ sudo touch local.rules

Then add a single line ACTION=="add", KERNEL=="i2c-[0-1]*", MODE="0666" to the file with your favorite editor.

$ sudo vi local.rules