PDA

View Full Version : MPX4115A to 16F87X and LCD (Novice level)



pt3rg
- 21st December 2003, 09:37
I'm trying to display the atmospheric pressure value on a 44780 LCD.

The Motorola MPX4115A pressure sensor is connected to pin2 (RA0/AN0) to make use of the built-in ADC of the 16F87X.

Is there anyone who can show me how to write the code to perform this operation?

MPX4115A voltage output:
Vout = Vs*(0.009*P - 0.095) P = Pressure in kPa
Vs = 5V


Thank you very much.

pt3rg.

Darrel Taylor
- 21st December 2003, 20:18
Vout = Vs*(0.009*P - 0.095)
--------------------------------------

Decimals can be easy to work with by just scaling up and then dividing down. For 3 decimal places, multiply times 1000.

Now the formula looks like this.

Vout = 5 * (9 * P - 95) ' result is * 1000


So, for 1 atmosphere ~ 101 kPa

5 * (9 * 101 - 95) = 4070

4.070 Vdc


HTH,
Darrel Taylor

iw2fvo
- 15th May 2009, 08:23
Thanks for the help.
Regards,
Ambrogio