ESP32 Based Data Logger
ESP32 Based Data Logger
259-267
ISSN 2320–088X
IMPACT FACTOR: 6.199
Abstract— Data logger is an important realization of any measurement and instrumentation system. The
developed data logger can be used in several measurement chains such as smart home applications and IIOT
(Industrial Internet Of Things). The development of such data logger can be achieved by measuring several
physical quantises such as temperature, humidity and position. The sensors readings are monitored by client
software running in widely used Internet browsers. The main advantage of the design is the creation of a
useful and important wireless based measurement system for any type of physical parameters monitoring.
The ESP32 microcontroller system is used to record data from several sensors and the measurements are
transmitted via Wi-Fi to client server.
I. INTRODUCTION
The main purpose of single-chip microcontrollers is the implementation of digital control algorithms. The
functioning of the microcontroller in the control system lies in the fact that it, receiving information from the
control object about its condition, processes it in accordance with the algorithm stored in the program memory
and issues control actions to the actuators. The interaction of the microcontroller with sensors and actuators is
determined by the corresponding exchange protocols, considering the features of the functioning of the system
and the requirements of software and hardware and circuit compatibility with other devices and systems.
The use of MC in equipment allows to increase productivity, quality, helps to solve complex problems of
program regulation, significantly improves the technical and economic characteristics of automated equipment,
increases its "intelligence".
To process analog and digital signals, a large range of microcircuits has been developed, among which
generators, amplifiers, analog-to-digital and digital-to-analog converters, modulators, comparators, current and
voltage switches, sampling and storage elements, filters, central processor elements, control devices I / O,
programmable serial and parallel interfaces, direct memory access controllers, trunk transceivers, microprogram
control units, priori memory interruptions, multifunction synchronization devices, programmable timers, etc.
Most of the circuits and devices listed are functional components of microprocessor kits, largely defining the
architecture of microcomputers. However, almost any microcomputer, in addition to the main functional LSIs,
contains a significant number of microcircuits of medium and low degree of integration.
In the framework of this work, a data logger system is developed. This development aims at introducing the
principles of data logging using ESP32.
In recent years, when developing measurement systems of various types and levels of complexity, more and
more attention has been paid to microcontroller technology. This is due to its rapid development and a wide
range of products offered. Using microcontrollers allows you to design devices with qualities such as small
dimensions, relative low cost, simplicity and reliability, compatibility with a personal computer through
standard interfaces.
When developing a device, it becomes necessary to choose a microcontroller that meets the requirements for
performance, reliability, application conditions, etc.
The choice of a microcontroller is one of the most important decisions on which the success or failure of an
entire project depends. When choosing a microcontroller, there are numerous criteria.
The main goal of this work is to choose a microcontroller with a minimum price (to reduce the total cost of the
system), but at the same time satisfying the system specification, i.e. performance requirements, reliability,
application conditions, etc. The total cost of the system includes everything: engineering research and
development, production (components and labor), warranty repair, updating, maintenance, compatibility, ease of
use, etc.
The second step is to find microcontrollers that satisfy all system requirements. It usually includes a selection of
literature, technical descriptions, and technical business journals, as well as demonstration consultations.
The last stage of the selection consists of several stages, the purpose of which is to narrow the list of acceptable
microcontrollers to one. These steps include analysis of price, availability, development tools, manufacturer
support, stability and availability of other manufacturers.
This project aims to develop a microcontroller data logger system. When performing the development of the
MC, it is first necessary to develop a structural diagram of the data logger, determining the necessary structural
modules and the relationships between them. Next, a choice of a specific element base is made, and on the basis
of the structural diagram, a circuit diagram of the MPS is developed.
After the development of the circuit diagram, the check of the coordination of the elements by electrical
parameters is performed.
In work [3], the author presents a logger in which a temperature sensor (DS18B20) is connected to Esp32 and an
E-paper screen is used to display the readings. The sensor will measure the temperature every 5 seconds and
save it in the data logger then display it on the screen. The circuit consists of DS18B20 Sensor, E-Paper display,
ESP32, Keypad.
In work [4], the authors present a data logger system in which the readings of several sensors are sent to be
published with Google Sheets using ESP32 board.
In work [5], the author presents a data logger based on ESP32. A memory is used to store the reading of a
simple AVO meter circuit.
In work [6], the author presents a logger for IOT applications, namely Industrial Data Logger (IDL) to log the
device temperature and current to IOT system and display it on a special platform. The IDL is connects into Wi-
Fi and then to the cloud. The system uses the MAX6675 for measuring the temperature and Non-invasive
YHDC SCT-013-050 AC current sensor to measure electric energy consumed. The measured temperature and
current along with power are logged to server using Hornbill AWS IOT library. This data could later be used to
determine device specific events like operating duration; total power consumption etc., Combing this with the
device temperature can be useful in understanding operating health of the machine. We have attached Hornbill
Industrial Data Logger to a bench top drill machine, you may add it any machine where power and temperature
measurements can result in useful insights. The circuit consists of MAX6675 Sensor, ESP32, Amplifier.
III. BACKGROUND
A Data logger is a set of hardware that performs sampling, conversion, storage and initial processing of various
input analog signals. The system is the main element of multichannel measuring instruments that determines its
technical characteristics.
The Data loggers may include low-pass filters (LPFs), normalizing amplifiers (NU), an analog multiplexer
(MUX), a sampling and storage device, an analog-to-digital converter (ADC), and a microcontroller (MC).
Some types of Data loggers contain a programmable amplifier after the multiplexer, which allows you to rebuild
the measurement range [7].
Analog signals are received at the dataloggers inputs, for example, from sensors of physical quantities. The type
and level of the analog signal is determined by the physical characteristics of the sensors used. As a rule, the
signal is small in amplitude, and there are unwanted noise and interference in it. A low-pass filter filters and
prevents the overlap of signal spectra. The normalizing amplifier matches the amplitude of the signal from the
primary converter with the input range of the ADC. An analog multiplexer provides switching of the selected
analog input channel with the I / O. The sample-storage device stores the signal for the entire period of time the
conversion of the analog-to-digital Converter. The ADC converts the voltage from the input analog channel to a
digital code. Next, a digital code proportional to the input signal from the sensor enters the microcontroller,
where it is initially processed. Data loggers are used in various fields, such as precision low-frequency
measurements, acoustics, and in high-speed measurements. Despite the similar structure, depending on the
application to the data logger, various requirements may be imposed on them. In some cases, other data logger
structures are also used, for example, a structure with several water-saving devices (Figure. 2). This structure is
used when it is necessary to sample the values of two or more signals exactly at the same time (simultaneous
sampling).
Currently, there are two main approaches to the design of modern datalogger systems: building dataloggers
using discrete components and building dataloggers using technology systems on a chip [8].
The first approach is the most difficult way to develop dataloggers. It requires a reasonable choice of the
element base, circuitry and design of the printed circuit board. This approach involves the creation of a
prototype and testing, which increases the time and cost of development. For all of the above, a highly qualified
developer is required, as well as sufficiently large time and economic costs. Nevertheless, the construction of
datalogger on discrete components is necessary for solving highly specialized problems. This is advisable in
cases where for solving the problem there are no specialized systems on a chip or ready-made integrated
dataloggers.
Maxim manufactures a significant number of highly integrated components with unique characteristics for
building modern data loggers. The range of its products includes components for the implementation of any data
logger unit, such as physical quantity sensors, integrated filters, operational and instrumental amplifiers, digital
and analog multiplexers, sampling and storage devices, voltage reference sources, programmable amplifiers,
analog-to-digital converters, microcontrollers etc.[9].
3. Analog multiplexers
The main purpose of analog multiplexers is to transfer data from several signal sources to one receiver. Using an
analog multiplexer helps to increase the number of channels when using one ADC. The main requirements for
analog multiplexers are the minimum channel resistance in the open state, the maximum resistance in the closed
state, speed, temperature drift of characteristics, power consumption, the values of switching voltages and
currents, as well as the presence of built-in additional functions.
multichannel data acquisition systems, where they provide storage of the sample for conversion on one channel,
while the multiplexer switches to another channel. The use of the I / O makes it possible to minimize the
aperture error. The main criteria for sampling / storage devices are sampling speed, signal retention period,
power consumption and overall dimensions [10].
5. A to D Converters
An analog-to-digital converter is the most important component of the data loggers, which determines the
metrological characteristics, as well as the speed of the entire system. Modern ADC is a complex device, the
production technology of which is far from every manufacturer of electronic components. The main parameters
of the ADC are metrological characteristics, speed, functional completeness, cost, type of external interface,
power consumption, type of housing.
6. Microcontroller
In this work ESP32 was selected as microcontroller system. This Node allows you to quickly program the
module thanks to the built-in USB-TTL adapter. There are also programming and reset buttons on it, as well as a
voltage regulator for powering the ESP32 microcontroller with a voltage of 3.3 V. Also, the board provides
convenient access to the module pins, the step between which is quite narrow so that you can work with them
without problems. The step between the outputs of the board is 2.54 mm, which is the standard for DIP-cases,
which are convenient to work with a conventional radio amateur without special tools.
Table 2.
Pin GPIO N
Ultrasonic – trig 12
Ultrasonic – echo 13
MQ-5 32
Potentiometer 35
LDR 33
DHT 15
V. SOFTWARE DEVELOPMENT
To display the results on any internet browser, several codes are developed under programming languages
which can be run under a web browser. These languages are HTML, CSS, java script, JQuery and Arduino. The
table below shows the function of each language [12].
Table1: Functions of languages
Languages Function
HTML Design the web page
CSS Format the web page and items
Jscript Define the functionality of the elements
JQuery Library for java script
Arduino Programming the esp32 chip and the sensors
The algorithm of reading data from sensors and sending it into internet browser is shown in figure
Figure 4. reading data from sensors and sending it into internet browser
Serial.print("temp="); //Print at serial monitor the text "temp=" and the value of t
Serial.println(t);
VII. IMPLEMENTATION
The developed system is utilized to read data from several sensors. The data are processed and sent into the web
server. Then, the readings of the sensors are presented in web browser as shown in figure 7.
VIII. CONCLUSION
A data logger based on ESP32 is developed. It was shown that the ESP32 provides a good solution for data
logger development and it is capable to be communicated with several clients. The sensors readings are
presented in a web browser of a smart phone or a PC without any requirements of additional setting.
REFERENCES
[1] Lobaccaro, G.; Carlucci, S.; Löfström, E. A review of systems and technologies for smart homes and smart
grids. Energies 2016, 9.
[2] ] Mohammad A. K. Alia, Tariq M. Younes, Mohammad Abu Zalata, Development of Equivalent Virtual
Instruments to PLC Functions and Networks, Journal of Software Engineering and Applications, 2011, 4, 172-
180, doi:10.4236/jsea.2011.43019 Published Online March 2011.
[3] Monzer M. Krishan, Tariq M. Younes and Farouq M. Al-Taweel,New Design of Socket Modules for
Smart Home Applications,International Journal of Engineering Research and Technology. ISSN 0974-3154,
Volume 12, Number 2 (2019), pp. 151-156.
[4] Jiang Feng, Dai Jian, Wu Fei, Zou Yan, Design of Socket Based on Intelligent Control and Energy
Management, (IJACSA) International Journal of Advanced Computer Science and Applications, Vol. 6, No. 10,
2015.
[5] Shebel Alsabbah ; Tariq Mughrabi ,Neural network-based waveguide acoustic gas detector, 2008 5th
International Symposium on Mechatronics and Its Applications,IEEE Xplore: 14 October 2008,DOI:
10.1109/ISMA.2008.4648867.
[6] Atsushi Mitani and TamonHosoya, Mechatronics Education in School of Design – Development of
Educational Tool to Study Design Expression Using Mechatronics, JRM Vol.23 No.5 pp. 629-637, doi:
10.20965/jrm.2011.p0629.
[7] KazuhitoHyodo, HirokazuNoborisaka, and Takashi Yada, Development of Mechatronics Teaching Materials
for Embedded System Engineer Education, JRM Vol.23 No.5 pp. 611-617, doi:
10.20965/jrm.2011.p0611(2011).
[8] Tariq M. Younes, Computer-Based Acoustic Detector for Determining the Type and Concentration of a
Solution, Journal of Applied Research and Technology, pp 859-866, Vol. 10, December 2012.
[9] RubaAlawneh, Aism El Sheikh, Raid Kanaan, Development of Embedded Personal Health CareRecord
System, IBusiness, volume 3, issue 6.
[10] https://dl.espressif.com/doc/esp-idf/latest/get -started/index.html
[11] Tariq M. Younes, Development of LVDT Signal Conditioner Using Waveguide Acoustic Resonance Tube,
Sensors & Transducers, Vol. 206, Issue 11, November 2016, pp. 88-94.
[12] Chen, C.-Y.; Liu, C.-Y.; Kuo, C.-C.; Yang, C.-F.; Chen, C.-Y.; Liu, C.-Y.; Kuo, C.-C.; Yang, C.-F. Web-
Based.