# Measuring temperature

There are different ways to measure temperature. One is simpler (read: cheaper), the other more accurate. The temperature sensor used in the ControlCO2 sensor is a thermistor.

## Resistance

Electronics are everywhere these days. Washing machines, coffee machines, smartphones, tablets, doorbells, bicycle lights, .... Almost everything contains some form of electronics these days. Or look at any CO2 sensor. These too contain electronics. And the ControlCO2 is a fine example of these electronics. Whereas in most devices the electronics are invisible because of the housing it is in, this is not the case with the ControlCO2 sensor. It has no housing, so you can see the pure electronics.

For example, if you look at the circuit board of ControlCO2, you will see several parts on it. All these parts are somehow connected to each other. Electrons will flow between all these parts. And we can influence the behaviour of these electrons by using the right parts.
You can compare the flow of electrons with the flow of water. By building pipes, we can bring water from one point to another. And by using the right components (water taps and valves, water barrels, constrictions, etc.) we can influence the behaviour of the water (e.g. block it with a valve or make it flow more slowly by using a smaller pipe).

One of the most commonly used components in electronics is a resistor. Simply put, a resistor will stop the movement of electrons (compare it to a constriction in a water pipe).

There are various types of resistor. Fixed resistors (such as a constriction in a water pipe) but also variable resistors (such as a tap in a water pipe, which you can open or close and thus control the constriction). But there are also resistors that depend on physical conditions. A thermistor is one of them.

## Thermistor

A thermistor is a variable resistor. The resistance of a thermistor will change when the temperature changes.

Thermistor is a combination of the words "Thermal" and "Resistor".
There are two types of thermistors: NTC and PTC. NTC stands for 'Negative Temperature Coefficient', whereas PTC stands for 'Positive Temperature Coefficient'. With an NTC, the resistance will decrease as the temperature rises, and increase as the temperature falls. With a PTC, it is the other way around (resistance will increase when temperature rises, resistance will decrease when temperature drops).

Every resistor is temperature sensitive but a thermistor is made to be extra sensitive. The graph below shows the change of a 10 kOhm NTC thermistor. Note that the resistance is 10 kOhm at 25℃ ambient temperature. If temperature decreases, resistance increases. If temperature rises, resistance falls. Also note that this is not a nice linear curve (it is not a nice straight line, but there is a curve in it).

Because the curve is not nicely linear (not a nice straight one), we need a relatively complex formula to determine the right temperature for a certain measured resistance. Below you can see such a formula (don't panic, the temperature sensor used in ControlCO2 will do this calculation for you).

So by measuring the resistance of the thermistor we can, by means of the above formula, determine the temperature. And this is how a temperature sensor works.