Building a smarter oil temp/pressure gauge

Alternatively, you could purchase a quality Redarc gauge and spend your spare time drinking beer:

View attachment 330984
I don't drink and this is a good example of the kind of limited functionality that's driving this project to begin with.

$450 for low grade transducers and a limited interface with poor resolution and no ability to log or remember transients.

I'll have about the same cost in this project with 10x the accuracy and far more function.

Beer is vastly overrated.
 
Can you add the functionality to calculate viscosity and display that as well? You might be able to approximate the HTHS value based on charting out the temp/pressure and referencing a calibration value.
 
Can you add the functionality to calculate viscosity and display that as well? You might be able to approximate the HTHS value based on charting out the temp/pressure and referencing a calibration value.
It would be easy to do in code IF you have a good ASTM 341 mapping of your viscosity curve AND you trusted the inputs.

But the problem is that you can't use VOA (carryover residual dilution) and your low hour baseline UOA loses accuracy as the oil shears and dilutes.

Thus the utility of a viscosity display-- if it ever existed-- is wiped out pretty readily.

A better usage I think would be just monitoring your temps and pressures and noting anomalies or changes. If your fresh oil is giving you 30psi oil pressure at idle and 90C oil temps and then later it only gives you 25psi under the same conditions, then you know from Poiseuille's law that you've also lost viscosity in the same proportion (1/6, in this example).

The world is your oyster with a setup like this-- you can program it to tell you any lie you want to hear. Me personally I just want to know what is true about temp and pressure and the max and min.
 
If you could show a graph of the temp/pres with history, and a trend line, I think you'd have all you need to infer something close to HTHS. Maybe?
 
We could use a few samples... Beta testing, anyone? Seriously, sounds like a patent should be in order!
With the absurd time suck this has been, nobody will want to do this and I promise I’m not going to be building them if it’s like this. But if one follows along, he will be able to duplicate fully the entire project because I will share the full BOM and scheme and all the software.
 
Progress update. I’ve confirmed the temperature sensor function, the display software, and today I verified my power supply gives a steady 5v output where it’s supposed to.

Unfortunately I made a huge mistake in building the first board, not realizing it was strip board! Unfortunately the Pico did not survive the extensive desoldering.

So we’re on hold for parts. But I’m learning a ms I go, no surprise that several mistakes are happening and I’m sure that more lie ahead.
 
Parts should arrive tonight and we should have a proof of function test up and running pretty soon.

I got the touch screen soldered in:
1775743164735.webp



I'm liking the PG7 cable gland for the display housing:

1775743240686.webp
 
Well, I reworked the main PCB somewhat and I’m pretty happy with the final layout.

IMG_2093.webp


I realized it was dumb of me to have a 12V tap inside on the PCB for the pressure sensor when it would just be exiting the CPU module and going right back out to the pressure sensor. SMH! Obviously the smarter option it just the 12V off the OBD pin 16 before it even enters the the CPU box.

So the only pressure sensor input to the box is the return on the ground side. That feeds the shunt that provides the voltage signal to the ADC.

I also decided to do a true split SPI layout. So my final pinout on the Raspberry is slightly different, but I think better.

In the pic, you can see the 10 wires for the touchscreen that are going to end up soldered to a 10-pin connector that will make the union to the touchscreen.

Ultimately, I eliminated daughterboards for everthing except the shunt resistor network. Hopefully the desolder of the buck converter didn’t cook it, it was feeling pretty hot to me. I think it’s OK but I won’t know until get the the final config boxed in and wired.
 
A nice bit of progress, I've got a connector installed on the display wiring.

1776341631479.webp


The pins on that are surprisingly challenging to solder because of the tight pitch of 10 pins in a small space. Note my small hand for scale:

1776341684939.webp



I even managed to remember to put the cable gland on before soldering any wires! Unfortunately, I forgot the plug backshell on the other half and had to desolder a couple wires in, thankfully a fairly minor setback.


If you ever need to solder something like this, the technique I used worked pretty well:
-- Tin the connector pins and fill the cups half with solder.
-- Twist and tin the wire leads
-- Dip the end of the wires in a bit of paste flux
-- Heat the cup to reflow the solder, letting the flux on the wire end do the necessary wetting and fluxing.

Because of the tight pitch, and bent fine point on the iron is super helpful. But that also means a fairly small tip mass and wetted area, so you'll want to run the temperature a bit higher than you'd normally consider. I like 400C within ±10-20C or so (~750F). This is hotter than I typically run, which I'm usually more in the 340-360C range. (660F neighborhood).

Tip temperature itself isn't really that critical, it's really about finding the balance between hot enough to get in and get out in a reasonable amount of time (2-3 seconds) without having things so hot you can't control them. I tried 450C and while it was super fast in any out, I was torching some insulation and the flux was burning off way too fast.

Besides, the 2 second rule is generally to prevent damage to fragile QFPs and other ICs on PCB. When soldering connectors, it's quite acceptable to run 3-5 seconds and get a tiny bit more heat soak in return for more control and neater work.


I like these cheap little connectors well enough I think I'm going to do another one on the other interface to the box that is for OBD interface (power/ground) and the sensor inputs (pressure sensor and RTD).

One advantage of doing a connector there is how easy it is to then run power to my pressure sensor-- I just need to solder a short between two pins on the connector. Easy Peasy. Then the pressure sensor gets 12V without any crimps or butt splices or other such complexity.

Ideally you would not use a 10 pin connector when you only need 5 pins. You'd either use a 5 pin version of the connector or the next size down for failsafing and such. But since this isn't going to be a production items (Lord knows that is NOT happening) and the only person dealing with these interfaces is yours truly, I think I can leverage the relative familiarity with the system.


Anyway, were almost to the point of being ready for full on bench test including the display! Exciting milestones are approaching.
 
Are you going to add some kind of filtration on the analog side for line noise? Cap/coil?
Probably not. Neither of these sensors are sensitive to EMI. Let's break it down by sensor:

TEMPERATURE:

The RTD is a voltage *drop* device, so just variable resistance. It seems very unlikely to me that the DC current flowing through two immediately adjacent wires could have a meaningful difference in induced voltage from any field interference. This is because the distance from any source is nearly identical for the two wires, so any induced voltage will be effectively equal and opposite. A electromagnetic field passing through both wires will cancel itself, due to this polarity difference. Since this is a pt1000, it has higher voltage drop from a higher baseline resistance than a PT100. This makes it more robust to induced voltages and variations in resistance.

If I was running two separate wires by two separate paths and one of those was near a coil pack or something then *maybe* it would skew my temperature data by perhaps as much as 2C. But I'm not, and the error is much smaller.

Also, my RTD has been calibrated with both an icebath and distilled water boil (including offset for ambient pressure that day). This calibrates not only for part to part variation but also lead resistance. My data should be accurate to within 0.2C, which is much better than I need since I'm only showing integer degrees and at only 2hz refresh. I determined the differences of <1°C were not significant for me to see or track, as that's less than 1% of the expected operating range between -20C and +120C or so.

PRESSURE:

The PX119 variant I selected has an output of 4-20ma. Only once this current enters the CPU and is shunted across a precision resistor network does it become a scalable voltage that the CPU interprets as pressure.

The wiring is a twisted pair of 20AWG fine strand wire. At a twist rate of 4/inch, almost every EMI will cancel unless its higher frequency.

The 4-20ma current output topology is used in automotive sensors specifically because 1) the 4ma "zero" allows for an easy open circuit indication, and 2) constant current is relatively immune to interference. Current signals are largely immune to resistive voltage drop and electromagnetic interference over long cable runs. A 10mV noise spike on a 4–20mA loop is negligible; on a 0–5V signal it's meaningful error.

The 4-20ma output is also mostly immune to loading effects at the ADC and and also capable of laughing at fairly long wire runs. THe 20awg wire I'm using for it is massive overkill.



Conclusion

The sensors are largely immune to any EMI error that would matter within integer units of temperature (c/f) or pressure (PSI/kPa).
 
Here's a brief video of the function. Note that only the temp sensor is connected so the pressure switches units but still shows zero.



Edit to add the temperature function demo:

 
Last edited:
We’re all but done with bench testing; the pressure response is making me very happy. Responds to over 5 bar essentially instantly and the max value in the corner is actually independent of the display.


Always glad to see progress. I wish something like this was commonly available without having to spend hundreds or a thousand.

Have you seen the Madman EMS3?
 
Last edited:
I applaud your ingenuity! But first a question. You mentioned you had a hard time finding decent 52mm gauges and sending units. Why 52mm?

There are tens of thousands of professional race car drivers (Nascar, NHRA, etc) and automotive enthusiasts all over the world using 2-1/16" gauges from companies like Autometer and others. They make a variety of options from more affordable to professional. I'm sure they even sell the pods to install them somewhere in your vehicle. 2-1/16" is the aftermarket standard gauge size, followed by 3-3/8" and 5" which are more often used for speedo/tach.

Just curious. I'm an Electrical Engineer and this is very interesting to me but at this point in my life with kids and too many projects...I'd just swap in some aftermarket stuff. Cool project though!
 
Last edited:
Back
Top Bottom