Professional Documents
Culture Documents
Black ? Book ?
Black ? Book ?
Sustainable Sanctuary
VIDYA PRASARAK MANDAL’s
POLYTECHNIC
Chendani Bunder Road, Thane-400 601 (Maharashtra).
Our Vision
Ensuring quality electronics engineering education for the benefit of
society.
Certificate
This is to certify that Mr./Miss College copy bearing
Examination Seat No. has satisfactorily completed his/her
PROJECT WORK entitled
Our sincere thanks to the entire teaching and non-teaching staff of Industrial
Electronics Department, for providing the best facilities andhelp in the actual
implementation of the project.
Thank you.
1.1 Abstract 07
08
1.2 Objective
09
1.3 Introduction
Chapter 2
11
2.1 List of Components
Chapter 3
Chapter 4
19
4.1 Components Description
20
4.1.1 ESP-32 Wroom 32
21
4.1.2 PIR Sensor
22
4.1.3 DC Toy Motor
23
4.1.4 Buzzer
24
4.1.5 LED
25
4.1.6 MQ2 Sensor
4.1.7 26
DHT-11 Sensor
4.1.8 27
2 Channel Relay Module
4.1.9 28
Ultrasonic Sensor
4.1.10 29
DC Water Pump
4.1.11 30
Mini Solar PV Panels
Chapter 5
Chapter 6
Chapter 7
7.1 Program 43
Chapter 8
8.1 Specification 47
Chapter 9
Chapter 10
10.2 Conclusion 61
10.3 References 62
Chapter 11
At the heart of this system lies the ESP32 Wroom 32 microcontroller, acting
as the central hub for data processing and communication. This intelligent hub
seamlessly connects with a server, facilitating a two-way exchange of
information. The system further extends its capabilities through the
incorporation of various sensors, including DHT11, PIR, MQ2, and HC-SR04,
providing real-time data for informed decision-making.
One of the standout features is the water level management system, which
dynamically responds to water levels and optimizes usage. Additionally, users
can customize their home environment by remotely controlling devices,
enhancing both comfort and efficiency.
➢ ESP-32 WROOM-32
➢ PIR Sensor
➢ DC motor
➢ Buzzer
➢ LED
➢ MQ2 sensor
➢ DTH 11
➢ Relay module
➢ Jumper Wires
➢ Single Strand Wire
➢ Ultrasonic sensor
➢ Mini water pump
➢ Micro USB cable
➢ Battery (Lithium-ion rechargeable cells)
➢ Mini solar PV panels
➢ Battery charging module
➢ Switch
➢ USB Hub
➢ Battery holder
❖ Software Used: -
➢ Arduino IDE
➢ Blynk.in
4. Relay 2 Control:
- Operates based on commands from the Blynk app.
- Blynk app commands are transferred to ESP32, which then controls Relay 2
5. Data Flow:
- Sensor data (temperature, humidity, motion, gas, water level) is sent to the
server.
- Server processes the data and sends relevant commands back to ESP32.
- ESP32 executes commands, controls relays, and performs actions based on
the received data.
1. Sensor Input:- PIR sensor detects motion and sends signals to the ESP32
Wroom 32.
3. Blynk Interface:
- Provides a user-friendly interface with sliders, buttons, or switches for
controlling devices and monitoring parameters.
- Widgets for on/off control of connected devices like buzzer, LED, and DC
motor.
5. Server Interaction:
- Blynk server receives data from the ESP32 Wroom 32.
- Processes user commands and updates the interface accordingly.
6. Feedback Loop:- The server sends back data or commands to the ESP32
Wroom 32 based on user inputs.
This setup allows for seamless remote monitoring and control of connected
devices through the Blynk interface, creating an effective IoT system with
motion detection capabilities.
Small buzzers come in various shapes and sizes, allowing for flexibility in
their applications. Some models are designed to be mounted directly onto
circuit boards, making them suitable for use in electronic devices such as
clocks, timers, and alarms. Others are enclosed in protective casings or
housings, ensuring durability and protection in more demanding environments.
In the world of DIY electronics and prototyping, small buzzers are often
employed to add sound interaction to projects. They can serve as audio
indicators, generating different tones or patterns to convey specific messages or
feedback. For example, a small buzzer connected to a microcontroller can
produce different beeping sequences to indicate the successful completion of a
task, the activation of a specific feature, or an error condition.
1.4 Buzzer
LEDs are also known for their durability and robustness. Being solid-state
devices, they do not have fragile components like filaments or glass envelopes,
making them resistant to shock, vibration, and external impacts. This
durability makes them suitable for various environments and applications,
including outdoor lighting, automotive lighting, and industrial settings.
One of the key advantages of LEDs is their instant response time. Unlike some
other lighting technologies, LEDs reach their full brightness almost instantly
when switched on. This rapid response is crucial in applications that require
immediate and accurate lighting, such as traffic signals and brake lights.
1.5 LED
The DHT11 is a popular and widely used temperature and humidity sensor
module. It is a low-cost, digital sensor that provides accurate and reliable
measurements of ambient temperature and relative humidity. The DHT11
module is commonly employed in various industries, home automation
systems, weather stations, and other applications where monitoring
environmental conditions is essential.
The DHT11 sensor module consists of a capacitive humidity sensor and a
thermistor for temperature measurement, along with a built-in
microcontroller that processes the sensor data and converts it into digital
signals. It operates on a single-wire communication protocol, making it easy
to interface with microcontrollers and Arduino boards.
Measuring temperature with the DHT11 is achieved by the thermistor, which
changes its resistance in response to temperature variations. This resistance
change is converted into temperature values by the sensor's internal circuitry.
The temperature range that the DHT11 can measure typically spans from 0
to 50 degrees Celsius, with an accuracy of approximately ±2 degrees Celsius.
The DHT11 is a low-cost sensor module that measures temperature and
humidity. It uses capacitive sensing for humidity detection and converts
changes in dielectric constant into relative humidity values. To use it, connect
its pins to a microcontroller or Arduino board and follow the communication
protocol. The DHT11 has a humidity range of 20% to 90% with around ±5%
accuracy. Though less precise and slower, it offers a reliable and affordable
solution for basic temperature and humidity monitoring.
When these sound waves encounter an obstacle in their path, they bounce back
towards the sensor. The receiver of the sensor captures the reflected waves, and
the sensor calculates the time taken for the waves to travel to the obstacle and
back. Using the speed of sound in the air, the sensor can determine the distance
between itself and the object with remarkable accuracy.
Key features of the HC-SR04 ultrasonic sensor include its simplicity, low cost,
and ease of integration. It typically has four pins: VCC (power supply), Trig
(trigger input), Echo (echo output), and GND (ground). Users can easily
interface it with microcontrollers like the ESP32 Wroom 32.
The mini DC water pump consists of a small electric motor that drives an
impeller or a propeller, creating a flow of water. These pumps are commonly
used in a variety of settings, including aquariums, water fountains, irrigation
systems, and experimental setups in electronics or DIY projects. The
simplicity of their design allows for easy integration into different systems,
and they are often compatible with a range of power sources, including
batteries and low-voltage power supplies.
One notable feature of mini DC water pumps is their ability to operate quietly
and efficiently, making them suitable for applications where noise is a
concern. Additionally, they are known for their low power consumption,
making them energy-efficient and cost-effective for continuous operation.
Overall, mini DC water pumps offer a reliable and compact solution for
moving water in small-scale applications, providing a balance of efficiency,
versatility, and ease of use.
Mini solar PV panels, also known as small photovoltaic panels, are compact
solar energy systems designed for applications with limited space or power
requirements. These panels typically have lower wattage outputs compared to
larger counterparts, making them suitable for portable devices, small
electronics, and low-power applications.
These panels are commonly used to charge small electronic devices like
smartphones, cameras, and rechargeable batteries. Additionally, they find
applications in educational projects, outdoor lighting, and other scenarioswhere
a small, sustainable power source is needed.
It's important to consider the wattage, efficiency, and durability when selecting
mini solar PV panels for a specific application. While they may not generate as
much power as larger solar panels, their versatility and portability make them
valuable for specific use cases.
During the initial stage, the TP4056 provides a constant current to the battery
until it reaches a predetermined voltage. Once this voltage is achieved, the
module switches to a constant voltage mode, delivering a stable voltage to the
battery while gradually reducing the charging current. This two-stage charging
process helps prevent overcharging and optimizes the battery's lifespan.
Moreover, the module is compact and easy to use, making it suitable for a range
of applications, from DIY projects to portable electronic devices. Its
affordability and reliability have made the TP4056 a popular choice for
hobbyists and professionals alike when implementing battery charging
solutions.
1. Arduino IDE
➢ The IDE comes with a wide range of built-in libraries and examples that
make it easy for users to get started with programming their Arduino boards.
Additionally, the IDE is designed to work seamlessly with the Arduino board,
allowing users to upload their code with a single click.
➢ Overall, the Arduino IDE is an essential tool for anyone looking toprogram
an Arduino board. Its user-friendly interface, built-in libraries, and
compatibility with multiple programming languages make it an ideal choice
for both beginners and experienced programmers alike.
2. MQ2 Sensor:
- A0 pin is connected to D34.
- D0 pin is connected to D35.
3. PIR Sensor:
- Output pin is connected to D15.
- VCC pin is connected to the Vin pin of ESP32 Wroom 32.
- GND pin is connected to the GND of ESP32 Wroom 32.
4. DHT11 Sensor
- Data pin is connected to D5.
Other sensors have their VCC connected to the 3.3-volt pin on ESP32 Wroom
32, and their GND pins are connected to the GND of ESP32 Wroom 32.
2. BUZZER Connection:
- Buzzer's positive pin is connected to D5 on the ESP32 .
- The negative pin of the buzzer is connected to the GND pin of the ESP32
3. DC Motor Configuration:
- DC motor's positive pin is linked to D4 on the ESP32
- The GND pin of the DC motor is connected to the GND pin of the ESP32
4. LED Connection:
- LED's positive pin is connected to D4 on the ESP32
- The GND pin of the LED is connected to the GND pin of the ESP32
The renewable energy system comprises a wind turbine and solar panel
connected in series to maximize power generation. The generated power is fed
into a dedicated battery charging circuit, specifically a TP4056 module. This
module efficiently charges the connected battery, acting as an energy storage
component within the system.
Once the battery is charged, the stored energy is directed to a USB hub,
featuring four Type-A ports. These ports serve as output points, enabling users
to connect standard mobile charger cables. This allows for the utilization of
renewable energy to power and charge various devices, creating a sustainable
and versatile energy source.
#include <WiFi.h>
#include <BlynkSimpleEsp32.h>
#include <DHT.h>
#define RELAY_1_PIN 23
#define RELAY_2_PIN 22
#define TRIG_PIN 4
#define ECHO_PIN 2
#define PIR_PIN 15
#define MQ2_ANALOG_PIN 34
#define MQ2_DIGITAL_PIN 35
#define DHT_PIN 5
#define DHT_TYPE DHT11.
#define MIN_DISTANCE 10 // Minimum distance in centimeters
#define MAX_DISTANCE 50 // Maximum distance in centimeters
void setup() {
Serial.begin(115200);
Blynk.begin(auth, ssid, pass);
pinMode(RELAY_1_PIN, OUTPUT);
pinMode(RELAY_2_PIN, OUTPUT);
pinMode(TRIG_PIN, OUTPUT);
pinMode(ECHO_PIN, INPUT);
pinMode(PIR_PIN, INPUT);
pinMode(MQ2_ANALOG_PIN, INPUT);
pinMode(MQ2_DIGITAL_PIN, INPUT);
void loop() {
Blynk.run();
// Read DHT11 sensor temperature only and update Blynk Chart widget
float temperature = dht.readTemperature();
Blynk.virtualWrite(V5, temperature);
BlynkTimer timer;
void sendSensor()
{
int motion_data=digitalRead(motion_sensor);
Serial.println(motion_data);
delay(200);
Blynk.virtualWrite(V0, motion_data);
delay(300);
}
void setup(){
Serial.begin(9600);
Blynk.begin(auth, ssid, pass);
timer.setInterval(100L, sendSensor);
}
void loop(){
Blynk.run();
timer.run();
• Number of channels: 2
• Control voltage: Usually 5V or 12V DC
• Maximum load: Typically rated for switching AC or DC loads up to
a certain voltage and current (e.g., 10A at 250VAC)
• Control signal input: Commonly accepts digital signals (e.g., from
microcontrollers like Arduino) to trigger the relay switches
• Isolation: Often includes isolation between the control circuitry and
the relay contacts for safety and protection
• Dimensions: Physical dimensions of the module, including the size
and layout of the relay switches and control circuitry
• Mounting: Methods for mounting the module, such as screw
terminals or header pins for easy connection
• Features: Additional features like status LEDs, optocouplers, or
protection diodes for enhanced performance and reliability
• Compatibility: Ensure compatibility with your control system or
microcontroller, considering factors like input voltage levels, signal
compatibility (e.g., TTL or CMOS), and communication protocols if
applicable.
• Reliability: Consider the expected lifespan and reliability of the relay
module, especially if it will be used in critical applications where
failure could result in safety hazards or costly downtime.
• Chemistry: Lithium-ion
• Nominal Voltage: 3.7V
• Maximum Voltage: 4.2V (during charging)
• Minimum Voltage: 2.5V (discharge cut-off)
• Standard Charging Current: 1C (2200mA for this cell)
• Maximum Charging Current: 2C
• Standard Discharge Current: 1C
• Maximum Discharge Current: 2C
• Cycle Life: Typically around 500 charge-discharge cycles
• Operating Temperature: -20°C to 60°C
• Cell Dimensions: Typically specified in millimeters (length x width x
height)
• Weight: Typically specified in grams
Department of Industrial Electronics, VPM’s Polytechnic Thane 55
CHAPTER 9
• Advantages: -
➢ Easy to operate and control the devices.
➢ Improved energy efficiency.
➢ Easy monitoring of motion.
➢ Smart switching.
➢ Low maintenance.
➢ Real time data can be accessed.
➢ Customization and Accessibility.
➢ eco-friendly
• Applications: -
As we advance, user feedback will play a crucial role in shaping the system's
features. We anticipate refining and expanding our automation capabilities
based on user preferences, making the system increasingly personalized and
adaptable to diverse lifestyles.
1. https://ieeexplore.ieee.org/document/8473224
2. https://ieeexplore.ieee.org/document/8907037
3. https://ieeexplore.ieee.org/document/8473224
4. https://randomnerdtutorials.com/
5. https://www.sciencedirect.com/science/article/pii/S09596526203
2922X
6. https://youtu.be/sXNcZdf4NS0?si=LKrDjlnZ97yODSXT
7. https://youtu.be/Jl4O4bERVnw?si=iqKSIkwPaSrrrFtw
8. https://chat.openai.com/
9. https://bard.google.com/chat
10. https://www.bing.com/
2. Pin Definitions
2.1 Pin Layout
Keepout Zone
1 GND GND 38
2 3V3 IO23 37
3 EN IO22 36
4 TXD0 35
5 RXD0 34
6 IO34 IO21 33
39 GND
7 IO35 NC 32
8 IO32 IO19 31
9 IO33 IO18 30
10 IO25 IO5 29
11 IO26 IO17 28
12 IO27 IO16 27
13 IO14 IO4 26
CMD
GND
IO13
IO15
CLK
SD2
SD3
SD0
SD1
IO2
14 IO12 IO0 25
15
16
17
18
19
20
21
22
23
24
Notice:
* Pins SCK/CLK, SDO/SD0, SDI/SD1, SHD/SD2, SWP/SD3 and SCS/CMD, namely, GPIO6 to GPIO11 are connected
to the integrated SPI flash integrated on the module and are not recommended for other uses.
6. Schematics
6. Schematics
3
GPIO13 GPIO23
GND XOUT
GND
Pin.3 Pin.17 Pin.36
CHIP_PU/EN SD2 IO22
XIN
CHIP_PU SHD/SD2 GPIO22
2
Pin.4 Pin.18 Pin.35
SENSOR_VP SD3 TXD0
SENSOR_VP SWP/SD3 U0TXD
48
47
46
45
44
43
42
41
40
39
38
37
Pin.6 Pin.20 Pin.33
CAP2 IO34 CLK IO21
GPIO21
GPIO22
VDDA
XTAL_P
VDDA
XTAL_N
U0TXD
U0RXD
GPIO19
CAP1
VDD3P3_CPU
GND
8
VCC
13
GND
GPIO32 SDI/SD1 GPIO19
4
Pin.9 Pin.23 Pin.30
IO33 IO15 IO18
VDD3P3_RTC
MTDO
GPIO2
GPIO0
GPIO4
MTMS
MTCK
Pin.11 Pin.28
GPIO33
GPIO25
GPIO26
GPIO27
GPIO14
GPIO12
GPIO13
GPIO15
IO26 IO17
GPIO2
GPIO0
GPIO4
GPIO26 GPIO17
ESP32-WROOM-32 Datasheet V2.9
Pin.12 Pin.27
IO27 IO16
GPIO27 GPIO16
Pin.13 Pin.26
IO14 IO4
GPIO14 GPIO4
This Relay Module 2-Channel is a module designed to allow you to control two relays in a very
simple and intuitive manner. Being compatible with Arduino, the most immediate way to use it is to
connect it to an Arduino board using flexible jumpers.
Exploiting the characteristics of the relays mounted on the module and through the use of two
Arduino digital I/O pins, it is possible to control motors, inductive loads and other devices; this
product is therefore fundamental in domotics projects or, more in general, in robotics projects.
The module is equipped with optocouplers on IN1 and IN2 lines in such a way that it ensures the
galvanic insulation between the relay load and the control board which drives this module.
CONNECTIONS
Pin Function
IN1 TTL digital input
IN2 TTL digital input
GND Ground
+5V Power (+5V)
NO1 Normally open contact
COM1 Common contact
NC1 Normally closed contact
1
MICROBOT di Prosseda Mirko – Strada Chiesuola 117, 04010 Borgo Carso (LT), Italy
web: http://www.microbot.it email: info@microbot.it tel: +39-347-2159275
Microbot – Relay Module 2-Channel
CHARACTERISTICS
Pin Function
Supply voltage +5V
Supply current 144mA typ. (150mA max.)
Current on pin IN 14mA typ.
Rated load 7A 250VAC
Operating temperature -30°C / +70°C
Operate time max. 10ms Max.
Release time max. 5ms Max.
Insulation resistance 100Mohm Min.
Mechanical Life Expectancy 10,000,000 operations
Electrical Life Expectancy 10,000 operations
Dimensions 1.7” x 1.3” (43.2 x 33.0 mm)
Weight 0.92oz (26.2g)
Tab.2 - Characteristics
2
MICROBOT di Prosseda Mirko – Strada Chiesuola 117, 04010 Borgo Carso (LT), Italy
web: http://www.microbot.it email: info@microbot.it tel: +39-347-2159275
MQ-2 Semiconductor Sensor for Combustible Gas
Sensitive material of MQ-2 gas sensor is SnO2, which with lower conductivity in clean air. When the
target combustible gas exist, The sensor’s conductivity is more higher along with the gas concentration
rising. Please use simple electrocircuit, Convert change of conductivity to correspond output signal of
gas concentration.
MQ-2 gas sensor has high sensitity to LPG, Propane and Hydrogen, also could be used to Methane
and other combustible steam, it is with low cost and suitable for different application.
Character Configuration
*Good sensitivity to Combustible gas in wide range
* High sensitivity to LPG, Propane and Hydrogen
* Long life and low cost
* Simple drive circuit
Application
* Domestic gas leakage detector
* Industrial Combustible gas detector
* Portable gas detector
Fig1 Fig2
Fig.1 shows the typical sensitivity characteristics of Rs/R0 Fig.2 shows the typical temperature and humidity
the MQ-2, ordinate means resistance ratio of the sensor characteristics. Ordinate means resistance ratio
(Rs/Ro), abscissa is concentration of gases. Rs means of the sensor (Rs/Ro), Rs means resistance of sensor
resistance in different gases, Ro means resistance of in 1000ppm Butane under different tem. and humidity.
sensor in 1000ppm Hyrogen. All test are under standard Ro means resistance of the sensor in environment of
test conditions. 1000ppm Methane, 20℃/65%RH
Structure and configuration of MQ-2 gas sensor is shown as Fig. 3, sensor composed by micro AL2O3 ceramic tube, Tin
Dioxide (SnO2) sensitive layer, measuring electrode and heater are fixed into a crust made by plastic and stainless steel
net. The heater provides necessary work conditions for work of sensitive components. The enveloped MQ-2 have 6 pin, 4
of them are used to fetch signals, and other 2 are used for providing heating current.
Notification
1 Following conditions must be prohibited
1.1 Exposed to organic silicon steam
Organic silicon steam cause sensors invalid, sensors must be avoid exposing to silicon bond,
fixature, silicon latex, putty or plastic contain silicon environment
1.2 High Corrosive gas
If the sensors exposed to high concentration corrosive gas (such as H2Sz, SOX,Cl2,HCl etc), it will
not only result in corrosion of sensors structure, also it cause sincere sensitivity attenuation.
1.3 Alkali, Alkali metals salt, halogen pollution
The sensors performance will be changed badly if sensors be sprayed polluted by alkali metals salt
especially brine, or be exposed to halogen such as fluorin.
1.4 Touch water
Sensitivity of the sensors will be reduced when spattered or dipped in water.
1.5 Freezing
Do avoid icing on sensor’surface, otherwise sensor would lose sensitivity.
1.6 Applied voltage higher
Applied voltage on sensor should not be higher than stipulated value, otherwise it cause down-line or
heater damaged, and bring on sensors’ sensitivity characteristic changed badly.
1.7 Voltage on wrong pins
For 6 pins sensor, if apply voltage on 1、3 pins or 4、6 pins, it
will make lead broken, and without signal when apply on 2、4 pins
2.5 Vibration
Continual vibration will result in sensors down-lead response then repture. In transportation or
assembling line, pneumatic screwdriver/ultrasonic welding machine can lead this vibration.
2.6 Concussion
If sensors meet strong concussion, it may lead its lead wire disconnected.
2.7 Usage
For sensor, handmade welding is optimal way. If use wave crest welding should meet the following
conditions:
2.7.1 Soldering flux: Rosin soldering flux contains least chlorine
2.7.2 Speed: 1-2 Meter/ Minute
2.7.3 Warm-up temperature:100±20℃
2.7.4 Welding temperature:250±10℃
2.7.5 1 time pass wave crest welding machine
If disobey the above using terms, sensors sensitivity will be reduced.