Page 1 of 1

OE thermistor resistance curves

Posted: Fri May 03, 2013 10:40 pm
by timk
I've borrowed a few MX-5 sensors to try and get some accurate resistance curve data:

Image

To do the measurements I will be using two sources of temperature data. One is a DS18B20 digital thermometer with a built-in 9 bit ADC (0-511), the other being a K type thermocouple (still waiting for the amp to arrive for this):

Image

To measure the resistance from the OE temp senders, I will use a voltage divider circuit fed to an Arduino Mega with 10 bit ADC resolution (0-1023).

To begin with I am using two 1% resistors to test the voltage divider circuit.

My multimeter had the following to say:
10k reading as 10.00k
470 reading as 471

I hooked up the Arduino with a 12V power supply in addition to the USB, so results aren't skewed from voltage drop. At worst I saw a 2% error in resistance readings (probably mostly to do with ADC resolution?)

Image

Here I have the OE sensor hooked up and the DS18B20:

Image

It seems to be spitting out the right data:

Image

When the thermocouple amp arrives I'll grab data from that at the same time then log the whole range (from each sensor, so we have a good sample). I plan to use an ice bath and also boil some water, with the final step being heated oil to get above water's boiling temp. If I melt the sensors at this stage at least I'll have the rest of the data! :lol:

So this is what I've done with my Friday night, just like the rest of the cool kids!

Re: OE thermistor resistance curves

Posted: Fri May 03, 2013 10:49 pm
by NitroDann
MAD!

Sick, in for results.

Re: OE thermistor resistance curves

Posted: Fri May 10, 2013 3:20 pm
by droo
If you have an NA8, i'd be curious if you could do the air temp sensor in the airflow meter/maf or whatever it's to be called.
(also, your 470ohm resistor looks fine to be 471 ohms with 1% values on the metal type / blue resisters)

Re: OE thermistor resistance curves

Posted: Fri May 10, 2013 3:28 pm
by mrpham
Very very cool!

I have a K-type thermometer I used ages ago to take intake air temp readings, you're more than welcome to borrow if needed.

http://omgpham.com/wp-content/uploads/2011/07/IMGP4174.jpg

Re: OE thermistor resistance curves

Posted: Sun May 12, 2013 12:15 am
by Okibi
Sub'd :mrgreen:

Re: OE thermistor resistance curves

Posted: Mon May 13, 2013 10:00 am
by timk
A little update; the amp arrived for the thermocouple so I wired it up using SPI:

Image

I then put the three temp sensors in a cup of cool water as a test:

Image

I didn't expect things to be this close! :shock:

Image

I changed the known resistor value for the voltage divider to 1k to get a bit more resolution where it is needed most. As a test I replaced the Mazda thermistor with a 1k resistor and it measured bang on 1000! Great success! :D

Re: OE thermistor resistance curves

Posted: Mon May 13, 2013 12:35 pm
by gslender
Would you mind sharing the Arduino code and parts you've used, how you wired it up etc.

G

Re: OE thermistor resistance curves

Posted: Mon May 13, 2013 2:53 pm
by timk
Sure, I'll do it when I'm on the right computer and I remember! I'll be publishing all the sensor data too.

The Adaptronic uses a 12 bit ADC with points in 5 degree steps. I know the MegaSquirt uses Steinhart–Hart approximation with three known points. We should see how close we can get things with the equation, I think it will be pretty much spot on if we choose sensible points. The equation will be good for extrapolating the very cold temps too.

Re: OE thermistor resistance curves

Posted: Mon May 13, 2013 10:05 pm
by timk
gslender wrote:Would you mind sharing the Arduino code and parts you've used, how you wired it up etc.


Here's the Arduino code, I essentially just copied and pasted bits of the temperature sensor library examples and merged them, so the variable naming could be better:

Code: Select all

#include "Adafruit_MAX31855.h"
#include <OneWire.h>
#include <DallasTemperature.h>

// This is GNU licensed, b*tches.  Yes I'm talking to you B&G.

#define ONE_WIRE_BUS 2

OneWire oneWire(ONE_WIRE_BUS);

DallasTemperature sensors(&oneWire);

int thermoDO = 3;
int thermoCS = 4;
int thermoCLK = 5;

Adafruit_MAX31855 thermocouple(thermoCLK, thermoCS, thermoDO);

int aPinIn = 0; // Analogue Input on Arduino
int val = 0; // The raw analogue value
float Vout = 0.0; // Voltage at point between resistors relative to ground
float Vin = 5.0; // Vcc (5 Volts)
float Rknown = 1000.0; // The known resistor (1 kohms)
float Runknown = 0.0;
 
void setup(){
 
  Serial.begin(9600);
  delay(500);
  digitalWrite(13, HIGH);
 
  sensors.setResolution(10); // IC Default 9 bit
  sensors.begin();
 
}
 
void loop(){
 
  sensors.requestTemperatures();
  Serial.print("T1: ");
  Serial.print(sensors.getTempCByIndex(0));
  Serial.print(", ");

  Serial.print("T2: ");
  Serial.print(thermocouple.readCelsius());
  Serial.print(", ");

  Serial.print("ADC: ");
  val = analogRead(aPinIn); // Read in 10 bit ADC val (0-1023)
  Serial.print(val);
  Serial.print(", ");
 
  Serial.print("R: ");
  Vout = (Vin/1024.0) * float(val); // Convert to voltage
  Runknown = Rknown*((Vin/Vout) - 1); // Calculate Runknown
  Serial.println(Runknown);

}


Analog pin 0 is the voltage divider input to measure resistance.
For the DS18B20, I use the Dallas Temperature Control Library - digital pin 2 is the OneWire data line from the DS18B20 thermistor.
For the MAX31855, I use the Adafruit MAX31855 Library - digital pins 3,4,5 are the SPI (DO, CS, CLK) lines to the MAX31855 thermocouple amp.

Cheers

Re: OE thermistor resistance curves

Posted: Mon May 13, 2013 11:16 pm
by gslender
Thanks Tim

Re: OE thermistor resistance curves

Posted: Tue May 14, 2013 10:09 am
by timk
droo wrote:If you have an NA8, i'd be curious if you could do the air temp sensor in the airflow meter/maf or whatever it's to be called.


Sorry I missed this question, I think you would pretty much have to pull one apart to do it properly. If you have a sacrificial one I can do it for you.

Cheers

Re: OE thermistor resistance curves

Posted: Wed May 15, 2013 10:42 am
by droo
I have 3, one has been sacrificed, i'll find the pin-out for you and PM it. Of the other two, one is stock and one has been modified, i change between the two every few weeks to do my own comparisons with inlet setups i've been experimenting with.

From my own checks, its a thermistor of some sort, which has a very VERY slow reaction time as it's moulded in a black plastic spine in the AFM (the spine with the little nobby nipple), and as the AFM gets pretty warm from various sources of heatsoak, i'm wondering if it's a sensor that's used as a one off or sparse periodic readings (maybe for IA Control?)