Problem reading honeywell 100PGAA5 pressure sensor

Hello all, I am doing a softrobot tool kit project changing their sample code and design to control the pressure of a hand that we fabricated.

I have an Arduino mega 2560

The pressure sensor is a honeywell 100PGAA5. Data sheet is in the attachments below.

The control board diagram is posted below.

The sample code is quite long so I’ll give you a simpler version that works better for my project.

int prescaler = 256; // set this to match whatever prescaler value you set in CS registers below

// intialize setpoint
float setpoint=8;
void setup() {
  // input pins for valve switches
  pinMode(50, INPUT);
  pinMode(51, INPUT);
  pinMode(52, INPUT);
  pinMode(53, INPUT);

  // output pins for valve PWM
  pinMode(5, OUTPUT);
  pinMode(6, OUTPUT);
  pinMode(7, OUTPUT);
  pinMode(8, OUTPUT);

void loop() {
  float PWM=255;// set PWM you want a finger to be
  float P1 = (analogRead(A8)/25); 
  float P2 = (analogRead(A9)/25); 
  float P3 = (analogRead(A10)/25); 
  float P4 = (analogRead(A11)/25);
  // if statement for manual switch override
  if ((digitalRead(50) == HIGH) && (P1<setpoint)){analogWrite(5,PWM);} else {digitalWrite(5,LOW);} 
  // first if statement turns everything on. Second if statment says that if the pressure reading
  // is lower than the set point, open and close valve at your desired PWM. If it is not shut the valve completely off. 
  if ((digitalRead(51) == HIGH) && (P2<setpoint)){analogWrite(6,PWM);} else {digitalWrite(6,LOW);} 
  if ((digitalRead(52) == HIGH) && (P3<setpoint)){analogWrite(7,PWM);} else {digitalWrite(7,LOW);} 
  if ((digitalRead(53) == HIGH) && (P4<setpoint)){analogWrite(8,PWM);} else {digitalWrite(8,LOW);} 

  // print pressure readings
Serial.print(setpoint); Serial.print("\t");
Serial.print(P1); Serial.print("\t");
Serial.print(P2); Serial.print("\t");
Serial.print(P3); Serial.print("\t");
Serial.print(P4); Serial.print("\n");

What I expect to happen is that when air is flowing past my sensor through a t connector that connects the pump to the hand, the sensor will read the airflow as pressure and convert it to a voltage that the arduino can read. However what actually happens is the voltage the arduino reads fluctuates in a slightly periodic way. The input of pressure seems to have no effect on its fluctuation. Only turning on the board and switching on the valve seems to change it. When it does it behaves similar to a sharply fluctuating floor function. Consistently fluctuating but shifted up or down depending if a switch is turned off or on.

The issue I am facing is most likely electronic. I posted my code just now but I tried the original source code my code is based off of, and it doesn’t read any attempt I made and better.

ASDX Series Silicon Pressure Sensors Low Pressure and Ultra-Low Pressure Digital Output, ±2% Total Error Band, 10 Inches H2O to 100 psi.pdf (569 KB)

The sensor has a digital interface, either I2C or SPI. You can not read a value from it with analogRead().
You should grab an Arduino board (for example a Arduino Uno, or your Arduino Mega with nothing else connected to it) and one of those sensors and try to make it work.

What is the full name of the sensor ? Does it have a '5' at the end for a 5V sensor ?

My apologies. I gave you the wrong spec sheet for the sensor. The correct one is listed in the attachments below and is analog. It’s full name is ASDXAVX100PGAA5. Also, the sensor’s aren’t fluctuating. They are just not being effected by pressure inputs. When they are activated they register that there is maximum pressure moving through it reading out 1023 regardless of pressure being applied.

honeywell-sensing-asdx-series-analog-pressure-sensors-product sheet-008090-12-EN.pdf (572 KB)

Let's check that :wink:
ASDX : Series
AV : port on top, no other port (vented cover on bottom)
X : Future option
100PG : 100 psi = 6.9 bar
A : Analog output
A : 10% to 90% calibration
5 : 5V power supply

I don't know what causes the problem, so I just give a few tips and notes. Maybe one of them can be useful.

Since the sensor has an analog ouput, you can measure the output voltage of the sensor with a multimeter. Once that is okay, then you can try to read it with an Arduino. You don't need to apply pressure to it. Grab a new sensor, power it with GND and 5V and measure the output, it should be about 125 mV (anything from 50 mV to 200 mV is close enough).

When a pump is turned on, and the sensor is near the pump, it might not measure a constant pressure. It depends on how the pump works, but it is often fluctuating (a lot). A muffler/damper/filter between the pump and the sensor will help. Or connect the sensor at the end of a long tube.

The burst pressure of the sensor is only 3 times the maximum pressure. That is very low. When a valve is closed, it might cause a peak in the pressure. A peak of 300 psi will damage the sensor.

In software you could calculate the average of many samples, but then you have to read the data properly in the first place.
The code that you show throws away 4 or 5 bits when you divide it by 25. Do you have a Arduino Uno ? Then you can test just one sensor, and write the value of analogRead() to the serial monitor. Try to make the sketch as small as possible and please show the sketch.

The pins of the sensor that are not used should never be connected to something. If you have accidently connected them to GND, then the sensor might be damaged. Only three pins should be connected, leave the other pins open.

The sensor is ratiometric. That means its 5V should be the same 5V that the Arduino board uses as reference voltage for the analog conversion. Therefor you must power the sensors with the 5V pin of the Arduino board.

Could the sensors be damaged when the sensor 5V was off and the Arduino was on or vice versa ? Perhaps that is possible. Do you have an unused sensor ? It is even possible that the analog input section of the Arduino Mega 2560 is damaged.

The sensor can not output 5V, so you can not read 1023. The range is from about 25 to about 977. That means something is damaged or something is wrong. Without applying pressue, you should see that value of about 25 from the analogRead().