Home / Series / The Ben Heck Show / Aired Order / Season 0 / Episode 46

The Learning Circuit 15 - Make Your Own Thermometer!

DaftMike builds a thermometer using an Arduino and a thermistor. He’ll write some Arduino code, build a circuit, and then convert the values into a temperature reading. He’ll use an NTC thermistor as a sensor, a breadboard, wire, and a 100K resistor. He’ll use an Arduino Micro because it plugs directly into the breadboard but you can use any Arduino you like for this. He uses wire to connect 5 volts to the top power rail and ground to the bottom power rail. There are usually multiple ground pins (marked ‘GND’). You can connect to any of these. He connects the thermistor to 5V and in the same column he connects the resistor to ground. It doesn’t matter which way around these components go, they work either way. Finally, you connect midpoint to analog pin p0. You can now write some code. He names the thermistor pin and sets up an array to store a bunch of readings so that you can take an average to sort out the data. He uses a line to set up the serial monitor. In the main code he declares the output as a float and then uses a for loop to calculate the average. A thermistor reading is stored in the array, added to a running total, and then delayed for a while to give the ADC a chance to settle before it runs through the loop again. ADC stands for analog to digital convertor. It converts voltage on the analog pin into a discrete signal. Outside that loop, the code divides the running total by the number of readings to get an average. You can then print it to the terminal. DaftMike gives a diagram of the circuit. It’s a voltage divider where R1 is the thermistor and R2 is 100K. The equation for voltage dividers is Vout = Vin *R2/(R1+R2). Vout is what we measured in the code, Vin is 5 volts, R2 is 100K, and R1 is what we are solving for.

English
  • Originally Aired July 4, 2018
  • Runtime 17 minutes
  • Network element14
  • Created July 18, 2018 by
    Administrator admin
  • Modified July 18, 2018 by
    Administrator admin