View Single Post
Old 12-03-2010, 03:50 AM   #4073 (permalink)
DJBecker
EcoModding Apprentice
 
Join Date: Nov 2010
Location: Annapolis
Posts: 159
Thanks: 0
Thanked 32 Times in 27 Posts
The Cougar board uses a NTC thermistor. It's inexpensive and easy to design around, but it's not linear. Combined with the loose tolerance of the surrounding resistors, you won't be able to do a direct conversion. Instead you'll need to create a curve fit polynomial to match your specific parts (as above) or a calibration table that you interpolate from.

Here are the notes I took when selecting the temperature sensors for our controller. We had a slightly different set of design goals.
- Most of the sensors were for reporting, rather than thermal limits, thus a calibrated result was important
- We wanted more sensors, and individual calibration would be a bit of a PITA
- We wanted automotive CAN bus reporting, thus needed degrees Celsius reporting.

---------------------


Temperature sensors

The LM335 is inexpensive and has an output voltage in "degrees Kelvin",
2.73V at 0C, 2.98V at 25C. We need a 2K ohm bias resistor for 5V operation
to get the approximately 1mA of operating current

A LM35 is a bit more expensive, but requires no bias resistor, uses
less current, and has a source lower impedance for a better A/D conversion.
(The A/D converter has trivial leakage current, but the sample
capacitor requires a low impedance source to charge correctly during the
short sample period.) The down-side is that it outputs 0V at 0C, and less
at lower temperatures.

The least expensive option is a themisor, where the output is non-linear
and depends on the bias reistor. The Cougar uses a B57862S103F40 thermistor
with a two resistor bias tree, and a 0.1uF cap.

An alternative is using digital sensors e.g. one wire. They aren't much
more expensive, and save on A/D channels, but may take a little more
processing time.

TI TMP75AIDGKT Digital temp sensor 2 wire 8 MSOP Digikey $1.54
Dallas DS18B20 One-wire, possible single pair operation, 750msec
$2 in medium quantity, $6 in a probe format

----------------------

And the comments from the CAN reporting code

case 0x05: /* Coolant temp A-40 -40C..+215C, use heatsink temp. */
/* Assume a LM335 where Kelvin = 100 * 5V * (count / 1024)
* Our baseline temp is -40C or 233.15 Kelvin, or 2.33V
* which is an A/D reading of about 477
* DataA = ((500 * rt_data.raw_hs_temp)/ 1024) - 233 */
can_cmd.dataA = (125 * (rt_data.raw_hs_temp - 477)) >> 8;
good = 3;
break;
  Reply With Quote
The Following User Says Thank You to DJBecker For This Useful Post:
mpgmike (01-19-2022)