Ankit Raj
Ankit Raj
Page 1
A
PROJECT REPORT
ON
HOME AUTOMATION SYSTEM USING ESP32
Diploma
in
Electrical Engineering
Submitted by
Name Enrollment No.
ANKIT RAJ 21011200005
Declaration
I, Ankit Raj (21011200005), bearing hereby certify that the Project Report
out under the guidance of Mr. Rohit Kr. Rajak, Lecture. is submitted to
of bonafide work carried out by me independently, and the results embodied in this
report have not been reproduced or copied from any source. The results embodied
in this report have not been submitted to any other Board or Institute for the award
Guide’s Certificate
enclosed in this report have been verified and found satisfactory. The results
embodied in this report have not been submitted to any other Board or Institute for
EXTERNAL EXAMINER
Page 4
ACKNOWLEDGEMENT
ABSTRACT
CONTENTS
Page No
1. INTRODUCTION ……………………………………………………… 7
1. INTRODUCTION
Nowadays, we have remote controls for our television sets and other electronic
systems, which have made our lives real easy. Have you ever wondered about
home automation which would give the facility of controlling tube lights, fans and
other electrical appliances at home using a remote control? Off-course, Yes! But,
are the available options cost-effective? If the answer is No, we have found a
solution to it. We have come up with a new system called ESP32S based
Home automation using wifi & google assistant . This system is super-cost
effective and can give the user, the ability to control any electronic device without
even spending for a remote control. This project helps the user to control all the
electronic devices using his/her smartphone. Time is a very valuable thing.
Everybody wants to save time as much as they can. New technologies are being
introduced to save our time. To save people's time we are introducing Home
Automation system using wifi(ESP32S) & google assistant. With the help of this
system you can control your home appliances from your mobile phone. You can
turn on/off your home appliances within the range of Wifi.
Page 8
2. LITERATURE SURVEY
Introduction
Home automation, also known as domotics, involves the control and
automation of household systems such as lighting, heating, and appliances.
Modern home automation systems leverage Internet of Things (IoT)
technologies to enhance comfort, security, and energy efficiency. The
integration of WiFi, ESP32S microcontrollers, and voice assistants like Google
Assistant has enabled more advanced and user-friendly home automation
solutions
Overview of Key Components
ESP32 Microcontroller*: ESP32S is a powerful, low-cost microcontroller with
integrated WiFi and Bluetooth capabilities. Its high processing power,
flexibility, and extensive library support make it ideal for IoT applications.
WiFi Connectivity*: WiFi is a widely adopted wireless communication
technology, essential for connecting IoT devices to the internet and enabling
remote control and monitoring.
Home Automation Platforms
Platforms like Home Assistant, OpenHAB, and Blynk provide frameworks for
integrating various smart devices. They support ESP32S and can interface with
Google Assistant, enabling unified control of home automation systems.
Voice Command Processing
Studies highlight the use of Google Cloud's Natural Language Processing
(NLP) services to interpret and process voice commands from Google
Page 9
Assistant. These commands are then translated into actions that control the
ESP32S devices.
3. BLOCK DIAGRAM
DESCRIPTION
SMART PHONE
Page 10
Used for controlling Purpose, for giving command and gain output,
for this g o o g l e a s s i s t a n t is required.
RELAY DRIVER
Output
These are the output Generated from the given input by the user The user can
set the various output sections and can gain output through any of the section
like Home appliance A for lights, Home appliance B for fans, Home appliance
C for T.V .and many more………
4. CIRCUIT DIAGRAM
Temperature Sensor: Connect the UCC and GND to 50 and GUD respectively.
The data pin goes to a digital input pin on the microcontroller.
Light Sensor (LDR): Connect in series with a resistor to form a voltage divider,
with the junction connected to an analog input pin.
2. Relay Connections:
Control Pins: Connect the relay control pins to digital output pins of the
microcontroller through transistors.
Page 12
Relay Power: Connect the relays UCC and GND to 50 and GND.
AC Appliance Control: Connect the common (COM) and normally open (NO)
terminals of the relay to the appliance and the mains power.
5. NODEMCU ESP32S
Microcontroller:
Programming:
Page 13
The NodeMCU firmware supports the Lua scripting language, but you can
also program the ESP32S using the Arduino IDE, MicroPython, or other
development environments.
Connectivity:
With integrated Wi-Fi and Bluetooth, it’s suitable for a wide range of IoT
applications, including home automation, wearables, and sensor networks.
Wi-Fi and Bluetooth*: It supports both Wi-Fi (802.11 b/g/n) and Bluetooth
(Classic and BLE), making it ideal for IoT applications.
Low Power Consumption*: The ESP32S can operate in various power modes,
enabling it to be used in battery-powered applications.
Rich Interface Options*: It includes interfaces such as UART, SPI, I2C, I2S,
PWM, ADC, DAC, and touch sensors.
Built-in Hall Sensor and Temperature Sensor*: It features a hall effect sensor
and an internal temperature sensor.
Embedded Flash Memory*: Typically, the ESP32S boards come with built-in
flash memory for program storage.
These features make the NodeMCU ESP32S suitable for a wide range of
applications, from home automation and wearable electronic
Page 14
PIN DIAGRAM/DESCRIPTION
Page 15
ESP32S
NODEMCU NODEMCU ESP32S
PIN
DEV KIT DEV KIT PIN
INTRODUCTION
This is a 5V 8-channel relay interface board, and each channel needs a 15 driver
current. It can be used to control various appliances and equipment with large
current. It is equipped DC30V 10A. It has a standard interface that can be
controlled directly by microcontroller.
PIN DESCRIPTION
1) Input: 0-5 V
2) VCC: Positive supply voltage
3) GND: Ground
4) IN1--IN8: Relay control port
5) Output: supports various types of loads
6) Connect a load, DC 30V/10A,
Page 17
FEATURE
1. Size: 75mm (Length) * 55mm (Width) * 19.3mm (Height)
2. Weight: 61g
3. PCB Color: Blue
4. There are four fixed screw holes at each corner of the board, easy for install
and fix. The diameter of the hole is 3.1mm
5. High quality Single relay is used with single pole double throw, a common
terminal, a normally open terminal, and a normally closed terminal
6. Optical coupling isolation, good anti-interference.
7. Closed at low level with indicator on, released at high level with indicator off
8. VCC is system power source, and JD_VCC is relay power source. Ship 5V
relay by default. Plug jumper cap to use
9. The maximum output of the relay: DC 30V/10A, AC 250V/10A
Page 18
7. ESP32S
INTRODUCTION
ESP32 is the SoC (System on Chip) microcontroller which has gained massive
popularity recently. Whether the popularity of ESP32S grew because of the growth
of IoT or whether IoT grew because of the introduction of ESP32S is debatable. If
you know 10 people who have been part of the firmware development for any IoT
device, chances are that 7−8 of them would have worked on ESP32S at some
point. So what is the hype all about? Why has ESP32S become so popular so
quickly Before we delve into the actual reasons for the popularity of ESP32S, let's
take a look at some of its important specifications. The specs listed below belong
to the ESP32S WROOM 32
Secondly, the μC should be able to perform basic processing of the incoming
sensor data, sometimes at high speeds, and have sufficient memory to store the
Page 19
PIN CONFIGURATION
CODING
/
******************************************************************
****************
* TITLE: ESP RainMaker + IR + Manual Switch control 8 Relays using ESP32
DHT11 LDR (Real time feedback + no WiFi control)
* Click on the following links to learn more.
* YouTube Video: https://youtu.be/7knQaSuEgsU
* Related Blog : https://iotcircuithub.com/esp32-projects/
* by Tech StudyCell
* Preferences--> Aditional boards Manager URLs :
* http://arduino.esp8266.com/stable/package_esp8266com_index.json,https://
raw.githubusercontent.com/espressif/arduino-esp32/gh-pages/
package_esp32_index.json
*
* Download Board ESP32 (2.0.3): https://github.com/espressif/arduino-esp32
*
* Download the libraries
* IRremote Library (3.6.1): https://github.com/Arduino-IRremote/Arduino-
IRremote
* DHT Library (1.4.4): https://github.com/adafruit/DHT-sensor-library
******************************************************************
****************/
#include "RMaker.h"
#include "WiFi.h"
#include "WiFiProv.h"
#include <IRremote.h>
#include <DHT.h>
#include <SimpleTimer.h>
// Switch State
bool SwitchState_1 = LOW;
bool SwitchState_2 = LOW;
bool SwitchState_3 = LOW;
bool SwitchState_4 = LOW;
bool SwitchState_5 = LOW;
bool SwitchState_6 = LOW;
bool SwitchState_7 = LOW;
bool SwitchState_8 = LOW;
float temperature1 = 0;
Page 23
float humidity1 = 0;
float ldrVal = 0;
IRrecv irrecv(IR_RECV_PIN);
decode_results results;
SimpleTimer Timer;
//The framework provides some standard device types like switch, lightbulb, fan,
temperature sensor.
static Switch my_switch1(deviceName_1, &RelayPin1);
static Switch my_switch2(deviceName_2, &RelayPin2);
static Switch my_switch3(deviceName_3, &RelayPin3);
static Switch my_switch4(deviceName_4, &RelayPin4);
static Switch my_switch5(deviceName_5, &RelayPin5);
static Switch my_switch6(deviceName_6, &RelayPin6);
static Switch my_switch7(deviceName_7, &RelayPin7);
static Switch my_switch8(deviceName_8, &RelayPin8);
static TemperatureSensor temperature("Temperature");
static TemperatureSensor humidity("Humidity");
static TemperatureSensor ldr("LDR");
break;
}
}
if(strcmp(device_name, deviceName_1) == 0) {
if(strcmp(param_name, "Power") == 0) {
Serial.printf("Received value = %s for %s - %s\n", val.val.b? "true" : "false",
device_name, param_name);
toggleState_1 = val.val.b;
(toggleState_1 == false) ? digitalWrite(RelayPin1, HIGH) :
digitalWrite(RelayPin1, LOW);
param->updateAndReport(val);
}
if(strcmp(param_name, "Power") == 0) {
Serial.printf("Received value = %s for %s - %s\n", val.val.b? "true" : "false",
device_name, param_name);
toggleState_2 = val.val.b;
(toggleState_2 == false) ? digitalWrite(RelayPin2, HIGH) :
digitalWrite(RelayPin2, LOW);
param->updateAndReport(val);
}
if(strcmp(param_name, "Power") == 0) {
Serial.printf("Received value = %s for %s - %s\n", val.val.b? "true" : "false",
Page 25
device_name, param_name);
toggleState_3 = val.val.b;
(toggleState_3 == false) ? digitalWrite(RelayPin3, HIGH) :
digitalWrite(RelayPin3, LOW);
param->updateAndReport(val);
}
if(strcmp(param_name, "Power") == 0) {
Serial.printf("Received value = %s for %s - %s\n", val.val.b? "true" : "false",
device_name, param_name);
toggleState_4 = val.val.b;
(toggleState_4 == false) ? digitalWrite(RelayPin4, HIGH) :
digitalWrite(RelayPin4, LOW);
param->updateAndReport(val);
}
if(strcmp(param_name, "Power") == 0) {
Serial.printf("Received value = %s for %s - %s\n", val.val.b? "true" : "false",
device_name, param_name);
toggleState_5 = val.val.b;
(toggleState_5 == false) ? digitalWrite(RelayPin5, HIGH) :
digitalWrite(RelayPin5, LOW);
param->updateAndReport(val);
}
if(strcmp(param_name, "Power") == 0) {
Serial.printf("Received value = %s for %s - %s\n", val.val.b? "true" : "false",
device_name, param_name);
toggleState_6 = val.val.b;
(toggleState_6 == false) ? digitalWrite(RelayPin6, HIGH) :
Page 26
digitalWrite(RelayPin6, LOW);
param->updateAndReport(val);
}
if(strcmp(param_name, "Power") == 0) {
Serial.printf("Received value = %s for %s - %s\n", val.val.b? "true" : "false",
device_name, param_name);
toggleState_7 = val.val.b;
(toggleState_7 == false) ? digitalWrite(RelayPin7, HIGH) :
digitalWrite(RelayPin7, LOW);
param->updateAndReport(val);
}
if(strcmp(param_name, "Power") == 0) {
Serial.printf("Received value = %s for %s - %s\n", val.val.b? "true" : "false",
device_name, param_name);
toggleState_8 = val.val.b;
(toggleState_8 == false) ? digitalWrite(RelayPin8, HIGH) :
digitalWrite(RelayPin8, LOW);
param->updateAndReport(val);
}
}
}
void readSensor(){
if (isnan(h) || isnan(t)) {
Serial.println("Failed to read from DHT sensor!");
Page 27
return;
}
else {
humidity1 = h;
temperature1 = t;
//Serial.print("Temperature - "); Serial.println(t);
//Serial.print("Humidity - "); Serial.println(h);
}
}
void sendSensor()
{
readSensor();
temperature.updateAndReportParam("Temperature", temperature1);
humidity.updateAndReportParam("Temperature", humidity1);
ldr.updateAndReportParam("Temperature", ldrVal);
}
void manual_control()
{
if (digitalRead(SwitchPin1) == LOW && SwitchState_1 == LOW) {
digitalWrite(RelayPin1, LOW);
toggleState_1 = 1;
SwitchState_1 = HIGH;
my_switch1.updateAndReportParam(ESP_RMAKER_DEF_POWER_NAME,
toggleState_1);
Serial.println("Switch-1 on");
}
if (digitalRead(SwitchPin1) == HIGH && SwitchState_1 == HIGH) {
digitalWrite(RelayPin1, HIGH);
toggleState_1 = 0;
SwitchState_1 = LOW;
my_switch1.updateAndReportParam(ESP_RMAKER_DEF_POWER_NAME,
toggleState_1);
Serial.println("Switch-1 off");
}
if (digitalRead(SwitchPin2) == LOW && SwitchState_2 == LOW) {
digitalWrite(RelayPin2, LOW);
toggleState_2 = 1;
SwitchState_2 = HIGH;
my_switch2.updateAndReportParam(ESP_RMAKER_DEF_POWER_NAME,
Page 28
toggleState_2);
Serial.println("Switch-2 on");
}
if (digitalRead(SwitchPin2) == HIGH && SwitchState_2 == HIGH) {
digitalWrite(RelayPin2, HIGH);
toggleState_2 = 0;
SwitchState_2 = LOW;
my_switch2.updateAndReportParam(ESP_RMAKER_DEF_POWER_NAME,
toggleState_2);
Serial.println("Switch-2 off");
}
if (digitalRead(SwitchPin3) == LOW && SwitchState_3 == LOW) {
digitalWrite(RelayPin3, LOW);
toggleState_3 = 1;
SwitchState_3 = HIGH;
my_switch3.updateAndReportParam(ESP_RMAKER_DEF_POWER_NAME,
toggleState_3);
Serial.println("Switch-3 on");
}
if (digitalRead(SwitchPin3) == HIGH && SwitchState_3 == HIGH) {
digitalWrite(RelayPin3, HIGH);
toggleState_3 = 0;
SwitchState_3 = LOW;
my_switch3.updateAndReportParam(ESP_RMAKER_DEF_POWER_NAME,
toggleState_3);
Serial.println("Switch-3 off");
}
if (digitalRead(SwitchPin4) == LOW && SwitchState_4 == LOW) {
digitalWrite(RelayPin4, LOW);
toggleState_4 = 1;
SwitchState_4 = HIGH;
my_switch4.updateAndReportParam(ESP_RMAKER_DEF_POWER_NAME,
toggleState_4);
Serial.println("Switch-4 on");
}
if (digitalRead(SwitchPin4) == HIGH && SwitchState_4 == HIGH) {
digitalWrite(RelayPin4, HIGH);
toggleState_4 = 0;
SwitchState_4 = LOW;
my_switch4.updateAndReportParam(ESP_RMAKER_DEF_POWER_NAME,
toggleState_4);
Page 29
Serial.println("Switch-4 off");
}
if (digitalRead(SwitchPin5) == LOW && SwitchState_5 == LOW) {
digitalWrite(RelayPin5, LOW);
toggleState_5 = 1;
SwitchState_5 = HIGH;
my_switch5.updateAndReportParam(ESP_RMAKER_DEF_POWER_NAME,
toggleState_5);
Serial.println("Switch-5 on");
}
if (digitalRead(SwitchPin5) == HIGH && SwitchState_5 == HIGH) {
digitalWrite(RelayPin5, HIGH);
toggleState_5 = 0;
SwitchState_5 = LOW;
my_switch5.updateAndReportParam(ESP_RMAKER_DEF_POWER_NAME,
toggleState_5);
Serial.println("Switch-5 off");
}
if (digitalRead(SwitchPin6) == LOW && SwitchState_6 == LOW) {
digitalWrite(RelayPin6, LOW);
toggleState_6 = 1;
SwitchState_6 = HIGH;
my_switch6.updateAndReportParam(ESP_RMAKER_DEF_POWER_NAME,
toggleState_6);
Serial.println("Switch-6 on");
}
if (digitalRead(SwitchPin6) == HIGH && SwitchState_6 == HIGH) {
digitalWrite(RelayPin6, HIGH);
toggleState_6 = 0;
SwitchState_6 = LOW;
my_switch6.updateAndReportParam(ESP_RMAKER_DEF_POWER_NAME,
toggleState_6);
Serial.println("Switch-6 off");
}
if (digitalRead(SwitchPin7) == LOW && SwitchState_7 == LOW) {
digitalWrite(RelayPin7, LOW);
toggleState_7 = 1;
SwitchState_7 = HIGH;
my_switch7.updateAndReportParam(ESP_RMAKER_DEF_POWER_NAME,
toggleState_7);
Serial.println("Switch-7 on");
Page 30
}
if (digitalRead(SwitchPin7) == HIGH && SwitchState_7 == HIGH) {
digitalWrite(RelayPin7, HIGH);
toggleState_7 = 0;
SwitchState_7 = LOW;
my_switch7.updateAndReportParam(ESP_RMAKER_DEF_POWER_NAME,
toggleState_7);
Serial.println("Switch-7 off");
}
if (digitalRead(SwitchPin8) == LOW && SwitchState_8 == LOW) {
digitalWrite(RelayPin8, LOW);
toggleState_8 = 1;
SwitchState_8 = HIGH;
my_switch8.updateAndReportParam(ESP_RMAKER_DEF_POWER_NAME,
toggleState_8);
Serial.println("Switch-8 on");
}
if (digitalRead(SwitchPin8) == HIGH && SwitchState_8 == HIGH) {
digitalWrite(RelayPin8, HIGH);
toggleState_8 = 0;
SwitchState_8 = LOW;
my_switch8.updateAndReportParam(ESP_RMAKER_DEF_POWER_NAME,
toggleState_8);
Serial.println("Switch-8 off");
}
}
void ir_remote(){
if (irrecv.decode(&results)) {
switch(results.value){
case IR_Button_1:
digitalWrite(RelayPin1, toggleState_1);
toggleState_1 = !toggleState_1;
my_switch1.updateAndReportParam(ESP_RMAKER_DEF_POWER_NAME,
toggleState_1);
delay(100);
break;
case IR_Button_2:
digitalWrite(RelayPin2, toggleState_2);
toggleState_2 = !toggleState_2;
Page 31
my_switch2.updateAndReportParam(ESP_RMAKER_DEF_POWER_NAME,
toggleState_2);
delay(100);
break;
case IR_Button_3:
digitalWrite(RelayPin3, toggleState_3);
toggleState_3 = !toggleState_3;
my_switch3.updateAndReportParam(ESP_RMAKER_DEF_POWER_NAME,
toggleState_3);
delay(100);
break;
case IR_Button_4:
digitalWrite(RelayPin4, toggleState_4);
toggleState_4 = !toggleState_4;
my_switch4.updateAndReportParam(ESP_RMAKER_DEF_POWER_NAME,
toggleState_4);
delay(100);
break;
case IR_Button_5:
digitalWrite(RelayPin5, toggleState_5);
toggleState_5 = !toggleState_5;
my_switch5.updateAndReportParam(ESP_RMAKER_DEF_POWER_NAME,
toggleState_5);
delay(100);
break;
case IR_Button_6:
digitalWrite(RelayPin6, toggleState_6);
toggleState_6 = !toggleState_6;
my_switch6.updateAndReportParam(ESP_RMAKER_DEF_POWER_NAME,
toggleState_6);
delay(100);
break;
case IR_Button_7:
digitalWrite(RelayPin7, toggleState_7);
toggleState_7 = !toggleState_7;
my_switch7.updateAndReportParam(ESP_RMAKER_DEF_POWER_NAME,
Page 32
toggleState_7);
delay(100);
break;
case IR_Button_8:
digitalWrite(RelayPin8, toggleState_8);
toggleState_8 = !toggleState_8;
my_switch8.updateAndReportParam(ESP_RMAKER_DEF_POWER_NAME,
toggleState_8);
delay(100);
break;
case IR_All_Off:
all_SwitchOff();
break;
default : break;
}
//Serial.println(results.value, HEX);
irrecv.resume();
}
}
void all_SwitchOff(){
toggleState_1 = 0; digitalWrite(RelayPin1, HIGH);
my_switch1.updateAndReportParam(ESP_RMAKER_DEF_POWER_NAME,
toggleState_1); delay(100);
toggleState_2 = 0; digitalWrite(RelayPin2, HIGH);
my_switch2.updateAndReportParam(ESP_RMAKER_DEF_POWER_NAME,
toggleState_2); delay(100);
toggleState_3 = 0; digitalWrite(RelayPin3, HIGH);
my_switch3.updateAndReportParam(ESP_RMAKER_DEF_POWER_NAME,
toggleState_3); delay(100);
toggleState_4 = 0; digitalWrite(RelayPin4, HIGH);
my_switch4.updateAndReportParam(ESP_RMAKER_DEF_POWER_NAME,
toggleState_4); delay(100);
toggleState_5 = 0; digitalWrite(RelayPin5, HIGH);
my_switch5.updateAndReportParam(ESP_RMAKER_DEF_POWER_NAME,
toggleState_5); delay(100);
toggleState_6 = 0; digitalWrite(RelayPin6, HIGH);
my_switch6.updateAndReportParam(ESP_RMAKER_DEF_POWER_NAME,
toggleState_6); delay(100);
toggleState_7 = 0; digitalWrite(RelayPin7, HIGH);
Page 33
my_switch7.updateAndReportParam(ESP_RMAKER_DEF_POWER_NAME,
toggleState_7); delay(100);
toggleState_8 = 0; digitalWrite(RelayPin8, HIGH);
my_switch8.updateAndReportParam(ESP_RMAKER_DEF_POWER_NAME,
toggleState_8); delay(100);
}
void setup()
{
Serial.begin(115200);
digitalWrite(RelayPin7, !toggleState_7);
digitalWrite(RelayPin8, !toggleState_8);
digitalWrite(wifiLed, LOW);
Node my_node;
my_node = RMaker.initNode(nodeName);
Timer.setInterval(2000);
//This is optional
RMaker.enableOTA(OTA_USING_PARAMS);
//If you want to enable scheduling, set time zone for your region using
setTimeZone().
//The list of available values are provided here
https://rainmaker.espressif.com/docs/time-service.html
Page 35
// RMaker.setTimeZone("Asia/Shanghai");
// Alternatively, enable the Timezone service and let the phone apps set the
appropriate timezone
RMaker.enableTZService();
RMaker.enableSchedule();
//Service Name
for(int i=0; i<17; i=i+8) {
espChipId |= ((ESP.getEfuseMac() >> (40 - i)) & 0xff) << i;
}
Serial.printf("\nStarting ESP-RainMaker\n");
RMaker.start();
WiFi.onEvent(sysProvEvent);
#if CONFIG_IDF_TARGET_ESP32
WiFiProv.beginProvision(WIFI_PROV_SCHEME_BLE,
WIFI_PROV_SCHEME_HANDLER_FREE_BTDM,
WIFI_PROV_SECURITY_1, pop, service_name);
#else
WiFiProv.beginProvision(WIFI_PROV_SCHEME_SOFTAP,
WIFI_PROV_SCHEME_HANDLER_NONE, WIFI_PROV_SECURITY_1, pop,
service_name);
#endif
my_switch1.updateAndReportParam(ESP_RMAKER_DEF_POWER_NAME,
false);
my_switch2.updateAndReportParam(ESP_RMAKER_DEF_POWER_NAME,
false);
my_switch3.updateAndReportParam(ESP_RMAKER_DEF_POWER_NAME,
false);
my_switch4.updateAndReportParam(ESP_RMAKER_DEF_POWER_NAME,
false);
my_switch5.updateAndReportParam(ESP_RMAKER_DEF_POWER_NAME,
false);
my_switch6.updateAndReportParam(ESP_RMAKER_DEF_POWER_NAME,
false);
my_switch7.updateAndReportParam(ESP_RMAKER_DEF_POWER_NAME,
false);
Page 36
my_switch8.updateAndReportParam(ESP_RMAKER_DEF_POWER_NAME,
false);
}
void loop()
{
// Read GPIO0 (external button to reset device
if(digitalRead(gpio_reset) == LOW) { //Push button pressed
Serial.printf("Reset Button Pressed!\n");
// Key debounce handling
delay(100);
int startTime = millis();
while(digitalRead(gpio_reset) == LOW) delay(50);
int endTime = millis();
if (WiFi.status() != WL_CONNECTED)
{
//Serial.println("WiFi Not Connected");
digitalWrite(wifiLed, false);
}
else
{
//Serial.println("WiFi Connected");
digitalWrite(wifiLed, true);
if (Timer.isReady()) {
//Serial.println("Sending Sensor Data");
sendSensor();
Timer.reset(); // Reset a second timer
}
Page 37
8. POWER SUPPLY
INTRODUCTION
The regulated power supply will accept an AC input and give a constant DC
output.
So we have Powered the Kit/ set-up with the Adaptor Which gives exact 5V output
voltage we have used the micro-type USB cables for connection of Controller with
Adaptor.
DESCRIPTION
Rectification
Rectifier is an electronic circuit consisting of diodes which carries out the
rectification process. Rectification is the process of converting an alternating
voltage or current into corresponding direct (DC) quantity. The input to a rectifier
is ac whereas its output is unidirectional pulsating DC. Usually a full wave rectifier
or a bridge rectifier is used to rectify both the half cycles of the ac supply (full
wave rectification). Figure below shows a full wave bridge rectifier.'
DC Filtration
The rectified voltage from the rectifier is a pulsating DC voltage having very high
ripple content. But this is not we want, we want a pure ripple free DC
Regulation
This is the last block in a regulated DC power supply. The output voltage or
current will change or fluctuate when there is change in the input from ac mains or
due to change in load current at the output of the regulated power supply or due to
other factors like temperature changes. This problem can be eliminated by using a
regulator.
A regulator will maintain the output constant even when changes at the input or
any other changes occur. Transistor series regulator, Fixed and variable IC
regulators or azener diode operated in the zener region can be used depending on
their applications. IC’s like 78XX and 79XX are used to obtained fixed values of
Page 39
voltages at the output. waveform. Hence a filter is used. Different types of filters
are used such as capacitor filter, LC filter, Choke input filter, π type filter.
9. FLOW CHART
Page 40
11. CONCLUSION
3. *Scalability and Flexibility*: The modular nature of the ESP32S system allows
for easy expansion. Additional devices and sensors can be added to the network
without significant modifications to the existing infrastructure. This makes the
system highly adaptable to different home automation
Page 43
12. REFERENCES
https://amzn.to/3mTWyVZ
3. Code for the ESP32 TO project with ESP32
https://iotcircuithub.com/esp-rainmak..
4. PCB Gerber File of ESP32 control 8 relays:
.: https://drive.google.com/uc?export=do...
5. Just ask Google Assistant, "Hey Google, turn off lights", or "Alexa,
HTTP://maps.app.goo.gl/edoeWoyBPL1mznHW8
Page 44