I have a similar problem, I got everything to work, except translating the math.
My lowest ADVAL is 0 and it's also the HIGHEST pressure.
I saw how the math worked out for him, but I am lost.
I have a similar problem, I got everything to work, except translating the math.
My lowest ADVAL is 0 and it's also the HIGHEST pressure.
I saw how the math worked out for him, but I am lost.
AD Res 1024
Lowest voltage = .085v = 100psi = ADVal 18
Highest voltage = .999v = 10psi = ADVal 205
In order to switch everything around all I did differently was subtract my highest voltage (1volt) from lowest voltage (.085volt) and went from there!
So then I thought it out a little more, and instead of converting to voltage etc.. ADVal represents that value...
SO
highest ADVal = 205
205 - whatever the adval is at for the input from the sender = x
x * .5347 = pressure
on my 187 resolution scale here.
Dave
Always wear safety glasses while programming.
yes, its an autometer 2242 pressure sender unit. its really annoying.
all I have is
15 ohms = 100psi
175 ohms = 10psi
What I am doing right now is using regulated current. ~5mA
reason why I am not using the 8bit adc is because I would have to use a lot more current to get it up out of the 19mV range, and not really wanting to do that since it seems to vary more, its probably my hardware tho, LM317T current reg.
I think I see the problem.
The ADC is for measuing a voltage.
Use the sensor for R1 of a voltage divider and a fixed resistor for R2. The feed that output to the PIC.
http://en.wikipedia.org/wiki/Voltage_divider
Dave
Always wear safety glasses while programming.
Bookmarks