This project aims to control output LEDs, a buzzer and an LCD based on the measured temperature from the sensor which is replaced by the potentiometer. Data was passed using queues to send data back and forth through tasks and additional help from UART was used to communicate between the user and the program itself.
If the measured temperature is below the setpoint, the green LED (the heater) will light up until they are equal again, and the red LED will light up when the temperature is above 50 °C and turns off when it’s sub 50 °C. The buzzer also notifies the user when the measured temperature is above 50 °C alongside the red LED
List of Inputs
Potentiometer (measured temperature)
User’s setpoint temperature
List of Outputs
LCD Display of temperatures
2 LEDs: Green (heater) & Red (alarm)
Buzzer
Task Diagram
Flowcharts
Description of files and tasks
Files
File Name
Description
main.c
Main file including 4 tasks, a structure, 4 functions (toString(), printchar(), print(), GPIO_init()
LCD_config.c
A library file for implementing LCD functions
ADC.c
A library file for initializing ADC
Tasks
Task Name
Description
Task 1
Main function which takes the measured temperature using ADC and compares it with the user’s setpoint and then turns the LEDs and the buzzer ON/OFF using the queues methods and sends the setpoint and measured temperature values to Task 3 which receives these values and displays them on the LCD.
Task 2
Takes the setpoint temperature from the user through UART and sends it to Task 1 through a queue
Task 3
Receives the setpoint and measured temperatures from Task 1 and displays them on the LCD
Task 4
Receives the buzzer state from Task 1 and turns it ON/OFF
Hardware Connections with TivaC
Output
LCD Output
Putty Output
Running Images
Image
Description
Green LED is on when the measured temperature is lower than the setpoint
No LEDs are on when the measured temperature is greater than the setpoint but still sub 50°C
Red LED is on when the measured temperature is greater than 50 °C
About
Changing heater state with the measured temperature and user input using TivaC and Putty for UART