Multiple temperature sensors (Arduino)
Moderators: Doone, westonwarrior
- Driver+Passengers
- Supreme Being
- Posts: 2019
- Joined: Mon Mar 14, 2011 1:56 pm
- Location: Fife
- Driver+Passengers
- Supreme Being
- Posts: 2019
- Joined: Mon Mar 14, 2011 1:56 pm
- Location: Fife
Re: Multiple temperature sensors (Arduino)
I've got the arduino logging to SD card. Performed minor brain surgery on the Bongo this evening, including tapping off the TPS voltage from one of the ECU connectors. A couple of dozen zip ties and a meter or two of electrical tape later, here is what I've got...


Re: Multiple temperature sensors (Arduino)
Hi Matt, did you get my e-mail? Have you thought of selling this as 'Pop Art'?Driver+Passengers wrote:I've got the arduino logging to SD card. Performed minor brain surgery on the Bongo this evening, including tapping off the TPS voltage from one of the ECU connectors. A couple of dozen zip ties and a meter or two of electrical tape later, here is what I've got...
Peter
- Driver+Passengers
- Supreme Being
- Posts: 2019
- Joined: Mon Mar 14, 2011 1:56 pm
- Location: Fife
Re: Multiple temperature sensors (Arduino)
I did get it, Peter - I'm just cogitating the permutations...peterrc wrote:Hi Matt, did you get my e-mail? Have you thought of selling this as 'Pop Art'?
Peter

The graphs are cool, aren't they?!

- Driver+Passengers
- Supreme Being
- Posts: 2019
- Joined: Mon Mar 14, 2011 1:56 pm
- Location: Fife
Re: Multiple temperature sensors (Arduino)
The big blue LCD requires a -14V supply to drive the LCD. I'd previously had this connected from a bench supply but was concerned how I was going to provide -14V in the vehicle. However, just discovered that the LCD board has it's own negative supply - just a case of attaching a pot to control contrast. Well chuffed.
Re: Multiple temperature sensors (Arduino)
Can you get the scaling correct? I'm wondering why the battery voltage is dropping when you accelerate, where is the load coming from?
1995 Ford Freda, 2.5TD, auto, AFT, side conversion.
- Driver+Passengers
- Supreme Being
- Posts: 2019
- Joined: Mon Mar 14, 2011 1:56 pm
- Location: Fife
Re: Multiple temperature sensors (Arduino)
Engine was not running, I was checking the TPS voltage with a multimeter as my mate tickled the peddle - I did not have a read out on the arduino itself at the time, we were just checking the 12V inputs were being scaled down correctly. We heard a buzzing with the throttle somewhere around half way down, but could not locate it - no doubt linked to the voltage drop. Good spot - I'm not sure...Rhinoman wrote:Can you get the scaling correct? I'm wondering why the battery voltage is dropping when you accelerate, where is the load coming from?
I'll need to do a couple of tests to calibrate the scale, but I'll try zooming in on that section and see what shows.
Edit: you can see three levels for the battery - corresponding with key position I, II and running. The initial drop might be glow plugs, then some additional load once they're out - not sure. You can see the same sort of the thing on the TPS voltage - one of the levels corresponds with ignition off/TPS unpowered.
- Northern Bongolow
- Supreme Being
- Posts: 7722
- Joined: Mon Mar 15, 2010 11:33 pm
- Location: AKA Vanessa
Re: Multiple temperature sensors (Arduino)
if cold matt the glowplugs come back on occassionally until the engine is deemed warm, unless the revs rise above 900 if i remember right, above that they turn off, if the revs drop, like at the traffic lights they come on again then when warm the egr will be activated.
knowing how your throttle is set up this could be your fly in your soup mate.
knowing how your throttle is set up this could be your fly in your soup mate.
- Driver+Passengers
- Supreme Being
- Posts: 2019
- Joined: Mon Mar 14, 2011 1:56 pm
- Location: Fife
Re: Multiple temperature sensors (Arduino)
Northern Bongolow wrote:if cold matt the glowplugs come back on occassionally until the engine is deemed warm, unless the revs rise above 900 if i remember right, above that they turn off, if the revs drop, like at the traffic lights they come on again then when warm the egr will be activated.
knowing how your throttle is set up this could be your fly in your soup mate.



Glow plug relay is already near the top of the list to sample.
- Driver+Passengers
- Supreme Being
- Posts: 2019
- Joined: Mon Mar 14, 2011 1:56 pm
- Location: Fife
Re: Multiple temperature sensors (Arduino)
Spent a bit of time over the weekend getting the code on the Arduino sorted. There's no point in fitting sensors to the vehicle if they're not being read. And there's no point reading sensors if you're not going to alarm on them, by the time you read off an overheat on the LCD screen, it's too late.
Given another overheat a couple of weeks ago, I'm getting the code to a point where I can fit it all back in the van for the next long drive later this week.
For any C++/Arduino bods reading, I'm writing the code such that I can do this...
The current Alarm template class simply compares the current sensor value against minimum and maximum thresholds. I will write another class to alarm when the 1st time derivative exceeds a particular threshold, eg "pressure has risen more than 2 psi in the last 20 seconds", "pressure has dropped more than 2 psi in the last 2 seconds", or "temperature rise exceeds 0.3 deg/second". Whatever those thresholds are.
Realtime clock and SD card still todo, as well as the physical wiring to the interface components I used in an earlier prototype.
Given another overheat a couple of weeks ago, I'm getting the code to a point where I can fit it all back in the van for the next long drive later this week.
For any C++/Arduino bods reading, I'm writing the code such that I can do this...
Code: Select all
class SensorArray
{
public:
DallasTemperatureSensor tSensorHead;
DallasTemperatureSensor tSensorAmbient;
FreescalePressureSensor pSensorHeaderTank;
SensorArray()
: tSensorHead ("Cyl. head #1", HEAD_TEMPSENSOR_ADDRESS),
tSensorAmbient ("Ambient", AMBIENT_TEMPSENSOR_ADDRESS),
pSensorHeaderTank("Header tank", PIN_7)
{}
};
SensorArray sensors;
//AlarmType Name Sensor, MIN, MAX
Alarm<Temperature> CoolantTemperatureAlarm (sensors.tSensorHead, 2 * degC, 90 * degC);
Alarm<Temperature> FrostAlarm (sensors.tSensorAmbient, 1 * degC, DONT_CARE);
Alarm<Pressure> HeaderTankCapAlarm (sensors.pSensorHeaderTank, -1 * psi, 15 * psi);
Realtime clock and SD card still todo, as well as the physical wiring to the interface components I used in an earlier prototype.
- Driver+Passengers
- Supreme Being
- Posts: 2019
- Joined: Mon Mar 14, 2011 1:56 pm
- Location: Fife
Re: Multiple temperature sensors (Arduino)
I'll forget this otherwise, so posting it here.
On the SainSmart 3.2" LCD panel and adapter shield, pins 51/52 are swapped (SCK/MOSI) which means SD card will not work out of the box.
Solution:
"SD/utility/Sd2PinMap.h"
- swap MOSI and SCK pin values
"SD/utility/Sd2Card.h"
- force Mega to Software SPI.
Could avoid the software SPI and pin assignment changes with some creative soldering. Next time, perhaps.
Also some voltage level stuff involving bridging/replacing resistors here...
See http://arduino.cc/forum/index.php?actio ... c=120599.0
On the SainSmart 3.2" LCD panel and adapter shield, pins 51/52 are swapped (SCK/MOSI) which means SD card will not work out of the box.
Solution:
"SD/utility/Sd2PinMap.h"
- swap MOSI and SCK pin values
"SD/utility/Sd2Card.h"
- force Mega to Software SPI.
Could avoid the software SPI and pin assignment changes with some creative soldering. Next time, perhaps.
Also some voltage level stuff involving bridging/replacing resistors here...
See http://arduino.cc/forum/index.php?actio ... c=120599.0