PDA

View Full Version : Simple Math



brenda
- 16th August 2005, 18:04
Hi,

I am playing with a pressure transducer. It has a capacity of 0 to 2.5 bar. the output is 0 to 5vdc proportional to the pressure.

Here is what I get using RA0 of 16f877.

At no load.... somewhere around 1.095vdc
With max load (1.5Bar) .... 2.4985vdc

Here is the question:

How can i convert it to percentage.
1v = O% and 2.5v=100%

Thanks!
Brenda

SuB-ZeRo
- 16th August 2005, 18:41
1v =1000 mv
2.5 v =2500 mv
2500 -1000=1500
1500 /100 =%1
i hope it will work :)

CocaColaKid
- 16th August 2005, 18:48
Off topic slightly but I have a silly question, I thought at 2.5 bar it should output 5V, not 2.5V? Either way the math still works.

brenda
- 17th August 2005, 17:47
hi,
many many thanks

brenda