My sensor: SSCDANN150PAAB5
Sensor Datasheet: Safety and Productivity Solutions | Honeywell
Below is my script:
int sensorPin = A0; // select the input pin for the pressure sensor
int pressure = 0; // variable to store the value coming from the sensor
int raw = 0;
float voltage = 3.3;
float supply = 5;
float error;
void setup() {
-
Serial.begin(9600);*
}
void loop()
{
_ error = 0.1*supply;_ -
// read the value from the sensor:*
-
raw = analogRead(sensorPin);*
_ voltage = raw * ( supply / 1023.0);_
_ pressure = (voltage - error ) * (150/(0.8*supply)); //convert reading to PSI_ -
// output reading*
-
Serial.print("Pressure: " );*
-
Serial.print(pressure);*
-
Serial.print(" PSI");*
-
Serial.println("");*
-
Serial.print("Raw: " );*
-
Serial.print(raw);*
-
Serial.println("");*
-
delay(500);*
}
Verified that my wiring connections are correct.
I am applying 100PSI to the system (known PSI of the source) and I am not getting accurate readings.
Can anyone spot anywhere in my script that may be source of the issue?
Also, my sensor is reading ~20 PSI in the room (situated in California) (raw value: ~220) - can anyone verify if this makes sense?
When I apply 100 PSI it reads 150 PSI (I feel it would be much larger but that is the measurement limit of the sensor - so I have a feeling my math in the script is off).