This is a support page for day 3 of an 8-session class is a basic introduction to both electronics and programming the Arduino microprocessor. The intent is to prepare the student for what is currently popular in the maker world, rather than an electronics or engineering degree, and includes some things of interest to amateur radio enthusiasts.
Day 1, Day 2, Day 3, Day 4, Day 5, Day 6, Day 7, Day 8
Day 3: Getting data, what’s a thermistor, resistors in series and parallel
Goals:
-
- Output data from an Arduino
- Write a conditional statement in C++
- Use a thermistor to show temperature
- Understand how resistors behave in series & parallel
Vocabulary:
-
- Serial data
- Thermistor
Thermistor schematic diagram, wiring and code
Schematic:

Build:

Code:
Thermistor.ino
Copied!
const int ThermistorPin = A0; const int LED = 12; void setup() { Serial.begin(115200); pinMode(LED, OUTPUT); } void loop() { int Temp = analogRead(ThermistorPin); Serial.print("Temp = "); Serial.println(Temp); delay(500); }
Thermistor_trigger schematic diagram, wiring and code
Schematic:

Build:

Code:
Thermistor_trigger.ino
Copied!
const int ThermistorPin = A0; const int LED = 12; void setup() { Serial.begin(115200); pinMode(LED, OUTPUT); } void loop() { int Temp = analogRead(ThermistorPin); Serial.print("Temp = "); Serial.println(Temp); if (Temp > 100) { // 100 can be changed to whatever your threshold is digitalWrite(LED, HIGH); } else digitalWrite(LED, LOW); delay(500); }
Thermistor-advanced (same wiring as above, but with the code below:
Thermistor_advanced.ino
Copied!
/** https://www.circuitbasics.com/arduino-thermistor-temperature-sensor-tutorial/ **/ int ThermistorPin = A0; int Vo; float R1 =10000; float logR2, R2, T; float c1 =1.009249522e-03, c2 = 2.378405444e-04, c3 = 2.019202697e-07; void setup() { Serial.begin(115200); } void loop() { Vo = analogRead(ThermistorPin); R2 = R1 * (1023.0 / (float)Vo - 1.0); logR2 = log(R2); T = (1.0 / (c1 + c2*logR2 + c3*logR2*logR2*logR2)); T = T - 273.15; T = (T * 9.0)/ 5.0 + 32.0; Serial.print("Temperature: "); Serial.print(T); Serial.println(" F"); delay(500); }
Homework:
-
- Rebuild LED + resistor in parallel (2x) from Day 1
- Watch How Resistor Work:
![]()