Go Down

Topic: Honeywell SA transducer (Read 129 times) previous topic - next topic

Eddiedellz

I am trying to read a Honeywell SA transducer but the pressure from my gauge is way off from the reading. I'm not sure how to really translate the data from the data sheet to my code.

http://media.digikey.com/pdf/Data%20Sheets/Honeywell%20Sensing%20&%20Control%20PDFs/SA_Series.pdf

here's my wacky code. Thanks

Code: [Select]

int pwrled = 12;
int whiteled = 11;

void setup(){
   pinMode(pwrled, OUTPUT);
   pinMode(whiteled, OUTPUT);
 
   Serial.begin(9600);
}

void measurePressure(){
  const float offset = 0.0;
  float pressure = 0;
  int rawReading = analogRead(A1); 
  float voltage = rawReading * (5.0 / 1023.0);
  pressure= (voltage - offset) * 100/4.0;
 Serial.println("-----------------------------------------------------");
  Serial.print("Transducer Pressure: ");
  Serial.print(pressure);
  Serial.print(" PSI ");
   Serial.print("Voltage: ");
  Serial.println(voltage);
   Serial.println("-----------------------------------------------------");
  digitalWrite(pwrled, HIGH);
   digitalWrite(whiteled, LOW);// Currently haveing it turn on a led
 delay(500);
   digitalWrite(pwrled, LOW);
    digitalWrite(whiteled, HIGH);
 delay(500); }
void loop() {

 measurePressure();


}



jremington

What exact model do you have?

The data sheet says to measure the voltage. 1V = zero pressure, 5V = full scale.

However, output up to 6V is possible. You MUST protect the analog input from voltages > 5 V. A 10K resistor in series with the gauge and the analog input will do that.

The following is correct in the basic approach, but why is offset set to zero, and what do you think the term 100/4.0 supposed to do?

Code: [Select]
  pressure= (voltage - offset) * 100/4.0;

Eddiedellz

The version is 0 to 100 PSIA
my thinking was divide the 100PSI by the 4V range

when I read just voltage at 0 applied pressure it reads .48v


jremington

#3
Dec 11, 2016, 11:40 pm Last Edit: Dec 11, 2016, 11:41 pm by jremington
How are you powering the sensor? It requires at least 9V to operate.

Post a diagram showing how you have everything wired (hand drawn, not Fritzing).

Eddiedellz

#4
Dec 12, 2016, 12:33 pm Last Edit: Dec 12, 2016, 12:39 pm by Eddiedellz
Attached the diagram
I was previously powering it from the 5V pin so now ill change it to off a 9v and I added the 10k resistor.

What would be the correct way to calculate the PSI?

if 0 PSI = 1V & 100 PSI = 5V

Would I be dividing 4V by 1023?

Thank you for the help BTW

outsider

#5
Dec 12, 2016, 01:31 pm Last Edit: Dec 12, 2016, 01:36 pm by outsider
Try:
Code: [Select]
float pressure = (analogRead(A1) - 204) / 819.0 * 100;
Serial.println(pressure,1);
delay(500);

Untested.
5V = 1023, 1V = 204, 4V = 819.

Go Up
 


Please enter a valid email to subscribe

Confirm your email address

We need to confirm your email address.
To complete the subscription, please click the link in the email we just sent you.

Thank you for subscribing!

Arduino
via Egeo 16
Torino, 10131
Italy