Sie sind auf Seite 1von 6

NodeMCU12e + Shield Base with Tft Nextion an

Experiment for IoT Projects

Antonio Carlos Bento


Universidade Nove de Julho
Computing Science Dept
São Paulo, Brazil
acb01@hotmail.com

Abstract— This article presents the results of an experiment of methods and materials should be presented the scientific
with devices developed for the Internet of Things with the devices research methods used during the project, as well as technical
NodeMCU12e and Nextion, because it is an emerging technology, details on the materials.
it is perceived the rapid growth in the development of projects
that intend to collaborate with human activities, carried out In the topic of results and discussions, the results of the
daily, facilitating the control and monitoring activities, or even experiment should be presented, demonstrating how the
individuals, such as patients, people with special needs, the process was carried out, the device configurations and
elderly, children. Due to this rapid growth, there is still a lack of programming code lines, discussing the main points that
content in academic materials that can contribute to new studies served as a basis for the study, besides presentation of a real
on the subject. The results presented with this project guide the solution, which may serve as a basis for future studies.
development of new projects, more complex and robust,
contributing to the academic and technical knowledge related to
II. BIBLIOGRAPHY REVIEW
automation and robotics.
The basis of the IEEE was the main source of research for
Keywords—IoT; NodeMCu12e; Nextion; internet; display the development of this manuscript, since it is an
internationally known information base, being used mainly by
I. INTRODUCTION scientific and technical means, representing the large amount
of academic research materials, collaborating with workshops,
As a general objective, this article presents the results of an congresses and various events on issues involving electronics,
experiment on the use of the internet of things, considering networks, communications equipment and devices, among
interface devices such as the Nextion display, a NodeMCU12e other baselines such as robotics and automation.
type controller, these devices being very common in the
international market, having low cost and simple often used in Coo reinforces CERP [8] and ITU-T [16], the Internet of
automation and robotics projects. Things is present daily in people's lives, several systems,
companies and services use resources for integration and
With the rapid and constant evolution of technical projects communication between devices at a distance, thus facilitating
for the Internet of Things, the motivation for the development monitoring and control of activities, as well as the automation
of this work is related to personal and professional experience, of processes, performed by machines or equipment, such as in
during classes and trainings for students of computers and smart homes, security and control services.
systems, due to the identification of absence of academic
materials that can serve as a basis for studies and guidance to The works presented by Bento [5], show the results of
students. studies in which devices were used for the Internet of Things,
making comparisons and evaluating the results by experiments
The Internet of Things as explained by CERP [8], IoT that can collaborate for the creation of academic and
[16] and Gartner, is a communication network that allows the professional projects, being this one of the parties that involve
connection of things, or objects that are normally used daily the results of projects developed for automation and robotics
by people, this is possible due to the use of small devices that classes.
can be connected to the objects, performing an automation
process, interconnected by a network communication, which During the researches at the IEEE bases, it was possible to
can be by radio, or the internet. perceive the lack of significant contents that can collaborate
with the development of scientific research projects, in this
This manuscript is divided as follows considering the titles way, this work becomes a contribution to the IEEE knowledge
of each phase of the research method, in the topic of base, being part of a more robust content that can be used by
bibliographic review, the study materials are presented, such different types of professionals and students.
as review of scientific literature, documents, manuals,
academic articles, discussions in technical forums. In the topic
Considering the studies on the internet of things we used In addition to the NodeMCU12e devices and the Nextion
the documents, articles and manuals presented by the authors: display, as accessories were used, connection cables,
connectors, Usb cables, Usb adapters, also considering a
[1] A. Å kraba; A. Koložvari; D. KofjaÄ ; R. notebook with Windows 10 64bit to develop the algorithm that
Stojanović; V. Stanovov; E. Semenkin, [2] A. Škraba; A. was used for communication between devices, the notebook
Koložvari; D. KofjaÄ ; R. Stojanović; V. Stanovov; E. was also used for the creation and adaptation of the screen to
Semenkin, [5] Bento A. C., [6] Bento, A. C., [7] Bento, A. C, the display.
[19] L. Shkurti; X. Bajrami; E. Canhasi; B. Limani; S.
Krrabaj; A. Hulaj, [18] L. K. P. Saputra; Y. Lukito, [21] M. As a software, the Arduino IDE was used, being it
Edward; K. Karyono; H. Meidia compatible with the NodeMCU, basically using the C ++
programming language, for the development of the
touchscreen screens for the Nextion device, the ITEAD
Up the device NodeMCU12e and Nextion were used Nextion editor software was used, providing more facility for
materials made available by: [3] A. George; H. the development of the interface, to transfer the projects
Dhanasekaran; J. P. Chittiappa; L. A. Challagundla; S. S. developed in the editor installed on the computer to Nextion
Nikkam; O. Abuzaghleh, [4] Arduino, [8] CERP, [9] D. Deif; device.
Y. Gadallah, [10] D. P. Shah; P. G. Shah, [11] F. Restuccia;
S. D’Oro; T. Melodia, [12] G. De Masi, [13] G. Li; J. IV. RESULTS AND DISCUSSIONS
Wu; J. Li; K. Wang; T. Ye,, [16] ITU-T, [17] L. Chen; P.
Zhou; L. Gao; J. Xu, [20] M. Chernyshev; S. Zeadally; Z. The results of this analysis presented the different
Baig; A. Woodward, [22] M. Zhang; W. Leng; Y. Ding; C. characteristics and configurations for the devices, due to the
Tang, [23] R. Ranjan; O. Rana; S. Nepal; M. Yousif; P. rapid evolution and development of new products. in the
James; Z. Wen; S. Barr; P. Watson; P. P. Jayaraman; D. market in general.
Georgakopoulos; M. Villari; M. Fazio; S. Garg; R. Buyya; The controllers developed for devices used for the Internet
L. Wang; A. Y. Zomaya; S. Dustdar, [24] S. Barai; D. of Things usually have low prices, reduced storage capacity
Biswas; B. Sal, [25] S. M. Brundha; P. Lakshmi; S. and memory, and are small in size as they are usually used as
Santhanalakshmi, [26] Z. A. Solangi; Y. A. Solangi; S. part of larger devices such as robots, boxes of control,
Chandio; M. bt. S. Abd. Aziz; M. S. bin Hamzah; A. Shah Internet, being one of its basic characteristics the
communication, or having some type of connection for
communication.
Considering the subject Nextion: [5] Bento A. C., [6]
Bento, A. C., [7] Bento, A. C, [14] Itead. Studio, [15] The NodeMCU12 is characterized as a type of controller
IteadLibNextion, for other devices, with the advantage of having a WiFi
communication system already built into the equipment,
unlike Arduino [4], which despite having a low cost, has no
WiFi feature, the memory has lower capacity and processing
III. METHOD AND MATERIALS is low, these are important points to be considered in a project
as this can affect the performance of the devices.
The method used in this material is the experimental
research method, usually applied in technical research, which The NodeMCU12e has a Shield Base, which is nothing
considers the use of techniques and devices for the validation more than a module to expand its capabilities, allowing to
of hypotheses about problems involving scientific research, increase the number of pins, facilitating the coupling of more
this method is also known as technique research applied, devices than the normal module, and better features for power
considering the various elements that involve the research control, Shield Base also facilitates the distribution and control
model. of new devices in an integrated and centralized way,
facilitating the development of solutions.
First, a bibliographic survey was carried out in the IEEE
databases, considering the key words of this document,
mainly: IoT, NodeMCU, Nextion. During the bibliographic
research it was noticed the absence of the keywords,
especially the word Nextion, not found in the IEEE database,
presenting an opportunity for the development of new research
on this subject.
As an analysis of the materials was developed an analysis
on the Internet of things, evaluating their devices and
applications, among the studies developed were considered
NodeMCU devices, this being a control usually used for the
development of projects for the Internet of Things, the
Nextion device was also considered due to simple tests and
configurations.
Fig. 1. Module NodeMCU12e CP2102.
The NodeMCU12e works with features of the ESP8266, Although the NodeMCu12 already has many connections
which is an integrated WiFi controller, some advantages of with extra pins, it is usually necessary to expand its resources
this module include: large data storage capacity, integrated to larger projects, increasing its capacity to connect with other
WiFi, large processing capacity, multiple connection pins for devices, allowing a better control of energy and balance with a
extra devices, which can be coupled to the enabling you to heterogeneous system, this of course will depend on the
extend your capabilities by increasing your capacity. It is an complexity of the project being developed, at the same time
evolution of the ESP8266 module, which allows connection to one can even use more than one controller, communicating
WiFi network, but in isolation, needed to have an external between them.
controller.

Fig. 4. Shield base for NodeMCU12e CP2102 pins schema.

As shown in Fig. 4, the NodeMCU with Shield Base


provides an increase in its connection capacity, as well as
Fig. 2. Pin schema for the module NodeMCU12e CP2102. providing better control for the different types of devices that
can be incorporated into the project, centralizing the control
As shown in Fig. 2, the NodeMCU12e device has several and allowing a sharing of data, for example, when using
pins for extra device connections, for this project, the 5V pins, environment sensors, temperature sensors, RTC clocks, radio
which is the input pin for the energy, the Ground pin, used for communication components, and other types of display,
the power control together with the 5V pin, the D3 pin to be motors and mechanical parts can be incorporated.
used as the TX transmitter, the D4 pin to be used as the RX
receiver, the latter two must be connected to the Nextion
device.

Fig. 5. Nextion display 2.4” with accessories..

The display Nextion as it presents Bento [5][6][7], is a


modern device with very interesting characteristics for the
development of projects for the Internet of Things, a highlight
Fig. 3. Shield base for NodeMCU12e CP2102.
of its resources, is the possibility to create the screens with its
own editor, this software made available with the product,
allows the development of simple to very complex solutions,
adding speed and quality to the solution.
As shown in Fig. 5, the Nextion display has as accessories, power control. Fig. 7 shows the connections with the Nextion
a connector cable for power and data transmission and device, noting that the RX / TX pins must be connected in the
reception, also has an adapter for a Usb cable connection, reverse order to the controller, ie RX-> TX Nextion controller,
being used to transmit power between the computer, a 5V TX-> RX Nextion controller.
socket, with connection to micro usb.

Fig. 6. Nextion display 2.4” pins schema.

As shown in Fig. 6, the Nextion display has only 4 cables,


Fig. 8. Nextion display 2.4” pins schema.
thus saving connection pins in the controller, unlike other
models which require a larger number of pins, with 1 5V cable Figure 8 shows the development screen for the Nextion
(red) for power connection in set with the Ground cable display projects with the ITEAD Nextion editor [15], for this
(black), the yellow cable is the TX cable, and the blue cable is project we used 9 objects, a page type object, which will
the RX cable. contain the main page of the project, two textbox objects,
The Nextion [14] device also has a coupling for a which must be used only as a label for the values HH (Hour),
MicroSD card, which is required to transfer the project that MM (minutes), two other objects of the numerical type for
has the screens, which must be built in the Compaq Pesario presentation of the values, 4 objects of the button type, which
notebook, then the project is compiled and transferred to the when pressed must update the numerical values. As a
MicroSD, Nextion display with the built-in MicroSD card, this complete project, a time input screen was developed to be
should upload the project with the screens, then the display is used to control the reception time of some data sent by a
restarted and the screen is updated. temperature sensor, oximeter, and also used to generate
control reports.
It is very important to note in this part of the project how
connections are being made, the location of use and the power
cables, since any configuration other than those recommended
by the manufacturers may damage the devices and cause some
kind of accident, such as fire , destruction of devices among
other electrical problems.
Another important factor for observation is the Nextion
device layout type that should be used for the creation of the
project, because if the project is developed with a screen
layout and then there is a need to change layout, such as in a
horizontal layout, that at the end of the project there was a new
decision to change to a vertical layout, this will lead to drastic
changes, which may cause a rework to the construction of the
screen, since the objects should occupy spaces different from
those initially defined.
The algorithm presented below was developed with the
Arduino IDE software, which needs some initial
Fig. 7. Shield base + NodeMCU12e with Nextion Tft schema..
configurations as it presents in Bento [5], with the devices
properly configured according to the manufacturer's manuals,
As previously demonstrated, the NodeMCU12 coupled to it is necessary to make the configuration of the devices, it was
the Shield Base allows to expand your connection capabilities, installed the Nextion device drivers, and used some algorithm
mainly to share the power resources between different examples to build this solution.
connected devices, with the extra pins you can connect more The algorithm should be divided into 3 phases, the main
than one device at the same input or output, another advantage phase is where the device libraries should be loaded, in the
is the coupling of motors for automation, and extra outputs for second step called Setup, libraries, devices and their
connection ports must be loaded, as well as other objects used 26- int v1;
in the project, in step 3 the Loop is executed, in which the 27- v1=number1.getValue();
code is executed when the controller is started, in this step the 28- v1=v1+1;
controller is monitoring some action performed on the Nextion 29- number1.setValue(v1);}
device. 30- void btn2_callback(NextionEventType type,
INextionTouchable *widget){
31- int v2;
32- v2=number1.getValue();
33- v2=v2-1;
34- number1.setValue(v2);}
35- void btn3_callback(NextionEventType type,
INextionTouchable *widget){
36- int v3;
37- v3=number2.getValue();
38- v3=v3+1;
39- number2.setValue(v3);}
40- void btn4_callback(NextionEventType type,
INextionTouchable *widget){
41- int v4;
42- v4=number2.getValue();
43- v4=v4-1;
44- number2.setValue(v4);}

Fig. 9. The complete project in operation.


Lines 1 to 5 load the libraries of the Nextion device, line 6
The following algorithm performs the sum of one digit sets the use of pins D3 and D4 for TX transmission and RX
when the Plus button is pressed, and subtracts a digit when the reception of the data, which must be transmitted during
Minus button is pressed, for both numeric values, the communication between NodeMCU12e and Nextion, line 7
operations are all controlled by the NodeMCU12e device, loads the Nextion object drivers, lines 8 through 14, load the
which checks if any button on the Nextion display screen has Nextion objects into variables to be controlled in the
been pressed, the algorithm can be incremented with other algorithm, lines 16 and 17 configure the communication speed
functions, or checks, for example. To check if the Hour field of the devices, by default 9600 is used.
has values up to 24, for the minutes field, it can be checked In lines 19 to 22, the functions are related to check if any
whether the value is between 0 and 60. buttons have been pressed, if any button is pressed the
01- #include <Nextion.h> function must be called for execution, in lines 23 and 24 the
02- #include <NextionPage.h> controller is in standby, waiting for some action on the
03- #include <NextionButton.h> teouchscreen, in lines 25 through 44, the functions that must
04- #include <NextionNumber.h> be executed according to the pressed button, adding a value to
05- #include <SoftwareSerial.h> the numeric field, or subtracting a value from the numeric
06- SoftwareSerial nextionSerial(D3, D4); // RX, TX field are displayed, in the same way the other buttons and their
07- Nextion nex(nextionSerial); actions are configured.
08- NextionPage pgButton(nex, 0, 0, "sensor"); This solution can be applied in different types of projects, such
09- NextionButton button1(nex, 0, 1, "b00"); as for temperature sensors, humidity, blood pressure,
10- NextionButton button2(nex, 0, 2, "b01"); oximeter, assisting in monitoring patients, objects, controlling
11- NextionNumber number1(nex, 0, 3, "n0"); machines, facilitating the configuration process for the
12- NextionButton button3(nex, 0, 4, "b0"); operator, can be added in designing different types of devices,
13- NextionButton button4(nex, 0, 6, "b1"); the Nextion display allows you to create solutions quickly,
14- NextionNumber number2(nex, 0, 5, "n1"); with excellent graphic results, such as those presented in this
15- void setup(){ study.
16- Serial.begin(9600);
17- nextionSerial.begin(9600); The results of this study may contribute to research
18- nex.init(); projects, or even be used in classes of automation or robotics,
19- button1.attachCallback(btn1_callback); as it may facilitate the control and configuration of the devices
20- button2.attachCallback(btn2_callback); used, it is possible to use this project to send data to the
21- button3.attachCallback(btn3_callback); internet, to create reports and remote control, reinforcing the
22- button4.attachCallback(btn4_callback);} concept of Internet of Things.
23- void loop(){
24- nex.poll();}
25- void btn1_callback(NextionEventType type,
INextionTouchable *widget){
Acknowledgment [13] G. Li; J. Wu; J. Li; K. Wang; T. Ye. (2018). Service Popularity-based
Smart Resources Partitioning for Fog Computing-enabled Industrial
Special thanks for all coleagues, relatives and students, Internet of Things. IEEE Transactions on Industrial Informatics, vol. ,
issue. Early Access, pp. 1-1, IEEE Early Access Articles, DOI:
which has contributed for the development of this statement. 10.1109/TII.2018.2845844
[14] Itead. Studio. Nextion Development Software and Informations.
https://nextion.itead.cc/
References [15] IteadLibNextion. Libraries and examples for Nextion devices.
https://github.com/itead/ITEADLIB_Arduino_Nextion
[16] ITU-T. (2012). Internet of Things Global Standards Initiative. Available
[1] A. Å kraba; A. Koložvari; D. KofjaÄ ; R. Stojanović; V. at: http://www.itu.int/ITU-T/recommendations/rec.aspx?rec=y.2060.
Stanovov; E. Semenkin . (2017) . Prototype of group heart rate [17] L. Chen; P. Zhou; L. Gao; J. Xu. (2018). Adaptive Fog Configuration
monitoring with NODEMCU ESP8266 . pp. 1 - 4 , 11-15 June 2017 , for the Industrial Internet of Things. IEEE Transactions on Industrial
IEEE Conferences , DOI: 10.1109/MECO.2017.7977151 Informatics, vol. , issue. , pp. 1-1, , IEEE Early Access Articles, DOI:
[2] A. Å kraba; A. Koložvari; D. KofjaÄ ; R. Stojanović; V. 10.1109/TII.2018.2846549
Stanovov; E. Semenkin . (2017) . Streaming pulse data to the cloud with [18] L. K. P. Saputra; Y. Lukito . (2017) . Implementation of air
bluetooth LE or NODEMCU ESP8266 . pp. 428 - 431 , 12-16 June conditioning control system using REST protocol based on NodeMCU
2016 , IEEE Conferences , DOI: 10.1109/MECO.2016.7525798 ESP8266 . pp. 126 - 130 , 8-10 Nov. 2017 , IEEE Conferences , DOI:
[3] A. George; H. Dhanasekaran; J. P. Chittiappa; L. A. Challagundla; S. 10.1109/ICON-SONICS.2017.8267834
S. Nikkam; O. Abuzaghleh. (2018). Internet of Things in health care [19] L. Shkurti; X. Bajrami; E. Canhasi; B. Limani; S. Krrabaj; A. Hulaj .
using fog computing. 2018 IEEE Long Island Systems, Applications and (2017) . Development of ambient environmental monitoring system
Technology Conference (LISAT), vol. , issue. , pp. 1-6, 4-4 May 2018, through wireless sensor network (WSN) using NodeMCU and “WSN
IEEE Conferences, DOI: 10.1109/LISAT.2018.8378012 monitoring†. pp. 1 - 5 , 11-15 June 2017 , IEEE Conferences , DOI:
[4] Arduino. 2018. Official Available at: https://www.arduino.cc 10.1109/MECO.2017.7977235
[5] Bento A. C.. IoT: NodeMCU 12e X Arduino Uno, Results of an [20] M. Chernyshev; S. Zeadally; Z. Baig; A. Woodward. (2018). Internet
experimental and comparative survey. International Journal of Advance of Things Forensics: The Need, Process Models, and Open Issues. IT
Research in Computer Science and Management Studies, v. 6, p. 46-56, Professional, vol. 20, issue. 3, pp. 40-49, May./Jun. 2018, IEEE Journals
2018. & Magazines, DOI: 10.1109/MITP.2018.032501747
[6] Bento, A. C.. IoT: Results of an Experimental Survey with Nodemcu, [21] M. Edward; K. Karyono; H. Meidia . (2017) . Smart fridge design
Nextion, DS1307 and NRF24L01+. International Journal of Current using NodeMCU and home server based on Raspberry Pi 3 . pp. 148 -
Innovation Research, v. 4, p. 969-974-974, 2018. 151 , 8-10 Nov. 2017 , IEEE Conferences , DOI:
[7] Bento, A. C.. IoT: Results of an experimental survey with NodeMCU 10.1109/CONMEDIA.2017.8266047
12e, TFT Nextion and RTC DS1307. International Journal of Advance [22] M. Zhang; W. Leng; Y. Ding; C. Tang. (2018). Tolerating Sensitive-
Research in Engineering, Science & Technology, v. 5, p. 6-14, 2018. leakage with Larger Plaintext-space and Higher Leakage-rate in Privacy-
[8] CERP. (2009). IoT – Internet of Thinsgs of European Research Cluster. aware Internet-of-Things. IEEE Access, vol. , issue. , pp. 1-1, , IEEE
Internet of things: Strategic Reserach Roadmap, Available at: Early Access Articles, DOI: 10.1109/ACCESS.2018.2842713
http://www.internet-of- [23] R. Ranjan; O. Rana; S. Nepal; M. Yousif; P. James; Z. Wen; S.
thingsresearch.eu/pdf/IoT_Cluster_Strategic_Research_Agenda_2009.p Barr; P. Watson; P. P. Jayaraman; D. Georgakopoulos; M. Villari; M.
df Fazio; S. Garg; R. Buyya; L. Wang; A. Y. Zomaya; S. Dustdar.
[9] D. Deif; Y. Gadallah. (2018). Reliable wireless sensor networks (2018). The Next Grand Challenges: Integrating the Internet of Things
topology control for critical internet of things applications. 2018 IEEE and Data Science. IEEE Cloud Computing, vol. 5, issue. 3, pp. 12-26,
Wireless Communications and Networking Conference (WCNC), vol. , May./Jun. 2018, IEEE Journals & Magazines, DOI:
issue. , pp. 1-6, 15-18 April 2018, IEEE Conferences, DOI: 10.1109/MCC.2018.032591612
10.1109/WCNC.2018.8376992 [24] S. Barai; D. Biswas; B. Sau . (2017) . Estimate distance measurement
[10] D. P. Shah; P. G. Shah. (2018). Revisting of elliptical curve using NodeMCU ESP8266 based on RSSI technique . pp. 170 - 173 ,
cryptography for securing Internet of Things (IOT). 2018 Advances in 4-6 Dec. 2017 , IEEE Conferences , DOI:
Science and Engineering Technology International Conferences (ASET), 10.1109/CAMA.2017.8273392
vol. , issue. , pp. 1-3, Feb. 6 2018-April 5 2018, IEEE Conferences, [25] S. M. Brundha; P. Lakshmi; S. Santhanalakshmi . (2017) . Home
DOI: 10.1109/ICASET.2018.8376830 automation in client-server approach with user notification along with
[11] F. Restuccia; S. D’Oro; T. Melodia. (2018). Securing the Internet efficient security alerting system . pp. 596 - 601 , 17-19 Aug. 2017 ,
of Things in the Age of Machine Learning and Software-defined IEEE Conferences , DOI: 10.1109/SmartTechCon.2017.8358441
Networking. IEEE Internet of Things Journal, vol. , issue. , pp. 1-1, , [26] Z. A. Solangi; Y. A. Solangi; S. Chandio; M. bt. S. Abd. Aziz; M. S.
IEEE Early Access Articles, DOI: 10.1109/JIOT.2018.2846040 bin Hamzah; A. Shah. (2018). The future of data privacy and security
[12] G. De Masi. (2018). The impact of topology on Internet of Things: A concerns in Internet of Things. 2018 IEEE International Conference on
multidisciplinary review. 2018 Advances in Science and Engineering Innovative Research and Development (ICIRD), vol. , issue. , pp. 1-4,
Technology International Conferences (ASET), vol. , issue. , pp. 1-6, 11-12 May 2018, IEEE Conferences, DOI:
Feb. 6 2018-April 5 2018, IEEE Conferences, DOI: 10.1109/ICIRD.2018.8376320
10.1109/ICASET.2018.8376837

Das könnte Ihnen auch gefallen