The Embedded-Thermostat project is a temperature control system designed to maintain a specified temperature set-point within an environment. The system integrates multiple peripherals on a Texas Instruments (TI) microcontroller to read temperature data from a sensor, adjust the set-point via button inputs, control an LED to indicate heating status, and communicate system status to an external server via UART.
- Temperature Monitoring: Continuously reads the current temperature from a sensor using I2C communication.
- Set-Point Adjustment: Allows users to increase or decrease the temperature set-point using button inputs.
- Heating Control: Controls an LED to indicate the heating status based on the current temperature relative to the set-point.
- Real-Time Communication: Sends system status updates to an external server via UART in a specified format.
- Modular Design: Structured to enhance maintainability, readability, and adaptability.
- Microcontroller: Texas Instruments (TI) CC3220S
- Temperature Sensor: I2C-based temperature sensor
- LED: Indicating heating status
- Buttons: For set-point adjustment
- Programming Language: C
- Development Environment: TI Code Composer Studio
- Real-Time Operating System: TI-RTOS
- Version Control: Git
-
UART: Used for communication with an external server. Data is sent in the format
<AA,BB,S,CCCC>
, where:AA
is the room temperature (00-99) degrees Celsius.BB
is the set-point temperature (00-99) degrees Celsius.S
indicates the heating status (0
for off,1
for on).CCCC
is the count of seconds since the board was reset.
-
I2C: Used to read data from the temperature sensor.
-
GPIO: Used for button inputs and LED control.
- Button Check: Every 200ms, the system checks the button inputs to adjust the set-point temperature.
- Temperature Reading and LED Update: Every 500ms, the system reads the temperature and updates the LED based on the heating status.
- UART Update: Every second, the system sends an update to the external server with the current status.
- Hardware: TI CC3220S microcontroller, I2C temperature sensor, LED, buttons
- Software: TI Code Composer Studio, Git
- Clone the repository:
git clone https://github.com/yourusername/embedded-thermostat.git
- Open the project in TI Code Composer Studio.
- Build and upload the firmware to the TI CC3220S microcontroller.
- Power on the microcontroller.
- Adjust the temperature set-point using the buttons.
- Open a COM port.
- Monitor the LED to see the heating status.
- View the status updates sent via UART to the external server.
The MIT License (MIT)
Copyright (c) 2024 82B1
Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
Texas Instruments for providing the microcontroller and development tools. Open-source communities for their valuable resources and support.