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
 6 void 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
14 void 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 }

Sourcecode

https://github.com/rac2030/Arduino-Sensirion-SDP3x-driver

Michel Racic avatar
About Michel Racic
I’m a coding and technology freak. I finished once my bachelor of engineering in computer science or on german “Dipl. Ing.” and currently I’m mostly coding in Java as main language besides some stuff in C, C++, C#, HTML, JS, … - In my day job I work as a Software Engineer in Test and deal with all kind of Software from Native over Web into Mainframe where I use existing tools or write my own testing apps or libraries and the Frameworks around that they can be used in the most efficient way.
comments powered by Disqus