Navigation

Saturday 15 November 2014

Programming the ASDXACX100PAAA05 pressure sensor


The ASDXACX100PAAA05 pressure sensor is an absolute pressure sensor, that is it measures atmospheric pressure plus any other pressure in the system.

  • Maximum pressure, Pmax is 100psi. Minimum pressure, Pmin is 0psi
  • Power supply is +5V
  • Supply current is 2.5mA
  • It uses 10% - 90% calibration
  • It uses 12-bit analogue output

Pinout: It has 8 pins, three are used, the remaining are not connected

Arduino uses 10-bit ADC (0 - 1023). Therefore the output voltage from the Arduino is in the range og 0 - 1023. Hence, must be converted to its voltage form. This is achieved by mapping 0 1 1023 to 0 - 5v as shown by the equation below.
Reading the voltage from Arduino: The transfer function limits define the output of the sensor at a given pressure input. By specifying the output signal at the maximum (Pmax) and minimum (Pmin) limit of the pressure range, the complete transfer curve for the sensor is defined.
It uses 10% - 90% of the supply voltage and maps it to Pmin and Pmax respectively. That is:

  • At 10% of Vsupply (0.5v), Pmin equals 0psi
  • At 90% of Vsupply (4.5v), Pmax equals 100psi

Pmax = maximum limit of pressure range = 100psi
Pmin= minimum limit of pressure range = 0psi

The equation of the transfer function is:


Therefore, at atmospheric pressure (14.696psi), output voltage should equal:
Therefore, pressure applied equals:

The Arduino Code:


/*

 Reads an analog input pin, converts it to voltage and calculates the corresponding output pressure
 Also prints the results to the serial monitor.

 The circuit:
 * ASDX pressure sensor pin 2 connected to analog pin 0.
   pin 1 connected to Vcc (+5v for ASDXACX100PAAA05)
   pin 3 connected to GND
   the other pins are not connected
 * 

 created 15 July. 2014
 by Toria Olawumi

 */

const int ADCFULLSCALE = 1023;               // ADC full scale of arduino is 10-bit (0-1023)
const float reference_voltage_mv = 5000.0;   // Vcc is 5000mv (5V) for ASDXACX100PAAA05
const int Pmax = 100;                       // 100psi for ASDXACX100PAAA05
const int Pmin = 0;                         // 0 psi FOR ASDXACX100PAAA05

const int analogInPin = A0;     // Analog input pin that the asdx pressure sensor is attached to

int sensorValue = 0;           // value read from the pressure sensor

float voltage_mv = 0.0;         // pressure sensor voltage in mV
float voltage_v = 0.0;         // pressure sensor voltage in volts
float output_pressure = 0.0;   // output pressure in psi
float vacuum_pressure = 0.0;   // (substract atmospheric pressure from output_preesure) // vacuum pressure in psi

void setup() {
    Serial.begin(9600); 
}
void loop() {
  // read the analog in value:
  sensorValue = analogRead(analogInPin);                              // digital value of pressure sensor voltage
  voltage_mv =  (sensorValue * reference_voltage_mv) / ADCFULLSCALE;   // pressure sensor voltage in mV
  voltage_v = voltage_mv / 1000;
  Serial.println(voltage_v);
  output_pressure = ( ( (voltage_v - (0.10 * (reference_voltage_mv/1000) )) * (Pmax - Pmin) ) / (0.8 * (reference_voltage_mv/1000) ) ) + Pmin;
  vacuum_pressure = output_pressure - 14.6; // subtract atmospheric pressure
}






No comments:

Post a Comment