Reliable and Accurate Temp Sensor?

Hi there,

My first post on this forum.

My question: What is the best temp sensor to use for a critical project where an Arduino board is the central control?

More Details: I'm new to Arduino programming but I've spent the past couple of weeks with an Arduino Uno Rev3 and some books getting up to speed on the basics. My purpose is to design and build a reliable system for monitoring and controlling temperature in a set of 5 battery boxes for my Electric Vehicle. I have nearly $8000 worth of batteries that I need to take very good care of.

Part of that 'proper care' is keeping them warm. I live in snow country and my EV is parked in an unheated garage. Therefore I need to keep these batteries at about 50 degrees F in the winter so they take a charge properly.

I've played with the TMP36 temp sensors referenced in two of my Arduino books and they work fine. I just wonder if they are the best sensor to use in an enclosed battery box.

I plan to use solid state relays to control a product called Flexi-Watt heat tape to warm the boxes. The bottom of the box has 1/2 inch of foam insulation. The heat tape will sit on top of the foam. A 1/8th inch thick aluminum plate will sit on top of the heat tape to help evenly spread the heat generated by the tape, to the bottom of the Lithium Ion batteries which sit on top of the aluminum plate.

I've run some tests and it seems to work well to warm the battery box as long as I am there to monitor the temperature and switch off the heat when it reaches 55 degrees F. Eventually, I'll have at least two sensors in each box. One will be near the source of the heat and act as the main temp sensor. The second will be a little removed from the first sensor and act as a seperate monitoring system to ensure that all 5 boxes are at nearly the same temp. Should one drift in temp a lot, it will signal a failure in the system and shut it all down. I'd rather not charge the batteries than to charge then unevenly.

I consider this system a critical component in the overall EV design so reliability and redundancy is very important.

Thanks in advance for any suggestions you have to offer.

Peter H.

Sounds like an interesting project.
The TMP36 has the following accuracy:

accuracies of ±1°C at +25°C and ±2°C over the ?40°C to +125°C temperature range

A One Wire has the following accuracy:

±0.5°C accuracy from –10°C to +85°C

Which one you use depends on how much accuracy you want.

The LM34 is also a nice sensor that “directly” outputs in Fahrenheit.
Think you should also add an outside thermometer.!!

Here modified basic code for the lm34 based upon some recent tests I did (not tested).

//    FILE: lm34.pde
//  AUTHOR: Rob Tillaart
//    DATE: 2012-01-24
// PURPOSE: showing LM34 fahrenheit temp sensor
// VERSION: 0.1
float raw = 0;
float t_inside = 0;
float t_outside = 0;

#define HEATERPIN 6 


void setup()

void loop()
  // 100 reads averaged give a smoother result
  raw = 0;
  for (int i=0; i<100; i++) raw += analogRead(A0);
  t_inside = 5 + raw * 5.0/1023.0;  

  raw = 0;
  for (int i=0; i<100; i++) raw += analogRead(A1);
  t_outside = 5 + raw * 5.0/1023.0;

  // two different values prevent fast switching of the system (hysteresis is the word ?)
  // the test for the outside temperature prevents unnecessary heating...
  if (t_inside > 55) HEATER = LOW;
  if (t_inside < 50 && t_outside < 50) HEATER = HIGH;

  digitalWrite(HEATERPIN, HEATER);

  // Some info for logging so you can make a graph of the switching times
  Serial.print(t_inside, 2);
  Serial.println(t_outside, 2);


I think an outside sensor is a good idea!

I just ordered a "mega" board to make things a little easier. I'd like to have at least 10 and maybe 15 sensors throughout the system to keep an eye on things so all the extra pins on the mega will help.

Don't take this the wrong way because I think what you are doing is a really cool project, but what is the purpose of an electric vehicle if you have to heat up your batteries (using extra energy) to charge them. Just curious.

Chemical processes decrease in speed with temperature. Rule of thumb a factor 2-3 for every 10 degrees C or 20 degrees F (factor depends on the exact reaction). Charging a battery is a chemical reaction so loading time depends on temperature.

Example (don't know the real numbers) :
if the batteries load in 3 hours @ 55 F they will take 6 hours @35F, or 4.5 hours @45F etc
So spending some energy on keeping the temperature at a certain level will speed up the loading.
Isolation will keep the amount of heating low.

On the other hand there is an upper limit for temperature for loading - depends on the used electrolyte.

Hi there,

Why bother to spend the energy to heat these batteries in an EV? In the case of these lithium iron phosphate batteries, their ability to take a charge or to discharge at their rated capacity depends on being above a certain temperature. This will only be done while they are in my unheadted garage and the heat will be supplied by 120 VAC from the house mains. Once the EV is on the road, the batteries will naturally warm a bit due to the discharge. This should keep them warm enough for me to make it to town and back without further warming. Unless of course, I decide to park for 8 hours or so. In that case, I'll want to find power to keep them warm and perhaps even add a bit of charge to the main battery pack.

It seems that all of the major car companies who are fielding EVs also spend a great deal of effort and energy maintaining the battery temperature to keep it within a certain range. In the case of other lithium battery chemistries,there are even greater needs to keep the batteries from getting too hot... but that is a whole other discussion.

Meanwhile, I have a new question related to this thread. I've ordered 20 of the TMP36 sensors for this project. Eventually I'll have to position them in the battery boxes. I'd like to encase the sensors in something that will protect them in that environment.

I don't expect the environment to be all that hostile but I need some way to securly mount the sensors so that there is little chance of physical damage. I was thinking of a bit of epoxy around each of them, after I've attached the necessary leads to connect them with the Arduino.

Anyone know of a reason why I shouldn't do this?