Site icon Circuit Ideas for You

DIY Temperature-Controlled Fan Circuit with Arduino

Modern gadgets and dwellings require efficient temperature regulation.

It prolongs gadget life and keeps things pleasant.

One useful example of this technology is a temperature-controlled fan.

Depending on the ambient temperature, it automatically modifies its pace.

This maintains temperature while lowering noise and energy consumption.

Here IC LM35 sensor is used to measure the temperature.

A 5V single channel relay module will activate an air conditioning fan to cool the space when the temperature rises too high.

The practical uses of Arduino are demonstrated by this project.

Developing intelligent temperature control systems is a breeze using the widely used and user friendly Arduino microcontroller.

Connecting sensors and devices is made easier by it.

Coding with Explanation:

#include <SoftwareSerial.h>

const int tempPin = A0; // Analog pin for temperature sensor
const int relayPin = 2; // Digital pin for relay
const int thresholdTemp = 30; // Temperature threshold in degrees Celsius

void setup() {
  Serial.begin(9600);
  pinMode(relayPin, OUTPUT);
}

void loop() {
  int sensorValue = analogRead(tempPin);
  float temperature = (sensorValue / 1023.0) * 5.0 * 100.0; // Convert sensor value to temperature

  Serial.print("Temperature: ");
  Serial.print(temperature);
  Serial.println(" degrees Celsius");

  if (temperature >= thresholdTemp) {
    digitalWrite(relayPin, HIGH); // Activate relay
    Serial.println("Fan turned on");
  } else {
    digitalWrite(relayPin, LOW); // Deactivate relay
    Serial.println("Fan turned off");
  }

  delay(1000); // Delay for 1 second
}

Explanation:

Circuit Working:

Parts List:

ComponentQuantity
Arduino UNO board1
IC 7809 voltage regulator1
IC LM35 temperature sensor1
5V single channel relay1
220V AC fan1

The circuit for the temperature-controlled fan is rather simple.

Three pins make up the LM35 sensor: VCC, GND and analog output pin.

The Arduino 5V pin will be linked to the VCC pin.

The analog output pin will be linked to the Arduinos A0 pin, and the GND pin will be connected to the GND pin.

The IC 7809 is used to control the 5V output from the Arduino to 3.3V so that the LM35 temperature sensor may be powered.

A voltage that is proportionate to the temperature is produced by the LM35 sensor.

The analog input pin on the Arduino reads this voltage.

A predetermined threshold is compared with the measured temperature by the Arduino.

An electromagnetic relay with a single switching channel and a 5V control voltage is known as a 5V relay.

Relays of this kind are frequently used in a variety of electrical and electronic circuits to control loads or high power devices with low power signals, usually from microcontrollers or other digital control sources.

This relay is turned on when the temperature rises over the threshold.

To cool the surroundings, the 220V AC fan is connected to the power supply via the activated relay.

The Arduino activates the relay to turn on the AC fan “ON” when the temperature reading from the LM35 rises beyond the predetermined threshold, in this case 30 degrees Celsius.

A cooling mechanism is provided by this operation to keep the temperature within the intended range.

When the temperature stays below the threshold in the second case, the Arduino does not send any signal to the relay, which keeps the fan “OFF.”

By automating the fan to only run when necessary, energy is saved and a comfortable temperature is maintained in the room.

How to Build:

To build a DIY Temperature-Controlled Fan with Arduino following are the steps to follow:

Conclusion:

This project shows how Arduino may be used in a real-world setting for automated control.

A comfortable temperature may be maintained in a variety of settings by using the temperature-controlled fan system.

The temperature threshold and other functionality, including temperature logging and fan speed control, may be added to the code by modifying it.

References:

Temperature Controlled Fan with i2c LED

Exit mobile version