Arduino UNO-Based Smart Home Automation System with Bluetooth and IR Control
View and Edit Project In Cirkit Designer
Circuit Documentation
Summary
This circuit is a comprehensive home automation system that integrates various sensors, actuators, and communication modules. It includes an Arduino UNO microcontroller, an LCD display, a Bluetooth module, an IR receiver, a temperature sensor, a soil moisture sensor, a gas sensor, a piezo buzzer, a red LED, a membrane keypad, a relay module, and a rocker switch. The system is designed to monitor environmental conditions and control devices based on sensor inputs and user commands.
Component List
LED: Two Pin (red)
- Description: A red LED used for visual indication.
- Pins: Cathode, Anode
16x2 I2C LCD
- Description: A 16x2 character LCD display with I2C interface.
- Pins: GND, VCC, SDA, SCL
HC-05 Bluetooth Module
- Description: A Bluetooth module for wireless communication.
- Pins: Key, VCC, TXD, RXD, State, GND
Rocker Switch
- Description: A simple on/off switch.
- Pins: 1, 2
VS1838B IR Receiver
- Description: An IR receiver module for remote control.
- Pins: OUT, GND, VCC
Temperature Sensor (LM35)
- Description: A temperature sensor that provides an analog output proportional to the temperature.
- Pins: +Vs, Vout, GND
MQ-2
- Description: A gas sensor for detecting smoke and other gases.
- Pins: GND, VCC, ANALOG, Digital
220V Fan
- Description: A fan operating at 220V AC.
- Pins: N, L
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
Membrane Matrix Keypad
- Description: A 4x3 matrix keypad for user input.
- Pins: Row 1, Row 2, Row 3, Row 4, Column 1, Column 2, Column 3
Piezo Buzzer
- Description: A buzzer for audio alerts.
- Pins: Pin 1, Pin 2
Red Light 220VAC
- Description: A red indicator light operating at 220V AC.
- Pins: -, +
240V Power Source
- Description: A power source providing 240V AC.
- Pins: Live, Neutral
2 Channel Relay Module
- Description: A relay module with two channels for switching high voltage devices.
- Pins: N.O. 2, COM 2, N.C. 2, N.O. 1, COM 1, N.C. 1, Pin 7, Pin 8, Pin 9, Pin 10, Pin 11, Pin 12, VCC+, VCC- (GND), IN 1, IN 2
SparkFun Soil Moisture Sensor
- Description: A sensor for measuring soil moisture levels.
- Pins: VCC, GND, SIG
Wiring Details
LED: Two Pin (red)
- Cathode: Connected to GND (Arduino UNO)
- Anode: Connected to Pin 2 of Piezo Buzzer and D13 (Arduino UNO)
16x2 I2C LCD
- GND: Connected to GND (common ground)
- VCC: Connected to 5V (common power)
- SDA: Connected to SDA (Arduino UNO)
- SCL: Connected to SCL (Arduino UNO)
HC-05 Bluetooth Module
- VCC: Connected to 5V (common power)
- GND: Connected to GND (common ground)
- TXD: Connected to D2 (Arduino UNO)
- RXD: Connected to D3 (Arduino UNO)
Rocker Switch
- Pin 1: Connected to D4 (Arduino UNO)
- Pin 2: Connected to GND (common ground)
Rocker Switch
- Pin 1: Connected to D5 (Arduino UNO)
- Pin 2: Connected to GND (common ground)
VS1838B IR Receiver
- OUT: Connected to A0 (Arduino UNO)
- GND: Connected to GND (common ground)
- VCC: Connected to 5V (common power)
Temperature Sensor (LM35)
- +Vs: Connected to 5V (common power)
- Vout: Connected to A1 (Arduino UNO)
- GND: Connected to GND (common ground)
MQ-2
- GND: Connected to GND (common ground)
- VCC: Connected to 5V (common power)
- ANALOG: Connected to A3 (Arduino UNO)
220V Fan
- N: Connected to Neutral (240V Power Source)
- L: Connected to N.C. 1 (2 Channel Relay Module)
Arduino UNO
- 5V: Connected to 5V (common power)
- GND: Connected to GND (common ground)
- A0: Connected to OUT (VS1838B IR Receiver)
- A1: Connected to Vout (Temperature Sensor)
- A2: Connected to SIG (SparkFun Soil Moisture Sensor)
- A3: Connected to ANALOG (MQ-2)
- SCL: Connected to SCL (16x2 I2C LCD)
- SDA: Connected to SDA (16x2 I2C LCD)
- D13: Connected to Anode (LED: Two Pin (red))
- D12: Connected to Row 1 (Membrane Matrix Keypad)
- D11: Connected to Row 2 (Membrane Matrix Keypad)
- D10: Connected to Row 3 (Membrane Matrix Keypad)
- D9: Connected to Row 4 (Membrane Matrix Keypad)
- D8: Connected to Column 1 (Membrane Matrix Keypad)
- D7: Connected to Column 2 (Membrane Matrix Keypad)
- D6: Connected to Column 3 (Membrane Matrix Keypad)
- D5: Connected to Pin 1 (Rocker Switch)
- D4: Connected to Pin 1 (Rocker Switch)
- D3: Connected to RXD (HC-05 Bluetooth Module)
- D2: Connected to TXD (HC-05 Bluetooth Module)
- D1: Connected to IN 2 (2 Channel Relay Module)
- D0: Connected to IN 1 (2 Channel Relay Module)
Membrane Matrix Keypad
- Row 1: Connected to D12 (Arduino UNO)
- Row 2: Connected to D11 (Arduino UNO)
- Row 3: Connected to D10 (Arduino UNO)
- Row 4: Connected to D9 (Arduino UNO)
- Column 1: Connected to D8 (Arduino UNO)
- Column 2: Connected to D7 (Arduino UNO)
- Column 3: Connected to D6 (Arduino UNO)
Piezo Buzzer
- Pin 1: Connected to Cathode (LED: Two Pin (red)) and GND (Arduino UNO)
- Pin 2: Connected to Anode (LED: Two Pin (red)) and D13 (Arduino UNO)
Red Light 220VAC
- -: Connected to Neutral (240V Power Source)
- +: Connected to N.C. 2 (2 Channel Relay Module)
240V Power Source
- Live: Connected to COM 1 and COM 2 (2 Channel Relay Module)
- Neutral: Connected to - (Red Light 220VAC) and N (220V Fan)
2 Channel Relay Module
- VCC+: Connected to 5V (common power)
- VCC- (GND): Connected to GND (common ground)
- IN 1: Connected to D0 (Arduino UNO)
- IN 2: Connected to D1 (Arduino UNO)
- COM 1: Connected to Live (240V Power Source)
- COM 2: Connected to Live (240V Power Source)
- N.C. 1: Connected to L (220V Fan)
- N.C. 2: Connected to + (Red Light 220VAC)
SparkFun Soil Moisture Sensor
- VCC: Connected to 5V (common power)
- GND: Connected to GND (common ground)
- SIG: Connected to A2 (Arduino UNO)
Code Documentation
int Buzzer = 13;
int Thres = 90;
int val;
int SensorPin = A2;
int limit = 500;
int output;
#include <Keypad.h>
#include <Adafruit_Liquid