Eng. Oilpresure Via GPIO
-
- Posts: 31
- Joined: Fri Oct 14, 2011 7:25 am
- Location: Utah
Eng. Oilpresure Via GPIO
to monitor the eng. oil pressure. I set up EGT4 as a resistance sensing circuit and changed the
gauge and datalog settings, it works but it idles @ 325 psi I looked through 2111 to find the ADC
math its hard to read so i looked at 2110 I didn't see where i can change the value from 500 to 100 psi
I've looked at MS2EXTRA (Add a gauge) for a reference. Do I need to "add a gauge"? If some one has done something like this I'd appreciate the help. * [ program challenged! ]
-
- Posts: 1696
- Joined: Fri Apr 04, 2008 1:28 pm
Re: Eng. Oilpresure Via GPIO
(http://www.msgpio.com/manuals/egt.htm)
There are a number of considerations:
- if you are using the sensor as one leg of a voltage divider, then you need to consider what the resulting voltage signal is. If the pull-up "bias" resistor is Rb (Rc in the diagram, R85 for EGT4), and the sensor resistance at a given time is Rs, then with supply voltage Vs (Vref in the diagram), the voltage signal V to the CPU is:
V = Vs*Rs/(Rb + Rs)
If the supply voltage is more than 5 Volts, then you have to make sure the signal voltage is never more than 5V. If the supply voltage is 5V, then you are safe.
- the signal voltage is divided into 1024 ADC counts. 0 counts is zero volts, 1023 counts is 5.00 V. So the ADC count you will get from a given voltage signal is:
ADCcount = V*1024/5
- TS gets the ADC count directly in most cases. In the INI, you can convert the ADC count to anything you like with the appropriate conversion math. For example, if the above calculation show that at 60 psi you get a signal of 2.5V, and at zero psi you get 0V, then you know:
- an ADC count of zero is zero psi
- an ADC count of 1024/2 = 512 is 60 psi
So if the relationship is linear, the conversion is OilPress = 0.117 * ADCcount
In the INI you find this in the [OutputChannels] section. There are lines like:
OilPress = scalar, U16, 21, "volts", 0.00488, 0.0
where 0.00488 is the factor you would change (0.00488 changes a 1024 ADC count to a 0-5V reading). 21 is the offset, in bytes, that the relevant value is from the start of the outpc structure (aka. the "Output Channels"). The exact line you change depends on which ADC input you used for the oil pressure sensor (if you used the linepressure input, the line has offset of 21, but if you used the line pressure input, you must set the software to return the ADC count and not the pressure).
Then under [GaugeConfigurations], you can add a gauge directly, something like this:
oil_pressure = OilPress, "Oil Pressure", "psi", 0, 100, 5, 15, 80, 90, 0, 0
The conversion is already taken care of when OilPress is returned from the controller by the equation we used above.
Lance.
-
- Posts: 1696
- Joined: Fri Apr 04, 2008 1:28 pm
Re: Eng. Oilpresure Via GPIO
http://www.msgpio.com/manuals/mshift/adccalc.html
to help with the calculation when using the ADC for 'non-standard' purposes. The calculator determines the signal voltage and ADC count, and also calculates the INI factors.
Lance.
-
- Posts: 31
- Joined: Fri Oct 14, 2011 7:25 am
- Location: Utah
Re: Eng. Oilpresure Via GPIO
I used a VDO Oil pressure sender with 15-180 ohm range RC with 330ohm and RA 1000 ohm.
And used Linepressure, changing its value from 1.00 to 0.16 this give me 50psi @ 50psi
at an idle.This makes me
I'm so impressed I think i'll do the same thing with fuel pressure.
The calculator is way cool!