Reading ECU Sensor in parallel without disturbing

cloudy

Member
I'm trying to measure a thermistor coolant sensor, which is fed from a 5V line (with a 2k pulldown in the ECU) with a PICAXE 40X2
I don't want to disturb the voltage reading of the sensor that the ECU sees (which varies from 145ohms to 2.45k, hence 2.247V-4.662V).

I presume I need to scale that 0-5V to 0-3.3V for adc10 but a divider would change the pulldown resistance for the ECU, disturbing the ECU's divider?

Any ideas?

circuit.png


Thanks!
James
 

eggdweather

Senior Member
You need to isolate the ADC from the sensor circuit, usually by using an op-amp:
LM324.png
and adjust R3/R4 for a gain of 0.66 to give your required 0-5 to 0-3.3 range. That way there will be negligible load on the circuit to be measured.
 

rossko57

Senior Member
The proper way to do it is with a buffer amplifier, an op-amp.

However you could use a simple divider with a high value (say 100K total resistance) and have negligible effect on the original circuit.
You don't need to track or read the slow changing reading very often, so a modest capacitor on the divider output will help reduce the effective impedance the Picaxe ADC sees.
You should always assume "12V" (in real life up to 15V) might appear on any automotive connection, be sure to protect the Picaxe - a simple diode from divider junction to Picaxe supply rail should do it. Might as well add the complementary diode from 0v to junction to cover negative spikes.
 

AllyCat

Senior Member
Hi,

It depends what resolution you (think you) need, but if the PICAXE is operating from the same 5 volt rail (and the ADC reference is the default Vdd) then just read the thermistor voltage "directly" and use maths: ;)

For example, subtract 2.247 * 1024 / 5 (ie = 460) from the READADC10 value and multiply by a suitable scaling factor. But presumably you'll need a lookup table for the temperature / resistance conversion anyway, so the offset and scaling could be incorporated into the table?

However, as said above, an automobile application is very "hazardous", so you do need (at least) a resistor of a few kohms between the thermistor and the ADC input, probably some nanoFarads from the ADC input to ground, perhaps diodes to Vdd and Vss and of course decoupling on the PICAXE supply rail.

Cheers, Alan.
 

cloudy

Member
Alas, the picaxe is running on 3.3V hence the ADC ref also at 3.3, I think i'll try the quick and dirty high value divider as accuracy isn't paramount for this...

As always, suitable protection on the pin as above! ;)

Thanks for the helpful advice as always
 

AllyCat

Senior Member
Hi,

Presumably the 5 volt rail is (also) stabilised? If not, you should (also) measure that voltage, via a similar divider, and compensate accordingly.

The (PIC) data sheet specifies that the source resistance for the ADC inputs should not exceed 10 kohms, but may be an (unspecified) higher value if a capacitor is connected from the pin to ground. Note that even a 220k divider chain will alter the 2k2 resistance by 1%, whilst a READADC10 can resolve to 0.1% !

So personally, I would use a potential didvider of about 1 / 6, e.g. perhaps 180k + 36k (or 33k would be near enough). Still use READADC10 but the result will then always fit into a single byte, making the temperature calculation / lookup easier.

As for converting the (very) non-linear NTC Thermistor resistance into a "useful" temperature value, I've reecently been considering starting a thread on that myself. ;)

Cheers, Alan.
 

eggdweather

Senior Member
As for converting the (very) non-linear NTC Thermistor resistance into a "useful" temperature value, I've reecently been considering starting a thread on that myself.
The DHT11 and DHT22 devices seem to do that - convert a cheap NTC into a reasonably accurate device - by knowing the basic NTC curve and software (microchip) then corrects the errors, it would make an interesting project as it would entail quite a few disciplines, production spread/tolerances of NTC, ability to linearize (an American term) the NTC and assign a best fit equation concepts that come to mind.
 

AllyCat

Senior Member
Hi,

Yes, virtually every low cost commercial electronic thermometer or "weather station" uses a (NTC) thermistor, probably employing a simple lookup table. But recently I was attempting something similar to the OP, i.e. "reverse engineering" an existing thermistor sensor, and was surprised by the lack of information on the PICaxe forum (noting that Rev. Ed. do sell at least one thermistor). I could find only two descriptions by Peter Adamson, but these have a rather limited temperature range, only around 10 or 20 degrees. Also a table lookup/interpolation routine by Jeremy Leach (for ATAN rather than an NTC as such) but this used nearly all of the named variables in an M2. :(

Of course the main reason is that an 18B20 temperature sensor is far more accurate and easier to use with a PICAXE in any "new" project. Or perhaps one of the Microchip "linear thermistor"s for lower cost. But, in addition to the Reverse Engineering aspect, a "classic" NTC thermistor is still potentially up to ten times cheaper, smaller, faster and has other advantages over an 18B20, so I (and maybe the OP) would be interested to hear if anybody does have a link to other suitable (PICAXEable) application details.

Cheers, Alan.
 

neiltechspec

Senior Member
My vote goes to 18B20s, so easy to use & more than accurate enough for my needs. Used quite a few with picaxe.

Even four in my 1972 Classic Car,
Outside Temp Sensor / Display
PWM Cooling Fan Controller
Cylinder Head Temp monitoring on the V8, 2 heads (Triumph Stag Paranoia !!)

Neil.
 

PhilHornby

Senior Member
I'm trying to measure a thermistor coolant sensor, which is fed from a 5V line (with a 2k pulldown in the ECU) ...
Any ideas?
If this is an EOBD compliant ECU in a modern road car, you could use an ELM327 to ask the ECU for the value. Last time I needed to do something like this, I bought a cheap ELM327(pirate!)-based product like this, and removed the USB-Serial interface from its PCB.
 
Last edited:

cloudy

Member
I have an external android app doing the ADC reading > temp conversion

thanks the voltage divider works fine with a small cap on the pin side, and doesn't affect original ECU signal

James
 
Top