Group 03 Project Documentation
Group 03 Project Documentation
Steven Donahoe
Rachel Rohr
Steven Terrana
Page | 4
Description
We created an interactive Connect Four board to hang on a wall in Benedum Hall. Two players
take turns placing their hand over one of the seven IR sensors to indicate in which column they
would like to go. The lowest available square in the column is populated with the correct color
of the player, alternating between green and red. If a player attempts to place a marker in a
column that is already full, the piezo element beeps three times. A servo motor rotates an arrow
back and forth between Player 1 and Player 2 to indicate whose turn it is. After each turn, the
Arduino checks for a winning string of four; once a player has won, music is played and the
board is reset. If there is a tie, the board LEDs flash T I E and then reset the game after 5
seconds. A reset pushbutton is also available for use during a game.
Bill of Materials
Obtained from Lab/Arduino Kits
Manufacturer/
Vendor
Arduino
Vilros
Part Description
(Quantity)
Analog Infrared
Distance Measuring
Sensor 20-150 cm
(7)
Arduino Uno R3
Board (2)
330 Resistors
(84)
Piezo Element (1)
Vilros
Pushbutton (1)
Vilros
SG90
Vilros
Texas
Instruments
Jumper Wires
Shift registers (2)
74HC595
Arduino
Vilros
Breadboards (8)
Power/Ground
Wires (450+ ft)
Model Number
SEN05312B
PKM17EPP-4001-B0
Notes
Used for player input on deciding
which column to play
Page | 1
Obtained Elsewhere
Manufacturer/
Part Description
Vendor
(Quantity)
Amico
50 Pcs 5mm Round Head
Common Cathode RGB
Light LED Emitting
Diodes (2)
Radioshack
Perfboard Combo Pack:
2-Pack (3)
Radioshack
Pre-Punched IC-Spacing
Perfboard (2)
Texas
Shift registers (10)
Instruments
Cost
Model
Number
$10.94
$11.97
$6.98
$7.95
Notes
(2) RBG LEDs be in each board
square: (42) squares for (84)
total RGB LEDs
2760328
Fabricated
Part Description
Wood for Game board
Notes
Wooden structure as seen in pictures
Tape (Medical/Masking/Gorilla)
Page | 2
System Design
(7) IR Sensors
Servo
Motor
(12) Shift
Registers
(2) Each
Breadboard
Piezo
Element
Pushbutton
Page | 3
Page | 4
Page | 5
Circuitry
Master Arduino:
To Breadboard
To Breadboard
To Slave GND
To Piezo Element
To Servo Element
To Column 1 IR
To Column 2 IR
To SR Pin 14
To SR Pin 12
To Column 3 IR
To Column 4 IR
To Slave Pin A4
To SR Pin 11
To Pushbutton
To Slave Pin A5
Page | 6
Slave Arduino:
To Breadboard
To Breadboard
To Master GND
From Master 5v
To Column 5 IR
To Column 6 IR
To Column 7 IR
To Master Pin A4
To Master Pin A5
Note that the Master and Slave Arduinos are directly connected with (3) different
pins: A4, A5, and GND. Additionally, the 5V from the Master Arduino is fed to the
Vin on the Slave Arduino so they share a common voltage.
Page | 7
Shift Registers:
Each shift register controls one row for one player, yielding a total of 12 shift registers.
To Column 6 LED
To +5 V
To Column 5 LED
To Column 7 LED
To Column 4 LED
Data In
To Column 3 LED
To GND
To Column 2 LED
To Latch Pin
To Column 1 LED
To Clock Pin
To +5 V
To GND
Data Out
The pins of the shift register are numbered as follows, which apply to the circuit on the following
page:
Pin 1
Pin 16
Pin 2
Pin 15
Pin 3
Pin 14
Pin 4
Pin 13
Pin 5
Pin 12
Pin 6
Pin 11
Pin 7
Pin 10
Pin 8
Pin 9
Page | 8
All shift registers share a common Clock Pin, which is connected to Master Arduino Pin 3.
All shift registers also share a common Latch Pin, which is connected to Master Arduino Pin 4.
The shift registers must be connected in a specific order for the code to properly pass in the bits
that light the correct colors of the correct LEDs. Pin 14, the Data In pin of each shift register,
receives the data from the Arduino pin or from the previous shift register. Pin 9, the Data Out
pin of each shift register, passes on the remaining bits to the next shift register. The shift
registers are connected as follows. Note that the upper text of each shift register refers to Pin 14
and the lower text refers to Pin 9.
SR
for
P1 R1
From SR P1 R2
SR
for
P2 R1
From SR P2 R2
To SR P1 R6
SR
for
P1 R2
From SR P1 R3
SR
for
P2 R2
To SR P1 R1
SR
for
P1 R3
From SR P1 R4
To SR P2 R1
SR
for
P2 R3
To SR P1 R2
SR
for
P1 R4
From SR P1 R5
From SR P1 R6
SR
for
P2 R4
From SR P2 R1
To SR P1 R5
From SR P2 R5
To SR P2 R3
SR
for
P2 R5
To SR P1 R4
SR
for
P1 R6
From SR P2 R4
To SR P2 R2
To SR P1 R3
SR
for
P1 R5
From SR P2 R3
From SR P2 R6
To SR P2 R4
SR
for
P2 R6
From Arduino
Master Pin 5
To SR P2 R5
Page | 9
The image below shows the (12) shift registers set up before the wires going to the RGB LEDs
were added. At this point, all shift registers properly connected to +5 V and GND. All Clock
pins and all Latch pins are connected. Additionally, the Data In, Data Out, connections as
described in the previous page are set up. Note that the three wires that must be connected to
the Arduino Master are not shown.
Page | 10
Each row contains (7) RGB LEDs. One shift register controls one rows green leg of each LED and another shift register controls the same rows red leg of each LED. One rows LEDs
are set up as follows:
The color leg of each RGB is indicated by P#. Player 1 is green and Player 2 is red.
See the RGB leg schematic to the right. Each LEDs ground leg must also be connected to GND.
Column number is indicated by C#. SR# is the shift register of the associated player.
All resistors used were 330 .
Page | 11
Column 2
Master A1
Column 3
Master A2
Column 4
Master A3
Column 5
Slave A0
Column 6
Slave A1
Column 7
Slave A2
Servo Motor:
The servo motor has three wires. The red wire must be connected to +5 from either Arduino.
The brown wire must be connected to GND from either Arduino. The orange wire must be
connected to Master Arduino pin 9.
Pushbutton:
The pushbutton should be set up as follows:
Top Left to +5 V
Bottom Left to 330
resistor then to GND
Bottom right to
Master Arduino pin 2
Piezo Element:
The piezo element has a positive and negative side. The positive side has a (+), indicating that
that leg should be connected to Master Arduino pin 10. The other leg must be connected to
GND from either Arduino.
Page | 12