1. Objective
The goal of this project is to design a simple HVAC (Heating, Ventilation, and Air Conditioning) control system. We will simulate this system using MATLAB Simulink.
The model will automatically switch Heating or Cooling ON or OFF based on the cabin temperature.
2. System Requirements
| Condition | Action |
|---|---|
| Temperature > 24ยฐC | Turn ON Cooling |
| Temperature < 20ยฐC | Turn ON Heating |
| 20ยฐC โค Temperature โค 24ยฐC | Maintain previous state (deadband) |
| Desired Cabin Temperature | 22ยฐC |
This means:
- If the cabin is too hot, cooling should start.
- If the cabin is too cold, heating should start.
- Between 20ยฐC and 24ยฐC, no action is taken; the system holds the last state.
3. Concept
The Unit Delay latch is used to store the last output. It remembers whether the system was in the Heating or Cooling state. This occurs when the temperature is within the deadband range (20โ24ยฐC).
This helps avoid frequent ON/OFF switching of the HVAC system, which improves stability and saves energy.
4. Model Blocks Overview
| Block | Purpose |
|---|---|
| Constant | Set the desired temperature value (22ยฐC). |
| In1 (Input) | Input temperature signal. |
| Relational Operator | Compare input temperature with limits (20ยฐC and 24ยฐC). |
| Logical Operator | Combine logical conditions (AND, OR). |
| Switch | Choose between Heating or Cooling based on comparison results. |
| Unit Delay | Holds the previous output when inside deadband. |
| Out1 (Output) | Shows final control output (Heating = 1, Cooling = 0). |
5. Model Logic Explanation
- Input Temperature (T_in) is compared with 20ยฐC and 24ยฐC.
- Three possible conditions are checked:
- If T_in < 20ยฐC โ Heating ON.
- If T_in > 24ยฐC โ Cooling ON.
- If T_in is between 20ยฐC and 24ยฐC, the Unit Delay block keeps the previous output.
- The Switch block selects the new state based on these conditions.
- The Unit Delay output feeds back to maintain the last output when the temperature is within the deadband range.
6. MATLAB SIMULINK LOGIC


Output

7. Test Results
| Temperature (ยฐC) | Expected Output | Description |
|---|---|---|
| 18 | Heating ON | Below 20ยฐC |
| 22 | Hold State | Within deadband |
| 26 | Cooling ON | Above 24ยฐC |
8. Conclusion
The HVAC system model successfully:
- Turns ON Heating when temperature < 20ยฐC.
- Turns ON Cooling when temperature > 24ยฐC.
- Maintains previous state between 20โ24ยฐC.
This approach using Unit Delay latch ensures smooth operation and avoids unnecessary switching.
