Master's Thesis 2015

Embed Size (px)

Text of Master's Thesis 2015

  • 1

    Masters Thesis 2015

    Kishan Prajapati (132359)

    Process Control and Monitoring using Arduino

    and Raspberry Pi

  • 2

    Telemark University College

    Faculty of Technology

    Department of Technology

    Kjlnes ring 56

    3918 Porsgrunn

    http://www.hit.no

    Kishan Prajapati

  • 3

    Telemark University College Faculty of Technology

    M.Sc. Programme

    MASTERS THESIS, COURSE CODE FMH606

    Student: Kishan Prajapati

    Thesis title: Process Control and Monitoring using Arduino and Raspberry Pi

    Signature: . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .

    Number of pages:

    Keywords: Process, logging, Monitoring, Control, PID, Web service, MySQL/Connector,

    Data Dashboard

    Supervisor: Hans-Petter Halvorsen Sign.: . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .

    Censor: Sign.: . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .

    External partner: National Instruments Sign.: . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .

    Availability:

    Archive approval (supervisor signature): Sign.: . . . . . . . . . . . . . . . . . . Date: . . . . . . . . . . .

    Abstract:

    In this 21st century, Monitoring and Controlling is being taken as the main entity of any field which can

    ensure for the effective performance, hence its importance is rising exponentially in industry field as well.

    Many parameters of the industry should be within the limit. There can be many factors which can bring

    variations in those variables. This may cease the efficiency of the industry and destruction of industrial

    equipment as well. Hence, monitoring and evaluation of the variables is very important and control them

    whenever it is necessary to.

    In this thesis, monitoring part is the most emphasized than the controlling part. Hence, the logging system is

    being more highlighted here. Two different logging systems are developed. The first one includes the

    Arduino and Raspberry Pi where Arduino is used for interacting with sensors/process and Raspberry Pi as

    database server (MySQL). This system can be used in a single industry, however can logged and monitor

    many sensors/processes using multiple number of Arduino connected to single Raspberry Pi. In this case,

    website is developed in Raspberry Pi for the managing and monitoring purpose which is displayed in a

    screen in Telemark University College. This system continuously logged the data in certain interval and can

    be monitored at the same time. And the second logging system is based on web service in LABVIEW. It is

    built by the use of Arduino and LABVIEW in laptop. MS SQL database is used for logging the data in this

    case. SQL toolkit of LABVIEW is used for logging purpose whereas web service and Data Dashboard for

    LABVIEW application is used to make the data available on Tablets and Smartphones that run on the

    Android and iOS operating system. Besides, PID controller is developed as an Arduino library. It is used for

    controlling the process (Air Heater).

    Hence, this thesis focus on developing en effective and cheap monitoring and controlling system with the use

    of Arduino and Raspberry Pi. In addition, web based logging, data publication in web, use of data dashboard,

    development and use of Arduino library, Arduino-LABVIEW interface, data management, etc are included

    in this thesis.

    Telemark University College accepts no responsibility for results and conclusions presented in this

    report.

  • 4

    Table of Contents

    Part I: OVERVIEW....................................................................................................... 14

    1 Introduction ............................................................................................................... 15

    2 Problem Description .................................................................................................. 16

    2.1 System Description ........................................................................................................................ 16

    2.2 Data logging ................................................................................................................................... 17

    2.3 Data Monitoring and Managing .................................................................................................... 19

    2.4 Web Based Data logging and Data Dashboard ............................................................................. 21

    2.5 Arduino PID Control..................................................................................................................... 22

    3 Objectives .................................................................................................................. 24

    4 Some Remaining Tasks ............................................................................................. 25

    Part II: Theory ............................................................................................................... 26

    5 Raspberry Pi .............................................................................................................. 27

    5.1 Overview ........................................................................................................................................ 27

    5.2 Exploring the Raspberry Pi Board................................................................................................ 27

    5.2.1 SD Card Slot .......................................................................................................................... 28

    5.2.2 Micro USB Power .................................................................................................................. 28

    5.2.3 HDMI Out ............................................................................................................................. 28

    5.2.4 Ethernet and USB port .......................................................................................................... 28

    5.2.5 RCA Video Out and Audio Out ............................................................................................ 28

    5.2.6 GPIO Headers(Pins) .............................................................................................................. 28

    5.2.7 ChIPs (Broadcom) ................................................................................................................. 29

    5.3 Raspberry Pi 2 Model B ................................................................................................................ 29

    5.4 Hardware Required for Raspberry Pi .......................................................................................... 29

    5.4.1 Power Supply......................................................................................................................... 30

    5.4.2 Storage ................................................................................................................................... 30

    5.4.3 Input ...................................................................................................................................... 30

    5.4.4 Monitor .................................................................................................................................. 30

    5.4.5 Network ................................................................................................................................. 30

    6 Arduino ...................................................................................................................... 31

    6.1 Arduino Board............................................................................................................................... 31

    6.2 Arduino IDE .................................................................................................................................. 32

    6.3 Internet Connection on Arduino ................................................................................................... 33

    6.3.1 Arduino Ethernet Shield ....................................................................................................... 33

    6.3.2 Arduino Wi-Fi Shield ............................................................................................................ 34

    7 Air Heater .................................................................................................................. 35

  • 5

    8 Database .................................................................................................................... 37

    8.1 Database model ............................................................................................................................. 37

    8.2 Database Design ............................................................................................................................ 38

    CA Erwin ....................................................................................................................... 39

    8.3 MySQL .......................................................................................................................................... 39

    8.3.1 SQL........................................................................................................................................ 39

    8.3.2 View ......................................................................................................................