2-digit thermometer
Scrolls temperature in degrees Celsius from -20 to +40°C. e.g. "+25°C". Cabling : +5|--[NTC]--+--[10K]--|GND Use a 10K @ 25°C negative temperature coefficient (NTC) thermistor, and a 10K resistor. Connect them as a divider bridge and connect leg 0 to the mid point. A linear fit over the -20..+40°C range gives : T = 0.4 * ADC_code -25.6. As floating point operations are not possible, it can be approximated by : T = ADC_code * 2 / 5 -26. The error is typically less than 2°C. Hard to do better with an 8-bit ADC and no floating point operations ! Note : the disabled blocks display the value of ain0 in binary.