From the course: Learning CircuitPython with Circuit Playground Express

Unlock the full course today

Join today to access over 22,600 courses taught by industry experts or purchase this course individually.

Sensing temperature

Sensing temperature - Python Tutorial

From the course: Learning CircuitPython with Circuit Playground Express

Start my 1-month free trial

Sensing temperature

- [Instructor] In this video, we're going to work with the temperature sensor on the Circuit Playground Express. The temperature sensor is located near pads A2 and A3. The sensor is called a thermistor, and there's a small thermometer printed on the circuit board next to it. Using the temperature sensor is easy with the CPX module, which returns the temperature in degrees centigrade. One application of the temperature sensor might be an alert that is triggered when the temperature gets too high. Here's the algorithm for the alert. First, record the initial room temperature as a reference. Then loop continuously, checking the current temperature against the reference. If the temperature is above the threshold, turn the NeoPixels red. Otherwise, turn them black. That's the basic idea. Let's head to the desktop to explore coding the temperature alert. Here I am on the desktop. I'm going to open up Atom. Make it full…

Contents