Download as pdf or txt
Download as pdf or txt
You are on page 1of 86

Tunisian Republic

Ministry of Higher Education


and Scientific Research
University of Carthage
Higher Institute of Information and
Communication Technologies

Graduation Report
Presented for the purpose of obtaining
Applied Bachelor in Industrial Computing
Mention : Industrial Computing
Curriculum: Embedded Systems

Conception and realization of a smart


conveyor system

By
Cyrine LABIDI and Mohamed Aziz BEN SLIMANE

Comapny Name: AROTEQ

Publicly presented on June 3, 2021 in front of the jury composed by:


President:: Malek BELOUDA,Assistant Professor,ISTIC
Reviewer: Emna AKKARI, Assistant Professor,ISTIC
Professional supervisor: Saber ABEDA, Co-Founder and CTO,AROTEQ
Academic supervisor: Manef BOUROGAOUI, Assistant Professor,ISTIC

Academic year: 2020-2021


Tunisian Republic
Ministry of Higher Education
and Scientific Research
University of Carthage
Higher Institute of Information and
Communication Technologies

Graduation Report
Presented for the purpose of obtaining
Applied Bachelor in Industrial Computing

Conception and realization of a smart


conveyor system

By
Cyrine LABIDI and Mohamed Aziz BEN SLIMANE

Company Name: AROTEQ

Authorization to deposit the End-of-Studies Project Report:

Professional supervisor: Academic supervisor:


Saber ABEDA Manef BOUROGAOUI

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.

aaaaaaaaaaaaaallllkkkkkkkkkkkkkCyrine LABIDI and Mohamed Aziz BEN SLIMANE

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

1 Presentation of the project context 3


1.1 Introduction . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 3
1.2 Host company . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 3
1.2.1 General presentation . . . . . . . . . . . . . . . . . . . . . . . . . . 3
1.2.2 Information about the company . . . . . . . . . . . . . . . . . . . . 4
1.2.3 The company activities . . . . . . . . . . . . . . . . . . . . . . . . 4
1.2.4 The company partners . . . . . . . . . . . . . . . . . . . . . . . . 4
1.2.5 The company products . . . . . . . . . . . . . . . . . . . . . . . . 4
1.3 Project Presentation . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 5
1.3.1 Project description . . . . . . . . . . . . . . . . . . . . . . . . . . . 5
1.3.2 Planning and Project Management . . . . . . . . . . . . . . . . . . 6
1.3.3 Analyze the requirements of the system . . . . . . . . . . . . . . . 9
1.3.4 Proposed solution . . . . . . . . . . . . . . . . . . . . . . . . . . . 10
1.4 Conclusion . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 12

2 Presentation and Study of the Project Components 13


2.1 Introduction . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 13
2.2 Roller conveyor . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 13
2.2.1 Conveyor advantages . . . . . . . . . . . . . . . . . . . . . . . . . . 14
2.2.2 Criteria for choosing a conveyor . . . . . . . . . . . . . . . . . . . . 14
2.3 The proposed conveyor system . . . . . . . . . . . . . . . . . . . . . . . . . 15
2.3.1 The proposed IoT application . . . . . . . . . . . . . . . . . . . . . 15
2.3.2 The proposed conveyor versus the existing ones . . . . . . . . . . . 16
2.4 The project components . . . . . . . . . . . . . . . . . . . . . . . . . . . . 16
2.4.1 STM32F407 microcontroller . . . . . . . . . . . . . . . . . . . . . . 16
2.4.2 Raspberry Pi 3 board Model B+ . . . . . . . . . . . . . . . . . . . 18
2.4.3 Photoelectric sensor . . . . . . . . . . . . . . . . . . . . . . . . . . 19
2.4.4 Roller Driver EC5000 . . . . . . . . . . . . . . . . . . . . . . . . . . 20
2.5 Smart conveying system design . . . . . . . . . . . . . . . . . . . . . . . . 21
2.5.1 Mechanical design software (Factory IO) . . . . . . . . . . . . . . . 21
2.5.2 Virtual system view . . . . . . . . . . . . . . . . . . . . . . . . . . 22
2.6 Conclusion . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 22

iii
CONTENTS

3 Design of a conveyor management system 23


3.1 Introduction . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 23
3.2 Intelligent conveyor . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 23
3.3 Global class diagram . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 24
3.4 Custom board design . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 25
3.4.1 Starting a project . . . . . . . . . . . . . . . . . . . . . . . . . . . . 26
3.4.2 Libraries . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 27
3.4.3 Schematic design . . . . . . . . . . . . . . . . . . . . . . . . . . . . 28
3.4.4 PCB Design . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 35
3.4.5 3D View . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 36
3.5 General system architecture . . . . . . . . . . . . . . . . . . . . . . . . . . 37
3.6 Conveyor management system . . . . . . . . . . . . . . . . . . . . . . . . . 38
3.6.1 Optical sensor montage . . . . . . . . . . . . . . . . . . . . . . . . . 38
3.6.2 Motor management system . . . . . . . . . . . . . . . . . . . . . . 39
3.7 MQTT protocol . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 40
3.7.1 Presentation . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 40
3.7.2 MQTT advantages . . . . . . . . . . . . . . . . . . . . . . . . . . . 40
3.7.3 Basic concept . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 40
3.7.4 Raspberry Pi and STM32 custom board library . . . . . . . . . . . 42
3.7.5 Communication process between boards . . . . . . . . . . . . . . . 44
3.8 Conclusion . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 46

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

4.8.4 The Dashboard Interface . . . . . . . . . . . . . . . . . . . . . . . . 64


4.9 Conclusion . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 66

General Conclusion 67

A STM32 custom board 68


A.1 STM32 microcontroller specification . . . . . . . . . . . . . . . . . . . . . 68
A.2 Characteristics : . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 68

B Raspberry Pi 3 board Model B+ 69


B.1 Specification . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 69
B.2 Characteristics : . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 69

C Photoelectric sensor 71
C.1 Specification . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 71

D Roller Driver EC5000 72


D.1 Specification . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 72

E Altium designer 73
E.1 Features . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 73

Bibliography 74

v
List of Figures

1.1 Logo of the company AROTEQ . . . . . . . . . . . . . . . . . . . . . . . . 3


1.2 Project Lifecycle . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 6
1.3 Agile Scrum . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 7
1.4 Our system management tool . . . . . . . . . . . . . . . . . . . . . . . . . 8
1.5 Project planning . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 8
1.6 System architecture . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 11

2.1 Roller conveyor[3] . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 13


2.2 The IoT Cycle . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 15
2.3 The Gateway Model . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 15
2.4 STM32F407 microcontroller . . . . . . . . . . . . . . . . . . . . . . . . . . 17
2.5 Raspberry Pi 3 Model B + board [5] . . . . . . . . . . . . . . . . . . . . . 19
2.6 Photoelectric sensor SICK W4-3 [6] . . . . . . . . . . . . . . . . . . . . . 19
2.7 Interroll RollerDriver EC5000 [7] . . . . . . . . . . . . . . . . . . . . . . . 20
2.8 Factory IO logo . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 21
2.9 Virtual view of the conveyor . . . . . . . . . . . . . . . . . . . . . . . . . 22

3.1 Global class diagram . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 25


3.2 Altium Designer Logo . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 25
3.3 Altium primary GUI . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 26
3.4 Project different files . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 27
3.5 Component library example . . . . . . . . . . . . . . . . . . . . . . . . . . 27
3.6 Global schematic sheet . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 29
3.7 Ethernet schematic sheet . . . . . . . . . . . . . . . . . . . . . . . . . . . . 30
3.8 USB schematic sheet . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 31
3.9 Relay schematic sheet . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 32
3.10 Analog Inputs schematic sheet . . . . . . . . . . . . . . . . . . . . . . . . . 32
3.11 Digital Inputs schematic sheet . . . . . . . . . . . . . . . . . . . . . . . . . 33
3.12 Power and Regulator schematic sheet . . . . . . . . . . . . . . . . . . . . . 34
3.13 FT232RL schematic sheet . . . . . . . . . . . . . . . . . . . . . . . . . . . 34
3.14 PCB Design . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 35
3.15 Top Layer . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 36
3.16 Bottom Layer . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 36
3.17 Power Layer . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 36
3.18 High Speed Layer . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 36
3.19 Top 3D board view . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 36
3.20 Buttom 3D board view . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 37
3.21 Board dimension . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 37
3.22 General system architecture . . . . . . . . . . . . . . . . . . . . . . . . . . 38

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

4.1 acer logo . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 47


4.2 intel logo . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 47
4.3 Raspbian-Buster-Full operating system logo . . . . . . . . . . . . . . . . . 48
4.4 STM32cubeMX Logo . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 48
4.5 keil uvision Logo . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 49
4.6 VNC logo . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 49
4.7 Data acquisition flow . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 50
4.8 STM32CubeMX interface . . . . . . . . . . . . . . . . . . . . . . . . . . . 50
4.9 The IDE Tool Environment . . . . . . . . . . . . . . . . . . . . . . . . . . 51
4.10 Node-red Logo . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 52
4.11 Node-red flow Editor . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 52
4.12 Input Nodes . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 53
4.13 Output Nodes . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 54
4.14 Processing/Function Nodes . . . . . . . . . . . . . . . . . . . . . . . . . . . 54
4.15 mosquitto logo . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 54
4.16 Data flow scenario . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 55
4.17 Screenshot of Terminal B(Publisher) . . . . . . . . . . . . . . . . . . . . . 56
4.18 Screenshot of Terminal A(Subscriber) . . . . . . . . . . . . . . . . . . . . . 56
4.19 System Properties Comparison . . . . . . . . . . . . . . . . . . . . . . . . 57
4.20 InfluxDB logo . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 58
4.21 SSD2 Measurement Structure . . . . . . . . . . . . . . . . . . . . . . . . . 58
4.22 Grafana Logo . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 59
4.23 Javascript Logo . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 59
4.24 CSS Logo . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 59
4.25 Global use case Diagram . . . . . . . . . . . . . . . . . . . . . . . . . . . . 60
4.26 SignUp Interface . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 62
4.27 SignUp Interface . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 62
4.28 Sign up Sequence Diagram . . . . . . . . . . . . . . . . . . . . . . . . . . . 63
4.29 Admin control panel . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 64
4.30 Supervision Interface . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 65
4.31 Sequence diagram of the connection between the Database and the Dash-
board . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 66

vii
List of Tables

1.1 AROTEQ data . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 4


1.2 AROTEQ products . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 5

2.1 A Comparison between the two solutions . . . . . . . . . . . . . . . . . . . 16


2.2 Comparison table between Arduino Mega microcontroller and STM32f407 . 18

4.1 work environment description . . . . . . . . . . . . . . . . . . . . . . . . . 47


4.2 Textual description of use cases . . . . . . . . . . . . . . . . . . . . . . . . 61

A.1 STM32 custom board characteristics . . . . . . . . . . . . . . . . . . . . . 68

B.1 Characteristics of Raspberry Pi 3 board Model B + . . . . . . . . . . . . . 70

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 conveyor automation is performed based on the acquisition process through a


photo-electrical sensors and the action process through electrical motors.

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 report is divided into four chapters:

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

Presentation of the project context

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.

1.2 Host company


In this section, the AROTEQ company is presented based on its data and activities.

1.2.1 General presentation


AROTEQ is an industrial automation company that designs and manufactures customized
machines. It provides a complete solution: cell robots, automated production lines [1].
The company’s logo is given by Figure 1.1.

Figure 1.1: Logo of the company AROTEQ

3
CHAPTER 1. PRESENTATION OF THE PROJECT CONTEXT

1.2.2 Information about the company


A summary of the company’s main information is given in Table 1.1.

Table 1.1: AROTEQ data


Company Characteristics
Sector Industrial automatisms
Size 13 employees
Head office Monplaisir, Tunis
Type Individual company
Address City Iskan 2, Ben arous, Tunis
Date of creation 2011
Contact contact@aro-teq.com

1.2.3 The company activities


AROTEQ has always been one of the leading manufacturers of assembly and control
machines and the best partner for personal automation solutions. When it comes to
product industrialization or productivity improvement, the company deploys its skills
through its engineers to design industrial solutions based on strong suggestions and ideas.
The proficiency of the entire manufacturing process from the design to the final step
of production enables AROTEQ to develop personalized services with competitive and
reliable products.
AROTEQ’s commitment to quality provides all guarantees for a true partnership. In
addition to providing efficient services that suit the company’s specific needs, it also
pursues excellent products and services every day [2].

1.2.4 The company partners


• Bosch Rexroth: It is a world leader in mobile applications, industrial equipment
and automation.

• Keyence: Manufacturer of sensors, machine vision systems, measuring instruments


and programmable controllers.

• Festo: is a global supplier of pneumatic and electrical industrial automation systems.

• Equip Test: Is a global player in the manufacture of test equipment for printed
circuit boards.

1.2.5 The company products


The different AROTEQ products are given in Table 1.2 [1]

4
CHAPTER 1. PRESENTATION OF THE PROJECT CONTEXT

Table 1.2: AROTEQ products


AROTEQ designs and manufactures
customized assembly and control
Special assembly machines
machines, fully automatic, semi-
automatic or manual workstations
AROTEQ integrates industrial robot
systems into its automation solutions and
Industrial robotics
becomes your ideal partner for robot
integration projects
Excellent functional testers are excellent
communicators, combining technical skills
Functional Testers
with a deep understanding of the
company’s requirements
AROTEQ provides various linear
conveyors. The range includes vibration
Conveyors rails, fluid rails and conveyors, different
lengths to suit the characteristics of the
room and your needs

1.3 Project Presentation


In this section, the system functionalities, goals and needs are presented as well as the
planning and project management is described, and it ends up with the proposed solution

1.3.1 Project description


The project objectives are the design and implementation of a connected and intelligent
conveyor system which can be configured, controlled and managed remotely using a web
interface. Our conveyor is divided into different parts.
In each part, there is a module designed mainly for data collection and processing in
order to make the suitable decision, all that to deliver the transported object to the right
recipient and at the right time without accumulation of objects and without pressure. It
is worth nothing that the conveyor behaves autonomously and intelligently.

The proposed system ensures the following functions:

- Provide computer-assisted control and configuration of the module,

- 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,

- Transport the boxes to the right way,

- Activate and deactivate the system parts to save energy,

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.3.2 Planning and Project Management


1.3.2.1 The workflow methodology
Project life cycle is a very important phase among the project management phases, for this
we chose to adopt the Project Management Institute (PMI) life cycle. This methodology
defines five phases of the project management. It includes the design and initiation,
planning, execution, performance / monitoring and the project closure. Figure 1.2 present
a project Lifecycle phases.

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.

4. PROJECT PERFORMANCE / CONTROL: This is about measuring the progress


and performance of the project and making sure that everything that happens is
aligned with the project management plan.

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.

Figure 1.2: Project Lifecycle

6
CHAPTER 1. PRESENTATION OF THE PROJECT CONTEXT

1.3.2.2 Project management methodology


Project management is the criteria for initiating, planning, executing, controlling and
ending teamwork to achieve specific goals and correctly manage time.

-Commonly used project management methodologies:

Agile Software Development: is a software development methodology. We use this soft-


ware to manage our project. Agile is a set of a framework and practices. It focuses on
the people, their needs, so that they can do the work and the methods to do the dialogue
between the stakeholders of the project, all this to achieve the work requested. It is char-
acterized by cycles, short time spaces(sprints), team culture, real-time communication,
for good control and good organization of the project. We chose Scrum as a management
tool, it is an Agile methodology, it is the best solution to improve the productivity of the
team. There is a Scrum Master who will manage the project and help the team move
forward, improve and overcome obstacles. Figure 1.3 present Agile Scrum Management
Tool.

Figure 1.3: Agile Scrum

-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.

Figure 1.4: Our system management tool

1.3.2.3 Project planning


Project planning is an indispensable step in its realization. It allows accurate monitoring
of the tasks progress. For this, it is necessary to put in place a set of work packages to
be respected for a better organization according to the defined deadlines. For each work
package, a period of time is assigned for its finalization.
Figure 1.5 highlights the different project phases.

Figure 1.5: Project planning

8
CHAPTER 1. PRESENTATION OF THE PROJECT CONTEXT

1.3.3 Analyze the requirements of the system


To clearly specify the requirements of the studied system, the key participants in the
system are defined, then the functional and non-functional requirements are introduced.

1.3.3.1 Identify the key system components


The different system requirements are classified and studied; hence the following compo-
nents are identified:

• 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.

• Database Management System (DBMS): it allows the management, manipulation


and local storage of data.

• Web interface: it allows the system monitoring and controlling as well as the con-
figuration of the transmission system.

• Server (Raspberry PI board): it is responsible for collecting and processing the


data coming from the different modules. These data are the measurements of the
different sensors collected by each module. They are sent by the server continuously
to a database to view them in a web interface. Thus, the server it may receive
control actions to maintain the system operation when required.

• STM32 custom Board: it acquires data from the optical sensor and send them to
the server via the MQTT protocol.

• MQTT protocol: it represents the communication link between the Raspberry Pi


board and the STM32 custom board.

1.3.3.2 Functional requirements


Functional requirements express an action that the system must perform in response
to a request. Therefore, there are requirements related to the system operation to be
developed. In this work, the conveyor management system should be able to establish the
following features:

• Acquire measurement data from different sensors,

• 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

• Remotely control and supervise the motion of the various boxes,

• Ensure the authentication and registration of the different users and control the
access to their accounts,

• Manage the different administrators and users accounts,

• Store data and display it in a web interface.

1.3.3.3 Nonfunctional requirement


When the functional requirement expresses the specific function of the product, the non-
functional requirement is an indicator of the delivery quality of the functional require-
ment. In other words, functional requirements can only be met when the corresponding
non-functional requirements are also met. Our system must ensure that the following
requirements are met:

• Performance: speed of the system execution, usually in terms of response time.

• 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.

1.3.4 Proposed solution


The architecture of the proposed smart conveyor management system is described in
Figure 1.6.
It details and describes the different system components with its communication flow.

10
CHAPTER 1. PRESENTATION OF THE PROJECT CONTEXT

Figure 1.6: System architecture

1.3.4.1 Data collection and acquisition module

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.

1.3.4.2 Actuator module

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.

1.3.4.4 Web communication tool

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

Presentation and Study of the


Project Components

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.

2.2 Roller conveyor


A conveyor is a mechanical device which transports various objects from one point to
another. The object can be moved quickly and efficiently using several types of conveyor
like roller conveyors, belt conveyors, wheel conveyor or chain conveyors. These conveyor
systems are widely used in industrial applications. In this project, the roller conveyor is
considered due to its efficiency when it comes to transport lightweight units.

Figure 2.1: Roller conveyor[3]

13
CHAPTER 2. PRESENTATION AND STUDY OF THE PROJECT COMPONENTS

2.2.1 Conveyor advantages


In order to cope with the growth of the company’s internal demand, it is necessary to
establish a real supply chain. A good idea is to install a conveyor during the production
routings. The latter will increase the efficiency[4]:

• Highly interesting productivity:

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.

• More convenient to carry loads:

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 .

2.2.2 Criteria for choosing a conveyor


The criteria for choosing a conveyor are presented below:

• Type of product to be transported:

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.

• Other points to consider:

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.

2.3 The proposed conveyor system


In this project, the proposed conveyor is an enhanced system version based on the IoT
applications.

2.3.1 The proposed IoT application


The IoT in our project is mainly composed of sensors that detect the presence of a moving
unit in the conveyor along with the timestamp and send the data to the different modules
in order to generate the suitable control actions for the motor.
The choice of the IoT platform requires the understanding of the specific requirements
of our system structure. That is why different aspects must be taken into consideration,
namely the network’s infrastructures, compatibility with telecommunication protocols
standards between the customized modules and the gateways as presented in Figure 2.2.

Figure 2.2: The IoT Cycle

-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.

Figure 2.3: The Gateway Model

15
CHAPTER 2. PRESENTATION AND STUDY OF THE PROJECT COMPONENTS

-Connectivity used by the gateway:


• Short-range networks (WIFI, Bluetooth, ZigBee, etc. ....)
These networks are designed to transmit information over short distance.
• Long-range cellular networks (2G, 3G, 4G)
The advantage of these networks lies in their very large coverage and reliability.
• Long-range, low-frequency networks (Sigfox, LoRa)
LPWA (Low Power, Wide Area) networks are M2M (Machine to Machine) long-
distance networks dedicated to IoT: they can communicate over long distances au-
tonomously.

2.3.2 The proposed conveyor versus the existing ones


The conveyors are widely used basically in industrial applications and different technolo-
gies and solutions exist in the market. However, in this work, the proposed solution is
based on the new IoT technology to create a Smart Conveying System (SCS) which is
totally connected and remotely controlled. The Table 2.1 below gives a comparison be-
tween the two solutions, namely the traditional solution (without IoT) and the proposed
solution (with IoT).

Table 2.1: A Comparison between the two solutions

Conveying system (without IoT) Conveying system (with IoT)


-The system is automatically communicating
-Need of human factors to control the system with each other without any inter-human or
human to machine interaction
-The communication between devices is
completely transparent with better quality
-No transparency with a low quality
and fewer inefficiencies because physical
devices are able to always stay connected
-Real-time data reception and processing
-It takes time to receive and process data
-Time saving
-There is no visualization, or display -Monitor and display data via a dashboard
-Use a variety of materials that require a lot of -Saving energy and cost (the good
energy, so cost is important management of materials)
-Send alert messages or notifications in case of
-The system is not secure; we do not receive
error or problem in the conveyor system
any alerts in case of error
-More secure

2.4 The project components


2.4.1 STM32F407 microcontroller
The custom board is based on STM32F407 microcontroller. Its configuration and pro-
gramming can be done directly from the software ’STM32CubeMX’ and ’Keil’, by directly

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.

Figure 2.4: STM32F407 microcontroller

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.

• The performance of the STM32F407 is significantly better than an Arduino mi-


crocontroller when it comes to bigger projects and it is much easier to program
compared to the PIC.

17
CHAPTER 2. PRESENTATION AND STUDY OF THE PROJECT COMPONENTS

• In terms of processor, STM32F407 is very powerful compared to Arduino Mega


microcontroller, the table below shows a comparison between Arduino Mega micro-
controller and STM32F407.

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

2.4.2 Raspberry Pi 3 board Model B+


Raspberry Pi 3 Model B+ is the latest member of the Raspberry Pi 3 series, with a pow-
erful 64-bit quad-core processor, running at 1.4 GHz, a Bluetooth 4.2 / BLE connection,
and featured by dual-band (2.4 GHz and 5 GHz wireless) LAN.

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.

Thanks to an updated version of the Broadcom 64-bit processor: BCM2837B0, used


in Raspberry Pi 3, which will power the board, we can increase the speed of the clock
with reduced power consumption and better monitor the temperature changes of the chip
during its operation [5].
Its main features are given in Appendix B.

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

Figure 2.5: Raspberry Pi 3 Model B + board [5]

2.4.3 Photoelectric sensor


The SICK W4-3 photoelectric sensor is a digital sensor. It is a miniature sensor that will
work in direct reflection on objects, It has the particularity of emitting a double line beam.
The amount of light reflected by objects, particularly difficult to detect, is increased sig-
nificantly to avoid any signal interruption and thus to get a flawless detection [6].
Its main features are given in Appendix C.

Figure 2.6: Photoelectric sensor SICK W4-3 [6]

The SICK W4-3 is used as a photoelectric sensor instead of other sensor types for different
reasons as given below.

• Flawless detection: It is the Pinpoint technology which is the combination of


the new generation of LEDs directly integrated on the electronic board to ensure
the best signal acquisition. This technology developed a new type of photoelectric

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.

• Detection accuracy: thanks to a homogeneous, concentrated, and precise light


beam, it is an innovative and reliable solution compared to other detection sensors
in the field of industrial automation and logistics.

• 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.

• The particularity of emitting a double line beam:the amount of light thus


reflected by objects difficult to detect is significantly increased to avoid any signal
interruption and achieve flawless detection.

2.4.4 Roller Driver EC5000


As the widest range of motor rollers on the market, the Interroll Roller Drive EC5000 is
the ideal drive to meet the requirements of any conveyor system.
Roller Drive is an efficient DC drive for conveying objects. With its motor built into the
roller, it can control and operate several other rollers.
At each meter we need 5 rollers: a motor roller(Roller Driver EC5000) that will run the
other 4 rollers.
According to the value detected by the photoelectric sensor, the STM32 custom board
will make the decision whether to operate the motor built into the roller or not [7].
Its main features are given in Appendix D.

Figure 2.7: Interroll RollerDriver EC5000 [7]

This motor was chosen based on these criteria:

• 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.

• Compact construction: Compact construction of the conveyor thanks to the


motor integrated in the tube.

• 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.

2.5 Smart conveying system design


2.5.1 Mechanical design software (Factory IO)
Factory IO is a 3D design and simulation software used to design and simulate complete
industrial systems. Developed in the same spirit as current video games, Factory IO offers
a high degree of realism during the design and simulation phases. The software can be
interfaced with real automata to perform the control from the outside [8].

This software is used in several fields such as Electrical Engineering, Industrial Automa-
tion, Mechanical Engineering, Mechatronics and Instrumentation [9].

The Factory IO software allows:


- Designing 3D objects very accurately,
- Performing development and simulation,
- Creating images and animations of 3D objects,
- Creating a system using the built-in library of industrial parts based on common content
in typical industrial facilities,
- Building a system from scratch or using one of the available pre-built systems to get
started.
Factory IO logo is given by Figure 2.8.

Figure 2.8: Factory IO logo

21
CHAPTER 2. PRESENTATION AND STUDY OF THE PROJECT COMPONENTS

2.5.2 Virtual system view


Using Factory IO conception and design software, we illustrate the view of our conveyor.
As shown in the figure below, we worked on three meters, we divided the system into
areas of one meter each, and we added a module to control each area. As mentioned pre-
viously, it is an STM32 custom board base-module connected with photoelectric sensor
and 5 rollers, 1 motor roller (Roller Drive EC5000) to control the other four rollers.

The dimensions of our conveyor are:


-Length: 3m
-Width: 0.85 m
-Height: 0.9 m

Figure 2.9: Virtual view of the conveyor

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

Design of a conveyor management


system

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.

3.2 Intelligent conveyor


The smart conveyor equipped with smart functions allows real-time collection and anal-
ysis of different sensor states from its modules and transmits them to the web platform
via the network.
Using this major technological innovation, installation and implementation of a complete
solution will be provided quickly and reliably, which is very suitable for industrial use, to
ensure the remote, automatic and efficient conveyor management. The smart conveyor
system can also predict management behavior to achieve better control quality.

Automation of conveyors ensures at least the following advantages:

• An efficient, reliable and flexible logistics system that delivers items to the right
destination at the right time.

• A convenient way to upgrade existing facilities at a lower cost.

• An integrated motor solution is an energy-efficient alternative because the conveyor


system is divided into different zones, which can save up to 50% of energy compared
to their mechanical equivalents, the system only activates the areas concerned at
the time and place where the products are conveyed, this means that the rest of the
conveyor system zones remain inactive and thus does not consume energy. These

23
CHAPTER 3. DESIGN OF A CONVEYOR MANAGEMENT SYSTEM

activation and deactivation of centralized drives as required are a key factor in


improving energy efficiency.

• 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.

3.3 Global class diagram


A class diagram is a graphical representation, its purpose is the presentation of the inter-
faces, objects or classes of the system, as well as the operations (or method) and attributes
of each object, to describe the structure of this system and the relationship between ob-
jects.
In this project, the class diagram is defined in Figure 3.1 and its different elements are
described below.

• 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.

• Class feature: it contains all sensor information.

• 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

Figure 3.1: Global class diagram

3.4 Custom board design


Altium Designer is a powerful electronic CAD (Computer Aided Design) tool developed
by Altium, Figure3.2. This software allows capturing of electrical diagrams, checking
and simulating them, then designing of the printed circuit board. Altium also allows the
routing of printed circuits as well as the programming of FPGAs, it is the most widely
used PCB (Printed Circuit Board) design solution in the world.
It is used by many organizations, including universities and companies in aerospace, au-
tomotive, defense, medicine, telecommunications, and retail. Among the large group that
uses Altium Designer, it is possible to mention NASA and Sony [10].
Its main features are given in Appendix E.

Figure 3.2: Altium Designer Logo

25
CHAPTER 3. DESIGN OF A CONVEYOR MANAGEMENT SYSTEM

3.4.1 Starting a project


3.4.1.1 Altium environment
Figure 3.3 shows Altium Designer tool interface window. Altium uses panels and windows
within a tool to provide a consistence looking feels for all the applications.
Here we see across the top of the tool the menu bar and the active tool bar.

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).

Figure 3.3: Altium primary GUI

3.4.1.2 Project files


Each project has a schematic design files, a PCB board design file, a PCB library (contain
components footprints) and a schematic library (contain components symbols) as shown
in the Figure 3.4. Libraries are project-based and only available for use in one project
(each project has its own library), we will look at the libraries in detail in the next section.

26
CHAPTER 3. DESIGN OF A CONVEYOR MANAGEMENT SYSTEM

Figure 3.4: Project different files

3.4.2 Libraries
In Altium, libraries can be downloaded or created as explained below.

3.4.2.1 Download libraries


The Altium software package provides a library of starter programs, which are usually
basic programs, and it iss impossible to start the design process without starting to define
components with its libraries. Creating libraries is not an easy thing and it takes a lot of
time, so a million of symbols, footprints and pre-defined 3D models of components, can be
downloaded and imported directly into the latest Altium format. Electronic components
CAD data download famous websites that provides these libraries, are Ultra Librarian
and SnapEDA.
The Figure 3.5 shows a symbol, a footprint and a 3D model of a component that can be
downloaded and imported into the Altium designer software, to be utilized in a project.

Figure 3.5: Component library example

27
CHAPTER 3. DESIGN OF A CONVEYOR MANAGEMENT SYSTEM

3.4.2.2 Create custom libraries


Altium allows creating custom libraries for each component that will be used in the
project. Symbols, footprints and 3D model, can be created refer to the datasheet of that
component.
Datasheet description helps to configure pins, to know pin numbers, pins swapping, com-
ponent characteristics, mechanical data and all the package necessary information.
Companies that distribute electronic components like Digi-Key provides datasheets of any
components with a clear description and huge information, that help electrical engineers
to ensure a correct design.

3.4.3 Schematic design


3.4.3.1 Schematic design basics
• Schematic capture
After creating a project file that contain a list of schematic sheets associate with this
project, to start creating the schematic design, the components libraries downloaded
or created are required.
To place component on the schematic sheet, we have just to select it from the
installed library. We can edit the component properties, edit pins or change the
rotation.

• 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.

• Schematic updates and annotation


When component placement and connection are done, components ordering and
annotation take a place and with Altium Designer it is possible to reorder the
existing components at any point of needing. It is possible also to number and
order sheets, when there’s multiple sheets on the design and to update schematic
by adding and removing components.

• Schematic updates and annotation


To provide documentation and organization, texting graphics must be added to the
schematic, that provide more professional and readable set of schematics and make
it clearer.

• 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

3.4.3.2 Schematic design realization


In the design of the board, four main things must be presented in the board to meet
the needs of our project: First, the USB port for the implementation of the code in the
microcontroller of the board. Second, the Ethernet port to connect the boards with each
other in order to have the data delivered and exchanged and create a network. Third,
the motor relays, in our case the motor requires a current of 24 V to operate however
the board only delivers a current of 3.6 V maximum so a relay is needed and finally, the
Analog and Digital Inputs. It should be noted that it has another component of protection
and regulation that will be explained later.
To properly organize the work, the schematic design of the project is divided on different
sheets as shown below.
• Global schematic sheet

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.

Figure 3.6: Global schematic sheet

• Ethernet schematic sheet

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.

Figure 3.7: Ethernet schematic sheet

• USB 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

Figure 3.8: USB schematic sheet

• Relay schematic sheet

A relay in an electromechanical switch which is used in industrial application to


provide isolation between high voltage and low voltage circuit (2 circuits have a
different voltage rating). In fact, the microcontroller doesn’t have enough current
sourcing ability to excite relays. Therefore, a relay driver circuit IC is used to supply
relays properly. The ULN2803 reference is used as a relay driver IC. It consists
of eight NPN Darlington transistors which provides the proper current amplifica-
tion. This sheet below represents the relay schematic sheet. Figure 3.9 shows Relay
schematic sheet.

31
CHAPTER 3. DESIGN OF A CONVEYOR MANAGEMENT SYSTEM

Figure 3.9: Relay schematic sheet

• Analog and Digital Inputs schematic sheet

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.

Figure 3.10: Analog Inputs schematic sheet

32
CHAPTER 3. DESIGN OF A CONVEYOR MANAGEMENT SYSTEM

Figure 3.11: Digital Inputs schematic sheet

• Power and Regulator schematic sheet

For the regulator, TL1963A-33DCQR reference is used, it is a low-dropout (LDO)


regulator optimized for fast transient response and have very low output noise, which
makes it ideal for sensitive supply applications.
BQ24320RGTR is used to charge the battery, this component features Dynamic
Power-Path Management (DPPM) that powers the system while simultaneously and
independently charging the battery. This feature reduces the number of charge and
discharge cycles on the battery, allows for proper charge termination, and enables
the system to run with a defective or absent battery pack. Additionally, this enables
instant system turn-on even with a totally discharged battery.
For battery protection, BQ29733DSER component is required. It’s a battery cell
protection device provides an accurate monitor and trigger threshold for overcurrent
protection during high discharge/charge current operation or battery overcharge
conditions. To provide the best protection, a power MOSFET (CSD16406Q3)
must be presented in the schematic, which has been designed to minimize losses in
power conversion applications.
All components are presented in the sheet below, and there is also the power circuit
of the USB and the power button circuit.
Figure 3.12 shows Power and Regulator sheet.

33
CHAPTER 3. DESIGN OF A CONVEYOR MANAGEMENT SYSTEM

Figure 3.12: Power and Regulator schematic sheet

• FT232RL schematic sheet

The FT232RL component of the FTDI (Future Technology Devices International


Limited) company is a serial USB to UART interface, which can be used to program
and transfer data. Figure 3.13 shows FT232RL schematic sheet.

Figure 3.13: FT232RL schematic sheet

34
CHAPTER 3. DESIGN OF A CONVEYOR MANAGEMENT SYSTEM

3.4.4 PCB Design


After creating the schematic design, it is transferred from the schematics to a PCB. The
first step for preparing the transfer of the design to the PCB is to ensure that all the
components have a footprint; otherwise, it will be reported as an error.
After components validation, if there is a missing footprint, it must be created. The
schematic designer must provide additional information in the form of rules that transfer
over the PCB from schematic. Adding rules directives to the schematic provides for better
flow between schematic and the PCB design.
After transferring and placing the footprints on the PCB board one by one, here it is the
most necessary part: the routing. PCB track routing is one of the most important aspects
for PCB design. Altium introduces design tools that can intelligently help to successfully
route PCB designs by following the most advanced available rules and techniques of rout-
ing.
The routing can be done on different layers. There are the top layer, the bottom layer
and many mechanical layers up to 31 layers. Each layer has its specific color, which will
present it and identify it relative to the other layers and there are vias used to switch
from layer to another, for example the red color presents the top layer, the blue color for
the bottom layer, the light-yellow present the power layer (to do the routing of power
supply) and the light-blue color present the high speed layer (to do the routing of USB
and Ethernet connections), as is shown in the figures below.
Figures 3.14 shows all layers together.

Figure 3.14: PCB Design

35
CHAPTER 3. DESIGN OF A CONVEYOR MANAGEMENT SYSTEM

Figure 3.15: Top Layer Figure 3.16: Bottom Layer

Figure 3.17: Power Layer Figure 3.18: High Speed Layer

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.

Figure 3.19: Top 3D board view

36
CHAPTER 3. DESIGN OF A CONVEYOR MANAGEMENT SYSTEM

Figure 3.20: Buttom 3D board view

Figure 3.21 shows board dimension (136.144mm x 80.391mm).

Figure 3.21: Board dimension

3.5 General system architecture


The diagram below shows project data acquisition and treatment process. Indeed, the
values measured by the photo-electric sensor, are sent by a STM32 custom board, from
each module, to a Raspberry Pi 3 Model B+ board, whose characteristics allowed it to
be used as a server. The data is transmitted over an Ethernet connection between the
different boards through the MQTT protocol, in order to be stored in a database, and
subsequently displayed, in a dashboard.

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.22: General system architecture

3.6 Conveyor management system


To ensure the best control and reliable management of the conveyor system, two very
important components must be used in our system, namely the photo-electric sensor that
will detect the presence of objects and the motor that will allow the operation of the
wheels to properly transport objects on the conveyor.

3.6.1 Optical sensor montage


To detect the presence of objects, we used the SICK W4-3 photo-electric sensor mounted
as shown in the diagram below with the STM32 custom board. In this case a divider
bridge is highly needed because the custom board does not support a voltage greater
than 3.7 V and the sensor needs a voltage between 10 V and 30V.

Figure 3.23: Montage of the photo-electric sensor with the custom board STM32

38
CHAPTER 3. DESIGN OF A CONVEYOR MANAGEMENT SYSTEM

3.6.2 Motor management system


3.6.2.1 Montage
In the diagram of Figure 3.24, the assembly containing the motor roller RollerDriver
EC5000 24V is presented, and it is mounted as follows with the STM32 custom board:

Figure 3.24: Montage of RollerDriver with custom board STM32

3.6.2.2 Flowchart for decision making for motor management


In order to do the management of motor, to control well the different rollers of the conveyor
of each module, the decision making is according to the value detected by the sensor, that
if there is detection of an object, the motor will stop immediately, otherwise, if there is
no object, the command will be in this case is to operate the motor.
It is worth noting that the sensor is located at the end of each module, if it detects the
object, which means that the object passes through this zone, the motor will be stopped
as shown in Figure 3.25.

Figure 3.25: Flowchart for engine management

39
CHAPTER 3. DESIGN OF A CONVEYOR MANAGEMENT SYSTEM

3.7 MQTT protocol


3.7.1 Presentation
Message Queuing Telemetry Transport (MQTT) is a lightweight publication and sub-
scription system of which a client can publish to send messages and subscribe to receive
messages through this IoT standard. It is a lightweight publish/subscribe messaging pro-
tocol, devoted for devices with low bandwidth constraints. It is the main protocol of
Internet of Things (IoT) and the best solution for different IoT applications, because it is
supported by most cloud services. MQTT permit us to read and publish data through sen-
sor nodes, ensures communication between different connected devices to control outputs
and much more [11]. Figure 3.26 present MQTT protocol logo.

Figure 3.26: MQTT protocol logo

3.7.2 MQTT advantages


The advantages of the MQTT protocol are mentioned below:
• Flexibility: MQTT is designed for TCP/IP network, used by internet protocols
including HTTP. So, we can find it on any hardware platform, a Raspberry Pi, a
STM32, a PC or even a cloud platform (Microsoft Azur/Amazon AWS). Further,
any data or message can be passed through topics, e.g., binary or JSON..., the main
thing will be as needed.
• Security: There are many security possibilities such as: Unique password, client
and server authentication, SSL / TLS encryption (to protect data and prevent data
modification attacks), and others. It is therefore a quality not to be overlooked in
a world where connected objects are an important vector of attack.
• Lightness: MQTT is specialized on a native asynchronous side, and it is much less
verbose than HTTP.
• Data Integrity: MQTT insert the concept of Quality of Service (QoS) allows
the customer to check whether the message has been transmitted or not and to
choose the level of credibility (QoS1 / QoS2 / QoS2). There is also a pretty great
feature: the ’will message’, this is a topic that is sent automatically when a client
disconnects. This allows any client to be notified of another client’s disconnection
and to act accordingly [12].

3.7.3 Basic concept


In this part, the different operations and concepts will be presented, these operations can
be achieved using the MQTT messaging protocol.

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.

Figure 3.27: MQTT publish subscribe

• 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.

Figure 3.28: MQTT 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.

Figure 3.29: MQTT broker

3.7.4 Raspberry Pi and STM32 custom board library


In order to use the MQTT protocol, a set of packages and libraries must be installed on
the Raspberry Pi side, which plays the role of a server, and on the STM32 custom board
side, which plays the role of a client.

3.7.4.1 STM32 custom board side


"MQTTClient.h" library: It is a Paho MQTT client library related to the C and C++
language, we can use this library for our STM32 custom board. Among the different
methods of this library, we can mention:

"MQTTClient_connect()": connects the client to a topic, each client is identified by


its ClientID.

"MQTTClient_publish()" : Publishes a string message in the specified topic and con-


tains as parameter, the topic (const char) and the message to be published(string).

"MQTTClient_subscribe()": Subscribe to messages published in the specified topic, as


parameter we can found the topic (const char) and Quality of Service (QoS) (int: 0 or 1
only).

"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

Figure 3.30: STM32 custom board operation flowchart

3.7.4.2 Raspberry Pi side


For the Raspberry side, the libraries to connect a client to MQTT broker are not needed.
the Node-RED installed on Raspberry Pi using Docker, will replace the Python language
with its libraries, however the Node-RED (MQTT client) must be connected to the MQTT
broker(Mosquitto).
The Node-RED publishes data to the STM32 custom board through a topic where the
STM32 is subscribed and it can be a subscriber to receive data from the STM32 board.
The Figure 3.31 below shows the operation flowchart of the Raspberry Pi board.

Figure 3.31: Raspberry Pi board operation flowchart

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

3.7.5 Communication process between boards


To ensure and guarantee the proper management of the system, a reliable Ethernet based-
communication network is implemented between the different conveyor modules. To en-
sure this, the different boards (Raspberry Pi and the STM32 custom board) are connected
to a switcher and then they communicate through the MQTT protocol. The detailed
process is presented below to simplify and better explain how the communication and
exchange of data and commands between the different modules really happens, so as to
provide control without fail.

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.

3.7.5.1 STM32 custom board process


There are 2 processes for the custom board STM32:

• STM32 custom board as a publisher

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.

Figure 3.33: STM32 custom board publish process

• STM32 custom board as a subscriber


If STM32 board receives 1 from the Raspberry Pi board, this means that the Rasp-
berry board has detect the object at the end of the previous module, therefore the
motor must turn-on, and the object continues its path. Figure 3.34 shows STM32
custom board subscribe process.

Figure 3.34: STM32 custom board subscribe process

45
CHAPTER 3. DESIGN OF A CONVEYOR MANAGEMENT SYSTEM

3.7.5.2 Raspberry Pi process


When the Raspberry Pi board receives 1 from the STM32 board (id1), it will deliver this
message to the STM32 board just after (id1+1), so that the latter can run its motor,
otherwise if it receives an error message, it displays this message on the dashboard to
alert the user to fix this error. Figure 3.35 shows Raspberry Pi board process.

Figure 3.35: Raspberry Pi board process

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.

4.2 Work Environment


4.2.1 Hardware Environment
We used as hardware environment a desktop computer which has the following charac-
teristics:

Table 4.1: work environment description


Brand Acers
Processor intel I7-9750H @ 2.60GHz
Memory 16Go
Hard Drive 500Go
Operating System Windows 10
Development Board Raspberry PI 3 B+

Figure 4.1: acer logo Figure 4.2: intel logo

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.

Figure 4.3: Raspbian-Buster-Full operating system logo

4.2.2 Software Environment


STM32 CubeMX

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].

Figure 4.4: STM32cubeMX Logo

Keil uVision

Keil uVision is a simplified development environment for integrated software program-


ming (IDE), MDK-ARM allows to create, simulate, and debug integrated applications
on microcontrollers. The ARM C/C++ compiler makes it possible to produce assembler
code that is more efficient and compact than other compilers. Keil is supplied with many
which facilitates the work and speeds up the development of our application. Keil is
compatible with all STM circuits. STM32F407 is programmed using this software.

48
CHAPTER 4. IMPLEMENTATION

Figure 4.5: keil uvision Logo

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.

Figure 4.6: VNC logo

4.3 Data Acquisition interface


-A customized card based on STM32 microcontroller for the acquisition of the sensor
values.
-A Raspberry Pi 3 Model B + board, as a central unit and a server, allowing the dialogue
between the custom board, the database, and the Web. In the following sections, we will
describe how we will acquire this data from these different platforms.

49
CHAPTER 4. IMPLEMENTATION

Figure 4.7: Data acquisition flow

4.4 Test and validation of data acquisition


To properly acquire the data from the sensor, a configuration of our custom board STM32
is needed. For this, STM32CubeMX offer this configuration of the board: Pins configu-
ration, Clock configuration. Figure 4.8 shows the STM32CubeMX interface.

Figure 4.8: STM32CubeMX interface

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.

Figure 4.9: The IDE Tool Environment

51
CHAPTER 4. IMPLEMENTATION

4.5 Data Logging with Node-red


Node-RED is chosen as a prototyping platform for building the IoT system. In the simplest
terms, Node-RED is a graphical user interface that allows the creation of workflows for
IoT data. By connecting simple components with defined functionality (called "nodes" in
Node-Red terminology), it provides the essential features to write applications that takes
data from one source (e.g. a sensor, a website) and publish or batch on this information
in many cases without any programming.

Figure 4.10: Node-red Logo

4.5.1 Node-red Components


Flows are created in the browser and then run and stored on the raspberry Pi. Flows
consists of several prefabricated code blocks, which are connected to one another via
inputs and outputs. A node consists on one hand, of JavaScript code and, on the other
hand, of HTML code, which can determine how the node looks in the flow editor.

Figure 4.11: Node-red flow Editor

52
CHAPTER 4. IMPLEMENTATION

In Node-RED, a message object is usually called ’msg’ and it had three properties by
default:

Var msg={payload : " u s e r data " ,


Topic : " SSD2 " ,
msgid : " 9 3 9 2 aeb8 . 6 c6d5 " } ;
Msg.payload: It contains the user data of message .This can be for example, the sensor
measurements.
Msg.topic: A custom string that allow to categorize the message.
Msg.msgid: An identifier of the message.

4.5.2 Overview of the most important nodes


Input Nodes:

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.

Figure 4.12: Input Nodes

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.

Figure 4.13: Output Nodes

Processing/Function Nodes:

They allow processing incoming data and can be used to write custom code and con-
vert data types.

Figure 4.14: Processing/Function Nodes

4.5.3 MQTT Broker


Eclipse Mosquitto is an open-source message broker (licensed by EPL/EDL) that imple-
ments MQTT protocol versions 5.0, 3.1.1 and 3.1. Mosquitto is lightweight and suitable
for use on all devices from low-power single-board computers to complete servers.
The MQTT protocol provides a lightweight method for performing message delivery using
the publish/subscribe model. This makes it suitable for IoT messaging, such as messag-
ing with low-power sensors or mobile devices such as phones, embedded computers or
microcontrollers [15]. Figure 4.15 shows mosquitto logo.

Figure 4.15: mosquitto logo

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)

• Step 3: Install Mosquitto broker on Raspberry Pi board using commands from


terminal

• Step 4: Add our STM32 map download manager

4.5.4 Node-RED and MQTT


The STM32 publishes data via MQTT, the photoelectric sensor are sent to Mosquitto
broker that runs on Raspberry Pi. Thus, to observe the flow of data, Node-RED must be
used.
A Node-RED UI dashboard, running on the Raspberry Pi, must be built that visualizes
the data acquired from the sensors.
Therefore, the Figure 4.16 below shows the scenario we want to develop.

Figure 4.16: Data flow scenario

4.5.5 Testing the MQTT Broker


For a first test of the broker, two new terminal windows A and B must be opened.

• Step1: Subscribe to the Topic ’Data/SSD2’ with terminal A as a subscriber:

Mosquitto_sub −h l o c a l h o s t −t " data /SSD2 "

55
CHAPTER 4. IMPLEMENTATION

• Step2: Publish with terminal B as publisher on the Topic ’Data/SSD2’:

Mosquitto_sub −h l o c a l h o s t −t " data /SSD2 "

A test message appears in terminal window A, the broker then directs the message from
publisher to subscriber.

Figure 4.17: Screenshot of Terminal B(Publisher)

Figure 4.18: Screenshot of Terminal A(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.

4.6.1 Time Series Database


A time series is an ordered sequence of a variable values (such as temperature) at equally
spaced time intervals (for example every hour). Therefore, it is a series of discrete time
data. For example, data with time stamps (such as log files and measurements of IoT

56
CHAPTER 4. IMPLEMENTATION

devices) can be considered as time series.


Moreover, it presents the dependency between time and measurements, thereby changing
the order may change the data meaning an example of time series would be hourly tem-
perature measurements at a specific weather station, daily measurements at the closing
price of a specific stock, etc.

4.6.2 Benefits and Uses


Reduced downtime: In real life, availability is always critical in certain situations, and
the database architecture built for time-series data can avoid data downtime even in the
event of network partitions or hardware failures.
Lower costs: Flexibility and high failure thresholds translate into fewer resources to
manage outages. Commodity hardware for quick and easy expansion can ensure the
reduction of operating and hardware costs for expansion.
Improved business decisions: TSDB enables organizations to monitor and analyze
data in real time, so it can help it adjust infrastructure changes, energy consumption,
equipment maintenance, or other major business decisions that affect the business faster
and more accurately. Figure 4.19 shows a comparison table between Databases.

Figure 4.19: System Properties Comparison

4.6.3 Chosen Database Technology (InfluxDB)


Influx DB stores data for any use case involving large amounts of timestamped data,
including DevOps monitoring, log data, application metrics, IoT sensor data, and real-
time analytics. It provides functionality that allows you to conserve space on your machine
by keeping data for a defined length of time, then automatically down sampling or expiring
and deleting unneeded data from the system. Figure 4.20 shows InfluxDB logo.

57
CHAPTER 4. IMPLEMENTATION

Figure 4.20: InfluxDB logo

4.6.4 System Database Model


The data coming from the modules are stored in a time series measurements called "SSD2".
It contains the value of the optical sensor and the error factor that we use to determine
if the system either shut down or continue functionning.
The data stored in "SSD2" are used afterwards to be visualized in the dashboard.
An example of the measurement structure is shown in the Figure 4.21.

Figure 4.21: SSD2 Measurement Structure

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

Figure 4.22: Grafana Logo

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.

Figure 4.23: 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.

Figure 4.24: CSS Logo

4.8 Dashboard interfaces Conception


In this section, the different interfaces and functionalities of our dashboard will be pre-
sented.

59
CHAPTER 4. IMPLEMENTATION

4.8.1 Global use case diagram


The global case diagram in the Figure 4.25 can give us an overview about actors and their
roles in the dashboard functionality.

Figure 4.25: Global use case Diagram

Textual description of use cases:

The Table 4.2 below represents the detailed description of the use case diagram shown in
the Figure 4.25.

60
CHAPTER 4. IMPLEMENTATION

Table 4.2: Textual description of use cases

Operation Actor Scenario


The user creates an account in order to
be able to access the content of the
Subscribe User
application and have more access
resources it contains
After creating an account by the user,
he must accept the terms of use of the
Accept the terms of use User
application, in order to be able to
access it and view data
After accepting the different conditions
View data User
of use, the user can view the data
The administrator has the ability
Manage users accounts Admin to manage user accounts (Add,delete
and search for user account(s))
The administrator can use the
application to configure and control
Configure and control data Admin
the data, and thus consult the system
status
After the data processing phase,
administrator can view or receive
View notifications and error messages Admin notifications about system status
and receive error messages when
problems occur
The visitor authenticates each time,
Authenticate User/Admin to be able to access his account and
consult the data

4.8.2 Registration and authentication interface


The Figure 4.26 illustrates the register interface. When the user launches the application
for the first time, he will be requested to sign in with his account credentials. In case
the user does not have an account, he must be registered to be able to use the full
functionalities of the application.

61
CHAPTER 4. IMPLEMENTATION

Figure 4.26: SignUp Interface

The Figure 4.27 shows the authentication interface in which the admin or the viewer
can access the different application functionalities.

Figure 4.27: SignUp Interface

4.8.2.1 Sequence Diagram


The sequence diagram in the Figure 4.28 can sum up all the scenarios that can be en-
countered in the operations "Register" and "Authenticates."

62
CHAPTER 4. IMPLEMENTATION

Figure 4.28: Sign up Sequence Diagram

4.8.3 Control System Interface


Only users with admin authentication privileges can access the control system interface,
it allows administrators to set up the number of units that are going to be processed in
the system and set a specific timer for the whole procedure. Conveyor system can be
manipulated with the "Start", "Reset" and "Stop" buttons.

63
CHAPTER 4. IMPLEMENTATION

Figure 4.29: Admin control panel

4.8.4 The Dashboard Interface


The user can consult the interface of variations of different sensors parameters in our
conveyor system. The Figure 4.30 contains the list of logs of the units that are being
processed with its exact timestamp, the error logs in case there happened to be an alert
or error occurring in the system, a counter to measure the exact number of units processed.

64
CHAPTER 4. IMPLEMENTATION

Figure 4.30: Supervision Interface

4.8.4.1 Sequence Diagram


The sequence diagram in the Figure 4.31 resume the entire "Connection between the
Database and the Dashboard" module.

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

New Information and Communication Technologies (ICT)continue to develop and become


more and more important not only in our daily life but also in professional fields.

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

STM32 custom board

A.1 STM32 microcontroller specification


• 82 input/output that support interruptions/ CAN bus, SPI, USART/UART

• Ethernet port.

• USB On-The-Go (OTG) Micro-AB connector.

• Support a variety of integrated development environments (IDE) including IAR


Embedded workbench, MDK-ARM and STM32CubeMX.

A.2 Characteristics :
In the following table, we show the different characteristics of our STM32 custom board:

Table A.1: STM32 custom board characteristics


Microcontroller STM32F407VGT6
Processor ARM Cortex-M4
core size 32 bits
Voltage-supply (VCC/VDD) 1.8 V up to 3.6 V
Number of Input and Output 18
Speed (clock frequency) 168 MHz
Flash memory 1MB
RAM size 192 KB
Operating temperature -40 °C to 80 °C (TA)
Dimensions 13.614 cm x 8.039 cm

68
Appendix B

Raspberry Pi 3 board Model 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.

• Speed and power: Compared to those of its predecessor, this Raspberry Pi 3 B+


have gained overall 15% of speed and power.

• 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+

Table B.1: Characteristics of Raspberry Pi 3 board Model B +


Broadcom BCM2837B0, Cortex-A53 64-bit SoC,
Processor
1.4GHz
Memory 1GB LPDDR2 SDRAM 1GB LPDDR2 SDRAM
GPIO Standard 40-pins GPIO header
Micro SD format for loading operating system
SD card support
and data storage
- 1 x full size HDMI
- MIPI DSI display port
Video and sound - MIPI CSI camera port
- 4 pole stereo output and composite
video port
Environment Operating temperature, 0 to 50°C
- 2,4 GHz and 5GHz IEEE 802.11b/g/n/ac
wireless LAN, Bluetooth 4.2, BLE
Connectivity - 4xUSB 2.0 ports
- Gigabit Ethernet over USB 2.0
(maximum throughout 300Mbps)
- 5V DC via GPIO header
- 5 V/2.5 A DC via micro-USB connector
Input Power
- Power Over Ethernet (PoE)-enable led
(requires separate PoE HAT)
H.264, MPEG-4 decode (1080p30); H.264 encode
Multimedia (1080p30);
OpenGL ES 1.1, 2.0 graphics
Dimensions 85 x 56 x 17 mm

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

• Sensing range max: 4 mm to 150 mm

• Supply voltage: 10 V DC / 30 V DC

• Switching output: PNP

• Source and Type of light: PinPoint LED, a visible red light

• Current consumption: 20 mA

• Connection type: Connector M8, 3-pin

71
Appendix D

Roller Driver EC5000

D.1 Specification
Among its specifications, we can cite the following criteria::

• Rated voltage:24 V to 48 V

• Rated current:1.4 A to 1.7 A

• Power:20 W to 50 W

• Starting current: 3 A to 3.8 A

• Operating ambient temperature: de 0 to 40 °C

• Maximum noise level:55 dB

• Motor cable length:500 mm

• RollerDrive length:1000 mm to 1500 mm

• Maximum load capacity:475 N to 1100 N

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.

• Many component’s libraries.

• Starting current: 3 A to 3.8 A

• 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

CAD = Computer Aided Design

CSS = Cascading Style Sheets


DBMS = Data Base Mamangement System
IoT = Internet of Things
LwIP = Light weight Internet Protocol
MAC = Media Access Control
MQTT = Message Queuring Telemetry Transport
PCB = Printed Circuit Board
QoS = Quality of Service
RMII = Reduced Media Independent Interface
SCS = Smart Conveyor System
SSL = Secure Socket Layer
TSDB = Time Series Data Base
USB= Universal Serial Bus

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

You might also like