0% found this document useful (0 votes)
2 views

Kol

Chapter Three outlines the design methodology for the Smart Energy Management System, detailing the integration of sensors, microcontroller firmware, and control logic using the ESP32. It describes the hardware components, including the ACS712 current sensor and ZMPT101B voltage sensor, which facilitate real-time energy monitoring, as well as the relay module for appliance control and an LCD for user interface. The software development is conducted using the Arduino IDE, leveraging libraries for connectivity and user interaction through the Blynk platform.

Uploaded by

GOZIE PROSAPE
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
2 views

Kol

Chapter Three outlines the design methodology for the Smart Energy Management System, detailing the integration of sensors, microcontroller firmware, and control logic using the ESP32. It describes the hardware components, including the ACS712 current sensor and ZMPT101B voltage sensor, which facilitate real-time energy monitoring, as well as the relay module for appliance control and an LCD for user interface. The software development is conducted using the Arduino IDE, leveraging libraries for connectivity and user interaction through the Blynk platform.

Uploaded by

GOZIE PROSAPE
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 8

CHAPTER THREE

3.1 DESIGN METHODOLOGY

This chapter used in developing the Smart Energy Management System. It details the integration of sensors,

microcontroller firmware and control logic implemented on the ESP32. The overall goal is to achieve real-

time energy management and automated appliance operation.

Fig 3.1 Block Diagram of System Design Stake

3.1.1 SYSTEM HARDWARE DESIGN

Figure 3.2 ESP32 Microcontroller Module.

16
INPUT UNIT

Figure 3.3 - ACs712 Current Sensor.

The ACS712 current sensor module is a compact, high-precision, Hall-effect–based sensor developed by

Allegro Microsystems. It is designed to accurately measure both alternating current (AC) and direct current

(DC) in a non-intrusive and electrically isolated manner. This makes it particularly suitable for energy

monitoring applications, such as the smart energy management system developed in this project. The sensor

provides a linear analog voltage output that is directly proportional to the current flowing through its

terminals, which can then be read and interpreted by a microcontroller such as the ESP32.

The ACS712 operates on a 5V DC power supply and typically draws around 10 milliamps during use. It

provides an output voltage range between 0 and 5 volts, centered at 2.5 volts when no current is flowing

through the sensor. This mid-point voltage shifts either upward or downward depending on the direction

and magnitude of the current being measured. The sensor internally isolates the high-current input side

from the low-voltage signal output, supporting isolation voltages up to 2100 volts RMS, which enhances

safety and reliability in domestic AC circuits.

In operation, the ACS712 senses the magnetic field generated by the current flowing through its internal

conductor and converts this magnetic field into a proportional voltage. For the 20A variant used in this

project, the sensor provides a sensitivity of approximately 100 millivolts per ampere. When the output

voltage from the sensor is greater than 2.5 volts, it indicates positive current flow, and when it is less than

2.5 volts, it indicates negative current flow. The analog signal is read by the ESP32’s analog-to-digital

converter (ADC) and processed through a calibrated algorithm to calculate the actual current in amperes.

To calculate the current, the system uses the relationship

19
Fig 3.4 - ZMPT101B Voltage Sensor

The ZMPT101B voltage sensor module is a highly precise and compact analog voltage sensing solution,

specifically designed for AC mains voltage monitoring. It is based on the ZMPT101B voltage

transformer, which is engineered to safely step down high-voltage AC signals for analysis and measurement

in low-voltage microcontroller systems. This sensor is especially valuable in smart metering and

energy monitoring applications, such as the Smart Energy Management System (SEMS) developed in this

project, where reliable and isolated measurement of real-time voltage is required.

The ZMPT101B operates on a 5V DC power supply and delivers an analog voltage output that is

proportional to the input AC voltage. Internally, the sensor features a high-precision, low-phase error

voltage transformer, combined with signal conditioning circuitry that includes a gain-adjustable operational

amplifier, allowing fine-tuning of the output signal for calibration and sensitivity adjustment. It is capable

of measuring standard AC mains voltage levels, such as 110V or 220V RMS, and outputting a scaled

waveform that mirrors the shape of the input AC signal, typically centered around 2.5V. The sensor

supports a maximum input voltage of approximately 250V AC, while maintaining complete electrical

isolation between the high-voltage input and the low-voltage output interface.

In operation, the ZMPT101B detects the alternating voltage waveform using its internal transformer. This

waveform is stepped down and conditioned before being output as an analog signal. The waveform can

then be read by the analog-to-digital converter (ADC) of a microcontroller like the ESP32, which

processes the signal to extract voltage parameters. These include peak voltage, RMS voltage, and waveform

characteristics, which are critical for computing real-time power (P=V×IP = V \times IP=V×I)

21
system, ensuring that decisions related to automation, alerting, and energy optimization are based on

comprehensive and accurate electrical information.

The ZMPT101B voltage sensor thus plays an indispensable role in transforming the SEMS into a truly

intelligent and data-driven system. By delivering continuous, accurate, and safe voltage measurement, it

supports advanced features such as true power computation, smart threshold detection, and appliance- level

analytics—all of which are crucial for achieving meaningful energy efficiency and user empowerment in

both residential and office environments.

OUTPUT UNIT

Fig 3.5 - Relay Module

The relay module serves as the principal output control mechanism within the Smart Energy

Management System (SEMS). It is responsible for executing the system’s automated and user-defined

commands by physically switching electrical appliances on or off. While sensors and microcontrollers

collect and process data, the relay module translates these decisions into real-world actions—making it a

critical component in enabling intelligent and responsive energy control.

A relay functions as an electrically operated switch that uses an internal electromagnetic coil to open or

close a contact within an external circuit. In this application, the relay allows the low-voltage logic

signals from the ESP32 microcontroller to safely control high-voltage alternating current (AC)

appliances. The module operates on a standard 5V DC input and can reliably switch AC loads up to

250V at 10A. For enhanced safety, the relay module incorporates an opto-isolator, which provides

complete electrical isolation between the low-voltage control side and the high-voltage switching side.
23
high-voltage circuits. Its integration supports not onlyfunctionality but also system integrity and user safety.

Display unit

Fig 3.6 Liquid Cryster Display (LCD)

The Liquid Crystal Display (LCD) is one of the most widely used visual output devices in embedded

systems. LCDs offer a simple and efficient way to present real-time information to users, including

sensor readings, system status, and alerts. They are lightweight, low-power, and easy to interface with

microcontrollers, making them highly suitable for energy monitoring, home automation, and IoT

applications.

In embedded development, the most commonly used LCD is the 16x2 alphanumeric display, which can

show two rows of sixteen characters. This module is based on the Hitachi HD44780 controller or its

equivalents and communicates with microcontrollers using either parallel (4-bit or 8-bit) or serial (I2C)

communication protocols. In this project, an I2C-based 16x2 LCD is used to minimize wiring complexity

and preserve digital I/O pins on the ESP32.

The LCD receives character data and control instructions from the microcontroller. With the help of

libraries such as LiquidCrystal_I2C.h in the Arduino IDE, developers can easily initialize the display,

send strings or numeric values, and control cursor behavior. This abstraction simplifies implementation

and significantly reduces development time.

LCD modules are particularly useful in projects that require local, on-site feedback, independent

of internet connectivity.

25
This ensures that users or technicians present at the device location can quickly view essential

system data without relying on mobile or cloud interfaces. It also acts as a fallback information

display if Wi-Fi is unavailable or mobile interfaces are inaccessible.

Functionality:

The LCD module functions as a real-time data output interface. It displays critical values obtained from

sensors and system status messages to the user. This includes numeric readings from the current and voltage

sensors, appliance states, or alerts . Its presence enhances usability by offering visual confirmation

of the system’s behavior and status at a glance.

Significance:

The inclusion of an LCD module in this project enhances user interaction and system transparency. It allows

for offline, local data visibility, which is crucial during testing, maintenance, or situations where cloud

services are temporarily unreachable. Moreover, because it requires minimal power and can be controlled

with only two microcontroller pins via I2C, it integrates efficiently with the ESP32 without significant

hardware overhead. The LCD complements the Blynk mobile interface by providing real-time, always-on

display feedback, further improving the system’s accessibility and responsiveness.

3.1.2 SYSTEM SOFTWARE

26
Fig 3.7 Ardunio Development Environment

The firmware layer of the project is developed using the Arduino Integrated Development Environment

(IDE), a widely adopted platform that simplifies the process of programming microcontrollers, including

the ESP32. The ESP32. The chosen for its built-in Wi-Fi and high- performance capabilities, integrates

seamlessly with the Arduino ecosystem through board support packages available via the Arduino Boards

Manager

Once the ESP32 board configuration is installed, the microcontroller can be programmed directly over

USB using a micro-USB cable. The Arduino IDE provides essential tools such as the Serial Monitor, which

allows for real-time debugging, sensor data inspection, and firmware behavior tracking. This built- in

interface is particularly useful during sensor calibration, control testing, and system optimization.

Fig 3.8 Ardunio Serial Monitor

Firmware is written in C++, with full support for standard C/C++ syntax, while also benefiting from

Arduino-specific abstractions that simplify many hardware-related operations. Programs follow a

standard structure beginning with the setup() function, where pin modes, communication protocols (e.g.,

I2C, UART, SPI), and wireless connections are initialized. The loop() function contains the main logic,

which runs continuously—handling sensor data acquisition from devices such as the ACS712 current

sensor and the ZMPT101B voltage sensor, evaluating conditions for automation, controlling relays, and

27
managing communication with cloud platforms.

The Arduino IDE supports a wide array of external libraries that significantly reduce development time.

Libraries such as WiFi.h, FirebaseESP32.h, HTTPClient.h, and BlynkSimpleEsp32.h are used to

establish wireless connectivity, communicate with remote databases or interfaces and simplify

integration with mobile apps or web dashboards. These libraries encapsulate low-level networking and

communication protocols, allowing the developer to focus on core application logic.

User Interface

Fig 3.9 Blynk Console

Blynk is a widely adopted Internet of Things (IoT) platform designed to enable developers, engineers,

and hobbyists to create mobile and web interfaces for connected devices with minimal effort. Originally

released in 2015 by the company Blynk Inc., the platform has grown into a versatile solution for real-

time device monitoring and control across a wide range of embedded and IoT applications. It supports

development for Arduino, ESP32, ESP8266, Raspberry Pi, and other microcontroller platforms.

From a technical perspective, Blynk comprises three core components: the Blynk Mobile App, the Blynk

Cloud Server, and the Blynk Device Library. The mobile app, available on both Android and iOS, serves

as the graphical user interface (GUI) where users interact with connected devices. The cloud server

manages communication between the app and the physical hardware, while the device library, integrated

28

You might also like