Temperature Sensor - Circuit Set-up

Temperature Sensor - Circuit Set-up#

../../../_images/Tempsensor_circuit_pico.png

For connecting the temperature sensor to the Pico (the blue wire), you must use one of the analog pins ADC pins labelled ADC0, ADC1 and ADC2.

../../../_images/Tempsensor_circuit_ard.png

For connecting the temperature sensor to the Arduino (the blue wire), you must use one of the analog pins labelled ADC0 - ADC4.

Warning

Make sure to double check that you have connected your microprocessor to the correct pins of your LM35.

If you accidentally swap the Power-in and GND pins, high resistance can cause current to build up massively, making the sensor very hot.

Analog to Digital signals#

While other microcontrollers may be able to read analog inputs, the microprocesser can only read digital and so requires an Analog to Digital Converter (ADC).

As you could guess, this is a small device built into the microprocesser’s microcontroller that can convert analog input signals into digital signals. The microprocesser’s ADC has 12 bit resolution meaning it converts the 0 - 3.3V input from the analog component into a value between 0 and 4095.

../../../_images/ADC.gif

LM35 Temperature sensor#

The temperature sensor we are using is an LM35 Temperature sensor - it is compact and very widely used for its low cost and high accuracy.

The sensor works by taking in current at a certain voltage and outputting a different voltage depending on the ambient temperature. This variable outputted voltage is the analog input signal that is converted to digital and read by the microprocesser.

../../../_images/LM35circuit.png

The LM35 is calibrated so that it will output 0V at \(0^{\circ}C\). From there, a 10mV increase in the voltage corresponds to a \(1^{\circ}C\) increase in the temperature. For example, at \(25^{\circ}C\) the output voltage should be approximately 250mV or 0.25V (which the microprocesser’s ADC would convert to 310).


Our set-up can measure temperatures ranging from roughly \(2^{\circ}C\) to 150\(^{\circ}C\). The component itself has a typical accuracy of \(\pm0.25^{\circ}C\) at standard room temperatures, which climbs up to roughly \(\pm 0.75^{\circ}C\) at higher temperatures. However, we have additional innacuracies since the power input from the microprocesser often deviates slightly from 3.3V.

More specs

Check here for more information from the official LM35 datasheet.