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

Wi-Fi Controlled Smart Home System with Arduino UNO and Sensors

View and Edit Project In Cirkit DesignerImage of Wi-Fi Controlled Smart Home System with Arduino UNO and Sensors

Circuit Documentation

Summary

This circuit involves an Arduino UNO R4 WiFi microcontroller, an Arduino UNO microcontroller, various sensors, servos, a relay module, and other components. The circuit is designed to control multiple devices, including a fan, servos, and an LCD screen, while also monitoring environmental conditions using sensors. The Arduino UNO R4 WiFi is the primary controller, handling most of the operations, while the Arduino UNO is used for additional functionalities.

Component List

  1. Arduino UNO R4 WiFi

    • Description: A microcontroller board based on the ATmega328P with built-in WiFi capabilities.
    • Pins: OFF, GND, VRTC, IIC0_SCL, IIC0_SDA, 3V3, GPIO 41, GPIO 0, GPIO 42, GPIO 43, GPIO 44, BOOT, IOREF, RESET, 5V, VIN, A0, A1, A2, A3, A4, A5, RSPCKA, CIPO, COPI, D0/RX, D1/TX, D2, D3, D4, D5, D6, D7, D8, D9, D10, D11, D12, D13, AREF, SDA, SCL
  2. LCD screen 16x2 I2C

    • Description: A 16x2 character LCD display with I2C interface.
    • Pins: SCL, SDA, VCC, GND
  3. Membrane Matrix Keypad

    • Description: A keypad with a matrix of buttons.
    • Pins: Row 1, Row 2, Row 3, Row 4, Column 1, Column 2, Column 3
  4. 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
  5. 4 channel relay module

    • Description: A module with 4 relays for controlling high-power devices.
    • Pins: N.O. 4, COM 4, N.C. 4, N.O. 3, COM 3, N.C. 3, N.O. 2, COM 2, N.C. 2, N.O. 1, COM 1, N.C. 1, Pin 13, Pin 14, Pin 15, Pin 16, Pin 17, Pin 18, Pin 19, Pin 20, Pin 21, Pin 22, Pin 23, Pin 24, VCC+, VCC- (GND), IN 1, IN 2, IN 3, IN 4
  6. Servo

    • Description: A servo motor for precise control of angular position.
    • Pins: GND, VCC, PWM
  7. Fan

    • Description: A fan for cooling or ventilation.
    • Pins: GND, 5V
  8. HC-SR04 Ultrasonic Sensor

    • Description: An ultrasonic sensor for distance measurement.
    • Pins: VCC, TRIG, ECHO, GND
  9. MQ-2

    • Description: A gas sensor for detecting various gases.
    • Pins: GND, VCC, ANALOG, Digital
  10. DHT11 Humidity and Temperature Sensor

    • Description: A sensor for measuring humidity and temperature.
    • Pins: VDD, DATA, NULL, GND

Wiring Details

Arduino UNO R4 WiFi

LCD screen 16x2 I2C

Membrane Matrix Keypad

Arduino UNO

4 channel relay module

Servo

Fan

HC-SR04 Ultrasonic Sensor

MQ-2

DHT11 Humidity and Temperature Sensor

Documented Code

Arduino UNO R4 WiFi Code

#define BLYNK_PRINT Serial

#define BLYNK_TEMPLATE_ID "TMPL6I9ijnAKh"
#define BLYNK_TEMPLATE_NAME "Arduino wifi"
#define BLYNK_AUTH_TOKEN "xoXNLvrwltbZ_meN02RTk5GW5kjVqWls"

#include <Wire.h>
#include <Servo.h>
#include <WiFiS3.h>
#include <BlynkSimpleWifi.h>
#include <DHT.h>
#include <SPI.h>

char ssid[] = "iPhone";
char pass[] = "Jasper98308021";
BlynkTimer timer;

Servo servo1;  
Servo doorServo;
Servo servo3;  
int servoPin1 = 9;
int servoPin2 = 11;  
int servoPin3 = 7;
bool isLocked = true;   

#define DHTPIN 5
#define DHTTYPE DHT11
DHT dht(DHTPIN, DHTTYPE);

#define SIG_PIN 12
#define THRESHOLD_DISTANCE 3 

#define SIG_PIN2 8