Hi everyone, I want to prove the MPX4115 pressure sensor in arduino but first I have to simulate the project, I’m using Proteus. I find a programe like this:
#define kpa2atm 0.00986923267
int pressurePin = 0;
int val = analogRead(pressurePin); // read the rawADC value.
float voltage = (float) val / 1023.0 * 5.0; // voltage at the input pin
// according to the datasheet:
// the minimal voltage is 0.135 at 15kPa.
// the maximum voltage is 4.863 at 115kPa
// the full span is 4.590
// and is 45.9mV per kPa
float kPa = ((voltage - 0.135) / 0.0459) + 15;
// convert kPa to atm
float Atm = kpa2atm * kPa;
I want to modify the program for my own, but first I neet to understand how it works because I don’t have much experience but the problem is that this program doesn’t have any mistakes but in proteus I always get the same result even if I increment o decrement the values of the sensor as you can see in the images.
Can anybody help me, please? I really need help to see what is wrong here.
Thanks and regards.