0% found this document useful (0 votes)
106 views28 pages

Functional Specification - Group 8

This document provides a functional specification for an industrial joystick controller. It describes the core components, block diagram, functionality, software program, hardware, wiring diagram, and considerations for electromagnetic compatibility, reliability, thermal management, maintenance, recycling, and costs. It includes references to relevant documents and components. The specification aims to describe the intended functionality and interactions to guide production of a robust and long-lasting industrial control device.

Uploaded by

Epic Arrow
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
106 views28 pages

Functional Specification - Group 8

This document provides a functional specification for an industrial joystick controller. It describes the core components, block diagram, functionality, software program, hardware, wiring diagram, and considerations for electromagnetic compatibility, reliability, thermal management, maintenance, recycling, and costs. It includes references to relevant documents and components. The specification aims to describe the intended functionality and interactions to guide production of a robust and long-lasting industrial control device.

Uploaded by

Epic Arrow
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 28

DEVELOPMENT OF

ELECTRONIC SYSTEMS

FUNCTIONAL SPECIFICATION DOCUMENT

UNIVERSAL AUTOMATION UNIT


“INDUSTRIAL JOYSTICK
CONTROLLER”

JULY 2022
Functional Specification

AUTHORS

Name Matriculation Number Role


Kurumbaparambil, Vishnudev 5068054 Group 8, Member
Lemar, Mohammad Naim 5069840 Group 8, Member
Moslemi, Mohammad Ali 5084527 Group 8, Member
Obert, Martin 4061838 Group 8, Member

2022-07-20 Page 1
Functional Specification

Table of Contents
1. Introduction.................................................................................................................... 4
1.1 Purpose of the document ..........................................................................................................4
1.2 Scope of the document .............................................................................................................4
1.3 Related documents ...................................................................................................................4
1.4 Terms/Acronyms and Definitions ..............................................................................................5
1.5 Risks and Assumptions ..............................................................................................................6

2. Functional Specifications................................................................................................. 7
2.1. Components of the System ......................................................................................................7
2.2. Block Diagram .........................................................................................................................7
2.3. Description of the System’s Functionality .................................................................................8
2.4 Software Program of the System ...............................................................................................9
2.4.1 Structure of the Software ............................................................................................................................9
2.4.2 Software used ..............................................................................................................................................9
2.4.2 Realization of the Software ..........................................................................................................................9

2.5 Hardware of the System ...........................................................................................................9


2.5.1 Wiring of the prototype ...............................................................................................................................9
2.5.2 Creation of a circuit board .........................................................................................................................10
2.5.3 Device protection of the prototype ...........................................................................................................10

2.6. Electromagnetic Compatibility ............................................................................................... 12


2.7. Thermal Management and Cooling ......................................................................................... 12
2.8. Reliability Analysis ................................................................................................................. 13
2.9. Service life duration ............................................................................................................... 14
2.10. Maintenance and repair requirements ................................................................................. 14
2.11 Recycling .............................................................................................................................. 14
2.12 Development Costs ............................................................................................................... 15
2.13 Availability / Second Source for the System ........................................................................... 15

3. References .................................................................................................................... 17
4. Open Issues .................................................................................................................. 19
5. Appendix ...................................................................................................................... 20
A. Flowchart of the software implementation – 1/2 ......................................................................................21
A. Flowchart of the software implementation – 2/2 ......................................................................................22
B. Content of Program_DoES_Joystick_RGB_LED.py .....................................................................................23
C. Schematic of the prototype’s wiring ..........................................................................................................26

2022-07-20 Page 2
Functional Specification
D. Applicable attachments .............................................................................................................................27

Table of Figures
FIGURE 1. BLOCK DIAGRAM WITH ALL CORE COMPONENTS ........................................................................................................7
FIGURE 2. FUNCTIONALITY OF JOYSTICK.[11] (A) PRESSING THE PUSH BUTTON SETS THE AXIS VALUE AS BRIGHTNESS AND BLINKING OF THE
LEDS AS DESCRIBED IN THE FLOW CHART, APPENDIX-A. (B) PRESS UP BUTTON, BRIGHTNESS INCREASES AND BLINK INTERVAL GOES
FASTER. (C) PRESS DOWN, BRIGHTNESS DECREASES AND BLINK INTERVAL GOES SLOWER. .......................................................... 8
FIGURE 3. WIRING OF THE SYSTEM’S PROTOTYPE ...................................................................................................................10
FIGURE 4. ROUTING FOR THE PROTOTYPE ..............................................................................................................................10
FIGURE 5: UNIVERSAL HOUSING OF THE COMPANY REICHELT [REIC01] .......................................................................................11
FIGURE 6: JOYSTICK MODULE WITH IP66 PROTECTION CLASS [ANP01] ......................................................................................11

2022-07-20 Page 3
Functional Specification

1. Introduction
Joysticks are a worldwide standard in control technology for interfacing with machines, including
industrial and manufacturing environments. They’ve slowly replaced traditional mechanical control levers
for a variety of tasks.

Joystick controllers offer precise movement for steering, positioning, and speed control in multiple
applications. Particularly high-risk operations such as mining and excavation, marine equipment,
construction, and in oil and gas exploration.

Industrial joysticks are commonly applied in many industrial applications, such as cranes, winches, marine
equipment, agricultural machines, forestry machines, construction equipment, material handling vehicles,
robotics, medical apparatus, and factory production lines. Due to environmental conditions and rough
usage, an industrial joystick must be robust to ensure a long-life expectancy and minimize equipment
failure.

1.1 Purpose of the document


This document serves as functional specification of an industrial joystick controller to describe the system
intended functionality, capabilities, appearance, and interactions with users in detail for industrial sector.
This document will also be a kind of guideline and continuing reference point for industries to produce a
joystick controller which can be a control device as assistive technology.

1.2 Scope of the document


This document describes the functional specification of an industrial joystick controller in details. This
document contains the description of core components of the controller with detailed circuit diagrams,
software program for its functionality, datasheets for the system components, calculations and
recommended standards for its reliability, electromagnetic compatibility, protection, thermal and
recycling.

1.3 Related documents


The following table addresses some relevance documents to the functional specification which are
combined as attachments to this document.

Document No. Name of the document Description


01 01_COM-KY016RGBLED-Datasheet Datasheet for RGB LED module
02 02_COM-KY016-RGBLED-Manual20200506 Manual for RGB LED module
03 Datasheet for Joystick module with
03_COM-KY023JM-Datenblatt20201026
push button function
04 Drawings and specifications of
04_Enclosure_1591SBK
enclosure.
05 05_Joy-It SensorKit X40 EN.pdf Datasheet for Sensor Kit
06 06_Joystick_Modul_Datenblatt Datasheet for Joystick Modul

2022-07-20 Page 4
Functional Specification

07 07_KY-016_LED_RGB_Modul_AZ-
Datasheet for LED RGB Modul
Delivery_Vertriebs_GmbH
08 Datasheet for Raspberry Pi Pico
08_Raspberry Pi Pico Datasheet
(RP2040-based microcontroller board)
09 09_RP2040 Microcontroller Datasheet Datasheet for microcontroller
10 Schematic drawing for Raspberry Pi
10_RPI-PICO-R3-PUBLIC-SCHEMATIC
Pico
11 11_micropython_1.18-docs MicroPython Documentation v.1.18
12 MicroPython environment for RP2040
12_Raspberry Pi Pico Python SDK
microcontrollers
13 13_Schematic Drawing_2022-06-20 Schematic Drawing of the System
14 14_Code_Joystick_RGB_LED Python Code for Joystick-RGB-LED
15 .py file for Python Program for
15_Program_DoES_Joystick_RGB_LED_v3
Joystick-RGB-LED
16 .py file (Python Program for testing
16_blink
the Joystick-RGB-LED

1.4 Terms/Acronyms and Definitions

Term/Acronym/Abbreviation Definition

A device that produces a motion by converting energy and


Actuator
signals going into the system.
btn Button
DC Direct Current
Duty Cycle The fraction of one period in which a signal or system is active.
FIT Failure in time
GND Ground Terminal
IC Integrated Circuit
Jystk Joystick
LED light-emitting diode
Mean time between failures (MTBF) is the average time
MTBF
between system breakdowns.
Is a type of computer memory that can retain stored
Non-Volatile Storage
information even after power is removed.
PCB Printed circuit board.
Is a three-terminal resistor with a sliding or rotating contact
Potentiometer
that forms an adjustable voltage divider.
Proc Process
PushBtn Push Button.
pwm Pulse Width Modulation.

2022-07-20 Page 5
Functional Specification

Is a passive two-terminal electrical component that implements


Resistor
electrical resistance as a circuit element.
RGB Red, Green and Blue LED Module.
Is a device that produces an output signal for the purpose of
Sensor
sensing a physical phenomenon.
val Value
is a type of computer memory that requires power to maintain
the stored information; it retains its contents while powered on
Volatile Storage
but when the power is interrupted, the stored data is quickly
lost.

1.5 Risks and Assumptions


Missing components are not the only risk when developing and launching a new physical product.
Developing a modern device with embedded electronics and a nice user interface is a complicated task.
Success requires a wide array of skills, great teamwork and experience. Many challenges need to be
tackled along the way to reach the goal. Among the other risks, clash of the available hardware parts with
the developed software program for the system is crucial and requires careful attentions.

2022-07-20 Page 6
Functional Specification

2. Functional Specifications
This functional specification of an industrial joystick controller to describe the system intended
functionality, capabilities, appearance, and interactions with users in detail for industrial sector.

This functional specification contains the following topics in details:

• The core components and connections of the system.


• The circuit diagram and/or system configuration by representing a block diagram
• The system functionality and the software design of its algorithm in MicroPython
• Datasheets of core components of the system
• Calculations for reliability of the system
• Standards to be used for the Electromagnetic compatibility of the system
• Standards to be used for the device protection
• Standards to be used for thermal specification
• And repairability and recycling of the system.
• System development cost calculation of a prototype.

2.1. Components of the System


The essential components of an industrial joystick controller are joystick module, RGB LEDs and Raspberry
Pi Pico. The joystick module is used as sensor to generate the user input. In addition, RGB LEDs are used
to actuator to display the results of the user input. Moreover, the Raspberry Pi Pico is used for translation
of the user input and outputs signals to RGB module.

2.2. Block Diagram


The following figure visualizes the core components of the system and their dependencies:

Figure 1. Block Diagram with all Core Components

2022-07-20 Page 7
Functional Specification

2.3. Description of the System’s Functionality


At the most fundamental level, a joystick is an input device that consists of a stick that pivots on a base.
When a joystick is moved, a message is relayed to the device or object being controlled and that triggers
a corresponding movement.

Depending on the application, an industrial joystick can be 1-axis (forward/backwards movement), 2-axis
(forward/backwards and left/right movement), or 3-axis (forward/backwards, left/right, and
clockwise/counter clockwise lever movement). This makes it possible to control a machine or apparatus
in one or multiple dimensions.

The system is used to control a RGB LED using a joystick. It supports different use cases like controlling
the brightness of the red LED, the green LED or the blue LED and blinking of the LEDs.

The use cases can be selected by pressing the joystick. Using the Y-axis of the joystick (Up and Down
motion), the brightness of the respective active LED can be continuously changed and saved by pressing
the joystick. As soon as a selection has been made for the red, green and blue LED, a flashing interval can
also be set steplessly according to the principle described.

Pressing the joystick again resets the selection and a new selection can be made.

(a) (b) (c)

Figure 2. Functionality of Joystick.[11] (a) Pressing the push button sets the axis value as brightness and blinking of the LEDs as
described in the flow chart, Appendix-A. (b) Press up button, brightness increases and blink interval goes faster. (c) Press
down, brightness decreases and blink interval goes slower.

2022-07-20 Page 8
Functional Specification

2.4 Software Program of the System


The following subchapter is dedicated to the documentation of the software implementation of the
project.

2.4.1 Structure of the Software


Before the software was created, the algorithm to be implemented was planned in detail with the aid of
a flowchart. The flowchart is attached to the appendix of this document (Appendix-A. Flowchart of the
software implementation).

2.4.2 Software used

MicroPython 1.18. Damien P. George , 2022.


Thonny 3.3.14. Aivar Annamaa et al., 2021

Windows 11. Microsoft, 2021


Visual Studio Code 1.65.2. Microsoft, 2022.
Office 2016 Home and Student. Microsoft, 2015.
Fritzing 0.9.3b. Friends-of-Fritzing e.V., 2016.

EasyEDA 6.4.25. EasyEDA, 2022.


PapDesigner 2.2.0.8.04. Friedrich Folkmann, 2017.
MTBF Calculator 3. ALD Ltd, 2011.

2.4.2 Realization of the Software


As required in the performance specification, the software was implemented in the programming
language MicroPython. The Thorny IDE was used for programming and to connect the Windows PC to the
Raspberry Pi Pico. Each use case was realized in different subfunctions. A main loop is executed
continuously which calls the sub functions for each use case. See appendix under B. Content of
Program_DoES_Joystick_RGB_LED.py.

2.5 Hardware of the System


The following subchapter is dedicated to the documentation of the hardware implementation of the
project.

2.5.1 Wiring of the prototype


The wiring of the circuit is done in parallel to the software programming. The figure below shows the
implementation of the prototype on a breadboard. For a detailed schematic of the system, refer to
Appendix-C. The correct functioning of the prototype was demonstrated in a consultation.

2022-07-20 Page 9
Functional Specification

Figure 3. Wiring of the System’s Prototype

2.5.2 Creation of a circuit board


In order to get an indication regarding the dimensions for the choice of a suitable housing for the
prototype, a circuit board was created using the EasyEDA software. As a positive side effect, this
procedure also allows a more accurate cost calculation for a prototype. It is possible to put all components
on one board with the dimensions 10cm x 4cm.

Figure 4. Routing for the prototype

2.5.3 Device protection of the prototype


To protect the prototype from environmental influences, it was decided to use a universal housing. The
universal housing of choice is distributed by the company Reichelt and has the dimensions 82 x 110 x 44
mm. It has the right dimensions to fit the intended PCB inside. The weight of the device including the
breadboard and cables is 276g.

2022-07-20 Page 10
Functional Specification

Figure 5: Universal housing of the company Reichelt [Reic01]

The specifications call for complete protection against contact and dust, as well as protection against
powerful waterjets. Taking into account the EN60529 standard, the required protection class is IP66 (see
[Prot01]).

It is intended to pass the cap of the RBG LED through a hole to be drilled in the universal housing and seal
the gap with hot glue to provide the required protection against water and dust entering. For a later series
model, the production of a custom-fit gasket would be recommended.

Due to the design, it is unfortunately hardly possible to make a potential recess in the universal housing
for the joystick dust- and water-proof. It is quite difficult to find a universal covers for this type of joystick
available on the market that meet the required degree of protection. A seal would create too much friction
and make the intended operation much more difficult. The resulting gap when pressure is applied to the
joystick cap would also negate the IP66 protection class. To solve this problem, it is recommended to
connect the joystick via an insulated cable away from the universal housing.

As another approach, we recommend using a different joystick model. Below is a picture showing an IP66
certified model:

Figure 6: Joystick module with IP66 protection class [ANP01]

2022-07-20 Page 11
Functional Specification

With a total height of 22mm, this joystick module falls into a similar size category to the KY-023 required
in the specifications (see [ANP01]) and could be mounted directly to the housing.

All resulting recesses in the universal housing for cable and modules are sealed with hot glue for the
prototype and can be replaced by precisely fitting gaskets for a later series model.

2.6. Electromagnetic Compatibility


According the Raspberry Pi Pico’s datasheet the device fulfills the JEDEC standards for the Human Body
Model /w Digital (FT) pins only and the Charged Device Model (see [Pico01]).
For further assessments regarding electromagnetic compatibility the following norms have to be
considered:

• EN61000-1 (general)
• EN61000-2-1 (conducted)
• EN61000-2-3 (radiated)
• EN61000-4-3 (radiated)
• EN61000-4-4 (transient)
• EN61000-4-5 (surge)
• EN61000-4-6 (conducted)
• EN61000-4-8 (magnetic)
• EN61000-4-9 (pulse)
• EN61000-4-2 ESD

2.7. Thermal Management and Cooling


According to the Raspberry Pi Pico’s datasheet the temperature range in usage is between -20°C and
+85°C and it is recommended that the surrounding temperature does not exceed 70°C (see [Pico01]).
The maximum power consumption is 93.5mA (@5V, popcorn test) at an environmental temperature of
25°C which results into:

Pmax = 3.3V * 93.5mA = 0.30855W ~ 309mW

The minimum power consumption is 9mA (@5V, USB Idle) at a temperature of 25°C which results into:

Pmin = 5V * 9mA = 0.0297W ~ 3mW

To investigate the current drain and the resulting power consumption in detail, the occurring currents for
the sensor and actuator were measured.

2022-07-20 Page 12
Functional Specification

The measuring was done using a Voltcraft ME-22T multimeter between the 3.3V – pin of an Arduino Mega
2560 and the relevant pin of the sensor/actuator:

Module Designation Pin name Current in mA


KY-023 Joystick Module Vcc +5V 0,7
KY-016 LED RGB Module Red LED R 8.7
Green LED G 5.1
Blue LED B 4.2
Table 1: Measurement via the operating currents required by the sensor and actuator

Ptotal = Pmin + PSensor + PActuator = 3mW + (0.7mA*3.3V) + (18*3.3V) = 64,71mW

With a maximum power consumption of 64mW, no active cooling is required.

2.8. Reliability Analysis


The following calculations regarding MTBF and Failure Rate for the main components of the project were
done with the MTBF Calculator by ALD. Due to the complexity of the Raspberry Pi Pico, only a selection of
parts was chosen for this. The calculations were done under the following settings

Reliability Prediction Method: Siemens SN 29500-1


Environment: GB Ground Benign
Temperature: 25°C

Main component Part MTBF in hours FIT - Failures per FIT - Failures per
million hours billion hours
Raspberry Pi Pico Flash memory 101501728.83 0.0099 9.8520
SRAM 609010358.57 0.0016 1.6420
Microcontroller 152063673.63 0.0066 6.5762
KY-016 RBG LED LED 2456801568.07 0.0004 0.4070
Resistor 6694449043.33 0.0001 0.1494
KY-023 Joystick Potentiometer 66944490.17 0.0149 14.9377
Resistor 6694449043.33 0.0001 0.1494
mean value 2396459987 ≈ 0.0048 4.81624286
273568.5 years
Table 2: Calculations of the MTBF and Failure Rates for the main components of the projects

The probability of a product failure in a product runtime T at an average MTBF value of 2396459987 was
calculated according to the following formula (see [Wik01]):

𝑇
𝑝(𝑇) = 1 − 𝑒 −(𝑀𝑇𝐵𝐹)

2022-07-20 Page 13
Functional Specification

Product runtime in years Probability of failure within this period in


percent
2 7.31076*10-6
3 1.09661*10-5
5 1.82768*10-5
10 3.65532*10-5
15 5.48294*10-5
Table 3: Probability of product failure within a certain runtime

2.9. Service life duration


Taking into account the low failure probability of the product calculated in section 2.8 Reliability Analysis,
an operation of at least three years can be assumed.

2.10. Maintenance and repair requirements


For reasons of feasibility, the prototype is soldered first. For a later production model, it would be possible
to connect the KY-023 joystick module and the KY-016 RGB LED module to the PCB via connectors. This
design would increase the repair possibility considerably, since the modules could be exchanged as a
whole in case of a defect.

2.11 Recycling
It is intended to distribute this product within the member states of the EU. In the European Union, the
sale, return and proper disposal of old electrical equipment is regulated by the Waste Electrical and
Electronic Equipment (WEEE) Directive (see [DR01]). Directive 2012/19/EU requires producers and
distributors of electrical and electronic equipment to bear the costs of financing collection and recovery
systems. It is therefore in the interests of the manufacturer to want to hand over this product to the
recycling process at the end of its lifespan as simple as possible. As a small electrical appliance, this
product falls under the jurisdiction of the aforementioned directive.

With this in mind, care was taken to ensure the simplest possible handling of the recycling process for the
series version of this product.

The plastic ABS is used as the housing material. Acrylonitrile butadiene styrene can be melted down as
often as required and thus recovered for the material cycle.

Since the series model uses plug-in modules for ease of repair, the separation of plastic and electronic
components is also straightforward and the respective components can be fed into the material
processing methods of the respective EU country. For easier recycling of the electronic components,
attention was paid to compatibility with the Restriction of Hazardous Substances (RoHS) directive and the
use of toxic substances was reduced to a minimum.

2022-07-20 Page 14
Functional Specification

2.12 Development Costs


Below you will find the cost calculation for one prototype for the main source and a second source of
components used in this project. Please note that the cost calculation does not include shipping costs. See
chapter 3.14 for corresponding references.

Part Main source Second source


Raspberry Pi Pico 4.55€ [1] 4.95€ [6]
KY-023 Joystick Module 3.69€ [2] 4.29€ [7]
KY-016 LED RGB Module 3.79€ [3] 0.32€ [8]
Printed circuit board 1.90€ [4] 3.71€ [9]
Universal housing 6.55€ [5] 9.99€ [10]
Additional material 5€
Price in total 25.48€ 28.26€
Table 4: Cost calculation for one prototype

2.13 Availability / Second Source for the System

Reference to the main source of supply:

[1] RASP PI PICO


Reichelt.de, accessed: 20th of June 2022, 5.30pm
URL: https://www.reichelt.de/raspberry-pi-pico-rp2040-cortex-m0-microusb-rasp-pi-pico-
p295706.html?&trstct=pos_9&nbc=1
[2] KY-023 Joystick Modul für UNO R3
AZ-Delivery.de, accessed: 20th of June 2022, 5.33pm
URL: www.az-delivery.de/products/joystick-modul
[3] KY-016 FZ0455 3-Farben RGB LED Modul
AZ-Delivery.de, accessed: 20th of June 2022, 5.35pm
URL: www.az-delivery.de/products/led-rgb-modul
[4] JLCPCB
Jlcpcb.com, accessed: 20th of June 2022, 5.40pm
URL:
https://cart.jlcpcb.com/quote?orderType=1&stencilLayer=2&stencilWidth=40&
stencilLength=100&stencilCounts=5
[5] Universalgehäuse, Serie 1591
Reichelt.de, accessed: 20th of June 2022, 5.45pm
URL: https://www.reichelt.de/universalgehaeuse-serie-1591-82-x-110-x-44-mm-
schwarz-1591sbk-p221297.html?&trstct=pos_2&nbc=1

Reference to the second source of supply:

[6] Raspberry Pi Mikrocontroller PICO


Pollin.de, accessed: 20th of June 2022, 5.50pm
URL: https://www.pollin.de/p/raspberry-pi-mikrocontroller-pico-811313
[7] Joy-it KY023JM

2022-07-20 Page 15
Functional Specification

Conrad.de, accessed: 20th of June 2022, 5.55pm


URL: https://www.conrad.de/de/p/joy-it-ky023jm-sensorkit-1-st-passend-fuer-
entwicklungskits-raspberry-pi-pcduino-banana-pi-arduino-1707629.html
[8] Joy-it KY-016
Conrad.de, accessed: 20th of June 2022, 5.58pm
URL: https://www.conrad.de/de/p/joy-it-ky-016-raspberry-pi-erweiterungs-platine-1-st-
1656370.html
[9] Smart-Prototyping
Smart-prototyping.com.com, accessed: 20th of June 2022, 6.03pm
URL: https://www.smart-prototyping.com/
[10] Hammond Electronics
Conrad.de, accessed: 20th of June 2022, 5.45pm
URL: https://www.reichelt.de/universalgehaeuse-serie-1591-82-x-110-x-44-mm-schwarz-
1591sbk-p221297.html?&trstct=pos_2&nbc=1

2022-07-20 Page 16
Functional Specification

3. References

[Pico01] Raspberry Pi Pico Datasheet


Datasheets.raspberrypi.com, accessed: 3rd of May 2022, 10.30pm
URL: https://datasheets.raspberrypi.com/pico/pico-datasheet.pdf

[Jystk01] KY-023 Joystick Modul Datenblatt


AZ-Delivery.de, accessed: 3rd of May 2022, 10.40pm
URL: https://cdn.shopify.com/s/files/1/1509/1638/files/Joystick_Modul_
Datenblatt.pdf?17237179332079383541

[RGB01] KY-016 LED RGB Modul Datenblatt


AZ-Delivery.de, accessed: 3rd of May 2022, 10.50pm
URL: https://cdn.shopify.com/s/files/1/1509/1638/files/KY-016_LED_RGB_Modul_AZ-
Delivery_Vertriebs_GmbH.pdf?6046459410546974998

[Reic01] Universalgehäuse, Serie 1591


Reichelt.de, accessed: 7th of June 2022, 5.30pm
URL: https://www.reichelt.de/universalgehaeuse-serie-1591-82-x-110-x-44-mm-
schwarz-1591sbk-p221297.html?&trstct=pos_2&nbc=1

[Reic02] Universalgehäuse, Serie 1591 Datenblatt


Reichelt.de, accessed: 28th of June 2022, 3.30pm
URL: https://cdn-reichelt.de/documents/datenblatt/C700/1591SBK.pdf

[Prot01] Protection classes per EN 60529


Janitza.com, accessed: 7th of June 2022, 6.00pm
URL: https://www.janitza.com/protection-classes-per-en-60529.html

[Wik01] Mean Time Between Failures


Wikipedia.org, accessed: 29th of June 2022, 3.00pm
URL: https://de.wikipedia.org/wiki/Mean_Time_Between_Failures

[ANP01] IP66 certified joystick module


Annapol.eu, accessed: 29th of June 2022, 7.00pm
URL: https://www.annapol.eu/product_info.php?products_id=156929&language=en

2022-07-20 Page 17
Functional Specification

[11] PCBWay.com, accessed: 3th of July 2022, 18:25


Two-Axis Joystick
https://www.pcbway.com/project/shareproject/The_Joystick_Hand_Controller_and_D
IY_Camera_Slider.html

2022-07-20 Page 18
Functional Specification

4. Open Issues
Issue Raised Solution/ Resolved Resolved
Issue Raised By Status
ID On Decision By On
01 Protection Group 8 25-June- Selection of Proposed 05-July- Open
against 2022 different by Group 2022
powerful types of 8
water jets Joystick
module

2022-07-20 Page 19
Functional Specification

5. Appendix
List of appendices:

A. Flowchart of the software implementation


B. Content of Program_DoES_Joystick_RGB_LED.py
C. Schematic of the prototype’s wiring
D. Applicable attachments

2022-07-20 Page 20
Functional Specification

A. Flowchart of the software implementation – 1/2

2022-07-20 Page 21
Functional Specification

A. Flowchart of the software implementation – 2/2

2022-07-20 Page 22
Functional Specification

B. Content of Program_DoES_Joystick_RGB_LED.py
#############################################################################
# University : Hochschule Anhalt
# Team : Kurumbaparambil, Vishnudev
# Lemar, Mohammad Naim
# Moslemi, Mohammad Ali
# Obert, Martin
# Degree Course : Electrical and Computer Engineering (M. Eng.)
# Subject : Development of Electronic Systems
# File Name : Program_DoES_Joystick_RGB_LED.py
# Version : 3.0
# Date : 30-05-2022
# Description : The joystick is used to change the RGB Led color and
# blinking frequency
#############################################################################

########### I M P O R T S E C T I O N ###################################
from machine import Pin, PWM
from time import sleep
#############################################################################

########### G L O B A L S E C T I O N ###################################
# Pin Definitions
RGB_pwmBlueLED = PWM(Pin(22))
RGB_pwmGreenLED = PWM(Pin(21))
RGB_pwmRedLED = PWM(Pin(20))
Jystk_valYAxis = machine.ADC(26)
Jystk_valPushBtn = machine.Pin(28, machine.Pin.IN, machine.Pin.PULL_UP)

# Initial value for PWM frequency


RGB_pwmBlueLED.freq(1000)
RGB_pwmGreenLED.freq(1000)
RGB_pwmRedLED.freq(1000)

# Initial value for PWM duty cycle


RGB_pwmBlueLED.duty_u16(0)
RGB_pwmGreenLED.duty_u16(0)
RGB_pwmRedLED.duty_u16(0)
#############################################################################

######### F U N C T I O N S E C T I O N #################################

#############################################################################
# Name : RGB_setBlueLED_Proc
# Description : This function sets the Blue LED according to the Y axis value
# of Joystick
#############################################################################
def RGB_setBlueLED_Proc():
global RGB_dutyBlueLED
while Jystk_valPushBtn.value() == 1:
RGB_dutyBlueLED = 65535 - Jystk_valYAxis.read_u16()
RGB_pwmBlueLED.duty_u16(RGB_dutyBlueLED)
RGB_pwmGreenLED.duty_u16(0)
RGB_pwmRedLED.duty_u16(0)

#############################################################################
# Name : RGB_setGreenLED_Proc
# Description : This function sets the Green LED according to the Y axis
# value of Joystick
#############################################################################

2022-07-20 Page 23
Functional Specification
def RGB_setGreenLED_Proc():
global RGB_dutyGreenLED
while Jystk_valPushBtn.value() == 1:
RGB_dutyGreenLED = 65535 - Jystk_valYAxis.read_u16()
RGB_pwmBlueLED.duty_u16(0)
RGB_pwmGreenLED.duty_u16(RGB_dutyGreenLED)
RGB_pwmRedLED.duty_u16(0)

#############################################################################
# Name : RGB_setRedLED_Proc
# Description : This function sets the Red LED according to the Y axis value
# of Joystick
#############################################################################
def RGB_setRedLED_Proc():
global RGB_dutyRedLED
while Jystk_valPushBtn.value() == 1:
RGB_dutyRedLED = 65535 - Jystk_valYAxis.read_u16()
RGB_pwmBlueLED.duty_u16(0)
RGB_pwmGreenLED.duty_u16(0)
RGB_pwmRedLED.duty_u16(RGB_dutyRedLED)

#####################################################################################
# Name : RGB_setLEDBlink_Proc
# Description : This function sets the LEDs to blink according to the Y axis #
value of Joystick
#####################################################################################
def RGB_setLEDBlink_Proc():
global RGB_dutyLEDBlink
while Jystk_valPushBtn.value() == 1:

RGB_dutyLEDBlink = round((Jystk_valYAxis.read_u16() - 280)*(10000-


0)/(65536-280)+0)

for i in range(0, RGB_dutyLEDBlink):


RGB_pwmBlueLED.duty_u16(RGB_dutyBlueLED)
RGB_pwmGreenLED.duty_u16(RGB_dutyGreenLED)
RGB_pwmRedLED.duty_u16(RGB_dutyRedLED)
print(RGB_dutyLEDBlink)
if Jystk_valPushBtn.value() != 1:
sleep(0.5)
LED_FINAL()

if RGB_dutyLEDBlink >= 10:


for i in range(0, RGB_dutyLEDBlink):
RGB_pwmBlueLED.duty_u16(0)
RGB_pwmGreenLED.duty_u16(0)
RGB_pwmRedLED.duty_u16(0)
if Jystk_valPushBtn.value() != 1:
sleep(0.5)
LED_FINAL()

#####################################################################################
# Name : LED_FINAL
# Description : Lights up the LEDs according to set duty cycle and blink
# interval
#############################################################################
def LED_FINAL():
while Jystk_valPushBtn.value() == 1:
for i in range(0, RGB_dutyLEDBlink):
RGB_pwmBlueLED.duty_u16(RGB_dutyBlueLED)
RGB_pwmGreenLED.duty_u16(RGB_dutyGreenLED)
RGB_pwmRedLED.duty_u16(RGB_dutyRedLED)
if Jystk_valPushBtn.value() != 1:
mainloop()

2022-07-20 Page 24
Functional Specification

if RGB_dutyLEDBlink >= 20:


for i in range(0, RGB_dutyLEDBlink):
RGB_pwmBlueLED.duty_u16(0)
RGB_pwmGreenLED.duty_u16(0)
RGB_pwmRedLED.duty_u16(0)
if Jystk_valPushBtn.value() !=1:
mainloop()

#############################################################################
# Name : mainloop
# Description : Main function of the program
#############################################################################
def mainloop():

# Set Blue LED


sleep(1)
RGB_setBlueLED_Proc()

# Set Green LED


sleep(0.5)
RGB_setGreenLED_Proc()

# Set Red LED


sleep(0.5)
RGB_setRedLED_Proc()

# Set LED to blink


sleep(0.5)
RGB_setLEDBlink_Proc()

# Repeat
sleep(0.5)
mainloop()

#############################################################################

# Program execution starts here


mainloop()

2022-07-20 Page 25
Functional Specification

C. Schematic of the prototype’s wiring

2022-07-20 Page 26
Functional Specification

D. Applicable attachments
The following data sheets are applicable:

- Raspberry Pi Pico Datasheet (see [Pico01])


- KY-023 Joystick Modul Datenblatt (see [Jystk01])
- KY-016 LED RGB Modul Datenblatt (see [RGB01])
- Universalgehäuse Datenblatt (see [Reic02])

2022-07-20 Page 27

You might also like