computer assisted gomoku board

35
Computer Assisted Gomoku Board By Hanfei Wang Jiahe Shi Qianwei Li Final Report for ECE 445, Senior Design, Fall 2018 TA: Anthony Caton 12 December 2018 Project No. 41

Upload: others

Post on 12-Feb-2022

3 views

Category:

Documents


0 download

TRANSCRIPT

Computer Assisted Gomoku Board

By

Hanfei Wang

Jiahe Shi

Qianwei Li

Final Report for ECE 445, Senior Design, Fall 2018

TA: Anthony Caton

12 December 2018

Project No. 41

ii

Abstract

Our project is a Gomoku board that is assisted by a computer. In a Gomoku game, when a

player puts a piece onto the board, it will detect the piece’s location and communicate with a

computer, connected via Bluetooth. The computer, running a PC program, will display the

Gomoku board on screen. When a player wins the game, the program will show which player

wins, and automatically save the entire game, so that players can reconstruct their previous

games and improve their skills.

iii

Contents

1. Introduction 1

1.1 Objective 1

1.2 Background 1

1.3 Functionality 1

1.4 Block Diagram 2

2 Design 4

2.1 Power Supply 4

2.2 Board 4

2.2.1 Pressure Sensors 4

2.2.3 Board Layout 4

2.3 Inner Circuits 4

2.3.1 Analog-to-digital Circuits 5

2.3.2 Priority Encoders 6

2.4 Control Unit 7

2.4.1 Microcontroller 7

2.4.2 Bluetooth 7

2.5 User Interface 8

3. Design Verification 9

3.1 Board 9

3.2 Inner Circuits 10

3.3 User Interface 11

4. Cost and Schedule 12

4.1 Parts 12

4.2 Labor 12

4.3 Schedule 13

5. Conclusion 15

5.1 Accomplishments 15

iv

5.2 Uncertainties 15

5.3 Ethical Considerations 15

5.4 Future Work 16

References 17

Appendix A Requirement and Verification Table 18

Appendix B Figures and Tables 22

1

1. Introduction

1.1 Objective

Gomoku is a strategy board game and it requires a lot of moves. Our goal is to build a computer

assisted Gomoku board which can simulate the on-board play automatically and simultaneously,

and to project the simulation onto a screen. Often during practicing, players must record the

whole game move by move manually on paper so that they can later analyze their games.

However, this way of recording not only distracts players during their games, but also is

considered inefficient and tedious. Other than the negative influences on players, current

technology of broadcasting Gomoku games is still outdated. The current method which medias

adopt to stream Gomoku games is manually putting Go pieces on the Go board to simulate the

actual game. In this way, for both players and audiences, replay of the game is inconvenient

and not efficient enough. Gomoku has world championships every two years and is developing

into a more popular and world-wide abstract strategy board game [1]. The current technology

is not sufficient to support the growing need for efficient broadcasting and game replay.

We will use an array of pressure sensors in the design to achieve the automation of the board.

The standard Go board uses 15×15 of the 19×19 grid intersections [2]. To simplify and increase

the fluency of the design, we will make a board with 9×9 grid intersections instead. We will

adopt an appropriate microprocessor to collect data from pressure sensors, analyze data and

send signals to projected screen through a Bluetooth device.

1.2 Background

Computer usage has been associated with Gomoku for decades. Artificial intelligence

specialized in playing Gomoku games has been created. In Gomoku World Championship (GWC)

2017, Yixin, a program created to play Gomoku, had a 2-game match with Rudolf Dupszki, the

champion of GWC 2015 [3]. However, there has not been a similar product designed for easier

broadcasts of Gomoku games. We expect our project to be a possible solution for better

gaming and broadcasting experiences. With similar working theory, we also expect the design

to be applied to other board games, especially Go, which shares basically the same board as

Gomoku.

1.3 Functionality

The high-level functions of our project should include the following 3 aspects:

Our board should be able to detect a piece being put onto the board, and accurately report

which cell the piece is put in with a successful rate of over 99.8%, which is the most basic

function for our board.

2

The microprocessor should be able to send the coordinate of the last placed piece to user

interface via Bluetooth, and the user interface should draw it correctly. The whole process is

expected to be in real-time -- less than 1s latency. The shorter the latency, the better the user

experience will be.

The board should be very sensitive for a force of from 20g to 50g, and insensitive for a force

less than 30g, since a typical pressure applied by a player placing a piece is 20g to 50g.

1.4 Block Diagram

Figure 1. Block Diagram

3

Figure 1 provides a graphical presentation of the complete flow of the system. It shows the

basic components and functions of each block, and the detailed connection among all blocks.

Starting with the board block, it is responsible to detecting any moves made on the board using

pressure sensors. The inner circuit block is responsible for encoding analog inputs from board

block into 16-bit digital outputs. The control unit decodes signals encoded by inner circuit block

and sends the result to PC via Bluetooth. The user interface block displays stones put on the

board, checks if the game ends and which side wins, and saves the game for replay. Finally, the

power supply block supplies power to all other blocks of the system. Using voltage regulator,

the power supply block provides a stable and lasting voltage supply to ensure the proper

functioning of the system.

4

2 Design

2.1 Power Supply

The power supply is designed to provide stable and lasting power to all other blocks. With the

concern of low-tolerance of PCBs to large current, we decided to use basic L7805 voltage

regulator with a 5V fixed output voltage. This fixed regulator provides a local regulation,

internal current limiting, thermal shutdown control, and safe area protection for our project [4].

2.2 Board

The board module we managed to achieve consists of the actual board, 9 × 9 sensor arrays and

the front cover that simulates the layout of a real Gomoku Board. The purpose of this module is

to detect any legal moves made on the board by players. The finalized design has three layers

of the board layer, the sensor layer and the cover layer because we want not interference

between pressure sensors.

2.2.1 Pressure Sensors

The pressure sensors used in the project is FSR402. FSR402 pressure sensor is a robust polymer

thick film device which exhibits a decrease in resistance with increase in force applied to the

surface of the sensor. The pressure sensor is picked for the following reasons: first, it is a round

sensor 18.28 mm in diameter, which has the shape and size in perfect match with Gomoku

stones; second, it’s force range from 10 g to 10000 g corresponding resistance range from 100

kΩ to 300 Ω satisfy the demand of the project.

2.2.3 Board Layout

The 3-layer design with the board base, the pressure sensors and the front cover simulates the

real Gomoku board used in tournaments, allows accurate detection of pressure sensors and is a

comparatively low cost solution. With the board laying on the top of the box, where we store all

PCBs and power supply, the appearance of the project becomes neat and well-ordered.

2.3 Inner Circuits

The inner circuit block takes inputs from the board block, transfers the analog signals into

digital signals through analog-to-digital signals, and finally encodes these signals into 16-bit

location codes through encoders. The analog-to-digital signals are necessary because encoders

cannot take analog signals. The priority encoders are necessary because the project has too

many outputs for affordable microprocessors available in the market. Also, this cascading

method is rather easy to implement.

5

2.3.1 Analog-to-digital Circuits

Figure 2. Analog-to-digital Circuits

Figure 2 is the schematic of the analog-to-digital circuit we used to transfer analog signals sent

from the pressure sensors to the digital signals which can be processed by priority encoders.

The resistances we choose to use in the circuit depend on the force-resistance curve of the

pressure sensors and the force been applied on the pressure sensors. We adopt a non-inverting

comparator circuit to achieve the function. The op-amp is LMV324M model, which would

output a voltage high when V+ is larger than V-, and a voltage low when V+ is smaller than V-. As

indicated in Figure 2, when V+ is larger than V-, Vout is expected to be 5 V, and thus provides a

digital “1” signal to the encoder. When V+ is smaller than V-, the Vout is expected to stay at 0. V+

is calculated by Eq.1 and V- is always 2.5V as RA.1.2 and RA.1.1 are both 10 kΩ.

𝑉+ = 𝑉𝑐𝑐 ×𝑅𝐹𝑆𝑅𝐴.1

𝑅𝐹𝑆𝑅𝐴.1+𝑅𝑅𝐴.1.3 (Eq.1)

After calculating the average force of applied by the stone’s weight and by player when putting

the stone onto the board, we estimate the resistance of the pressure would drop to between

20 kΩ and 30 kΩ. Thus, we connect a 47 kΩ resistance in series with the pressure sensor.

When no force is applied on the pressure sensor, its resistance is much larger than 100 kΩ, and

V+ stays close to 5 V. When proper force is applied to the pressure sensor, its resistance drops

below 47 kΩ, V+ drops to a value smaller than V- accordingly. Thus, combining the op-amp with

the 47 kΩ resistance, the analog-to-signal circuit would only output a voltage low when

players put stone on the board with some pressure.

6

2.3.2 Priority Encoders

Priority encoders take all their data inputs one at a time and converts them into an equivalent

binary code at its output [5]. We choose priority encoders over other choices such as

multiplexers because the binary code outputs can easily help us determine which grid

intersection on the board does the player put the stone on. The priority encoders used in the

design are CD40147B CMOS type because it is a 10-line to 4-line model which best serve our

requirements of 9 input pins. One difficulty of using this priority encoder is that it has active low

inputs and outputs and would always process the highest priority line, line 9. To ensure that

line 9 is never active because we only use 9 input lines of the encoders instead of 10 input lines,

we connect line 9 to voltage high directly and thus prevent line 9 from interfering activations of

other lines.

We use two layers of priority encoders to accommodate the limit I/O ports of microprocessor,

the connections are shown in Figure 3 and Figure 4. The first layer has 9 priority encoders, and

each corresponds to one column of the 9 × 9 sensor array. We connect sensors in each column

in sequence to inputs line 0 to line 8 of the first layer priority encoders. Because only one

pressure sensor would be pressed hard enough at one time, the priority encoders can always

output a binary code at the time. The 4 second layer encoders would further encode the 4-bit

binary code outputs of the first layer encoders. The first, second, third and fourth bit of each

first layer encoder are connected to the corresponding input pins of each second layer

encoders. The final outputs sent from encoders to microprocessors would be 16-bit binary

codes consisted of 4 4-bit codes from 4 priority encoders in the second layer. Figure 3 is the

schematic of first layer encoder connection, VOA1 through VOA9 are connected to the

corresponding analog-to-digital circuit outputs of each row. Outputs EA1 connects to one of the

inputs of encoder A in the second layer, and EA2 corresponds to one of the inputs of encoder B

in the second layer, and so forth for EA3 and EA4.

Figure 3. First layer encoder Figure 4. Second layer encoder

7

2.4 Control Unit

The control unit block consists of two parts: a microcontroller and a Bluetooth module. The

main functionality of our control unit block is to process output data from inner circuits block,

decode the data, and transmit to User Interface application via Bluetooth. This unit can also

handle other inputs/outputs, such as buttons and LED indicators.

2.4.1 Microcontroller

For the microcontroller, we choose to use ATmega328P-PU, because we can load programs to

the chip with Arduino. It also has enough programmable I/O ports for our 16-bit output from

the 2nd layer encoders, as well as a serial port for communication with our Bluetooth module.

The connection schematic for our microcontroller is shown in Figure 5.

Figure 5. Schematic for Microcontroller

2.4.2 Bluetooth

The Bluetooth module is for communications between the microprocessor and the user

interface, so that the game can be broadcasted through a screen. For the Bluetooth module, we

use HC-06 Bluetooth Serial Pass-Through Module, which can pair with a PC and send data to the

PC’s serial port wirelessly.

8

2.5 User Interface

User Interface Block will be consisting of a PC Program. The program needs to receive data from

the Bluetooth Module in the Control Unit Block. Whenever a piece is put on the board, the PC

program should receive the data via Bluetooth and display the game board on the computer

screen.

If the game is ended, the PC program should receive an end game signal via Bluetooth, and

display the result (the winning player or it is a draw) on the screen. If the game state is changed

by the Reset Button or the Undo Button, the PC program should also receive corresponding

signals reflect the change on the screen. Figure 6 shows the flowchart of the program.

Figure 6. Software Flowchart

9

3. Design Verification

3.1 Board

Requirements: Resistance of the pressure sensor would stay above 100 kΩ when force applied

is less than 20g and drop to 30 kΩ when a force equal to or larger than 20 g is applied on the

surface, thus ensure a detection accuracy of higher than 99.8%.

Verification:

a) Apply forces of 10 g, 20 g, 30 g, 40 g, and 50 g to each pressure sensor.

b) Measure the resistance of pressure sensors.

c) Record all the results, check for outliers and calculate the average resistance we got by

applying different forces.

There were no outliers when we did the verification and in Table 1 and Figure 7 are the final

results we got for the verification. There are minor differences between the results we

measured and the resistance-force curve provided by the datasheet. But overall, the pressure

sensors have resistance range satisfy the design requirements and stable performance that can

ensure detection accuracy.

Figure 7. FSR Resistance-Force Plot

10

Table 1. FSR Resistance-Force Data

Force (g) Resistance (kΩ)

10 100

20 31.4

30 18.7

40 12.5

50 10.3

3.2 Inner Circuits

Inner circuits block is significant in our design because it determines if the software can receive

correct location binary codes. To check the outputs from the second layer encoders can match

with the location code we set in the software, we manually set each input of the first layer

encoders to voltage low and keep all others at voltage high, collect the inputs to the

microprocessor through Bluetooth, and compare them directly with the location binary codes

we entered into the software. Table 2 shows the abbreviated version of activated pressure

sensors and the corresponding binary codes received by microprocessor. And Table B.1 shows

the full verification results we got through the testing process. After comparing the 16-bit

binary code microprocessor received from priority encoders to the coordination data we have

in the software, it proves that the results match our design expectation. To convenient the

recording process, we refer to each pressure sensor through its column and row indexes.

Table 2

D C B A

Row 1 col 15 15 col

Row 2 15 15 15 col

Row 3 15 15 col 15

Row 4 15 15 col col

Row 5 15 col 15 15

Row 6 15 col 15 col

Row 7 15 col col 15

Row 8 15 col col col

Row 9 col 15 15 15

11

3.3 User Interface

The user Interface is required to receive data sent from control unit. To verify this, we first pair

the Bluetooth module with the PC, then we load a to microcontroller a program that repeatedly

transmits a sequence of numbers through the microcontroller’s serial port, which is connected

with the Bluetooth module that is paired with PC. After the Bluetooth module starts to transmit

data, we run on the PC a python script that reads from the communication port paired with the

Bluetooth module, and prints out the data it receives. We verified that the number sequence

received by the User Interface is the same as transmitted by the Bluetooth module.

12

4. Cost and Schedule The total cost of the project is 25842.4254 dollars, which consists of two parts: labor fee and

prototype manufacturing cost. Also, a detailed schedule is provided in table 4.

4.1 Parts

Table 3. Parts Costs

Part Manufacturer Retail Cost ($)

Bulk Purchase Cost ($)

Actual Cost ($)

Pressure sensor: FSR Model 402,

0.5’’ circle

Interlink Electronics 5.6000 560.0000 453.6000

L7805 Positive Voltage Regulator

STMicroelectronics 0.9500 1.9000 0.9500

CR0603-FX-4702ELF

Chip Resistor

Bourns Inc. 0.0086 2.5800 0.6966

CR0603-JW-103ELF Chip Resistor

Bourns Inc. 0.0064 2.5600 1.0368

Atmega328-PU Chip

Atmel 4.8300 14.4900 4.8300

PCB PCBWay 25.0000 189.0000 125.0000

CD40147BM Priority Encoder

Texas Instrument 1.2510 25.0200 17.5140

LMV324M/NOPB OP-AMP

Texas Instrument 1.24200 43.4700 29.8080

HC-06 Bluetooth Serial Module

Atomic Market 8.9900 8.9900 8.9900

Total N/A N/A 848.0100 642.4254

4.2 Labor

Based on the starting salary for students graduating with a bachelor's degree in electrical

engineering (2016-17), our estimated labor cost is $35 per hour per person. We officially

started the design and manufacture process in week 5 of this semester, so the total process

was 12 weeks. We worked around twenty hours per week per person. Regardless of overtime

working during weekends and Thanksgiving break, the estimated labor cost is calculated as:

3 ∗ ($35

ℎ𝑟) ∗ (20

ℎ𝑟𝑠

𝑤𝑒𝑒𝑘) ∗ (12 𝑤𝑒𝑒𝑘𝑠) = $25200

13

4.3 Schedule

Table 4. Project Schedule

Week Jiahe Shi Qianwei Li Hanfei Wang

10/01/2018 Read data sheet of

the microprocessor

and design the

circuit for

microprocessor.

Read data sheet of

the Bluetooth

module and design

the circuit for

Bluetooth.

Design the board

block and inner

circuit block.

10/08/2018 Finish and test

version 1 software

program used in the

microprocessor.

Test and finalize

Bluetooth Module

functions.

Order parts;

Finish and test

version 1 sensor

block design

(schematics and

layout).

10/15/2018 Refine, debug, and

finalize the software

program to improve

performance and to

lower cost.

Finish and test

version 1 user

interface.

Begin version 1

power supply

design

10/22/2018 Test and finalize

microcontroller

functions.

Refine, debug, and

finalize user

interface to improve

visual effect.

Test and finalize

version 1 sensor

block and power

supply.

10/29/2018 Coordinate

microcontroller

with Bluetooth

Module.

Coordinate

microcontroller

with Bluetooth

Module.

Prototype version 2

sensor block and

power supply.

11/05/2018 Integrate the MCU

block with other

blocks.

Run unit and

integrated test for

all modules.

Integrate the MCU

block with other

blocks.

Run unit and

integrated test for

all modules.

Test and finalize

version 2 sensor

block and power

supply;

Coordinate with

MCU.

11/12/2018 PCB re-design PCB re-design PCB re-design

11/19/2018 Start manufacturing Start manufacturing Start manufacturing

11/26/2018 Integrate MCU with

user interface

Integrate MCU with

user interface

Integrate inner

circuit with MCU

14

12/03/2018 Prepare

demonstration and

presentation;

Keep working on

final paper.

Prepare

demonstration and

presentation;

Keep working on

final paper.

Prepare

demonstration and

presentation;

Keep working on

final paper.

12/10/2018 Finish final paper. Finish final paper. Finish final paper.

15

5. Conclusion

5.1 Accomplishments

Although we haven’t completed our 9 x 9 board, due to PCB failures, we successfully make a

3x3 version, which contains all the major functionalities of our original 9x9 design. When a

player puts a stone on a specific intersection of the board, the pressure sensor under the

intersection would immediately detect the stone. The control unit will successfully decodes the

location of the stone, and send the location to User Interface module via Bluetooth. The User

Interface, receiving the location of the stone successfully, will draw it on the screen, and the

time delay between putting a stone and it showing up on the screen is less than 0.5 second. The

time consumed to display is in acceptable range and would not affect the experience of the

players using the board. Once the game is finished with one side wins, the software would

detect any five same-colored stones in a row and show which side wins on the user interface.

5.2 Uncertainties

We didn’t complete our original project, mainly due to failures of our 9 x 9 PCBs. When we first

completed all the soldering, we tested and verified that the 9 x 9 PCBs were working correctly.

However, when we tested the PCBs the next day, two of the first layer encoders didn’t produce

correct results.

We have checked all the wire connections and the components on the PCB, and it showed that

the wires and chips were all fully functional. Thus, the most reasonable explanation is that

when we moved the PCBs, some electrostatic discharge might have damaged the PCBs itself. In

our future manufacture process, we need to be more careful with our PCBs.

5.3 Ethical Considerations

As trained engineers of University of Illinois, it’s our responsibility to comply with Code of Ethics

such as IEEE and ACM. We should also have our own standards of conduct consistent with IEEE

and ACM Codes of Ethics [6].

The production of our project requires large amount of soldering. With the equipments we

have, it can be a threat to the person who solders parts together. Through the soldering

process, we tried our best to follow the IEEE Code of Ethics and to avoid injuring others, their

property, reputation, or employment by false or malicious action [7]. To avoid as much hurt our

project may make to the potential users of our project as possible, we use minimum amount of

potentially dangerous component such as batteries and diodes.

Also, pertain to the third rule of IEEE Code of Ethics, we stay honest and realistic in stating our

claims and estimate based on the available data we have [7]. When our hardware parts fail to

16

work normally, we tested through all possible causes of the failure and then came up with the

conclusion that the PCB failure was the cause.

From the perspective of professional responsibilities contained in ACM Code of Ethics and

Professional Conduct [8], we strived to maintain high quality both in the producing process and

the final product. We tried hard to seek advice and help from our TA and peers who have

experience and knowledge of our project. We also take advice from instructor during design

review and modify our design so that it’s more realistic and user friendly.

Overall, through this semester we have complied with Codes of Ethics and would keep follow

them in our careers.

5.4 Future Work

We will try to complete the 9 x 9 board first, as we have analyzed the possible reasons of our

previous failure we will avoid the same mistake and be more cautious during the manufacture

process. After the 9 x 9 board is completed, we will scale the board up to a standard size 15 x 15

Gomoku board, which requires a change in our current encoder to a 16-5 encoder and some re-

design for the inner circuit block and control unit.

Besides for the size of the board, there are also some other features can be implemented, such

as undo and reset button and some LED indicators. These features will help the user better

interact with the board. Different game modes such as human vs. computer can also be

implemented through software.

17

References [1] Gomoku World, ‘World Championships - History’, 2018. [Online]. Available:

http://gomokuworld.com/worldchampionship/6. [Accessed: 18 - Sep - 2018].

[2] Allis, L. V.; van der Meulen, M.; and van den Herik, H. J. "Proof-Number Search."

Artificial Intelligence 66, 91-124, 1994. Available:

http://mathworld.wolfram.com/Gomoku.html. [Accessed: 18 - Sep - 2018].

[3] K. Sun, “Rudolf Dupszki versus Yixin,” AI EXP Atom. [Online]. Available:

http://www.aiexp.info/ai-vs-human-gomoku-2.html. [Accessed: 12-Dec-2018].

[4] "Voltage Regulator - 5V - COM-00107 - SparkFun Electronics", Sparkfun.com, 2018. [Online].

Available: https://www.sparkfun.com/products/107. [Accessed: 11- Dec- 2018].

[5] “Priority Encoder and Digital Encoder Tutorial,” Basic Electronics Tutorials, 10-Sep-2018.

[Online]. Available: https://www.electronics-tutorials.ws/combination/comb_4.html.

[Accessed: 11-Dec-2018].

[6] E. I. T. S. Services, “Ethical Guidelines,” Ethics and Engineering. [Online]. Available:

https://courses.engr.illinois.edu/ece445/guidelines/ethical-guidelines.asp. [Accessed: 12-

Dec-2018].

[7] “IEEE Code of Ethics,” IEEE - Advancing Technology for Humanity. [Online]. Available:

https://www.ieee.org/about/corporate/governance/p7-8.html. [Accessed: 12-Dec-2018].

18

Appendix A Requirement and Verification Table

Table A.1 Voltage Regulator Requirements and Verifications

Requirements Verifications Verification Status (Yes/No)

1)Regulate voltage 5V +/‐ 5% from the source.

a) Connect the regulators to the voltage source. b) Use voltmeter to measure voltages provided by the two regulators, should supply voltages within specified ranges.

Yes

2) Maintain thermal stability below 45°C.

a) Connect the regulator to a load which draws current at 300mA (the estimated largest current draw). b) Use IR thermometer to measure the regulator temperature, should stay below 45°C.

Yes

Table A.2 Pressure Sensor Requirements and Verifications

Requirements Verifications Verification Status (Yes/No)

1) Detection accuracy higher than 99.8%.

a) Connect voltage divider circuit of the pressure sensor into power supply and set it under a grid intersection of the board. b) Put a piece on the intersection and measure the Vout indicated in Figure 3 using a multimeter. c) Repeat the process for 1000 times and only 2 failure is allowed. d) If the accuracy cannot reach 99.8%, we should re-design the sensor block.

Yes

2) When piece along is on the board, and no pressure is applied, the pressure sensor voltage should not below 100k Ohm.

a) Put piece on each intersection. b) Measure resistance at the end of the pressure sensor. All resistance measured should be above 100k Ohm.

Yes

19

TableA.3 Priority Encoder Requirements and Verifications

Requirements Verifications Verification Status (Yes/No)

1) First layer encoders should be able to read all 81 inputs from ADCs.

a) Connect the first layer encoders to microprocessor directly. b) The connected encoder should output a 4-bit binary code while the pressure sensor is pressed. c) Check all the encoders by pressing all 81 sensors row by row.

Verified we test on breadboard. Worked on PCBs for a while, but failed when we demoed.

2) Second layer encoders should encode signals from first layer 9 unique 4-bit binary signals.

a) After finishing testing the first layer encoders, connect the second layer encoders with the microprocessor. b) Press pressure sensors one by one and check the reading from the microprocessor. c) Ensure all the outputs from the encoders match our design of the sensor block.

Verified we test on breadboard. Worked on PCBs for a while, but failed when we demoed.

Table A.4 Microcontroller Requirements and Verifications

Requirements Verifications Verification Status (Yes/No)

1) The microcontroller must process the inputs from encoders and send the coordinates to Bluetooth Module in less than 0.4 seconds.

a) Connect the an encoder and Bluetooth Module to Arduino A000066. b) Use the microcontroller’s internal RTC to measure the time. c) Make sure the time is less than 0.4 seconds.

Yes

2) The microcontroller must output digital HIGH with a voltage > 2V.

a) Using arduino to program the microcontroller such that it outputs a digital HIGH from port PC5. b) Use a multimeter to measure the output voltage of PC5. c) Ensure the output voltage is greater than 2V.

Yes

20

Table A.4 Microcontroller Requirements and Verifications (Continued)

3) The microcontroller must output digital LOW with a voltage < 0.4V.

a) Using arduino to program the microcontroller such that it outputs a digital LOW from port PC5. b) Use a multimeter to measure the output voltage of PC5. c) Ensure the output voltage is smaller than 0.4V.

Yes

Table A.5 Bluetooth Requirements and Verifications

Requirements Verifications Verification Status (Yes/No)

1)The signal integrity should remain perfect within 9 meters range.

a) To simplify the test procedure, we will use a mobile phone to test the connection range. b) Connect a mobile phone to the Bluetooth device. c) Move around the Bluetooth device with increasing range till 9 meters. d) The device should be properly connected and the mobile phone should receive all the data that is sent be the Bluetooth device during the whole process.

Yes

21

Table A.6 User Interface Requirements and Verifications

Requirements Verifications Verification Status (Yes/No)

1) The program must correctly determine the player’s move, and the accuracy should be higher than 99.8%.

a) Play for 1000 moves, and record all the inaccurate moves. b) Ensure there are no more than 2 inaccurate moves.

Yes

2) The program must correctly determine the game result, and the accuracy should be higher than 99.8%.

a) Designed a loop for the Arduino to continuously send different coordinates to the software. b) Play for 500 games, monitor all the results. c) Ensure that there is at most 1 wrong result.

Yes

3) The UI must show the piece in its correct place on the screen in less than 0.2 seconds.

a) Use python’s timer to measure the time between the receiving of the signal from Bluetooth and the end of drawing the piece on the screen. Also, the piece has to be in the right block.

Yes

22

Appendix B Figures and Tables Table B.1 Verification of Priority Encoders

Pressure Sensor 16-bit Location Binary Codes

(0,0) 0001-1111-1111-0001

(0,1) 1111-1111-1111-0001

(0,2) 1111-1111-0001-1111

(0,3) 1111-1111-0001-0001

(0,4) 1111-0001-1111-1111

(0,5) 1111-0001-1111-0001

(0,6) 1111-0001-0001-1111

(0,7) 1111-0001-0001-0001

(0,8) 0001-1111-1111-1111

(1,0) 0010-1111-1111-0010

(1,1) 1111-1111-1111-0010

(1,2) 1111-1111-0010-1111

(1,3) 1111-1111-0010-0010

(1,4) 1111-0010-1111-1111

(1,5) 1111-0010-1111-0010

(1,6) 1111-0010-0010-1111

(1,7) 1111-0010-0010-0010

(1,8) 0010-1111-1111-1111

(2,0) 0011-1111-1111-0011

(2,1) 1111-1111-1111-0011

(2,2) 1111-1111-0011-1111

(2,3) 1111-1111-0011-0011

23

Table B.1 (Continued)

(2,4) 1111-0011-1111-1111

(2,5) 1111-0011-1111-0011

(2,6) 1111-0011-0011-1111

(2,7) 1111-0011-0011-0011

(2,8) 0011-1111-1111-1111

(3,0) 0100-1111-1111-0100

(3,1) 1111-1111-1111-0100

(3,2) 1111-1111-0100-1111

(3,3) 1111-1111-0100-0100

(3,4) 1111-0100-1111-1111

(3,5) 1111-0100-1111-0100

(3,6) 1111-0100-0100-1111

(3,7) 1111-0100-0100-0100

(3,8) 0100-1111-1111-1111

(4,0) 0101-1111-1111-0101

(4,1) 1111-1111-1111-0101

(4,2) 1111-1111-0101-1111

(4,3) 1111-1111-0101-0101

(4,4) 1111-0101-1111-1111

(4,5) 1111-0101-1111-0101

(4,6) 1111-0101-0101-1111

(4,7) 1111-0101-0101-0101

(4,8) 0101-1111-1111-1111

(5,0) 0110-1111-1111-0110

24

Table B.1 (Continued)

(5,1) 1111-1111-1111-0110

(5,2) 1111-1111-0110-1111

(5,3) 1111-1111-0110-0110

(5,4) 1111-0110-1111-1111

(5,5) 1111-0110-1111-0110

(5,6) 1111-0110-0110-1111

(5,7) 1111-0110-0110-0110

(5,8) 0110-1111-1111-1111

(6,0) 0111-1111-1111-0111

(6,1) 1111-1111-1111-0111

(6,2) 1111-1111-0111-1111

(6,3) 1111-1111-0111-0111

(6,4) 1111-0111-1111-1111

(6,5) 1111-0111-1111-0111

(6,6) 1111-0111--0111-1111

(6,7) 1111-0111-0111-0111

(6,8) 0111-1111-1111-1111

(7,0) 1000-1111-1111-1000

(7,1) 1111-1111-1111-1000

(7,2) 1111-1111-1000-1111

(7,3) 1111-1111-1000-1000

(7,4) 1111-1000-1111-1111

(7,5) 1111-1000-1111-1000

(7,6) 1111-1000-1000-1111

25

Table B.1 (Continued)

(7,7) 1111-1000-1000-1000

(7,8) 1000-1111-1111-1111

(8,0) 1001-1111-1111-1001

(8,1) 1111-1111-1111-1001

(8,2) 1111-1111-1001-1111

(8,3) 1111-1111-1001-1001

(8,4) 1111-1001-1111-1111

(8,5) 1111-1001-1111-1001

(8,6) 1111-1001-1001-1111

(8,7) 1111-1001-1001-1001

(8,8) 1001-1111-1111-1111

26

Figure B.1 Microprocessor PCB Layout

27

Figure B.2 Sensor PCB Layout

28

Figure B.3 3 × 3 PCB Layout

29

Figure B.4 PCB Manufacturing

30

Figure B.5 Board Manufacturing

Figure B.6 Board Prototype

31

Figure B.7 User Interface