Alisdair's Fencing Projects


MK I (lo-tech prototype and proof of concept)


  • 1 x scrap piece of wood
  • some beer cans (just the bottoms, soft drinks cans can also be used)
  • nuts & bolts (one of each per can)
  • 1 x LED 
  • 1 x resistor (depends on LED)
  • 1 x capacitor (for LED persistence)
  • battery (low voltage to drive LED)
  • wire to connect the targets   
  • wire to connect to epee (only one pin or core is required)


  • a few pennies (unless you include the cost of the beer)

The target is a few beer can bases that are bolted to a board, in this case a bit of leftover melamine shelf: 

On the back face a wire connects all the bolts electrically.

A single wire connects the centre (or near) pin on an epee to the circuit.

The electric circuit comprises a battery and LED in series, and a capacitor across the LED.

The epee wire connects to one leg of the LED, the other leg is connected to the battery +ve, and the battery -ve is connected to the target wire.

Pressing the epee's tip completes the circuit and lights the LED.

The capacitor means that the light dims slowly rather than just being a blink.


Similar to the above, this reacts to the epee's tip hitting or missing the target. An Arduino is used to monitor and to provide feedback via coloured LEDs.

When the Arduino is first powered on the three LEDs flash to indicate that they are working, following which:

  • GREEN - ready.
  • WHITE - off target. The epee tip struck something firmly enough for a hit to be noted, but it wasn't on target.
  • RED - target hit.

Following a strike the red or white LED will be illuminated for a couple of seconds, then the box returns to ready/green.

This system uses an Arduino, the circuit and code are below. It wouldn't take much effort to expand this to have several targets on different pins, to include a timer to measure response time or add a scoreboard.


  • same target as MK 1
  • 3 x LED
  • 3 x resistors (depends on LEDs)
  • Arduino Uno (£3 from China)
  • 1 x wire from Arduino to target
  • Body wire to connect to epee (two pins are used - near and centre, far pin is not used)

Download STL file for 3D printing


// Alisdair Gurney, December 2019
// When the epee tip is depressed near and centre body wires complete the circuit and pull 'swordtipIn' to ground.
//   The sword tip becomes part of the circuit when depressed. 
//   Body wire pin 3 (far) is not used. 
// Fencing target made from beer can bases. 
//   Multiple targets are connected eletrically and to one of the Arduino pins in PULLUP mode.
//   A hit is registered by pulling the pin to ground (via the closed sword tip).  
// this sketch uses an epee but scores like a foil, so:
//   hit not on target = white light
//   hit on target = red light
//   light touch on target = no light (tip not depressed so no circuit) 
// Components: 3 x LEDs, 3 x resistors (to suit LEDs)

const int greenLED = 10;   // Ready     
const int whiteLED = 11;   // Miss
const int redLED = 12;     // Score
const int swordtipIn = 8;  // pin for sword tip
const int targetIn = 9;    // pin for target hit

int tipval;  // Tip hit state
int targval; // Target hit state 

void setup() {

Serial.begin(9600); // use serial port to check status

// initialize the LED pins as output:
pinMode(greenLED, OUTPUT);
pinMode(whiteLED, OUTPUT);
pinMode(redLED, OUTPUT);

// and two input pins.  
pinMode(swordtipIn, INPUT_PULLUP);  // 
pinMode(targetIn, INPUT_PULLUP);
// turn all the LEDs ON to check they are working:
digitalWrite(redLED, HIGH);
digitalWrite(whiteLED, HIGH);
digitalWrite(greenLED, HIGH);

// Wait a couple of seconds before entering loop
delay (2000);

void loop() {

// For each iteration start by turning all LEDs OFF 
digitalWrite(redLED, LOW);
digitalWrite(whiteLED, LOW);
digitalWrite(greenLED, LOW);
// delay .5 second
delay (500);

// Turn green light on/off +.++ pret -> allez
digitalWrite(greenLED, HIGH);
//delay (500);
//digitalWrite(greenLED, LOW);
//delay (500);
//digitalWrite(greenLED, HIGH);
//delay (200);
//digitalWrite(greenLED, LOW);
//delay (200);
//digitalWrite(greenLED, HIGH);

// Keep checking the tip and target values until a hit is made (tipval is 0)
do {

// uncoment the following lines to view status in the serial console
// Tip:1 is normal position, Tip:0 is a touch (tip pressed) 
// Target:1 is normal state, Target:1 pin is grounded due to hit 
// Serial.print("Tip: ");  
// Serial.print(digitalRead(swordtipIn));
// Serial.print("  Target:    ");  
// Serial.print(digitalRead(targetIn));
// Serial.println();  

} while (tipval > 0);

// we're out of the loop because a hit has been made
// turn the green light off 
digitalWrite(greenLED, LOW);

// get the target's state
if (targval > 0)
  // hit not on target
  {digitalWrite(whiteLED, HIGH);}
  // hit was on target
  {digitalWrite(redLED, HIGH);}

// leave the result on for two seconds then go around again 
delay (2000);





  • Added rubber behind targets so they have a little bit of give.
  • Covered the bolt heads in copper to protect sword tips.
  • Targets are individually addressable and have an LED indicator. LEDs are mounted below the surface of the target so they don't get damaged, and the holes are covered by old CDs so the holes are protected (the scoring areas are the beer cans, not the CDs).
  • Controlled by an Arduino and runs off a small battery.
  • There's a reset switch on the side of the control box that clears current values and restarts the system.
  • A laptop can be connected to monitor response times, period, and hit/miss on a serial console (for example using the Arduino IDE, PUTTY or similar).
  • How it works / what it does
    • At startup, all the LEDs flash to prove that they work.
    • A random LED is lit for a short period (three seconds).
      • If the correct target is hit then the next random target is selected, and the period is reduced by a small amount (50ms). Repeated accuracy results in the exercise speeding up
      • If the target is missed the white LED is lit, there's a short pause and the period is increased by 50ms. Repeated misses results in the exercise slowing down.
      • If the period times out the next random target is selected and lit for the same period. If left, the targets continually cycle at the same rate, so if coaching input is required, or a break for any reason, there's no change to the current settings.

There are four short clips in this video:

  • Startup; striking and missing the targets.
  • Serial console, showing results of strikes.
  • Target frequency shown speeded up following a string of accurate hits.
  • Pressing the reset button.



Download the Arduino sketch (fencing_target_MK3.ino)


This email address is being protected from spambots. You need JavaScript enabled to view it.



Download STL file for 3D printing

Cable Clip

Download STL file for 3D printing


Epee Tip



Download STL file for 3D printing


Copyright © 1997-2021