Deconstructing the Sure Temperature Sensor

Technical questions and answers about the Mazda Bongo

Moderators: Doone, westonwarrior

User avatar
Driver+Passengers
Supreme Being
Posts: 2019
Joined: Mon Mar 14, 2011 1:56 pm
Location: Fife

Re: Deconstructing the Sure Temperature Sensor

Post by Driver+Passengers » Sat Sep 24, 2011 9:39 pm

I'd noted down last night the addresses at which the table was being entered. It was of the order 10 times per sample, and I have just spotted a pattern just now...

Image
Furthermore, the range of values stored in the lookup table is 55-921, which corresponds pretty well with the values I obtained experimentally (in the simulator) for the limits of operating temperature on the pin (0.27V=55, 4.48V=916).

So the lookup table contains values that would be seen from the ADC result (10 bit = 0-1024), and the table is sampled several times in order to 'home in'. I reckon it's a reverse lookup table, the index being related to the temperature. In fact, if there are 150-odd entries, that's -25 to 0 to +125, no?
Image Image
What she doesn't know won't hurt me.
User avatar
Rhinoman
Bongolier
Posts: 330
Joined: Mon Jan 11, 2010 7:45 pm
Location: Brinkworth, Wilts
Contact:

Re: Deconstructing the Sure Temperature Sensor

Post by Rhinoman » Sat Sep 24, 2011 11:44 pm

I'm now sure that that is the temperature look up table. I looked back on some old work I did a few years ago, I characterised the temperature sensors on a Vitara ECU, when you determine the voltage you get a graph that looks very similar to that and if you were to combine the two you'd get a straight line. The pic is too big to upload but I'm sure that you get the idea.
If you're thinking of using different sensors then you need to note that the pull up resistor is carefully selected to put the operating temperature range on the most linear area of the curve for best accuracy.
1995 Ford Freda, 2.5TD, auto, AFT, side conversion.
User avatar
Driver+Passengers
Supreme Being
Posts: 2019
Joined: Mon Mar 14, 2011 1:56 pm
Location: Fife

Re: Deconstructing the Sure Temperature Sensor

Post by Driver+Passengers » Sat Sep 24, 2011 11:47 pm

Right on! Working backwards (pull up of 10K, supply 5V) gives 10K@25C...

Image

...which looks broadly right to me.
Image Image
What she doesn't know won't hurt me.
User avatar
Rhinoman
Bongolier
Posts: 330
Joined: Mon Jan 11, 2010 7:45 pm
Location: Brinkworth, Wilts
Contact:

Re: Deconstructing the Sure Temperature Sensor

Post by Rhinoman » Sat Sep 24, 2011 11:47 pm

I resized it so you can see what I mean:

Image
1995 Ford Freda, 2.5TD, auto, AFT, side conversion.
User avatar
Rhinoman
Bongolier
Posts: 330
Joined: Mon Jan 11, 2010 7:45 pm
Location: Brinkworth, Wilts
Contact:

Re: Deconstructing the Sure Temperature Sensor

Post by Rhinoman » Sat Sep 24, 2011 11:48 pm

Snap, lol. The resistances are different but the shape matches.
1995 Ford Freda, 2.5TD, auto, AFT, side conversion.
User avatar
Driver+Passengers
Supreme Being
Posts: 2019
Joined: Mon Mar 14, 2011 1:56 pm
Location: Fife

Re: Deconstructing the Sure Temperature Sensor

Post by Driver+Passengers » Sun Sep 25, 2011 12:03 am

Seems like a daft way round to do it to me! Still - that's that solved.

Next steps:
[*] find the exit point of that search routine and I've got the final temp value;
[*] trip the output pin over some threshold;
[*] add a momentary switch the spare input pin (RA3/pin4).
Image Image
What she doesn't know won't hurt me.
User avatar
Driver+Passengers
Supreme Being
Posts: 2019
Joined: Mon Mar 14, 2011 1:56 pm
Location: Fife

Re: Deconstructing the Sure Temperature Sensor

Post by Driver+Passengers » Sun Sep 25, 2011 11:01 am

Thoughts on calibration...

Assuming that different readings are due to the accuracy of the 10K thermistors across the operating range, it would be possible to modify the lookup table for a given thermistor, though not without manual effort. As both channels use the same lookup table, it's quite possible that you'll not get both sensors reading the same.

Another option might be to half the size of the table (say 25-100 degC) and, like the original temp gauge, it wouldn't 'move' until up to temperature. That would leave space for 2 lookup tables, one per channel. You'd then match the lookup table values to your sensor.

But to do this reliably, would require obtaining a value for every degC between 25-100, and repeat this for each sensor. Sounds like too much work.

Not sure there's anything easy to be done, here. Eventually, I'd like to get 1-wire master code in there to get the DS18B20s working. You'd then be at the mercy of the DS18B20's own accuracy - perhaps no better than the NTCs at our 80-100 operating range?

Haven't though of anything simple yet.

It might be possible to put the sensors in boiling water and press the (new) microswitch for some period to cause some value to be written to EEPROM, read it every time on startup, and then apply some offset function to the values in the table when determining the reading to display.

All this said, it's probably too much effort and we'll likely be fine living with up to a few degrees difference between two sensors.
Image Image
What she doesn't know won't hurt me.
User avatar
Rhinoman
Bongolier
Posts: 330
Joined: Mon Jan 11, 2010 7:45 pm
Location: Brinkworth, Wilts
Contact:

Re: Deconstructing the Sure Temperature Sensor

Post by Rhinoman » Sun Sep 25, 2011 9:56 pm

if you look at your graph then the linear region is between something like 0 and 50 degrees, about what you'd expect for a room temperature/outdoor thermometer. As I mentioned before if you alter the value of the pull up resistor you can move the linear region to improve accuracy over a given range. I used to have a hacked about spreadsheet to do this, I will look and see what I've got.
1995 Ford Freda, 2.5TD, auto, AFT, side conversion.
User avatar
Rhinoman
Bongolier
Posts: 330
Joined: Mon Jan 11, 2010 7:45 pm
Location: Brinkworth, Wilts
Contact:

Re: Deconstructing the Sure Temperature Sensor

Post by Rhinoman » Sun Sep 25, 2011 10:02 pm

1995 Ford Freda, 2.5TD, auto, AFT, side conversion.
tallbongo
Bongolier
Posts: 396
Joined: Sat Jul 31, 2010 5:40 pm
Location: Central Scotland

Re: Deconstructing the Sure Temperature Sensor

Post by tallbongo » Mon Sep 26, 2011 10:11 am

Driver+Passengers wrote:Thoughts on calibration...

Assuming that different readings are due to the accuracy of the 10K thermistors across the operating range, it would be possible to modify the lookup table for a given thermistor, though not without manual effort. As both channels use the same lookup table, it's quite possible that you'll not get both sensors reading the same.

Another option might be to half the size of the table (say 25-100 degC) and, like the original temp gauge, it wouldn't 'move' until up to temperature. That would leave space for 2 lookup tables, one per channel. You'd then match the lookup table values to your sensor.

But to do this reliably, would require obtaining a value for every degC between 25-100, and repeat this for each sensor. Sounds like too much work.

Not sure there's anything easy to be done, here. Eventually, I'd like to get 1-wire master code in there to get the DS18B20s working. You'd then be at the mercy of the DS18B20's own accuracy - perhaps no better than the NTCs at our 80-100 operating range?

Haven't though of anything simple yet.

It might be possible to put the sensors in boiling water and press the (new) microswitch for some period to cause some value to be written to EEPROM, read it every time on startup, and then apply some offset function to the values in the table when determining the reading to display.

All this said, it's probably too much effort and we'll likely be fine living with up to a few degrees difference between two sensors.
Due to the non-linearity there doesn't appear to be any easy fix across the whole range. Even if you do manage to implement something like your push button at 100 deg C method, you won't know whether it's the B-value or the resistance that's out on the thermistor (assuming it is the thermistor).

I know you will want to avoid pots with such a nice integrated unit, but it may be easier to just add one that can be adjusted to match the thermistors at the critical temp, i.e. around 100 deg and hope that the first order approximation holds over a wide enough range to be useful. Of course doing this won't fix any offset at ambient temps, but the difference should decrease as it moves into normal operating temps.
95 N Reg 4WD Manual AFT Bongo

Image Image
User avatar
Driver+Passengers
Supreme Being
Posts: 2019
Joined: Mon Mar 14, 2011 1:56 pm
Location: Fife

Re: Deconstructing the Sure Temperature Sensor

Post by Driver+Passengers » Mon Sep 26, 2011 12:05 pm

tallbongo wrote:Due to the non-linearity there doesn't appear to be any easy fix across the whole range. Even if you do manage to implement something like your push button at 100 deg C method, you won't know whether it's the B-value or the resistance that's out on the thermistor (assuming it is the thermistor).

I know you will want to avoid pots with such a nice integrated unit, but it may be easier to just add one that can be adjusted to match the thermistors at the critical temp, i.e. around 100 deg and hope that the first order approximation holds over a wide enough range to be useful. Of course doing this won't fix any offset at ambient temps, but the difference should decrease as it moves into normal operating temps.
I agree - that's likely the most feasible compromise and perhaps what I'll work towards.

Won't be working on this for a good week, but will mull over the possibilities in the bath! ;) :lol:
Image Image
What she doesn't know won't hurt me.
bikerbob

Re: Deconstructing the Sure Temperature Sensor

Post by bikerbob » Sat Nov 12, 2011 9:17 pm

Hi, has the research com to an end :?: :?: as there has not been any input for a while,or have I missed it
User avatar
Driver+Passengers
Supreme Being
Posts: 2019
Joined: Mon Mar 14, 2011 1:56 pm
Location: Fife

Re: Deconstructing the Sure Temperature Sensor

Post by Driver+Passengers » Sat Nov 12, 2011 10:15 pm

bikerbob wrote:Hi, has the research com to an end :?: :?: as there has not been any input for a while,or have I missed it
I have had to service the van, then the car. Now I'm making wooden sledges for a craft fair.

I don't think that there is an easy solution for calibration. On your unit, there are now three wires (12V, gnd and signal) ready for the alarm buzzer. I haven't written any code to set threshold for triggering the alarm, yet. It's not come to an end, more a grinding halt. Ran out of fuel. ;)

Would you like me to send your unit back, now the firmware is upgraded (albeit without display in farenheit!!)?
Image Image
What she doesn't know won't hurt me.
bikerbob

Re: Deconstructing the Sure Temperature Sensor

Post by bikerbob » Sun Nov 13, 2011 5:10 pm

U dun gud Bro wid de progress, would like to have audible warning option for the unit so if you want to retain the unit for further testing/modification at your leisure then thats ok by me. what are your thoughts on the DS18B20 unit, would this be are more accurate display of the Temp, as both units received from Sure are crap, hopefully Sure will send a 3rd unit which will be reliable. In the event that I receive another DS18B20 unit would you like to have a faulty one to play with.
Post Reply

Return to “Techie Stuff”