Assignment Brief 2 (RQF)
Higher National Certificate/Diploma in Business
Student Name/ID Number:
Nguyen Dinh Vu
Unit Number and Title:
Unit 43 – Internet of Things
Academic Year:
2021
Unit Assessor:
Tran Trong Minh
Assignment Title:
Assignment 2 – Internet of Things
Issue Date:
Submission Date:
Internal Verifier Name:
Date:
Submission Format:
Format:
This assignment is an Individual assignment and specifically including 1 document:
You must use font Calibri size 12, set number of the pages and use multiple line spacing at
1.3. Margins must be: left: 1.25 cm; right: 1 cm; top: 1 cm and bottom: 1 cm. The reference
follows Harvard referencing system. The recommended word limit is 2.000-2.500 words.
You will not be penalized for exceeding the total word limit. The cover page of the report
has to be the Assignment front sheet 2.
Submission Students are compulsory to submit the assignment in due date and in a way requested by the
Tutors. The form of submission will be a soft copy posted on />Note:
The Assignment must be your own work, and not copied by or from another student or from
books etc. If you use ideas, quotes or data (such as diagrams) from books, journals or other sources, you
must reference your sources, using the Harvard style. Make sure that you know how to reference properly,
and that understand the guidelines on plagiarism. If you do not, you definitely get fail
Unit Learning Outcomes:
LO1 Analyse what aspects of IoT are necessary and appropriate when designing software applications
LO2 Outline a plan for an appropriate IoT application using common architecture, frameworks, tools,
hardware and APIs
LO3 Develop an IoT application using any combination of hardware, software, data, platforms and
services.
LO4 Evaluate your IoT application and detail the problem your IoT application solves, the potential
impact on people, business, society and the end user and the problems it might encounter when
integrating into the wider IoT ecosystem
Page 1
Assignment Brief and Guidance:
You currently work as a product developer for a new startup where you design IoT products for the
consumer, corporate, government and defence clients. As part of your role your manager has tasked you to
plan and develop a new IoT product, service or application for a potential client. You are required to
identify a target user and conduct tests with this user and include this feedback into multiple iterative
versions of your product.
Part 1 (Assignment 1):: For the first part, you must:
Plan an IoT application for a specific target end user and the tests you intend to conduct with this
user. This plan will be in the form of a document and will include supporting evidence and material,
such as user personas and customer journey maps.
Create multiple iterations of your application and modify each iteration with enhancements gathered
from user feedback and experimentation. This will follow the pathway outlined in your plan.(log
book,)
Part 2 (Assignment 2): For the second part, you must produce a report to prove that:
Show evidence about Developed IoT application using any combination of hardware, software,
data, platforms and services (video or images of your IoT system with code snippet)
Evaluate your IoT application and detail the problem your IoT application solves, the potential
impact on people, business, society and the end user and the problems it might encounter when
integrating into the wider IoT ecosystem
Page 2
Learning Outcomes and Assessment Criteria
Pass
Merit
Distinction
LO3 Develop an IoT application using any combination of hardware, software, data, platforms and
services.
P5 Employ an appropriate set
of tools to develop your plan
into an IoT application.
M5 Reconcile and evaluate end
user feedback and determine
advantages and disadvantages of
your chosen IoT techniques.
D3 Critical evaluate security risks
that your application might
encounter.
P6 Run end user experiments
and examines feedback.
LO4 Evaluate your IoT application and detail the problem your IoT application solves, the potential
impact on people, business, society and the end user and the problems it might encounter when
integrating into the wider IoT ecosystem
P7 Evaluate end user feedback
from your IoT application.
M6 Undertake a critical review and
compare your final application with
the original plan.
Page 3
D4 Critique the overall success of
your application. Did it solve
your problem? What is the
potential impact on people,
business, society and the end user?
What problems might it encounter
when integrating into the wider
IoT ecosystem?
Contents
Assignment Brief 2 (RQF).................................................................................................................................1
Higher National Certificate/Diploma in Business..........................................................................................1
I. Introduction.....................................................................................................................................................6
II. Employ appropriate tools to develop your plan into an IoT application. (P5)..............................................6
1. Introduction.................................................................................................................................................6
2. Implementation of design...........................................................................................................................6
Hardware Selection.....................................................................................................................................7
Microcontroller and Programming Software Selection............................................................................10
3. Program Compiler on Arduino.................................................................................................................11
Menu Bar......................................................................................................................................................14
Tools.........................................................................................................................................................19
Help...........................................................................................................................................................21
III. Run end-user experiments and examine feedback. (P6).............................................................................22
1. Introduction...............................................................................................................................................22
2. Code implements functions in detail:.......................................................................................................23
Light sensor:..............................................................................................................................................23
Rain sensor:...............................................................................................................................................24
Temperature sensor:..................................................................................................................................24
Gas sensor:................................................................................................................................................25
Smart door:................................................................................................................................................26
Motion sensor............................................................................................................................................27
3. Test cases..................................................................................................................................................28
4. Test case summary....................................................................................................................................28
Keypad Door Lock Testing:......................................................................................................................28
Motion Sensor Testing:.............................................................................................................................28
Light Sensor Testing:................................................................................................................................29
Gas Sensor Testing:...................................................................................................................................29
Rain Sensor Testing:.................................................................................................................................29
Temperature-Humidity Sensor Testing:....................................................................................................29
System Responsiveness Testing:...............................................................................................................29
Accuracy and Reliability Testing:.............................................................................................................29
User Experience Testing:..........................................................................................................................29
Conclusion.................................................................................................................................................30
Page 4
IV. Evaluate end-user feedback from your IoT application. (P7)....................................................................30
1. Introduction...............................................................................................................................................30
2. User Feedback...........................................................................................................................................30
User 2: Sarah Williams.............................................................................................................................31
User 3: Michael Johnson...........................................................................................................................32
3. Self-evaluation..........................................................................................................................................33
4. Options to upgrade the product in the next version..................................................................................34
V. References....................................................................................................................................................35
Figure 1 Keypad & servo sg90...........................................................................................................................7
Figure 2 PIR Motion Temperature Sensor HC-SR501.......................................................................................8
Figure 3 Light Sensor.........................................................................................................................................8
Figure 4 Gas Sensor............................................................................................................................................9
Figure 5 Rain Sensor..........................................................................................................................................9
Figure 6 DHT11 Temperature-Humidity Sensor.............................................................................................10
Figure 7 ESP8266 v3........................................................................................................................................10
Figure 8 Arduino IDE.......................................................................................................................................11
Figure 9 The Arduino IDE display in detail....................................................................................................12
Figure 10 Toolbar Button.................................................................................................................................12
Page 5
I. Introduction
This Smart Home IoT project aims to create a smart home system that uses IoT devices to improve safety,
convenience and energy savings for users. The project includes a numeric keypad for access management
and motion sensors, light variables, gas sensors and rain sensors to automatically control home appliances.
II. Employ appropriate tools to develop your plan into an IoT application. (P5)
1. Introduction
In this section, we will look at how to choose the right hardware and software architecture for Smart Home
IoT project development, including door lock numeric keypad, motion sensor, light sensor, sensor gas and
rain variable.
Page 6
2. Implementation of design
Hardware Selection
Keypad Door Lock:
Figure 1 Keypad & servo sg90
1) What is it?
In this case, the system consists of a keypad with an LCD (Liquid Crystal Display) and an SG90 servo
motor, combined with an Arduino Uno to create a secure and interactive control system through entering
codes via the keypad and controlling the servo motor.
2) Why do you need to do that?
Combining the keypad, LCD, and SG90 servo motor helps establish a secure and convenient mechanism for
door access. By using the keypad to input codes and controlling the servo motor, users can easily control
access to a specific space and ensure security.
3) How do you do it?
3.1) Setting up the keypad and LCD:
Step 1: Connect the keypad to the Arduino Uno using GPIO pins. The keypad usually has rows and columns
of buttons, and you'll need to connect the rows to specific GPIO pins and the columns to other pins.
Step 2: Connect the LCD display to the Arduino Uno using either the I2C interface or parallel interface.
Typically, the LCD will have output including data lines and control lines.
Step 3: Use the corresponding libraries (like Keypad.h and LiquidCrystal.h) to read data from the keypad
and display information on the LCD. When users input codes, the data will be displayed on the LCD.
3.2) Controlling the SG90 servo motor:
Page 7
Step 1: Connect the SG90 servo motor to the Arduino Uno. The servo motor has three wires: one for power,
one for ground, and one for signal. Connect the power and ground wires to the power and ground of the
Arduino, and connect the signal wire to a GPIO pin on the Arduino.
Step 2: Use the Servo.h library to control the SG90 servo motor from the Arduino. This library allows you to
adjust the rotation angle of the servo motor.
Step 3: Based on the code input from the keypad and displayed on the LCD, you can determine the
corresponding actions. For example, if the code is correct, you can control the servo motor to open the door
by adjusting the rotation angle.
In summary, by combining the keypad, LCD, and SG90 servo motor with the Arduino Uno, you can create a
secure and interactive door access system. The process involves setting up the keypad and LCD, using the
corresponding libraries to control and display data, as well as controlling the SG90 servo motor based on
data from the keypad.
Page 8
Motion Sensor:
Figure 2 PIR Motion Temperature
Sensor HC-SR501
1) What is it?
A motion sensor light is a sensor device used to detect motion in the environment and activate corresponding
light fixtures or lighting devices. It typically utilizes infrared or ultrasonic technology to detect changes in
the surroundings.
2) Why do you need to do that?
Motion sensor lights help conserve energy and enhance convenience. When a person moves within an area
monitored by the sensor, the light system automatically turns on, ensuring sufficient illumination when
needed, and turns off after motion is no longer detected. This contributes to energy savings and improves
security in the area.
3) How do you do it?
3.1) Connecting the Motion Sensor:
Step 1: Connect the power and ground pins of the motion sensor to the appropriate power and ground
sources.
Step 2: Connect the signal pin of the motion sensor to a GPIO pin on the Arduino Uno. Typically, the
motion sensor will have a signal pin to send a signal when motion is detected.
3.2) Arduino Programming:
Step 1: Use the Arduino IDE programming environment to write code.
Step 2: Utilize the corresponding library (e.g., PIR.h if using a PIR motion sensor) to read data from the
motion sensor.
Page 9
Step 3: Write code to check the status of the motion sensor. If motion is detected, the system will activate the
light by controlling the related GPIO pin connected to the light. After a period of no motion, the system will
turn off the light.
3.3) Integration with the Light Fixture:
Step 1: Connect the light fixture to the Arduino Uno using the appropriate GPIO pin.
Step 2: Write code to control the GPIO pin of the light. When the motion sensor detects motion, the system
will turn on the light, and after a period of no motion, the system will turn off the light.
In summary, a motion sensor light combined with an Arduino Uno enables automatic activation of lights
upon motion detection and turning off lights when motion is no longer detected. The process involves
connecting the sensor, programming the Arduino to read data and control the light, and integrating the
system with the light fixture.
Light Sensor
Page 10
Figure 3 Light Sensor
1) What is it?
A photodiode sensor is a type of light sensor used to detect the level of light in the environment. It operates
by generating an electron current based on the amount of light it encounters.
2) Why do you need to do that?
Combining a photodiode sensor with a light fixture and Arduino Uno can create an automated light control
system based on the natural light level in the environment. This helps conserve energy, enhance
convenience, and create a more comfortable living environment.
3) How do you do it?
3.1) Connecting the Photodiode Sensor:
Step 1: Connect the anode (positive pin) of the photodiode sensor to a stable power source, such as 5V on
the Arduino Uno.
Step 2: Connect the cathode (negative pin) of the photodiode sensor to a GPIO pin on the Arduino Uno.
3.2) Arduino Programming:
Step 1: Use the Arduino IDE programming environment to write code.
Step 2: Utilize the corresponding library to read data from the photodiode sensor. You can use AnalogRead()
to read the voltage value from the GPIO pin connected to the cathode of the sensor.
Step 3: Read the voltage value from the sensor and convert it into a corresponding light level. This
conversion can be based on the correlation between the voltage value and the light level.
3.3) Controlling the Light Based on the Sensor:
Step 1: Connect the light fixture to the Arduino Uno using the appropriate GPIO pin.
Step 2: Write code to control the GPIO pin of the light. Based on the light value read from the sensor, the
system will adjust the light accordingly. For example, if the natural light is low, the system can turn on the
light.
Page 11
In summary, combining a photodiode sensor with a light fixture and Arduino Uno allows the creation of an
automated light control system based on the light level in the environment. The process involves connecting
the sensor, programming the Arduino to read data, and controlling the corresponding light fixture.
Gas Sensor:
Figure 4 Gas Sensor
1) What is it?
The MQ-2 gas sensor is a popular type of gas sensor used to detect the presence of gases such as LPG,
carbon monoxide (CO), methane, and other combustible gases. This sensor operates based on the principle
of measuring the change in electronic resistance when in contact with different gases.
2) Why do you need to do that?
Combining the MQ-2 gas sensor with a speaker and Arduino Uno can create an automatic gas alert system.
When the sensor detects the presence of harmful gases, the system will activate the speaker to alert users
about the dangerous situation. This ensures safety for users and helps prevent potential accidents due to the
accumulation of hazardous gases.
3) How do you do it?
3.1) Connecting the MQ-2 Gas Sensor:
Step 1: Connect the power and ground pins of the MQ-2 gas sensor to the appropriate power and ground
sources.
Step 2: Connect the signal pin of the MQ-2 gas sensor to an analog pin on the Arduino Uno.
3.2) Arduino Programming:
Step 1: Use the Arduino IDE programming environment to write code.
Step 2: Utilize the AnalogRead() function to read the signal value from the MQ-2 gas sensor.
Page 12
Step 3: Determine a threshold value to decide when the sensor detects harmful gas. If the reading value from
the sensor crosses this threshold, the system will activate the speaker.
3.3) Controlling the Speaker:
Step 1: Connect the speaker to the Arduino Uno using a corresponding GPIO pin.
Step 2: Write code to control the GPIO pin of the speaker. When the sensor detects harmful gas, the system
will activate the speaker to produce an audible alert.
In conclusion, combining the MQ-2 gas sensor with a speaker and Arduino Uno allows the creation of an
automatic gas alert system. The process involves connecting the sensor, programming the Arduino to read
data, and activating the speaker when hazardous gas is detected.
Page 13
Rain Sensor
Figure 5 Rain Sensor
1) What is it?
A rain sensor, also known as a rain detector or raindrop sensor, is a type of sensor designed to detect the
presence of rainfall or water droplets. It is commonly used to trigger actions or responses based on weather
conditions involving rain.
2) Why do you need to do that?
Integrating a rain sensor with a system, such as an irrigation system or an automated car wiper system,
allows for automatic adjustments in response to rain. This can help conserve water resources, improve
safety, and enhance the efficiency of various processes that are impacted by rainfall.
3) How do you do it?
3.1) Connecting the Rain Sensor:
Step 1: Connect the rain sensor's power and ground pins to the appropriate power source and ground.
Step 2: Connect the signal pin of the rain sensor to a digital or analog pin on the Arduino Uno.
3.2) Arduino Programming:
Step 1: Use the Arduino IDE programming environment to write code.
Step 2: Utilize the digitalRead() or analogRead() function, depending on the type of rain sensor, to read the
signal from the sensor.
Step 3: Define a threshold value that determines when the sensor detects rain. This threshold value can be
based on the analog or digital signal's value.
Page 14
3.3) Response Mechanism:
Step 1: Based on the rain sensor's reading, you can design a response mechanism. For example, if rain is
detected, the system could trigger actions such as activating an automated wiper system for a car or turning
off an irrigation system for a garden.
Step 2: Write the code to control the response mechanism. This could involve using digitalWrite() to control
a relay for activating a wiper motor or turning off a water pump.
In summary, a rain sensor can be integrated with a system to enable automatic responses to rainfall. The
process involves connecting the sensor, programming the Arduino to read data, and designing and
implementing a response mechanism based on the sensor's readings.
Temperature-Humidity Sensor
Figure 6 DHT11 Temperature-Humidity Sensor
1) What is it?
The DHT11 sensor is a combined temperature and humidity sensor that provides real-time measurements of
the surrounding environment's temperature and humidity levels. An LCD (Liquid Crystal Display) is a type
of screen that can display information using liquid crystal technology.
2) Why do you need to do that?
Integrating the DHT11 sensor with an LCD and Arduino Uno allows you to create a system that can provide
users with real-time temperature and humidity readings in a visual format. This can be useful for monitoring
environmental conditions and making informed decisions based on the data.
Page 15
3) How do you do it?
3.1) Connecting the DHT11 Sensor:
Step 1: Connect the sensor's VCC and GND pins to the appropriate power source and ground.
Step 2: Connect the sensor's data pin to a digital pin on the Arduino Uno.
3.2) Connecting the LCD:
Step 1: Connect the LCD's VCC and GND pins to the appropriate power source and ground.
Step 2: Connect the LCD's data pins (such as RS, E, D4, D5, D6, D7) to digital pins on the Arduino Uno.
3.3) Arduino Programming:
Step 1: Use the Arduino IDE programming environment to write code.
Step 2: Utilize the DHT library to read data from the DHT11 sensor. This library provides functions to
retrieve temperature and humidity readings.
Step 3: Use the LiquidCrystal library to control the LCD. You can use functions like lcd.begin() to initialize
the LCD and lcd.print() to display information on the screen.
Step 4: Combine the DHT11 readings with LCD display. Read temperature and humidity values from the
sensor and display them on the LCD.
3.4) Displaying Data:
Step 1: Write the code to display the temperature and humidity readings on the LCD. You can use
lcd.setCursor() to set the position and lcd.print() to display the values.
Step 2: You can also add additional features like scrolling or updating the values at specific intervals.
Page 16
In summary, integrating the DHT11 temperature and humidity sensor with an LCD and Arduino Uno allows
you to create a system that provides real-time environmental data in a visual format. The process involves
connecting the sensor and LCD, programming the Arduino to read data and control the LCD, and displaying
the temperature and humidity readings on the screen.
Microcontroller and Programming Software Selection
Microcontroller (ESP8266)
Figure 7 ESP8266 v3
The ESP8266 microcontroller will be the central control unit for the entire system. It supports Wi-Fi
connectivity, communicates through UART for interactions with the keypad door lock and buzzer, and
manages the SG90 servo motor using PWM pins.
Page 17
Programming Software
Figure 8 Arduino IDE
Utilize the Arduino IDE to develop code for the ESP8266 microcontroller. The code will encompass tasks
such as processing data from various sensors, managing password inputs, controlling door locking and
unlocking, adjusting lighting based on light levels, activating the buzzer upon detecting harmful gas, rain, or
suboptimal temperature and humidity conditions.
3. Program Compiler on Arduino
The Arduino IDE is an open-source software, which is used to write and upload code to the Arduino boards.
The IDE application is suitable for different operating systems such as Windows, Mac OS X, and Linux. It
supports the programming languages C and C++. Here, IDE stands for Integrated Development
Environment.
The program or code written in the Arduino IDE is often called as sketching. We need to connect the
Genuino and Arduino board with the IDE to upload the sketch written in the Arduino IDE software. The
sketch is saved with the extension '.ino.'
Page 18
The Arduino IDE will appear as:
Figure 9 The Arduino IDE display in detail
Toolbar Button
The icons displayed on the toolbar are New, Open, Save, Upload, and Verify.
Page 19
It is shown below:
Figure 10 Toolbar Button
Upload
The Upload button compiles and runs our code written on the screen. It further uploads the code to the
connected board. Before uploading the sketch, we need to make sure that the correct board and ports are
selected.
We also need a USB connection to connect the board and the computer. Once all the above measures are
done, click on the Upload button present on the toolbar.
The latest Arduino boards can be reset automatically before beginning with Upload. In the older boards, we
need to press the Reset button present on it. As soon as the uploading is done successfully, we can notice the
blink of the Tx and Rx LED.
If the uploading is failed, it will display the message in the error window.
We do not require any additional hardware to upload our sketch using the Arduino Bootloader.
A Bootloader is defined as a small program, which is loaded in the microcontroller present on the board.
The LED will blink on PIN 13.
Open
The Open button is used to open the already created file. The selected file will be opened in the current
window.
Save
The save button is used to save the current sketch or code.
New
It is used to create a new sketch or opens a new window.
Page 20