Microcontrollers-1-11
Microcontrollers-1-11
Original article
Keywords: This paper presents the utilization of the ESP32 microcontroller as a teaching tool for signal acquisition,
Microcontroller programming processing, and control theory in biotechnological engineering. The ESP32 microcontroller, equipped with
Sensors and actuators Bluetooth and WiFi capabilities, offers an affordable and versatile solution for educational purposes. By
Internet connection
leveraging the Arduino© software, students can easily learn microcontroller programming and utilize various
Control theory
peripherals such as sensors and actuators. Several practical exercises related to process control have been
conducted using this microcontroller. Additionally, remote process monitoring and control are enabled through
integration with a database. Furthermore, concepts of artificial intelligence are explored using the Edge Impulse
platform to obtain an artificial neural network that can be downloaded onto the ESP32. Positive feedback from
students highlights the effectiveness and engagement of utilizing these microcontrollers, and the integration
of internet connectivity enhances the overall learning experience.
∗ Corresponding author.
E-mail addresses: [email protected] (M.A. Márquez-Vera), [email protected] (M. Martínez-Quezada), [email protected]
(R. Calderón-Suárez), [email protected] (A. Rodríguez), [email protected] (R.M. Ortega-Mendoza).
https://doi.org/10.1016/j.dche.2023.100122
Received 17 July 2023; Received in revised form 30 August 2023; Accepted 30 August 2023
Available online 6 September 2023
2772-5081/© 2023 The Author(s). Published by Elsevier Ltd on behalf of Institution of Chemical Engineers (IChemE). This is an open access article under the CC
BY-NC-ND license (http://creativecommons.org/licenses/by-nc-nd/4.0/).
M.A. Márquez-Vera et al. Digital Chemical Engineering 9 (2023) 100122
poses challenges in developing countries, where the cost of acquiring a 1.1. Programmable dispositives
license - $6995 per copy - can be prohibitive for students.
At the Polytechnic University of Pachuca, the Biotechnology Engi- PLCs are widely employed in various industries, and the most com-
neering program offers a comprehensive curriculum that emphasizes monly used programming method is ladder programming (Petruzella,
the application of living microorganisms in the design of industrial, 2016). Due to the inherent correspondence between state machine ar-
food, and pharmaceutical products. One of the courses offered in the chitecture and ladder programming, PLC programming becomes
eighth level is Bioprocess Control, which covers topics such as closed- straightforward. In their guide, Rowe et al. (2020) demonstrated the
loop control, stability analysis, PID controllers, fault diagnosis, and the creation of a state machine for PLC programming, with a specific
utilization of artificial intelligence for control and system identification. focus on discrete control. Additionally, the LabVIEW® software can be
However, the challenges of teaching this subject arise from the stu- utilized to develop techniques for continuous control. The framework
dents’ limited programming skills and the high costs associated with proposed by Rowe et al. (2020) received a high level of acceptance
specialized simulation software. from students, with a satisfaction rate of 95%. It is worth noting
There are various specialized software tools available for modeling, that the functionality of PLCs can be extended to other programming
control, and simulation in bioprocess engineering. For instance, dos paradigms, and plans involving leveraging Karnaugh maps for program
Santos et al. (2018) highlighted the integration of programming skills development.
through the use of computational tools. Similarly, Granjo et al. (2012) A notable simulator for ladder programming of PLCs is LogixPro® ,
demonstrated the effectiveness of software such as Matlab® , Fortran, which includes a practical exercise involving the control of a batch
Octave® , and Java® in teaching separation processes to chemical engi- reactor. This simulation encompasses two inlet pumps, an outlet pump,
neering students. Additionally, Ospino et al. (2017) compared the use a mixer, a heater, high and low liquid level sensors, a thermostat, and
of Simulink® and Xcos® , both of which employ a block-oriented pro- a control panel with buttons, displays, a knob controller, and lamp
gramming approach, to enhance the programming abilities of chemical indicators. An intriguing aspect of using this software is the ability
engineering students. to simulate realistic problem scenarios, such as reactor overfilling or
Xcos® by Scilab® and Octave® are open-source programs that offer overheating, which may otherwise be overlooked when focusing solely
high-level programming capabilities and come with specialized atoms on ladder programming. However, it is important to acknowledge that
or packages. These programs can be utilized by students to develop the licensing fees associated with the LogixPro® program may pose
numerical methods for operations research, optimization, modeling, limitations for certain universities in developing countries.
and control. Consequently, artificial intelligence techniques can be em-
An alternative to PLCs is the use of microcontrollers, such as LD-
ployed to design fuzzy controllers for biotechnological processes (Demir
micro, which is a software designed for programming Microchip®
and Eren, 2022), intelligent fault diagnosis systems for chemical facto-
and Arduino® microcontrollers using ladder logic. Microcontrollers are
ries (Bi et al., 2022), or artificial neural networks to model the dynamic
small computers that integrate a microprocessor along with various
behavior of chemical processes (Kakkar et al., 2021).
peripherals such as memory, analog-to-digital converters, timers, coun-
Programming skills are essential for biotechnological students
ters, and communication drivers (Serrano-Pérez et al., 2017). There are
(Kakkar et al., 2021). However, to gain a better understanding of
numerous types and brands of microcontrollers available, and one pop-
software implementation, it is crucial to develop practical applications.
ular and cost-effective option is the Arduino® microcontroller (Pereira,
One possible approach is to utilize virtual reality. For instance, Herink
2022). For instance, Küçükaǧa et al. (2022) utilized an Arduino® micro-
et al. (2022) developed an educational tool that simulates industrial
controller to control an anaerobic bioreactor. The microcontroller was
chemical environments to captivate students’ attention and enhance
employed for monitoring biogas changes using a gasometer and facili-
their learning experience. This immersive approach helps students
tating pulse-mode liquid recirculation in the bioreactor. This approach
concentrate better and improves their retention of the lessons.
allowed for the development of a cost-effective prototype, costing less
An alternative approach is to utilize web labs, which provide stu-
than 100 €, catering to the needs of students and young researchers, as
dents in chemical and biotechnological engineering with remote access
to industrial equipment (Botero et al., 2016). This allows students opposed to investing in a commercially fabricated bioreactor, which
to gain hands-on experience with chemical installations that may be typically exceeds 1000 €. Furthermore, Kubínová and Šlégr (2015)
inaccessible or impractical at their university. One notable web lab demonstrated the adaptation of Arduino® for chemical sensor measure-
is the LiLa project, which enables sharing remote and virtual labora- ments, known as ‘‘chemduino’’. This modification enabled the mea-
tories among a network of universities (Richter et al., 2009). As an surement of temperature and pH values using thermometers and pH
example, this project has been used to control the light absorption meters, respectively, providing chemistry students with a practical and
proportion to maintain product concentration in a reactor, with stu- affordable solution.
dents tuning a proportional–integral–derivative (PID) controller. The
web lab implementation at the University of Cambridge incorporates 1.2. Artificial intelligence
a programmable logic controller (PLC) and utilizes Siemens’ SIMATIC
STEP 7 software (Botero et al., 2016). Artificial intelligence (AI) refers to the implementation of systems
The LiLa project serves as an excellent solution in situations where and programs in computers that aim to emulate behavior and events
hands-on experiential education is not feasible in real industrial settings occurring in nature. AI utilizes different approaches, such as artifi-
due to security concerns, long distances between the university and cial neural networks (ANN), fuzzy logic, and genetic algorithms. In
industry, or limited access to certain equipment or facilities. particular, machine learning is a technology that relies on ANN to
Student feedback was collected through questionnaires regarding predict events and patterns without human intervention (Saranya and
the experiments and user interface. The consensus among the students Subhashini, 2023). By using neural network models, machine learning
was that the exercises provided them with valuable opportunities to enables computers to learn from datasets and make predictions or
work with real data and gain hands-on experience with industrial decisions based on this data, providing a wide range of applications
equipment. in various fields, including biotechnology.
Similarly, Rowe et al. (2020) developed a framework for incorpo- Biotechnology engineering relies digitalization of variables sensing,
rating programmable logic controllers (PLCs) in chemical engineering data storage and sharing, signal processing, filtering and transforma-
education at the University of Colorado. The cost associated with tions. These topics and be aborded using AI applications (Holzinger
acquiring a single laboratory setup, including the PLC and its connector, et al., 2023). Thus, AI is an important topic that biotechnological
amounted to $2294 dollars. In developing countries, such expenses are engineering students should explore. As mentioned by Kakkar et al.
typically borne by the professor or the students themselves. (2021), the advent of Industry 4.0 has led to a significant increase in the
2
M.A. Márquez-Vera et al. Digital Chemical Engineering 9 (2023) 100122
application of machine learning algorithms in the chemical industry. The built-in WiFi module of the ESP32 enables the saving of data
Machine learning enables the description and analysis of complex in the cloud or databases. For instance, Firebase, a Google database,
chemical processes by utilizing artificial neural networks (ANNs) to allows for the storage of data and information collected by an ESP32
capture and model nonlinear relationships. microcontroller. In a review by Chamara et al. (2022), IoT applica-
Kakkar et al. (2021) provided students with the opportunity to tions for crop monitoring were explored, highlighting the utilization
program artificial neural networks (ANNs) using a MATLAB® toolbox, of platforms such as Arduino® , ESP32, and Raspberry® Pi to store
enabling them to solve chemical engineering problems. This approach information in databases. The review explained how these platforms
allowed students to focus on specifying key parameters such as the can be employed to effectively store and manage data in the context of
propagation function, the number of neurons in the hidden layer, crop monitoring.
the number of hidden layers, and the number of iterations, without Machine learning algorithms can be implemented on an ESP32 us-
requiring an in-depth understanding of the underlying mathematical ing tools such as Edge Impulse. These applications, known as embedded
framework. systems, allow for the development of small-scale machine learning
AI algorithms play a crucial role in fault diagnosis (Bi et al., 2022; applications on hardware with limited memory. In particular, the Faster
Xiong et al., 2023). In industrial settings, equipment failures can trigger Objects, Multiple Objects (FOMO) network is a machine learning algo-
a domino effect, leading to the failure of entire processes (Khan et al., rithm used for real-time object detection. It requires significantly less
2021a). To digitalize the process and mitigate such risks, it is essential processing power and memory compared to networks like MobileNet
to monitor all sensors and actuators in a chemical plant (Khan et al., SSD or YOLOv5. Additionally, FOMO can be successfully deployed on
2021b). Fault diagnosis can be approached through two main methods: a microcontroller. Hymel et al. (2023) demonstrated the effectiveness
model-based approaches and data-driven methods (Márquez-Vera et al., of using Edge Impulse for developing embedded systems with machine
2021). In the latter, AI algorithms leverage acquired data to extract learning capabilities.
valuable information that can indicate the presence of a fault. Effective Parameter estimation is an intriguing area of study in chemical engi-
fault diagnosis is of utmost importance in preventing major industrial neering, particularly when dealing with systems that may lack sensors
accidents (Shu et al., 2016). Consequently, process monitoring becomes or exhibit time-varying behavior, such as biotechnological processes.
crucial for implementing data-driven methods in modern industrial Sinha and Mishra (2018) addressed this challenge by employing an
operations (Ge et al., 2013). extended Kalman filter to develop a sliding mode control strategy for
temperature regulation in a stirred tank reactor with varying parame-
Process intensification (PI) is a concept in chemical engineering
ters. The Kalman filter not only facilitated disturbance rejection but also
that aims to create smaller, cheaper, safer, and more energy-efficient
enabled accurate parameter estimation, enhancing the overall control
processes compared to conventional approaches (Harmsen, 2010). By
performance of the system.
utilizing PI, the implementation of fault diagnosis becomes more robust
These concepts and applications are essential to be incorporated
and reliable in chemical processes. According to Harmsen (2010), PI
into the curriculum of biotechnological engineering programs. With a
can be developed using heuristic techniques based on expert knowl-
focus on competency-based education. Tools such as Google Classroom
edge, which can then be implemented through AI algorithms, such
has become instrumental in sharing academic resources, including
as fuzzy logic (Cosenza and Galluzzo, 2012). Therefore, a solid un-
papers, programs, videos, links, and online content, with students
derstanding of programming and automation is crucial in practical
(Nguyen et al., 2022). Additionally, assignments and video calls have
educational projects, as it ensures occupational health and safety in
facilitated effective communication and interaction between professors
both laboratory and industrial settings (Safiena and Goh, 2022). Fa-
and students. At the Polytechnic University of Pachuca, the imple-
miliarity with AI is essential for chemical engineers, as it equips them
mentation of this platform has proven particularly valuable, enabling
with a powerful tool for addressing various challenges in their field.
the teaching of various subjects such as programming, control the-
According to Buzzelli and Asafo-Adjei (2023), observation is a
ory, embedded systems, fault diagnosis, and AI techniques within the
fundamental principle of experiential learning, and the incorporation
framework of CBA education.
of intense emotional experiences aids in the retention of concepts The remaining sections of this paper are organized as follows:
taught in the classroom. Therefore, developing programming skills for Section 2 provides an overview of the ESP32 microcontroller, high-
AI applications in chemical engineering is crucial for the comprehen- lighting its key features and capabilities. In Section 3, we delve into
sive training of students. By actively engaging in the development the bioprocess control class, where a basic understanding of electronic
of AI applications, students gain practical experience and a deeper devices and microcontroller programming is necessary. Additionally,
understanding of the subject matter. Section 3 showcases several projects that can be undertaken by students
Recently, the ESP32 microcontroller has gained popularity due to its utilizing the ESP32 microcontroller.
numerous advantages over similar devices like the Arduino or Freescale Moving on to Section 4, we present the feedback received from
microcontrollers. The ESP32 boasts a 32-bit buffer and comes equipped students, who expressed positive opinions regarding the use of mi-
with integrated WiFi and Bluetooth capabilities, making it a versatile crocontrollers in their learning experiences. Section 5 encompasses
and cost-effective option. Its WiFi functionality enables it to be used the conclusions drawn from this study, which highlight the favorable
for Internet of Things (IoT) applications. For instance, Andreas et al. acceptance of the ESP32 microcontroller and its seamless integration
(2019) utilized a PIR sensor to monitor the area surrounding a door with WiFi connectivity and database interaction.
and employed the ESP32 to send notifications to a smartphone via the Lastly, the Appendices include detailed information on specific func-
MQTT protocol. tions used for fuzzy temperature control in the ESP32 (Appendix A), as
The ESP32 microcontroller offers the capability to implement con- well as instructions on displaying temperature and timestamps on an
trol strategies. In a study by Bhookya et al. (2022), a PID controller LCD display, saving data to an SD card memory, and storing data in a
was successfully implemented for a liquid level system using the ESP32. database (Appendix B).
The integration of IoT enables real-time control and monitoring of
the system. The ESP32 has also found applications in the field of 2. ESP32 microcontroller
chemical engineering. For example, Frühling et al. (2023) utilized the
microcontroller for temperature control and data acquisition in a stirred The microprocessor serves as the brain of a system, capable of mak-
tank reactor operating at low temperatures and high pressures for ing decisions and performing computations at a much faster rate than a
hydrate formation. The acquired data was stored on an SD card for human. However, in order to interact with the external world, the mi-
further analysis. croprocessor requires various peripherals to acquire information. These
3
M.A. Márquez-Vera et al. Digital Chemical Engineering 9 (2023) 100122
peripherals include digital and analog inputs, which allow the micro- • State feedback control
processor to interface with sensors for data acquisition. Additionally, • Simulation of nonlinear systems
external memory is crucial for storing programs and data. • Programming of microcontrollers
Similarly, the microprocessor can control actuators using digital • Programmable logic controllers (PLCs) and ladder programming
and analog outputs, enabling it to manipulate external devices. Com- • Fault diagnosis techniques
munication protocols play a vital role in facilitating communication
between the microprocessor and other devices. There are protocols These topics provide students with a comprehensive understanding
specifically designed for sending information to slave devices, allowing of control theory and its application in biotechnological processes.
bidirectional communication (full duplex) by sending and receiving At the beginning of the course, we introduce students to free soft-
data. ware tools that facilitate the understanding of key concepts. For in-
A microcontroller is a complete integrated circuit that incorporates stance, we use Octave, a powerful mathematical programming lan-
a microprocessor along with additional electronic components such guage, to explore topics like the Laplace transform, root locus analysis,
as memory, clock, analog-to-digital and digital-to-analog converters, and state-space representation. To utilize these functionalities, students
filters, and various other peripherals. This integration simplifies the are required to download and install Octave’s control and symbolic
implementation of embedded applications. Microcontrollers come in packages. For example, the command pkg install control can be
different types, with some operating on 8-bit architecture and featur- used to install the control package. It is important to note that even
ing a specific number of pins for connecting external hardware. In if the packages have been installed, they need to be loaded each time
recent years, the ESP32 microcontroller has gained prominence due Octave is restarted. This can be done by executing commands like pkg
to its built-in Bluetooth and WiFi capabilities, making it particularly load symbolic.
well-suited for Internet of Things (IoT) development (Pratama and
Furthermore, the ESP32 microcontroller can be seamlessly inte-
Kiswantono, 2022).
grated with Octave using the Octave bindings for controlling Bricks and
The ESP32 microcontroller features a powerful microprocessor with
Bricklets. To enable this integration, students are instructed to add a
two cores from Tensilica, operating at a clock speed of 240 MHz.
precompiled Java library called Tinkerforge to Octave’s classpath.
Specifically, the DevKit V1 variant is equipped with a 240 MHz clock,
In addition to software-related topics, the course also covers es-
4 MB of flash memory, 520 kB of SRAM, and 448 kB of ROM. In terms
sential electronics concepts. Students learn about registers, digital and
of communication capabilities, it offers WiFi, Bluetooth, Ethernet, SPI,
analog signals, binary and hexadecimal numeral systems, transistors,
UART, I2 C, I2 S, and CAN modules. The microcontroller also includes
timers, and other fundamental elements. This knowledge provides a
various peripherals such as a Hall sensor, low-pass filters, pull-up resis-
tors, power-on LEDs, and pin 2 status indicators. It provides 15 pins for solid foundation for their understanding of microcontroller program-
acquiring analog readings using two 12-bit analog-to-digital converters, ming and automation in bioprocess control.
two 8-bit digital-to-analog converters, 25 GPIOs (Maier et al., 2017), In the bioprocess control class, the ESP32 microcontroller can be
and 9 touch-enabled pins. Remarkably, the ESP32 is available at an utilized as a standalone data acquisition card, while the Octave soft-
affordable price of around $7, making it a cost-effective and powerful ware is employed to process the acquired data and compute the desired
choice for students. output signals for the actuators. A power stage is then utilized to
The ESP32 can be programmed using commonly used software manage the electrical current or voltage required by the actuators.
platforms such as MicroPython and Arduino. The latter, in particular, Using a microcontroller as a computer peripheral presents an inter-
has gained popularity within the electronic community due to its ex- esting opportunity to program filters or control signals directly from
tensive collection of examples and readily available information on the the computer and visualize the acquired or calculated signals through
internet. Many applications related to IoT and automation have been graphical plots. However, for real-world applications, it is often ad-
developed using Arduino and the ESP32 (Andreas et al., 2019; Pereira, vantageous to perform the computation and signal processing directly
2022; Serrano-Pérez et al., 2017; Maier et al., 2017; Carducci et al., within the microcontroller, enabling efficient and real-time control of
2019). Taking advantage of the free software provided by Arduino the bioprocess.
and the ESP32’s impressive capabilities, this microcontroller has been
selected for teaching the design of acquisition systems, process automa- 3.1. Electronic devices required in class
tion, and control actions. Only a basic understanding of electronics
concepts is required to implement these applications in the classroom.
In the bioprocess control class, various electronic devices are re-
quired to facilitate the practical implementation and understanding of
3. Bioprocess control class at the university
the concepts taught. The following electronic devices are essential for
The Bioprocess Control class is offered to students during the eighth the class:
four-month period of their program. Prior to enrolling in this course,
• Microcontrollers: The ESP32 microcontroller is the main device
students are expected to have completed a foundational mathematics
used in the class due to its versatility and capabilities. It serves
course for engineering. This mathematics course introduces students
as the central component for data acquisition, signal processing,
to key concepts including differential equations, Laplace transforms,
and actuator control. Additionally, other microcontrollers like
and numerical methods. This course serves as a prerequisite for the
Arduino or Raspberry Pi may be used for specific projects or
bioprocess control class. While the previous mathematics course covers
topics related to numerical methods, it does not delve into control the- applications.
ory concepts. However, within the context of the mathematics course, • Sensors: Different types of sensors are utilized to monitor vari-
students engage in simulations of nonlinear bioreactor models. ous process variables in biotechnological systems. These sensors
During the bioprocess control class, students cover a range of topics, include temperature sensors, pressure sensors, flow sensors, pH
including: sensors, and others, depending on the specific experiments and
projects undertaken.
• Laplace transform • Actuators: Actuators play a crucial role in the implementation
• Root locus of control strategies. Devices such as motors, valves, pumps, and
• State space modeling heaters are used as actuators to manipulate the process variables
• Closed-loop control systems based on the control algorithms developed.
4
M.A. Márquez-Vera et al. Digital Chemical Engineering 9 (2023) 100122
• Communication Modules: Modules like WiFi, Bluetooth, and Eth- For actuators, cost-effective options can be used in the classroom
ernet are employed to establish connectivity between the mi- setting. Incandescent spotlights or resistors can be employed for heating
crocontrollers and external systems or the internet. These mod- jacketed reactors or greenhouse prototypes. Fans can be utilized for
ules enable remote monitoring and control of the bioprocess, cooling purposes.
facilitating data transmission and communication. These affordable and readily available sensors and actuators allow
• Display Units: LCD displays or graphical user interfaces (GUIs) students to implement practical control systems using the ESP32 micro-
are utilized to visualize and present the acquired data, system controller. By working with these components, students gain hands-on
parameters, and control outputs. These display units enhance the experience in integrating sensors, programming the microcontroller,
understanding of the processes and facilitate real-time monitor- and controlling various physical processes.
ing. To control the actuators, a power stage is required. For 12 V𝐷𝐶
• Power Supplies: Adequate power supplies, including batteries or actuators, transistors can be employed. One option is the BJT (Bipolar
power adapters, are necessary to provide the required voltage Junction Transistor) series TIP120, which can handle loads requiring
and current levels to drive the electronic devices and ensure their approximately 3 A and supports up to 60 V𝐷𝐶 between the collector
proper functioning. and emitter. The TIP120 is a Darlington transistor, meaning that it
acts as an electrical current source controlled by the base current.
These electronic devices, along with appropriate connections and With its Darlington configuration, it has a high current gain, typically
interfaces, are essential tools that enable hands-on learning experiences ℎ𝐹 𝐸 ≈ 2500 (Marchus et al., 2022). Thus, to achieve a collector current
and practical implementation of control strategies in the bioprocess of 3 A, only 1.2 mA is needed at the base of the transistor.
control class. For applications requiring higher current capacity, the TIP3055 can
The implementation of bioprocess control in practice involves uti- handle up to 15 A in the collector and supports 60 V𝐷𝐶 between the
lizing a data-acquisition system with the ESP32 microcontroller, which collector and emitter. However, its current gain, ℎ𝐹 𝐸 ≈ 50, is lower. In
is integrated with the Octave software. The control theory concepts this case, to operate a load that requires 15 A, it is necessary to supply
taught in class are applied using the control package provided by 300 mA to the transistor base. Additionally, a Darlington connection is
Octave. To demonstrate these concepts, practical prototypes are devel- necessary because a microcontroller’s GPIO pin can provide a maximum
oped, incorporating sensors and actuators. of 40 mA.
Examples of these prototypes include: An alternative option is to use the IRFZ44N MOSFET (Metal-Oxide-
Semiconductor Field-Effect Transistor). This transistor is controlled by
1. Liquid level control: A system that monitors and controls the voltage at its gate and acts as a current source. The IRFZ44N can
level of a liquid in a tank or reactor. This can be achieved using support up to 55 V𝐷𝐶 between the drain and source and handle a
sensors to measure the liquid level and actuators to adjust the drain current of 49 A (Bula and Hajrizi, 2021). By applying a suitable
inflow or outflow rates. gate voltage, the IRFZ44N allows current to flow through the actuator,
2. Temperature control of a reactor jacket: In biotechnological providing an efficient and reliable solution.
processes, maintaining precise temperature control is essential. Choosing the appropriate transistor for actuator control depends on
By incorporating temperature sensors and heaters, the ESP32 can the specific requirements of the application, such as voltage, current,
regulate the temperature of a reactor jacket to ensure optimal and control capabilities. Students can explore and experiment with dif-
conditions for the desired process. ferent transistors to gain practical understanding of their characteristics
3. Humidity control for a small greenhouse: For applications in and how they affect the performance of the actuators.
plant cultivation or bioprocessing, controlling humidity levels For AC actuators, the TRIAC (Triode for Alternating Current) is a
is crucial. By integrating humidity sensors and humidifiers or suitable choice. The MAC16 TRIAC, for instance, can handle a load
dehumidifiers, the ESP32 can monitor and adjust humidity levels of up to 15 A and withstand a voltage of 600 V𝐴𝐶 when turned off.
within a small greenhouse or controlled environment. With the use of these sensors, actuators, and electronic devices as power
stages, students can engage in practical exercises to automate chemical
These prototypes serve as practical demonstrations of how the or biological processes in an affordable and straightforward manner.
ESP32 microcontroller, in conjunction with sensors and actuators, can One example of automation involves the dosing of inlet flow to
be utilized to implement bioprocess control strategies. Through hands- a reactor using an analog signal, particularly if the laboratory has
on experimentation, students gain a deeper understanding of control a peristaltic pump. To simplify the control of these pumps without
theory concepts and their practical application in real-world scenarios. delving into complex electronic concepts such as filtering and PWM
To facilitate the implementation of sensor-based control systems, (Pulse Width Modulation) signals using operational amplifiers, the
the use of various sensors and communication protocols is explained ESP32 can supply analog signals for pump control. Peristaltic pumps
to the students. The Arduino software is utilized to program the ESP32 are available at prices ranging from $12.50 to $95 dollars, making them
microcontroller and interface with these sensors. accessible options for student projects.
For liquid level control, the HC-SR04 ultrasonic sensor is a cost- To provide a visual reference, Fig. 1 illustrates a circuit that incor-
effective option, priced at approximately $3. This sensor uses ultra- porates some of these devices and components.
sound waves to measure the distance to the liquid surface and provides
accurate level readings (Al-agele et al., 2022). 3.2. Microcontroller programming in class
To measure temperature, the LM35 sensor is commonly used. With
a cost of around $2, this sensor provides an analog signal proportional Microcontroller programming plays a crucial role in the bioprocess
to the temperature within a range of −55 to 150 ◦ C (Swapna et al., control class. Students are introduced to the fundamentals of program-
2020), while the DHT11 sensor is suitable for monitoring temperature ming using the Arduino IDE, which provides a user-friendly interface
and relative humidity It costs approximately $5 and provides a digital for writing and uploading code to the ESP32 microcontroller. The
signal that indicates temperature and humidity on a single wire (Doshi Arduino programming language, based on C/C++, is relatively easy to
et al., 2019). learn, making it accessible to beginners. In the class, students are taught
To measure soil humidity, the FC-28 hygrometer sensor, priced how to set up the development environment, write code to control the
at around $4, can be used (Lena et al., 2022). This sensor provides ESP32’s digital and analog pins, and interface with various sensors and
readings of moisture content in the soil, enabling precise control over actuators. Additionally, they learn about concepts such as loops, con-
irrigation systems. ditional statements, and functions, which are essential for developing
5
M.A. Márquez-Vera et al. Digital Chemical Engineering 9 (2023) 100122
6
M.A. Márquez-Vera et al. Digital Chemical Engineering 9 (2023) 100122
7
M.A. Márquez-Vera et al. Digital Chemical Engineering 9 (2023) 100122
Table 1
Hardware used in class.
Name Description Characteristics Price
240 MHz clock, 4 MB in flash memory, 520 kB in SRAM,
ESP32 Microcontroller 448 kB in ROM, WiFi, Bluetooth, Ethernet, SPI, $7
UART, I2 C, I2 S, 15 pins to acquire analog readings
HC-SR04 Ultrasound sensor Measure distance range [2 cm, 450 cm], precision ±3 mm, $3
opening angle 15◦
LM35 Temperature sensor Temperature sensing range [–55 ◦ C, 150 ◦ C], precision ±0.25◦ $2
Humidity and Temperature sensing range [0 ◦ C, 50 ◦ C], precision ±2◦ ,
DHT11 temperature sensor humidity sensing range [20%RH, 90%RH], precision ±5%RH, $5
Sample time 1 s
FC-28 Hygrometer Digital output of 10 bits inversely proportional to the $4
humidity in ground
IRFZ44N MOSFET transistor N-channel, V𝐷𝑆𝑚𝑎𝑥 = 55 V, I𝐷𝑚𝑎𝑥 = 49 A, R𝐷𝑆 = 17.5 mΩ $3
MAC16 TRIAC silicon I𝑚𝑎𝑥 = 15 A, V𝐴𝐶𝑚𝑎𝑥 = 600 V $2
bidirectional thyristor
8
M.A. Márquez-Vera et al. Digital Chemical Engineering 9 (2023) 100122
Table 2
Answers to the final questionnaire.
Group Very/more than 10/always Something/five/almost always Little/two/rarely Not/zero/never
1 70% 16% 10% 4%
2 74% 15% 9% 2%
3 74% 16% 10% 0%
to the eighth grade, as it enables a better understanding of the class sought additional information in specialized journals about process
material and ensures that the course can be completed within the al- control and the applications of AI in biotechnology. Finally, the use
lotted timeframe. The practical implementation of the concepts covered of the Edge Impulse platform was introduced to obtain neural models
in class, particularly when combined with mobile device interaction, of the controlled processes, enabling simulations and control design
generated great excitement among the students. without the need for physical processes.
One approach to enhancing programming skills in the field of
biotechnological engineering is through interdisciplinary collabora- 6. Conclusions
tion between students and professors from both biotechnological and
mechatronics engineering. By integrating programming and numeric Teaching complex topics to a group of students who may not have
methods into their engineering mathematics classes, students can gain a strong mathematical background or prior programming skills can be
practical programming experience and apply it to biotechnological challenging. In such cases, students may feel stressed, demotivated, or
engineering problems. struggle to see the relevance of these topics to their studies. To address
these concerns, we focused on selecting applications that allowed stu-
5. Discussions dents to engage in practical exercises with minimal effort and using a
limited number of electronic devices.
The students of biotechnological engineering often lack knowledge We chose the ESP32 microcontroller over similar devices due to
about electronics and have limited programming skills. Although they its lower cost and built-in WiFi connectivity. This enabled students
receive some foundation in mathematical concepts during a previ- to easily program control techniques and implement trained Artificial
ous class on numeric methods, Laplace transform, and interpolation, Neural Networks (ANNs) in their applications. The ability to validate
it seems that understanding control theory concepts solely through simulation results obtained using open-source software like Octave𝑞𝑞 ©
mathematical instruction may not be sufficient. The use of simulation with inexpensive and straightforward applications proved to be highly
software, such as the open-source Octave© , provides a valuable tool valuable.
for visualizing, computing, and plotting results and simulations. This The Arduino software simplified the integration of sensors and
choice is particularly beneficial for students in public universities, as actuators into the projects. By including the appropriate headers and
it eliminates the need to pay for licenses, which may be a financial configuring the necessary parameters, students could easily incorporate
burden. various communication protocols. The modular programming approach
However, a challenge arises when applying software tools and and the use of functions enhanced code reusability, streamlined the
classical control theory literature to chemical and biotechnological compilation process, and facilitated error correction.
processes, as these processes are inherently nonlinear. Additionally, The integration of internet connectivity for process monitoring and
real-world applications often involve factors that are not accounted for control through WiFi and Firebase integration proved to be one of the
in theoretical scenarios, such as actuator saturation, communication most engaging exercises for students. This topic served as a focal point
delays, and sensor noise. To bridge the gap between theory and practice to reinforce other concepts taught in the class.
and provide students with a better understanding, it is essential to The overall acceptance rate of the bioprocess control class was ap-
engage them in practical projects. proximately 73%. It was observed that students who initially struggled
Thanks to the control and symbolic packages available in Octave© , with the course had difficulties primarily related to their mathemat-
control theory concepts can be taught more effectively. These con- ical background and limited access to computers. To address these
cepts are evaluated during the first assessment. To provide practical challenges, teamwork and peer feedback were encouraged, and teams
applications, students are taught about electronics, power interfaces, of five individuals were formed to promote active participation and
number systems, and microcontroller programming, which are essential facilitate cooperative purchasing efforts.
for developing small-scale process control projects. In conclusion, the practical and hands-on approach, coupled with
The use of sensors and data acquisition is an intriguing topic for stu- the use of affordable hardware and open-source software, contributed
dents, especially when they can plot the collected data on a computer to the positive reception of the bioprocess control class. By selecting
using an ESP32 card and Octave© through serial communication. Up relevant applications and providing adequate support, students were
to this point, it is primarily an instrumentation application. To achieve able to overcome initial challenges and develop a deeper understanding
closed-loop control, students need to incorporate an actuator, such as of control theory and microcontroller programming.
a heating resistor or a pump for tank filling. Concepts like the Ziegler–
Nichols method, which is well-documented for Arduino in Picuino Declaration of competing interest
(2023), can be utilized to propose specific control algorithms.
Based on student feedback, it is evident that demonstrating practical The authors declare that they have no known competing finan-
applications of control theory is crucial for helping students understand cial interests or personal relationships that could have appeared to
how to propose control laws, such as using fuzzy logic, and design influence the work reported in this paper.
electronic circuits to control the hardware they are working with.
Although this paper proposed inexpensive and user-friendly electronic Appendix A. Fuzzy partition (mu’s are global variables)
devices, the most intriguing aspect for the students was the ability to
send information to the internet via WiFi connectivity using the ESP32. float mu1[5] = {0, 0, 0, 0, 0};
Students could store data and timestamps in a database, and even send float mu2[5] = {0, 0, 0, 0, 0};
setpoints to their control applications using their cellphones. void perten(float x, float *mu){
This approach captured the students’ attention and facilitated a int *pt;
deeper assimilation of the concepts and theories. Some students even pt=mu;
9
M.A. Márquez-Vera et al. Digital Chemical Engineering 9 (2023) 100122
10
M.A. Márquez-Vera et al. Digital Chemical Engineering 9 (2023) 100122
Harmsen, J., 2010. Process intensification in the petrochemicals industry: Drivers and Olisa, S.C., Asiegbu, C.N., Olisa, J.E., Ekengwu, B.O., Shittu, A.A., Eze, M.C., 2021.
hurdles for commercial implementation. Chem. Eng. Process.: Process Intensif. 49, Smart two-tank water quality and level detection system via IoT. Heliyon 7,
70–73. http://dx.doi.org/10.1016/j.cep.2009.11.009. e07651. http://dx.doi.org/10.1016/j.heliyon.2021.e07651.
Herink, T., Bělohlav, V., Jirout, T., Bělohlav, Z., 2022. Opportunities of experiential Ospino, J., Sánchez, M.E., Secchi, A.R., 2017. Implementation of a block-oriented model
education in chemical technology and engineering. Educ. Chem. Eng. 41, 32–41. library for undergraduate process control courses in EMSO simulator. Educ. Chem.
http://dx.doi.org/10.1016/j.ece.2022.08.003. Eng. 18, 45–57. http://dx.doi.org/10.1016/j.ece.2016.08.002.
Holzinger, A., Keiblinger, K., Holub, P., Zatloukal, K., Müller, H., 2023. AI for life: Pereira, 2022. Low-cost arduino-based temperature, relative humidity and CO2 sensors
Trends in artificial intelligence for biotechnology. New Biotechnol. 74, 16–24. - An assessment of their suitability for indoor built environments. J. Build. Eng.
http://dx.doi.org/10.1016/j.nbt.2023.02.001. 60, 105151. http://dx.doi.org/10.1016/j.jobe.2022.105151.
Hymel, S., Banburi, C., Situnayake, D., Elium, A., Ward, C., Kelcey, M., Baaijens, M., Petruzella, F., 2016. LogixPro PLC Lab Manual for Programmable Logic Controllers,
Majchrzycki, M., Plunkett, J., Tischler, D., Grande, A., Moreau, L., Maslov, D., fifth ed. McGraw Hill, New York, ISBN: 9781259680847.
Beavis, A., Jongboom, J., Reddi, V., 2023. Edge Impulse: An MLOPS platform Picuino, 2023. Ziegler–Nichols method. Autom. Control from https://www.picuino.
for tiny machine learning. In: Computer Science. Distributed, Parallel, and Cluster com/en/control-ziegler-nichols.html.
Computing. http://dx.doi.org/10.48550/arXiv.2212.03332. Pratama, E.W., Kiswantono, A., 2022. Electrical analysis using ESP32 module in
Hymel, S., Banbury, C., Situnayake, D., Elium, A., Ward, C., Kelcey, M., Baaijens, M., realtime. J. Electr. Eng. Comput. Sci. 7 (2), 1273–1284. http://dx.doi.org/10.
Majchrzycki, M., Plunkett, J., Tischler, D., Grande, A., Moreau, L., Maslov, D., 54732/jeecs.v7i2.21.
Beavis, A., Jongboom, J., Reddi, V.J., 2022. Edge impulse: An MLOps platform for RandomNerdTutorials, 2023. Microsd-card-arduino. from https://RandomNerdTutorials.
tiny machine learning. http://dx.doi.org/10.48550/arXiv.2212.03332. com/esp32-microsd-card-arduino.
Jhurree, V., 2005. Technology integration in education in developing countries: Richter, T., Boehringer, D., Lila, J.S., 2009. A European project on networked
Guidelines to policy makers. Int. Educ. J. 6 (4), 467–483. experiments. In: Sixth International Conference on Remote Engineering and Vir-
Kakkar, S., Kwapinski, W., Howard, C.A., Kumar, K.V., 2021. Deep neural networks in tual Instrumentation. Vol. 6. International Association of Online Engineering,
chemical engineering classrooms to accurately model adsorption equilibrium data. Bridgeport, NJ, USA, pp. 41–46. http://dx.doi.org/10.54732/jeecs.v7i2.21.
Educ. Chem. Eng. 36, 115–127. http://dx.doi.org/10.1016/j.ece.2021.04.003. Rowe, S.C., Samson, C.I., Clough, D.E., 2020. A framework to guide the instruction of
Khan, F., Amin, M.T., Cozzani, V., Reniers, G., 2021a. Methods in Chemical Pro- industrial programmable logic controllers in undergraduate engineering education.
cess Safety. Elsevier, ISBN: 978-0-323-91515-1, pp. 1–35, Ch. Domino effect: Its Educ. Chem. Eng. 31, 76–84. http://dx.doi.org/10.1016/j.ece.2020.03.001.
prediction and prevention—An overview. Safiena, S., Goh, Y.M., 2022. A hazard identification digital simulation game developed
Khan, F., Amyotte, P., Adedigba, S., 2021b. Process safety concerns in process system based on the extended authentic learning framework. J. Eng. Educ. 111 (3),
digitalization. Educ. Chem. Eng. 34, 33–46. http://dx.doi.org/10.1016/j.ece.2020. 642–664. http://dx.doi.org/10.1002/jee.20459.
11.002. Saranya, S., Subhashini, R., 2023. A systematic review of Explainable Artificial
Kubínová, Štěpánka, Šlégr, J., 2015. Chemduino: Adapting arduino for low-cost Intelligence models and applications: Recent developments and future trends. Decis.
chemical measurements in lecture and laboratory. J. Chem. Educ. 92, 1751–1753. Anal. J. 7, 100230. http://dx.doi.org/10.1016/j.dajour.2023.100230.
http://dx.doi.org/10.1021/ed5008102. Serrano-Pérez, E., Serrano-Pérez, J., Martínez-Piñón, F., Juárez-García, J.M., Serrano-
Küçükaǧa, Y., Facchin, A., Torri, C., Kara, S., 2022. An original arduino-controlled Pérez, O., Juárez-López, F., 2017. Sequential microcontroller-based control for
anaerobic bioreactor packed with biochar as a porous filter media. MethodsX 9, a chemical vapor deposition process. J. Appl. Res. Technol. 15 (6), 593–598.
101615. http://dx.doi.org/10.1016/j.mex.2021.101615. http://dx.doi.org/10.1016/j.jart.2017.07.003.
Lena, B.P., Bondesan, L., Rodrigues-Pinheiro, E.A., Ortiz, B.V., Morata, G.T., Kumar, H., Shu, Y., Ming, L., Cheng, F., Zhang, Z., Zhao, L., 2016. Abnormal situation management:
2022. Determination of irrigation scheduling thresholds based on hydrus-1D simu- Challenges and opportunities in the big data era. Comput. Chem. Eng. 91, 104–113.
lations of field capacity for multilayered agronomic soils in alabama, USA. Agricult. http://dx.doi.org/10.1016/j.compchemeng.2016.04.011.
Water Manag. 259, 107234. http://dx.doi.org/10.1016/j.agwat.2021.107234. Sinha, A., Mishra, R.K., 2018. Temperature regulation in a continuous stirred tank
Maier, A., Sharp, A., Vagapov, Y., 2017. Comparative analysis and practical implemen- reactor using event triggered sliding mode control. IFAC-PapersOnLine 51 (1),
tation of the ESP32 microcontroller module for the internet of things. In: Internet 401–406. http://dx.doi.org/10.1016/j.ifacol.2018.05.060.
Technologies and Applications. IEEE, Wrexham, United Kingdom, pp. 143–148. Swapna, B., Andal, C., Minivannan, S., Krishna, N.J., Rao, K.S.S., 2020. IoT based light
http://dx.doi.org/10.1109/ITECHA.2017.8101926. intensity and temperature monitoring system for plants. Mater. Today: Proc. 33
Malhotra, R., Massoudi, M., Jindal, R., 2023. Shifting from traditional engineering (7), 3409–3412. http://dx.doi.org/10.1016/j.matpr.2020.05.269.
education towards competency-based approach: The most recommended approach Tao, J., Fan, Q., Ma, L., 2017. Improved linear quadratic and proportional control
- Review. Educ. Inf. Technol. http://dx.doi.org/10.1007/s10639-022-11568-6. system for improved liquid level system regulation in a coke fractionation tower.
Marchus, C.R.N., Morrison, J.A.K.A.E., Strawn, I.K., Hartman, A.J., Shrestha, D., ISA Trans. 69, 148–156. http://dx.doi.org/10.1016/j.isatra.2017.04.011.
Pancheri, N.M., Glasgow, I., Schiele, N.R., 2022. Low-cost, open-source cell culture Thapa, P., Gautam, A., 2021. Potential of free and open source software for education
chamber for regulating physiologic oxygen levels. HardwareX 11, e00253. http: in developing countries. In: FOSS4G-Asia. International Association of Online
//dx.doi.org/10.1016/j.ohx.2021.e00253. Engineering, Dhulikhel, Kavrepalanchok, Nepal, pp. 168–172. http://dx.doi.org/10.
Márquez-Vera, M.A., Ramos-Velasco, L.E., López-Ortega, O., Zúñiga Peña, N.S., Ramos- 13140/RG.2.2.31876.65929.
Fernández, J.C., Ortega-Mendoza, R.M., 2021. Inverse fuzzy fault model for fault Vleeschauwer, F.D., Caluwé, M., Dobbeleers, T., Stes, H., Dockx, L., Kiekens, F.,
detection and isolation with least angle regression for variable selection. Comput. Copot, C., Dries, J., 2020. A dynamic control system for aerobic granular sludge
Ind. Eng. 159, 107499. http://dx.doi.org/10.1016/j.cie.2021.107499. reactors treating high COD/P wastewater, using pH and DO sensors. Comput.
Medero, A., Sename, O., Puig, V., 2022. State-feedback and static-output-feedback Electron. Agric. 33, 101065. http://dx.doi.org/10.1016/j.jwpe.2019.101065.
parametric controllers based on a discrete-time LPV grid based approach. IFAC Xiong, S., Zhou, L., Dai, Y., Ji, X., 2023. Attention-based LSTM fully convolutional
PapersOnLine 55 (35), 109–114. http://dx.doi.org/10.1016/j.ifacol.2022.11.298. network for chemical process fault diagnosis. Chin. J. Chem. Eng. 56, 1–14.
Nguyen, L.T., Kanjug, I., Lowatcharin, G., Manakul, T., Poonpon, K., Sarakorn, W., http://dx.doi.org/10.1016/j.cjche.2022.06.029.
Somabut, A., Srisawasdi, N., Traiyarach, S., Tuamsuk, K., 2022. How teachers Zalmotek, 2023. Predictive Maintenance - Nordic Thingy:91. Edge Impulse,
manage their classroom in the digital learning environment – experiences from from https://docs.edgeimpulse.com/experts/featured-machine-learning-
the university smart learning project. Heliyon 8 (10), e10817. http://dx.doi.org/ projects/predictive-maintenance-with-nordic-thingy-91.
10.1016/j.heliyon.2022.e10817.
11