Oil Temp Indicator - LotusTalk - The Lotus Cars Community
 1Likes
Reply
 
LinkBack Thread Tools Display Modes
post #1 of 31 (permalink) Old 08-05-2015, 08:20 AM Thread Starter
Registered User
 
jdawson's Avatar
 
Join Date: Mar 2014
Posts: 384
Oil Temp Indicator

I've wanted to come up with a clean oil temp & oil pressure gauge solution for quite a while now. I've prototyped bench-top arduino + LCD assemblies to handle this task... and they worked, but I never got around to designing an LCD mount or installing the hardware. After a while, I came up with a simple oil temperature indicator idea.

The basics:
Arduino Pro Mini
AEM fluid temp sensor
Mishimoto sensor adapter
VDO remote mounted pressure sender
5mm RGB LED
Simple regulated 12V power supply

The AEM temp sensor is a thermistor, varying resistance in relation to temperature. AEM publishes the resistance specs over a large range of temperatures. After concepting a simple circuit, I plotted the a 3rd order polynomial "best fit" line to the anticipated analog voltage I would see at the Arduino input. This gave me the equation to convert voltage to "Deg F". From there, I defined 4 temperature intervals for the RGB LED outputs:

<170 = blue
170 to 240 = green
240 to 285 = yellow
>285 = red

The code uses a running average of 10 measurements and the main code loops once per second. I used 1k ohm resistors to dim the LED... which I thought would be enough. I would probably use a higher resistance value if I were to build it again, as the LED is quite bright. The good news is that it should be visible in direct sunlight. Haha.

Of interesting note, letting the car warm up at idle.... it took 17 minutes for the oil to reach 170 degrees F AFTER the water temperature reached 170 degrees F. I will now be warming my car up much longer before auto-x runs.

Here are some pics.

Mishimoto adapter and sensors. I installed a VDO pressure sender, as well.


Switch power source from flasher plug in center console.


Running sensor wires into passenger compartment was easy.


My mess of arduino, power, signal and LED wires in center console.


LED mounted


And... it works!

2006 Lotus Elise
jdawson is offline  
Sponsored Links
Advertisement
 
post #2 of 31 (permalink) Old 08-05-2015, 08:24 AM
Registered User
 
Join Date: Sep 2013
Location: Boulder, CO
Posts: 945
Nice and simple!

I'm working on the same thing but with Bluetooth serial on the microcontroller, outputting to a Torque for Android plugin so I can keep all my data in one place.
bri3d is offline  
post #3 of 31 (permalink) Old 08-05-2015, 08:27 AM
Registered User
 
LSDaddict's Avatar
 
Join Date: Oct 2014
Location: Colorado
Posts: 13
Awesome.
LSDaddict is offline  
 
post #4 of 31 (permalink) Old 08-05-2015, 08:28 AM
Registered User
 
Join Date: Mar 2012
Posts: 253
That's excellent. I'm curious how long it takes to get 170F oil temps out of the car; on my cars with temp gauges, it takes a lot longer than I'd have thought.

Tempting to build, but how to incorporate carbon?
mannix is offline  
post #5 of 31 (permalink) Old 08-05-2015, 08:29 AM Thread Starter
Registered User
 
jdawson's Avatar
 
Join Date: Mar 2014
Posts: 384
Quote:
Originally Posted by mannix View Post
Tempting to build, but how to incorporate carbon?
Something tells me you'll find a way

2006 Lotus Elise
jdawson is offline  
post #6 of 31 (permalink) Old 08-05-2015, 09:55 AM
He's on fire!
 
jds62f's Avatar
 
Join Date: Jun 2006
Posts: 3,081
very cool. Care to publish your code? :-) Also, it doesn't look like you have incorporated the pressure data output? Are you planning to add another LED, or use the same one under an OR condition (ie low temp or low pressure is a red light)

What sandwich plate is that?

"Give a man a match, and he'll be warm for a minute, but set him on fire, and he'll be warm for the rest of his life."
jds62f is offline  
post #7 of 31 (permalink) Old 08-05-2015, 10:02 AM
purveyor of lightness
 
darkSol's Avatar
 
Join Date: Feb 2004
Location: Leawood, KS
Posts: 4,060
Garage
Ok this is beyond awesome!

Four years ago I handcrafted a launch control system using a Netduino. It tied into the front right ABS wheel speed sensor and had a solid state relay for selecting an secondary map (identical as primary except for the 3400 rpm rev limit) for the EFI I was running at the time. It worked flawlessly.

I've been waiting for more electronic integration in our cars. This is an excellent use of an Arduino!

.
d.a..v...i....d

David Thomas Stewart - [email protected]
2005 Midnight Silver Lotus Elise (www.darksol.com) 388hp (342whp) BOE RevX 1736lbs.
2018 Midnight Silver Tesla Model 3 Performance
2016 Machine Gray Metallic Mazda CX-9
darkSol is offline  
post #8 of 31 (permalink) Old 08-05-2015, 10:04 AM Thread Starter
Registered User
 
jdawson's Avatar
 
Join Date: Mar 2014
Posts: 384
Quote:
Originally Posted by jds62f View Post
very cool. Care to publish your code? :-) Also, it doesn't look like you have incorporated the pressure data output? Are you planning to add another LED, or use the same one under an OR condition (ie low temp or low pressure is a red light)

What sandwich plate is that?
Yeah, I can post my code this evening. I don't code for a living... so keep that in mind when critiquing!

I haven't decided what I want to do for the oil pressure. Maybe a small 4D Systems intelligent LCD for a live readout and low-pressure warning LED. I need to figure out how to code RPM into the Arduino logic so I can define an allowable RPM vs. oil pressure relationship. I wouldn't want the warning light to illuminate at idle because oil pressure is below 50psi. Similarly, I wouldn't want the system to show everything is OK at redline with 50psi of oil. Something like 7 or 8 psi per 1000 RPM would be my first guess of allowable minimum oil pressure.

It's a Mishimoto sandwich plate.

2006 Lotus Elise
jdawson is offline  
post #9 of 31 (permalink) Old 08-05-2015, 10:14 AM
Registered User
 
cyow5's Avatar
 
Join Date: Mar 2013
Location: NoVa
Posts: 3,879
Quote:
Originally Posted by jdawson View Post
Yeah, I can post my code this evening. I don't code for a living... so keep that in mind when critiquing!

I haven't decided what I want to do for the oil pressure. Maybe a small 4D Systems intelligent LCD for a live readout and low-pressure warning LED. I need to figure out how to code RPM into the Arduino logic so I can define an allowable RPM vs. oil pressure relationship. I wouldn't want the warning light to illuminate at idle because oil pressure is below 50psi. Similarly, I wouldn't want the system to show everything is OK at redline with 50psi of oil. Something like 7 or 8 psi per 1000 RPM would be my first guess of allowable minimum oil pressure.

It's a Mishimoto sandwich plate.
You could probably CAN the rpm into the arduino, right? You'd also want a temp reference. If you could build up either a two-input lookup table or come up with an equation that says min oil pressure is a function of temp and rpm, then you could have a pretty solid diagnostic tool.

"Lots Of Trouble; Usually Serious"
cyow5 is offline  
post #10 of 31 (permalink) Old 08-05-2015, 10:22 AM Thread Starter
Registered User
 
jdawson's Avatar
 
Join Date: Mar 2014
Posts: 384
Quote:
Originally Posted by cyow5 View Post
You could probably CAN the rpm into the arduino, right? You'd also want a temp reference. If you could build up either a two-input lookup table or come up with an equation that says min oil pressure is a function of temp and rpm, then you could have a pretty solid diagnostic tool.
The CAN protocol is where my knowledge starts to breakdown. If someone can school me on how to feed CAN RPM data to the Arduino that would be awesome.

Since I have the temperature data, it would be relatively easy to incorporate the oil temp into the low-oil-pressure-warning system.

However at low temperature, the oil pressure is going to be higher than when the system is at operating temperature. So, would it really be necessary to alter the low-pressure limits for cold oil temps considering the system will be at lower oil pressures with heat in the system? Seems like you could just define the higher-temp, lower-pressure limit conditions and you'd be OK for low-temp conditions as well. Maybe I'm misunderstanding what you meant, cyow5. I hadn't previously thought about blending oil pressure and oil temperature data for a warning system.

2006 Lotus Elise
jdawson is offline  
post #11 of 31 (permalink) Old 08-05-2015, 10:27 AM
Registered User
 
cyow5's Avatar
 
Join Date: Mar 2013
Location: NoVa
Posts: 3,879
Quote:
Originally Posted by jdawson View Post

However at low temperature, the oil pressure is going to be higher than when the system is at operating temperature. So, would it really be necessary to alter the low-pressure limits for cold oil temps considering the system will be at lower oil pressures with heat in the system? Seems like you could just define the higher-temp, lower-pressure limit conditions and you'd be OK for low-temp conditions as well. Maybe I'm misunderstanding what you meant, cyow5. I hadn't previously thought about blending oil pressure and oil temperature data for a warning system.
You are generally correct and would probably be just fine. Adding a temp input would help you detect a cold oil leak sooner, but I doubt it would be completely necessary, just fun.

I've always wanted to play around with an Arduino, so I'll just have to live vicariously through guys like you in the meantime. Keep it up!

"Lots Of Trouble; Usually Serious"
cyow5 is offline  
post #12 of 31 (permalink) Old 08-05-2015, 01:18 PM
Registered User
 
Join Date: Sep 2013
Location: Boulder, CO
Posts: 945
Quote:
Originally Posted by jdawson View Post
The CAN protocol is where my knowledge starts to breakdown. If someone can school me on how to feed CAN RPM data to the Arduino that would be awesome.
I use this shield:

https://www.sparkfun.com/products/10039

It's overpriced (like all Arduino stuff) but comes with SD built in, which is great for making a data logger

It's also designed really well and has a ton of nice features like power off of the OBD connector if you go that route.

I used this library to start:

https://github.com/franksmicro/Ardui...raries/MCP2515

The documentation for the CAN protocol used in the Elise dashboard is here:

https://www.lotustalk.com/forums/f129...nalysis-10866/
bri3d is offline  
post #13 of 31 (permalink) Old 08-05-2015, 01:28 PM Thread Starter
Registered User
 
jdawson's Avatar
 
Join Date: Mar 2014
Posts: 384
Thanks for the resources. I probably won't be able to resist tinkering with some of the Arduino CAN hardware.

2006 Lotus Elise
jdawson is offline  
post #14 of 31 (permalink) Old 08-05-2015, 06:27 PM Thread Starter
Registered User
 
jdawson's Avatar
 
Join Date: Mar 2014
Posts: 384
Quote:
Originally Posted by jds62f View Post
Care to publish your code? :-)
// GENERAL PARAMETERS & CONSTANTS
const int RedPin = 3; // red value output on PWM pin 3
const int GreenPin = 5; // green value output on PWM pin 5
const int BluePin = 6; // blue value output on PWM pin 6
const int OTSensorPin = 0; // analog sensor connected to input pin 0
int RawOT = 0; // raw ADC reading, integer
float OT = 0; // oil temp in F, decimal value
float OTV = 0; // oil temp in VDC, decimal value

// SMOOTHING PARAMETERS
const int numReadings = 10; // number of readings to average
int readingsOT[numReadings]; // the readings from the analong oil temp input, integer
int index = 0; // the index of the current reading, integer
int totalOT; // the running oil temp total, integer
int aveOT = 0; // the oil temp average, integer

void setup() {
// put your setup code here, to run once:
pinMode(RedPin,OUTPUT); // define output on pin linked to "RedPin" integer
pinMode(GreenPin,OUTPUT); // define output on pin linked to "GreenPin" integer
pinMode(BluePin,OUTPUT); // define output on pin linked to "BluePin" integer
Serial.begin(9600); // communicate with serial protocol, debugging
}

void loop() {
OilTemp();
Serial.println(aveOT); // print average oil temp via serial
Serial.println(OTV); // print oil temp voltage value
if (aveOT < 170) {
SetColor(0,0,255); // blue
delay(500);
}
else if ((aveOT >= 170) && (aveOT < 240)) {
SetColor(0,255,0); // green
delay(500);
}
else if ((aveOT >= 240) && (aveOT < 275)) {
SetColor(255,255,0); // yellow
delay(500);
}
else if (aveOT >= 275) {
SetColor(255,0,0); // red
delay(500);
}
}

void OilTemp() {
RawOT = analogRead(OTSensorPin); // read analog value
delay(1); // delay 1 millisecond
OTV = 5.0*RawOT/1024; // convert ADC value to voltage
OT = -5.1656*OTV*OTV*OTV+42.947*OTV*OTV-160.1*OTV+404.31; // convert voltage to deg. F

// SMOOTHING OPERATIONS
// subtract the last reading:
totalOT= totalOT - readingsOT[index];

// current sensor reading
readingsOT[index] = OT;

// add the reading to the total:
totalOT= totalOT + readingsOT[index];

// advance to the next position in the arrays:
index = index + 1;

// if we're at the end of the array...
if (index >= numReadings) {

// ...wrap around to the beginning:
index = 0;

// calculate the average
aveOT = totalOT / numReadings;
}
}

void SetColor(int red, int green, int blue){

// use the three lines below if common anode LED
red = 255-red;
green = 255-green;
blue = 255-blue;

analogWrite(RedPin,red); // write "R" component to PWM output 1
analogWrite(GreenPin,green); // write "G" component to PWM output 2
analogWrite(BluePin,blue); // write "B" component to PWM output 3
}

2006 Lotus Elise
jdawson is offline  
post #15 of 31 (permalink) Old 08-05-2015, 06:32 PM
Registered User
 
Motard's Avatar
 
Join Date: Feb 2010
Location: Knoxville, Tennessee
Posts: 1,445
Garage
Very cool man. I took note of your oil temp data summation. That is approx the 30 minutes of driving before second cam.

Yours is a very elegant solution!

L O T U S
Motard is offline  
post #16 of 31 (permalink) Old 08-05-2015, 06:36 PM Thread Starter
Registered User
 
jdawson's Avatar
 
Join Date: Mar 2014
Posts: 384
Quote:
Originally Posted by Motard View Post
Very cool man. I took note of your oil temp data summation. That is approx the 30 minutes of driving before second cam.

Yours is a very elegant solution!
Thanks!

Yep, about 25-30 minutes of warmup at idle. I'll hit the road with it in a bit. I imagine it will warm up much quicker with low load driving. More to follow...

2006 Lotus Elise
jdawson is offline  
post #17 of 31 (permalink) Old 08-05-2015, 07:31 PM
Registered User
 
doug_porsche's Avatar
 
Join Date: Jun 2008
Location: 38th state
Posts: 2,249
That is just so dang cool!


Apexes are a lot like relationships. So tough to get right, so easy to see where they went wrong.

The secret to a long life is ------- not dying.
doug_porsche is offline  
post #18 of 31 (permalink) Old 08-05-2015, 08:04 PM Thread Starter
Registered User
 
jdawson's Avatar
 
Join Date: Mar 2014
Posts: 384
With normal surface street driving warm up conditions, here's how long oil warm up took:

9:10pm - start car
9:15pm - start driving
9:18pm - 170 F water temp
9:22pm - 170 F oil temp
jdawson is offline  
post #19 of 31 (permalink) Old 08-17-2015, 06:33 AM
Registered User
 
Join Date: Sep 2013
Location: Boulder, CO
Posts: 945
If you're interested in tinkering with the CAN, I wrote a really simple setup which uses a string of WS2811 color-changing LED pixels as shift lights. I made them sensitive to the temperature as well as the ECU-sent shift light signal, so it should give you a good idea of how to use various parts of the 0x400 CAN message that our ECUs broadcast.

https://github.com/bri3d/elise-shift...ift_lights.ino

I ended up using this CAN library: https://github.com/Seeed-Studio/CAN_BUS_Shield as it seems decently well written and already has the constants for 1Mbit CAN with a 16Mhz crystal set up.

This should work the same way on '08+ cars as the data didn't change that much, but the CAN speed should be set to 500Kbit instead of 1Mbit. I was also able to use two CAN transceivers to drive an '08 dash off of my '06 car, but I don't have a source for the right connectors to make it reliable, and the '08 dash I bought turned out to be broken anyway so now I get to take it apart and try to repair it.
bri3d is offline  
post #20 of 31 (permalink) Old 08-17-2015, 02:54 PM Thread Starter
Registered User
 
jdawson's Avatar
 
Join Date: Mar 2014
Posts: 384
Thanks for the resources. I'm working on the idea of a 7" LCD from 4D Systems, an arduino mega2560 (for multiple serial communications), the OBDII UART adapter and an array of analog sensors to build a replacement gauge cluster.

Something like this feature set would be awesome:
- RPM bar graph with shift light(s)
- Digital speedo (corrected/calibrated using GPS datalogs)
- Fuel level from stock sensor
- Water temp from stock sensor
- Oil temp from non-stock sensor
- Oil pressure from non-stock sensor
- RPM (and temp?) based low-oil-pressure warning system
- CEL display (maybe even the code # displayed)

2006 Lotus Elise
jdawson is offline  
Sponsored Links
Advertisement
 
Reply

  LotusTalk - The Lotus Cars Community > Lotus Discussions > Electrical

Quick Reply
Message:
Options

Register Now



In order to be able to post messages on the LotusTalk - The Lotus Cars Community forums, you must first register.
Please enter your desired user name, your email address and other required details in the form below.

User Name:
Password
Please enter a password for your user account. Note that passwords are case-sensitive.

Password:


Confirm Password:
Email Address
Please enter a valid email address for yourself.

Email Address:
OR

Log-in











Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools
Show Printable Version Show Printable Version
Email this Page Email this Page
Display Modes
Linear Mode Linear Mode



Posting Rules  
You may post new threads
You may post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On

 
For the best viewing experience please update your browser to Google Chrome