Airspeed Sensor Issue

Hi guys, I am facing with air speed sensor calibration error right now. I searched about it in that forum , and I read all of the problems most of them has same error and I tried to solve that as they did but I got nothing, and the other questions have not answered yet.

I have a MS4525 (in below px4airspeedv1.1),
QGC version is: 4.1.4
px4 version is : 1.13.0dev
My controller is holybro durandal
airframe is: Generic Quad Delta VTOL

then I connect my sensor GND to GND, 5V to 5V, SDA to SDA and SCL to SCL , in my controller I used I2CA port.
I made parameter SENS_EN_MS4525 as 1 in QGC parameter list then I tried to calibrate it in QGC, then I got thar error:

then I closed QGC then I entered nsh terminal.
I command:

nsh> ms5525_airspeed  status
INFO  [SPI_I2C] Not running
nsh> ms5525_airspeed start -I -X
WARN  [SPI_I2C] ms5525_airspeed: no instance started (no device on bus?)
nsh> ms5525_airspeed start
ERROR [SPI_I2C] need to specify a bus type
Usage: ms5525_airspeed <command> [arguments...]
 Commands:

   start
     [-I]        Internal I2C bus(es)
     [-X]        External I2C bus(es)
     [-b <val>]  board-specific bus (default=all) (external SPI: n-th bus (default=1))
     [-f <val>]  bus frequency in kHz
     [-q]        quiet startup (no message if no device found)
     [-a <val>]  I2C address
                 default: 118

   stop

   status        print status info
nsh> ms5525_airspeed start -q
Usage: ms5525_airspeed <command> [arguments...]
 Commands:

   start
     [-I]        Internal I2C bus(es)
     [-X]        External I2C bus(es)
     [-b <val>]  board-specific bus (default=all) (external SPI: n-th bus (default=1))
     [-f <val>]  bus frequency in kHz
     [-q]        quiet startup (no message if no device found)
     [-a <val>]  I2C address
                 default: 118

   stop

   status        print status info
nsh> ms4525_airspeed start -b 4
ERROR [SPI_I2C] need to specify a bus type
Usage: ms4525_airspeed <command> [arguments...]
 Commands:

   start
     [-I]        Internal I2C bus(es)
     [-X]        External I2C bus(es)
     [-b <val>]  board-specific bus (default=all) (external SPI: n-th bus (default=1))
     [-f <val>]  bus frequency in kHz
     [-q]        quiet startup (no message if no device found)
     [-T <val>]  Device type
                 values: 4525|4515, default: 4525

   stop

   status        print status info

then I stuck in that problem.
If you had a solution or any guess about it could you make me know.
Have a nice day, thanks. :slight_smile:

Try “ms5525_airspeed start -X”

I got that output:

nsh> ms4525_airspeed start -X
WARN  [SPI_I2C] ms4525_airspeed: no instance started (no device on bus?)

I try to see my sensor is working or not by coding in Arduino and it worked:
Code:

//#include <WireMW.h>
#include <Wire.h>   //I2C library 0x28H 
byte fetch_pressure(unsigned int *p_Pressure); //convert value to byte data type


#define TRUE 1
#define FALSE 0

void setup(void)
{
  Serial.begin(9600);
  Wire.begin();
  delay(500);
  Serial.println(">>>>>>>>>>>>>>>>>>>>>>>>");  // just to be sure things are working  
}

void loop()
{
  byte _status;
  unsigned int P_dat;
  unsigned int T_dat;
  double PR;
  double TR;
  double V;
  double VV;
  while (1)
  {
    _status = fetch_pressure(&P_dat, &T_dat);

    switch (_status)
    {
      case 0: Serial.println("Ok ");
        break;
      case 1: Serial.println("Busy");
        break;
      case 2: Serial.println("Slate");
        break;
      default: Serial.println("Error");
        break;
    }


    PR = (double)((P_dat-819.15)/(14744.7)) ;
    PR = (PR - 0.49060678) ;
    PR = abs(PR);
     V = ((PR*13789.5144)/1.225);
    VV = (sqrt((V)));

    
    TR = (double)((T_dat*0.09770395701));
    TR = TR-50;
    
  
    
   Serial.print("raw Pressure:");
   Serial.println(P_dat);
   //Serial.println(P_dat,DEC);
   //Serial.println(P_dat,BIN);
   Serial.print("pressure psi:");
   Serial.println(PR,10);
   Serial.print(" ");
   Serial.print("raw Temp:");
   Serial.println(T_dat);
   Serial.print("temp:");
   Serial.println(TR);
   Serial.print("speed m/s :");
   Serial.println(VV,5);
  



    delay(1000);
  }
}

byte fetch_pressure(unsigned int *p_P_dat, unsigned int *p_T_dat)
{


  byte address, Press_H, Press_L, _status;
  unsigned int P_dat;
  unsigned int T_dat;

  address = 0x28;
  Wire.beginTransmission(address);
  Wire.endTransmission();
  delay(100);

  Wire.requestFrom((int)address, (int) 4);//Request 4 bytes need 4 bytes are read
  Press_H = Wire.read();
  Press_L = Wire.read();
  byte Temp_H = Wire.read();
  byte  Temp_L = Wire.read();
  Wire.endTransmission();


  _status = (Press_H >> 6) & 0x03;
  Press_H = Press_H & 0x3f;
  P_dat = (((unsigned int)Press_H) << 8) | Press_L;
  *p_P_dat = P_dat;

  Temp_L = (Temp_L >> 5);
  T_dat = (((unsigned int)Temp_H) << 3) | Temp_L;
  *p_T_dat = T_dat;
  return (_status);

}

output:

raw Pressure:8071
pressure psi:0.0012207925
 raw Temp:760
temp:24.26
speed m/s :3.70704
Ok 
raw Pressure:8071
pressure psi:0.0012207925
 raw Temp:761
temp:24.35
speed m/s :3.70704
Ok 
raw Pressure:8076
pressure psi:0.0015598833
 raw Temp:760
temp:24.26
speed m/s :4.19037
Ok 
raw Pressure:7643
pressure psi:0.0278065800
 raw Temp:760
temp:24.26
speed m/s :17.69214
Ok 
raw Pressure:7555
pressure psi:0.0337748527
 raw Temp:761
temp:24.35
speed m/s :19.49859
Ok 
raw Pressure:8076
pressure psi:0.0015598833
 raw Temp:761
temp:24.35
speed m/s :4.19037

and you can see that when I blow its speed is increasing.

I don’t know how sensor probing is implemented in this driver. And ms4525_airspeed start -X -b <port_number> it doesn’t work? Have you tried another i2c port?

It didn’t work, my colleague made something that don^t know and he solved it, I will ask him to put issue here and how he did.