Skip to content

dB-XIX/cc3200-thermostat-controller

Repository files navigation

Embedded Thermostat Controller

Embedded thermostat controller implemented in C using Code Composer Studio and TI Drivers.
The system reads temperature data from an I2C temperature sensor, compares it to a user-adjustable setpoint, and controls a heating indicator while reporting system status over UART.

This project demonstrates core embedded systems concepts including interrupts, timers, I2C communication, GPIO handling, and periodic task scheduling.


Features

  • I2C temperature sensor communication
  • Adjustable thermostat set-point using hardware buttons
  • Periodic temperature sampling using hardware timers
  • UART serial output for system monitoring
  • GPIO interrupt-driven user input
  • Basic thermostat control logic

Hardware Platform

  • TI LaunchPad development board
  • TMP temperature sensor (I2C)
  • Onboard LED used as heater indicator
  • Two push buttons used to adjust temperature set-point

System Behavior

The firmware performs the following tasks:

  1. Initializes system peripherals

    • UART
    • I2C
    • Timer
    • GPIO
  2. Detects the connected temperature sensor over I2C

  3. Starts a 1-second periodic timer

  4. Every timer cycle:

    • Reads the temperature sensor
    • Compares temperature to the set-point
    • Activates the heater indicator LED if needed
    • Outputs system status over UART

UART Output Format

The system periodically prints status messages via UART in the following format:

<currentTemperature,setPoint,heatOn,seconds>

Example:

<21,22,1,0045>

Meaning:

Field Description
currentTemperature Measured temperature (°C)
setPoint Desired thermostat temperature
heatOn Heater state (1 = ON, 0 = OFF)
seconds System runtime counter

Controls

Two push buttons adjust the thermostat set-point.

Button Function
Button 0 Decrease temperature set-point
Button 1 Increase temperature set-point

Button presses trigger GPIO interrupts to modify the set-point.


Software Architecture

The program uses a simple event-driven embedded architecture.

Timer Interrupt

A hardware timer generates a periodic callback every second.

timerCallback()

This callback sets a flag used by the main control loop.


Main Control Loop

The main loop waits for the timer event and then executes the thermostat control logic.

while(1)
{
    wait for timer flag
    read temperature
    compare to set-point
    control heater LED
    send status over UART
}

Peripheral Modules

Module Purpose
GPIO Button interrupts and LED control
I2C Temperature sensor communication
UART System monitoring output
Timer Periodic scheduler

System Architecture Overview

Buttons → GPIO Interrupts
            ↓
      Setpoint Control

Temperature Sensor → I2C → Thermostat Logic → Heater LED

Timer → Scheduler → Status Output → UART

Key Embedded Concepts Demonstrated

  • Interrupt-driven input handling
  • Peripheral driver configuration
  • I2C device communication
  • Periodic scheduling using timers
  • Embedded control logic
  • UART debugging output

Development Environment

  • Code Composer Studio
  • TI Drivers
  • NoRTOS
  • Embedded C

Author

Michael Berry
B.S. Computer Science – Software Engineering

About

Embedded thermostat controller for the TI CC3202X LaunchPad demonstrating temperature sensing, hysteresis control, and interrupt-driven input handling.

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors