# help creating analogue temp and fuel guage

#### Bear_2759

Joined May 23, 2008
120
ok, so I went out and bought a brand new replacement temp sensor, results are as follows. resistance varied +/- 2% while testing for each reading. pressure 29.97

°C Resistance
16.5 740Ω
37 330Ω
53 161Ω
80 64Ω
99.6 34-35Ω

very similar results to previous test. I don't think I need the temp to be all that accurate, correct me if I'm wrong but I just need it to display when the car reaches its normal running temp (I have no Idea, but I will guess 80 at this time), and when it is beginning to increase past that, so say it lights up half the display at 80°C, 64Ω resistance (5 of 10 segment block for example) once it reaches 50Ω, guessing from the readings above that would be about 90 another 2 led's have lit up. if it actually reaches the 8th LED then I would like to incorporate the design on the 3914 datasheet (sorry for not mentioning this earlier) that makes the display flash once that LED is reached. so it wouldn't have much of a chance of getting past 40Ω (guess 92°C) without the driver (myself) having a visual signal that the engine is running over temp. does that sound like a possibility to you? or is my in-experience showing

#### Bear_2759

Joined May 23, 2008
120
hi SgtWookie,

does what I suggested sound possible? I did however think of another option... I have a 1994 Mazda 626 that I am about to scrap, I could if needed take the temp sensor off that to see how it goes, the only thing is I would need to re-tap the thread on the block which I am not all that confident with doing but would be willing to if needed...

#### SgtWookie

Joined Jul 17, 2007
22,219
Hi Bear,
Sorry, there was a very loud "thud" heard eminating from my place as I dropped the ball on you.

The non-linearity of those temp senders really bothers me; the worst part of it is how different they are at the most important end. Not ever having dissected one, the only thing I can imagine how they're made is a bimetal spring pushing on a carbon "pile" to change the resistance. You really need something with a much more linear response. Otherwise, it's going to be darn near impossible to get accuracy in the range where you really need it; from around 150°F to perhaps 250°F, or (roughly) 65.5°C to 121°C. I don't know what temperature range you're planning on operating the engine with.

Back in the 60's and 70's, it was pretty common to run engines at around 160°F to 180°F; they got warmer as time went on. My last Oldsmobile ('92, 3.8L V6) ran 195°F. Running them warmer made them more efficient. However, if you've been running at a lower temp, or built the engine for a lower temp (tight tolerances) you wouldn't want to get it very warm.

Now it would be a shame to tap out the block if you can do it some other way.

You can buy "bare" thermistors quite inexpensively from electronic supply houses. Something like this from Farnell could do the trick:
http://uk.farnell.com/8829560/passives/product.us0?sku=epcos-b57540g303j

#### SgtWookie

Joined Jul 17, 2007
22,219
Sure, the -20°C to +125°C thermistors will be fine

Get a few of those, and we'll proceed as before.

#### Bear_2759

Joined May 23, 2008
120
quick update just so you know I'm still alive... I wasn't able to find any solid brass bar to be able to use as a replacement for the temp sensor, so I've drilled out the spare one I had... however I forgot to get myself some JBweld... I'm aiming to get out this afternoon to get some... will let you know when I do. here's the pics of the guts of the temp sensor. looks to me like you were pretty close with how you thought it was constructed

#### SgtWookie

Joined Jul 17, 2007
22,219
Interesting! Thanks for the pics

Not precisely what I was thinking of, but interesting nonetheless.

Now that I see the guts of it, I'm thinking that the springs' main function was to keep the brown rod in contact with the bottom of the housing. However, you could experiment with an ohmmeter and some pressure and/or different temperatures to see if you can get different readings from it.

That's not really what you're after though.

Before you J-B Weld a thermistor into it, let's take some temperature and resistance measurements from the thermistors you have - no sense wasting materials and epoxy.

I'd like to see at least three readings from several of them - one after they've been sitting on ice for several minutes (while they're still in the ice), one after they've been in boiling water for a minute or so (while they're still in the water), and one at room temperature; preferably 22°C - 25°C - but however you can measure it reasonably accurately.

#### Bear_2759

Joined May 23, 2008
120
actually the brown rod you are referring to is merely a thin sleeve that went over the outside of the spring, my guess is it is non-conductive and was just there to stop the spring touching the sides... the top piece (far right of pic) was sealed in the top of the case with a ceramic ring, preventing it from touching the sides... all I can guess is that the resistance varies depending on expansion/contraction of the spring.

Before you J-B Weld a thermistor into it, let's take some temperature and resistance measurements from the thermistors you have - no sense wasting materials and epoxy.
too late, while my wife has bubs out of the house I'm getting as much done as I can, I found some JB weld and as I write this the temp sensor is all together waiting for the JB weld to set... ha ha. I'll do some tests on the spares I have and if the one that is in the old temp sensor case is by chance defective then I can easily get a new case... I should have thought of it ages ago but a mate of mine rebuilds these engines, he would be throwing out the old ones constantly... all I need is the brass case from the old ones and I'm set... I'll let you know what the readings are of the thermistors soon.

#### Bear_2759

Joined May 23, 2008
120
I have a small dilemma... here's the results. I noticed the problem just after I started testing, I'm sure you will too. I tested 4 different thermistors... I apologize for the gap between 35 and 75 but it was too difficult to keep the temp around the same range for testing each of the 4 thermistors. for future reference is there any way to insert a table into a post?

Thermistor A
Temp Resistance
20.1°C: 38.0k
20.5°C: 41.5k
35.6°C: 18.4k
74.9°C: 4.20k
79.0°C: 4.13k
88.6°C: 3.20k
90.0°C: 3.10k
99.0°C: 2.20k

Thermistor B
Temp Resistance
20.4°C: 38.1k
20.6°C: 44.0k
35.4°C: 22.7k
75.2°C: 4.50k
82.0°C: 4.00k
99.5°C: 2.20k

Thermistor C
Temp Resistance
20.5°C: 46.0k
20.6°C: 43.0k
35.3°C: 22.5k
75.0°C: 4.80k
86.0°C: 3.40k
99.5°C: 2.20k

Thermistor D
Temp Resistance
20.5°C: 33.5k
20.7°C: 45.0k
35.0°C: 22.0k
74.9°C: 5.40k
78.0°C: 4.30k
88.0°C: 3.30k
99.5°C: 2.20k

What next o wise one

#### alwayslearning

Joined Feb 27, 2008
22
Bear 2759

I feel bad for you Bear 2759 that after 30 posts and 3 months later you are back were you started from. I am surprised that SgtWookie did not know that these sensors are non-linear. The vehicle computer simply uses a “Look-up Table” for the actual measured resistance. A couple of options below neither of which requires you to take a perfectly good working sensor; open it up and implant another sensor similar to what is already there. I have explained these two options below. Also referring to the old sensor the spring does not vary with resistance. A 50 foot section of heated copper pipe will expand about ¾ of an inch.

Solution one: It is possible to use a thermistor over a wide temperature range only if you can tolerate a lower sensitivity to achieve improved linearity. One approach to linearizing a thermistor is simply shunting it with a fixed resistor. As shown in the added plot the parallel combination exhibits a more linear variation with temperature compared to the thermistor itself. The sensitivity of the combination still is high compared to a thermocouple or RTD. The primary disadvantage to this technique is that linearization can only be achieved within a narrow range:

R(fixed) = [RT2*(RT1+RT3)-2*RT1*RT3] / (RT1+RT3-2*RT2)
Where:
RT1 is the thermistor resistance at T1; lowest temperature in the measurement range.
RT3 is the thermistor resistance at T3; highest temperature in the measurement range.
RT2 is the thermistor resistance at T2; the midpoint, T2 = (T1+T3)/2

These values will change for your actual min, max values; which can be measured on the vehicle with the engine running from cold to hot with an ohm meter hooked up to the sensor, assumming a non-feedback sensor; If the sensor is interfaced to a computer then you will need to measure the resistance by either measuring both current and voltage to the sensor, while it is connected as designed or turn the vehicle off in increments to measure the resistance; where your ohm meter is connected but turned off until you turn the vehicle off to measure the sensor resistance (not as accurate).

below is just an example:

RT1=1600 ohms
RT3=44 ohms
RT2=822 ohms

Therefore R (fixed) = 490.9 ohms

So if you put a series combination of one 470 ohm (standard) and one 20 ohm (standard) for a total resistance of 490 ohms in parallel with your original sensor or what ever you choose to use you will have a linear response to work with. Though remember that the temperature range will now correlate to a more narrow resistance range; which you can then measure. The plot provided shows an approximation of the linear response.

Solution two: Program a microcontroller with a lookup table to convert your temp values to what you require.

#### Attachments

• 25.5 KB Views: 30
Last edited:

#### Bear_2759

Joined May 23, 2008
120
I wouldn't necessarily say I'm back where I started, I might be in the same place that I was 3 weeks ago, but I have worked out not to by components where a datasheet is not available ... with any form of science there is no such thing as a failed experiment, you only succeed in finding another option/task etc that does not work... while it may be a time consuming and sometimes frustrating process you will still reach the same goal as if you succeed first go... and it's really only taking so long because I have a son that was born around the same time as I started this project, but I am determined to finish. do you mean to say that all thermistors are non-linear? my guess at how the old sensor worked was simply that, a guess, my knowledge of electronics is basic and childlike compared to some of the others I have seen on this site while browsing other posts... however my history with maths is quite good so it makes it easy to pick it up as I go...

the new thermistors seem to follow a very similar pattern to the original temp sensor, and being a car from the early 70's there is no 'lookup table'... I am beginning to think that option 2 that you mentioned below would have been a better idea to start with, there are only two reason's why I didn't go with it from the start.

1. I'm in I.T. and coding is half of my day job. not too keen on doing it when I get home too... old saying, .... a plumbers pipes ....

2. I find it much more enjoyable working with physical components.

while doing a bit of coding is beginning to look a bit more attractive I haven't given up on what I originally thought would be the "simpler version".

I'm interested to try your first solution though, as SgtWookie has pointed out in the past, the important end for measurement in this instance would be 75/80°C to 120°C, I don't care at all about any readings below that. I apologize if I get this wrong, it's late and my brain switched off a long time ago. my understanding of what your are saying "solution 1" is to use a resistor or series of resistors (value is calculated using the formula provided depending on where I want the min/max to be) in parallel or as a voltage divider with the original sensor that will give me a linear (or very close to linear) response?

SgtWookie feel free to jump in any time here. the more input the better.

thanks for the help alwayslearning, very much appreciated.

#### SgtWookie

Joined Jul 17, 2007
22,219
I took a look at the data a few hours ago, and plotted it out. Really, the only area of concern is from perhaps 70°C to around 120°C. The plot of temp vs resistance from 75°C to 99.5°C is actually quite linear, so we're still on target.

They're vastly more promising than the original sensor, and the replacement you purchased. At the high temp end, their resistance was SO low and so offset, it would have been impossible to design a circuit that would be even reasonably accurate. With these thermistors, we might not get perfect accuracy, but it'll be within 5% or so.

Now what you need to decide is what the range of temperatures is that you want to be able to display, and at what resolution? Perhaps 60°C to 110°C in 5 degree increments? That would require one LM3914 and 10 LEDs. Perhaps you wish to be able to display a higher range. Your input is needed.

#### hgmjr

Joined Jan 28, 2005
9,029
There was a good article on thermistors in the October 2008 issue of "Nut and Volts" magazine. If you can pick up a copy of the magazine at a local new stand I think you will find it very informative.

hgmjr

#### Bear_2759

Joined May 23, 2008
120
With the engine having been worked and now running much hotter than an original hemi I think I only really need from 70°C - 120°C, I will check what the running temp of the car is as soon as I get the new alternator on. just part way through making a new bracket for it... i think, that I would like to have 2 LM3914's so 20 LED's and in 2.5°C increments. using one of the example circuits from the datasheet, if the temp hits 105°C, the whole gauge would start to flash.

SgtWookie do you think using the suggestion from alwayslearning with having a resistor or series of resistors in parallel with the temp sensor might help improve acuracy in the range that we need?

hgmjr, thank's for that, I'll see if I can track down a copy, but with it almost being November I don't like my chances.

#### hgmjr

Joined Jan 28, 2005
9,029
In lieu of the article in Nuts and Volts, here is a link to an article on the web that will serve the purpose.

hgmjr

#### SgtWookie

Joined Jul 17, 2007
22,219
With the engine having been worked and now running much hotter than an original hemi I think I only really need from 70°C - 120°C, I will check what the running temp of the car is as soon as I get the new alternator on. just part way through making a new bracket for it... i think, that I would like to have 2 LM3914's so 20 LED's and in 2.5°C increments. using one of the example circuits from the datasheet, if the temp hits 105°C, the whole gauge would start to flash.
That's do-able.

Do you think using the suggestion from alwayslearning with having a resistor or series of resistors in parallel with the temp sensor might help improve acuracy in the range that we need?
Need another reading still - I want to know what they measure at 120°C/248°F! Without that reading, all I could do is speculate. I really would hate to have to guess at this. With the data you've provided thus far, it looks like the response is surprisingly linear between 75°C and 99.5°C. But in order to really know for certain, I'll need that 120°C reading.

Also, in the results you reported, there were only two digits. Isn't your meter 3.1 digits? The more accurate your readings of resistance vs temperature, the better.

#### alwayslearning

Joined Feb 27, 2008
22
Bear_2759:

There is a risk involved with monitoring only the temperatures above 70 degrees celsius. If the engine coolant were to leak externally/internally before start-up (hopefully would notice a visible external leak) or during the no monitor temperature state, 0-70 degrees celsius (while driving), there would be no indication that the engine is overheating. By the time you realize that the 70 degree indicator should have already come onthe engine may have been presented to unforgiving temperature levels. This problem arises due to the low thermal conductivity of air; when engine coolant is not in contact with the temperature sensor.

Therefore if you choose to only monitor temperatures above 70 degrees Celsius; then you may want to consider this in your design?

#### SgtWookie

Joined Jul 17, 2007
22,219
Bear, I don't know why I didn't think of this before - likely because I've been used to seeing thermistors used for monitoring engine temps.

However, there are semiconductor devices available which permit accurate and linear reading of temperatures over a broad range.

The LM35 is a Precision Centigrade Temperature Sensor, and would make these non-linearity problems go away. I've attached a datasheet. Look at page 9. There is a complete circuit showing how to connect it to a pair of LM3914's for a complete solution to your engine temp monitoring.

#### Attachments

• 303.7 KB Views: 20