Sung 2020
Sung 2020
IoT-Based Home Care System with a FPGA Development Board by Using RS-485
Interface and Verilog HDL
Abstract—This paper presents the packet processing and achieve the transmission of equipment information is a
transmission of a field programmable gate array (FPGA) crucial topic of research [1]. IoT developers prefer visual
development board by using an RS-485 interface module and interface development tools. When a field programmable
Verilog HDL. The proposed communication protocol was gate array (FPGA) development board is used, information
established between the sensors in the sensing layer and web
collected by devices of various manufacturers can be easily
server. In the sensing layer, the sensor system, which comprises
a temperature sensor, warning light, and fan, controls the integrated into a common communication tool and used in a
environment temperature. An attractive Internet of Things home care system. The rest of this paper is organized as
application system was proposed to simultaneously monitor follows. The system design of the IoT technology and its
real-time temperature information through wireless architecture, its implementation with the FPGA
communication and the webpage. Node-RED software was development board, and the web server are presented in
used to develop the home care system because of its advantages Section II. Section III explains the implementation of the
in facilitating management and maintenance. The linkage system using Node-RED software. Section IV presents the
function was written in the JavaScript language on Node-RED verification of the care system developed using the FPGA
software. In the designed system, when the temperature
development board and measured results. Section V
reaches the preset value, the fan and warning light
automatically turn on and a notification email is sent to the presents conclusions.
user. The measurement results showed that the throughput
II. SYSTEM DESIGN OF IOT TECHNOLOGY
and conversion time were 0.00958 Mbps and 283.83 ms,
respectively, at a clock frequency of 1 MHz and Baud rate of An IoT home monitoring system with an FPGA
9600 bps. development board was constructed using a temperature
sensor (DS18B20) paired with the RS485 interface [2]. The
Keywords-Field programmable gate array (FPGA) system architecture consists of four parts. The first part
development board, home care system, Internet of Things (IoT),
comprises sensors. The second part consists of the gateway,
JavaScript, Node-RED software, RS-485 interface.
which in this case is an Altera FPGA development board for
enabling communication between the sensors and virtual
I. INTRODUCTION server. The third part is the virtual server, which provides
True compact Internet of Things (IoT) products have not many services for the IoT system. The final part is the
yet been realized because most smart home products application or webpage, which controls the device (e.g., fan
comprise simple sensors and rather than advanced or warning lights) through a mobile phone or web browser.
technological products. If products of different brands are Fig. 1 illustrates the architecture of the IoT-based home care
integrated into smart homes, then the user is not assured that system.
the products will function as desired. Furthermore, most Server
smart home products are developed to possess a smart IoT RMM VM VM VM
Authorized licensed use limited to: Central Michigan University. Downloaded on May 14,2021 at 17:46:24 UTC from IEEE Xplore. Restrictions apply.
The operating principle of the proposed IoT-based home The operating principle of the MQTT broker service can
care system is as follows: sensing information, also called be described as follows: First, the subscriber subscribes to
the sensor’s packet, is connected to the I/O port of the the topic of the message to be received from the broker.
FPGA development board through a wire. The packet Next, the publisher is responsible for sending the message
timing process transforms the parallel data packet into serial with information of the topic. Finally, the message is
data, which are displayed on the seven-segment display of published to the broker and then posted to the subscriber.
the FPGA development board. After the temperature has Fig. 3 depicts the operational diagram of the MQTT service.
been verified, the real-time data are sent to the web server In addition to publishing and subscription, MQTT also
through the designed RS-485 interface. RS-485 monitoring provides three types of message delivery services [3],
software is used to ensure the reception of the temperature namely QoS 0, QoS 1, and QoS 2. QoS 0 is a function of “at
data, which are then presented on the seven-segment display. most once” and is prone to message loss or delivery failure.
Next, Node-RED software, which is provided by IBM If the connection is confirmed, then the transmission control
Emerging Technology, Armonk, New York, USA, is used to protocol (TCP) can ensure that the message packet can be
develop the link function to integrate sensing devices into an delivered to the destination. The open system
IoT-based home care system. interconnection model has seven layers, with the MQTT
After the sensing data are transmitted to the web server, service belonging to the application layer. The packet is
the received data are sent to the database for access handled by the TCP in the next layer. That is, the MQTT
operation through MQTT. The graphical management service can be guaranteed in the application layer, whereas
interface can be used to simultaneously view the stored data the MQTT service cannot be confirmed in the TCP layer.
and display it on the web page. Fig. 2 depicts the flowchart Thus, confirming whether the network connection is
of the IoT-based home care system. successful is unnecessary; the next sensing data are received
immediately. The QoS 0 service is highly suitable for use in
Start
home care systems.
FPGA data
Information regarding the sensor package of the home
processing and care system is transmitted through the FPGA development
RS485 module board to the web server through universal asynchronous
transfer packet receiving transmitters (UARTs), such as RS-232, RS-449,
Seven-segment
RS-423, and RS-485. Through maintenance of the data
Detect current Save parameters
environmental
display shows into database transmission line at a high level (1), the received data are
conditions
temperature preserved. If the start bit of the transmission line is pulled
value
down to a low level (0), the preserved data are transmitted
View through by time sharing, and transmission ceases after a specified
webpage
No Temperature Modbus RTU period of time. Notably, these data are serial data. If the 8-
> 28°C (Serial port) bit data have been sent out, then the last bit, known as the
YES stop bit, is received, and the transmission line is pulled
down to the low level (0). Fig. 4 depicts the transmitted data
Turn on the Fan of the standard asynchronous serial data transmission [4].
Open MQTT Broker
and Warning LED
The data comprise a 1-bit start bit, an 8-bit datum, a 1-bit
parity bit, and a 1-bit stop bit.
The hypertext transfer protocol (HTTP) is a vital
Publish parameters
Email service
to MQTT broker standard for requests and responses between the client and
server (website), which uses TCP/Internet protocol at the
transport layer. The HTTP can be implemented on any
Fig. 2 Flowchart of the IoT-based home care system.
Internet protocol or other networks to send a request
(Request) to the server. The server will send the data back to
the web browser. The HTTP message is typically sent to and
from the web browser through the 80 port or 443 port
(Secure http). For web servers, HTTP is used for web page
requests and pushbacks, as depicted in Fig. 5 [5].
Start
Bit Parity Stop
D0 D1 D2 D3 D4 D5 D6 D7 Bit Bit
(Low)
(High) (High)
Fig. 4 Transmitted data of the standard asynchronous serial data
Fig. 3 Operation diagram of the MQTT service. transmission.
3371
Authorized licensed use limited to: Central Michigan University. Downloaded on May 14,2021 at 17:46:24 UTC from IEEE Xplore. Restrictions apply.
A. Get Device Data (Function (1))
Web Server
The temperature sensor (DS18B20) creates a data field in
Port 443 the remote monitoring and management (RMM) server,
Web stores data in the field, and extracts the sensor’s real-time
Browser data through the device ID and field name of the EIS-DK10
mini server. The data are arranged in JSON format.
Web Server
B. Parse Sensor Data (Function (2))
Port 80 After obtaining the temperature sensor data, a JSON node
is added to ensure that the data are in the JSON format. The
Fig. 5 HTTP is used in port 80 or in port 443 for web page requests and function of Parse Sensor Data are to parse the data from the
pushbacks. JSON node for error; if the data format is wrong, then the
data cannot be moved to the next step.
III. SYSTEM IMPLEMENTATION WITH NODE-RED
SOFTWARE C. Threshold Setting (Function (3))
In this study, Node-RED IoT development software was After the data format has been parsed and the data have
used to construct the home monitoring environment. Node- been confirmed to be free from error, the data are sent to the
RED receives the data processed by the development board judgment type for comparison. The system assumes that the
through the RS485 UART interface. Next, the data access normal temperature is 28 °C. If the sensed temperature
and all linked functions are written in JavaScript on Node- exceeds the preset temperature, then the control switch
RED software. As depicted in Fig. 6, the linkage function selects ON and turns on the fan and warning light
includes three categories, namely temperature, fan, and light. simultaneously; if the sensed temperature is lower than the
When the sensed temperature reaches the preset value, the preset temperature, then the control switch selects OFF.
fan and warning light are turned on automatically and a D. Temperature-Controlled Fan and Light-Emitting Diode
warning email is sent to the user. Conversely, if the (Function (4))
temperature is lower than the preset value, then the fan and
When the sensing temperature is higher than the preset
warning light are turned off automatically and a cancellation
value, a switch-controlled request is made to the RMM
message or email is sent to the user. Fig. 6 depicts the
server to change the state of the fan to true (1) and turn on
temperature-controlled fan and warning light with Node-
the warning light. Conversely, if the sensing temperature is
NEW software. Functions (1), (2), (3), and (4) denote the
lower than the preset value, then a switch-controlled request
device’s data, parsing sensor data, the setting threshold, and
is made to change the fan state to false (0). In addition, a
the temperature-controlled fan and light, respectively. The
notification email is sent to the user regarding the status of
node flow was established using Node-RED software,
the fan and the warning light. The node flow of the email
whereas the functional diagram was completed in JavaScript.
service with the short message is depicted in Fig. 7.
3372
Authorized licensed use limited to: Central Michigan University. Downloaded on May 14,2021 at 17:46:24 UTC from IEEE Xplore. Restrictions apply.
Fig. 7 Node flow of the email service with a short message.
3373
Authorized licensed use limited to: Central Michigan University. Downloaded on May 14,2021 at 17:46:24 UTC from IEEE Xplore. Restrictions apply.
for achieving complete home environment monitoring and
providing a human–machine interface system. Furthermore,
a FPGA development board was used to enable
communication in the sensing, network, and application
layers. The main contribution of this system integration is
not only to reduce hardware devices but also to facilitate
system maintenance with easy debugging. Furthermore, the
real-time sensing data and the current status of the linked
device can be viewed through the webpage and used to
control the devices. JavaScript software was used to design
the system program, homepage, and subpage. Users can
monitor their devices at any time through mobile devices or
computers. Through integration of the designed Verilog
HDL codes into ASIC, a small and cheap IoT-based home
care system was implemented.
ACKNOWLEDGMENT
The authors would like to thank the Ministry of Science
Fig. 10 Measurement on the FPGA platform.
and Technology, R.O.C., for financially supporting this
research under Contract MOST 108-2221-E-027-092. They
are grateful to the Chip Implementation Center, Taiwan, for
fabricating the test chip. This manuscript was edited by
Wallace Academic Editing.
REFERENCES
[1] S. K. Vishwakarma, P. Upadhyaya, B. Kumari, and A. K. Mishra,
“Smart energy efficient home automation system using IoT,” in Proc.
4th International Conference on Internet of Things: Smart Innovation
and Usages (IoT-SIU), Ghazizbad, India, 18-19 April 2019, pp. 1-4.
[2] G. M. Sung, Y. S. Shen, and J. H. Hsieh, “ Internet of Things–based
smart home system using a virtualized cloud server and mobile phone
app,” International Journal of Distributed Sensor Networks, Vol. 15,
no. 9, pp. 1-13, 2019.
[3] S. Spinsante, G. Ciattaglia, A. D. Campo, D. Perla, D. Pigini, G.
Cancellieri, and E. Gambi, “A LoRa enabled building automation
architecture based on MQTT,“ in Proc. AEIT International Annual
Conference, Cagliari, Italy, 20-22 Sept. 2017, pp. 1-5.
[4] V. A. Desnitsky, I. V. Kotenko, and S. B. Nogin, “Detection of
anomalies in data for monitoring of security components in the
Fig. 11 Graphical interface of the webpage.
Internet of Things,” in Proc. XVIII International Conference on Soft
Computing and Measurements (SCM), St. Petersburg, Russia, 19-21
Next, the web server was designed using the Node.js May 2015, pp. 189-192.
software, which is a source code based on the Chrome V8 [5] A. N. Ansari, M. Sedky, N. Sharma, and A. Tyagi, “An Internet of
things approach for motion detection using Raspberry Pi,” in Proc.
engine. Node.js can run JavaScript on the server side and International Conference on Intelligent Computing and Internet of
works with a cross-platform execution environment. Things, Harbin, China, 17-18 Jan. 2015, pp. 131-134.
Compared with the traditional PHP Apache, Node.js can [6] Z. Runjing, X. Hongwei, and R. Guanzhong, “Design of temperature
handle numerous requests on the web server side. Users can measurement system consisted of FPGA and DS18B20,” in Proc. 2011
International Symposium on Computer Science and Society, Kota
not only browse the environment data from sensors but also Kinabalu, Malaysia, 16-17 July 2011, pp. 16-17.
monitor the sensing devices through the setup web server. [7] H. Bhojwani, G. K. Sain, and G. P. Sharma, “Computerized Fuse Auto
Fig. 11 depicts the graphical interface of the webpage. A Changeover System with RS485 Bus Reporting & Multiple IOT
short icon of temperature is displayed on the webpage to Cloud Connectivity Avenues,” in Proc. 3rd Technology Innovation
Management and Engineering Science International Conference
ensure that the link function between the sensor and the (TIMES-iCON), Bangkok, Thailand, 12-14 Dec. 2018, pp. 1-5.
web server is functioning properly. Furthermore, a [8] R. K. Nath, R. Bajpai, and H. Thapliyal, “IoT based indoor location
graphical curve of the sensing temperature is displayed with detection system for smart home environment” in Proc. 2018 IEEE
respect to the sensing data. From the webpage, the user has International Conference on Consumer Electronics (ICCE), Las
Vegas, NV, USA, 12-14 Jan. 2018, pp. 1-3.
access to daily temperature variations. [9] J. K. Reena and R. Parameswari, “ A Smart Health Care Monitor
System in IoT Based Human Activities of Daily Living: A Review,”
V. CONCLUSION in Proc. 2019 International Conference on Machine Learning, Big
In this study, a novel IoT home care system was designed Data, Cloud and Parallel Computing (COMITCon), Faridabad, India,
India, 14-16 Feb. 2019, pp. 446-448.
3374
Authorized licensed use limited to: Central Michigan University. Downloaded on May 14,2021 at 17:46:24 UTC from IEEE Xplore. Restrictions apply.