I've got a new MPX5100DP, which I connected to an Arduino, as follows:
pin 1: Vout to A0 on Arduino (analog in)
pin 2: ground on Arduino ground
pin 3: Vcc on Arduino 5V
This simple code:
#define MPX5100_PIN A0 | // MPX5100DP sensor pin |
void setup() {
pinMode(MPX5100_PIN, INPUT);
Serial.begin(9600);
}
void loop() {
unsigned int pressureSensorValue;
pressureSensorValue = analogRead(MPX5100_PIN);
Serial.print("Pressure value.....: ");
Serial.println(pressureSensorValue);
delay(2000);
}
... does not produce any other value than 1017.
How can I check, whether this sensor is actually functioning?
Solved! Go to Solution.
Hi Max,
Yes, as Anthony suggested, try to force some air into P1, e.g. using your mouth and see if the voltage goes up. Also check the output voltage when no pressure is applied, it should produce about 0.2V (0.088V - 0.313V).
Regards,
Tomas
Yes, hardware or software :smileyhappy:
Thank you guys! I put a poti on the same analogue input and it worked; assuming the sensor is dead... and ordered a new one.
I had an air pump connected to either port and nothing changed on the analogue port.
What a great idea to use a Volt meter (embarrassed)... and guess what? ... it works! 185mV.
One port the voltage goes down, the other it goes up.
Which one is the port I should use as in put wanting to measure a water level (via tube dangling in water tank)? -- The one where the voltage goes up?!
I am lost for words, or rather an explanation... wired it up and ran the sketch... it works as it should... :-S
Hi Max,
Glad to hear our suggestions have been helpful.
Yes, use the P1 port and leave the P2 port open, since the MPX5100DP is designed to be used under P1>P2 condition.
Regards,
Tomas
Hi Max,
It an be a software problem or a sensor issue. I suggest you to use a voltmeter to measure the MPX5100 outout voltage. You can blow/draw into the sensor and check if the voltage has changed.
Anthony
Hi Max,
Yes, as Anthony suggested, try to force some air into P1, e.g. using your mouth and see if the voltage goes up. Also check the output voltage when no pressure is applied, it should produce about 0.2V (0.088V - 0.313V).
Regards,
Tomas