Download as pdf or txt
Download as pdf or txt
You are on page 1of 73

EcoHaven: Your Smart,

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

“EcoHaven: Your Smart, Sustainable Sanctuary”


along with his / her batch mates in fulfillment for the

DIPLOMA COURSE IN INDUSTRIAL ELECTRONICS


of the Maharashtra State Board of Technical Education in the
Department of Industrial Electronics during the Academic Year 2022-2023.

Project Guide / Head of the Department/ PRINCIPAL/


Ms. Pradnya Bodke Dr. Kirti Agashe Dr.D.K.Nayak

Date: Internal Examiner External Examiner


Diploma Program in INDUSTRIAL ELECTRONICS
Vision
Ensuring quality electronics engineering education for the benefit of society.
Mission
• To provide the best technical learning environment for the completion of Industrial Electronics
curriculum with strong emphasis on concepts and fundamentals.
• To empower students with latest trends in electronics and multidisciplinary engineering with
the help of Industry and Alumni.
• To Motivate and Encourage professional skills of students and faculty.
• Undertaking collaborative projects for long-term Industry Institute interaction and research
innovations.
Programme Educational Objectives (PEOs)
• Provide socially responsible, environment friendly solutions to Industrial Electronics
Related broad-based problems adapting professional ethics..
• Adapt state-of-the-art Industrial Electronics broad-based technologies to work in multi-
disciplinary work environments.
• Solve broad-based problems individually and as a team member communicating effectively in
the world of work.

Programme Outcomes (POs)


• Basic and Discipline specific knowledge: Apply knowledge of basic mathematics,
science and engineering fundamentals and engineering specialization to solve the engineering
problems.
• Problem analysis: Identify and analyses well-defined engineering problems using codified
standard methods.
• Design/ development of solutions: Design solutions for well-defined technical problems
and assist with the design of systems components or processes to meet specified needs.
• Engineering Tools, Experimentation and Testing: Apply modern engineering tools and
appropriate technique to conduct standard tests and measurements.
• Engineering practices for society, sustainability, and environment: Apply
appropriate technology in context of society, sustainability, environment, and ethical practices.
• Project Management: Use engineering management principles individually, as a team
member or a leader to manage projects and effectively communicate about well-defined
engineering activities.
• Life-long learning: Ability to analyze individual needs and engage in updating in the context
of technological changes.

Program Specific Outcomes (PSOs)


• Power Electronic Systems: Troubleshoot Power Electronics based Equipment..
• Industrial Electronic Processes: Use Industrial Electronics Technologies to control the
industrial processes.

Department of Industrial Electronics, VPM’s Polytechnic Thane 1


Acknowledgement

We are thankful to our respected principal Dr.D.K.Nayak for encouraging us


and providing us with good facility of well-equipped laboratories which was a
key of success of our project.

We express our sincere gratitude to Head of the Industrial Electronics


Department Dr. Kirti Agashe and our project guide Ms. Pradnya Bodke for
her timely guidance to make this project successful.

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.

Lastly, my thanks and appreciations also go to my group in developing the


project with full of enthusiasm with a novel knowledge and continuous
encouragement from my parents has made this project successful.

Thank you.

Department of Industrial Electronics, VPM’s Polytechnic Thane 2


INDEX

Chapter 1 Page No.

1.1 Abstract 07

08
1.2 Objective
09
1.3 Introduction

Chapter 2
11
2.1 List of Components

Chapter 3

3.1 Block Diagram’s 13,15,17

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

Department of Industrial Electronics, VPM’s Polytechnic Thane 3


4.1.12 31
Battery Charging Module

Chapter 5

5.1 System Software 33

Chapter 6

6.1 Circuit Diagram 36,38,40

6.2 Circuit Description 37,39,41

Chapter 7

7.1 Program 43

Chapter 8

8.1 Specification 47

Chapter 9

9.1 Advantage and Application 58

Chapter 10

10.1 Future Scope 60

10.2 Conclusion 61

10.3 References 62

Chapter 11

11.1 Data sheet 63

Department of Industrial Electronics, VPM’s Polytechnic Thane 4


CHAPTER 1

Department of Industrial Electronics, VPM’s Polytechnic Thane 5


ABSTRACT
The Internet of Things (IoT) has revolutionized various domains, and one
significant area of application is home automation. IoT-based home automation
systems leverage the power of connected devices, sensors, and intelligent
algorithms to transform traditional houses into smart homes. This abstract
provides an overview of the key aspects and benefits of IoT-based home
automation.
The integration of IoT technology into home automation brings numerous
advantages to homeowners. Firstly, it enables remote monitoring and control of
different aspects of the home, including lighting, heating, ventilation, security
systems, and appliances. This functionality enhances convenience, comfort, and
energy efficiency, as users can manage their homes efficiently from anywhere
using smart devices, such as smartphones or tablets.
Moreover, IoT-based home automation systems offer advanced automation
features based on predefined rules and personalized preferences. By leveraging
data from various sensors and devices, the system can intelligently adjustsettings
and optimize energy consumption. For example, it can automatically adjust the
temperature based on occupancy patterns or gather data on energy usage to
provide insights and recommendations for efficiency improvements.
Furthermore, IoT-based home automation contributes to a more sustainable
lifestyle. By integrating renewable energy sources, such as solar panels, with the
system, homeowners can optimize energy production and consumption. The
system can dynamically manage energy flows, prioritize renewable sources, and
even provide insights on energy usage patterns for further efficiency
improvements.
Overall, the implementation of IoT-based home automation brings a new level
of convenience, energy efficiency, security, and sustainability to modern
households. With the ability to monitor and control multiple aspects of the home
remotely, users can create a personalized and intelligent living environment. As
technology continues to advance, the future holds even more exciting
possibilities for IoT-based home automation, making it an essential aspect of the
smart home ecosystem.

Department of Industrial Electronics, VPM’s Polytechnic Thane 6


OBJECTIVE
Remote Monitoring and Control:
Enable users to remotely monitor and control various aspects of their home
environment through a user-friendly Blynk app interface.
Sensor Integration:
Integrate multiple sensors, including DHT11 for temperature and humidity, PIR
sensor for motion detection, MQ2 sensor for gas monitoring, and HC-SR04 for
water level measurement.
Water Level Management:
Implement an intelligent water level management system that triggers actions
based on water levels, such as activating a relay to control water pumps or valves.
Customizable Relay Control:
Provide flexibility with relay control, allowing users to remotely operate Relay
2 through the Blynk app, offering on-demand control of connected devices.
Data Exchange with Server:
Establish a two-way communication channel with a server to send sensor data,
receive commands, and facilitate data processing for informed decision-making.
Energy Efficiency:
Optimize energy usage by implementing conditional control, such as turning on
or off devices based on specific sensor readings or user commands.
Modular Architecture:
Design the system with a modular architecture to allow easy scalability and
integration of additional sensors or devices in the future.
User-Friendly Interface:
Develop an intuitive and user-friendly interface on the Blynk app, providing
users with a seamless experience in monitoring, controlling, and customizing
their smart home environment.
Automation based on Sensor Data:
Enable automation of devices and systems based on real-time sensor data,
enhancing overall efficiency and responsiveness of the home automation setup.
Enhanced Security and Comfort:
Incorporate features that enhance home security, comfort, and energy efficiency,
contributing to a more intelligent and adaptable living space.
In summary, the project aims to create a comprehensive IoT-based home
automation solution that leverages sensor data, remote control capabilities, and
intelligent automation for a smarter, more connected home environment.
Department of Industrial Electronics, VPM’s Polytechnic Thane 7
INTRODUCTION
This project showcases a cutting-edge IoT-based Modular Home Automation
System that prioritizes both convenience and sustainability. Leveraging the
power of the Blynk app, users can remotely manage and monitor various
aspects of their home, from temperature and humidity to motion detection and
gas levels. However, what truly sets this system apart is its commitment to
environmental responsibility. By integrating renewable energy sources like
solar panels and a small wind turbine, the system operates efficiently while
minimizing its ecological impact.

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.

Department of Industrial Electronics, VPM’s Polytechnic Thane 8


CHAPTER 2

Department of Industrial Electronics, VPM’s Polytechnic Thane 9


LIST OF COMPONENTS USED
❖ Hardware Components: -

➢ 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

Department of Industrial Electronics, VPM’s Polytechnic Thane 10


CHAPTER 3

Department of Industrial Electronics, VPM’s Polytechnic Thane 11


BLOCK DIAGRAM (1)

Department of Industrial Electronics, VPM’s Polytechnic Thane 12


DESCRIPTION
1. ESP32 Wroom 32 Microcontroller:
- Interfaces with Blynk for remote control and monitoring via a dedicated
interface.
- Communicates bidirectionally with a server for data exchange.

2. Sensors Connected to ESP32:


- DHT11: Measures temperature and humidity.
- PIR Sensor: Detects motion.
- MQ2 Sensor: Monitors gas levels.
- HC-SR04: Ultrasonic sensor for distance measurement.

3. Water Level Monitoring:


- Monitors water level with an additional condition:
- If water level is below 30%, ESP32 receives a command to energize Relay
1.
- when water level reached to 100% ESP 32 receives a command to turn off
Relay 1

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.

Basically, this system integrates sensors, a microcontroller, Blynk app for


control, and a server for data exchange to create a smart environment with
monitoring and control capabilities.

Department of Industrial Electronics, VPM’s Polytechnic Thane 13


BLOCK DIAGRAM (2)

Department of Industrial Electronics, VPM’s Polytechnic Thane 14


DESCRIPTION

1. Sensor Input:- PIR sensor detects motion and sends signals to the ESP32
Wroom 32.

2. ESP32 Wroom 32 Microcontroller:


- Processes the PIR sensor data.
- Connects to the Blynk server for real-time monitoring and control.

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.

4. Data Transmission:- The ESP32 Wroom 32 sends relevant data and


commands to the Blynk server based on sensor inputs and user interactions.

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.

7. Device Control:- Connected devices such as buzzer, LED, and DC motor


respond to commands received from Blynk.

8. Execution:- ESP32 Wroom 32 executes actions based on received


commands, controlling devices and responding to motion detection from the
PIR sensor.

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.

Department of Industrial Electronics, VPM’s Polytechnic Thane 15


BLOCK DIAGRAM (3)

Department of Industrial Electronics, VPM’s Polytechnic Thane 16


DESCRIPTION

A renewable energy system is depicted in the block diagram, featuring a wind


turbine and solar panel connected in series. The generated power charges a
battery through a dedicated charging module. The stored energy is then
transmitted to a USB hub, equipped with four Type-A ports. These ports serve
as output points, allowing users to connect standard mobile charger cables and
harness the renewable energy for various devices.

Department of Industrial Electronics, VPM’s Polytechnic Thane 17


CHAPTER 4

Department of Industrial Electronics, VPM’s Polytechnic Thane 18


4.1.1. ESP-32 Wroom 32
The ESP32 WROOM-32 is a highly popular and versatile microcontroller
module in the field of IoT and embedded systems. It is based on the ESP32
system-on-chip (SoC) and offers a comprehensive platform for developing
Wi-Fi and Bluetooth-enabled applications.
The ESP32 WROOM-32 module combines a powerful 32-bit dual-core
processor, low-power modes, abundant memory, and a wide range of
peripherals. It also includes built-in Wi-Fi and Bluetooth connectivity, making
it ideal for various IoT applications that require wireless communication.
With its dual-core architecture, the ESP32 WROOM-32 provides ample
processing power for executing multiple tasks simultaneously. This capability
enables the development of more complex applications, such as home
automation systems, smart devices, and sensor networks.
The module offers extensive GPIO (General Purpose Input/Output) pins, SPI
(Serial Peripheral Interface), I2C (Inter-Integrated Circuit), UART (Universal
Asynchronous Receiver-Transmitter), and other interfaces, allowing for
seamless integration with external sensors, actuators, and other electronic
components.
Furthermore, the ESP32 WROOM-32 supports various programming
languages and development frameworks, including the popular Arduino IDE
and Espressif's own ESP-IDF (Espressif IoT Development Framework). It
also provides over-the-air (OTA) firmware updates, facilitating maintenance
and remote updates of deployed devices.

1.1 ESP-32 Wroom 32


Department of Industrial Electronics, VPM’s Polytechnic Thane 19
4.1.2 PIR Sensor
In conclusion, the passive infrared (PIR) sensor is a valuable device used for
motion detection and presence sensing. Its ability to detect changes ininfrared
radiation makes it a versatile tool for enhancing security, controllinglighting
systems, and improving overall energy efficiency.

The Passive Infrared (PIR) sensor is a remarkable device used in various


applications for motion detection. Built on the principle of detecting infrared
radiation emitted by objects, the PIR sensor offers a non-contact, efficient,
and reliable solution. It consists of a pyroelectric sensor that responds to
changes in the ambient infrared radiation caused by moving objects. When
an individual or object crosses its field of view, the sensor detects the infrared
energy and triggers an output signal to activate other components or systems.
Widely utilized in security systems, lighting controls, and automatic doors,
the PIR sensor plays a vital role in enhancing convenience, energy efficiency,
and safety by sensing human presence and movement accurately.

1.2 PIR Sensor

Department of Industrial Electronics, VPM’s Polytechnic Thane 20


4.1.3 DC Toy Motor
A DC toy motor is a simple and commonly used electric motor in various toys
and small-scale electronic devices. It operates on direct current (DC) and is
designed for lightweight applications. The motor typically consists of a small
coil of wire, a magnet, and a shaft with an attached propeller or gear mechanism.
The basic principle behind the operation of a DC toy motor involves the
interaction between the magnetic field generated by the coil and the permanent
magnet. When an electric current flows through the coil, it creates a temporary
magnetic field that interacts with the permanent magnet, causing the coil to
experience a force and subsequently rotate. This rotational motion is then
transferred to the attached shaft, resulting in the movement of the propeller or
gears.
DC toy motors are characterized by their simplicity, affordability, and ease of
use. They are often powered by small batteries, making them suitable for low-
voltage applications commonly found in toys, hobby projects, and educational
kits. The rotational speed and torque of these motors can vary depending on
factors such as voltage, coil design, and the presence of gear mechanisms.
While DC toy motors are not as powerful as larger electric motors, they serve
their purpose well in applications where lightweight and compact design are
essential. The simplicity of these motors makes them accessible for educational
purposes, allowing enthusiasts and beginners to understand the basic principles
of electromagnetism and motor operation.

1.3 DC Toy Motor

Department of Industrial Electronics, VPM’s Polytechnic Thane 21


4.1.4 Buzzer
A small buzzer is a compact, electronic device designed to emit a buzzing or
beeping sound when activated. It is commonly used in various applications
where a simple and audible alert is needed. Despite its modest size, a small
buzzer can play a significant role in a wide range of scenarios, from household
appliances to electronic gadgets, security systems, and DIY projects.

Typically, a small buzzer consists of a coil of wire, a magnet, and a diaphragm


or a piezoelectric element. When an electric current passes through the wire
coil, it creates a magnetic field that interacts with the magnet and causes the
diaphragm to vibrate or the piezoelectric element to deform. These vibrations
or deformations generate sound waves, resulting in the distinctive buzzing or
beeping sound.

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

Department of Industrial Electronics, VPM’s Polytechnic Thane 22


4.1.5 LED
LEDs, or Light Emitting Diodes, are compact electronic devices that emit light
when an electric current passes through them. They have revolutionized the
lighting industry with their numerous advantages. First and foremost, LEDs
are highly energy efficient, converting a significant portion of electrical energy
into light, resulting in lower power consumption and reduced electricity bills.
Additionally, LEDs have remarkable longevity, lasting much longer than
traditional incandescent or fluorescent bulbs. With lifespans ranging from
25,000 to 50,000 hours or more, they require less frequent replacement and
reduce maintenance costs.

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

Department of Industrial Electronics, VPM’s Polytechnic Thane 23


4.1.6 MQ2 Sensor
The MQ-2 sensor is a widely used gas sensor module designed for the
detection and measurement of various gases in the surrounding air. It has
gained popularity for its ability to sense combustible gases, such as LPG,
methane, and propane, making it a crucial component in applications related
to gas leakage detection and fire prevention. The sensor operates on the
principle of conductivity changes in the presence of different gases, utilizing
a sensitive layer of tin dioxide (SnO2) whose resistance alters when exposed
to specific gases. This change in resistance is then measured to determine the
concentration of the detected gas.
Physically, the MQ-2 sensor typically comprises a small circuit board
housing the gas sensor element, a heater, and a comparator circuit. The heater
is responsible for maintaining a constant temperature for the sensor element,
ensuring stability and accuracy in measurements. The sensor provides an
analog output voltage proportional to the concentration of the detected gas,
allowing it to be easily interfaced with microcontrollers or other digital
devices.
Calibrating the MQ-2 sensor is essential for accurate readings. It is versatile,
used in gas and fire detection, and air quality monitoring. However, it may
show cross-sensitivity to various gases, requiring regular calibration to
maintain accuracy. Prolonged exposure to high gas concentrations can
impact its lifespan.
Basically, the MQ-2 sensor plays a significant role in enhancing safety by
detecting and measuring concentrations of combustible gases in various
environments. Its cost-effectiveness and versatility make it a popular choice
for a range of applications, though proper calibration and an awareness of its
limitations are essential for reliable and accurate results.

1.6 MQ2 Sensor


Department of Industrial Electronics, VPM’s Polytechnic Thane 24
4.1.7 DHT-11 Sensor

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.

1.7 DHT-11 Sensor

Department of Industrial Electronics, VPM’s Polytechnic Thane 25


4.1.8 2-Channel relay module
A 2-channel relay module is a commonly used electronic component that
allows control over two separate electrical circuits using microcontrollers or
other control devices. It serves as a switch, enabling the control of high-
power devices with low-power signals.
The relay module consists of two relays, typically electromechanical or solid-
state relays, mounted on a single board. Each relay operates independently
and can handle different voltages and currents depending on the specific
model. Each channel usually has three pins: VCC (power supply), GND
(ground), and a control input pin.
To use a 2-channel relay module, you connect the control input pin of each
channel to a digital output pin of a microcontroller or any other compatible
control device. By sending a digital signal (typically HIGH or LOW), you
can control the on/off state of each relay independently. When the control
signal is activated, the relay's internal switch mechanism flips, connecting or
disconnecting the electrical load connected to the relay's output terminals.
A 2-channel relay module allows low-power control signals to control high-
power devices. It provides electrical isolation, enabling centralized control of
lights, motors, and appliances. It's used for automation, remote control, and
in industrial settings. Safety precautions and understanding specifications are
important for proper operation.

1.8 2-Channel relay module

Department of Industrial Electronics, VPM’s Polytechnic Thane 26


4.1.9 Ultrasonic sensor
The HC-SR04 ultrasonic sensor operates on the principle of echolocation, much
like how bats navigate in the dark. It consists of two main components – a
transmitter and a receiver. The transmitter emits ultrasonic sound waves,usually
at a frequency of around 40 kHz, which then travel through the air.

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.

Applications of the HC-SR04 sensor range from measuring distances in robotics


to creating proximity detection systems. For instance, in your described system, the
HC-SR04 sensor is employed to monitor water levels. Its ability to provide real-
time distance measurements makes it an invaluable component for creating
responsive and automated systems in a variety of contexts.

1.9 Ultrasonic sensor

Department of Industrial Electronics, VPM’s Polytechnic Thane 27


4.1.10 DC water pump

A mini DC water pump is a compact and efficient device designed for


pumping and circulating water in various applications. These pumps are
typically powered by direct current (DC) electrical sources and come in small
sizes, making them ideal for projects with space constraints or where a discreet
and portable water pumping solution is required.

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.

1.10 DC water pump

Department of Industrial Electronics, VPM’s Polytechnic Thane 28


4.1.11 Mini solar PV panels

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.

Key features of mini solar PV panels include their lightweight design,


flexibility, and ease of integration into various products. They harness sunlight
to generate electricity through the photovoltaic effect, where semiconductor
materials convert solar energy into electrical power.

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.

1.11 Mini solar PV panels

Department of Industrial Electronics, VPM’s Polytechnic Thane 29


4.1.12 Battery charging module
The TP4056 is a popular battery charging module commonly used for lithium-
ion and lithium-polymer batteries. This module offers a straightforward and
reliable solution for charging applications. It operates based on constant current
and constant voltage charging stages, ensuring the safe and efficient charging
of rechargeable batteries.

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.

The TP4056 integrates various protection features, including overcharge


protection, over-discharge protection, and short-circuit protection. These safety
mechanisms contribute to safeguarding the battery and the overall charging
system.

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.12 Battery charging module

Department of Industrial Electronics, VPM’s Polytechnic Thane 30


CHAPTER 5

Department of Industrial Electronics, VPM’s Polytechnic Thane 31


SYSTEM SOFTWARE

1. Arduino IDE

➢ Arduino IDE is an Integrated Development Environment (IDE) that is


specifically designed for programming Arduino microcontroller boards. It is
a free and open-source software that provides a user-friendly interface for
writing, compiling, and uploading code to an Arduino board.

➢ The code editor provides syntax highlighting and auto-completion, making


it easy to write and edit code. The compiler translates the code into machine-
readable instructions that can be understood by the Arduino board. The serial
monitor allows users to communicate with the Arduino board and see the
results of their code in real-time

➢ 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.

➢ The Arduino IDE supports multiple programming languages, including C


and C++. This makes it easy for users to integrate existing code into their
projects or to write their own custom libraries.

➢ 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.

Department of Industrial Electronics, VPM’s Polytechnic Thane 32


2. Blynk Software:

➢ Blynk is an IoT platform for iOS or Android smartphones that is used to


control Arduino, Raspberry Pi and NodeMCU via the Internet. This
application is used to create a graphical interface or human machine
interface (HMI) by compiling and providing the appropriate address on the
available widgets.
➢ Blynk was designed for the Internet of Things. It can control hardware
remotely, it can display sensor data, it can store data, visualize it and do
many other cool things.
➢ There are three major components in the platform:
1. Blynk App: – It allows you to create amazing interfaces for your projects
using various widgets which are provided.
2. Blynk Server: – It is responsible for all the communications between the
smartphone and hardware.
3. You can use the Blynk Cloud or run your private Blynk server locally. It's
open-source, could easily handle thousands of devices and can even be
launched on a Raspberry Pi.
4. Blynk Libraries: – It enables communication, for all the popular hardware
platforms, with the server and process all the incoming and outcoming
commands.
➢ The process that occurs when someone presses the Button in the Blynk
application is that the data will move to Blynk Cloud, where data magically
finds its way to the hardware that has been installed. It works in the opposite
direction and everything happens in a blink of an eye

Department of Industrial Electronics, VPM’s Polytechnic Thane 33


CHAPTER 6

Department of Industrial Electronics, VPM’s Polytechnic Thane 34


CIRCUIT DIAGRAM (1)

Department of Industrial Electronics, VPM’s Polytechnic Thane 35


CIRCUIT DESCRIPTION

1. Ultrasonic Sensor (HC-SR04):


- Trig pin is connected to D4 pin.
- Echo pin is connected to D2 pin.

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.

5. 2-channel Relay Module:


- IN1 pin is connected to D23.
- IN2 pin is connected to D22.
- Vcc is connected to the ESP32 Wroom 32 VIN pin.
- GND is connected to the GND of ESP32 Wroom 32.

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.

This setup allows for a comprehensive smart environment monitoring system,


integrating various sensors with an ESP32 microcontroller, Blynk app for
remote control, and a server for data exchange. The relay modules are used to
control devices based on sensor data and app commands.

Department of Industrial Electronics, VPM’s Polytechnic Thane 36


CIRCUIT DIAGRAM (2)

Department of Industrial Electronics, VPM’s Polytechnic Thane 37


CIRCUIT DESCRIPTION
1. PIR Sensor Setup:
- PIR sensor's output pin is connected to D15 on the ESP32
- Vcc of the PIR sensor is connected to the Vin pin of the ESP32 .
- GND pin of the PIR sensor is connected to the GND pin of the ESP32

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

5. Data Transmission and Server Interaction:


- The ESP32 processes data from the PIR sensor and transmits relevant
information to the Blynk server.
- The Blynk server receives data, processes user commands, and updates
the interface with sliders, buttons, or switches.

6. Feedback Loop and Device Control:


- The server sends commands back to the ESP32 based on user inputs.
- Connected devices like the buzzer, DC motor, and LED respond to
commands received from Blynk.

7. Execution:- The ESP32 executes actions based on received commands,


controlling devices and responding to motion detection from the PIR sensor.

This setup enables seamless remote monitoring and control of connected


devices through the user-friendly Blynk interface, providing effective IoT
functionality with motion detection capabilities.

Department of Industrial Electronics, VPM’s Polytechnic Thane 38


CIRCUIT DIAGRAM (3)

Department of Industrial Electronics, VPM’s Polytechnic Thane 39


CIRCUIT DESCRIPTION

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.

Department of Industrial Electronics, VPM’s Polytechnic Thane 40


CHAPTER 7

Department of Industrial Electronics, VPM’s Polytechnic Thane 41


PROGRAM
#define BLYNK_TEMPLATE_ID "TMPL3xVL3OSR9"
#define BLYNK_TEMPLATE_NAME "2 Channel Relay module"
#define BLYNK_AUTH_TOKEN "EwfSKEIUzgJP2JONIpYJLZ1Ae8FukEHC"

#include <WiFi.h>
#include <BlynkSimpleEsp32.h>
#include <DHT.h>

char auth[] = "EwfSKEIUzgJP2JONIpYJLZ1Ae8FukEHC";


char ssid[] = "Mukund";
char pass[] = "11223344";

#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

DHT dht(DHT_PIN, DHT_TYPE);

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);

dht.begin(); // Initialize DHT sensor

// Initialize relay states (OFF by default)


digitalWrite(RELAY_1_PIN, LOW);
digitalWrite(RELAY_2_PIN, LOW);

// Allow PIR sensor to calibrate

Department of Industrial Electronics, VPM’s Polytechnic Thane 42


delay(5000);
}
BLYNK_WRITE(V1) {
int relayState = param.asInt();
digitalWrite(RELAY_1_PIN, relayState);
}
BLYNK_WRITE(V2) {
int relayState = param.asInt();
digitalWrite(RELAY_2_PIN, relayState);

void loop() {
Blynk.run();

// Measure distance using ultrasonic sensor


long duration, distance;
digitalWrite(TRIG_PIN, LOW);
delayMicroseconds(2);
digitalWrite(TRIG_PIN, HIGH);
delayMicroseconds(10);
digitalWrite(TRIG_PIN, LOW);
duration = pulseIn(ECHO_PIN, HIGH);
distance = duration * 0.01715; // Calculate distance in centimeters (divided by 2)

// Check if the distance is within the specified range


if (distance >= MIN_DISTANCE && distance <= MAX_DISTANCE) {
Blynk.virtualWrite(V0, map(distance, MIN_DISTANCE, MAX_DISTANCE, 0, 100));
// Turn on RELAY 1
digitalWrite(RELAY_1_PIN, HIGH);
} else {
Blynk.virtualWrite(V0, 0);
// Turn off RELAY 1
digitalWrite(RELAY_1_PIN, LOW);
}
// Read PIR sensor and update Blynk Label widget
int motionState = digitalRead(PIR_PIN);
Blynk.virtualWrite(V4, motionState);

// Read MQ2 sensor and update Blynk Gauge widget


int gasValue = analogRead(MQ2_ANALOG_PIN);
int gasPercentage = map(gasValue, 0, 1023, 0, 100);
Blynk.virtualWrite(V3, gasPercentage);

// Read DHT11 sensor temperature only and update Blynk Chart widget
float temperature = dht.readTemperature();
Blynk.virtualWrite(V5, temperature);

// Control RELAY 2 based on temperature


if (temperature > 30) {

Department of Industrial Electronics, VPM’s Polytechnic Thane 43


digitalWrite(RELAY_2_PIN, HIGH); // Turn on RELAY 2
Blynk.virtualWrite(V2, 1); // Update Blynk app to show RELAY 2 is ON
} else {
digitalWrite(RELAY_2_PIN, LOW); // Turn off RELAY 2
Blynk.virtualWrite(V2, 0); // Update Blynk app to show RELAY 2 is OFF
}
delay(1000); // Adjust the delay as needed for your application
//Include the library files
#define BLYNK_TEMPLATE_ID "TMPL3TZldoI7U"
#define BLYNK_TEMPLATE_NAME "Home Automation"
#define BLYNK_AUTH_TOKEN "owtmSP1deJb3W68q8OEJUH0RcvVNtpBA"
#define BLYNK_PRINT Serial
#include <WiFi.h>
#include <WiFiClient.h>
#include <BlynkSimpleEsp32.h>
int motion_sensor=15;
int motion_data=0;

char auth[] = "owtmSP1deJb3W68q8OEJUH0RcvVNtpBA";


char ssid[] = "Mukund";
char pass[] = "11223344";

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();

Department of Industrial Electronics, VPM’s Polytechnic Thane 44


CHAPTER 8

Department of Industrial Electronics, VPM’s Polytechnic Thane 45


SPECIFICATIONS
1. Esp-32 Wroom32:

• Microcontroller: Dual-core Xtensa LX6 microprocessors, operating at up to


240 MHz
• Wi-Fi: 802.11 b/g/n/e/i support (2.4GHz)
• Bluetooth: Bluetooth v4.2 BR/EDR and BLE (Bluetooth Low Energy)
• RAM: 520KB SRAM
• Flash Memory: 4MB
• GPIO: 38 GPIO pins, including capacitive touch, ADCs, DACs, UART,
SPI, I2C, I2S, PWM, and SDIO
• Security: Hardware-accelerated AES, SHA-2, RSA, ECC, and random
number generator (hardware cryptographic coprocessor)
• Operating Voltage: 3.0V to 3.6V
• Operating Temperature: -40°C to +125°C
• Power Consumption: Ultra-low power consumption with various sleep
modes for battery-powered applications
• Size: 18mm x 25.5mm x 3.1mm
• Interfaces: UART, SPI, I2C, I2S, SDIO, PWM, IR, GPIO, capacitive touch
sensor, ADC, DAC
• Operating System Support: FreeRTOS
• Certifications: FCC/CE/TELEC/KCC/SRRC/NCC/Wi-Fi
Alliance/Bluetooth SIG
• Development Environment: Supports Arduino IDE, ESP-IDF (Espressif IoT
Development Framework), MicroPython, and other development platforms
• Peripherals: Various peripherals such as timers, watchdogs, RTC, and more

Department of Industrial Electronics, VPM’s Polytechnic Thane 46


2. PIR Sensor:

• Detection Method: Passive infrared detection


• Detection Range: The range within which motion can be detected, often
adjustable.
• Detection Angle: The angle over which motion can be detected, which is
120 degrees.
• Sensitivity: Adjustable sensitivity to detect small or large motions.
• Output Type: Typically, digital (e.g., high or low signal) or analog (e.g.,
voltage level proportional to motion).
• Operating Voltage: Voltage range required for operation, often between
3 to 5 volts.
• Current Consumption: Current drawn by the sensor during operation,
often in the microampere range.
• Warm-up Time: Time required for the sensor to stabilize after power-up,
typically a few seconds.
• Operating Temperature Range: Temperature range within which the
sensor operates reliably, often between -20°C to +60°C.
• Dimensions: Physical dimensions of the sensor package.
• Output Signal Duration: Duration of the output signal after motion is
detected, often adjustable.
• Trigger Mode: Single or repeated trigger mode.
• Mounting Type: Whether the sensor is designed for surface mounting or
through-hole mounting.
• Shielding: Some sensors may come with shielding to reduce interference
from other sources

Department of Industrial Electronics, VPM’s Polytechnic Thane 47


3. DC Motor:

• Voltage: Operating voltage of 5 volts DC.


• Speed: The rotational speed of the motor, usually measured in revolutions
per minute (RPM) or angular velocity.
• Current: The current drawn by the motor when operating under load.
• Torque: The rotational force produced by the motor, often measured in
ounce-inches (oz-in) or Newton-meters (Nm).
• Power: The electrical power consumed by the motor, calculated as the
product of voltage and current (P = VI).
• Size: Physical dimensions of the motor, including diameter and length.
• Shaft: Diameter and length of the motor shaft, as well as the type of shaft
(e.g., D-shaped, keyed).
• Mounting: Type of mounting options available, such as flange mount,
face mount, or bracket mount.
• Operating Temperature: Temperature range within which the motor can
safely operate.
• Efficiency: The efficiency of the motor, indicating how effectively it
converts electrical power into mechanical power.
• Noise Level: The level of noise generated by the motor during operation,
typically measured in decibels (dB).
• Protection: Any built-in protection features, such as overcurrent
protection or thermal protection.
• Insulation Class: Insulation class rating for the motor windings, indicating
the maximum allowable operating temperature.
• Environmental Rating: Any environmental certifications or ratings, such
as IP (Ingress Protection) rating for dust and water resistance.

Department of Industrial Electronics, VPM’s Polytechnic Thane 48


4. Buzzer:

• Voltage: Operating voltage range (e.g., 3V, 5V, 12V).


• Current: Current consumption during operation.
• Sound Output: Sound pressure level (SPL) measured in decibels (dB) at
a specific distance (e.g., 10 cm).
• Frequency: The frequency of the sound produced by the buzzer, usually
measured in Hertz (Hz).
• Type: Buzzer type, such as piezoelectric buzzer or magnetic buzzer.
• Size: Physical dimensions of the buzzer, including diameter and height.
• Mounting: Type of mounting options available, such as through-hole or
surface mount.
• Operating Temperature: Temperature range within which the buzzer can
safely operate.
• Termination: Type of electrical termination (e.g., leads, solder pads).
• Resonant Frequency: The frequency at which the buzzer resonates most
efficiently.
• Operating Life: Expected operational lifespan of the buzzer.
• Environmental Rating: Any environmental certifications or ratings, such
as IP (Ingress Protection) rating for dust and water resistance

Department of Industrial Electronics, VPM’s Polytechnic Thane 49


5. MQ2 Sensor:

• Sensing Element: The sensing element is usually a tin dioxide (SnO2)


semiconductor.
• Operating Voltage: Typically operates at 5 volts DC.
• Heating Element: A built-in heating element to heat the sensing element
for optimal performance.
• Analog Output: Provides an analog voltage output proportional to the
concentration of the detected gas.
• Digital Output: Some variants of the MQ2 sensor may include a digital
output pin that provides a high or low signal based on the presence of the
target gas above a certain threshold level.
• Detection Range: Range of gas concentrations the sensor can detect,
usually specified in parts per million (ppm) or percentage of the lower
explosive limit (LEL).
• Sensitivity: Sensitivity to different gases, specified in terms of the
resistance change per unit gas concentration.
• Response Time: Time taken by the sensor to respond to changes in gas
concentration.
• Recovery Time: Time taken by the sensor to return to its initial state after
exposure to gas.

Department of Industrial Electronics, VPM’s Polytechnic Thane 50


6. DHT-11:

• Temperature Range: 0°C to 50°C (32°F to 122°F)


• Humidity Range: 20% to 90% RH
• Temperature Accuracy: ±2°C (±3.6°F)
• Humidity Accuracy: ±5% RH
• Operating Voltage: 3.3V to 5V
• Output: Digital signal (single-wire protocol)
• Response Time: 2 seconds (typical)
• Dimensions: Usually comes in a small package with dimensions
around 15.5mm x 12mm x 5.5mm (L x W x H)
• Power Consumption: The DHT11 sensor typically consumes around
1-2.5mA during data acquisition.
• Compatibility: The sensor is commonly used with microcontrollers
like Arduino, Raspberry Pi, ESP8266, and other similar platforms. It
communicates using a simple single-wire digital protocol.
• Operating Principle: The DHT11 sensor utilizes a capacitive
humidity sensor and a thermistor to measure temperature. It converts
the analog readings into a digital signal that can be read by a
microcontroller.

Department of Industrial Electronics, VPM’s Polytechnic Thane 51


7. 2 channel Relay module:

• 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.

Department of Industrial Electronics, VPM’s Polytechnic Thane 52


8. Ultrasonic sensor:

• Operating Principle: Uses high-frequency sound waves to measure


distances or detect objects.
• Detection Range: Maximum distance the sensor can detect objects
accurately.
• Operating Voltage: Required voltage for sensor operation (e.g., 5V
or 3.3V).
• Output Type: Digital or analog signal indicating object presence or
continuous distance measurement.
• Resolution: Smallest detectable change in distance.
• Beam Angle: Angle of the emitted ultrasonic beam.
• Operating Temperature Range: Safe temperature range for sensor
operation.
• Response Time: Time taken to detect an object and provide an
output signal.
• Accuracy: Degree of closeness between measured distance and
actual distance.
• Protection Rating: IP rating indicating resistance to dust and water
ingress.
• Size and Mounting: Physical dimensions and mounting options for
installation.

Department of Industrial Electronics, VPM’s Polytechnic Thane 53


9. Mini water pump

• Type: Submersible or non-submersible.


• Flow Rate: Volume of water moved per hour.
• Head Height: Maximum vertical lifting height.
• Power Consumption: Electrical power required (in watts).
• Operating Voltage: Required voltage (e.g., 12V DC).
• Maximum Temperature: Temperature tolerance of pumped water.
• Materials: Construction materials (e.g., plastic, stainless steel).
• Noise Level: Operational noise output (in decibels).
• Size and Weight: Physical dimensions and weight.
• Features: Adjustable flow rate, built-in filters, etc.

10. Solar PV panel

• Voltage: 5 volts (V)


• Power Output: Typically a few watts to around 10 watts
• Dimensions: Approximately 6 x 6 inches (15 x 15 cm) for small panels
• Type: Monocrystalline, polycrystalline, or amorphous (thin-film)
• Efficiency: Varies based on type, higher efficiency panels produce more
power
• Weight: Varies, from a few ounces/grams for portable panels to several
pounds/kilograms for larger ones
• Mounting Options: Some have built-in mounting holes or brackets for
easy installation
• Durability: Should be weatherproof and durable for outdoor use

Department of Industrial Electronics, VPM’s Polytechnic Thane 54


11. Battery charging module

• Input Voltage: Typically 4.5V to 5.5V DC


• Charging Voltage: Approximately 4.2V (single-cell lithium-ion
battery)
• Charging Current: Adjustable via external resistors, commonly set at
1A (1000mA) or lower for smaller batteries
• Charging Method: Linear charging (constant current, constant voltage)
• Protection: Overcharge protection, over-discharge protection, short-
circuit protection
• Indicator: Charging status LED indicator
• Dimensions: Small PCB module with standard dimensions for easy
integration into projects
• Compatibility: Compatible with various lithium-ion and lithium
polymer batteries
• Protection: Overcharge, over-discharge, short-circuit protection

12. Battery (Lithium ion rechargeable cells)

• 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

Department of Industrial Electronics, VPM’s Polytechnic Thane 56


ADVANTAGES AND
APPLICATIONS

• 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: -

1. Cutting-edge IoT-based Modular Home Automation Project integrates


renewable energy sources like solar panels and a small wind turbine for
an eco-friendly living space.
2. Blynk app provides seamless control, allowing remote management of
temperature, humidity, motion, and gas levels.

3. ESP32 Wroom 32 microcontroller acts as the central hub, connecting


with sensors like DHT11, PIR, MQ2, and HC-SR04 for real-time data.

4. Water level management system optimizes usage, activating relay when


levels fall, and users can customize home environment through Relay 2
for comfort and efficiency.

5. A dedication to sustainability ensures the entire system is powered by


clean, renewable energy sources, creating a smarter home that respects
the environment.
Department of Industrial Electronics, VPM’s Polytechnic Thane 57
CHAPTER 10

Department of Industrial Electronics, VPM’s Polytechnic Thane 58


FUTURE SCOPE
The future scope of our IoT-based Modular Home Automation Project
envisions continuous evolution and expansion. We aim to integrate advanced
machine learning algorithms to enhance predictive analytics for energy
consumption, optimizing the use of renewable resources. Additionally,
incorporating AI-driven home security features will further fortify the system,
ensuring a comprehensive and intelligent safeguarding of the living space.

Looking ahead, we aspire to collaborate with emerging technologies, such as


5G connectivity, to enable faster and more reliable communication between
devices. The integration of voice recognition technology and natural language
processing will offer an intuitive and hands-free experience, making home
automation even more user-friendly.

In our commitment to sustainability, we plan to explore partnerships with


organizations promoting green technologies, potentially incorporating
innovations like energy-efficient appliances and smart grids. The future
iterations of our project will aim to create a more interconnected ecosystem,
allowing users to seamlessly integrate additional smart devices into their
homes.

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.

In conclusion, the future of our IoT-based Modular Home Automation Project


is characterized by a relentless pursuit of innovation, sustainability, and user-
centric design, aiming to create a smarter, greener, and more harmonious
living environment for all.

Department of Industrial Electronics, VPM’s Polytechnic Thane 59


CONCLUSION

In conclusion, our IoT-based Modular Home Automation Project represents a


pioneering leap into the future of smart living. With a foundation built on
cutting-edge technology, our system seamlessly integrates into your daily life,
offering unparalleled control and monitoring through the Blynk app. What
truly sets us apart is our unwavering commitment to sustainability – harnessing
the power of solar panels and a small wind turbine ensures not only efficiency
but also a minimized ecological footprint.

The ESP32 Wroom 32 microcontroller serves as the intelligent core,


connecting effortlessly with a server and facilitating a two-way exchange of
information. The array of sensors, including DHT11, PIR, MQ2, and HC-
SR04, empowers the system with real-time data for informed decision-
making, enhancing the overall user experience.

A standout feature is our water level management system, dynamically


responding to levels and optimizing usage. This, coupled with the ability to
customize your home environment through Relay 2, epitomizes the harmony
between comfort and efficiency.

As we invite you to join us on this journey toward a smarter, sustainable future,


we envision a world where innovation not only enhances lives but alsonurtures
and respects the environment. Together, let's create homes thatembody the
perfect blend of technology, sustainability, and convenience – a testament to
the limitless possibilities when innovation meets responsibility. Welcome to
the future of smart, eco-friendly living with our IoT-based Modular Home
Automation Project.

Department of Industrial Electronics, VPM’s Polytechnic Thane 60


REFERENCES

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/

Department of Industrial Electronics, VPM’s Polytechnic Thane 61


CHAPTER 11

Department of Industrial Electronics, VPM’s Polytechnic Thane 62


Datasheet

Department of Industrial Electronics, VPM’s Polytechnic Thane 63


2. Pin Definitions

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

Figure 1: ESP32-WROOM-32 Pin Layout (Top View)

2.2 Pin Description


ESP32-WROOM-32 has 38 pins. See pin definitions in Table 2.

Table 2: Pin Definitions

Name No. Type Function


GND 1 P Ground
3V3 2 P Power supply
EN 3 I Module-enable signal. Active high.
SENSOR_VP 4 I GPIO36, ADC1_CH0, RTC_GPIO0
SENSOR_VN 5 I GPIO39, ADC1_CH3, RTC_GPIO3
IO34 6 I GPIO34, ADC1_CH6, RTC_GPIO4
IO35 7 I GPIO35, ADC1_CH7, RTC_GPIO5
GPIO32, XTAL_32K_P (32.768 kHz crystal oscillator input), ADC1_CH4,
IO32 8 I/O
TOUCH9, RTC_GPIO9
GPIO33, XTAL_32K_N (32.768 kHz crystal oscillator output), ADC1_CH5,
IO33 9 I/O
TOUCH8, RTC_GPIO8

Espressif Systems 3 ESP32-WROOM-32 Datasheet V2.9


2. Pin Definitions

Name No. Type Function


IO25 10 I/O GPIO25, DAC_1, ADC2_CH8, RTC_GPIO6, EMAC_RXD0
IO26 11 I/O GPIO26, DAC_2, ADC2_CH9, RTC_GPIO7, EMAC_RXD1
IO27 12 I/O GPIO27, ADC2_CH7, TOUCH7, RTC_GPIO17, EMAC_RX_DV
GPIO14, ADC2_CH6, TOUCH6, RTC_GPIO16, MTMS, HSPICLK, HS2_CLK,
IO14 13 I/O
SD_CLK, EMAC_TXD2
GPIO12, ADC2_CH5, TOUCH5, RTC_GPIO15, MTDI, HSPIQ, HS2_DATA2,
IO12 14 I/O
SD_DATA2, EMAC_TXD3
GND 15 P Ground
GPIO13, ADC2_CH4, TOUCH4, RTC_GPIO14, MTCK, HSPID, HS2_DATA3,
IO13 16 I/O
SD_DATA3, EMAC_RX_ER
SHD/SD2* 17 I/O GPIO9, SD_DATA2, SPIHD, HS1_DATA2, U1RXD
SWP/SD3* 18 I/O GPIO10, SD_DATA3, SPIWP, HS1_DATA3, U1TXD
SCS/CMD* 19 I/O GPIO11, SD_CMD, SPICS0, HS1_CMD, U1RTS
SCK/CLK* 20 I/O GPIO6, SD_CLK, SPICLK, HS1_CLK, U1CTS
SDO/SD0* 21 I/O GPIO7, SD_DATA0, SPIQ, HS1_DATA0, U2RTS
SDI/SD1* 22 I/O GPIO8, SD_DATA1, SPID, HS1_DATA1, U2CTS
GPIO15, ADC2_CH3, TOUCH3, MTDO, HSPICS0, RTC_GPIO13, HS2_CMD,
IO15 23 I/O
SD_CMD, EMAC_RXD3
GPIO2, ADC2_CH2, TOUCH2, RTC_GPIO12, HSPIWP, HS2_DATA0,
IO2 24 I/O
SD_DATA0
IO0 25 I/O GPIO0, ADC2_CH1, TOUCH1, RTC_GPIO11, CLK_OUT1, EMAC_TX_CLK
GPIO4, ADC2_CH0, TOUCH0, RTC_GPIO10, HSPIHD, HS2_DATA1,
IO4 26 I/O
SD_DATA1, EMAC_TX_ER
IO16 27 I/O GPIO16, HS1_DATA4, U2RXD, EMAC_CLK_OUT
IO17 28 I/O GPIO17, HS1_DATA5, U2TXD, EMAC_CLK_OUT_180
IO5 29 I/O GPIO5, VSPICS0, HS1_DATA6, EMAC_RX_CLK
IO18 30 I/O GPIO18, VSPICLK, HS1_DATA7
IO19 31 I/O GPIO19, VSPIQ, U0CTS, EMAC_TXD0
NC 32 - -
IO21 33 I/O GPIO21, VSPIHD, EMAC_TX_EN
RXD0 34 I/O GPIO3, U0RXD, CLK_OUT2
TXD0 35 I/O GPIO1, U0TXD, CLK_OUT3, EMAC_RXD2
IO22 36 I/O GPIO22, VSPIWP, U0RTS, EMAC_TXD1
IO23 37 I/O GPIO23, VSPID, HS1_STROBE
GND 38 P Ground

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.

2.3 Strapping Pins


ESP32 has five strapping pins, which can be seen in Chapter 6 Schematics:

Espressif Systems 4 ESP32-WROOM-32 Datasheet V2.9


Espressif Systems

6. Schematics
6. Schematics

Pin.1 Pin.15 Pin.38


The values of C1 and C2 vary with GND GND GND
the selection of a crystal.

Pin.2 Pin.16 Pin.37


3V3 IO13 IO23

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

Pin.5 Pin.19 Pin.34


SENSOR_VN CMD RXD0
SENSOR_VN SCS/CMD U0RXD
49

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

GPIO34 SCK/CLK GPIO21

Pin.7 Pin.21 Pin.32


IO35 SD0 NC
GPIO35 SDO/SD0

8
VCC
13

Pin.8 Pin.22 Pin.31


IO32 SD1 IO19

GND
GPIO32 SDI/SD1 GPIO19

4
Pin.9 Pin.23 Pin.30
IO33 IO15 IO18
VDD3P3_RTC

GPIO33 GPIO15 GPIO18


The values of C14, L4 and C15
32K_XN
GPIO25
GPIO26
GPIO27

MTDO
GPIO2
GPIO0
GPIO4
MTMS

MTCK

vary with the actual


MTDI

selection of a PCB board. Pin.10 Pin.24 Pin.29


IO25 IO2 IO5
13
14
15
16
17
18
19
20
21
22
23
24

GPIO25 GPIO2 GPIO5

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

Pin.14 Pin.39 Pin.25


IO12 GND IO0
GPIO12 GPIO0

Figure 3: ESP32-WROOM-32 Schematics


Name: Relay Module 2-Channel
Code: MR009-004.1

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

NO2 Normally open contact


COM2 Common contact
NC2 Normally closed contact
Tab.1 – Connections

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

Technical Data Basic test loop


T

Model No. MQ-2 Vc VRL


Sensor Type Semiconductor
Standard Encapsulation Bakelite (Black Bakelite)
Detection Gas Combustible gas and smoke
RL
300-10000ppm VH
Concentration
( Combustible gas)
Loop Voltage Vc ≤24V DC
Heater Voltage VH 5.0V±0.2V ACorDC GND
Circuit
Load
RL Adjustable The above is basic test circuit of the sensor.
Resistance
The sensor need to be put 2 voltage,
Heater
RH 31Ω±3Ω(Room Tem.) heater voltage(VH)and test voltage(VC).
Resistance
VH used to supply certified working
Heater
PH ≤900mW temperature to the sensor, while VC used
consumption
to detect voltage (VRL) on load resistance
Character Sensing
Rs 2KΩ-20KΩ(in 2000ppm C3H8 ) (RL)whom is in series with sensor. The
Resistance
sensor has light polarity, Vc need DC
Rs(in air)/Rs(1000ppm
Sensitivity S power. VC and VH could use same power
isobutane)≥5
circuit with precondition to assure
Slope α ≤0.6(R5000ppm/R3000ppm CH4)
performance of sensor. In order to make
Tem. Humidity 20℃±2℃;65%±5%RH
the sensor with better performance,
Vc:5.0V±0.1V; suitable RL value is needed:
Condition Standard test circuit
VH: 5.0V±0.1V Power of Sensitivity body(Ps):
Preheat time Over 48 hours Ps=Vc2×Rs/(Rs+RL)2
Resistance of sensor(Rs): Rs=(Vc/VRL-1)×RL

Sensitivity Characteristics Influence of Temperature/Humidity

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

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 Following conditions must be avoided


2.1 Water Condensation
Indoor conditions, slight water condensation will effect sensors performance lightly. However, if water
condensation on sensors surface and keep a certain period, sensor’ sensitivity will be decreased.

2.2 Used in high gas concentration


No matter the sensor is electrified or not, if long time placed in high gas concentration, if will affect
sensors characteristic.

2.3 Long time storage


The sensors resistance produce reversible drift if it’s stored for long time without electrify, this drift is
related with storage conditions. Sensors should be stored in airproof without silicon gel bag with clean air.
For the sensors with long time storage but no electrify, they need long aging time for stbility before using.

2.4 Long time exposed to adverse environment


No matter the sensors electrified or not, if exposed to adverse environment for long time, such as
high humidity, high temperature, or high pollution etc, it will effect the sensors performance badly.

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.

You might also like