Multiple temperature sensors (Arduino)

Technical questions and answers about the Mazda Bongo

Moderators: Doone, westonwarrior

User avatar
Driver+Passengers
Supreme Being
Posts: 2019
Joined: Mon Mar 14, 2011 1:56 pm
Location: Fife

Re: Multiple temperature sensors (Arduino)

Post by Driver+Passengers » Thu Jul 05, 2012 5:29 pm

Another type of sensor to integrate - coolant pressure.

viewtopic.php?f=3&t=56588
Image Image
What she doesn't know won't hurt me.
User avatar
Driver+Passengers
Supreme Being
Posts: 2019
Joined: Mon Mar 14, 2011 1:56 pm
Location: Fife

Re: Multiple temperature sensors (Arduino)

Post by Driver+Passengers » Mon Jul 16, 2012 10:55 pm

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...

Image
Image Image
What she doesn't know won't hurt me.
peterrc
Bongolier
Posts: 186
Joined: Sat May 12, 2012 7:07 am

Re: Multiple temperature sensors (Arduino)

Post by peterrc » Tue Jul 17, 2012 9:28 am

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...

Image
Hi Matt, did you get my e-mail? Have you thought of selling this as 'Pop Art'?
Peter
User avatar
Driver+Passengers
Supreme Being
Posts: 2019
Joined: Mon Mar 14, 2011 1:56 pm
Location: Fife

Re: Multiple temperature sensors (Arduino)

Post by Driver+Passengers » Tue Jul 17, 2012 9:53 am

peterrc wrote:Hi Matt, did you get my e-mail? Have you thought of selling this as 'Pop Art'?
Peter
I did get it, Peter - I'm just cogitating the permutations... ;)

The graphs are cool, aren't they?! :D
Image Image
What she doesn't know won't hurt me.
User avatar
Driver+Passengers
Supreme Being
Posts: 2019
Joined: Mon Mar 14, 2011 1:56 pm
Location: Fife

Re: Multiple temperature sensors (Arduino)

Post by Driver+Passengers » Tue Jul 17, 2012 9:55 am

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.
Image Image
What she doesn't know won't hurt me.
User avatar
Rhinoman
Bongolier
Posts: 330
Joined: Mon Jan 11, 2010 7:45 pm
Location: Brinkworth, Wilts
Contact:

Re: Multiple temperature sensors (Arduino)

Post by Rhinoman » Tue Jul 17, 2012 10:26 pm

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.
User avatar
Driver+Passengers
Supreme Being
Posts: 2019
Joined: Mon Mar 14, 2011 1:56 pm
Location: Fife

Re: Multiple temperature sensors (Arduino)

Post by Driver+Passengers » Tue Jul 17, 2012 10:59 pm

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?
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...

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.
Image Image
What she doesn't know won't hurt me.
User avatar
Northern Bongolow
Supreme Being
Posts: 7722
Joined: Mon Mar 15, 2010 11:33 pm
Location: AKA Vanessa

Re: Multiple temperature sensors (Arduino)

Post by Northern Bongolow » Wed Jul 18, 2012 12:01 am

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.
User avatar
Driver+Passengers
Supreme Being
Posts: 2019
Joined: Mon Mar 14, 2011 1:56 pm
Location: Fife

Re: Multiple temperature sensors (Arduino)

Post by Driver+Passengers » Wed Jul 18, 2012 12:06 am

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.
:oops: :lol: :lol:

Glow plug relay is already near the top of the list to sample.
Image Image
What she doesn't know won't hurt me.
User avatar
Driver+Passengers
Supreme Being
Posts: 2019
Joined: Mon Mar 14, 2011 1:56 pm
Location: Fife

Re: Multiple temperature sensors (Arduino)

Post by Driver+Passengers » Mon Oct 15, 2012 11:03 am

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...

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);
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.
Image Image
What she doesn't know won't hurt me.
User avatar
Driver+Passengers
Supreme Being
Posts: 2019
Joined: Mon Mar 14, 2011 1:56 pm
Location: Fife

Re: Multiple temperature sensors (Arduino)

Post by Driver+Passengers » Mon Oct 15, 2012 5:32 pm

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
Image Image
What she doesn't know won't hurt me.
Locked

Return to “Techie Stuff”