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

Arduino UNO Bluetooth-Controlled Home Automation System

View and Edit Project In Cirkit DesignerImage of Arduino UNO Bluetooth-Controlled Home Automation System

Circuit Documentation

Summary

This circuit is designed to control various devices such as a fan, a bulb, and an AC bulb using an Arduino UNO microcontroller. The control is facilitated through a 4-channel relay module and an HC-05 Bluetooth module, allowing wireless communication. Additionally, a Tower Pro SG90 servo motor is included for mechanical actuation. The circuit is powered by a 7.4V battery and an AC supply.

Component List

  1. Arduino UNO

    • Description: A microcontroller board based on the ATmega328P.
    • Pins: UNUSED, IOREF, Reset, 3.3V, 5V, GND, Vin, A0, A1, A2, A3, A4, A5, SCL, SDA, AREF, D13, D12, D11, D10, D9, D8, D7, D6, D5, D4, D3, D2, D1, D0
  2. Relay 4 Channel 5v

    • Description: A relay module that allows control of high voltage devices.
    • Pins: GND, IN1, IN2, IN3, IN4, VCC, COM1, COM2, COM3, COM4, NO1, NO2, NO3, NO4, NC1, NC2, NC3, NC4
  3. HC-05 Bluetooth Module

    • Description: A Bluetooth module for wireless communication.
    • Pins: Key, VCC, TXD, RXD, State, GND
  4. Tower Pro SG90 Servo

    • Description: A small servo motor for precise control of angular position.
    • Pins: Signal, +5V, GND
  5. BULB

    • Description: A standard DC bulb.
    • Pins: +, -
  6. Fan

    • Description: A 5V DC fan.
    • Pins: GND, 5V
  7. Power Outlet (IL)

    • Description: A power outlet for AC devices.
    • Pins: N, L, GND
  8. 7.4V Battery

    • Description: A 7.4V battery for powering the circuit.
    • Pins: +, -
  9. AC Supply

    • Description: An AC power supply.
    • Pins: +ve, -ve
  10. AC Bulb

    • Description: An AC bulb.
    • Pins: P, N

Wiring Details

Arduino UNO

Relay 4 Channel 5v

HC-05 Bluetooth Module

Tower Pro SG90 Servo

BULB

Fan

Power Outlet (IL)

7.4V Battery

AC Supply

AC Bulb

Code Documentation

long int ac=2;
long int bulb=3;
long int heater=4;
long int fan=5;
char x;

void setup()
{
    pinMode(ac, OUTPUT);
    pinMode(bulb, OUTPUT);
    pinMode(heater, OUTPUT);
    pinMode(fan, OUTPUT);
    digitalWrite(ac, HIGH);
    digitalWrite(bulb, HIGH);
    digitalWrite(heater, HIGH);
    digitalWrite(fan, HIGH);
    Serial.begin(9600); 
}

void loop()
{
    if(Serial.available() > 0)
    {
        x = Serial.read();
    }
    if(x == 'a')
        digitalWrite(ac, LOW);
    if(x == 'b')
        digitalWrite(ac, HIGH);
    if(x == 'c')
        digitalWrite(bulb, LOW);
    if(x == 'd')
        digitalWrite(bulb, HIGH);
    if(x == 'e')
        digitalWrite(heater, LOW);
    if(x == 'f')
        digitalWrite(heater, HIGH);
    if(x == 'g')
        digitalWrite(fan, LOW);
    if(x == 'h')
        digitalWrite(fan, HIGH);
}

This code initializes the pins connected to the relay module as outputs and sets them to a high state (off). It then reads commands from the Bluetooth module to control the state of the relays, thereby controlling the connected devices.