Automatic Cooling System

by Aromal M in Circuits > Arduino

9 Views, 0 Favorites, 0 Comments

Automatic Cooling System

Screenshot 2025-01-17 171050.png

This is a project to simulate temperature control in a smart home. It uses a temperature sensor and a fan to regulate the temperature and cool the home environment for a comfortable temperature. This project was inspired by my interest in smart home technology to show how smart thermostats, heaters, and A/Cs work and can improve in the future.

Supplies

Screenshot 2025-01-17 191022.png

Materials to Build:

  1. Arduino UNO
  2. 25x Jumper Wires
  3. Breadboard
  4. LM35 or TMP36 Temperature Sensor
  5. LCD (16x2 I2C)
  6. H-Bridge (L293D)
  7. DC Motor
  8. Fan
  9. Red and Green LED (optional)

Add Temperature Sensor

Screenshot 2025-01-17 192123.png

The first step is to take either your TMP36 or LM35 temperature sensor and insert it into one end of the breadboard. If you are using either of the mentioned temperature sensors, the pinout details are provided in the image below. However, if you have a different temperature sensor, please search the pinout details for that specific sensor.


Connect "+V" to the positive terminal

Connect "Ground" to the negative terminal

Connect "Analog Output" to A0


Ensure the wires do not obstruct easy access to touch the sensor.


After code is uploaded: artificially increase the detected temperature by pressing the sensor lightly. If not working, check connections again.

Add LCD

Screenshot 2025-01-17 193001.png

After you have confirmed all connections for the temperature sensor, add an LCD (preferably 16x2). The code will introduce a library called "LiquidCrystal_I2C" which allows the use of only the four pins in the back.


Do NOT use any of the 16 pins in the front as it may cause errors and is not as efficient. Also remember to connect Vcc to positive terminal on the breadboard.

Add H-Bridge

Screenshot 2025-01-17 193819.png
L293D_1-550x550w.jpg

For step 3, add the H-Bridge which is essentially the L293D IC. Please ensure that the wire connections match and are correct for your configuration. To do this best, align your IC with the diagrams provided using the semicircular cut on one end of the top. Check IC is not upside down or other alignment faults.

Add DC Motor With Fan

Screenshot 2025-01-17 194430.png

Finally, add the DC motor with the plastic fan attached onto it. If wires are not already connected to the motor, add jumper wires and carefully press the negative and positive terminals with the wire. If possible, soldering can make the wires more permanent and remove the risk of sliding off.


After code is uploaded: If you wish for the motor to spin in a different direction, switch the HIGH/LOW on lines 33/34.

Add LED's (optional)

Screenshot 2025-01-17 195457.png

This is an optional part to the circuit as with the current implementations and code, it should display the temperature, fan status (on or off), and accordingly turn the fan on or off. The LED's only serve a purpose to add more visual cues to know when the temperature has crossed or is close to crossing the threshold.


After code is uploaded: Add another if statement and move lines 35/36 with a different threshold temperature as a "warning" light or anything else.

Code

This is the code for the circuit. Please open the file on Arduino IDE, connect the Arduino UNO (or other Arduino model), choose correct USB output, and click the arrow to compile.


Line 10 defines the variable "thresholdTemp" which can be changed according to what temperature you want the fan to turn on.

If you wish to change what is written on the LCD, edit lines 26-29


Once the code is uploaded, your project is ready to be tested and used however you please. Enjoy!

Downloads