A dual-ATmega64 embedded system for intelligent temperature monitoring, automatic fan speed control, and bidirectional UART communication.
- Overview
- System Architecture
- Features
- Repository Structure
- Documentation
- Hardware
- Technologies
- Running the Simulation
- Building the Firmware
This project implements a Smart Temperature Control and Monitoring System using two ATmega64 microcontrollers that communicate with each other through UART communication.
The system measures the surrounding temperature using an LM35 temperature sensor and automatically adjusts the cooling fan speed based on the detected temperature. It also provides a user interface using an LCD display, status LEDs, a buzzer alarm, and push buttons for user interaction.
The firmware is designed using an interrupt-driven architecture, allowing the system to respond quickly to temperature changes, user inputs, and communication events without relying on blocking delays.
The system consists of two ATmega64 microcontrollers:
-
Control Unit
- Reads temperature from the LM35 sensor using ADC
- Calculates required fan speed
- Generates PWM signal for motor control
- Communicates system status through UART
-
Display Unit
- Displays temperature and system status on LCD
- Handles user input buttons
- Controls LEDs and buzzer alarms
- Sends user commands to the Control Unit through UART
- Dual-microcontroller architecture
- Hardware PWM fan control
- Manual fan speed override
- Bidirectional UART communication
- UART timeout detection
- Interrupt-driven scheduling
- Proteus simulation included
.
├── control-unit/
├── display-unit/
├── simulation/
├── docs/
│ ├── project_specification.md
│ └── implementation-report.md
└── README.md
Each firmware directory follows the same layout:
control-unit/
│
├── include/ Header files (.h)
├── src/ Source files (.c)
└── out/ Pre-generated firmware (.hex)
This README provides a high-level overview of the project.
For detailed information about the system design, hardware configuration and implementation details refer to the documentation files below.
| Document | Description |
|---|---|
| Project Specification | Functional requirements, hardware specification, communication protocol, and expected system behavior. |
| Implementation Report | Firmware architecture, implementation details, engineering decisions, and module descriptions. |
| Component | Description |
|---|---|
| MCU 1 | ATmega64 (Control Unit) |
| MCU 2 | ATmega64 (Display Unit) |
| Temperature Sensor | LM35 |
| Motor Driver | L298 H-Bridge |
| Cooling Device | DC Motor |
| Display | 20×2 LCD |
| Indicators | Green, Yellow, Red LEDs |
| Alarm | Active Buzzer |
| User Input | Mode, Up, Down Buttons |
- C
- ATmega64
- ADC
- Hardware PWM
- USART
- Timer Interrupts
- GPIO
- Proteus Design Suite
Pre-generated firmware files are already included.
Simply:
- Open the Proteus project inside
simulation/. - Load the firmware from:
control-unit/out/display-unit/out/
- Start the simulation.
- Adjust the LM35 temperature to observe the system behavior.
You do not need to compile the firmware to run the simulation.
This repository is not bound to a specific IDE or compiler. You may use any AVR-compatible development environment, including:
- CodeVisionAVR
- Microchip Studio (Atmel Studio)
- AVR-GCC
- or any other AVR toolchain
To build the firmware:
- Create a new ATmega64 project.
- Configure the MCU clock to 8 MHz.
- Add every
.cfile from the correspondingsrc/directory. - Add the
include/directory to the compiler include paths. - Build the project.
Every IDE manages projects differently. Since this repository is IDE-independent, configuring the project structure is left to the user.