Close

Pressure Sensor Concerns

A project log for ArduAOA

Use BLE enabled Arduinos to collect Angle of Attack (AoA) information and display

tklenketklenke 11/25/2023 at 23:030 Comments

The MPX10DP I purchased has an overpressure limit of 75 kPA, with an operation range of 0 to 10 kPA.  10 KPA = 1.45 PSI.  This is equivalent to 248 knots at standard atmosphere.  This seems fine, but I am concerned that the gauge reads in milliVolts with a range of 20 to 54.  I think the ESP A/D converter only reads in increments of 1 milliVolt.  This would mean that we would not have very good resolution.  

If this is true, we'll need to consider maybe amplifying the voltage output so we can get a range more like 1000 to 2500 milliVolts, or 50x the output voltage.

Ok...a little digging.  There seems to be a method to change the AtoD attenuation in the ESP32 chip.  But not clear if this will be easily done.  Will need to dig into the drivers for the ESP32 and look for variable ADC_ATTEN_11 for a start.

Ok...github is awesome.  Found the header file arduino-esp32/cores/esp32/esp32-hal-adc.h

and tried to compile my project with the following line...it worked.

analogSetPinAttenuation(VBATPIN,ADC_11db);

 So now need to carefully try this out with a low voltage signal and different attenuations. Humans can produce about 2.8 psi by blowing, or 19 kPa.  So we should be able to blow on the input and max out the pressure without overpressuring the sensor.

typedef enum {
    ADC_0db,
    ADC_2_5db,
    ADC_6db,
    ADC_11db,
    ADC_ATTENDB_MAX
} adc_attenuation_t;

/*
 * Set the attenuation for all channels
 * Default is 11db
 * */
void analogSetAttenuation(adc_attenuation_t attenuation);

/*
 * Set the attenuation for particular pin
 * Default is 11db
 * */
void analogSetPinAttenuation(uint8_t pin, adc_attenuation_t attenuation);

Discussions