Arduino Fencing Scoring Apparatus

Download as pdf or txt
Download as pdf or txt
You are on page 1of 8

technology workshop craft home food play outside costumes

Arduino Fencing Scoring Apparatus


by aireal on August 31, 2015

Table of Contents

Arduino Fencing Scoring Apparatus . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1

Intro: Arduino Fencing Scoring Apparatus . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 2

Step 1: Configuring your Arduino . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 2

Step 2: Hardware: Scoring LEDs . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 3

Step 3: Hardware: Weapon Change Button . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 4

Step 4: Hardware: Buzzer . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 4

Step 5: Hardware: Weapon and Lame Interface . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 5

Step 6: Hardware: Power Supply . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 5

Step 7: Enclosure . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 6

Step 8: How the Code Works . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 7

Step 9: Testing your Scoring Box . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 7

Step 10: ................................................................................................................. 7

Related Instructables . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 8

Advertisements . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 8

Comments . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 8

http://www.instructables.com/id/Arduino-Fencing-Scoring-Apparatus/
Intro: Arduino Fencing Scoring Apparatus
This is a tutorial on how to build a fencing scoring machine using the Arduino Uno. It supports all 3 fencing disciplines of foil, epee and sabre.

Fencing boxes or scoring machines are normally very expensive and I have, for a long time, been wanting to create an open-source box. Now finally here is it! The hope
is that this benefits clubs out there that don't have the money to by scoring boxes for hundreds of dollars and can make this one for around $25.

All the source code, firmware and hardware designs are released under the GPL licence so it is free to use and distribute. It can all be found on the github website here.

Bill of Materials:

1 x Arduino Uno or equivalent (You will need 6 ADC pins and at least 7 digital I/O pins)
6 x 20kR resistors
1 x Green LED Matrix
1 x Red LED Matrix
2 x White Matrix
2 x Yellow LEDs
6 x 220R resistors
1 x Buzzer
7 x Banana Plug Sockets (3 Green, 3 Red, 1 Black)
Breadboard or Veraboard

Step 1: Configuring your Arduino


It is assumed that you already know how to upload code to your Ardruino, if not, Google is your friend.

This instructable uses the all_weapon box Arduino code. The file to be found here. Upload the all_weapon_box code to your Arduino and you are ready for the next step

If you haven't used an Arduino board before, it is really easy and there are plenty of tutorials online. Google is your friend.

I used an Arduino Nano, it is pretty much equivilent to the Uno in terms of IO and the Micro Controller Unit. Now that you have the heart of the scoring box and just need
to build the rest of the circuit.

http://www.instructables.com/id/Arduino-Fencing-Scoring-Apparatus/
Step 2: Hardware: Scoring LEDs
I have used a couple of RGB matrices for the scoring lights. These are pretty cool because you can use on matrix for both on target and off target hits, you can also use
them for the short circuit lights. Getting RGB Matrices to make colours other then RGB requires the use of PWM to control the power to each set of LEDs. Basically
turning all the colours on at the same current doesn't give a white light as come colours are brighter then others at the same current.

The LEDs need to be controlled using a transistor switch as the arduino IO pins cant supply enough current to drive the LEDs properly. See the image in this step.

[Show how the LED matrix is connected up]

This is the solution that I have used for the LEDs. Feel free to come up with you own solution and please share it in the comments below if you do.

Image Notes
1. Transistor switch to drive the LEDs directly from 5v rather then from the Arduino
IO pin.

http://www.instructables.com/id/Arduino-Fencing-Scoring-Apparatus/
Step 3: Hardware: Weapon Change Button
The weapon mode button switches the scoring box between foil, epee and sabre. This is easy to connect up and debounce is take care of in software. The Arduino has
an internal pull up resistor on most digital pins which leaves us with one less resistor to connect! Yah! Just connect a normally open push button between pin 2 and
ground.

Note: Internally the code uses a interrupt to manage the button. The Uno and Nano only have external interrupts on pins 2 and 3.

Step 4: Hardware: Buzzer


The buzzer is also a pretty easy one. Just connect the buzzer between ground and pin 3. A simple piezo buzzer is good enough and can be driven directly from the
Arduino IO pins.

http://www.instructables.com/id/Arduino-Fencing-Scoring-Apparatus/
Step 5: Hardware: Weapon and Lame Interface
The weapons are connected to the box via 4mm banana sockets. They are spaces 15mm and 20mm apart. These sockets are connected directly to the Arduino's analog
pins with pull up and pull down resistors, as per the circuit image.

Note: These resistors should be around 1k ohms, much larger and you will create an RC filter with the capacitance between the 2 long wires and the pull up/down resistor
which makes the hit signal from the decay slowly instead of a sharp edge. This will only be measurable with an oscilloscope. But blah. Don't worry about this, just use 1k
resistors.

Step 6: Hardware: Power Supply


The power supply solution is dependent on the Arduino that you use. I used the Nano so I need to power it over the mini USB connector. The Uno does have a power
jack, so just source a compatible power supply. But I prefer to do it over USB. There are a number of options with USB, power banks, wall plug USB adapters or even a
computer or laptop.

A power bank doubles is pretty much a battery so you could just build it into your box if it requires a battery.

http://www.instructables.com/id/Arduino-Fencing-Scoring-Apparatus/
Step 7: Enclosure
We have come up with the enclosure that you can see in the images. I hope to upload a template for it at a later stage, but I encourage you to 3D print or design your own
enclosure. I would love to see your idea and designs.

http://www.instructables.com/id/Arduino-Fencing-Scoring-Apparatus/
Step 8: How the Code Works
The Arduino code samples each of the ADC pins on each loop. It compares the read values to what is expected for the currently selected weapons and checks if it has
been depressed for enough time to register a hit. Then the lockout timer is started and if the 2nd hits hasn't occurred before the time-out then the single hit is registers
and the correct lights turned on.

On the Uno/Nano the loop runs about at over 2000 times per second. This allows us to easily capture the shortest possible hit, which is foil at 2ms.

For a more details about how the code works see the comments in the source files. It is well commented and it explains what each thing is doing. All_weapon_box

Again any feedback is much appreciated.

Step 9: Testing your Scoring Box


Well the best way to test the box is to use it. Check things like hits on bell guards don't trigger hits, double hits etc.

If you want to test the timing of the box you will need an oscilloscope which can check out the signals and tell how long a tip was depressed for or the difference in time
between hits for lockout. This is a very specialise piece of equipment so properly not worth it. Trust me that I have used my oscilloscope to test it properly and the timings
are a function of the code and I am happy that they are FIE compliant.

If you do come across any issues or bugs please let me know and Ill update the code.

Step 10:
Well that is it folks. Please leave your feedback and ideas. Ill try and update this inscrutable with more details in the near future.

Peace

http://www.instructables.com/id/Arduino-Fencing-Scoring-Apparatus/
Related Instructables

Arduino Laser
Turn a 1970's Engraver by
pinball machine How To Make DIY Skee Ball getburnt A Smart Plant
Cheap PVC Automated Box with
into an atomic Machine by
Project Bottle Cutter by Lightning and
synced alarm fungus amungus
clock using a Enclosures and jrharari Raining by Kevin
gps and an Boxes by Chuck - Lee
arduino by Stephens
alanamon

Advertisements

Comments

http://www.instructables.com/id/Arduino-Fencing-Scoring-Apparatus/

You might also like