I have coupled it to my arduino. It is to measure the water pressure in a model submarine. I have connected it with the following code and find that it starts at ‘5’ and only reacts when the pressure is negative. (Ie I suck on the tube..) I want the sensor to sense positive pressure when the boat dives, and know that this is the sensor used in other depth keeping devices so am I missing something? How can I measure positive pressure? Is this a mechanical issue?
// Flexiforce quick start example
// Reads A0 every 100ms and sends voltage value over serial
void setup()
{
// Start serial at 9600 baud
Serial.begin(9600);
}
void loop()
{
// Read the input on analog pin 0:
int sensorValue = analogRead(A0);
// Convert the analog reading (which goes from 0 - 1023) to a voltage (0 - 5V):
float voltage = sensorValue * (5.0 / 1023.0);
// Print out the value you read:
Serial.println(voltage);
// Wait 100 milliseconds
delay(100);
}
[code/]
Can it be that the sensor measures absolute pressure, that is vacuum equals 0V out and 100kPa equals full voltage? What output do you get for different pressures?
That would confirm that the sensor measures absolute pressure above vacuum. Normal air pressure is about 100kPa which is full scale for the sensor. As far as i can see the sensor is not suited for your needs.
OK but.. I have an old depth keeping device which was not working. The sensor in it is the same. I tried it on the breadboard and got exactly the same readings, and thought there must be something wrong with it.. so I purchased another which does exactly the same thing. There has to be a way to get this working.
You have two tubes coming out of the sensor. The sensor measures the difference in pressure between the two. If they are both exposed to an identical pressure then the output is ZERO. It doesn't matter what the pressure is.
If you plug the hole on the negative pressure port and then allow the other port to be open to the full fury of the waters pressure, it will start giving you some results.
I attach the sensor to a rubber hose, and power it up with a 6 volt source. When I read the output of the sensor on a voltmeter it sits at 4.9 (maybe 5.. might be the meter) When I suck the voltage goes down, but when I blow into the tube it rises to 5.5 volts.
This little bit between 5 and 5.5 is my measuring field for the submarine.
When I connect the sensor up to the arduino it shows 1023, when I ‘suck’ it goes down but ‘blow’ and it stays at 1023. So how can I get this to read the .5??
If you attach the tube to a sealed vessel (ie your sub) then as depth increases, the sealed vessel, by comparison to the surrounding water will decrease. So I think it's working around the right way. I suspect, however, that you have your +ve and -ve supply around the wrong way.
Bugger. I just thought 'of course' and reversed the power and it has gone to God. Never mind I have a collection of them. You are not responsible, only my desperation.
The idea of reversing the pressure dynamic is not possible but a nice idea.
I need somehow to apply code to the arduino that will allow it to measure the 5 - 5.5v. It is just stopping at 5. Maybe a resistor?
When I put a resistor in series with the sensor it drops down to, in this case, 4.5 v. Then suck and blow and all as it was. Ie it goes up to nearly 5 with +ve pressure.
Put that into the arduino and it automatically reads 4.5v as 1023. I need the reading to float somehow.
That ebay sensor (MPX2010) is different than the one you linked to in your first post (MPX5100). Neither are appropriate for what you're trying to do. The 5100 only measures up to 10kPa, 1/10 of an atmosphere. The 2010 measures to 100kPa, 1 atmosphere. Underwater the pressure goes up by an atmosphere every 30 feet or so. To be able to measure the pressure down to, say, 200 feet you'll need a gauge that measures to at least 600kPa. This one, MPX5700, would do that.
It's interesting that you could move it to 3 and 5.5 volts manually. If you have the MPX2010 that would imply you suck and blow to the tune of about 6psi and 1.5psi respectively.
I have finally received the right sensor. It is MPXV7007G! It works perfectly. At 1 bar it sits at 511. Sucking it goes down and as if by magic, and four unusable sensors later, it goes up. Surface pressure is 570-511, and periscope depth is about 670.
I got this by emailing a sensor company and finally someone talked to me. Told them the problem and oila.
So it's onward and upward now. Would anyone like to buy some sensors?