Air presure sensor (mpx5700dp)

Solve the transfer function for P.
Use a voltmeter
Measure Vout
Measure Vsupply

Where '5' appears in the transfer function, you will eventually have to substitute (5*Vsupply/5). This is what ratiometric means.

With the A/D's reference = to the power supply voltage, see what you need to do to massage the value into the (5*Vsupply/5) form.

I still suspect that with a differential sensor, ports unconnected, , the answer will always be near zero within the error bars.

I think this https://www.arduino.cc/reference/en/language/functions/analog-io/analogreference/ Arduino page needs work.
 
This http://sites.bu.edu/engcourses/files/2016/08/adc-tutorial.pdf is not the Arduino, but hopefully it makes sense. if you read n as an integer, then n/1023 is the fraction of full scale value. 1023 would be 100%,
If it read 500, then 500/1023 = 0.489. 0.489*5 = 2.445; That is an OK number to use in the equation, but it may not be the voltage. If Vss=5 or Vss=5.1, you get the same 2.445 and that's the point when it's ratiometric.

It's not 500 * 5/1023 (Volts/bit) because when Vss=5.1 volts 500*5/1023 isn't going to be the same number.

2.444 in the first case and really 500*5.1/1023, but you don't know the 5.1 number. You get 2.493. Tomorrow, that 5.1 might be 4.9 but you read 500. The A/D gets the same value even if the supply voltage changes.
 

Thread Starter

28sya

Joined Jun 13, 2020
20
This http://sites.bu.edu/engcourses/files/2016/08/adc-tutorial.pdf is not the Arduino, but hopefully it makes sense. if you read n as an integer, then n/1023 is the fraction of full scale value. 1023 would be 100%,
If it read 500, then 500/1023 = 0.489. 0.489*5 = 2.445; That is an OK number to use in the equation, but it may not be the voltage. If Vss=5 or Vss=5.1, you get the same 2.445 and that's the point when it's ratiometric.

It's not 500 * 5/1023 (Volts/bit) because when Vss=5.1 volts 500*5/1023 isn't going to be the same number.

2.444 in the first case and really 500*5.1/1023, but you don't know the 5.1 number. You get 2.493. Tomorrow, that 5.1 might be 4.9 but you read 500. The A/D gets the same value even if the supply voltage changes.
For the conversion raw to kpa, which formula should i use? Should i use the transfer function formula on the datasheet?
 
Cheating: https://www.wolframalpha.com/input/?i=solve+V+=+5+*+(0.0012858+P+++0.004)+for+P

1609740015886.png

Checking: https://www.wolframalpha.com/input/?i=solve+2.5+=+5+*+(0.0012858+P+++0.004)+for+P

1609740093723.png

Dividing: 385.75 which checks out.

You just have to do the V thing correctly.

Like I said, the Arduino page needs some work. I'm not sure if the A/D converter really uses Vcc and the difference is small.
There are 3.3 and 5V Arduino's too.

You can measure Vcc and hope it's not 5.00 Volts. 4.9 or 5.1 would be good. Then create an external input say with a 10K to 100K potentiometer. If the supply were 5.1, inputting 5V would not give you the max counts. When you reach Vcc, the counts would be maximum if indeed Vref is Vcc.
 

ericgibbs

Joined Jan 29, 2010
18,869
Running your Arduino code , I get this plot

hi,
Yes your Code in my Arduino.
'pot' is short for potentiometer ie: variable 10k resistor, connected across +5V and 0V, wiper to AN0.

At local room pressures , the reading you get will be small/changes.
Post the serial print out.

Over what pressure range are you using the sensor to measure, what is the project.?

E

Update:

One kP = 0.145038 psi
As the typical ambient pressure at sea level is ~14.5psi = 100kP, thats why you have 'low' kP values.
 
Last edited:
What processor are you using?

I'm just trying to understand stuff (details), so the A/D stuff for the 2560 (picked out of a hat) starts here https://ww1.microchip.com/downloads...40-1280-1281-2560-2561_datasheet.pdf#page=268

This has a selecable 2.56 and 1.1V absolute reference and an external reference. The internal refereneces can't be used if the external one is.

Page 277 states:

An n-bit single-ended ADC converts a voltage linearly between GND and VREF in 2n steps (LSBs). The lowest codeis read as 0, and the highest code is read as 2n-1

Page 280

1609754481716.png

I was a little misled. I don't know if Vref is connected to Vcc and I need to look at the schematics for that.
This basically says if you have a 5V reference, you can't read 5V.

1023 does not = ( 5 * 1024)/5

1023 = (Vin * 1024) /5; 5*1023 = Vin * 1024; so Vin = 5*(1023/1024)
So, the max voltage you can read is: 4.995

I don;t know what this means yet.
 

ericgibbs

Joined Jan 29, 2010
18,869
hi 28,
Checking your Code, a problem is subtracting the 0.2V, pushes the reading below zero.
Note: your Arduino's ADC is also ratiometric as well as the Sensor.
I would recommend you power the Arduino and Sensor from the same nominal 5V supply

E
 

Thread Starter

28sya

Joined Jun 13, 2020
20
hi 28,
Checking your plot against the d/s plot, your plot is out of alignment.
Ref this image, ask if you need an explanation.

E
How do you get the data? Do you give the pressure to sensor at port 1 or are you using the simulation? I have the initial value for the sensor at initial condition. I will attach the file, could you please look for it?
 

Attachments

Thread Starter

28sya

Joined Jun 13, 2020
20
hi 28,
Checking your Code, a problem is subtracting the 0.2V, pushes the reading below zero.
Note: your Arduino's ADC is also ratiometric as well as the Sensor.
I would recommend you power the Arduino and Sensor from the same nominal 5V supply

E
If I add modulus to value pressureSensor so that I will get the positive value only, does it will affect the graph?
 

ericgibbs

Joined Jan 29, 2010
18,869
hi 28,
I am using an Arduino, with your Code.
I have a10K variable resistor connected from +5v to 0V and the wiper to AN0.
By varying the potentiometer I can sumulate your pressure sensor.

Why are you dividing the Sensor value by 4.5 and not 5..?
Also remove the -0.2V from the code.

E
This plot shows your Code I have edited and the plot from the datasheet.
 

Attachments

Thread Starter

28sya

Joined Jun 13, 2020
20
What processor are you using?

I'm just trying to understand stuff (details), so the A/D stuff for the 2560 (picked out of a hat) starts here https://ww1.microchip.com/downloads...40-1280-1281-2560-2561_datasheet.pdf#page=268

This has a selecable 2.56 and 1.1V absolute reference and an external reference. The internal refereneces can't be used if the external one is.

Page 277 states:

An n-bit single-ended ADC converts a voltage linearly between GND and VREF in 2n steps (LSBs). The lowest codeis read as 0, and the highest code is read as 2n-1

Page 280

View attachment 226713

I was a little misled. I don't know if Vref is connected to Vcc and I need to look at the schematics for that.
This basically says if you have a 5V reference, you can't read 5V.

1023 does not = ( 5 * 1024)/5

1023 = (Vin * 1024) /5; 5*1023 = Vin * 1024; so Vin = 5*(1023/1024)
So, the max voltage you can read is: 4.995

I don;t know what this means yet.
the processor that i use is Atmega2560(Mega25600)
 

Thread Starter

28sya

Joined Jun 13, 2020
20
hi 28,
Running your Arduino code , I get this plot.
It is varying because I need to attach a pot to the Analog pin. [ later ]

E
Can i know which port did you use to give the pressure? which port should i give pressure to get the data because if i give pressure at Port 1 the pressure became low & if pressure at Port2 the pressure became high
 

ericgibbs

Joined Jan 29, 2010
18,869
hi 28,
I have already said what I am using to simulate that sensor.

I have a10K variable resistor connected from +5v to 0V and the wiper to AN0.
By varying the potentiometer I can simulate your pressure sensor, using your Arduino Sketch.


I do not have a sensor on the test bench.

Please answer my questions else it is not possible to help you.

1. Are the Arduino and sensor powered from the same supply.?
2. What is the supply voltage?
3. What is the sensor pressure range that you are using for the test.?
4. Over what pressure range will the sensor be used in the final project.?

E
 
Top