Reading oil temp from a thermistor

pjrebordao

Senior Member
I'm building a petrol pressure controller for one of my cars and one of the inputs will be the engine temperature.
As the engine already has an oil temperature sensor (in the form of a thermistor), I would like to use it an input... but I need some help.

The existing circuit is like this:

Ground------>Thermistor------->Temp gauge------->12V

I'm thinking of connecting somewhere between the Thermistor and the gauge to an ADC input of a 18M2.
But how to convert the signal suitably ?
 

westaust55

Moderator
The use of thermistors for temperature measurement has been discussed frequently on this forum.
Try a search for circuits and code with "thermistor" as a search term.

I suggest that you will need to replace the term gauge in your circuit with a resistor and then tap off between the resistor and thermistor as the signal to the PICAXE ADC input.
Resistor selection will need to ensure that the ADC signal does not exceed 5 Volts when vehicle voltage is at a max (typically 14.2V when engine running and alternator working but peaks could be higher still).


EDIT:

Here is one older but useful thread about thermistors:
http://www.picaxeforum.co.uk/showthread.php?4457-resistance-to-adc-value

some thermistor related threads others here:
http://www.picaxeforum.co.uk/showthread.php?17342-Resistor-on-thermistor-question
http://www.picaxeforum.co.uk/showthread.php?17913-Precision-Temp-Readings-with-a-Thermistor
http://www.picaxeforum.co.uk/showthread.php?14378-Thermistor-value-K
 
Last edited:

sghioto

Senior Member
I would try connecting directly across the thermistor since one side is grounded. If the value exceeds 5 volts then use a resistor divider to adjust as needed.

Steve G
 

nerdegutta

Senior Member
What type of termistor is it?

Do you think it's linear?

Maybe a better approach would be to use a LM34 or LM35? These are linear, if I remember correct.

- nerdegutta
 

SAborn

Senior Member
The problem i see is as Westy pointed out, with the supply voltage not being stable (12-15v) as this will effect the output readings, it would be far better to have a different oil temp thermister from the gauge sensor and use it between ground and 5 volt (picaxe supply voltage) as then the 5v+ will be a stable reference.

I would not use it as Sghioto had suggested as during a high resistance the picaxe pin will be subjected to 12++ volts, and as Westy has said it needs to be used in a voltage divider configuration where the sensor makes up the low side resistor, if it is used between ground and 12v.

It would be worth taking some resistance measurements of the thermistor cold and again once the engine was hot, to know what working range the sensor operates between.
 

pjrebordao

Senior Member
I would prefer to use the existing sensor, as installing another would involve changes to the "plumbing" or engine block, which are a bit more troublesome...
I really don't need the reading to be absolutely stable as I will add some software damping on the code. The function of this controller is merely during the warm-up phase only.
After reaching a normal operating temperature (85-90C), the pressure setting should remain constant.
I will start by doing some measurements of the resistance. When cold I already know it to be about 110ohm. Tonight, I will check when warm.

I'm actually building version 2 of an earlier controller that you can see here http://www.picaxeforum.co.uk/showthread.php?18768-Bringing-a-70-s-car-into-the-21st-century
The first one worked but the stepper didn't had a resolution fine enough and I was taking the temperature from engine block, instead of the oil, thus there was some thermal "inertia" before the temperature rise really showed up.
 

matherp

Senior Member
If you divide down the system voltage and then use this as the positive ADC reference voltage to the picaxe this will make the thermistor readings stable with respect to changes in the system voltage.
 

SAborn

Senior Member
If you divide down the system voltage and then use this as the positive ADC reference voltage to the picaxe this will make the thermistor readings stable with respect to changes in the system voltage.
How can this be? all you will be doing is changing the resolution of the error and not removing the error.

After reaching a normal operating temperature (85-90C), the pressure setting should remain constant.
We seem to have changed from temperature readings to pressure readings here.
 

matherp

Senior Member
SAborn

By using the system voltage as the ADC reference you are making the thermistor reading ratiometric thus:

Assume: System voltage = 15, thermistor = 50ohm and fixed resistor= 200ohm. Therefore voltage across thermistor= 3V
if system voltage = 12.5V then voltage across thermistor = 2.5V

However, lets use system voltage/3 as the ADC positive reference to the picaxe which has a fixed 5V supply.

In the case of system voltage = 15, positive reference =5V therefore ADC reading = 3/5*1024=614
In the case of system voltage = 12.5, positive reference = 4.166667, therefore ADC reading is 2.5/4.166667 * 1024 = 614 - MAGIC!
 

hippy

Technical Support
Staff member
If you divide down the system voltage and then use this as the positive ADC reference voltage to the picaxe this will make the thermistor readings stable with respect to changes in the system voltage.
How can this be? all you will be doing is changing the resolution of the error and not removing the error.
That should work; as the vehicle supply changes the sensor voltage will change proportionally, hence the ADC reading with respect to Vref should remain constant no matter what Vref is.
 

rossko57

Senior Member
The sensors and gauges on cars are generally run from a regulated supply anyways. On an older vehicle this might take the form of a square wave that averages 9V - that's a nasty potential trap for you. On most post-1990 cars it'll probably be a 5V supply for a factory fitted item. Get your meter out and see what's what before inventing complicated references. Worth checking what's on the wires with the sensor unplugged too.
 

pjrebordao

Senior Member
The sensors and gauges on cars are generally run from a regulated supply anyways. On an older vehicle this might take the form of a square wave that averages 9V - that's a nasty potential trap for you. On most post-1990 cars it'll probably be a 5V supply for a factory fitted item. Get your meter out and see what's what before inventing complicated references. Worth checking what's on the wires with the sensor unplugged too.
This is a 73 car, no regulation whatsoever, apart from the alternator VR.
 

MartinM57

Moderator
My 1971 (British) car has a crude 10v square wave regulator for instruments that work just like this - there is so much damping in the gauge that it doesn't notice the square waves (but it's interesting that the average voltage is 5v, not 10)

If there wasn't one, the gauge readings would change with Vbat. Even in 1971 they had that sorted out. You sure you don't have any instrument regulation?
 

rossko57

Senior Member
Instrument regulation was the norm in the 1940s ...
You really are playing your cards close to your chest here ;)
 

MFB

Senior Member
The AD590 2-wire analog output temperature sensor can operate directly from an unregulated supply, because its a constant (well, apart from temperature change) current device. For the same reason it can be operated with high noise immunity over unscreened cable. I have used this Analog Devices sensor successfully on F1, rally and touring cars.
 

pjrebordao

Senior Member
Had a good look at the circuit diagram and couldn't find any regulator for the instruments.
Could it be that the instruments damping is enough ?

However in the diagram for my old rover 3500s there is a 10v reg indeed.

Different philosophies ?
 
Last edited:

g6ejd

Senior Member
Does the present guage move around a lot, I suspect not, in which case for what your measuring, placing the PICAXE across the current thermistor should be fine. I recommend you check the voltage across the device to see what typical values your dealing with and then as others have suggested, divide the voltage down if necessary with a couple of resistors.

The good thing about using a microcontroller/Picaxe, is you can adjust the readings in software to compensate for non-linear responses, which can only make for a better install.
 

rossko57

Senior Member
The gauge head may include an internal regulator. You're the only one who knows what car, factory or aftermarket gauge, etc. so no-one else can find out for you.
Have a meter around and find out what you are dealing with.
 

pjrebordao

Senior Member
Easy...

Car is a 73 Porsche 911, sensor is a VDO with no visible part number. I doubt it has an internal regulator, all the other sensors should have one too, then.

When cold, resistance across it is 110ohm, tension across is 5.7 V
At operating temp, resistance is 70ohm, tension around 3.5 V

So, I'll do some calculations and add some resistors.
 

rossko57

Senior Member
Did you check for an AC component? It is unlikely

Did you check the voltage with the sensor unplugged? You must design your circuit to withstand at least that too, in case of oops or fault. It'd be smart to make it withstand at least 15V in an automotive environment anyways. But if knew what sensor-open looked like (you can guess sensor-short is 0V), you could write your code to behave sensibly in the event of a fault and/or flash lights. Otherwise you might have a non-starter.

Most standalone gauges use internal movement compensation by cunning windings rather than actual output regulation. That means the needle will give a steady reading even with supply voltage variations ... but the important thing for you is that the sensor voltage will vary with supply.
If you measure a different voltage with the engine running and immediately after stopping it, it means the sensor wire is unregulated and you would need the supply reference suggested earlier.
 
Top