Digital Differential Pressure Sensor SDP600

Hello,
I have a problem with my project. I have capture the pressure difference is the DATA my sensor and I have not managed to find Arduino library for programming.
If you could tell me which library to use for my project.
Thanks you for your help,
Datasheet : http://www.farnell.com/datasheets/1720196.pdf
Sorry if i'm not very understanding but i'm not english and i have not a good english.

In french :
Bonjour,
J'ai un problème avec mon projet. Je dois pouvoir relever la différence de pression soit le DATA de mon capteur et je n'ai pas réussi à trouver de librairie ARDUINO pour programmer.
Si vous pourriez m'indiquer quel librairie utiliser pour réaliser mon projet.
Merci de votre aide,

first thing to do is to use an I2C scanner to see if the Arduino can find the device.

they can be found here - Arduino Playground - I2cScanner -

Note it uses 3,3V and not 5V so you might need a voltage converter!

from the datasheet

Note that two transfer sequences are needed to perform a measurement.

First write command byte hF1 (trigger measurement) to the sensor,

and then execute a read operation to trigger the measurement and retrieve the flow or differential pressure information.

in code you need something like this

uint16_t readRawPressure(uint8_t address)
{
    Wire.beginTransmission(address);
    Wire.Write(0xF1);
    int rv = Wire.endTransmission();
    if (rv != 0)
    {
        // handle error
        return 0;
    }
    
    Wire.requestFrom(address, 2);
    uint16_t val = Wire.read() << 8;
    val += Wire.read();
    rv = Wire.endTransmission();
    if (rv != 0)
    {
        // handle error
        return 0;
    }
}

And then you need to convert the raw value to something in HPa or so

When you write Wire.requestFrom(address, 2);, what is address? The pin where data is connect to the arduino?

The I2C address

Yes, i understand, 0x40. and command byte hF1 (trigger measurement) to the sensor, what is that? I must find the formul to convert in Pa?
Thanks for the answer Rob

and the function uint16_t readRawPreassure is not recognize by the ArduinoIde. What i suppose to do?

I find this code but it doesn't work:

#include <Wire.h>

#include <Sensirion.h>

void setup()
{
  Wire.begin();

  Serial.begin(9600);
  Serial.println("\nI2C Scanner");
const int analog_pins[2] = {4, 5};       //Sensor_count = 2
                                         //Pins 4 and 5  
}


void loop()
{
  byte error, address, sensorValue, result;
  int nDevices;
  int analogOutPin;
  //int result
  
  Serial.println("Scanning...");

  nDevices = 0;
  for(address = 1; address < 127; address++ ) 
  {
    // The i2c_scanner uses the return value of
    // the Write.endTransmisstion to see if
    // a device did acknowledge to the address.
    Wire.beginTransmission(address);
    error = Wire.endTransmission();

    if (error == 0)
    {
      Serial.print("I2C device found at address 0x");
      if (address<16) 
      Serial.print("0");
      Serial.print(address,HEX);
      Serial.println("  !");

      nDevices++;
    }
    else if (error==4) 
    {
      Serial.print("Unknow error at address 0x");
      if (address<16) 
        Serial.print("0");
      Serial.println(address,HEX);
    }    
  }
  if (nDevices == 0)
    Serial.println("No I2C devices found\n");
  else
    Serial.println("done\n");

  delay(500);           // wait 5 seconds for next scan
  
  ///////////////NEW////////////////////////

int MEASUREMENT_PA_HM = 0xF1;             // update for pressure measurement, hold master
int USER_REG_W = 0xE6;                    // write user register
int USER_REG_R = 0xE7;                    // read user register
0xFE; }                                   // soft reset

float readPA(0xF1);

with the SDP6 libraries

Sensirion.cpp (4.28 KB)

Sensirion.h (2.89 KB)

and the function uint16_t readRawPreassure is not recognize by the ArduinoIde. What i suppose to do?

try to make no typing errors :wink:

What i suppose to do? Sorry if i make typing errors :slight_smile:

And i make test late.. : I have Scanning...
No I2C devices found
SDA>Pin2 et SDL>Pin3

Code for the test :

#include <Wire.h>


void setup()
{
 Wire.begin();

 Serial.begin(9600);
 Serial.println("\nI2C Scanner");
}


void loop()
{
 byte error, address;
 int nDevices;

 Serial.println("Scanning...");

 nDevices = 0;
 for(address = 1; address < 127; address++ )
 {
   //address = 0x40;
   // The i2c_scanner uses the return value of
   // the Write.endTransmisstion to see if
   // a device did acknowledge to the address.
   Wire.beginTransmission(address);
   error = Wire.endTransmission();

   if (error == 0)
   {
     Serial.print("I2C device found at address 0x");
     if (address<16)
       Serial.print("0");
     Serial.print(address,HEX);
     Serial.println("  !");

     nDevices++;
   }
   else if (error==4)
   {
     Serial.print("Unknow error at address 0x");
     if (address<16)
       Serial.print("0");
     Serial.println(address,HEX);
   }    
 }
 if (nDevices == 0)
   Serial.println("No I2C devices found\n");
 else
   Serial.println("done\n");

 delay(5000);           // wait 5 seconds for next scan
}

DO you have pull up resistors?

Did you connect the SDA and SCL pins correctly?
For Arduino UNO these should be Analog4 (SDA) and analog5 (SCL)

I have connect Sda to A4 and SDL to A5, and for one connection, i have pull up resistor for Sda and Sdl. When i test with i2c scanning, if i have sda and sdl on analog pin, the test block when it arrive to
error = Wire.endTransmission(); I have test with serial.print to see that. And i have i2c device not found if i test with the sda/sdl on pin 2 and 3.
R = 4.7k

In the datasheet title, this is write Digital sensor, so i should be connect to other pin than analog? Like pin 3,4?

I solve the problem for the i2c scanner, i find the sensor with 0x40 (adress) but i have the problem with the code. ;p

Result this : Screenshot by Lightshot
With the code

#include <Wire.h>
#include <SDP6xx.h>

void setup()
{
  Wire.begin(); 
  Serial.begin(115200);
}


void loop()
{
   Serial.println((float)SDP6xx.readPA());
   delay(100);
}

I modify the code and i have now after write the result with (pressure = sensor output / 1200) after see datasheet.
I have : Screenshot by Lightshot
It's the possibl result? Correct?

I modify the code and i have now after write the result with (pressure = sensor output / 1200) after see datasheet.
I have : Screenshot by Lightshot
It's the possibl result? Correct?

The Arduino uses the ANALOG PINS 4 and 5 also as I2C bus. I2C is a digital protocol.

You can use other pins for I2C if you use a software I2C library. As that would make your code more complex I would not do that unless there is no other option.