Underwater ROV‎ > ‎Research‎ > ‎arduino wiring‎ > ‎

pressure wiring schematic

MXPX4250AP-ND Pressure Probe

http://www.instructables.com/answers/What-could-I-use-for-a-depth-sensor-in-a-SeaPerch-/




void setup()  {
  //initialize serial port (defined in help menu) at 9600 baud
  Serial.begin(9600);
}

void loop()  {
  //Analog pin 0 as input
  int aValue=analogRead(0);

  //double volt=digital/[(dig_max-dig-min)/(volt_max-volt-min)]
  double volt=aCalc/204.8;

  //pressure=[{(press_max-press_min)/(volt_range_max-volt_range_min)}  
  //{(dig_max-dig_min)/(volt_max-volt_min)}] * (digital-dig_offset)
  double pressure=0.037711935*(aCalc-41);

  //print to screen
  Serial.print("Digital: ");
  Serial.println(aValue);
  Serial.print(" Volts: ");
  Serial.println(volt);
  Serial.print("Pressure: ");
  Serial.println(pressure);
  
  //delay
  delay(1);
}
Ċ
tim hettinger,
Apr 25, 2010, 8:55 AM
Comments