Cirkit Designer LogoCirkit DesignerYour all-in-one circuit design IDE Launch Cirkit Designer App

Arduino-Controlled Temperature Regulation System with Dual Relay Fans and Heating Elements

View and Edit Project In Cirkit DesignerImage of Arduino-Controlled Temperature Regulation System with Dual Relay Fans and Heating Elements

Circuit Documentation

Summary

The circuit in question is designed to control a heating element and two 12V fans using an Arduino Uno R3 microcontroller and a 2-channel 12V relay. The Arduino Uno R3 is programmed to respond to inputs from an 8-push button board PCB to toggle the state of the heating element and the fans. The circuit is powered by a 12V battery, which supplies power to the relay, fans, and indirectly to the heating element through the relay contacts.

Component List

12V Battery

40 Fan 12v (x2)

Heating Element (x2)

Arduino Uno R3

2 Channel 12v Relay

8 Push Button Board PCB

Wiring Details

12V Battery

40 Fan 12v

Heating Element

Arduino Uno R3

2 Channel 12v Relay

8 Push Button Board PCB

Documented Code

// Constants for readability
const bool off = HIGH;
const bool on = LOW;

// Pin assignments
int heater = 4;
int cooler = 2;
int heateron = 7;
int heateroff = 8;
int cooleron = 12;
int cooleroff = 13;

void setup() {
  // Initialize pins
  pinMode(cooler, OUTPUT);
  pinMode(heater, OUTPUT);
  pinMode(heateron, INPUT_PULLUP);
  pinMode(heateroff, INPUT_PULLUP);
  pinMode(cooleron, INPUT_PULLUP);
  pinMode(cooleroff, INPUT_PULLUP);
  
  // Start serial communication
  Serial.begin(9600);
}

void loop() {
  // Read the state of the push buttons
  if(digitalRead(heateron) == LOW) {
    digitalWrite(heater, on);
    Serial.print("Heater On");
  }
  if(digitalRead(heateroff) == LOW) {
    digitalWrite(heater, off);
    Serial.print("Heater Off");
  }
  if(digitalRead(cooleron) == LOW) {
    digitalWrite(cooler, on);
    Serial.print("Cooler On");
  }
  if(digitalRead(cooleroff) == LOW) {
    digitalWrite(cooler, off);
    Serial.print("Cooler Off");
  }
}

This code is designed to control the heating element and the fans based on the input from the push buttons. When a button is pressed, the corresponding device is either turned on or off, and a message is printed to the serial monitor. The INPUT_PULLUP mode is used for the buttons, which means they are expected to be connected to ground, and the internal pull-up resistors are enabled.