LS Eagles American Football

Important note:  This build is still in progress!!!

Jefferson T and the team at LS Eagles stumbled over our website.

20161006_191041small

Having looked around they decided on an ambitious project to convert our cricket scoreboard in to a something suitable to replace their existing one.

20161006_192931small

Jefferson contact Chris R at Bradford upon Avon and myself to ask for help with the web interface, which is an order of magnitude more complicated than our simple game!

Chris R spent several days put together a fully featured web interface to allow the team to control their scoreboard output.  You can see an online demo of this here.

interfaceaf

I spent a couple of hours writing the scoreboard.php file to handle the interface output and also a new sketch file to power all of the extra lamps and even a horn that sounds when the counter reaches zero.

Board layout

The board layout design has 16 digits, two possession lamps and a horn.

layout

Creating the electronics and wiring the board.

The LS Eagles board layout requires 16 shifter circuits, and you should follow the instructions on the Creating and Testing the Electronics page to build these, and understand how they are chained using the  standard diagram.  Because of the sheer number of digits, we use three sets of pins on the Arduino, plus some special additional pins to operate the horn and the possession lamps.

Pin 0

Pin 0 should be wired into a relay, which should control a horn.  The relay will take the 5v output from the arduino, and switching on a  high current circuit to blow the horn.  The type of relay required depends on the voltage and amps required by the horn.  I would suggest getting a 5v to 12v relay, and an automotive car horn.  That way the horn can be powered from the shared 12v power supply (subject to sufficient wattage being available)

Pins 2, 3 and 4

Pins 2 (SRCK), 3 (SERIN) and 4 (RCK) of the Arduino should be wired in to: homeScoreTens, homeScoreOnes, homeTimeOut, guestTimeout, guestScoreTens, guestScoreOnes.

Pins 5, 6 and 7

Pins 5 (SRCK), 6 (SERIN) and 7 (RCK) of the Arduino should be wired in to: down, togoTens, togoOnes, ballonTens, ballonOnes, qtr

Pins 8, 9 and 10

Pins 8 (SRCK), 9 (SERIN) and 10 (RCK) of the Arduino should be wired in to: timerMinutesTens, timerMinutesOnes, timerSecondsTens, timerSecondsOnes.

Pin 11 and GND

Pin 11 and GND should be wired in to a 16 LED NeoPixel ring, which acts as the home possession lamp.

Pin 12 and GND

Pin 12 and GND should be wired in to a 16 LED NeoPixel ring, which acts as the visitor possession lamp.

Setting up the Arduino

To set up the Arduino, you should follow the instructions on the Setting up the Arduino page to  load on the cricket sketch file and test.  Once this is working, we now need to download one additional library file and apply a new sketch, which is available to download from the afScoreboard directory in the zip file here.

To install the additional library, open a file explorer and browse to the Arduino software directory, and then in to the library directory.  Copy in the Adafruit_Neopixel folders from the zip download.

library

Now open the Arduino software, and then open the afScoreboard.ino file (included with the zip file.)  Make sure you select the USB port from the tools, serial port menu.  Then make sure Arduino Uno is selected from the tools, board menu.

arduinoaf

Arduino may ask you to update the libraries, ignore this as the software has not been tested with the new libraries.

The pre-requisites are now in place, and the sketch file can be compiled and uploaded to the Arduino.  You can do this by clicking sketch, upload.

Testing the Arduino

To test that everything has worked, open the serial monitor from the Tools menu.  Change the speed to 57600 baud, and the line ending to Newline (as per the screenshot below)

Type 4,28,1,1016,2,7,2,48,02,4,0,1# in the command window, then click send.  You should see the response shown in the screen below.

arduinotest

Setting up the Raspberry

To set up the Raspberry Pi, first follow the instructions on the Setting up the Raspberry page.  Install the Westbury on Severn web interface, but don’t test it.  Once you have done that you can install the Football interface written by Chris R.

interfaceaf

To install the interface, we should start by making a backup copy of the original Westbury on Severn interface and then deleting it from the apache directory.  To do this open a terminal on the raspberry and run the following commands (with significant care!)

sudo cp -r /var/www/html /var/www/html.old
sudo rm -rf /var/www/html/*

Now download the afScoreboard.zip updated UI, and upload it to the /home/pi/ directory on the Raspberry using WinSCP.

jessie6

raspberry3

Now open a terminal on the Raspberry, and unzip the files with the following command

cd /home/pi/
unzip afScoreboard.zip

Now copy the interface in to the apache directory and set the correct permissions with the following commands:

cd /home/pi/html.lseagles/
sudo cp -r * /var/www/html/
sudo chown -R www-data: /var/www/html/
sudo chmod 664 /var/www/html/save.txt

raspberry1

Now edit the admin password that is required to shutdown or reboot the board by editing the /var/www/html/verifyadmin.php file.  Update the if($_GET[‘pass’]==”admin”) line to change the password from admin to something secret.

Now we can test the software is working correctly.  First, open a terminal and run (this will sit in an endless loop):

sudo /usr/local/bin/scoreboard/readFromSerial.sh

Leave that terminal open, and now open a second terminal and run:

sudo tail -f /var/log/scoreboard.log

Now using a browser, open the scoreboard web interface from your laptop.  I recommend using Chrome for this.   Type in the name of the IP address of the Raspberry in to the address bar and the interface should load.  Change the score.

interfaceaf

In the second terminal you opened you should see something like:

raspberry5

 

If this is displayed, and the interface has loaded correctly. And the task is complete!