Sensirion SDP3x Arduino driver
This Arduino library can be used to interface the SDP3x differential pressure sensor from Sensirion over I2C to get the pressure difference and the temperature reading it exposes.
Installation
For now clone the github repository or download and unpack a Zipped version into the libraries folder of your Arduino IDE.
git clone https://github.com/rac2030/Arduino-Sensirion-SDP3x-driver.git
Usage example
1// To set a different I2C address, uncomment the define
2// #define SDP3x_I2C_ADDRESS 0x21
3#include "SDP3x.h"
4
5// Setup routine runs once when you press reset
6void setup() {
7 // Initialize serial console
8 Serial.begin(9600);
9 // Initialize I2C communication
10 Wire.begin();
11}
12
13// the loop routine runs over and over again forever
14void loop() {
15 // Simply print raw value, this can be viewed in the serial plotter
16 Serial.print("Pressure difference: ")
17 Serial.println(SDP3x.getPressureDiff());
18 // delay for a 100ms until the next sensor reading
19 delay(100);
20 Serial.print("Temperature: ")
21 Serial.println(SDP3x.getTemperature());
22 // delay for a 100ms until the next sensor reading
23 delay(100);
24}
25