Simple pressure sensor wiring

Hi all :slight_smile:

I need to measure a pressure with accuracy and speed.
I've found this kind of pressure sensor which looks perfect for my application:

http://cgi.ebay.fr/300psi-Pressure-Transducer-or-Sender-for-Oil-Fuel-Diesel-Gas-Air-Water-/181138034634?pt=Motors_Car_Truck_Parts_Accessories&hash=item2a2cab0fca

My question is: what is the best way to wire it to keep a good accuracy and no reading problem with around 500 samples/seconds ?
The sensor is using 3 wires: 5V, ground and sensor output.

Thank you all :slight_smile:

There's only one way to wire it: 5V and gnd, and analog output to an Arduino analog pin.

Arduino's loop() runs (by my trivial testing) in the 100k times a second range, so I'd guess that your readings will be often enough. Others may have specific knowledge about how long an analogRead takes though, and give better info on the possible frequency of reading.

edit....

The code below runs 150000 times a second with the 6x analogReads //'d out, and 1500 times a second with them in.

//speed test

long startTime;
long runTime;
long counter=0;
int analogReading;

void setup()
{
  startTime = millis();
  Serial.begin(9600);
  Serial.print("Start ");
  Serial.println(millis());
}

void loop()
{
  runTime = millis()- startTime;
  counter++;
  /*
  analogReading= analogRead(0);
  analogReading= analogRead(1);
  analogReading= analogRead(2);
  analogReading= analogRead(3);
  analogReading= analogRead(4);
  analogReading= analogRead(5);
  */

  if (runTime >= 1000)
  {
    Serial.print("Looped ");
    Serial.print(counter);
    Serial.print(" times in ");
    Serial.print(runTime);
    while(1){
    };
  }

}

wow, great reply :smiley:

thank you very much, I have everything I need.

M4vrick:
wow, great reply :smiley:

thank you very much, I have everything I need.

You're welcome but here's my disclaimer: Your Mileage May Vary, Terms and Conditions Apply 8)

Btw, that analog input to the Arduino is conceptually no different from a 0-5V divider as established with a potentiometer like this.

Yes, but as I need accurary I've post here to be sure there is no better way to avoid any reference voltage problem or something like this.

You'll only really know it's ok when you invest the 20€ and test it, I suppose.

You'll need to check if it's keeping the output voltage up-to-date as often as you say you want to read it.... No point reading it faster than it can service its output.

The sensor responds time is maximum 1ms regarding the specs, with 1Khz sampling I guess it's ok.

But you're right, the only way to test it is buying the sensor :smiley: