Probleme with SP610 Pressure sensor

Hello guys
I want to mesure pressure and with this mesure use the formula of thermodynamic to have the speed of the wind. It's for a project of wind tunnel. So for that i take the SP610 the 25Pa differential pressure. For the programme i use this code and sometime the mesure can be good but also doing something crazy and show not a number or big value.
So if you can help me on what is the problem. I DIDNT FOUND ANYTHING ON INTERNET TO AVOID THIS PROBLEM. I just want to have good value .
< #include "SDP6xx.h"

#include <OneWire.h>
#include <DallasTemperature.h>
#include <Wire.h>
#include <LiquidCrystal_I2C.h>//toute les bibliotheque a avoir pour temp et lcd
#include <Wire.h>
moyenne =((float)SDP6xx.readPA());
//moyenne = Moy.getAverage();
moyenne = moyenne/1200;// Convertion en Pa (modèle 25 Pa)
moyenne = 2moyenne;
moyenne=moyenne/1.293;
moyenne=sqrt(moyenne);// Conversion en m/s
moyenne=moyenne
3.6;>

Hi, @khumran
Welcome to the forum.

Can you please post link to data/specs of the sensor?
What model Arduino are you using?

Thanks.. Tom... :smiley: :+1: :coffee: :australia:

The lines in bold don't look correct.

As @TomGeorge said, please post the whole code.

I use the Arduino Uno
this the data sheet i use the 25Pa
data sdp-610 25 Pa

#include "SDP6xx.h"



 #include <OneWire.h>
   #include <DallasTemperature.h>
    #include <Wire.h>
     #include <LiquidCrystal_I2C.h>//toute les bibliotheque a avoir pour temp et lcd
     #include <Wire.h>
      
    // #include <RunningAverage.h>
 
  byte nike_wr[8] = {
  B11100,
  B10100,
  B11100,
  B00000,
  B00000,
  B00000,
  B00000,
  B00000
};
 byte cho[8] = {
    B00000,
    B00000,
    B00000,
    B00000,
    B00000,
    B00000,
    B00000,
    B00000
};// creation d'un motif

OneWire oneWire(6);//fil sur la broche 6 arduino  Configurez une instance oneWire pour communiquer avec n'importe quel appareil

DallasTemperature sensors(&oneWire); // prendre cette reference la mettre dans dallas temperature
LiquidCrystal_I2C lcd(0x27, 16, 2);// dimension de l'ecran lcd et son addresse
DeviceAddress insideThermometer={0x28, 0x21, 0x4A, 0x25, 0x13, 0x21, 0x01, 0xCF};//addressage des deux sondes
DeviceAddress outsideThermometer={0x28, 0xBF, 0x3A, 0x2C, 0x13, 0x21, 0x01, 0x93};

int h = 00;
int m = 00;
int s = 00;
int i=00;
float moyenne = 0;
int j=0;
//RunningAverage Moy(150);
void setup() {
  
  Wire.begin();
   Serial.begin(115200);
  
  lcd.init();//demarage du lcd
lcd.backlight();//affichage de l'eclairage
lcd.createChar(0, nike_wr);//creation du caractere 0 nommer nikewr
lcd.createChar(1, cho);
Serial.begin ( 9600 ) ;//pour le demarage de la console
//sensors.begin();
sensors.setResolution(insideThermometer, 64);//resolution des sondes le nom suivis de nombre de bit 
sensors.setResolution(outsideThermometer, 64);


}


void loop() {
  // put your main code here, to run repeatedly:

sensors.requestTemperatures();//envoie la commande pour receptionner les temperature


float w=sensors.getTempC(outsideThermometer);//creation de la variable w pour avoir la temperature de la sonde en degres celsuis


lcd.setCursor(0,0);
lcd.print("T1=");


lcd.print(w);


lcd.write(0);


lcd.print("C");//ecriture lcd


float p=sensors.getTempC(insideThermometer);
lcd.setCursor(0,1);
lcd.print("T2=");


lcd.print(p);


lcd.write(0);
lcd.print("C");

//lcd.setCursor(11,0);
//lcd.print(m);
//lcd.print("min");


//lcd.setCursor(11,1);
//lcd.print(s);
//lcd.print("sec");
j++;


//s = millis()/1000 % 60; //compteur
 // if (s == 59) {
   // s = 0;
   // delay(1000);
   // m++;
   // i++;
//lcd.setCursor(15,1);
    //lcd.write(1);
  //  if (m >= 60) {
   //   m = 0;
    //  h++;
    //  lcd.setCursor(15,0);
    //   lcd.write(1);
  //    if (h >= 24) {
   //     h = 0;
     
    
   //   }
//    }
//  }
 //     if(i>=30){
  // lcd.clear();
  // lcd.print("temps programme");
  //  lcd.setCursor(3,1);
   // lcd.print(h);
   //     lcd.print("h");
   // lcd.print(m);
   //       lcd.print("min");
   //  delay(2000);
   //  lcd.clear();
   //  i=0;
     // }
  while(j==1){
  //Serial.println(m);
  //Moy.addValue((int)SDP6xx.readPA());
   moyenne =((int)SDP6xx.readPA());
//moyenne = Moy.getAverage();
  moyenne = moyenne/1200;// Convertion en Pa (modèle 25 Pa)
  moyenne = 2*moyenne;
  moyenne=moyenne/1.293;
  moyenne=sqrt(moyenne);// Conversion en m/s
  moyenne=moyenne*3.6;
 // if(moyenne==nan){
 // lcd.print("error"); ;
  //}
   Serial.println(moyenne);
   
  lcd.setCursor(13,1);
  lcd.print(moyenne);
  j=0;}
  //Moy.clear();
  //delay(1000); 
  
  
}```
this is the entire code 
i use this for code
[SDP6xx.zip|attachment](upload://zt4hhpgtZYXa4Qb4rRAwpcix3pC.zip) (3,8 Ko)
and other library they are for another sensor who use one wire and dallastemp library the sensor called DS18B20 but in fact this information isnt use full

You have started Serial twice. Please remove one of the statements. Let us know if it helps

The SDP6x-Sensors are very sensitive.
But there is another thing you have to take care of:

This sensor works based an flow through the sensor. It measures pressure but the measuring is based on a flowrate through the sensor.

This means that pressure-loss through the flow impacts the measured value.
Especially on long hoses with a very small diameter the pressure-drop is significant.
Even at small pressures like 1 to 5 Pa.

I attach the Sensirion-document that explains it.
Sensirion_Differential_Pressure_AppNotes_SDP600Series_Pressure_Drop_In_Hose.pdf (155.6 KB)

best regards Stefan

in that case im supposed to reduce the inlet diameter? im already at 2 mm and 25 cm long.
And the problem is my sensor when he goes above 0 the sensor drop and the mesurement going crazy like -0.25 and after -12333 but that number isnt actully acceptable for sensor so the arduino serial show nan like not a number .

No the opposite.
the smaller the diameter of the hose
and
the longer the hose is
the more pressure-drop you have which gives a deviating result from the true value

The ideal thing is
hose is only 5 mm long and the hose has a inner free diameter of 8 mm.
Now hose short as 5 mm and 8 mm is unrealistic.

The diagram in the PDF shows the deviation of a hose with inner free diameter of 5 mm that is 0,5 m long (the red line) is in the range between 98% and 99% which means the deviation is only 1% to 2%.

From where do you have the library SDP6xx.h (double-x) ?

I have this library SDP6x.h (single-x)

The library SDP6x.h-library does not have a function readPA()

best regards Stefan

from previous forum
SDP6xx.zip (3,8 Ko)

where do you go this library

What do you mean with
"where do you go this library?"

where did you get SDP6x.h this library

general strategy to find libraries
quogling with keyword "GitHub" name of the library

https://www.google.com/search?q=github+SDP6x.h

best regards Stefan

This topic was automatically closed 180 days after the last reply. New replies are no longer allowed.