Pressure Transducer inversely proportional readings ??

ivanabela

New Member
Hello,

I am trying to build a water tank level indicator using an MPX2010DP pressure sensor as per silicon chip schematic below.

http://archive.siliconchip.com.au/cms/gallery/article.html?a=109529&i=6

Using readadc10 on an 08M2 I can read something from the pressure sensor. However the number returned decreases when I increase the pressure on the MPX2010DP. Is this normal ? Shouldn't the value returned increase proportionally to the pressure applied ?

I have not quite grasped the theory of op-omps yet so if there is a problem in the op-amp circuit, I just copied it like a duck.

Any help would be appreciated.
 

srnet

Senior Member
Is this relevant, from the datasheet;

Voltage Output versus Applied Differential Pressure

The output voltage of the differential or gauge sensor
increases with increasing pressure applied to the pressure
side (P1) relative to the vacuum side (P2). Similarly, output
voltage increases as increasing vacuum is applied to the
vacuum side (P2) relative to the pressure side (P1).
 

ivanabela

New Member
The datasheet confirms that the voltage output should be proportional to the pressure applied. But my readadc10 value is decreasing. My opamp circuit is exactly as shown in the schematic. I am powering everything from 5v regulated. Power to pressure sensor through pin c.1, readadc10 at c.2.
 

ivanabela

New Member
Swap the pipes round ; it's a differential sensor.
Tried already. Nothing happens. Although it wouldn't make any sense because there are two pipes just for reference. Pressure on one pipe is referenced against the pressure on the other pipe to detect an increase or decrease in pressure. My problem is that I am increasing the pressure but the readadc10 value decreases.
 

Buzby

Senior Member
Looking at the diagram in post #1, it shows port P1 connects to the pressure to be measured, i.e the water head, and port P2 should be open to the air.

Is this how you have the pipework configured ?
 

ivanabela

New Member
Yes buzby. Could it be some wrong connections on the opamp ? I have no idea how opamps work so can't troubleshoot that part :(
 

SAborn

Senior Member
Try swapping pin 2 and 4 of the pressure sensor around as that should make the opamp work the other way, you wont hurt anything by trying it.

With the ADC reading backwards what is your ADC reading when there is no pressure applied to the sensor? as its easy enough to flip the ADC reading around in program to show a positive reading for positive pressure.
 

SAborn

Senior Member
well just take the ADC reading and invert it so it counts up and not down.

1023 - ADC reading = inverted ADC.

Readadc10, c.1, w0
w0 = 1023 - w0
 

Bill.b

Senior Member
this is one i built using the same transducer with modified silicon chip circuit.

tanklevel.jpg

Code:
'program  Water Tank Level indication
'picaxe 18x
'7th June 2010   WB.


symbol Pressure  = b0
symbol counter = b1


main:
	readadc 1,pressure
	

	if pressure<52 then  empty 	'tank empty
	if pressure<62 then tenpct	'tank at 10%
	if pressure<72 then twentypct 	'tank at 20%
	if pressure<82 then thirtypct		'tank at 30%
	if pressure<92 then fourtypct		'tank at 40%
	if pressure<102 then fiftypct		'tank at 50%
	if pressure<112 then sixtypct		'tank at 60%
	if pressure<122 then seventypct	'tank at 70%
	if pressure<132 then eightypct	'tank at 80%
	if pressure<142 then nintypct		'tank at 90%
	if pressure<152 then onehpct		'tank at 100%
	if pressure=>152 then full		'tank overflowing
	goto main
	
tenpct:
	for counter=1 to 100
		pins = %00111110
		pins = %01011111
	next counter
	goto main
twentypct:
	for counter=1 to 100
		pins = %00111100
		pins = %01011111
	next counter
	goto main
	
thirtypct:
	for counter=1 to 100
		pins = %00111000
		pins = %01011111
	next counter
	goto main
fourtypct:
	for counter=1 to 100
		pins = %00110000
		pins = %01011111
	next counter
	goto main
	
fiftypct:
	for counter=1 to 100
		pins = %00100000
		pins = %01011111
	next counter
	goto main
sixtypct:
	for counter=1 to 100
		pins = %00100000
		pins = %01011110
	next counter
	goto main
seventypct:
	for counter=1 to 100
		pins = %00100000
		pins = %01011100
	next counter
	goto main
eightypct:
	for counter=1 to 100
		pins = %00100000
		pins = %01011000
	next counter
	goto main
nintypct:
	for counter=1 to 100
		pins = %00100000
		pins = %01010000
	next counter
	goto main
onehpct:
	for counter=1 to 100
		pins = %00100000
		pins = %01000000
	next counter
	goto main
full:
	for b2=1 to 20
		for counter=1 to 100
			pins = %00100000
			pins = %01000000
		next counter
		for counter=1 to 100
			pins = %00111111
			pins = %01011111
		next counter
	next b2
	goto main
empty:
	for counter=1 to 20
	let pins =%10011111
	pause 100
	let pins = %00011111
	pause 100
	next counter
	goto main
This code is a bit old, if I were to program ir now, i would use a table to set the required output patterns.

Bill
 
Last edited:

SAborn

Senior Member
Is this project being tested on a breadboard, if so you could try swapping pin 9 and 10 of IC2c around, as a opamp has a non inverting input ( + pin 10) and a inverting input ( - pin 9 ), meaning by swapping the data on the inputs should also invert the data on the output ( pin 8 ).

I have not taken much time to study the schematic, so this is just a test idea, again you wont harm anything by trying.

In theory it should change your present ADC reading of 774 to a ADC reading of 249 and increasing with positive pressure.

Opamps can the tricky animals to get your mind around when there is several in use, and why i have not spent the time to workout what the circuit is actually doing in full, but its really just the final opamp thats talking to the picaxe and would need inverting.
 

ivanabela

New Member
Thanks Bill and SAborn. It turned out that I had not connected VR3 (10K POT) to GND. I have now connected it and it works properly. Thankyou all for your help.
 
Top