Skip to content

Temperature measurement with cheap NTC's

Daniel Berenguer edited this page Sep 18, 2015 · 15 revisions

Thermistors

Thermistors provide a simple and inexpensive way to measure temperatures. They are resistors whose resistance change significantly with temperature. Compared with other solutions like the TP36 or LM35 IC's, thermistors are cheaper and more accurate. They can work at any voltage, they are very robust and can be simply powered from an output pin.

Among thermistors, NTC's (Negative Temperature Coeficient) are easier to use for temperature measurements whilst PTC's are mostly used in switching applications. The downside of thermistors is that they are not linear so look-up tables or more complex formulas have to be implemented in order to transform voltage (or resistance) into temperature readings. For this aplication we will apply the Steinhart–Hart equation wich will release us from having to create our own look-up table.

Wiring

The simplest thermistors circuit consists of a thermistor and a series resistor. We are using the following parts in our example:

  • 10 Kohm 1% thermistor
  • 10 Kohm 1% series resistor

Minibat NTC includes SM0603 footprints for a NTC circuit. panStamp sell this board with the NTC circuit in place.

minibat with on-board NTC

Power

Our NTC circuit can be powered from any voltage so sensor and panStamp can share the same source of power. This lets us power the NTC from an output pin for example and, as result, we can power the whole wireless module from a simple 3V battery. This makes this wireless temperature sensor really simple, cheap and low-power. Current consumption is under 2 uAmps during sleep mode and around 30 mAmps when measuring and transmitting.

minibat with panStamp NRG powered from a couple of AAA batteries

Sample code

We provide a SWAP-compatible sample application called ntc. This application or sketch works out of the box with minibat-ntc so no other changes have to be made in the code.

Thes code is quite simple. It relies on our thermistor library and SWAP stack. If you don't want to dive into the code, simply grab the application into your panStamp and configure your desired transmission interval from SWAPdmt.

SWAP packets

SWAP status packets transmitted by this application are very simple. Data payload simply consists of two bytes. temp.xml is the device definition file used for this application. In order to transform this 2-byte number into a readable temperature you have to apply the formulas defined in the units section of this XML file:

  • Celsius degrees: Temperature (ºC) = data x 0.1 - 50
  • Fahrenheit degrees: Temperature (ºF) = data x 0.18 - 58
  • Kelvin degrees: Temperature (ºK) = data x 0.1 + 223.15