This lab consists in building a Digital Thermometer using a microcontroller, a thermistor, LEDs, and a buzzer. The main loop monitors the thermistor through the ADC, switching more LEDs on as the temperature increases and activating the buzzer if a given threshold is passed.
Let's begin with a pseudo code (actual coding is up to you):
1. |
int main() { |
The pseudo-code is self-explaining: an infinite loop reading the ADC channel to which the thermistor has been connected and a composed conditional to switch on the LEDs and the buzzer through the respective GPIO ports. The delay at the end of the loop is a good practice in terms of energy, since a tight loop, checking the thermistor faster then it actually can vary would be useless. A well implemented delay could put the MCU in a low-power mode while keeping a timer counting.
For this lab, you'll need the following components: