Professional Documents
Culture Documents
Aziz and Cyrine PFE Report
Aziz and Cyrine PFE Report
Graduation Report
Presented for the purpose of obtaining
Applied Bachelor in Industrial Computing
Mention : Industrial Computing
Curriculum: Embedded Systems
By
Cyrine LABIDI and Mohamed Aziz BEN SLIMANE
Graduation Report
Presented for the purpose of obtaining
Applied Bachelor in Industrial Computing
By
Cyrine LABIDI and Mohamed Aziz BEN SLIMANE
Date: Date:
Signature: Signature:
Dedications
We dedicate this work to everyone who has supported and inspired us. Our families. Our
parents, our brothers, our sisters. You provide us the end-less support we need , to go
seize the day. You understand our crazy dreams and you push us forward as we chase
them! Thank you.
To every teacher who supported and inspired us. Thank you for teaching us valuable
things, for challenging us and pushing us to our limits and for making us believe in our-
selves.
To our friends. When life gets tough, you are always there to cheer us up. Thank you
for being such amazing friends. We could never do it without you.
To Everyone who we love, Thanks for being so wonderful and kind to us. We appre-
ciate your support and understanding.
i
Acknowledgment
Before presenting our work, we would like to thank all the people who contributed to the
success of our internship and who helped us in the drafting of this report.
First of all, we want to express our deep gratitude to all the AROTEQ family espe-
cially Mr. Saber ABEDA for help, relevant explanations and valuable tips that have the
greatest impact in the success of the completed project, we would also like to thank Mrs.
Wissal FATTOUM for helping us and being very kind and supportive.
We would like to thank our internship supervisor, Mr. Manef BOUROGAOUI, assis-
tant professor at ISTIC, for his help and the valuable lessons we learned from him.
We would also like to thank all our professors for being very kind and caring. We love
you from the bottom of our hearts.
Finally, I would like to express my profound gratitude to the Director of the Higher
Institute of Information and Communication Technologies Mr. Lazher MANAI, the Head
of study Mrs. Neila BEDOUI and all members of the administration for the efforts and
care they given to facilitate and make sure that we work in good conditions especially
during the COVID-19 pandemic.
ii
Contents
Dedications i
Acknowledgment ii
General Introduction 1
iii
CONTENTS
4 Implementation 47
4.1 Introduction . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 47
4.2 Work Environment . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 47
4.2.1 Hardware Environment . . . . . . . . . . . . . . . . . . . . . . . . . 47
4.2.2 Software Environment . . . . . . . . . . . . . . . . . . . . . . . . . 48
4.3 Data Acquisition interface . . . . . . . . . . . . . . . . . . . . . . . . . . . 49
4.4 Test and validation of data acquisition . . . . . . . . . . . . . . . . . . . . 50
4.5 Data Logging with Node-red . . . . . . . . . . . . . . . . . . . . . . . . . 52
4.5.1 Node-red Components . . . . . . . . . . . . . . . . . . . . . . . . . 52
4.5.2 Overview of the most important nodes . . . . . . . . . . . . . . . . 53
4.5.3 MQTT Broker . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 54
4.5.4 Node-RED and MQTT . . . . . . . . . . . . . . . . . . . . . . . . 55
4.5.5 Testing the MQTT Broker . . . . . . . . . . . . . . . . . . . . . . . 55
4.6 DataBase . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 56
4.6.1 Time Series Database . . . . . . . . . . . . . . . . . . . . . . . . . . 56
4.6.2 Benefits and Uses . . . . . . . . . . . . . . . . . . . . . . . . . . . 57
4.6.3 Chosen Database Technology (InfluxDB) . . . . . . . . . . . . . . . 57
4.6.4 System Database Model . . . . . . . . . . . . . . . . . . . . . . . . 58
4.7 Dashboard . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 58
4.7.1 Grafana . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 58
4.7.2 Javascript . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 59
4.7.3 CSS . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 59
4.8 Dashboard interfaces Conception . . . . . . . . . . . . . . . . . . . . . . . 59
4.8.1 Global use case diagram . . . . . . . . . . . . . . . . . . . . . . . . 60
4.8.2 Registration and authentication interface . . . . . . . . . . . . . . . 61
4.8.3 Control System Interface . . . . . . . . . . . . . . . . . . . . . . . . 63
iv
CONTENTS
General Conclusion 67
C Photoelectric sensor 71
C.1 Specification . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 71
E Altium designer 73
E.1 Features . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 73
Bibliography 74
v
List of Figures
vi
LIST OF FIGURES
3.23 Montage of the photo-electric sensor with the custom board STM32 . . . . 38
3.24 Montage of RollerDriver with custom board STM32 . . . . . . . . . . . . . 39
3.25 Flowchart for engine management . . . . . . . . . . . . . . . . . . . . . . . 39
3.26 MQTT protocol logo . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 40
3.27 MQTT publish subscribe . . . . . . . . . . . . . . . . . . . . . . . . . . . . 41
3.28 MQTT topic structure . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 41
3.29 MQTT broker . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 42
3.30 STM32 custom board operation flowchart . . . . . . . . . . . . . . . . . . 43
3.31 Raspberry Pi board operation flowchart . . . . . . . . . . . . . . . . . . . . 43
3.32 Sequence diagram of the different operations between the acquisition inter-
faces of the application . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 44
3.33 STM32 custom board publish process . . . . . . . . . . . . . . . . . . . . . 45
3.34 STM32 custom board subscribe process . . . . . . . . . . . . . . . . . . . . 45
3.35 Raspberry Pi board process . . . . . . . . . . . . . . . . . . . . . . . . . . 46
vii
List of Tables
viii
General Introduction
In this work, an interest is given to the conveyor systems which are considered as basic
elements of an industrial process. In fact, each year, internet sales continue to generate
double-digit growth rates, this striking trend requires efficient logistic strategies combined
with highly productive conveyor technologies. Today, an efficient, reliable and flexible lo-
gistic system is key of success. The main fields of application of conveyor systems are
food industry, airport logistics, postal express courier services and industrial sectors.
In this project, the study, the design and the realization of the conveying system was
expected to be achieved based on the technological development in the fields of electronics,
electricity, computer science, automation, embedded systems and structural mechanics.
For example, as a promising new technology, the Internet of things (IoT)is used to collect
and record a significant amount of data from the sensors. This data is used for decision-
making, control and management of the conveyor via a web interface.
The sensor and motors are connected to a custom board based on the STM32F407
microcontroller which is the key component for the conveyor management through en-
suring measurements collection and transmission to the cloud and also through receiving
the suitable control actions from the cloud. Therefore, the conveyor is going to be smart
based-system. The modules located throughout the conveyor collect data from the sen-
sors and execute the suitable actions to start or stop the motor remotely. This approach
allows ensuring an online control of the different system elements.
This manuscript illustrates in detail the different stages leading to the realization of
the intelligent conveying system, from the bibliographic study to the prototyping, includ-
ing the design, sizing mechanical structure assembling, sensors and actuators integration,
communication between the boards and the validation of the system operation.
The first chapter aims to present the host company AROTEQ, the project presenta-
tion, as well as the project requirements and the proposed solution.
The second chapter is devoted to the presentation of the conveyor as well as the main
criteria of choice. Then, the different required components are presented and described
and a special interest is given to the operative and control parts.
1
General Introduction
The third chapter is dedicated to the custom board design, the smart conveyor design,
the presentation of the different acquisition and control interfaces and the technologies
involved.
The fourth chapter is devoted to the web interface development which should take
on consideration possible system database output and the defined hardware/software
connections, to ensure intelligent communication between the conveyor and the dashboard.
2
Chapter 1
1.1 Introduction
This chapter is devoted to the presentation of the host company in which we carried
out our end-of-study graduation project. Thus, the project context is presented and the
proposed solution is described to design and implement a smart algorithm for the man-
agement of a conveyor using a web interface for remote configuration and supervision.
3
CHAPTER 1. PRESENTATION OF THE PROJECT CONTEXT
• Equip Test: Is a global player in the manufacture of test equipment for printed
circuit boards.
4
CHAPTER 1. PRESENTATION OF THE PROJECT CONTEXT
- Collect all the data from the different modules, process and save them in a database,
- Manage motors and actuators operation as well as their rotation or motion speed,
5
CHAPTER 1. PRESENTATION OF THE PROJECT CONTEXT
- Send an automatic alert message when a problem appears in the production line,
- Follow the system status through a web interface and configure its functionalities.
1. PROJECT INITIALIZATION: This is the fresh start of the project. It includes the
specification of functional and non-functional needs and defined choices.
2. PROJECT PLANNING: This phase usually begins with goal setting; it focuses
mainly on how to plan ahead in the project by setting up various factors like a
RoadMap that everyone will follow through the work.
3. PROJECT IMPLEMENTATION: This is the phase to put the plan into actions.
5. PROJECT CLOSURE: This phase represents the results of the project and discusses
the possible perspectives that may enhance the project components. It is mandatory
to validate the different project parts and to identify its shortcomings. This is
particularly useful, so we can do improvements to future projects.
6
CHAPTER 1. PRESENTATION OF THE PROJECT CONTEXT
-Chosen Methodology:
The Scrum software was chosen as a Project management tool using a website called
monday.com to organize our tasks and priorities as a team, as shown in Figure 1.4. In
fact, it has many features:
• It helps to supervise the work and progress and it gives details about each task, like
the person who did or modified the task and the time when it was performed.
• It can give a follow up Timeline to respect.
• It can generate an early alert when approaching a specific date without any change
in the state of accomplishment.
7
CHAPTER 1. PRESENTATION OF THE PROJECT CONTEXT
• It allows to track each member performance for every task, thereby it will allow
better dynamics in the team.
8
CHAPTER 1. PRESENTATION OF THE PROJECT CONTEXT
• Administrator: he is the supervisor, he can also carry out all the configuration and
control required for the production line operation, and he has all the access rights
on the system to control user access.
• User: it is the supervisor who can register and access his account. This actor has
restrictions on access to the system.
• The sensor: this is the instrument or tool that captures the different measurement
data of the system.
• Actuator: it is a device that allows performing operations and changing the system
state.
• Web interface: it allows the system monitoring and controlling as well as the con-
figuration of the transmission system.
• STM32 custom Board: it acquires data from the optical sensor and send them to
the server via the MQTT protocol.
• Consult the collected data and use them for decision-making and to take the neces-
sary action,
9
CHAPTER 1. PRESENTATION OF THE PROJECT CONTEXT
• Ensure the authentication and registration of the different users and control the
access to their accounts,
• Security: the system must be highly secured, and the access to the information
should be restricted, that is, the web interface can be accessed through the identifier
and password assigned to each natural person.
• Ease of use: the configuration and access to the account must be simple and easy
to handle regardless of the user nature.
• Scalability: the system must be scalable through giving the possibility, to add or
delete new features.
• Real-time: no matter what action the user takes, the system must be efficient and
it must respond as fast as possible.
• Portability: it means the ease of compatibility of the web interface with the different
operating systems like Mac and Windows.
10
CHAPTER 1. PRESENTATION OF THE PROJECT CONTEXT
This module is installed in each part throughout the conveyor. It allows an online
continuous collection of data which is useful to ensure a good management and an
optimal control. Firstly, the SICK photoelectric sensor is used to detect the presence
of the object on the conveyor. Secondly, the data acquisition is performed using our
implemented algorithm on the custom board STM32F407 microcontroller. Thirdly,
the data are collected from the different microcontrollers and then processed by the
Raspberry PI 3 Model B+ board.
The C and the Python are used as programming languages for the STM32F407 and
the Raspberry PI 3 boards, respectively.
The actuator is also composed of a relay module to ensure the supply of the Motor
Roller Drive EC5000 of the Interroll brand.
1.3.4.3 Dashboard
The dashboard is implemented in order to collect the different data from the different
modules and to make the suitable decisions to ensure a good conveyor management.
It also manages a database and serves as a web portal from which a user or admin-
istrator can view this various data and monitor the flow of objects. It also presents
diagrams and blocks showing the variation of the data, quantity and position of the
different objects.
This tool provides the link between the web interface (the dashboard) and the
database, which includes the data coming from the different modules as described
previously.
11
CHAPTER 1. PRESENTATION OF THE PROJECT CONTEXT
1.4 Conclusion
This chapter is an introductory part in which we tried to place the project in its general
framework while describing the host company AROTEQ, as well as its field of activity
and products. We went on to present the context of our project while specifying the
proposed solution of this project by indicating the functional and non-functional needs of
the envisaged solution.
12
Chapter 2
2.1 Introduction
In this chapter, a general presentation of the conveyor is given, thereby its advantages
and criteria of choice are explained. Next, the Internet of Things (IoT) technology is
introduced. After that, an interest is given to the different components involved in the
proposed conveyor system, ending by its mechanical design.
13
CHAPTER 2. PRESENTATION AND STUDY OF THE PROJECT COMPONENTS
The conveyor greatly reduces the number of tasks to be performed by the employees
in the company. This will save time and allow to affect these human resources to
other productive tasks rather than moving goods, hence the demand can be met
leading to a better revenue growth.
This kind of transporter is indeed designed for lightweight loads, and it is suit-
able for many object types. It’s used for processing flat objects and mechanical
components .
There are several types of conveyors, but they must be chosen according to the
goods to be transported. The roller conveyor helps to handle pieces, packaged and
unpackaged products. The splint belt conveyor easily transports unpackaged unit
products and cartons. For conveying loads or heavy objects, modular belt conveyors
are still the best choice. They can bear these loads well. In addition, they can also
transport pieces with a certain temperature, pieces at an acute angle and abrasive
pieces.
• Type of materials:
The material of which the conveyor is composed can be chosen according to the
desired application. As an example, the metal strips can be considered when trans-
porting products in a baking oven at high temperature. Metal strips-based conveyors
are easy to maintain, they are widely used in the food industry. Polyurethane con-
veyor has a good service life and can resist to the erosion of grease, oil and any
chemical substances. It is also more hygienic; hence it can be used in the food in-
dustry. In addition, PVC strips conveyors can be adopted, and they can withstand
a temperature of 60°C.
• Physical space:
The physical space where the conveyor will be installed plays a very important
role in its choice.
14
CHAPTER 2. PRESENTATION AND STUDY OF THE PROJECT COMPONENTS
The conveyor must be sized regarding to the size and weight of the objects to
be transported. As a result, objects will not fall off the conveyor when the latter is
set in motion., avoiding many accidents.
-Gateway: An IoT gateway device is the component that provides communication be-
tween the IoT devices (sensors, equipment, the cloud...) as presented in Figure 2.3.
Gateway devices provide local processing and storage solutions, as well as the ability to
autonomously control the devices based on data captured by sensors.
15
CHAPTER 2. PRESENTATION AND STUDY OF THE PROJECT COMPONENTS
16
CHAPTER 2. PRESENTATION AND STUDY OF THE PROJECT COMPONENTS
connecting it to the computer using a USB cable. Its main features are given in Appendix
A.
The choice of this STM32F407 microcontroller was made after performing a compar-
ison between the existing microcontrollers. It was chosen based on the project require-
ments. The first basic requirement is the Ethernet communication which is a main feature
of the STM32F407. The Ethernet communication was chosen to create a network between
the different modules. It was chosen over WIFI for various reasons as described below.
• The ability to run at high speed at low cost. Thus, maintenance operations can be
carried out more quickly.
• The Ethernet connection is essential for professional and especially industrial use
because Ethernet communication is completely secure against industrial noise.
• The Ethernet connection allows the sending of queries and data in real time, lossless
to ensure trouble-free communication and offers a stable and more effective perfor-
mance. In fact, it is well protect from external factors that can affect the achievable
transmission speed unlike WIFI. For example, all building materials, concrete walls,
trees, or any type of obstacles, may lead to signal loss or to performances minimiza-
tion of the WIFI connection,
• The connection speed is higher than that of WIFI and specifically it does not suffer
from fluctuation or interruption, it is very secure.
The other different reasons for this choice are given below.
• STM32F407 are ARM cores, which have the advantages of extremely widespread
everywhere.
17
CHAPTER 2. PRESENTATION AND STUDY OF THE PROJECT COMPONENTS
Table 2.2: Comparison table between Arduino Mega microcontroller and STM32f407
STM32F407 ATmega2560
Speed 168MHz 16MHz
Flash memory 1MB 256KB
RAM size 192KB 8KB
I/O 82 54
For the human operator, the Raspberry Pi 3 Model B + offers desktop performance,
it behaves like those of the x86 entry-level PC systems. The main features of this board
include a high-performance 64-bit ARM processor quad-core.
In the case of this work, as it was mentioned in the previous subsection, the whole system
is based on the Ethernet communication to be installed between the different STM32
custom boards and the server Raspberry PI 3 to collect the data coming from sensors.
The Raspberry PI 3 will process these data and send the suitable control actions so as to
ensure a good management and reliable control of the conveyor.
Moreover, the Raspberry PI 3 will be used to transfer and receive data to/from the
web interface for recording, supervision, and control of the conveyor system.
On the other hand, this board is compared to a mini-PC with a real Linux operating
system. It is a real small desktop computer equipped with an Ethernet port and it is a
server that can be controlled remotely via SSH(Secure Shell Protocol), this card is very
reliable and powerful for our project because it is a web server too.
Regarding these features, the Raspberry Pi 3 is a good candidate for this system.
18
CHAPTER 2. PRESENTATION AND STUDY OF THE PROJECT COMPONENTS
The SICK W4-3 is used as a photoelectric sensor instead of other sensor types for different
reasons as given below.
19
CHAPTER 2. PRESENTATION AND STUDY OF THE PROJECT COMPONENTS
sensor that is much more efficient and far ahead of the market’s sensors in terms of
detection.
• Perfect visibility of the light beam: regardless of the reflectivity of the object
to be detected and the ambient lighting conditions, often at a distance of a few
hundred centimeters, the beam of conventional electrical cells from other sensors
becomes difficult to distinguish.
• Very low power consumption: In braking mode, the brushless drive has an
energy and power recovery device. The conveyor does not need pneumatic or con-
ventional drives, which must be used continuously.
20
CHAPTER 2. PRESENTATION AND STUDY OF THE PROJECT COMPONENTS
• Low noise emissions: The use of decoupling elements ensures very quiet opera-
tion.
• Lack of maintenance and ease of assembly: The drive with internal electronic
switching device requires no maintenance. It has overload protection that prevents
damage from over temperature or blockages. The connection is carried out safely
without tedious screwing via a five-pole interlocking connector cable.
• Flexible use possibilities: The Roller Drive is available in the most diverse
versions and can therefore be used in many different conveyor systems. This means
for users a single interface, instead of several. The electronic stop brake (Zero-
Motion-Hold) keeps the products to be transported in position, even in downward-
sloping conveyors.
This software is used in several fields such as Electrical Engineering, Industrial Automa-
tion, Mechanical Engineering, Mechatronics and Instrumentation [9].
21
CHAPTER 2. PRESENTATION AND STUDY OF THE PROJECT COMPONENTS
2.6 Conclusion
In this chapter, we firstly presented an overview of the conveyor and its advantages and
mentioned the most important criteria for choosing it. Secondly, we detailed the hardware
environment with its various components, and we gave technical justifications for their
choice. Finally, we presented a 3D view of our system.
22
Chapter 3
3.1 Introduction
In this chapter, a description by UML diagram of the different elements involved in the
design of the conveyor management interface will be presented as well as a detailed custom
board design.
In a second part, a detailed description of the operating part (sensors and actuators) and
the control part (boards) allowing the acquisition and processing of data will be presented.
In this context, diagrams and flowcharts of the different treatments carried out, will be
described for better explain.
• An efficient, reliable and flexible logistics system that delivers items to the right
destination at the right time.
23
CHAPTER 3. DESIGN OF A CONVEYOR MANAGEMENT SYSTEM
• The automatic control and supervision system provides real-time supervision of all
changes and the flow of objects.
• Remotely monitor the conveyor and stay informed and receive notifications if there
is an error, which enable continuous remote monitoring by providing the means to
quickly and a real time action.
• Raspberry Pi board class: it retrieves the various data from the STM32 board and
sends commands.
• STM32 custom board: it collects data from the sensor class and allows control of
the actuator class.
• Sensor class: it captures the measurement and detects the presence of an object.
• Actuator (motor) class: it allows to modify the behavior or state of the system.
• Database class: it records every data recovery from the Raspberry Pi board.
• Dashboard class: this is the place where it will be displayed the data recovered by
the Raspberry Pi board.
24
CHAPTER 3. DESIGN OF A CONVEYOR MANAGEMENT SYSTEM
25
CHAPTER 3. DESIGN OF A CONVEYOR MANAGEMENT SYSTEM
The workplace section is in center of the window and the workspace panel button on the
bottom right and the status bar on the bottom left provide feedback on the current status.
We can also see the user icon that represent the current user information and the gear
icon that present description and learning about materials. Figure 3.3 presents Altium
primary Global User Interface (GUI).
26
CHAPTER 3. DESIGN OF A CONVEYOR MANAGEMENT SYSTEM
3.4.2 Libraries
In Altium, libraries can be downloaded or created as explained below.
27
CHAPTER 3. DESIGN OF A CONVEYOR MANAGEMENT SYSTEM
• Schematic connection
Wires provides a means of connection between components within a page, so after
placement the different component must be connected, then adding power connec-
tion, ground connection and buses if needed.
Net Labels used to connect two components from two different sheets, it is important
to they be placed on a wire or on a pin. Two pins or two wires have the same name
of Net Label will be electrically connected. Ports also used to connect components
from different sheets.
• Project compilation
With all the components placed, everything is wired, and ports added for connection
between the schematics, the design can be compiled. If there are errors found in the
compile, the message window panels will open.
28
CHAPTER 3. DESIGN OF A CONVEYOR MANAGEMENT SYSTEM
The global sheet shown in the Figure3.6 below, presents the STM32F407VGT6
microcontroller with its various connected ports, as well as the power supply board
of this microcontroller and the clocks,. There are two clocks: HSE (High Speed
External) clock, it is clocked by a 8MHz and LSE (Low Speed External) clock, it is
clocked by a 32.768KHz for RTC (Real Time Clock) with calibration.
29
CHAPTER 3. DESIGN OF A CONVEYOR MANAGEMENT SYSTEM
This sheet below represents the Ethernet port connection. The RMII (Reduced
Media Independent Interface) is used. The RMII is standardized by IEEE 802.3u
to connect a fast Ethernet Media Access Control (MAC) to an external PHY chip.
LAN8720AI-CP is chosen, as an Ethernet physical layer transceiver (PHY) chip,
that supports RMII standard. Figure 3.7 shows Ethernet schematic sheet.
This sheet below represents the USB (Universal Serial Bus) port connection. Using
USB FS (Full Speed), with a speed rate of 12 Mbit/s.
STMPS2171 provide protection, it’s a power distribution switches intended for
applications where heavy capacitive loads and short-circuits are likely to be encoun-
tered as our case. STMPS2171 provide protection against overheating and over
current. ESDA6V1L is used for ESD (Electrostatic Discharge) protection, ESD is
the sudden flow of electricity between 2 electrical objects caused by a short-circuit,
or dielectric breakdown. Figure 3.8 shows USB schematic sheet.
30
CHAPTER 3. DESIGN OF A CONVEYOR MANAGEMENT SYSTEM
31
CHAPTER 3. DESIGN OF A CONVEYOR MANAGEMENT SYSTEM
This sheets below represents respectively the Analog and Digital Inputs, to connect
sensors or devices with a voltage up to 24V. In this case transistors are used, such
as the PS2502-4-A (a High Isolation Voltage Transistor) to regulate the voltage
and obtain 24V.
32
CHAPTER 3. DESIGN OF A CONVEYOR MANAGEMENT SYSTEM
33
CHAPTER 3. DESIGN OF A CONVEYOR MANAGEMENT SYSTEM
34
CHAPTER 3. DESIGN OF A CONVEYOR MANAGEMENT SYSTEM
35
CHAPTER 3. DESIGN OF A CONVEYOR MANAGEMENT SYSTEM
3.4.5 3D View
If the routing is complete and everything is ok, here is the custom board 3D view as is
shown in the figures below.
36
CHAPTER 3. DESIGN OF A CONVEYOR MANAGEMENT SYSTEM
It is necessary that all the boards must be connected to a router via Ethernet, for the
purpose of creating a network and connect them together.
37
CHAPTER 3. DESIGN OF A CONVEYOR MANAGEMENT SYSTEM
Figure 3.23: Montage of the photo-electric sensor with the custom board STM32
38
CHAPTER 3. DESIGN OF A CONVEYOR MANAGEMENT SYSTEM
39
CHAPTER 3. DESIGN OF A CONVEYOR MANAGEMENT SYSTEM
40
CHAPTER 3. DESIGN OF A CONVEYOR MANAGEMENT SYSTEM
• MQTT Publish/Subscribe
The principle of MQTT protocol is to publish a message, to send information and
subscribe to topics, to receive information [13].
The Figure 3.27 shows the communication with the Publish/Subscribe MQTT pro-
tocol.
If device 1 is going to publish to a topic as a client, device 2 is going to be a sub-
scriber to that same topic.
• MQTT Messages
Messages are the data or commands, to be transformed between the different devices
[13].
• MQTT Topics
Topics are the method by which we save interest in incoming messages or the way
in which we specify the message [13].
Topics are described by separate chains using a slash. Each slash is concerned with
indicating a topic level.
The Figure 3.28 shows a topic structure.
• MQTT client
Any clients can publish (to send) and subscribe (to receive). The client does not
have an address like in the email system, and the message will not directly be sent
to the client. We publish the message to the broker on a certain topic, and then the
subscribers to this topic on the same broker will receive these messages.
41
CHAPTER 3. DESIGN OF A CONVEYOR MANAGEMENT SYSTEM
• MQTT Broker
The MQTT broker protocol receives all messages from the publishers on a specific
topic, filters those messages to make the right choice as needed, and then publishes
them to all subscribers as shown in Figure 3.29 [13].
It is therefore possible to use several brokers in communication with the MQTT
protocol. In our project, we are interested in the broker Mosquitto. The latter can
be installed in the Raspberry Pi board.
"MQTTClient_disconnect()" : allows the client to disconnect from the topic. The Figure
3.30 below shows the operation flowchart of the STM32 custom board.
42
CHAPTER 3. DESIGN OF A CONVEYOR MANAGEMENT SYSTEM
As shown by Figure 3.32 the sequence diagram summarizes the different operations be-
tween the acquisition interfaces of the system.
43
CHAPTER 3. DESIGN OF A CONVEYOR MANAGEMENT SYSTEM
Figure 3.32: Sequence diagram of the different operations between the acquisition inter-
faces of the application
It should also be noted that Raspberry Pi is the central, i.e., the server of the system
that will control all the other boards. At each meter, there is a module, each module
integrates an STM32 board connected with the photoelectric sensor.
The system is divided on zones, on modules to save energy firstly (up to 50%) and
secondly to deliver the objects without accumulation and without pressure. The conveyor
system only activates the affected areas, this means that the rest of the conveyor system
remains inactive and therefore does not consume energy.
44
CHAPTER 3. DESIGN OF A CONVEYOR MANAGEMENT SYSTEM
To get the object to the end of the module where it is the sensor, it takes about
5s (The motor speed is 2.01 m/s and the distance is 1m, so the time needed to
travel this distance is 0.49 s (1/2. 01)). Therefore, if the object does not arrive
after 5s, there is an error and it must be displayed on the dashboard to alert the
user, otherwise the object is detected at the end of the module and the motor can
turn-off. Figure 3.33 shows STM32 custom board publish process.
45
CHAPTER 3. DESIGN OF A CONVEYOR MANAGEMENT SYSTEM
3.8 Conclusion
In this chapter, the different phases and stages of the STM32 custom board design were
presented. Afterwards, the different acquisition interfaces involved in the design of our
intelligent conveyor management system were given. Then, UML diagrams and flowcharts
for decision making describe the different operating cases of the conveyor management
modules. Finally, the transmission of data between the different modules, based on the
MQTT messaging protocol was ensured.
46
Chapter 4
Implementation
4.1 Introduction
In this chapter, a description and an explanation of all the followed steps during the
realization and execution of this project will be presented, such as the phase of data
integration, the configuration of the Node-RED and the creation of a dashboard for visu-
alization and analysis of multidimensional data.
To be able to use and operate the Raspberry Pi 3 board correctly, in fact, the Raspbian-
Buster-Full operating system must be installed on a 32 GB Class 10 SD card, through
Win32 Disk Imager software, this software is an indispensable way for processing disk
images using removable support programs. With it, we can, for example, write the disk
47
CHAPTER 4. IMPLEMENTATION
image of the system (Windows, Linux, etc.) on the storage medium, such as memory
card, as in our case.
To speed up the work by reducing efforts and work well using STM32F407VGT6 micro-
controller, there is a solution offered by STMicroelectronics which is the STM32cubeMX
graphics platform. This tool allows to configure pins and clocks of the microcontroller.
This software offers a pin interface for pin multiplexing and a clock tree interface for
setting appropriate frequencies for clocks and timers. STM32CubeMX then allows the
generation of a C code which is then able to initialize the microcontroller from these
configuration elements [14].
Keil uVision
48
CHAPTER 4. IMPLEMENTATION
VNC
A VNC Viewer software is an example for a client on the machine that allows us to
take control of raspberry pi.
We will have to install a client on the machine from which we want to take control of the
Raspberry Pi. For this we have installed VNC Viewer.
Indeed, VNC Viewer is a remote control and access software for an unparalleled combina-
tion of Windows, Unix, Mac and Linux computers. This software allows the VNC client
(PC) to transmit keyboard and mouse input information to the VNC server (Raspberry
Pi) over a computer network.
49
CHAPTER 4. IMPLEMENTATION
50
CHAPTER 4. IMPLEMENTATION
The project is tested using Keil uvision. For implementation, here is the important
packages that are used:
-LwIP: it is is a TCP/IP stack used as an MQTT client for STM32, to reduce memory
usage.
-FreeRTOS: is an operating system, offer a real time programming and task scheduling.
-mbedTLS: it is a software library to implement SSL (Secure Socket Layer) and TLS
(Transport Layer Security) protocols, those protocols used for the security of exchange
on the internet.
-MQTT: contains all the files of the MQTT libraries, for data transmission via MQTT
protocol.
51
CHAPTER 4. IMPLEMENTATION
52
CHAPTER 4. IMPLEMENTATION
In Node-RED, a message object is usually called ’msg’ and it had three properties by
default:
The MQTT node send message as an input to either start the system or shut it down.
Message can be composed of a JSON format that can contains many information that we
can extract and use in the system.
53
CHAPTER 4. IMPLEMENTATION
Output Nodes:
We send output in the system in MQTT nodes to publish commands to the modules.
Data can also be used in other nodes for functions, or it can be stored in a data base
Node.
Processing/Function Nodes:
They allow processing incoming data and can be used to write custom code and con-
vert data types.
54
CHAPTER 4. IMPLEMENTATION
Communication with the client through the MQTT protocol is done according to the
following four steps:
• Step 1: Raspberry Pi board Setup
• Step 2: Enable and connect Raspberry Pi board with SSH (Secure Shell)
55
CHAPTER 4. IMPLEMENTATION
A test message appears in terminal window A, the broker then directs the message from
publisher to subscriber.
4.6 DataBase
A database is a collection of information ,which can be accessed through a database
management system or DBMS (such as SQL Server, MS Access, MySQL, Oracle, etc.).
All these functions can store data in related linked tables.
56
CHAPTER 4. IMPLEMENTATION
57
CHAPTER 4. IMPLEMENTATION
4.7 Dashboard
In this section we will present the different technologies used for the realization of the
dashboard as well as our different dashboard interfaces.
4.7.1 Grafana
Grafana is an analysis platform for all indicators. Metrics are any data (or time series
data, so to speak) that you want to track over time. It allows you to add custom queries,
visualize, issue alerts, and understand metrics no matter where they are stored. Create,
explore, and share dashboards with your team, and cultivate a data-driven culture. It
is a collection of independent panels arranged on a grid, with a set of variables (such as
server, application, and sensor names). It can help us analyze and monitor data over a
period, which is called time series analysis [16]. Figure 4.22 shows Grafana logo.
58
CHAPTER 4. IMPLEMENTATION
4.7.2 Javascript
JavaScript is a client-side scripting language, which means that the source code is pro-
cessed by the client’s web browser instead of on the web server. This means that JavaScript
functions can run after the web page is loaded without communicating with the server.
For example, a JavaScript function can check the web form before submitting it to ensure
that all required fields have been filled in [17]. Figure 4.23 shows Javascript logo.
4.7.3 CSS
Cascading style sheets, abbreviated as CSS, is a simple language designed to simplify the
process of making web pages that can be rendered. CSS allows you to apply styles to web
pages. More importantly, CSS enables you to do this independently of the HTML that
makes up each web page. CSS is easy to learn and understand, but it provides powerful
control over the presentation of HTML documents [18]. Figure 4.24 shows CSS logo.
59
CHAPTER 4. IMPLEMENTATION
The Table 4.2 below represents the detailed description of the use case diagram shown in
the Figure 4.25.
60
CHAPTER 4. IMPLEMENTATION
61
CHAPTER 4. IMPLEMENTATION
The Figure 4.27 shows the authentication interface in which the admin or the viewer
can access the different application functionalities.
62
CHAPTER 4. IMPLEMENTATION
63
CHAPTER 4. IMPLEMENTATION
64
CHAPTER 4. IMPLEMENTATION
65
CHAPTER 4. IMPLEMENTATION
Figure 4.31: Sequence diagram of the connection between the Database and the Dash-
board
4.9 Conclusion
This chapter covered all the realization steps we followed to achieve most of the project
objectives, starting by the communication between the STM32 module and the broker us-
ing the MQTT messaging protocol, then Node-RED programming flows in the Raspberry
PI with its successfully connection to the broker and the time series database to collect
the data acquired in real time. Finally, a presentation of the different interfaces of both,
control system and supervision environment was given.
66
General Conclusion
Our Project is entitled "Conception and realization of a smart conveyor system". Its
main objectives are the designing and creating of custom boards which we called them
modules in this project, enhancing the conveyor system features by adding various IoT
technologies, ensuring a connectivity with the different components in the system such
as sensors or actuators and managing of various aspects of the system, such as energy
consumption, or time regulations.
Our solution comes also with a dashboard to allow users to manage and control the flow
of data in the conveyor system either by storing them in databases or analyzing them for
future use.
During the realization of our project, we managed to develop a team spirit, we distributed
the different tasks. Each member of the group had a preference in the areas encountered:
programming, electronics, Hardware design, etc.
This experience also allowed us to initiate ourselves in complex projects and get an un-
derstanding of fundamental basics of IoT and how we can integrate such a technology in
our lives.
We carried out this work, while putting into practice some theoretical knowledge acquired
during our academic training at ISTIC (Higher Institute of Information and Communi-
cation Technologies) and certainly, this project is a great opportunity that allows us to
become familiar with industrial processes and to know new technologies and new skills
that can help us in the rest of our professional or academic career and to enhance our
technical knowledges on the theoretical and practical level.
67
Appendix A
• Ethernet port.
A.2 Characteristics :
In the following table, we show the different characteristics of our STM32 custom board:
68
Appendix B
B.1 Specification
• Replacing the desktop PC: With high speed and performance, the Raspberry Pi 3
board behaves like a desktop computer, it is very advanced compared to previous
models.
• Networking: The Raspberry Pi 3 comes with Gigabit, Bluetooth and with built-in
wireless networking.
• Quiet and low power consumption: The Raspberry Pi 3 is without a fan, energy
efficient, runs without a noise with lower energy and power consumption, compared
to other computers.
B.2 Characteristics :
In the following table we expose the different characteristics of Raspberry Pi 3 board
Model B + .
69
APPENDIX B. RASPBERRY PI 3 BOARD MODEL B+
70
Appendix C
Photoelectric sensor
C.1 Specification
Among its specifications, we can cite the following criteria:
• Dimension: 16 mm x 39.5 mm x 12 mm
• Weight:30g
• Supply voltage: 10 V DC / 30 V DC
• Current consumption: 20 mA
71
Appendix D
D.1 Specification
Among its specifications, we can cite the following criteria::
• Rated voltage:24 V to 48 V
• Power:20 W to 50 W
72
Appendix E
Altium designer
E.1 Features
The great strength of Altium Designer is the many tools that it integrates by default.
This software represents a single computer solution to design and develop an electronic
assembly from the schematic to the programming of the components of this schematic.
Here are the main features of this software:[10]
• The unique tool simplifies the work between schematic editor, simulation, PCB
realization and all other features.
• Realize a prototype via the software thanks to the various tools, including a 3D
visualization tool.
• Continuous update.
• Suitable for the future (considers some new technologies and regular update).
73
Bibliography
[1] https://aro-teq.com
[2] https://fr.linkedin.com/company/aroteq
[3] https://www.gebhardt-foerdertechnik.de/en/products/tote-carton-transport-technology
straight-routes-accumulation/inclined-roller-conveyor/
[4] https://www.apatransport.com
[5]https://projects-raspberry.com/new-raspberry-pi-3-model-b-features-and-purchase/
[6]https://www.sick.com/de/en/photoelectric-sensors/c/g172752?q=:Def_Type:Product
[7]https://www.interroll.com/fr/rollerdrive-ec5000/
[8]http://www.automation-sense.com/medias/files/manuel-factory-i-o.pdf
[9]https://www.amtekcompany.com/technical-training-equipment/programmable-logic-contro
real-games/
[10]http://www.elektronique.fr/logiciels/altium-designer.php
[11]http://www.steves-internet-guide.com/mqtt/
[12]https://www.bevywise.com/blog/5-reasons-why-we-choose-mqtt-protocol/
[13]https://randomnerdtutorials.com/what-is-mqtt-and-how-it-works/
[14]https://wiki.st.com/stm32mpu/wiki/STM32CubeMX
[15]https://mosquitto.org/
[16]https://aspiresoftware.in/blog/introduction-to-grafana/
[17]https://techterms.com/definition/javascript
[18]https://developer.mozilla.org/en-US/docs/Learn/CSS/First_steps
74
List of abbreviations
75
Résumé
Ce travail fait partie de notre projet de fin d’étude, présenté afin d’obtenir la licence
appliquée en informatique industrielle, systèmes embarqués de l’Institut supérieur des
technologies de l’information et des communications de Borj Cedria (ISTIC). L’objectif
de ce projet est la mise en oeuvre des modules personnalisés destinés pour les convoyeurs
utilisés dans les entreprises de fabrication.Les modules collectent les mesures issues des
capteurs et les envoies au Cloud via des protocoles de communication bien définis, ainsi
ces mesures sont affichées directement dans un tableau de bord.
Pour la réalisation de la solution proposée, nous avons commencé par explorer
les bases fondamentales de l’IoT et comment mettre en oeuvre la technologie dans les
machines autonomes dans l’industrie. Ces données sont transférées et enregistrées dans
une base de données pour les affichées ensuite sur la page web pour la supervision à
distance.
Mots clés : Convoyeurs ; Systéme de gestion ; IoT ; Tableau de bord ; Carte person-
nalisée ; Protocoles de communication
Abstract
This Work is a part of our graduation project, presented in order to obtain the
applied license in Industrial Computing, Embedded Systems from the Higher Institute
of Information and Communications Technologies of Borj Cedria (ISTIC). We focused
on implementing custom modules for conveyors used in manufacturing companies. The
modules collect measurements and send them to the cloud using different communication
protocols, thereby these measurements are directly displayed in a dashboard.
This Project was carried out within the company AROTEQ, which is an engi-
neering and information technology service company. For the realization of the proposed
solution, we started by exploring the IoT fundamental basics and how to implement the
technology in autonomous machinery in the industry, following this study we started de-
veloping a custom board for acquiring data from our Conveyor. This data is transferred
and saved in a database for data displayed on the web page for remote supervision.
Keywords: Conveyors ; Management System ; IoT ; Dashboard ; Custom Board ;
Communication Protocols
Adresse du site: Route de Soliman, Technopole de Borj Cédria, Adresse postale : BP 123,
Hammam Chatt 1164, Ben Arous, Tunisie - Téléphone: (216) 79 32 67 63 ; (216) 79 32 67 90 ;
(216) 79 32 67 91 ; (216) 79 32 67 92 - Fax: (216) 79 32 67 64 - Site web: www.istic.rnu.tn