• No results found

JOHANNES TOMASIRAK GHEBREAMLAK A braille calculator Num2Braille

N/A
N/A
Protected

Academic year: 2021

Share "JOHANNES TOMASIRAK GHEBREAMLAK A braille calculator Num2Braille"

Copied!
48
0
0

Loading.... (view fulltext now)

Full text

(1)

IN

DEGREE PROJECT TECHNOLOGY, FIRST CYCLE, 15 CREDITS

(2)
(3)

Num2Braille

SIRAK GHEBREAMLAK JOHANNES TOMA

Bachelor’s Thesis at ITM Supervisor: Nihad Subasic

(4)
(5)

Abstract

This thesis attempts to answer how a “braille-only” calcu-lator can be constructed and what needs consideration. An attempt to create such a device has been made. The under-lying purpose is the poor selection of braille devices readily available in the market. Braille literacy is very low and the development of easy to use devices that utilize braille actively might encourage the learning of the language.

(6)

Referat

Braille miniräknare

Rapporten f¨ors¨oker svara p˚a hur en minir¨aknare som enbart anv¨ander blindskrift can byggas och vad som b¨or t¨ankas p˚a. Ett f¨ors¨ok till att konstruera en s˚adan apparat har gjorts. Den bakomliggande anledningen till detta ¨ar det tunna ut-budet av blindskrifts-apparater p˚a marknaden.

L¨askunnigheten av blindskrift ¨ar v¨aldigt l˚ag och utveck-landet av apparater som aktivt anv¨ander blindskrift kan uppmuntra l¨arandet av spr˚aket.

En ny design till en braille sk¨arm, som blir sk¨armen till minir¨aknaren, f¨oresl˚as och en prototyp har konstrue-rats f¨or att testas. Den f¨orsta prototypen ¨ar lovande, ¨aven om den ¨ar ganska opraktisk och stor. Den fungerar som en minir¨aknare men kr¨aver manuell kalibrering vid uppstart f¨or att nollst¨alla l¨aget hos braille-hjulen.

(7)

Acknowledgements

We would like to thank our course coordinator, Mr. Nihad Subasic, who has put in a tremendous effort this semester in guiding all of his mechatronics-students. Thank you Mr. Subasic.

Thank you Mr. Sresht Iyer for being so helpful in the lab whenever we needed you.

Thanks to everyone for your very helpful comments on this paper. Special thanks to Ms. Kayla Kearns!

Special thanks to Mr. Seshagopalan Thorapalli Muralidharan who helped us in our hour of need by supplying us with functioning capacitors. Thank you for answering all of our questions throughout the course of the project.

(8)

Contents

1 Introduction 1 1.1 Background . . . 1 1.2 Purpose . . . 2 1.3 Scope . . . 2 1.4 Method . . . 2

1.4.1 The input mechanism . . . 2

1.4.2 The output mechanism . . . 3

1.4.3 The programing of the microcontroller . . . 3

2 Theory 5 2.1 Design Theory . . . 5 2.2 Components . . . 7 2.2.1 Keypad . . . 7 2.2.2 Microcontroller . . . 7 2.2.3 Stepper Motor . . . 8

2.2.4 Stepper Motor Driver . . . 8

2.2.5 Decoupling Capacitor . . . 9

3 Demonstrator 11 3.1 Hardware . . . 12

3.1.1 The input mechanism . . . 12

3.1.2 The output mechanism . . . 12

3.2 Software . . . 13

4 Discussion 15

5 Evaluation and Future work 17

Bibliography 19

Appendices 21

(9)
(10)

List of Figures

(11)

List of abbreviations

SEKSwedish Krona USB Universal Serial Bus DCDirect current

(12)
(13)

Chapter 1

Introduction

The systematically oriented dots of the braille language are often encountered around public transportation. What might not be so obvious are the statistics regarding braille literacy. It is reported by the organization funka that there are 30 000 people in Sweden who are blind or have severely impaired vision [1]. The num-ber of people who read braille in Sweden is estimated to be 1 500 people [2]. Several studies [3][4][5] have been conducted regarding braille literacy that concluded that braille literacy has been declining for some years. It is partly due to incompetence of teachers in regular schools.

The development of equipment that utilize braille actively, and are easy to use, might encourage the learning of this interesting language. Mathematics and reading are important tools in nurturing the mind. It is one thing to have something read out aloud for you and another thing completely to do it yourself.

1.1

Background

The current selection of devices which utilize the braille language, in both their inputs and outputs respectively, is thin. Prices of these devices which utilize a “braille-only” design are really expensive. The cheapest one in Sweden is called EasyLink 12 and retails for 11 750 SEK [6]. This device is meant to aid in note taking. It functions as a keyboard and uses bluetooth technology to connect to various other devices. The device itself does not perform any other action and is meant to be used as a supplement to other devices.

The next tier of devices are the ones which use audio assistance instead of braille. Calculators for the blind often use this technology. The input is registered through regular non-braille buttons. When pressed, their value is revealed through a machine voice. The calculated results are also read out to the user by the device. These devices are usually cheaper. An example is the “Iris talk tech table calculator” retailing for 476 SEK [7].

(14)

soft-CHAPTER 1. INTRODUCTION

ware [8]. Devices completely absent however, are simple entry level ones, that do not require much knowledge of braille to begin with. Such devices could ignite an interest for braille within the beginner.

1.2

Purpose

The purpose of this project is to build a calculator for blind people without using any audio assistance. A “braille-only” design is investigated, which uses braille for both input and output. The following research question was formulated:

• How can a “braille-only” calculator be constructed?

1.3

Scope

The project aims to find a way to build a non-audio calculator that can be used by blind people. It needs to be done within a time period of 20 weeks as the basis of a bachelor’s thesis, by two people. There are time and resource constraints which limit the scope of the project.

The design-aim is to make a calculator which is somewhat portable in the sense that it could fit in a backpack and not be too heavy. Furthermore, the design and functionality will be limited to a basic “non-scientific” calculator which will be able to execute addition, subtraction, multiplication and division on integer numbers. The output mechanism will hold up to ten symbols. Larger numbers that need more space will simply not be displayed.

The braille symbols of the calculator will correspond with the standard for math-ematical braille notation in the USA known as “The Nemeth Code for Braille Math-ematics” [9].

1.4

Method

The construction of the Num2Braille calculator can be split into three major parts consisting of: the construction of the input mechanism, the construction of the output mechanism/display, and, lastly, the programing of the microcontroller which will be the brain of the calculator.

1.4.1 The input mechanism

A customized pin-based keypad will be used to register input by users. The keypad used for this project has sixteen buttons which will be programmed to input one symbol each as follows.

• The decimal numerals zero through nine (0-9),

• the signs for addition, multiplication, subtraction and division,

(15)

1.4. METHOD

• the letter “C” for “clearing” the memory, • and finally, an “equals sign”.

New buttons will be designed, and 3D-printed, to be fitted on top of the existing buttons of the keypad using adhesive.

1.4.2 The output mechanism

The calculator’s display will consist of ten 3D-printed wheels. The wheels will be divided into twenty parts, each taking up 18 out of 360 degrees. Every part can hold a symbol. Thirteen parts will each have 3D-printed extrusions, forming braille symbols, and seven parts will remain flat and thus without braille symbols. The wheels will then be individually mounted on stepper motor shafts, allowing individual control. The symbols on the wheels will be the following.

• The braille decimal numerals, • a decimal point,

• a minus sign

• and a special braille sign used as indication of numerals. 1.4.3 The programing of the microcontroller

The actual input to the microcontroller will consist of regular decimal numbers. The mathematical operations ordered by the user will be carried out in the micro-controller. The length of the resulting answer will be analyzed in order to determine how many stepper motors need to be engaged and to what positions they should move to. The positions, or steps, will be predetermined and synchronized with the wheels, so that one position shows one symbol on the attached wheels. The default step will be set to display a part of the wheel without a symbol. This is what is shown when the calculator is reset. The second step will show the number one in braille, the third step will show the number two and so on.

(16)
(17)

Chapter 2

Theory

This project is the basis of a bachelor’s thesis in mechatronics. The design bears this in mind, utilizing mechanical and electrical components and designing the desired functionality through the programing of a microcontroller [10]. This chapter begins by explaining the design of the calculator and its capabilities and goes on to describe the components used in the construction.

2.1

Design Theory

A calculator is a device which executes mathematical operations on numeric input from the user. Most calculators have a screen that displays the result. The numbers on the screen of a calculator are not permanently etched in and instead the screen is “refreshable”, meaning that it can be erased and reused. A refreshable braille display can not be thought of in that sense since braille symbols are three dimensional. This implies that the output mechanism needs moving parts. Otherwise it would be counterproductive as braille is traditionally read using fingertips, and the braille symbols, on the reading surface, are protrusions.

In this section descriptions will be kept to a minimum, rather, the overall design and the vision of the calculator will be focused on. For further information regarding each component, see section 2.2.

The component which works as the input mechanism consists of a basic key-pad made to be easily interfaced with a microcontroller. The keykey-pad is fitted with custom made 3D-printed buttons with braille numbers and mathematical opera-tors, following the standard known as “The Nemeth Code for Braille Mathematics” [9][11]. Figure 2.1 shows the intended design of the braille buttons.

(18)

CHAPTER 2. THEORY

Figure 2.1: The custom made keypad buttons with braille symbols. Made in Solid Edge ST10 [12]

braille symbols on them, among which are the decimal numerals 0-9. This way the Num2Braille calculator is able to display up to ten numerals at a time. Figure 2.2 shows the design of the wheels.

Figure 2.2: The wheels carrying the braille symbols. Made in Solid Edge ST10 [12] Each wheel is mounted on the axis of one stepper motor. The stepper motors are each connected to a stepper motor driver which handles their movement. The stepper motor drivers allow the stepper motors to be controlled using only one pin per motor. Those pins are connected to the microcontroller which enables individual control. This allows accurate control over which braille symbols are shown to the user.

This display is fundamentally different from the ones used in current devices. Most often, braille displays use precise actuating technology to move each braille dot, like the “piezoelectric bimorph actuators” [13]. Those actuators are very ex-pensive and many of them are needed to fill a display. Thus, the research for better technologies goes on [14].

(19)

2.2. COMPONENTS

Finally, an Arduino Mega microcontroller together with a breadboard is used to connect all components, and to design the required functionality of the calculator. The prototype is limited to the fundamental mathematical operations: addition, multiplication, subtraction and division. The input is limited to only handle integer numbers whilst the output may hold decimals as well.

2.2

Components

The purpose of this section is to go over the different components that make up the Num2Braille calculator.

2.2.1 Keypad

A four by four keypad is used in this project allowing custom mapping of up to 16 buttons. There is a wire running through each row and each column. The keypad therefore has eight pins that need to be connected to the microcontroller. The column pins are set as outputs and the row pins are set as inputs of the microcontroller. The buttons work like switches. When a button is pressed down it connects the column wire of that button to its corresponding row wire which closes the circuit. This creates a change in the current flowing through the wires and that allows the microcontroller to identify which button is being pressed [15]. Figure 2.3 shows an example of how a simple keypad is wired.

Figure 2.3: Example wiring of a keypad [15].

2.2.2 Microcontroller

(20)

CHAPTER 2. THEORY

Arduino Mega is a microcontroller that contains 54 digital pins and 16 analog pins. It is based on the ATmega2560 [16], which is often used in projects in need of a simple, low-cost and low-powered microcontroller. It uses the VIN pin, the DC power jack or USB connector as its power supply. The Arduino Mega can be programmed using the open-source software Arduino IDE that uses C as its programming language [17].

2.2.3 Stepper Motor

A stepper motor is a brushless DC motor that can move between distinct steps with good precision. It is able to do this through its deliberate design which does not require a feedback system [18]. The stepper motor that is used in this project is a 4 wire 2-phase bipolar stepper motor. Figure 2.4 demonstrates the internal design of the motor.

Figure 2.4: A 4 wire 2-phase bipolar stepper motor [19].

The circle in the middle of the figure is the rotor, generally a permanent magnet, which is connected to the output shaft [20]. The rotor is controlled by two groups, or phases, of coils that are fed an electric current in a systematic manner which rotates and then traps the rotor in the desired position. The two phases in Figure 2.4 are Aand B.

According to the company Adafruit [20] there are drawbacks to using stepper motors, one of which being the high current consumption when idling, producing a lot of heat.

2.2.4 Stepper Motor Driver

A stepper motor driver is a circuit board specifically designed to control stepper motors. The driver used in this project is called “A4988”. It allows for simpler interfacing with the microcontroller, using a single pin to control the stepping of a stepper motor [21]. The current is also fed directly through the driver with a standalone power supply.

(21)

2.2. COMPONENTS

2.2.5 Decoupling Capacitor

(22)
(23)

Chapter 3

Demonstrator

The final measurements of the calculator are 190mm by 190mm in its square base and 80mm in height. The weight is measured to 681 grams, batteries not included. All of the hardware is inside a 3D-printed case. The case is split into two parts, bottom and top, for easy access. The top part holds the keypad through a cutout so that it is accessible when the case is closed as seen in Figure 3.1. The rest is held in the bottom part shown in Figure 3.2.

(24)

CHAPTER 3. DEMONSTRATOR

Figure 3.2: Internal look into the calculator. Partly assembled for better visual.

3.1

Hardware

The hardware schematic diagram is found under Appendix B at the end of the report.

3.1.1 The input mechanism

A keypad with 16 buttons is used to register input. The buttons are fitted with 3D-printed braille symbols. Figure 3.3 shows the keypad in an early stage with the braille symbols. These are fitted with adhesive.

3.1.2 The output mechanism

The top part of Figure 3.1 is the output mechanism, or the braille-display. The braille wheels, more clearly seen in Figure 3.2, poke out of the cutouts of the top part. Braille readers can slide their fingers across this part to feel the braille cells currently showing.

The stepper motors used have tiny gears on their shafts as can be seen in Figure 3.4. Axial locking with the braille wheels is achieved by friction, through a small

(25)

3.2. SOFTWARE

Figure 3.3: The keypad of the calculator

Figure 3.4: Mini stepper motor

Figure 3.5: Braille wheel mounted on axis of mini stepper motor

hole on the center of the braille wheels designed for this purpose. The braille wheel mounted on a stepper motor is shown in Figure 3.5.

3.2

Software

(26)

CHAPTER 3. DEMONSTRATOR

pressed. When an operation is ordered, for example division, the case for division is executed and the variable second is filled with numeric input by the user until the equals sign is pressed. Mathematical operations can already be carried out by an Arduino so a variable total holds the result of first divided by second.

The display function is launched and a string is created out of the variable total in order to determine its length, and thus how many stepper motors that will be required to display the result. If the length is less than or equal to ten, the script proceeds in analyzing the elements of the string and launching the function rotate wheel in order to rotate the wheels to their destinations. The full code is included under Appendix A at the end of the report.

The code handles addition, subtraction, division and multiplication of integer numbers. It does not allow for numbers needing more than ten symbols to be displayed and does not accept division by zero.

(27)

Chapter 4

Discussion

How can a “braille-only” calculator be constructed? As hinted on in section 2.1 of the theory chapter, a braille symbol, or any symbol for that matter, needs to be three-dimensional for it to be comprehended without vision. The braille reader traditionally uses their fingertips, or their sense of touch, to register the symbol in their mind.

A display needs to be reusable, so it needs to be refreshable. A refreshable display which depicts three-dimensional objects that must be solid so that they can be felt, must therefore have moving parts. Either the braille dots of each braille cell need to be movable or the braille cells in their entirety need to be movable.

The former design requires precise actuating technology which is expensive. The display of the Num2Braille calculator utilizes the latter approach where the whole braille cell is movable. The decision was reached after considering two things, the first being the total cost of the project. The second reason was the relatively small number of braille symbols that the calculator needed to be able to display.

The other part of the calculator is not as abstract as the display. The input device can use traditional buttons as those are three dimensional. The top surfaces need to hold braille symbols which can be fitted on existing button modules.

The The NIST Braille Reader, by John Roberts, Oliver Slattery and David Kardos [23] shares some similarity with the Num2Braille calculator. It has a single cell display meaning that one braille character can be displayed at a time. The cell is part of a wheel that rotates, and the intention is for the user to hold their finger still while the wheel rotates under it. Otherwise, the Num2Braille calculator uses a unique design that seems to have been overlooked by others, most likely due to its limitations. Though cheaply reproduced, the calculator is not very practical in its current state. This is because manual calibration of the wheels to their starting positions is required upon startup.

(28)
(29)

Chapter 5

Evaluation and Future work

The Num2Braille calculator works, albeit being impractical. It utilizes a braille-only design and is relatively portable thus, meets our initial expectations of the design with one exception. The display now only carries eight wheels as opposed to the ten intended. This is due to malfunctioning stepper drivers. Only 8 of the 13 originally available remained working throughout the project, forcing us to eventually make a smaller prototype.

There is also a lot of room for improvements. When a calculation is being carried out and the wheels are spinning there is not as much noise from the stepper motors as initially expected. Some noise could function as an indicator for the blind user to signal when not to touch the display. This could be solved using a vibration module attached to the inside of the chassi, or some audio emitting module, that would indicate when a calculation is complete.

Furthermore, fitting the wheels to the stepper motors proved to be rather diffi-cult. The stepper motors initially used in this project were even smaller than the ones shown in Figure 3.4. They had tiny shafts which were circular and smooth, without any gears or flat surfaces. Adhesive alone did not provide a good enough axial locking between stepper motor and braille-wheel which significantly lowered the speed at which the stepper motors could accurately function in this application. We suggest using motors that have gears on the shafts for easier axial locking with the wheels, similar to the ones shown in Figure 3.4.

Another important addition would be automatic calibration of the wheels to the starting position. This was not in the scope of the project as manual calibration was expected to be sufficient. Some positional feedback of the wheels angular location must be gathered for such an implementation to work.

(30)
(31)

Bibliography

[1] Funka: Statistik ¨over m¨anskilga f¨orm˚agor. [Cited 2019-02-12] [Online] https://www.funka.com/design-for-alla/tillganglighet/ statistik/

[2] Synskadades riksf¨orbund: Louis Braille - punktskriftens uppfinnare. [Cited 2019-02-14] [Online]

http://www.srf.nu/leva-med-synnedsattning/ att-ha-en-synnedsattning/att-lasa/punktskrift/ louis-braille---punktskriftens-uppfinnare/

[3] Schroeder, F. Literacy: The key to opportunity.. Journal of Visual Impair-ment and Blindness, 83(6, Spec Issue), 290-293. 1989. [Online]. https: //psycnet.apa.org/record/1989-40497-001

[4] Johnson, L. The Braille Literacy Crisis for Children. Journal of Visual Im-pairment and Blindness, v90 n3 p276-78 May-Jun 1996. [Online]. https: //eric.ed.gov/?id=EJ526021

[5] de Verdier, Kim. Ek, Ulla. A Longitudinal Study of Reading De-velopment, Academic Achievement, and Support in Swedish Inclu-sive Education for Students with Blindness or Severe Visual Im-pairment.. Journal of Visual Impairment and Blindness, ISSN 0145-482X, E-ISSN 1559-1476, Vol. 108, nr 6, s. 461-472. [Online]. http://www.diva-portal.org/smash/record.jsf?aq2=%5B%5B% 5D%5D&c=7&af=%5B%5D&searchType=SIMPLE&sortOrder2=title_ sort_asc&query=braille&language=sv&pid=diva2%3A794229& aq=%5B%5B%5D%5D&sf=research&aqe=%5B%5D&sortOrder=author_ sort_asc&onlyFullText=false&noOfRows=50&dswid=7558

[6] EasyLink 12. A braille notepad. [Cited 2019-03-29] [Online].

http://www.polarprint.se/product/2696/EasyLink+12.html [7] Iris talk tech table calculator. A calculator using audio assistance. [Cited

2019-03-29] [Online].

(32)

BIBLIOGRAPHY

[8] Hossein Ghodosi Fard, Bie Chuangjun

Braille-based Text Input for Multi-touch Screen Mobile Phones School of Computing, Blekinge Institute of Technology. Sweden, Karlskrona, march 2011. Thesis no: MCS-2011-12 . [Cited 2019-05-05] [Online].

http://www.diva-portal.org/smash/get/diva2:832940/ FULLTEXT01.pdf

[9] American association of workers for the blind association for education of the visually handicapped, National braille association. The Nemeth braille code for mathematics and science notation, rev. 1972, page 7. American printing house for the blind. Printed 1987 in Louisville, Kentucky. [Online].

https://nfb.org/images/nfb/documents/pdf/nemeth_1972.pdf [10] Klaus Janschek.

Mechatronics Systems Design Methods, Models, Concepts. Translation by Kristof Richmond ISBN: 978-3-642-17530-5. 2012 Springer-Verlag Berlin Heidelberg. [Online].

https://books.google.se/books?id=mIxKw9kfFjgC&printsec= frontcover#v=onepage&q&f=true

[11] Gloria Bennett, Susan Osterhaus.

Algebra I Symbols Nemeth Reference Sheet, page 1.[Cited 2019-03-01] [Online]. Texas School for the blind and visually impaired. July 2000. Austin, Texas. https://www.tsbvi.edu/attachments/1552_algebra1.pdf

[12] Solid Edge ST10, (2019), Siemens. [Software]. https://solidedge. siemens.com/en/

[13] Smithmaitrie, Pruittikorn & Kanjantoe, Jinda & Tandayya, Pichaya. (2008). Touching force response of the piezoelectric Braille cell. Disability and rehabilitation. Assistive technology. 3. 360-5. 10.1080/17483100802281442. [Online]. https://www.researchgate.net/publication/23714399_ Touching_force_response_of_the_piezoelectric_Braille_ cell

[14] Noel H Runyan and Federico Carpi (2011) Seeking the ‘holy Braille’ display: might electromechanically active polymers be the solution?. Expert Review of Medical Devices, 8:5, 529-532, DOI: 10.1586/erd.11.47 . [Online].

[15] Krishna Pattabiraman, ”Circuit Basics: How to Set Up a Keypad on an Arduino”, http://www.circuitbasics.com, [Cited 2019-02-14] [Online]. http://www.circuitbasics.com/ how-to-set-up-a-keypad-on-an-arduino/

[16] Arduino.cc : Arduino Mega product page. [Cited 2019-03-29] [Online]. https: //www.arduino.cc/en/Main/arduinoBoardMega/

(33)

BIBLIOGRAPHY

[17] Arduino Mega Datasheet. [Cited 2019-03-29] [Online]. https://www.farnell.com/datasheets/1674878.pdf?

_ga=2.12759806.871556650.1519619484-654667508. 1508905608&_gac=1.209399078.1518779130.

EAIaIQobChMI97my66Sq2QIV77ftCh01kgA_EAMYASAAEgKPyvD_BwE [18] V.V. Athani.

Stepper Motors Fundamentals, application and de-sign.1997. [Cited 2019-02-12] [Online] ISBN: 81-224-1006-5 Printed 2005. New Delhi, India. By New Age International Limited Publishers https://books.google.se/books?hl=sv&lr=&id=0m8NTozFZL8C& oi=fnd&pg=PA1&dq=Stepper+Motors&ots=MEcVJlvNF6&sig= eZOiQfszmnsmlNgUStBhJpsOgdo&redir_esc=y#v=onepage&q&f= false

[19] Stan, ”Bipolar stepper motor control with Arduino and an H-Bridge”, https://42bots.com, December 2, 2014. [Cited 2019-05-31] [Online]. https://42bots.com/tutorials/ bipolar-stepper-motor-control-with-arduino-and-an-h-bridge/ [20] Adafruit: All about stepper motors. [Cited 2019-02-14] [Online].

https://learn.adafruit.com/all-about-stepper-motors/ types-of-steppers

[21] Allegro: Datasheet for the A4988 microstepping driver. [Cited 2019-02-14] [Online]. https://www.allegromicro.com/˜/media/ Files/Datasheets/A4988-Datasheet.ashx?la=en&hash=

B0052E915715F54E7338E1274BC43698E610D8A9

[22] Autodesk.com: What are decoupling capacitors? [Cited 2019-02-14] [Online]. https://www.autodesk.com/products/eagle/blog/ what-are-decoupling-capacitors/

(34)
(35)

Appendix A

First Appendix

1 // University: Royal Institute of Technology, KTH 2 // Course: MF133X, Degree Project in Mechatronics 3 // TRITA no: TRITA-ITM-EX 2019:62

4 // Authors: Johannes Toma and Sirak Ghebreamlak 5 // Program: CMAST 3

6 // Project name: Num2Braille 7 // Finalized: 2019-05-05

8 // Info: This code is used for a calculator with 9 // a display made up of wheels with

10 // braille symbols on them. The code 11 // calculates addition, subtraction, 12 // multiplication and division on integer 13 // numbers. The desired operation is 14 // received through a keypad.

15 // The answer is outputted by turning 16 // stepper motors carrying wheels. Each 17 // wheel hold the same braille symbols, 18 // which are spread out to take 20 slots 19 // evenly.

20 21

22 // Keypad 23

24 #include <Keypad.h> // Library used for the keypad 25 const byte ROWS = 4; // Four rows

26 const byte COLS = 4; // Four columns 27

28 // Defining our keymatrix 29 char keys[ROWS][COLS] = {

(36)

APPENDIX A. FIRST APPENDIX 31 {’2’,’5’,’8’,’0’}, 32 {’3’,’6’,’9’,’=’}, 33 {’+’,’-’,’*’,’/’} 34 }; 35

36 // Connecting one Arduino pin to each row of the keypad 37 byte rowPins[ROWS] = { 14, 15, 16, 17 };

38 // Connecting one Arduino pin to each column of the keypad 39 byte colPins[COLS] = { 18, 19, 20, 21 };

40 // Creating the keypad

41 Keypad kpd = Keypad( makeKeymap(keys), rowPins, colPins, ROWS, COLS);

42 43

44 // Steppermotors 45

46 // Library used to store the positions of each

47 // steppermotor/braille wheel and saves that info even while 48 // turned off

49 #include <EEPROM.h>

50 // Creating an array of all the pins needed 51 const int motorer[] = {2,3,4,5,6,7,8,9,10,11};

52 53

54 // Initalize the parameters used in our functions 55

56 double first = 0; // First number of the calculation 57 double second = 0; // Second number of the calculation 58 double total = 0; // Answer to be displayed

59 char key2; //Keys being pressed for "second" 60 char neg_sign = 0; //Indicator of a negative "first"

and/or "second"

61 int total_len = 0; //Amount of symbols in "total" 62 int num_of_motors = 0; //Number of motors that need to be

reset

63 int old_len = 0; //Stores the amount of digits of the previous "total"

64 int total_len_needed = 0; //Gives how many symbols of "total " that are needed. For example: ( if total == 12.30 --> only need four symbols "1" "2" "." "3")

65 66

67 char to_display; //Symbol that need to be displayed 68 int current_position; //The wheels current position

(37)

69 int destination; //The amount of steps from the starting position of the wheel to its destination

70 int steps; //Amount of steps the wheel is from its destination

71

72 void setup() {

73

74 //Declaring our output pins

75 pinMode(11 , OUTPUT); pinMode(2 , OUTPUT);

76 pinMode(3 , OUTPUT); pinMode(4 , OUTPUT);

77 pinMode(5 , OUTPUT); pinMode(6 , OUTPUT);

78 pinMode(7 , OUTPUT); pinMode(8 , OUTPUT);

79 pinMode(9 , OUTPUT); pinMode(10 , OUTPUT);

80 81

82 //EEPROM.write(adress, value) where the adress can be seen as an array index where every index is a byte. 0 is the motor for the singular, 1 is the motor for the tens, 2 is

the motor for the hundreds etc.

83 EEPROM.write(0, 0); EEPROM.write(1, 0); EEPROM.write(2, 0);

84 EEPROM.write(3, 0); EEPROM.write(4, 0); EEPROM.write(5, 0);

85 EEPROM.write(6, 0); EEPROM.write(7, 0); EEPROM.write(8, 0);

86 EEPROM.write(9, 0); 87 88 } 89 90 void loop() { 91

92 char key = kpd.getKey(); //Gets the keys being pressed for "first"

93 switch(key) //Runs the correct case for

each time a key is pressed 94 {

95 //Calculates "first" 96 case ’0’ ... ’9’:

97 total = 0;

98 first = first*10 + (key-’0’);

99 break;

(38)

APPENDIX A. FIRST APPENDIX

104 //Subtracts "second" from "first"/"total", then calls on the function "Display()" to display the answer

105 case ’-’:

106 if (first == 0 && total == 0){ //If negeative "first" is wanted-->neg_sign = 1 107 neg_sign = 1;

108 break;}

109 first = (total != 0 ? total : first);

110 if (neg_sign==1){ //Makes "first" negative if neg_sign = 1

111 first = first*(-1);

112 neg_sign=0;}

113 second = SecondNumber();

114 if( key2 == ’C’){ break;} //Breaks case if "C" is pressed

115 total = first - second;

116 Display();

117 first = 0, second = 0; //Resets

"first" & "second"

118 break; //Calculation finished,

breaks case 119

120 121

122 //Adds "second" with "first"/"total", then calls "Display()" to display the answer

123 case ’+’:

124 first = (total != 0 ? total : first);

125 if (neg_sign==1){ //Makes "first" negative if neg_sign = 1

126 first = first*(-1);

127 neg_sign=0;}

128 second = SecondNumber();

129 if( key2 == ’C’){ break;} //Breaks case if "C" is pressed

130 total = first + second;

131 Display();

132 first = 0, second = 0; //Resets

"first" & "second"

133 break; //Calculation finished,

breaks case 134

135 136

(39)

137 //Multiplies "second" with "first"/"total", then calls on the function "Display()" to display the answer

138 case ’*’:

139 first = (total != 0 ? total : first);

140 if (neg_sign==1){ //Makes "first" negative if neg_sign = 1

141 first = first*(-1);

142 neg_sign=0;}

143 second = SecondNumber();

144 if( key2 == ’C’){ break;} //Breaks case if "C" is pressed

145 total = first * second;

146 Display();

147 first = 0, second = 0; //Resets

"first" & "second"

148 break; //Calculation finished,

breaks case 149

150 151

152 //Divides "first"/"total" with "second", then calls on the function "Display()" to display the answer

153 case ’/’:

154 first = (total != 0 ? total : first);

155 if (neg_sign==1){ //Makes "first" negative if neg_sign = 1

156 first = first*(-1);

157 neg_sign=0;}

158 second = SecondNumber();

159 if( key2 == ’C’){ break;} //Breaks case if "C" is pressed

160 total = (float)first / (float)second;

161 if (second != 0){ //Division by zero wont give any answer with this line

162 Display();}

163 else{total=0;} //total is set to zero if attempt of division by zero is made

164 first = 0, second = 0; //Resets

"first" & "second"

165 break; //Calculation finished,

(40)

APPENDIX A. FIRST APPENDIX

167 case ’C’:

168 first = 0, total = 0; //Resets

"first" & "second"

169 break; //Calculation canceled,

Breaks case 170 } 171 } 172 173 174 175 176 // Gets "second" 177 long SecondNumber(){

178 neg_sign = 0; //resets "neg_sign" 179 while(1)

180 {

181 key2 = kpd.getKey(); //Gets the keys being pressed for "first" 182

183 if(key2 == ’-’){ neg_sign = 1;} //If negeative "first" is wanted then neg_sign = 1

184

185 if(key2 == ’C’){ //Breaks out of the loop and resets "first", "second" & "neg_sign" if "C" is pressed

186 first = 0, second = 0, neg_sign = 0;

187 break;}

188

189 if(key2 >= ’0’ && key2 <= ’9’){ //Calculates "second "

190 second = second * 10 + (key2-’0’);}

191

192 if(key2 == ’=’) {

193 if(neg_sign == 1){ //Makes "second" negative if neg_sign = 1

194 second = second*(-1);

195 }

196 break;}

197 }

198 neg_sign=0; //Resets "neg_sign"

199 return second; //returns "second"

200 }

(41)

201

202 // This function gets the symbols needed to be displayed and calls on the functions that actually will display "total "

203 void Display()

204 {

205 //Sets old_len to total_len_needed 206 int old_len = total_len_needed;

207

208 //Turns "total" into a string 209 String total_str = String(total);

210

211 //Gives the length of that string 212 total_len = total_str.length();

213 214

215 //216: If the length of total_len_needed is greater than 10 then break "Display()" since the device/program can not display more than 10 symbols

216 if (total_len_needed > 10){

217 return;

218 }

219 220

221 //Gives total_len_needed by searching for the symbol ’.’ or a ’1’...’9’ in string, starting from the right of " total".

222 for ( int z = total_len-1 ; z >= 0 ; z-- ){

223 if(total_str[z] != ’0’){ 224 225 if(total_str[z] == ’.’){ 226 total_len_needed = z-1; 227 } 228 else { 229 total_len_needed = z; 230 } 231 break; 232 } 233 }

234 //235:Calculating the number of motors needed to be reset. Example: If the displayed a four digit answer and now needs to display a three digit answer then one of the motors/wheels need to be reset

(42)

APPENDIX A. FIRST APPENDIX

236 //237:Calling the funktion "scrubber()" that resets the neccersary amount of motors/wheels

237 if(num_of_motors>0){scrubber(num_of_motors);}

238 239

240 //Going through requested symbols starting from the right 241 for ( int n = total_len_needed ; n >= 0 ; n-- )

242 {

243 //Seting "to_display" to the symbol in the n:th position of "total_str"

244 to_display = total_str[n];

245

246 //Gets the position of the current motor ordered to move 247 current_position = EEPROM.read(total_len_needed-n);

248 249

250 //Gets the wanted destination depending on the number to be displayed, then runs

"rotate_wheel(total_len_needed-n)" to rotate the wheel to its destination

251 if (to_display >= ’0’ && to_display <=’9’){

252 destination = (to_display-’0’)+1;

253 rotate_wheel(total_len_needed-n);}

254

255 //Runs "rotate_wheel(total_len_needed-n)" to rotate the wheel to its destination

256 else if (to_display == ’.’){

257 destination = 12; //the symbol ’.’ is on the 12th step on the wheel 258 rotate_wheel(total_len_needed-n);}

259 260

261 //When displaying a negative answer an extra motor is needed to indicate numbers being used after the "-" sign. For exampel "-123" would be displayed as "-#123"

262 else if (to_display == ’-’){

263 destination = 11; //the symbol ’#’ is on the 11th step on the wheel 264 rotate_wheel(total_len_needed-n); //Runs "

rotate_wheel(total_len_needed-n)" to rotate the wheel to its destination

265 destination = 13; //the symbol ’-’ is on the 13th step on the wheel

(43)

266 rotate_wheel(total_len_needed-n+1); //Runs " rotate_wheel(total_len_needed-n)" to rotate the wheel to its destination

267 }

268 }

269 }

270

271 // This function rotates the correct wheel by activating the pin connected to the wheels motor

272 void rotate_wheel(int current_wheel){

273 //Calculates the amount of steps the stepper motor needs to take

274 if (destination > current_position){

275 steps = destination - current_position;

276 }

277

278 //Calculates the amount of steps the stepper motor needs to take. 20 steps = one revoltuion for our steppermotors 279 else if (destination < current_position){

280 steps = 20 - current_position + destination;}

281

282 //If the wheel is already in the place it needs to be then steps = 0 283 else { 284 steps = 0; 285 } 286 287 //

288 for( int x = 0; x < steps; x++) {

289 //Sets that pin to low

290 digitalWrite(motorer[current_wheel],LOW);

291 delayMicroseconds(5000); //5 sec delay 292 //Sets that pin to high

293 digitalWrite(motorer[current_wheel],HIGH);

294 delayMicroseconds(5000); //5 sec delay 295 delay(1000); //1 sec delay 296 }

297 //Store the current postiotion of the wheel to the memory 298 EEPROM.write(current_wheel, destination);

299 300 }

301 // This function resets motors/wheels that should not display anything

(44)

APPENDIX A. FIRST APPENDIX

303

304 //"k" = every wheel that needs to be reset

305 for (int k = total_len_needed+1; k <= old_len; k++){

306 destination=0; //Destination of said wheel needs to be 0 307

308 //Get the wheels current position 309 current_position = EEPROM.read(k);

310

311 //Rotate that wheel to the 0:th position of the wheel, which holds no symbols

312 rotate_wheel(k);

313

314 //Store the new destination of that wheel in the memory 315 EEPROM.write(k, destination);

316 }

317 }

(45)

Appendix B

Second Appendix

(46)

APPENDIX B. SECOND APPENDIX

(47)
(48)

TRITA TRITA-ITM-EX 2019:62

References

Related documents

How do professional braille instructors teach braille literacy to the visually

Since the AI-camera was able to read Braille in standard size, the user was also able to go directly from learning Braille on the demonstrator to reading books and other texts

Teachers in our studies specifically emphasized the need for more education about braille and teaching methods for students with blindness, with or without additional disabilities,

The power supply of the Braille printer is designed to allow two hammers striking at the same time. If more than two hammers are energized at the same time the striking force will

We began with evaluating the current text entry methods and based on their limitations (such as screen accessibility, proper feedback, limited features and cost), we

In this section, we present the numerical results on the physics reach of the OPERA experiment in constraining the new physics parameters ε αβ.. In addition, the parameter θ 13

WinBraille contains Windows drivers for Index Braille's embossers, the WinBraille application, contraction rules for more than 20 languages, a contraction rule editor,

i) The external logic to which the power is being switched should have its own reset circuitry to automatically reset the logic when power is re-applied when moving out of