Skip to content

A comprehensive module integrating motion detection, temperature and humidity monitoring, RGB LED control, and relay switching functionalities using an ESP32.

Notifications You must be signed in to change notification settings

Timmy-Bergkvist/home-automation-system

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

1 Commit
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Home Automation System

Home Automation System with ESP32

ESP32

A comprehensive module integrating motion detection, temperature and humidity monitoring, RGB LED control, and relay switching functionalities.

Table of Contents

  1. Project Description
  2. Components and Pin Configurations
  3. Project Diagram
  4. Components List
  5. Additional Information and Resources

Project Description

This project implements a home automation system using an ESP32 microcontroller. The system integrates various sensors to detect motion, monitor temperature and humidity, and control an RGB LED and a relay. The project demonstrates the use of FreeRTOS tasks to manage concurrent operations and showcases efficient utilization of I2C and GPIO interfaces for sensors. The system also includes an LCD screen to display temperature, humidity, and motion detected by the PIR sensor. The RGB LED changes color based on temperature and motion detection, while the PIR sensor activates a relay to turn on an external battery-powered lamp.

Getting Started

Prerequisites

  • ESP32 development board
  • USB cable to connect ESP32 to your computer
  • ESP-IDF Visual Studio Code Extension

Installation

Configuration

  • Adjust the pin settings in the config.h file if necessary.
  • Ensure all connections are secure according to the project diagram.

Components and Pin Configurations

LCD1602

The LCD screen is controlled via the I2C interface, with programmatic pull-up resistors configured in the software.

  • I2C_MASTER_SCL_IO: GPIO_NUM_14
  • I2C_MASTER_SDA_IO: GPIO_NUM_13

PIR Sensor

The PIR sensor is connected with a programmatic pull-up resistor.

  • PIR_SENSOR_PIN: GPIO_NUM_27

Pin Settings

Definitions Component GPIO Pin Interface Type
DHT11_PIN DHT-11 GPIO_NUM_18 GPIO (one-wire) Input
I2C_MASTER_SCL_IO LCD1602 / SCL GPIO_NUM_14 I2C Output
I2C_MASTER_SDA_IO LCD1602 / SDA GPIO_NUM_13 I2C Output
PIR_SENSOR_PIN PIR Sensor GPIO_NUM_27 GPIO Input
RELAY_PIN Relay GPIO_NUM_12 GPIO Output
RGB_LED_RED_PIN RGB LED (Red) GPIO_NUM_15 PWM Output
RGB_LED_GREEN_PIN RGB LED (Green) GPIO_NUM_2 PWM Output
RGB_LED_BLUE_PIN RGB LED (Blue) GPIO_NUM_4 PWM Output

The pin definitions can be found in the config.h file within the components folder.

Project Diagram

Project Diagram

Components List

Component Resistance/Type Amount
DHT-11 Humidity/Temp Sensor 1
LCD 1602 1
PIR Sensor Motion Sensor 1
Relay SPDT 1
RGB LED Common Anode 1
Resistor 220kΩ 4
Resistor 1KΩ 1
Resistor 10KΩ 1
Transisor NPN 1
LED Blue 1
Diode rectifier 1
Battery 9v 1

Home Automation System

Home Automation System

Additional Information and Resources

ESP32 Datasheets

Component Datasheets

GitHub Repositories

About

A comprehensive module integrating motion detection, temperature and humidity monitoring, RGB LED control, and relay switching functionalities using an ESP32.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published