Asm 1 Iot
Asm 1 Iot
Student declaration
I certify that the assignment submission is entirely my own work and I fully understand the consequences of plagiarism. I understand that
making a false declaration is a form of malpractice.
Grading grid
P1 P2 M1 M2 D1
Summative Feedback: Resubmission Feedback:
Table Figure
Figure 1: IoT layer........................................................................................................................................................6
Figure 2: IoT Level 1.....................................................................................................................................................7
Figure 3: IoT Level 2....................................................................................................................................................7
Figure 4: IoT level 3......................................................................................................................................................8
Figure 5: IoT Level 4.....................................................................................................................................................9
Figure 6: IoT level 5......................................................................................................................................................9
Figure 7: IoT level 6....................................................................................................................................................10
Figure 8: Step design IoT............................................................................................................................................15
Figure 9:ACS712…………………………………………………………………………………………………………………………………………………….17
Figure10:ESP8266………………………………………………………………………………………………………………………………………………….18
Figure 11:Relay5V………………………………………………………………………………………………………………………………………………….20
Figure12:Light……………………………………………………………………………………………………………………………………………………….21
Figure 17:Blynk………………………………………………………………………………………………………………………………………………………26
- IoT stands for Internet Of Things, a concept that describes a network of physical devices connected to the
Internet, allowing them to collect and exchange data. These devices can be sensors, machines, household
appliances to vehicles, all of which have the ability to connect and communicate with each other to automate
processes, improve efficiency, and provide information in real-time.
Along with that popularity, IoT is also applied in many fields such as agriculture, smart homes, smart buildings,
industry, healthcare, retail, energy, and logistics. Some examples of its applications in the following fields:
For Agriculture, you can use sensors to measure soil moisture in combination with an automatic watering
system to determine the appropriate amount of water to avoid wasting water, save costs, and help plants
grow well.
Smart Homes, use sound sensors or gesture sensors to automatically open and close doors when
performing a certain pre-programmed gesture or sound, for convenience in opening and closing doors.
Smart Buildings, use camera sensors to detect the number of empty parking spaces to help drivers find
parking quickly.
In industry, for nuclear plants, air quality sensors can be used to know if there are gas leaks to the outside.
For the purpose of protecting the environment as well as human life. For Healthcare, body temperature
sensors, heart rate, etc. can be used to monitor human health for the purpose of warning and checking
the body's condition.
Retail, Inventory management monitors inventory using RFID readers and tracks products.
Energy, a Smart Grid collects data related to electricity production, consumption, and storage, or can
convert energy to other forms, and distribution. Controls electricity consumption.
From the example of IoT that I gave above, we can determine that IoT plays an extremely important role in the
current era, especially in promoting the digital transformation of many industries and daily life. The applications
and roles of IoT have changed the way we live, work, and interact with the world around us, from household
appliances to complex industrial systems.
Content
Asm 1:
I. Analyse what aspects of IoT are necessary and appropriate when designing software
applications.
1. Components and functions of IoT
IoT has many components, some basic components make up an IoT system such as Sensors, Control, Connection,
Data processing and analysis, Architecture, and User interface.
Sensor: A sensor is a device that generates an output signal to detect a physical phenomenon, such as being able
to sense impacts or changes in the surrounding environment such as Light, temperature, sound,
and movement, .... this is one of the core functions of IoT. Without sensors, an IoT will lack flexibility and
intelligence.
For example, an Automatic lighting system, to implement this IoT, you need a sound sensor so that the
system can recognize it. On the contrary, if an IoT project does not use sensors, it will not be considered
an IoT. Because people develop an IoT for its flexibility and intelligent processing, without sensors, that IoT
will not be considered an IoT.
Actuation: IoT actuators are mechanical or electromechanical devices that convert energy into motion. They
combine electrical signals with power sources, ultimately manipulating the physical world around them.
For example, an automatic watering system will automatically water when the moisture sensor detects
dry soil and the moisture level is lower than the user-set moisture level for the sensor.
Connectivity: Considered the nervous system of IoT, it can connect and transmit data between IoT devices with
each other and with central systems via the network. In my opinion, Connectivity is the most important
component in an IoT system because it ensures that data collected from sensors can be transmitted to processing
devices or not, if there is no connection, control commands may not be sent to actuators.
For example: You can use wifi or Bluetooth connection for IoT devices.
Data Processing and Analysis: IoT Data Processing & Analysis It is necessary to analyze data to get useful findings
from that data while performing data analysis. Data processing techniques such as data cleaning, modification,
and normalization are used to make the data accurate, reasonable, and ready for analysis. The processed
information will be sent to a centralized server, or cloud, or sent directly to the user.
For example: Smartwatches after being worn will collect data from our body such as heart rate, blood
pressure, and health status. This collected data will be analyzed and processed to check and detect
abnormal signs to warn the user.
Physical/Device Layer. Includes sensors, actuators, and other smart devices, along with connected devices,
that make up the physical and device layers. These smart devices collect data (sensors), and perform
actions (actuators), or sometimes both.
Network Layer. Includes network devices, communication types, and protocols, e.g. 5G, Wi-Fi, Bluetooth,
etc. While many IoT architectures rely on general-purpose network layers, there is an increasing trend
toward dedicated IoT-specific networks.
Data/Database Layer. Includes the database platform layer. There are many databases used for IoT
architectures, and many organizations spend a significant amount of time selecting and designing the right
IoT databases for them.
Analytics/Visualization Layer. This layer includes the analytics layer, visualization layer, and perception
layer. Essentially, the focus of this layer is to analyze the data provided by the IoT and provide users and
applications with the ability to make sense of that data.
Application/Integration Layer. This is the application and platform layer that work together to deliver
functionality from the IoT infrastructure to the enterprise. In other words, the application layer, platform
layer, and integration layer are what deliver business value from the IoT infrastructure. The processing
layer and business layer are all part of the larger application/integration layer.
Security and Management Layer. As the name suggests, this layer includes both the security layer and the
management layer. Strictly speaking, it is not a layer because it connects to all the other layers to provide
security and management. But it is an important component that is worth considering at every layer.
User Interface: Users need a way to view and understand the data collected by the IoT. That’s where user
interfaces come in. In the simplest terms, a user interface (UI) is the means by which a user and a computer
system interact.
2. Standards in IoT
When developing an IoT, we will need to comply with the following standards: Architecture, Frameworks, Tools,
Hardware, APIs, and Communication Protocols.
A Architecture
IoT Levels & Deployment Templates: This architectural framework allows the classification and organization of IoT
systems based on scale, complexity, and deployment capabilities. This model helps guide building, deploying, and
managing IoT systems, from simple systems to larger, more complex ones. This model includes 6 different levels.
Level 1: A level-1 IoT system has a single node/device that performs sensing and/or actuation, stores
data, performs analysis, and hosts the application. Level-1 IoT systems are suitable for modeling low- cost
and low-complexity solutions where the data involved is not big and the analysis requirements are not
computationally intensive
Figure 2: IoT Level 1
Level 2: A level-2 IoT system has a single node that performs sensing and/or actuation and local analysis.
Data is stored in the cloud and the application is usually cloud-based. Level-2 IoT systems are suitable for
solutions where the data involved is big, however, the primary analysis requirement is not
computationally intensive and can be done locally.
Level 4: A Level 4 IoT system has multiple nodes that perform local analysis, with data stored in the cloud
and applications running on the cloud platform. It includes local and cloud observation nodes that can
subscribe to and receive information from data collected in the cloud. Level 4 IoT systems are suitable for
solutions that require multiple nodes, big data, and complex computational analysis requirements
Figure 5: IoT Level 4
Level 5: A level 5 IoT system consists of multiple end nodes and a coordinator node. The end nodes
perform sensing and/or action tasks, while the coordinator node collects data from the end nodes and
sends it to the cloud. The data is stored and analyzed in the cloud, with the application operating on the
cloud. Level 5 IoT systems are suitable for solutions based on wireless sensor networks, where data is big
and complex computational analysis is required.
Level 6: Level 6 IoT systems consist of multiple independent end nodes that perform sensing and/or
actions, sending data to the cloud. The data is stored in the cloud, and the application operates on the
cloud platform. The analytics component analyzes the data and stores the results in a cloud database,
then visualizes the results via the cloud application. The central controller knows the status of all the end
nodes and sends control commands to these nodes.
B. Frameworks
An IoT framework can be defined as a set of protocols, tools, and standards that provide a specific structure for
developing and deploying IoT applications and services. In other words, an IoT framework provides you with the
basics to build your application. An IoT framework typically includes the following: Domain Model Specification,
Information Model Specification, Service Specifications, Functional View Specification, Operational View
Specification.
Domain Model Specification: A domain model is a way of organizing and describing the entities in an IoT
system. It describes the objects, devices, and the relationships between them in an IoT application.
Information Model Specification: An information model describes how data is represented, transmitted,
and stored in an IoT system.
Service Specifications: Service Specifications in IoT define the services that the system provides.
Functional View Specification: The functional view focuses on describing the main functions of an IoT
system, including data collection, data storage, processing and analysis, and user interaction
Operational View Specification: The operational view focuses on how the components of an IoT system
operate and interact with each other. It describes the processes, data flows, and tasks that the system
performs in real-time.
Tools:
Hardware:
Hardware plays a very important role because it is the component that directly participates in the process of
collecting data, transmitting, and performing control actions. IoT hardware includes physical devices such as
sensors, microprocessors, controllers, and communication devices to connect to the network. Some common
hardware components in an IoT system:
Sensors: Sensors collect data from the surrounding environment, such as temperature, humidity, light,
pressure, motion, or pollution levels. This data is sent to the IoT system for processing.
Actuators: Actuators are devices that perform physical actions based on sensor data or commands from
the IoT system. They can adjust, change, or activate other devices.
Microcontrollers and Processors: Microprocessors and controllers are responsible for processing data
collected from sensors and controlling actuators. They are the “brains” of the IoT system, helping the
system perform calculations and control devices on command.
Communication Modules: Communication devices play a role in connecting sensors and control devices to
each other as well as to the central system via wireless or wired networks.
APIs:
The term API (application programming interface) is a tool that software developers use to collect and transmit
data and communicate between devices, platforms, and services. In other words, APIs allow developers to interact
with software components internally and externally. Some common APIs in IoT:
RESTful Web Services: It is a service that combines personal computers with other devices, databases, and
computer networks to form a virtual computing fabric that users can work with through web browsers.
Figure 8: RESTful Web Services
WebSocket APIs: is a network protocol that allows for two-way, long-lasting connections between clients and
servers, providing a more efficient way to exchange data between clients and servers without having to constantly
open and close connections. This is especially useful in applications that require real-time data exchange, such as
chat, multiplayer games, live streaming, and many IoT applications.
MQTT (Message Queuing Telemetry Transport): MQTT is a standards-based messaging protocol or set of rules
used for machine-to-machine communication. Smart sensors, wearables, and other Internet of Things (IoT)
devices often need to transmit and receive data over networks with limited resources and bandwidth. These IoT
devices use MQTT to transmit data because the protocol is easy to implement and can communicate IoT data
efficiently. MQTT supports device-to-cloud and cloud-to-device messaging
Figure 9: MQTT
CoAP: CoAP or Constrained Application Protocol is a web transport protocol specifically designed for use with
constrained nodes and constrained networks in the IoT. CoAP is designed to allow simple, constrained devices to
participate in the IoT even over constrained networks with low bandwidth and low availability. It is commonly
used for machine-to-machine (M2M) applications such as smart energy and building automation.
C. Communication Protocols:
Very important for devices to connect and exchange data effectively. Depending on the requirements,
communication protocols are selected appropriately to ensure stable connections between IoT devices with each
other or with the cloud. There are 4 main protocols: Linker layer, Network Layer, Transport Layer, and Application
Layer.
Linker layer: The link layer is responsible for the physical connection and data transmission between
devices in the IoT network, including both wireless and wired connections such as:
- WiFi (IEEE 802.11): Allows IoT devices to connect to the Internet or communicate with other devices
quickly and reliably in the same local area network (LAN)
- IEEE 802.15.4: In addition to being used in the physical layer, 802.15.4 also defines data link layer
specifications for low-power, low-data-rate communications in Zigbee and Thread protocols.
- WiMAX (Worldwide Interoperability for Microwave Access) is the IEEE 802.16 standard for wireless
broadband Internet connectivity over long distances.
Network Layer: The network layer is responsible for routing and transmitting packets between devices in
the IoT system over the Internet or private networks. Some layers of this layer are:
- IPv4 (Internet Protocol version 4): The most popular addressing protocol today, helping IoT devices
connect to the Internet.
- IPv6 (Internet Protocol version 6): An improved protocol from IPv4 with a larger address space, necessary
for scalable IoT applications with millions of connected devices.
- 6LoWPAN (IPv6 over Low-power Wireless Personal Area Networks): Allows IPv6 to run on wireless sensor
networks (WPANs) such as Zigbee, enabling efficient data transmission on low-power devices.
Transport Layer: The transport layer ensures that data is transmitted securely and reliably between
devices or between devices and cloud systems. Some protocols of this layer are:
- TCP (Transmission Control Protocol): A reliable transmission protocol, ensures that data is delivered in the
correct order and without loss. TCP is suitable for applications that require high reliability but consume a
lot of bandwidth.
- UDP (User Datagram Protocol): A fast data transmission protocol that does not guarantee reliability like
TCP. UDP is often used in IoT applications that do not require accurate data transmission in each packet
such as audio/video streaming.
Application Layer: The application layer contains protocols used for exchanging data between devices and
management systems. Some protocols are:
- HTTP (Hypertext Transfer Protocol): A popular protocol in web services, often used for transmitting data
from IoT devices to servers.
- MQTT (Message Queuing Telemetry Transport): Lightweight protocol, designed for small IoT devices with
limited bandwidth and power.
- AMQP (Advanced Message Queuing Protocol): Secure and reliable messaging protocol, often used in IoT
systems that require high reliability, such as financial or industrial systems.
Sensors and devices: Choosing the right sensors and devices is an important step to ensure accurate data
collection and timely response in an IoT system. Factors to consider include the processing power of the
microcontroller, memory capacity, and power consumption.
Communication network:
Communication protocol: The choice of network protocol depends on the range, speed, bandwidth, and
power requirements of the IoT system.
Security:
Security: IoT systems need to be protected with security solutions such as firewalls, data encryption, and
intrusion detection systems to prevent unauthorized access and protect sensitive information.
Data management:
Data storage and processing: IoT systems often generate large amounts of data from sensors, so efficient
data storage and processing is extremely important. You can use MySql or NoSql to store and process
data.
User Interface:
Interface Design: The user interface design will make it easier for users to access and control the IoT
system. This interface can include a touch screen, voice control, or a GUI (graphical user interface).
The first step in IoT system design methodology is to define the purpose and requirements of the system.
In this step, the system purpose, behavior, and requirements, (such as data collection requirements, data
analysis requirements, system management requirements, data privacy and security requirements, user
interface requirements, ...) are captured
The second step in the IoT design methodology is to define the process specification. In this step, the use
cases of the IoT system are formally described based on and derived from the purpose and requirement
specifications
The third step in the IoT design methodology is to define the Domain Model. The domain model describes
the main concepts, entities, and objects in the domain of the IoT system to be designed. The domain
model defines the attributes of the objects and the relationships between objects. Domain model provides
an abstract representation of the concepts, objects, and entities in the IoT domain, independent of any
specific technology or platform. With the domain model, the IoT system designers can get an
understanding of the IoT domain for which the system is to be designed.
The fourth step in the IoT design methodology is to define the Information Model. The information Model
defines the structure of all the information in the IoT system, for example, attributes of Virtual entities,
relations, etc. Information model does not describe specifics of how the information is represented or
stored. To define the information model, we first list the Virtual Entities definedintheDomain Model.
Information model adds more details totheVirtualEntities by defining their attributes and relations
The fifth step in the IoT design methodology is to define the service specifications. Service specifications
define the services in the IoT system, service types, service inputs/outputs, service endpoints, service
schedules, service preconditions, and service effects.
The sixth step in the IoT design methodology is to define the IoT level for the system. (The levels in this
sixth step are the levels I mentioned in the Architecture section of Part I)
The seventh step in the IoT design methodology is to define the Functional View. The Functional View (FV)
defines the functions of IoT systems grouped into various Functional Groups (FGs). Each Functional Group
either provides functionalities for interacting within stances of concepts defined in the Domain Model or
provides information related to these concepts.
The eighth step in the IoT design methodology is to define the Operational View Specifications. In this
step, various options related to the IoT system deployment and operation are defined, such as service
hosting options, storage options, device options, application hosting options, etc
The ninth step in the IoT design methodology is the integration of the devices and components.
The final step in the IoT design methodology is to develop the IoT application.
2. The Importance and Impact of Standards on the IoT System Development Process.
Standards play a crucial role in the development and deployment of IoT systems. They not only help ensure
system compatibility and scalability, but also influence the security, performance, and manageability of IoT
applications. Each standard will have a different impact on the development of IoT systems, such as:
Improved efficiency: Modular architectures and structured frameworks simplify the planning and design
phases, reducing the time and effort required for development.
Improved scalability and performance: Cloud-based architectures and lightweight communication
protocols ensure that IoT applications can scale efficiently and perform well even under high loads.
Rapid prototyping and testing: Development tools and prototyping platforms enable rapid iteration,
helping to identify and resolve issues during implementation and testing.
Simplified maintenance and upgrades: Standard hardware interfaces and APIs make integration,
maintenance, and upgrades easy, ensuring the longevity and adaptability of IoT solutions.
Architecture:
Level 2 IoT System: Distributed system with multiple sensor nodes and control devices, including humidity
sensors, light sensors, and automatic irrigation devices.
Automatic watering: Using humidity sensors to determine soil moisture, if lower than the set level, the
system will automatically water
Tools:
Hardware:
APIs:
RESTful APIs: To remotely access and control devices in the agricultural system, including retrieving data
from sensors and controlling devices.
MQTT: To link sensors and devices on the farm, allowing fast and efficient data transmission between
nodes in the network.
IoT is a system that allows devices to collect information from the environment and process data to
determine the tasks to be performed. It has become an essential part of many areas of life, contributing
significantly to improving work efficiency, minimizing risks, and improving the quality of life.
First of all, the most important components to make up an IoT system are sensors. If an IoT system lacks
sensors, in my opinion, the system has lost 80% of its performance. Second are the controllers, which are
responsible for performing assigned tasks such as turning on/off or adjusting devices. Third, connectivity is
also very important, often done via Wifi, Bluetooth, or other technologies to be able to link devices
together. The collected data is then processed and analyzed to extract valuable information, which is
usually stored locally or on a cloud platform. Finally, the user interface allows users to interact with the IoT
system through an intuitive design
IoT Standards:
Through the report, I have a better understanding of the levels of IoT systems, which makes it easier for
me to develop the system. I am also aware of the frameworks that support the development, deployment,
and management of IoT systems. These frameworks provide the tools and environments needed to
effectively connect devices, manage data, and control remotely, including the use of client-server
communication services along with communication protocols.
IV. Analyze IoT architecture forms and use cases for each form.
In the Architecture section of Standards in IoT, I have outlined 6 levels of IoT, so in this section I will analyze and
give examples for each level. Since I have outlined each level in detail above, here I will summarize the main points
of each level.
1. Level 1
Characteristics:
There is only one node (device) that performs sensing and/or action without a network connection. This
device stores data, performs analysis, and runs the application.
Use case:
The meter can sense the temperature and store the data locally, without complex analysis or connection
to other systems. So level 1 is a suitable choice because it meets the requirements of simplicity and cost
savings.
2. Level 2
Characteristics:
There is one node that performs sensing and/or action along with local analysis.
The data is stored in the cloud, the application mainly operates on the cloud platform.
Use case:
Used when there is large data but the analysis requirements are not complex and can be performed
locally.
The sensor can measure moisture and perform local analysis to adjust irrigation, while the data is sent to
the cloud for storage. Choose level 2 because it combines local sensing and cloud storage.
3. Level 3
Characteristics:
There is a single node, data is stored and analyzed in the cloud, and the application operates in the cloud.
Use case:
Used when there is large data and complex analysis needs to be processed in the cloud.
The sensor collects data on air pollution and sends it to the cloud for further analysis. Level 3 is suitable
because data analysis requires large computational resources that can only be done in the cloud.
4. Level 4
Characteristics
There are multiple nodes performing local analysis and data is stored in the cloud.
There are local and cloud observation nodes.
Use case:
Use when multiple nodes, large data, and complex analysis are required.
Sensors in the field can collect data on moisture and nutrients, perform local analysis, and send the data
to the cloud. Since it has to process and analyze data efficiently from multiple sources, Level 4 is suitable.
5. Level 5
Characteristics:
Use case:
Suitable for wireless sensor network-based solutions where large data and complex analysis are required.
Use multiple sensors and cameras to collect data on traffic flow and send it to the coordinator node. This
node will analyze the data and send it to the cloud for storage and further analysis. Choose level 5,
because it efficiently manages multiple nodes and optimizes data collection.
6. Level 6
Characteristics:
Sensors and cameras on the vehicle send data to the central controller for analysis and vehicle control.
Level 6 is best because of the requirement of fast response and complex automation.
V. Self-assessment
During the process of writing this report, I assessed myself that I still lacked self-awareness in doing the
assignment, but instead, I also learned many new things such as how IoT works, the structure of IoT, the
components that makeup IoT, etc. These are all very good knowledge because after learning during the process of
writing the report, I felt very excited and wanted to create an IoT system myself so that I could both apply the
knowledge in the process of writing this report and be able to create an IoT system myself. And I also realized how
important the value of IoT is to current life.
Asm 2:
Solution ideas:
1. Risk of Overloading:
- When the power consumption exceeds the safety limit (rated current), devices like a 5W light bulb may
fail or cause fire hazards.
- Without timely detection, overloading can damage electrical systems, posing risks to both property and
personal safety.
- Traditional devices like light bulbs lack the capability to detect and prevent overload automatically.
1. Real-Time Monitoring:
- IoT allows continuous monitoring of the light bulb's power consumption remotely over the internet.
- Sensors like ACS712 provide real-time data, enabling users to stay informed about their devices.
2. Automation:
- Users can monitor and control the system from anywhere via an IoT app.
4. Energy Optimization:
- The system can analyze power consumption patterns to identify abnormalities and prevent energy
wastage.
1. Key Components:
- ACS712 Current Sensor: Measures the current consumed by the 5W light bulb.
- ESP8266 Microcontroller: Processes sensor data, controls the relay, and communicates with the Blynk
platform via Wi-Fi.
- Relay Module: Switches the power supply on or off for the light bulb.
2. How It Works:
- Current Monitoring:
The ACS712 sensor measures the current and sends an analog signal to ESP8266.
ESP8266 converts this signal to a current value and compares it with a predefined safety
threshold (e.g., 1.0A).
If the current exceeds the threshold, ESP8266 triggers the relay to disconnect the power
supply to the light bulb.
Simultaneously, ESP8266 sends an alert notification via the Blynk app (e.g., "Overload
detected! Power disconnected").
- User Interaction:
The Blynk app displays the current readings and the relay status in real time.
Users can manually control the relay if needed.
3. Ease of Device Management: Users can easily monitor and control the system remotely.
The system can be organized into a 3-layer IoT architecture, which includes the following levels:
- Purpose: Collect real-time current data and execute control commands (turning the relay on/off).
- Purpose: Transmit data from devices to the cloud (e.g., Blynk platform) and receive user commands via
the internet.
- Purpose: Display data (current readings), relay status, and allow remote control by users.
1. Arduino IDE:
- Role: Programming and deploying code to ESP8266.
- Why: Easy to use, supports a wide range of libraries for IoT components.
2. Blynk Platform:
- Role: Provides an interface for IoT device management and user interaction.
- Why: Simplifies cloud integration and offers pre-built widgets for quick app development.
- Role: A lightweight protocol for communication between devices using publish/subscribe mechanisms.
- Why: Optimized for resource-constrained devices, ensuring efficient and reliable data exchange.
4. Development Process:
1. Arduino IDE:
- Why: Easy to use, supports the required libraries for IoT projects.
2. Fritzing:
3. Blynk App:
- Why: Simplifies IoT integration with built-in widgets for monitoring and control.
3. Relay Module:
1. Networking Method:
2. Communication Protocols:
- MQTT:
- HTTP/HTTPS:
- One-Way Communication: Data from ACS712 sent to ESP8266 -> Blynk displays.
- Two-Way Communication: Commands from Blynk sent to ESP8266 -> ESP8266 controls the relay.
Why:
- This architecture is simple, modular, and suitable for small IoT projects focused on monitoring and control.
- Each layer handles a distinct function, making development and debugging more efficient.
- Perception Layer: Collects real-time current data from the ACS712 sensor and controls the relay to
manage the light bulb.
- Network Layer: Uses ESP8266 to transmit data to the Blynk platform via Wi-Fi.
- Application Layer: Displays current readings and relay status on the Blynk app while allowing users to
control the relay remotely.
Selected:
Arduino IDE:
- Why:
Blynk Platform:
- Why:
Offers a pre-built interface for IoT device management, reducing development time.
Blynk: Provides the graphical interface for monitoring current consumption and controlling the relay
remotely.
Selected:
Fritzing:
- Why: Useful for creating clear and professional circuit diagrams for hardware design.
Postman:
- Why: Helpful for testing and debugging APIs if any custom communication protocol is implemented.
Use Fritzing to design and visualize the wiring of ACS712, ESP8266, and relay.
4. Hardware: Components
Selected:
- Why: Measures current drawn by the 5W light bulb, cost-effective, and easily integrates with ESP8266.
- Why: A microcontroller with built-in Wi-Fi, ideal for IoT applications with a small footprint and low cost.
Relay Module:
- Why: Controls the power supply to the light bulb, providing safe switching capabilities.
ESP8266 processes the data and sends updates to Blynk while receiving control commands.
Relay Module switches the light bulb on/off based on conditions or user commands.
5. API Techniques: Communication
Selected:
Wi-Fi (ESP8266):
- Why: Built-in Wi-Fi simplifies connectivity, making ESP8266 ideal for home IoT applications.
- Why: Efficient for cloud communication, syncing data between the device and mobile application.
The ESP8266 connects to Wi-Fi to transmit real-time data from the ACS712 sensor to the Blynk app.
HTTP is used for communication between ESP8266 and the Blynk server, enabling remote monitoring and
control.
Purpose:
The system automatically monitors and adjusts the power supply to a 5W bulb, cutting the power when an
overload occurs, protecting the device, and optimizing energy usage.
Requirements:
Detect when the current exceeds a predefined threshold (overload) and automatically cut the power.
Process Specification
Operating Process:
Process 1: The ACS712 sensor measures the current flowing through the circuit of the bulb.
Process 2: The ESP8266 collects data from the ACS712 and processes it to detect overload conditions.
Process 3: If the current exceeds the threshold, the ESP8266 controls a relay to cut the power and sends
an alert to the Blynk platform.
Process 4: Blynk receives and displays the current status, allowing users to control the bulb remotely.
Domain Model Specification
Main Objects: Bulb, current sensor (ACS712), relay, alert system (Blynk).
Relationships:
The alert system (Blynk) depends on the current data to trigger notifications.
Data Structure:
Bulb Object:
Relay Object:
Service Specifications
Main Services:
Current Monitoring Service: The ACS712 sensor measures and sends current data to the ESP8266.
Power Cut Service: When the current exceeds the threshold, the ESP8266 controls the relay to cut the
power to the bulb.
Alert Service: Sends notifications via Blynk when an overload condition is detected or if there is a system
error.
Input/Output:
Integration between edge devices (like ESP8266, sensors) and control devices (like relays).
Reason: This system requires data processing at the edge, without direct connection to the cloud in real-
time. The data processing at the ESP8266 allows for quick decisions and reduces latency.
Main Functions:
1. Monitoring: Collect and transmit current sensor data from the ACS712 to the ESP8266.
2. Automation: Cut the power when the current exceeds the threshold or if there is an overload.
3. Alerting: Send an alert via Blynk when there is an overload or system fault.
System Operation:
Data Storage: The current data may be stored temporarily in the ESP8266 memory or displayed in the
Blynk app.
Edge Device: The ESP8266 operates locally but can be monitored remotely via Wi-Fi.
Relay: Directly controls the bulb and cuts the power based on signals from the ESP8266.
ESP8266: Collects data from the ACS712 sensor through the ADC pin, processes the signal, and decides
whether to cut the power.
ACS712 Sensor: Measures the current in the circuit and provides voltage signals to the ESP8266.
Relay Module: Controls the bulb’s power state based on signals from the ESP8266.
Blynk: Provides a remote interface for monitoring and controlling the system.
Application Development
App Development:
Blynk App:
- Create a dashboard in Blynk to monitor the current status and control the bulb remotely.
1. The ACS712 sensor measures the current and sends the signal to the ESP8266.
2. The ESP8266 processes the data, checks for overload, and controls the relay if necessary.
3. If an overload is detected, ESP8266 sends an alert to the Blynk app and cuts the power to the bulb via the
relay.
Feasibility:
The system uses low-cost hardware (ESP8266, ACS712) and is easy to implement.
The MQTT protocol ensures fast and reliable data transmission, minimizing latency.
Effectiveness:
Automatic power cut prevents damage due to overload, enhancing device longevity.
2. ACS712 Current Sensor - Measures the current flowing through the load.
The ACS712 is a sensor that can measure both AC and DC currents. It provides an analog signal that ESP8266 can
read and process.
Figure 1: ACS712
ESP8266 is a microcontroller with built-in Wi-Fi, capable of reading the signal from ACS712, processing it, and
sending the data to the Blynk app via Wi-Fi.
GPIO Pins: Used to control devices like the relay (to switch the light bulb).
Figure 2: ESP8266
1.3 Relay Module
The relay module controls the AC power to the light bulb. It receives signals from the ESP8266 and switches the
light bulb on or off.
The light bulb is connected to the relay, and the relay will turn the bulb on/off depending on the current value.
One leg of the bulb connects to the NO (Normally Open) pin on the relay.
2. Hardware Connections
One leg of the light bulb to NO (Normally Open) pin on the relay.
The other leg of the bulb to AC live wire.
Create a new project in the Blynk app with ESP8266 as the selected device.
Here is a basic code to read the current, detect overcurrent, and control the relay.
Figure 9: Blynk
Figure 10: Code 1
readCurrent(): This function reads the current value from the ACS712 sensor, converts it from an analog
value to a voltage, and then converts the voltage to the corresponding current (in Amps).
checkCurrent(): This function runs every second, checks the current, compares it to the overload
threshold, and turns the relay (and thus the light) on/off based on the current. It also sends the current
value to the Blynk app.
Blynk.virtualWrite(V1, currentValue): Sends the current value to Virtual Pin V1 in the Blynk app for real-
time monitoring.
To store the current readings over time, you can integrate the system with platforms like Google Sheets,
ThingSpeak, or Firebase. These platforms can store data sent by ESP8266, which allows you to review the
historical data of the current measurements.
Result:
Positive "The email alert system is quick The alert system meets the
and reliable." practical needs of users and they
trust its effectiveness in keeping
them informed in real-time.
Negative "The light sensor data is sometimes The light sensor data needs to be
noisy, especially when the light is filtered before processing to
very weak." eliminate noise, ensuring better
accuracy, especially in low-light
conditions.
Improvement Suggestion "The email alerts are useful, but it Adding SMS or push notifications as
would be better to have SMS or an alternative channel will increase
app notifications as well." convenience and responsiveness,
providing users with more options
for alerts.
Interface "ThingSpeak shows data visually Users need the ability to adjust
but doesn’t allow customization of alert thresholds directly in the
alert thresholds based on personal interface to cater to their specific
preferences." environments and needs.
Sensor Data Processing Use Node-RED to filter light sensor The sensor data will be more
data (remove noise at very low accurate, and the error margin will
light levels). be reduced to less than 2%.
SMS Alerts Integrate Twilio API to send SMS Users will receive real-time alerts
notifications instead of just email via SMS, improving responsiveness
alerts. and user experience.
Interface Customization Add a feature that allows users to Users will be able to easily adjust
modify the alert thresholds directly the system to their personal
on ThingSpeak. environment, improving usability
and flexibility.
Latency Optimization Improve MQTT data transmission Data latency will be reduced to
speed and ThingSpeak display under 1 second, ensuring real-time
refresh rate. operation and enhancing the
overall user experience.
Email Alerts "Email alerts are - Free integration - Slow response Integrate Twilio API
effective but with IFTTT. time (15-60 to send SMS alerts,
sometimes delayed, - Easy to implement seconds). reduce response
especially when and use. - Doesn’t support time to 10 seconds.
immediate response other alert channels
is required." (SMS, app).
Data Display "ThingSpeak shows - Visual interface is - Limited number of Switch to AWS IoT
data well but easy to understand. API calls in the free Core for greater
doesn’t allow - Easily integrates version. customization,
customizing alert with small IoT - Lacks advanced remove API call
thresholds devices. customization for limitations, and
according to alert thresholds. support advanced
individual needs." alert settings.
Light Sensor "Light sensor data is - Affordable and - Data can be noisy Replace BH1750
sometimes easy to use. in low-light with TSL2591 for
inaccurate, - Relatively high conditions. more accurate data,
particularly in weak accuracy under - Not suitable for especially in weak
light conditions." stable lighting applications light conditions.
conditions. requiring high
accuracy.
Automatic Light "The automatic light - Stable operation. - Delay in switching Upgrade to ESP32
Control control works well, - Energy-saving. the light on/off to reduce
but there’s a delay - Doesn’t require depending on processing delay
when changing light manual ESP8266 processing and improve
conditions, which intervention. speed and data response times.
affects the user transmission
experience." protocol.
Improvement Plan:
Email Alerts Integrate Twilio API to send SMS Reduced response time from 30
notifications. seconds to 10 seconds, enhancing
efficiency in urgent situations.
Light Sensor Replace the BH1750 sensor with More accurate light data, especially
the TSL2591 sensor. in low-light conditions, improving
overall system reliability.
Automatic Light Control Use the ESP32 instead of ESP8266. Decrease delay in light switching
from 5 seconds to under 2 seconds,
enhancing user experience and
system responsiveness.
Data Display Switch from ThingSpeak to AWS IoT Real-time customization of alert
Core for customizable alert thresholds and an enhanced user
thresholds and no API call limits. interface with no API restrictions,
improving flexibility.
7. Provide improved versions and compare
1. Introducing Different Versions
Configuration:
Changes Made: This is the base configuration, chosen for its low cost and simplicity, aimed at providing
basic light monitoring and automated control.
Reason for Change: The initial version provides a working prototype but lacks advanced features such as
better sensor accuracy and faster response times.
Configuration:
- Data Display: Migrated from ThingSpeak to AWS IoT Core for more customization options and higher
scalability.
Changes Made: Replaced the light sensor with a more accurate one (TSL2591), upgraded to ESP32 for
faster processing, and migrated to AWS IoT Core for greater flexibility.
Reason for Change: The changes address user feedback regarding sensor inaccuracies and the delay in
response times, as well as limitations in customization options.
Configuration:
- Communication Protocol: Optimized MQTT with low latency and faster data transmission.
- Data Display: AWS IoT Core with full customizability and no API limits.
- Alerts: SMS alerts through Twilio, along with email alerts, and a mobile push notification system.
Changes Made: Added mobile push notifications, enhanced customization of alert thresholds, and
improved real-time data processing.
Reason for Change: Based on feedback, mobile notifications and more customizable alert thresholds were
added to provide a more responsive and user-friendly experience.
2. Change Analysis
Version 1 to Version 2:
Key Changes:
- Replaced BH1750 with TSL2591 for better light measurement in low-light conditions.
- Upgraded from ESP8266 to ESP32 to enhance processing speed and reduce delay.
- Migrated from ThingSpeak to AWS IoT Core to allow for deeper customization and improved scalability.
- Sensor Accuracy: The TSL2591 provided more accurate readings in low-light environments, reducing
errors and improving reliability.
- Processing Speed: The ESP32 reduced latency, speeding up sensor data processing and improving the
responsiveness of the system.
- Customization: AWS IoT Core allowed users to set custom alert thresholds, making the system more
adaptable to various environments.
- Alert Speed: Twilio SMS alerts reduced response times, ensuring that users received immediate
notifications during critical events.
Version 2 to Version 3:
Key Changes:
- Alert Response: Mobile push notifications provide even faster real-time alerts, improving user
engagement and responsiveness.
- Customization: The ability to adjust alert thresholds directly within the app interface made the system
more user-friendly and adaptable to specific user needs.
- Data Transmission: Optimized data flow and faster transmission improved the overall system's
performance, making the experience smoother for users.
Data Display ThingSpeak AWS IoT Core (more AWS IoT Core (same as
customizability) Version 2)
Alerts Email via IFTTT Email + SMS via Twilio Email + SMS + Mobile
Push Notifications
Response Time Delayed (up to 30 Reduced latency (under 5 Instant response (under 2
seconds) seconds) seconds)
Real-Time Performance Basic real-time updates Optimized real-time Instant updates with
updates enhanced performance
4. Conclusion
- Version 1: Laid the foundation with a simple, cost-effective system for light and temperature monitoring
with basic alerting.
- Version 2: Significantly improved accuracy, speed, and scalability, meeting user needs for more responsive
and customizable features.
- Version 3: Further enhanced user experience by adding mobile push notifications, increasing
customizability, and improving real-time performance.
System Optimization:
- Each version’s improvements were driven by user feedback, making the system more reliable, user-
friendly, and efficient.
- The introduction of faster processing, accurate sensors, and customizable notifications in subsequent
versions addressed critical user concerns, ensuring that the system became increasingly aligned with user
needs.
Based on tests and upgrade plans, the application has successfully addressed the following issues:
1. Energy Saving:
- Automatically cuts off the power when not needed, reducing electricity wastage in households or small
businesses.
- Especially useful for lights that consume electricity continuously but are not frequently monitored.
- The ACS712 sensor monitors the current and detects abnormalities such as excessive current, immediately
shutting off the power.
- Utilizes the Blynk platform to enable remote control of lights via Wi-Fi.
- Users can monitor the light’s status and current consumption via a mobile app, reducing the need for on-
site checks.
4. Environmental Impact:
- Description: By automatically turning off lights when not in use, the application helps reduce electricity
costs for users.
- Impact: Particularly beneficial for households where people often forget to turn off lights.
2. Electrical Safety:
- Description: The application ensures power is cut off immediately upon detecting unsafe current levels via
the ACS712 sensor.
- Impact: Protects electrical devices from damage and minimizes the risk of fire.
3. Convenient Management:
- Description: Connection with Blynk allows users to control and monitor lights through a mobile
application.
4. Environmental Protection:
- Description: Reduces unnecessary energy consumption, contributing to lower CO2 emissions and
environmental conservation.
- Fully implemented functionalities: Automatic on/off control based on current detection, current
monitoring via ACS712, remote control through Blynk.
- Incomplete functionalities: Advanced features like email notifications for abnormal current or historical
usage tracking are yet to be implemented.
- Accuracy: The ACS712 sensor works accurately, but Wi-Fi delays may occasionally cause minor control
latency.
2. Completion Level:
- Based on the initial plan, the application has achieved approximately 85% of the objectives.
- Features like scalability (managing multiple devices) and advanced notifications require further
development.
IV. Conclusion and Upgrade Recommendations
1. Overall Remarks:
- The application effectively meets the basic requirements for energy saving, safety, and remote
management.
- With an 85% completion rate, it is a highly practical solution for households and small businesses.
2. Upgrade Suggestions:
- Integrate additional features like email/SMS notifications for abnormal current detection.
- Enhance the user interface for easier operation within the Blynk application.
Risk: If there is a network outage or the Wi-Fi connection becomes unstable, the system may fail to
respond to remote commands.
Impact:
- Lights may not turn on/off as needed, leading to inconvenience or even safety issues if the system is
controlling critical lighting.
- Remote monitoring through Blynk will not function without an internet connection.
Mitigation:
- Implement an offline mode where the system can operate with preset schedules.
- Incorrect readings from the ACS712 sensor might fail to detect overcurrent conditions, increasing the risk
of damage or fire.
Mitigation:
3. Maintenance Costs
Risk: The system relies on various hardware components (ESP8266, ACS712, Wi-Fi routers) and software
(Blynk server), which require periodic maintenance.
Impact:
- Maintenance costs could increase if hardware frequently fails or if software updates disrupt system
functionality.
- Long-term reliance on third-party services like Blynk may incur subscription costs.
Mitigation:
4. Security Vulnerabilities
Risk: The system’s connection to the internet opens it to potential cybersecurity threats such as
unauthorized access or hacking.
Impact:
- Intruders could control the system remotely, potentially causing harm or mischief (e.g., turning lights
on/off at random times).
- Personal data on the Blynk platform could be exposed.
Mitigation:
- Use strong passwords and enable encryption protocols for the Wi-Fi network.
- Keep the firmware of ESP8266 and software platforms up to date to patch known vulnerabilities.
5. Scalability Issues
Risk: If multiple devices are added to the system, it could exceed the ESP8266’s processing power or the
Wi-Fi router's capacity.
Mitigation:
- Use more powerful controllers or segment the system into smaller, manageable modules.
6. Operational Limitations
Risk:
- If the system relies heavily on the mobile app, non-tech-savvy users may face difficulties.
Impact:
Mitigation:
7. Environmental Factors
Risk: Environmental conditions like high humidity, extreme temperatures, or power fluctuations could
impact system reliability.
Impact:
Mitigation:
Risk: If the Blynk platform or other third-party libraries cease support or become deprecated, the
application could lose functionality.
Impact:
- Users may need to migrate to another platform, incurring additional costs and effort.
Mitigation:
Summary of Concerns
10.Comprehensive Evaluation
1. Comparison Between Initial Idea and Final Product
Initial Idea:
Develop a system to automatically cut power to a 5W light bulb using the ACS712 current sensor and
ESP8266 module.
Enable remote monitoring and control via the Blynk app, with features to:
Final Product:
- Successfully implemented the core functionality: automatic power control, current monitoring, and
remote control via Blynk.
- Real-time data on current consumption and device status is accessible through the Blynk app.
- The system effectively improves energy efficiency and ensures electrical safety by detecting abnormal
current flow.
- Advanced notifications (e.g., email/SMS alerts): Excluded due to time constraints and reliance on the
Blynk platform.
- Scalability for multiple devices: Simplified to focus on a single-device prototype for initial deployment.
- Reason for changes: Limited resources and a need to deliver a minimum viable product (MVP) within
deadlines.
Notifications Real-time notifications for abnormal Partially implemented (via Blynk but
events no email/SMS)
Data Logging Historical records of power usage Not implemented (planned for future
upgrades)
Social Impact:
Example Use Case: Households with frequent power usage can save on bills and improve safety, directly
benefiting residents.
Impact on Businesses:
Operational Optimization:
- Businesses can reduce electricity costs by automating power management in offices or warehouses.
- Monitoring systems provide insights into power consumption, enabling better energy planning.
Cost Efficiency: Low-cost components like ACS712 and ESP8266 make it an affordable solution for small
and medium enterprises (SMEs).
Example Use Case: A small office with irregular lighting needs could reduce operational overheads by 10–
15% using this system.
User Experience:
Satisfaction Levels:
- Strengths: Easy-to-use interface via Blynk, reliable automatic functions, and real-time monitoring.
- Challenges: Dependence on stable Wi-Fi and limited advanced notification options may affect satisfaction
for some users.
- Feedback: Users appreciate the system's basic functionality but express interest in future enhancements
like data logging and multi-device control.
Achievement Rate: ~85% of the initial goals were realized, focusing on delivering core features effectively.
Strengths: The solution is practical, affordable, and addresses real-world problems like energy efficiency
and safety.
Limitations: Features like advanced notifications, scalability, and offline functionality require further
development to enhance usability and versatility.
General Success:
The process from research to product completion can be divided into key phases as follows:
Tasks performed:
- Creating a detailed implementation plan, including desired features, system design, and project timeline.
Evaluation:
- This phase was executed well, helping to clearly define the direction of the project.
- Area for improvement: Anticipating potential technical challenges in more detail could have helped avoid
major adjustments in the later stages.
Tasks performed:
- Writing and testing the code for ESP8266 to control and transmit data.
- Integrating the system with the Blynk app for remote monitoring and control.
Evaluation:
- The core functionalities were implemented successfully as planned, ensuring feasibility and stability.
- However, some advanced features ( email/SMS notifications or historical data logging) were omitted to
meet the project deadline. This highlighted a need for better time management and prioritization of tasks.
Tasks performed:
- Testing the system under real-world conditions (network outages, abnormal current, connection stability).
- Thorough testing ensured that the product worked well under practical conditions.
- Area for improvement: Some edge cases ( offline functionality) were not fully addressed, which could
have improved reliability.
Tasks performed:
- Preparing documentation and reports to assist with future upgrades and maintenance.
Evaluation:
- The reports were comprehensive and well-structured, making the product easy to understand and future-
proof.
- Area for improvement: A more detailed proposal for future steps, including scalability and advanced
features, would have strengthened the final presentation.
Successes:
Achieved the main objectives of the project within the given timeframe.
The project has both academic and practical value, demonstrating real-world applicability.
Challenges:
Time management could have been better, leading to the omission of some advanced features.
Some technical risks and challenges were not anticipated early enough, causing delays in problem-solving.
The system was not designed for scalability or multi-device integration, which limited its broader
application.
Lessons Learned:
1. Better time management: Allocate more time for each phase to avoid rushed decisions and ensure a more
complete product.
2. Early risk anticipation: Consider potential risks and prepare solutions in advance to minimize delays.
3. Real-world testing: Ensure that the product performs smoothly under various conditions by conducting
more comprehensive testing.
4. Continuous learning: Stay updated with new IoT platforms and hardware to improve creativity and
expand development possibilities.
3. Overall Evaluation
Effectiveness: The project execution demonstrated commitment and creativity in solving a real-world
problem.
Product quality: The final product meets the basic goals, is feasible, and has significant potential for real-
world application.
Development potential: With further enhancements and scalability, the product could become a
comprehensive solution for smart energy management.
VI. Conclusion
The project of creating an automated 5W light control system using ACS712, ESP8266, and Blynk successfully
demonstrates the integration of IoT technology into practical energy management solutions. From research to
implementation, the project met its core objectives, including energy-saving functionality, enhanced safety, and
remote monitoring capabilities. While some advanced features were omitted due to time constraints, the product
remains a robust prototype with significant potential for real-world applications.The development process
highlighted key strengths, such as thorough testing, practical problem-solving, and clear documentation, alongside
areas for improvement, like better time management and risk anticipation. The system has proven its value to
both individuals and businesses by offering cost efficiency, convenience, and safety.Looking ahead, future
upgrades—such as offline functionality, multi-device support, and historical data logging—could transform this
prototype into a scalable, market-ready product. Overall, the project reflects a strong foundation in IoT design and
implementation, contributing to energy efficiency and safety in daily life while opening pathways for further
innovation.
VII. References
What is IoT:
Gillis, A. and Yasar, K. (2023). What Is IoT (Internet of Things) and How Does It Work? [online]
TechTarget. Available at: https://www.techtarget.com/iotagenda/definition/Internet-of-Things-
IoT.
Sensor:
Wikipedia Contributors (2019). Sensor. [online] Wikipedia. Available at:
https://en.wikipedia.org/wiki/Sensor.
Actuator
Connectivity
www.xyte.io. (n.d.). IoT Connectivity: Types & How to Choose the Right Technology. [online]
Available at: https://www.xyte.io/blog/iot-connectivity.
Architecture
SlideShare. (2019). IoT Levels and Deployment Templates. [online] Available at:
https://www.slideshare.net/slideshow/iot-levels-and-deployment-templates/131285487
[Accessed 15 Oct. 2024].
APIs