Tải bản đầy đủ (.pdf) (89 trang)

Iot - Based automatic monitoring and control system for agriculture

Bạn đang xem bản rút gọn của tài liệu. Xem và tải ngay bản đầy đủ của tài liệu tại đây (5.52 MB, 89 trang )

MINISTRY OF EDUCATION AND TRAINING
HO CHI MINH CITY UNIVERSITY OF TECHNOLOGY AND EDUCATION
FACULTY FOR HIGH QUALITY TRAINING

ELECTRONICS AND
TELECOMMUNICATION
ENGINEERING
TECHNOLOGY

IOT-BASED AUTOMATIC MONITORING AND CONTROL
SYSTEM FOR AGRICULTURE

LECTURER: DO DUY TAN
STUDENT : DAO DUY TUNG
VO BANG TRANH

SKL 0 0 9 3 2 7

Ho Chi Minh City, August, 2020


HO CHI MINH CITY UNIVERSITY OF TECHNOLOGY AND EDUCATION
FACULTY FOR HIGH QUALITY TRAINING

--------------

GRADUATION THESIS

IOT-BASED AUTOMATIC MONITORING AND
CONTROL SYSTEM FOR AGRICULTURE
DAO DUY TUNG


Student ID: 17141034
VO BANG TRANH
Student ID: 17141146
Major: ELECTRONIC AND COMMUNICATION
ENGINEERING TECHNOLOGY
Advisor: DO DUY TAN, M.Eng.

Ho Chi Minh City, August 2022


HO CHI MINH CITY UNIVERSITY OF TECHNOLOGY AND EDUCATION
FACULTY FOR HIGH QUALITY TRAINING

--------------

GRADUATION THESIS

IOT-BASED AUTOMATIC MONITORING AND
CONTROL SYSTEM FOR AGRICULTURE
DAO DUY TUNG
Student ID: 17141034
VO BANG TRANH
Student ID: 17141146
Major: ELECTRONIC AND COMMUNICATION
ENGINEERING TECHNOLOGY
Advisor: DO DUY TAN, M.Eng.

Ho Chi Minh City, August 2022

ii



THE SOCIALIST REPUBLIC OF VIETNAM
Independence – Freedom– Happiness
-------Ho Chi Minh City, July 27th, 2022

ADVISOR’S EVALUATION SHEET
Student name: Dao Duy Tung

Student ID: 17141034

Student name: Vo Bang Tranh

Student ID: 17141146

Major: Electronics and Communication Engineering Technology
Project title: IOT-BASED AUTOMATIC MONITORING AND CONTROL
SYSTEM FOR AGRICULTURE
Advisor: M.Eng. Do Duy Tan
EVALUATION
1. Content of the project:
- The team implements the content that meets the requirements set out initially
2. Strengths:
- The group made the graduation thesis on schedule and reported on the complete
process.
- The content of the report presents a clear layout.
3. Weaknesses:
-The topic of designing a garden care system using IoT technology has been
implemented by many groups before
show before

- It is recommended to supplement the garden monitoring table in a certain period of
time to evaluate the effectiveness
- Some images are not good quality.
4. Approval for oral defense? (Approved or denied): APPROVAL
5. Overall evaluation: (Excellent, Good, Fair, Poor):
6. Mark: 8.2 (in words: Eight point two )
Ho Chi Minh City,
ADVISOR
(Sign with full name)

iii


HCMC University of Technology and
Education
Faculty for High Quality training

Socialist Republic of Vietnam
Independence - Liberty – Happiness
Ho Chi Minh City, July 27th, 2022

PROJECT ASSIGNMENT
Name of Members: Dao Duy Tung

Student ID: 17141034

Vo Bang Tranh

Student ID: 17141146


Training system: Regular university
Major: Electronics and communication engineering technology
Class: 17141CLA2; 17141CLS
I.

NAME OF PROJECT: IOT-BASED AUTOMATIC MONITORING AND
CONTROL SYSTEM FOR AGRICULTURE

II.

ASSIGNMENT

1. Content of implementation
- Present the theoretical basis of greenhouse models, wifi standards, protocols
UART, I2C communication.
- Design block diagrams and schematic diagrams of the entire system.
- Present and analyze the operating modes of the system.
- Analyze and evaluate the resource usage of the design.
- Provide general conclusions and development direction of the topic.

2. Product
- Evaluation results on the real paradigm.
III.

DATE OF RECEIVING TASK:

IV.

DATE OF TASK COMPLETION:


V.

ADVISOR: M.Eng. Do Duy Tan
CHAIR OF THE PROGRAM
(Sign with full name)

ADVISOR
(Sign with full name)

i


HCMC University of Technology and
Education
Faculty for High Quality training

Socialist Republic of Vietnam
Independence - Liberty – Happiness
Ho Chi Minh City, July 27th, 2022

PROJECT IMPLEMENT SCHEDULE

Name of Members: Dao Duy Tung

Student ID: 17141034

Vo Bang Tranh

Student ID: 17141146


Class: 17141CLA2; 17141CLS
Name of project: IOT-BASED AUTOMATIC MONITORING AND CONTROL
SYSTEM FOR AGRICULTURE

Week/Date
1st
(7/3-13/3)

Content
Meet Instructor to disseminate regulations:
choose topic, working time.
- Instructor conducts review of the topic.

2st

- Write a summary of the requirements of the

(14/3-20/3)

selected topic: Reasons and objectives of the topic,
design content, limited parameters of the topic.

3nd
(21/3-27/3)
4rd
(28/3-4/4)

Write the plan and detail outlines for the topic.
- Design block diagram.
- Design the principal diagram and explain the

function of each block.
- Search for knowledge, information about the

5th
(5/4-11/4)

characteristics, temperature, and humidity of
plants.
- Find out the sensors used in the subject.
ii

Lecture Confirm


- Learn about how to program apps on smartphone
phone.
6th
(12/4-18/4)
7th
(19/4-25/4)
8th

Calculate the parameter of component and
choose the suitable material.
Complete schematic and layout of components
on the circuit board.
Design and construction of central control block.

(26/4-2/5) 9th
(3/5-9/5)

10th

- Programming to connect operating modules in
the system.

(10/5-16/5) - - Design the interface on Blynk App though
11th
smartphone
(17/5-23/5)
12th
(14/5-30/5)
13th
(31/5-6/6)
14th

- Implement the circuit board.
- Model building.

(7/6-13/6)
15th
(14/6-20/6)
16th
(21/6-27/6)
17th
(28/6-4/7)

- Implement, test and fix the Project.
- Write the report.
Complete the report and send it to Instructor to
review and comment for the last time before

printing the report.
Summit the report and slide PowerPoint.

iii


DISCLAIMER
We guarantee that this project is our research, under M.Eng. Do Duy Tan's guidance. The
results published in this project are honest and are not replicated from any other work.

STUDENTS
Vo Bang Tranh

iv

Dao Duy Tung


ACKNOWLEDGMENTS
Foremost, our group would like to express our sincere thanks to the teachers in the Faculty
of High Quality Training. During the time studying at the school, the teachers were
dedicated to teaching and imparting to their group knowledge, experience and motivation
in the learning process.
We sincerely thank to my advisor for his continued support and encouragement: M.Eng.
Do Duy Tan. We offer our sincere appreciation for the learning opportunities provided by
my lecturer.
Besides my advisor, we would like to thank our friends who shared knowledge and
valuable experiences during the implementation of the project.
Finally, we would like to thank our family for giving time to care and supporting us
spiritually throughout our life.


Sincerely!

STUDENTS
Vo Bang Tranh

v

Dao Duy Tung


TABLE OF CONTENTS
PROJECT ASSIGNMENT ............................................................................................... i
PROJECT IMPLEMENT SCHEDULE ........................................................................... ii
DISCLAIMER ................................................................................................................ iv
ACKNOWLEDGMENTS ............................................................................................... v
TABLE OF CONTENTS ................................................................................................ vi
LIST OF FIGURES ...................................................................................................... viii
LIST OF TABLES.......................................................................................................... xi
ABSTRACT .................................................................................................................. xii
Chapter 1: INTRODUCTION .......................................................................................... 1
1.1. PROBLEM STATEMENT............................................................................. 1
1.2. OBJECTIVES ................................................................................................ 2
1.3. METHODOLOGY ......................................... Error! Bookmark not defined.
1.4. LIMITATIONS .............................................................................................. 2
1.5. RESEARCH CONTENT................................ Error! Bookmark not defined.
1.6. THESIS REPORT OUTLINE ........................ Error! Bookmark not defined.
Chapter 2: LITERATURE REVIEW ............................................................................... 4
2.1. GREENHOUSE MODEL .............................................................................. 4
2.2. INTERNET OF THINGS (IoT) ...................................................................... 5

2.3.COMMUNICATION PROTOCOLS .............................................................. 6
2.3.1. UART ............................................................................................... 6
2.3.2. I2C ................................................................................................... 7
2.3.3. WIFI ................................................................................................. 9
Chapter 3: METHODOLOGY ....................................................................................... 12
3.1. HARDWARE DESIGN ............................................................................... 12
3.1.1. System block diagram design ......................................................... 12
3.1.2. Circuit design and calculation ....................................................... 144
3.1.3. Hardware schematic ..................................................................... 388
3.2. SOFTWARE DESIGN ............................................................................... 400
vi


3.2.1. Introduce about BLYNK APP ...................................................... 400
3.2.2. Design the user interface ............................................................... 411
3.2.3. Flowchart ..................................................................................... 446
Chapter 4: EXPERIMENT RESULTS ........................................................................... 49
4.1. MODEL IMPLEMENTATION ................................................................... 50
4.1.1. Manual mode ................................................................................ 533
4.1.2. Automatic mode ........................................................................... 544
4.2. PLANTING EXPERIMENTS ON THE SYSTEM..................................... 555
Chapter 5: CONCLUSION AND RECOMMENDATIONS ........................................ 622
5.1. CONCLUSION ............................................................................................ 62
5.2. RECOMMENDATIONS ........................................................................... 622
REFFERENCES .......................................................................................................... 633
APPENDICES ............................................................................................................. 656

vii



LIST OF FIGURES
Fig. 2.1. Realistic closed garden model .......................................................................... 4
Fig. 2.2. Realistic opened garden model ......................................................................... 4
Fig. 2.3. Applications of the Internet of Things .............................................................. 5
Fig. 2.4. UART protocol format ..................................................................................... 6
Fig. 2.5. Transmission frame .......................................................................................... 6
Fig. 2.6. Receive Frame ................................................................................................. 7
Fig. 2.7. I2C connections ............................................................................................... 7
Fig. 2.8. Start(left) and Stop(right) condition ................................................................. 8
Fig. 2.9. I2C data transfer bit ......................................................................................... 8
Fig. 2.10. I2C address bit ................................................................................................. 8
Fig. 2.11. The master sends data to slave bit sequence ..................................................... 9
Fig. 2.12. The master reads data from slave bit sequence ................................................. 9
Fig. 2.13. Summary of Wi-Fi standards ........................................................................... 9
Fig. 3.1. Block diagram of the system ............................................................................ 13
Fig. 3.2. Honeycomb power supply................................................................................ 15
Fig. 3.3. LM2596 Buck Converter ................................................................................. 16
Fig. 3.4. The schematic of LM2596 Buck Converter ...................................................... 16
Fig. 3.5. Pin diagram of ESP32 Module ......................................................................... 19
Fig. 3.6. ESP32-CAM pinout ......................................................................................... 22
Fig. 3.7. DHT22 sensor pinout ....................................................................................... 24
Fig. 3.8. Soil moisture sensor ......................................................................................... 25
Fig. 3.9. Arduino CNC Shield V3 .................................................................................. 27
Fig. 3.10. Attach A4988 module to CNC shield and wire 2 step motors ......................... 28
Fig. 3.11. Module Stepper Motor A4988 schematic ....................................................... 29
Fig. 3.12. L298 Motor Driver Module ............................................................................ 29
Fig. 3.13. Schematic of L298 circuit .............................................................................. 31
Fig. 3.14. Relay module ................................................................................................. 32
Fig. 3.15. Servo motor pinout ........................................................................................ 32
viii



Fig. 3.16. How to control the motor's direction .............................................................. 33
Fig. 3.17. TP-43D2033 Step motor ................................................................................ 34
Fig. 3.18. DC pump motor ............................................................................................. 35
Fig. 3.19. 16x2 LCD ...................................................................................................... 36
Fig. 3.20. I2C converter module for LCD ...................................................................... 38
Fig. 3.21. The schematic diagram of the whole system .................................................. 39
Fig. 3.22. Blynk App working diagram .......................................................................... 41
Fig. 3.23. The application store of the two platforms on smartphones ............................ 41
Fig. 3.24. How to create an account on Blynk App ........................................................ 42
Fig. 3.25. Create a project and device ............................................................................ 42
Fig. 3.26. Enter auth token, user name and password of Wi-Fi to program..................... 43
Fig. 3.27. Where to add widgets ..................................................................................... 43
Fig. 3.28. Add the widget to the project ......................................................................... 44
Fig. 3.29. Configure the widget ...................................................................................... 44
Fig. 3.30. The information displayed on the App ........................................................... 45
Fig. 3.31. Flow chart of selection mode ......................................................................... 46
Fig. 3.32. Manual mode flow chart ................................................................................ 47
Fig. 3.33. Automatic mode flow chart ............................................................................ 48
Fig. 3.34. Flowchart of Image processing ...................................................................... 49
Fig. 4.1. Automatic Monitoring and Control System in Agriculture based on IoT ........ 51
Fig. 4.2. The system is covered by plastic film ............................................................. 51
Fig. 4.3. The system is not connected to the network ................................................... 51
Fig. 4.4. The system is connected to the network ........................................................ 52
Fig. 4.5. Camera captures live images .......................................................................... 52
Fig. 4.6. The sow seeds system is working ................................................................... 53
Fig. 4.7. MANUAL Configuration Mode ..................................................................... 54
Fig. 4.8. The garden is in ideal condition ..................................................................... 54
Fig. 4.9. Set the temperature and humidity ................................................................... 55

Fig. 4.10. The map of garden ......................................................................................... 56
Fig. 4.11. Select plant varieties ...................................................................................... 56
ix


Fig. 4.12. Select Auto mode and press the sow seed button ............................................ 57
Fig. 4.13. Seeding system is working ............................................................................. 58
Fig. 4.14. Water pump is working .................................................................................. 59
Fig. 4.15. Image of the garden after 36 hours of sowing ................................................. 60
Fig. 4.16. Image of the garden after 7 days of sowing .................................................... 61

x


LIST OF TABLES
TABLE 3.1. Parameters about power consumption of components ............................... 14
TABLE 3.2. LM2596 buck converter specifications..................................................... 18
TABLE 3.3. The pinout configurations of the ESP32 module ....................................... 19
TABLE 3.4. ESP 32 module specifications .................................................................. 21
TABLE 3.5. ESP 32 CAM specifications ..................................................................... 22
TABLE 3.6. OV2640 specifications ............................................................................. 23
TABLE 3.7. DHT22 specifications ............................................................................... 25
TABLE 3.8. Soil moisture specifications ...................................................................... 26
TABLE 3.9. Module steeper control A4988 specifications ........................................... 27
TABLE 3.10. Number of step control ............................................................................ 28
TABLE 3.11. Pin functions of L298 .............................................................................. 30
TABLE 3.12. L298 module technical specifications ...................................................... 30
TABLE 3.13. SG90 servo specifications ........................................................................ 33
TABLE 3.14. The step requirement to reach desire length ............................................. 37
TABLE 3.15. Water pump specifications ....................................................................... 37

TABLE 3.16. Functions of the LCD’s Pins .................................................................... 38
TABLE 3.17. I2C module specifications........................................................................ 40

xi


ABSTRACT
Currently, with the development of 4.0, products or systems that remotely monitor
and control smart gardens are becoming increasingly popular and appear to be necessary
tools for keeping the garden in the best condition. However, the market price of these
gadgets is rather costly, making them difficult to obtain for farmers. As a result, our team
created the " Automatic Monitoring and Control System in Agriculture based on IoT"
to meet the need to monitor the environmental parameters of the garden, ensuring that the
garden is always in the best condition, as well as cost more affordable to farmers and tree
enthusiasts.
The system has the following capabilities that can be controlled via a smartphone
app. Sensor data, device status, and camera images will be captured and continuously
updated to the App. The system has two operating modes: manual and automatic. In
MANUAL mode, users can actively control devices, turn them on and off as needed,
regardless of environmental conditions, such as watering plants, turning on lights, turning
fans on and off, and most importantly, selecting the sowing place and having the app
irrigate automatically. In AUTO mode, if the user activates the water pump or seeding
button, the system will automatically water or sow seeds at all pre-programmed positions.
In addition, the system also allows users to set temperature and humidity limits and from
there the devices will operate based on environmental parameters.
In this project, we tackle this problem by collecting data inside the greenhouse using
ESP 32 and ESP 32 CAM, sensors, and actuators, signal processing from the sensors using
programming, and controlling the actuator to keep the garden in the proper condition. After
that, the farmer can get real-time data on the smartphone. The operating model is relatively
stable, the operations on the application are easy, and the online image can be observed

through the Camera.

xii


Chapter 1: INTRODUCTION
1.1.

PROBLEM STATEMENT

According to estimation, world population could reach to 9,8 billion in 2050, it
would be 25% more than it is at the moment. Urbanization would be increasing in tendency
significantly in 2050, nearly 70% of world population are expected to be urbanize
(compared to 49%). Agricultural productivity must double by 2050 to support this big
metropolitan population [2]. Crop production will become equally vital to industry, not
only for food but crops such as cotton and rubber are also essential to the economies of
many countries. These demands place a further strain on already restricted agricultural
resources.
Internet of Things (IoT) is an important topic at the moment and the future of all
thing and it is now changing life of everyone by doing everything smarter. Internet of
Things is also known as a vast network in which any computer or practically anything with
an IP address is linked to the internet or to another in order to automate operations or
minimize human interaction smartphones, lights, watches, machine producing, cars, etc are
some examples. Beside its numerous benefits, there are three major issues with IoT is
privacy violations, over-rely on technology leading to job loss. [3].
The 4.0 industrial revolution offers a new approach to resolve this problem. By
developing the new green house using IoT, it will show a portrait of traditional agriculture
by enhancing plant productivity and minimize wasting crop. The goal of this idea is not
just revitalizing traditional farming methods but also to provide a solution for family home
garden. This product help farmers by collecting real-time data, monitoring the sensors and

controlling the actuators to take care of the garden. Precision plays a key role in agriculture
so that we could use the collected data from the sensors for analytics. [4].
IoT technology in agriculture also has drawbacks, such as Wi-Fi signal relying, for
example, if the system loses its connection with the Wi-Fi, the whole chain will be unable
to update the condition of the garden. Beside, people may want some personal space in
their lives so it is not easy to stay connected with family and friends but also provide them
with every aspect of their functioning. There is possibility that your data can be misused
and this is another downside of IoT [6]
As previously indicated, the farmer can only monitor and care for a limited number
of planted crops using themes such as the "Closed Garden System". By inheriting
foundation from the previous monitoring system. The system can display temperature,
humidity of th garden and control watering in closed range with smartphone. Our group
enhances it more in the situation when the connection is not available, user can set timer
for sprinkle to automatically water the garden. The "Design and making a closed garden
1


system" project describes a a garden system with a closed garden structure and irrigation
based on settings on the web interface.

1.2.

OBJECTIVES.

Research, design and manufacture “Automatic Monitoring and Control System in
Agriculture based on IoT with the following fundamental features:
 Research the theoretical basis of designing and constructing the garden.
 Research and analyze the planting seeds automation system.
 Design the seeding and watering system for each pre-programmed location, and
integrated camera to easily monitor the garden remotely via smartphone device.

 Developing an automatic system based on temperature, humidity, and soil moisture
monitoring.
 Designing the interface to monitor and control the devices on smartphones.
1.3.

METHODOLOGY.

The thesis conducted research on the references related to garden monitoring and
control systems to select the right system. Evaluate latest automated garden design
requirements. Learn and develop the right design for the intended use. Evaluate the results
of the simulation, conduct the actual modeling. Make final evaluation and improve design
results.
1.4.

LIMITATIONS.

The limitations of this project are:
 Using an ESP 32 as a controller, central microcontroller and a represent camera to
transmit photos is not a good idea since the signal transmission speed and signal
processing are quite slow and heavy depend internet bandwidth.
 The system is fully controlled via the app.
 The system responding depends on the strength of the Wi-Fi signal.
 Design a device’s model especially for educational purposes.
1.5.

RESEARCH CONTENT.

As a product that has the function of controlling devices remotely via the Internet,
for everyone especially for urban family. If there is a need to control and monitor their
garden


2


conveniently, they could use this product due to automatically doing all the work
such as: seeding, watering and monitoring all environment variables via smartphone. Users
can also set the condition for the system to work without having to get close to the system
each time they need to do something.
In order to design, construct efficiently and save money, the project has been
through these following research forms: reading documents related to microcontroller
programming to apply for writing programs on Arduino IDE, basic theory of electronics
for hardware design.

1.6.

THESIS REPORT OUTLINE.

The project’s report is arranged into 5 chapters:


Chapter 1: Introduction: general introduction about the topic, methodology, research
content, some facts relate to the topic in reality and introduce the quick view of content.
In addition, the thesis also presents the topic's objectives and limitations.



Chapter 2: Literature review introduce research status, research direction, services and
applications being used.




Chapter 3: Methodology: provides a general model of the system as a whole, the blocks
of the system, the design and calculation of each block, and the devices used in these
blocks.



Chapter 4: Experiment results: presenting the construction results of the system model



Chapter 5: Conclusion and recommendations: draw conclusions, strengths and
weaknesses. Present the plan of the topic in the future.

3


Chapter 2: LITERATURE REVIEW
2.1.

GREENHOUSE MODEL

Currently, our country has also applied and deployed many types of vegetable
growing system in greenhouses, in which the two main types are prominent:
Closed greenhouse: A house totally covered in plastic film on the roof and all around,
with plastic film on the doors as well. Used to shield against insects. In terms of design
with flat roof and slanted roof on both sides. The house frame is made of concrete columns
or welded or screwed iron frames. Plastic film is completely resistant to ultraviolet rays,
sunlight, wind ... so its durability is quite high [7]. Fig. 2.1 as below, depicts a realistically
closed garden.


Fig. 2.1.

Realistic closed garden model

Opened greenhouse type: A type of house that is only covered mainly on the roof
or partially surrounded, mainly to reduce the harmful effects of rain and wind to help
vegetables grow even in the rainy season. No insect repellant effect [8]. Fig. 2.2, describes
a realistically opened garden.

Fig. 2.2.

Realistic opened garden model

4


Although there are undeniable advantages, the above models still have many
limitations such as in the closed greenhouse type, it will create an environment with higher
temperature and humidity than outside, from which if there is no strict monitoring measure,
it will be easy to mold, etc. On the other hand, in the opened greenhouse, because it is not
covered well, it is easy for insects to attack. Moreover, the cost of installation and large
investment is often many times the cost of traditional farming methods. In addition, the
monitoring and supervision system is still manual, with practical experience, so it will be
difficult for those who do not have experience in farming.
With the above shortcomings, in this project, the assemblers will retain the advantages
of the above methods and partially overcome the existing shortcomings such as the cost
will be cheaper. Additionally, there is a monitoring mechanism, monitoring via the Internet,
so it will be easier for users to stay away from the garden.


2.2.

INTERNET OF THINGS (IoT)

The Internet of Things could be a network of physical devices. Kevin Ashton (1999)
from the Massachusetts Institute of Technology proposed this idea and defined it as a
network of things, including computers, mobile phones, refrigerators, doors, and cars
that connect with one another and share data over the web. There are similar technologies
that are closely associated with IoT like Machine-to-Machine, the web of Everything,
ubiquitous computing, and embedded Internet systems. Physical things must contain
microcontrollers and sensors so as to smartly connect with one another. These
microcontrollers and sensors will send data to an IoT cloud server that functions as a hub
for data exchange [9].
The Internet of Things (IoT) could also be a technology that connects people with
things and enables real-time communication and data exchange. It is accustomed to record,
analyze, and evaluate data important for decision-making or achieving target conditions.

Fig. 2.3.

Applications of the Internet of Things

5


The Fig. 2.3, depicts the applications of Internet of Things is currently being used
in a variety of fields, including measuring the amount of sunlight, temperature, and
humidity suitable for agriculture, turning home appliances on and off with a smart home
mobile application over the internet, monitoring the amount of water and biogas, as well
as activating fire alarms in animal farms, providing flood warnings, and recording data.
Furthermore, the Internet of Things is becoming increasingly compatible with

smartphones, which is increasing their popularity. Blynk, NETPIE, and Line Notify are
examples of smartphone applications that are simple to use and support the Internet of
Things.

2.3.

COMMUNICATION PROTOCOLS

2.3.1. UART
UART stands for Universal Asynchronous Receiver - Transmitter means
asynchronous serial data transmission. The UART's purpose is to transform incoming and
outgoing data into a serial binary stream. Serial to parallel conversion is used to transform
8-bit serial data from a terminal computer into parallel data, and serial to parallel
conversion is used to convert parallel data from the CPU. This data is in modulating form
and is transmitted at a specified baud rate.
 Protocol format
The UART initiates communication with a start bit of ‘0' as figure 2.4 describes.
The start bit initiates serial data transfer, and the stop bit terminates the data exchange. It
also has a parity bit (even or odd). The even parity bit is described by ‘0' (even number of
1's), while the odd parity bit is represented by ‘1' (odd number of 1's).

Fig. 2.4.

UART protocol format

 Transmission

Fig. 2.5.

Transmission frame


6


A single transmission line is used for data transmission (TxD) shows in Fig. 2.5
above. In this case, ‘0' denotes a blank space and ‘1' denotes a symbol condition. While
transmission, the LSB (Least Significant Bit) is often transmitted first. The transmitter only
delivers one bit at a time. Following the transmission of one bit, the next bit is transmitted.
As a result, all data bits are transmitted to the receiver at a predetermined baud rate. Each
bit would be transmitted with a slight delay. To send one byte of data at 9600 baud rates,
for example, each bit is sent with a 108 micro-second’s delay.
 Reception
The RxD line (Receiver) is used to receive data during reception is shown in Fig.
2.6. After reading the data frame, the receiving UART counts the number of bits with a
value of 1 and determines if the sum is an even or odd number. If the parity bit is a 0 (even
parity), the data frame's 1 bits can add up to an even amount. If the parity bit is a 1 (odd
parity), the data frame's 1 bits can add up to an odd amount.

Fig. 2.6.

Receive Frame

When the parity bit matches the data, the UART knows that the transmission was
free of errors. But if the parity bit is a 0, and the total is odd; or the parity bit is a 1, and the
total is even, the UART knows that bits in the data frame have changed.
2.3.2. I2C
The Inter-Integrated Circuit (I2C) Protocol is a protocol expected to permit
numerous "peripheral" digital coordinated circuits ("chips") to interface with at least one
"regulator" chips shows in Fig. 2.7. I2C requires two wires, as asynchronous serial,
however I2C can support up to 128 devices and accommodate a multi-controller

configuration, allowing multiple controllers to interface with any of the bus's peripheral
devices.

Fig. 2.7.

I2C connections

7


The SCL and SDA signals make up each I2C bus. SDA stands for data and SCL
stands for clock. The current bus controller generates the clock signal at all times; certain
peripheral devices can push the clock low to prevent the controller from transmitting
additional data.
 Interfacing condition
The start and stop sequences are unique in that they are the only times when the
SDA (data line) will shift while the SCL (clock line) remains high as illustrated in the Fig.
2.8. SDA must stay constant and not shift when SCL is high as data is being transmitted.
The start and stop sequences indicate when a contract with the slave system begins and
ends.

Fig. 2.8.

Start(left) and Stop(right) condition

 Data transferring
For every 8 bits transmitted, each 8bit byte of data requires 9 SCL clock pulses to
transmit. If the receiving device returns a LOW ACK bit, it has received the data and is
ready to accept the next byte as shown in Fig. 2.9.


Fig. 2.9.

I2C data transfer bit

If it responds with a High-level bit, it means it cannot take any more data and the
master should stop the transfer by sending a stop sequence.

Fig. 2.10.

I2C address bit

Normally, I2C addresses is 7 bits but the master still sends 8 bits when sending the
7-bit address. The extra bit informs the slave whether the owner is writing to it or reading
8


from it. If the bit is set to 0, the master is sending data to the slave. The master is reading
from the slave if the bit is set to 1. The 7-bit address is put in the upper 7 bits of the byte,
and the Read/Write (R/W) bit is located in the lower 7 bits (Least Significant Bit).

Fig. 2.11.

The master sends data to slave bit sequence

Bit R/W is set to LOW so master sends data to slave at 0xC0 which is illustrated in Fig. 2.11
above.

Fig. 2.12.

The master reads data from slave bit sequence


Bit R/W is set to HIGH so master reads data to slave at 0xC1 as shown in Fig. 2.12.
2.3.3. WIFI
Defined by an IEEE (Institute of Electrical and Electronics Engineers) technology
organization. It's a numbering system that's used to classify and unify a common standard
for many different technical protocols. The four common standards of Wi-Fi today are
802.11a/b/g/n [10].
Fig. 2.13 below, is a summary of all Wi-Fi standards from 1999 to 2019, a summary
of the Wi-Fi standard name, release year, frequency, speed, indoor and outdoor range of
each Wi-Fi type.

Fig. 2.13.

Summary of Wi-Fi standards
9


×