help creating analogue temp and fuel guage

Thread Starter

Bear_2759

Joined May 23, 2008
120
hi everyone,

I need a bit of help working out how to create a circuit, my overall project is to create a whole guage cluster from scratch. tach, spedo, temp, fuel, the whole lot. I already have a working circuit for tach and spedo, I'm now up to temp and fuel. I was thinking of using the lm3194 for both temp and fuel, just one of the basic circuits from the datasheet.

im still a bit of a noob so excuse me if I make any simple mistakes, the inputs from both temp and fuel sensors are pretty simple, both use a potentiometer so as fuel/temp increases/decreases the resistance changes. my thought was to bridge pins 4 and 5, replace R2 with the pot in the sensor, that way as ref hi decreases the display will light up. but after thinking about it this would not work, to begin with the voltage on pin 5 would need to be higher than pin 4, and even then the display would increase exponentially instead of linear. I am yet to think of another way to hook up the sensors. thats my first problem, the only other Idea that I have had is to use the sensor as part of a voltage divider to pin 5 but not sure how well that will work. others that I have thought of are as follows.

as fuel drops resistance decreases (guage needs to drop from High to Low)
as temp drops resistance increases (guage needs to drop from High to Low)
so circuits would need to be different because I want to use the IC's in Bar mode. if it were dot mode I could simply flip one upside down. but that would be cheating.

like I said I'm a bit of a noob, it took me about 3 months to finally get a working Tach and spedo so if i've missed anything obvious or made any obvious mistakes feel free to have a good laugh at my expense.:D

thanks in advance.

P.S. feel free to ask me if you want the Tach or Speedo circuit. they are both one and the same and just need to be duplicated for the second application.
 

SgtWookie

Joined Jul 17, 2007
22,230
First, we need to know a few things:
1) What is the resistance of the fuel level sender when the tank is empty?

2) What is the resistance of the fuel level sender when the tank is full?

3) What is the resistance of the temperature sender when at room temperature for at least 10 minutes? (72°F, or report the temperature you read on an accurate thermometer when it and the part had been sitting there for at least 10 minutes.)
Alternatively, what is the resistance of the temperature sender while it has been sitting in a bowl of ice cubes for 10 minutes?

4) What is the resistance of the temperature sender when immersed in boiling water for at least 10 minutes (not touching the sides or bottom of the vessel of boiling water? (212°F) If you are at more than 200' altitude above sea level, tell us what your altitude is. As altitude increases, water boils at much lower temperatures.

5) What range of temperatures do you wish to display?

The more accurate you are with your initial measurements, the better results you'll wind up with.
 
Last edited:

Thread Starter

Bear_2759

Joined May 23, 2008
120
I'll do a bit of research, hopefully someone else has already got the info, otherwise I will do some thorough testing. hopefully I will have something before the end of next week.

thanks
 

SgtWookie

Joined Jul 17, 2007
22,230
I'll do a bit of research, hopefully someone else has already got the info, otherwise I will do some thorough testing. hopefully I will have something before the end of next week.
Bear, we have absolutely no clue as to what the year, make, model and engine is of the vehicle you're working on. Therefore, we could guess until Kingdom come and not arrive upon an accurate concensus.

Even if the year, make, model and engine were supplied, we can't be certain of what your actual components measure out to - just a range.

It might sound like a pain in the keister, but this is a necessary process to go through in order to get the facts. The more accurate these facts are, the better the chance of having a reasonably accurate result.

As far as the thermal sensor goes, they're usually very linear. If we can get accurate resistance measurements at just two temperatures that are reasonably far apart, we'll be able to extrapolate to get reasonably accurate readings for a very wide range of temperatures.

The fuel level sender is different, because gas tanks come in wierd shapes, and the arc the level sender's arm travels results in very non-linear readings. If you want that to be accurate, it'll take a microcontroller with a look-up table programmed in, and lot of work on your part.

For example:
1) Empty the tank completely.
2) Take a resistance reading. Record the results.
3) Add 1 quart (or 1 liter, or 1 gallon) of fuel.
4) Repeat steps 2 and 3 until the tank is completely full.
5) Program a microcontroller to interpret the resistance readings to how many quarts or liters or gallons of fuel you have left. Since a microcontroller can't read resistance values, develop the necessary circuits to translate the level sender's resistance to a voltage level that the ADC on the microcontroller can read and interpret.

See, it's not all that easy. But, it IS possible.

The first car I owned with an accurate fuel gauge was my '92 Olds 88 LSS. The whole dash was computerized. The fuel gauge was accurate to within 2/10 of a gallon, if the car was level and not subjected to unusual G-forces at the moment.
 
Last edited:

Thread Starter

Bear_2759

Joined May 23, 2008
120
apologies, my poor choice of words meant you misunderstood, when I said that I hope someone else already has the info, I meant one of my mates who are into the same cars, including the guy that just rebuilt the engine less than 1000k's ago. so the thermostat should be very close to what it was when it came out of the pack. as for the fuel tank, the car is from the 70's so no molded plastic tanks just a big square tank so the results should be fairly linear. I plan on doing some experiments on sat with the fuel tank, if i haven't got any info by then I'll test the thermostat as well...
 

Thread Starter

Bear_2759

Joined May 23, 2008
120
Im back, with some readings,

Fuel sender:

Empty: 10Ω
1/2: 90Ω
full: 165Ω

results are close enough that no PIC needed.

Temp:

I dont have an acurate thermometer so was not able to test exactly what you asked, however

at Cold (which would be room temp) is 202Ω
to hit the Hot end of the guage it needs to be 22Ω.

I discovered something else that I need to do, for my car to be legal and for me to be able to register it here in Australia, I need to have an Odometer for which I will need to build another circuit. but I think that is worthy of a seperate post. cheers and thanks for all your help so far.:D

as a side note I would prefer to be able to calibrate what would be High and low on both guages as with all old cars I may need to swap the fuel sender, or temp sensor for a second hand one, and they are not always right. this particular car is almost 40yrs old so even the second hand parts are starting to get hard to find...
 

SgtWookie

Joined Jul 17, 2007
22,230
OK, here's the first part of your fuel tank gauge.

The circuit feeds a safe low-voltage (< 1.4v) low-current (<8mA) signal level to your in-tank level sender. It's important that it be low voltage and low current to minimize the risk of creating a spark inside your gas tank.

The current flow is constant, so as the resistance of the sender in the tank changes, the voltage across the sender varies. The higher the resistance, the higher the voltage.

There are a pair of diodes in series to ground that prevent the voltage to the in-tank level sensor from ever rising higher than 1.4v. This is strictly for safety reasons; without such protection if your sender ever opened up, the current regulator would try to send 12v to your sender; if it later made a connection, there could be a spark produced.

The LT1006A is a precision single operational amplifier from Linear Technology. You could substitute an LMV2011 from National Semiconductor, or another single-supply opamp with low offset voltage that are capable of working with input voltages down to the negative rail - most won't.

That takes care of the hard part. :) Now, what LEDs are you going to use for the 10-segment display? Looking for a current rating here. Were you planning on a constant current type of thing, or were you going to provide a method of dimming the LEDs?

As far as the temperature sensor readings go, it's really not that difficult to get accurate readings at different temperatures without an accurate thermometer.
1) Connect your ohmmeter to the temp sensor.
2) Fill a bowl with ice, add some cold water from the tap.
3) Place the temp sensor in the cold icewater for 5 minutes.
4) Read & record the resistance.
5) Get a pot of water to boiling on the stove.
6) Immerse the temp sensor in the boiling water, without letting it contact the sides or bottom of the pot. Keep it there for 5 minutes.
7) Read & record the resistance.
8) Obtain your local barometic pressure, and record that.
You can get it from the Weather Channel: http://www.weather.com
Barometric pressure directly affects the boiling temperature of water.
You can use the calculator on this page to find out at what temperature water boils with your barometric pressure:
http://www.primogrill.com/boiling.htm
 

Attachments

Thread Starter

Bear_2759

Joined May 23, 2008
120
that looks great, thanks heaps.

I'm not 100% sure about what LED's yet, I'd probably use SMD's, either red or white, from what I can tell most red surface mount LED's are 20mA, and most white are 10mA. I need to get my hands on some to test them out and see how bright they are...

I would like to be able to adjust brightness of the whole dash if possible, I already have a pot on my Tach circuit to adjust brightness, I just have to link them all together once my prototype is complete and working... if I cant adjust brightness over the whole dash then I will at least need to set it up so that the dash is dimmer when the headlights are on... but if what I have in my head is right then variable brightness is easy...

I'll pull the temp sensor off the car this weekend (hopefully:rolleyes:) and get myself a decent digital thermometer to test the sensor.

any components resellers you would recommend? the few I know here in Aus don't have much in the way of SMD's (or at least not advertised) I'll need to get some pretty bright SMD's because they will need to light up a diffuser that will be mounted in front of them...
 

SgtWookie

Joined Jul 17, 2007
22,230
that looks great, thanks heaps.
Thank Bertus; much of the original idea was his, I just added some bits to it ;)

I'm not 100% sure about what LED's yet, I'd probably use SMD's, either red or white, from what I can tell most red surface mount LED's are 20mA, and most white are 10mA. I need to get my hands on some to test them out and see how bright they are...
OK. Keep in mind that red is a very good color for preventing night blindness. That's why aviation instruments are illuminated with red lamps. I suggest that white would not be a good choice for that very reason. Also, red LEDs usually have a low Vf (forward voltage) which makes it quite easy to use pairs of them in series. This can be very advantageous when you have LEDs with varying Vf's; you can match the high Vf LEDs with the low Vf LEDs so that the brightness for a given current is very close.

You might wish to download a datasheet for Agilent's HDSP-4820, HLCP-J100, HDSP-4830 10-segment LED bars. If you mounted them in sockets, it would make it extremely easy to replace them should they develop a faulty segment. SMT/SMD LEDs are rather difficult for hobbyists to work with due to their tiny size. However, if you are looking to re-create something like the original instruments looked, you could even go with a glass panel (RGB LED) driven by a microcontroller - but that would be a rather advanced option.

I would like to be able to adjust brightness of the whole dash if possible, I already have a pot on my Tach circuit to adjust brightness, I just have to link them all together once my prototype is complete and working... if I cant adjust brightness over the whole dash then I will at least need to set it up so that the dash is dimmer when the headlights are on... but if what I have in my head is right then variable brightness is easy...
That might be accomplished using PWM on the LED's supply side. The LM3914 would be set up to provide a constant current of say, 20mA (or whatever the LEDs were rated for) - and then a PWM circuit comprised of a 555 timer, a couple of diodes and a potentiometer could control the brightness of whole thing. A 555 timer is limited to 200mA current source/sink, so you would also need a PNP transistor and a resistor to limit the base current per every 5 to 10 LEDs or a P-channel power MOSFET to switch the current to the LEDs on/off.

I'll pull the temp sensor off the car this weekend (hopefully:rolleyes:) and get myself a decent digital thermometer to test the sensor.
You really don't need to spend the money for a digital thermometer. Icewater is 32°F/0°C, and water boils at 212°F/100°C at 29.92 InHg barometric pressure. The formula for getting the actual temperature in °F of the boiling water is:
BoilingPoint = 212-(1.8518*(29.92-LocalPressure))

any components resellers you would recommend? the few I know here in Aus don't have much in the way of SMD's (or at least not advertised) I'll need to get some pretty bright SMD's because they will need to light up a diffuser that will be mounted in front of them...
Well, since I'm in the States, and have never been downunder, I couldn't begin to guess whom you could get a decent deal from. You might try Farnell in the UK, but I frankly don't know. You might try E-bay, but your mileage may vary considerably. Many resellers are reputable, but there are a number that aren't. Caveat Emptor.

I suggest that you get about 20% more LEDs than you actually need. If you measure them for Vf at a given current, you will find that about 10% are considerably higher or lower than the average Vf. It is also a good idea to have spare LEDs from the same lot, in case you manage to burn out some of them or some get "launched" into space when you are trying to solder them to the board (this has happened to me more than once!)
 

Thread Starter

Bear_2759

Joined May 23, 2008
120
Red it is, I'll be using individual SMD's as the look i'm wanting to go for wont allow for the 10 segment bars, it would be easier but I would be sacrificing the look for ease and as tempting as it is I need to not let myself start doing that... you've given me allot of ideas with your suggestion of the glass panel (RGB LED)... just to make sure we are talking about the same thing are you referring to OLED's? I think I would spin a few people out if I had a digital dash that looked like the original... especially if I chose to replicate the charger R/T dash. which I would of course... however, as my wife has reminded me... I need to stick to one project at a time... I might start looking into that after this one's finished though...;). there's more than one car it can go in...

with adjusting brightness, I dont have the data sheet in front of me but in the circuit diagram at the beginning of the post does R2 not control the brightness of all the LED's? would I just not be able to put a pot in its place with all sections of my dash running through that pot? remember I'm still learning so I might be very wrong... if I am then your idea sounds good:D as I just ordered some 555 timers to experiment with earlier this week. including some dual 555 timers, lm3194's, lm3195's and lm3196's...

any online resellers that you might think would ship world wide? I'd be willing to pay a little more for shipping if I knew I wasn't going to get fake IC's... I've heard a few stories about some retailers selling fakes that dont quite end up being what you thought...

I alway's buy more than I need. it means I slowly build up a range of parts and dont have to go for a 20minute drive if I'm one resistor short... :rolleyes:
 

SgtWookie

Joined Jul 17, 2007
22,230
Red it is, I'll be using individual SMD's as the look i'm wanting to go for wont allow for the 10 segment bars, it would be easier but I would be sacrificing the look for ease and as tempting as it is I need to not let myself start doing that...
Understood, and appreciated. However, you may wish to use a 10-segment display for your testing phase. Keeping things simple will keep your troubleshooting simple.

you've given me allot of ideas with your suggestion of the glass panel (RGB LED)... just to make sure we are talking about the same thing are you referring to OLED's?
Actually, I was thinking of something like those that are used in aviation displays. High-resolution cell phone displays are a similar idea, although on a smaller scale. Somewhere I saw images of someone's efforts to replicate the dashboard instruments of an antique car using a glass panel LED display; it was extremely (and remarkably) convincing.
I think I would spin a few people out if I had a digital dash that looked like the original... especially if I chose to replicate the charger R/T dash.
A Charger R/T, eh? What year? I remember them, but have never ridden in one. Here's a '70:


...which I would of course... however, as my wife has reminded me... I need to stick to one project at a time... I might start looking into that after this one's finished though...;). there's more than one car it can go in...
It would be a LOT of work, but it is do-able. Best to stick to the K.I.S.S. philosophy for the moment, and get the current project completed and on the road; you can always upgrade later.

with adjusting brightness, I dont have the data sheet in front of me but in the circuit diagram at the beginning of the post does R2 not control the brightness of all the LED's? would I just not be able to put a pot in its place with all sections of my dash running through that pot?
It's a bit more complex than that. Getting correct values for R1 and R2 is a bit involved, as they not only set the current for the LEDs, but also set the high reference voltage on the resistive divider bridge. Reference Vout = 1.25 x (1+ R1/R2), and I(led) = 12.5/R1 - so you can see that if you're using the REF OUT for establishing your Rhigh, changing R1 would vary your LED intensity, but also your Rhigh. With just a single LM3914, you could use a pot to control the LED intensity if you were using an external Rhigh reference voltage, but you would need a pot for each LM3914 that you used, plus another for for your general dash lighting. That is the reason why the intensity needs to be controlled via PWM on the supply side. The LEDs will still get a controlled current, but for a duration controlled by the PWM.

I just ordered some 555 timers to experiment with earlier this week. including some dual 555 timers, lm3194's, lm3195's and lm3196's...
OK, the dual 555 timers are 556's. Which ones in particular did you order? Some of them are strictly bi-polar, some are CMOS, and some are low-power CMOS. They have different specifications as to their output drive current, supply voltages and what values of timing components they require.

BTW, that's LM3914, LM3915, LM3916. ;) LM3914 = linear, LM3915= logarithmic, LM3916 = VU meter (for audio signal levels). For your current projects (fuel level, temp) only the LM3914 will be useable.

any online resellers that you might think would ship world wide? I'd be willing to pay a little more for shipping if I knew I wasn't going to get fake IC's... I've heard a few stories about some retailers selling fakes that dont quite end up being what you thought...
In general, go to the manufacturers' website and find out who their authorized distributors are. Then either purchase directly from the manufacturer, or from their authorized distributors.
Fairchild Semiconductors has Fairchild Direct; you can purchase right from them.
Microchip has Microchip Direct Sales - but they are mainly microcontrollers and interface ICs.
Farnell's (sp) in the UK is an authorized distributor for many manufacturers.
Like I've mentioned before, I have absolutely no experience with attempting to buy electronic components while downunder. You might try asking for recommendations in the Electronics General Chat forum.

I always buy more than I need. it means I slowly build up a range of parts and dont have to go for a 20 minute drive if I'm one resistor short... :rolleyes:
That's OK - it's good to have a basic stock of general-use components like a selection of resistors, capacitors, and handy IC's such as 555/556 timers. CD4093B quad NAND Schmitt-trigger input CMOS logic ICs are also very handy, as besides being able to be used to duplicate the function of any other logic gate (inverter, AND, OR, NAND, NOR, XOR, XNOR) and they can be used as oscillators, crystal drivers, signal shaping, and many other functions.

In production manufacturing purchasing, there is an "attrition factor" applied when purchasing items; basically you understand that there will be some percentage of the purchased components that may not work properly, or could become damaged during assembly, or fail during testing cycle. It's simply unavoidable; component failures are a reality.

For LEDs, you will find that somewhere between 3% and 10% of the lot you get will have a significantly higher or lower Vf than the rest of them.
I cannot tell you offhand if the LM3914 actually regulates the current through each individual LED, or by voltage. It is not obvious according to the datasheet that I am looking at (National Semiconductor LM3914 Dot/Bar Driver, dated January 2000). I have a dozen or so of these sitting around, I should get off my duff and experiment with some of them ;)
 
Last edited:

Thread Starter

Bear_2759

Joined May 23, 2008
120
I've already been using some cheap 3mm red LED's for testing... they were $3 for 100 so I figured I could use them somewhere...

I'll remember that glass panel LED display idea and create a new post when this one is done...

while I do love the Dodge Charger, Dodge had an Australian arm called Valiant, the Valiant Charger was only manufactured in and for Australia, so are very rare worldwide and from what I know are becoming allot more popular in the US... the particular model I like is the 71 VH E49,



and here's mine almost complete, the car's as finished as it will be at any one time... this photo's about a year old now...


I intentionally picked 5 of each of the 3914's 5's and 6's. I will be incorporating a few VU meters into the stereo that will go in the car, the 3915's were just for experimenting... I just checked my order and the 3914's don't appear to be on there so I'll have to get them again later. the 555's are LM555CN and the 556's LM556N

A PWM circuit is starting to sound like a good idea... for the Tach I am using 3x3914's and the ref out of the last IC sets the ref hi of all three (through a few resitors for each etc.) so I don't want to go and mess that up...
 

SgtWookie

Joined Jul 17, 2007
22,230
Very nice! I do like the color you've chosen. It's very similar to a "Medium Garnet Red Metallic" color that three of my former Oldsmobiles were painted.

The 3mm red LEDs are great for testing.

Interesting about the Valiant line. There was a Plymouth model called Valiant in years past (part of the Chrysler/Dodge/Plymouth group) but now the Plymouth brand has been discontinued here in the States.

OK, your LM555CN are the National Semiconductor bipolar 8-pin DIP, so they'll do 200mA source/sink. Haven't bothered to download their 556 datasheet, but I can tell by the part number that yours will be bipolar DIPS as well, only 14 pin instead of 8 pin.

Really, PWM of the LED source voltage is going to be by far the easiest way to go. The most difficult part will be to get your LED's intensity balanced at 100% on for all gauge functions while getting your REFhigh set properly, and "tweaking in" your Rlow. After that, PWM will dim/brighten all of your gauges equally.

You will need at least one P-channel MOSFET capable of supplying all of the current for all of your dash LEDs. Alternatively, you could use several smaller P-channel MOSFETs, or even PNP transistors.

A MOSFET worth considering for your PWM source is an IRF4905S. This is a P-ch power MOSFET made by International Rectifier. It is a surface mount device, and is capable of sourcing 74A current. While it may be successfully argued that using this device to power a few LEDs is like using a battleship to swat a fly, one must consider the vehicle itself, which literally screams brute force from every flake of metal in it's paint job ;) One thing for certain, if proper ESD (electrostatic sensitive device) procedures are followed during installation, this MOSFET is one thing that won't break - it will require only a very small space on the board somewhere, and due to it's very low Rds(on) compared to the load being driven, will not require any heat-sinking.

MOSFETs are extremely efficient for sourcing/sinking power, particularly at low voltages, but at the same time are extremely vulnerable to static electricity discharge. Irreversable damage can occur far faster than the blink of an eye. One small "zap" and they are paperweights.

Keep them in their ESD-safe packaging until you are ready to install them. Using a sheet of aluminum foil on your workbench connected to earth ground via a (roughly) 100k resistor will help a great deal in safely eliminating static charges. Place the parts still in the ESD-safe packaging on the foil, and touch the foil yourself. Having an ESD wrist strap connected to the foil via a wire and alligator clip will help to eliminate you as a source of static.

Might seem a bit extreme, but if you're in a really dry climate, you must take extra precautions. BTW, LEDs can be "zapped" by electrostatic discharge, too.
 

Thread Starter

Bear_2759

Joined May 23, 2008
120
Ok, I've tested the temp sensor, I borrowed a digital cooking thermometer from a neighbour;)... current pressure 29.83

°C Resistance
0.5 1.6K
18 650Ω
65 115Ω
91 47Ω
99.8 44Ω

not exactly linear... but probably dont need a PIC as long as it shows a difference between cold, normal running temp and hot. normal temp and Hot being the important two... while I was only able to get the temp up to 99.8 the sensor is rated to 120°C. and with how the graph in my head looks from those readings it would make sense that hot (120) would be 22Ω. I will order some SMD LED's tonight, I'll let you know what the ratings are on them once I choose... With my last purchase about a week ago I did order some 10 segmet bars for experimenting with the VU meter circuit so I will be able to use them for testing this one too...
 

Ozjello

Joined Aug 12, 2008
10
... for the Tach I am using 3x3914's and the ref out of the last IC sets the ref hi of all three (through a few resitors for each etc.) so I don't want to go and mess that up...
G'day Bear,

Is is possible for me to take a butcher's at that Tach schematic ? I am working on an 02 sensor circuit using LED's and LM3914's and would like to see how you wired yours up.

Thanks
Tim
Aussie living state-side
 

Thread Starter

Bear_2759

Joined May 23, 2008
120
here it is. I know I said a few days but I had some spare time and got bored... I didn't actually design this circuit, only made a few minor mods so I don't deserve any cred for it... hopefully the Image is not too large...

quick explaination of a few things, the LM2907 (frequency to voltage converter) uses the frequency from the coil or if you wanted to use it as a speedo then from a Hal Effect sensor. if you dont have a frequency, but already have a voltage as your signal, then just remove the 2907 and wire your signal into pin 5 of each 3914.

C3 is needed if wires to LED's are more than 6". thats from the datasheet:D
R1 controls the slope of the voltage response
R2 controls the initial DC offset of the voltage response
R3-R5 fine tune the bar graph display.



Have fun... I know I have with this one:rolleyes:
 

Thread Starter

Bear_2759

Joined May 23, 2008
120
ok, so I think I've decided what LED's I'll be going with, so far I have only recieved two of the 5 I ordered to test but I'm pretty sure I'm sold on one of them. typical forward voltage of 1.9V and current of 20mA. they're also a little bit bigger than the other SMD's so easier to work with. while it's only an extra 1.2mm it makes all the difference at that size... here's a link to the datasheet if you want more info.

Data Sheet
 

SgtWookie

Joined Jul 17, 2007
22,230
OK, it's always good to have the documentation :)

I'm concerned about your temp sender; it's very non-linear. I think it would be a really good idea to find a more modern and more linear replacement for it. Otherwise, it will be very difficult to get an accurate correlation between the sender resistance and what the actual temperature is, and the most dubious accuracy will occur at the high temp end where you need the most accuracy.

If need be, you could even re-build your existing temp sensor using a small thermistor, a couple of spade lugs soldered to the thermistor's leads that will fit your wiring harness and some J-B Weld. Drill out the top of the original sensor (being careful to not go through the sides or bottom) - fill it with mixed J-B Weld, insert your new thermistor and spade lugs, and let it cure for a day.
 
Top