• Hello Guest, we are proud to now have our Wiki online that is completely compiled and written by our members. Feel free to browse our Jeep-CJ Wiki or click on any orange keyword when looking at posts in the forum.
    To dismiss this notice
    click the top right X.

Build Thread Build a New Set of Gauges from Scratch

Build Thread Build a New Set of Gauges from Scratch
Re: Build a New Set of Gauges from Scratch - Wrapup

Wrap-up

Here is the punch list for the completion of the digital Jeep gauges project:

1. Calibrate fuel tank level readout.
2. Links to hookup details for connecting the LCD-16X2 display to the Arduino board.
3. Link to Arduino sketch “resistorRead.ino”
4. Calibrate temperature sensor and readout
a. Use “resistorRead.ino” on the breadboard
b. Use standalone TMP36CZ analog temperature measuring device.
5. Calibrate oil pressure measurement using “resistorRead.ino”
6. Link to final iteration of Arduino sketch to cycle thru and display gauge readouts.

The calibration turned out to be both simple AND accurate, two surprises. remember that the Jeep fuel tank float registers a resistance of between 10 and 73 ohms, 10 ohms when empty and 73 ohms when filled. We need a voltage divider to get the measurement into our Arduino. I used a resistor of 1k ohms (1023 ohms actually) in series with resistors spanning the range of readings for the tank float resistor.

Here is a brief description of how you can mimic the Jeep CJ gauges on an Arduino:
20JunPIC1.png


And here is what the breadboard voltage divider circuit actually looks like:
20JunPIC2.png


Running the Arduino sketch “resistorRead.ino” and changing resistors between all values of 10 to 73 ohms, the sketch returned the correct resistor value within one ohm across the full range of fuel tank float resistor readings. The resistance reading of the tank float resistor is directly proportional to the quantity of fuel in the tank.

While the coolant temperature sending unit varies across a resistance range very close to the tank resistor, the coolant temp resistor is inversely proportional to the coolant temp… heat goes up, resistance goes down. We can simulate coolant temperatures with a voltage divider just as we did the fuel float level, but “resistorRead.ino” will need a slight change. That is an experiment for the next part of wrap-up.
 
Re: Build a New Set of Gauges from Scratch - COMPLETE!

After a couple of gloriously fun months with all my children and grandchildren here, I finally got testing and trouble-shooting done. It works, and I like it! There are some important short notes following, but first, take a look at recorded video:
JeepGauges.MP4
Large format image up close
GaugesFinal.m4v
Smaller image, bit longer.

IMPORTANT-TO-SUCCESS NOTES:
1. 1,000 ohm (1K) resistor in the voltage divider replaced by 100 ohm resistor. This places the sampled voltage near the middle of the 5 volt range for greater accuracy.
2. To avoid erasure of the program code in the Arduino during power-on and engine start, you must install a 10 microfarad (uf) capacitor on the Arduino as shown below. The capacitor absorbs electrical signal that would reset the Arduino memory. I used a tantalum capacitor that has plus-minus polarity, but is quite small. Here's a pic.
00Final.jpg


3. My son Steve, a talented and clever programmer, re-wrote the Arduino driver code. Aside from better, tighter code by 10X, he insisted (quite rightly) that all values should be visible on the LCD display at once. The outcome you can see on the two video clips at top of this post.

HERE IS THE LINK TO STEVE'S NEW ARDUINO CODE, TheeSensorsSteve.ino.


4. Here, for anyone who feels motivated to build this display and would need to tweak (as I must in further testing) the displayed values, is the section of code that drives what numbers display on the LCD.

void convertValues(struct s_SampleReading& sample)
{
sample.fuelGallons = map(sample.rFuel, 73, 10, 0, AMC 150 ) / 10.0;
sample.coolantDegF = map(sample.rTemp, 280, 9, 30, 220);
sample.oilpressPSI = map(sample.rOil, 236, 32, 0, 60);
}

I need to move the low-temp end of the temperature displayed values higher. Likewise, I should put the max value of oilpressPSI at 80 PSI like the engine spec lists as max gauge reading. I will make all these changes and post back.

5. One final note - I MUST HAVE BEEN OUT OF MY MIND TO UNDERTAKE THIS JOB!!!!

But I'm glad I did, and when this display system is integrated into a new dash panel to replace the old tattered diamond aluminum, I'll be right glad to have all the displayed data, night or day, dark or light.

More about tuning the numbers in next post.
 
Re: Build a New Set of Gauges from Scratch - Gauge Accuracy

What I said I'd do, I did!

I said I'd run the fuel tank completely dry to test gauge fuel level accuracy. I left the house with the gauge reading ZERO. A mile later, stopped at a traffic signal on a two degree up-slope, she flamed out. The folks behind me weren't too happy with me as I refilled the tank from a jerry can.

I put in 2.5 gallons, reprimed the fuel pump and dry line by cranking for a long, long time (the battery dates from Nov. 2009), and went on to the gas station 300 yards down the road. The tank filled at 12.5 gallons pumped. On the way home the gauge shows 15 gallons.

No further questions, Your Honor.

I don't have to repeat that test.
 
Re: Build a New Set of Gauges from Scratch - FINAL CALIBRATION

The last major task for this Home-Build Electronic Gauges project was to install an external-to-the-Jeep-Engine temperature sensor and calibrate the output to the first position on the LCD panel, labelled "TMP". Earlier in these notes I showed photos of a DS18B20 temperature converter chip, built into an armored harness for "wet work" (forget CIA and spies here; I mean installation into the water jacket).

It was really troublesome getting the DS18B20 sensor wires, of which there are three; 5Volt, GND, and DATA OUT, into the interface board connector. The wires of the harness were 24 gauge, and the armored cable was stiff enough to yank them out of the screw-down connector with any serious handling of the IF board or the display box. I built a plug-in harness between the armored wire termination and the IF board; solved the problem.

Now for the water jacket insertion. There is a socket at the base of the thermostat housing for an National Pipe Thread plug, once the home of yet another useless temp switch for pollution control. I couldn't find a plug that was hollow yet closed at the distal end, so I improvised.

The next photo series show the NPT plug, a .30-30 Winchester shell casing, a 4-40 tap and screw, and some brazing solder for use at 1125 to 1145 degrees Fahrenheit. I brazed the screw into the .30-30 primer hole, sawed off the shell casing head, and brazed it onto the bottom of the NPT plug.

00Final01.jpg

00Final02.jpg

00Final03.jpg


Now a couple of pieces of brass hardware from a local auto supply, and it comes together. Here is what we have now:
PICSLastxx.png


I took a twenty minute drive to warm the engine. I have a new 185 degree thermostat and fresh 50-50 antifreeze. There is no shroud, nor do I yet have the two electric fans I know would help. When I got home, I parked in the driveway, hooked up the computer, and adjusted the values associated with the temperature read of the OEM thermistor screwed into the block right behind the thermostat housing. The final numbers that look the best are:

sample.coolantDegF = map(sample, Temp, 170, 9, 30, 210);

The last pair of numbers, 30, 210, represent the value range that may show up under the TMP position on the LCD. This is the temperature reading that would show up on your temperature gauge of OEM design, if it still worked. The first two numbers, 170, 9, are the range of resistance values that the OEM-installed thyristor will output at reasonable engine temp. The larger number is cold resistance, the smaller hot resistance.

Recall, please the the far right of four readout positions, T0, is the standalone temperature sensor, the DS18B20 digital output.

Now watch a short video of the LCD display as the engine idles in my driveway, over hot concrete at 90 degrees F outside temperature. Note particularly what happens to the TMP value past midway of the video when T0 increases to 186 degrees. I am kinda proud of how well the numbers track, which means I owe my son Steve some really good bottles of beer for the software improvements.

LCD DISPLAY IDLING ON A HOT DAY


So this is the end of the project to replace long-INOP OEM Jeep gauges with digital technology. I know the gas gauge reads empty when the tank is empty from an earlier experiment. The oil pressure reads and tracks the OEM oil pressure gauge which still works. And I am now convinced that the 185 degree thermostat holds the engine where I want it, and that my new temp gauge will alert me long before I damage my engine from an undetected overheat condition, whatever the cause.

Should you decide to consider such an install for your Jeep, don't hesitate to post or PM any questions to me. There are probably many ways to do it better, now that we know it will work.
 
Re: Build a New Set of Gauges from Scratch - FINAL CALIBRATION

TYPO in the line that reads " sample.coolantDegF = map(sample, Temp, 170, 9, 30, 210); "

IT SHOULD READ " sample.coolantDegF = map(sample, rTemp, 170, 9, 30, 210); "

The edit places a lower case 'r' before the upper case 'TEMP'
 

Jeep-CJ Donation Drive

Help support Jeep-CJ.com by making a contribution.

Help support Jeep-CJ.com by making a contribution.
Goal
$200.00
Earned
$25.00
This donation drive ends in
Back
Top Bottom