Notes before we start:
- This system DOES NOT GROUND, bell guard hits will register as will touches on the strip obviously
- No guarantee of timing accuracy, should be about right but I have not tested how accurate it is
- Doesn’t actually use Bluetooth
- Adafruit ESP32 – $15 x2 (need one per box)
- Solderable breadboard – $5 x2 (need one per box)
- Piezo buzzer – $1.50 x2 (need one per box)
- 5mm LED – $5
- 330 ohm resistor
- German epee socket – $11 x2 (need one per box)
- Solder/Soldering iron
- Small portable charger with short(3″) usb->micro usb cable x2
- Some sort of protective housing to put the circuit in, I modeled and 3d printed one but a cardboard box would work just as well. Make sure the Micro usb port is visible from the outside.
Building the circuit:
- Place ESP32 board into breadboard with usb connector at the edge, solder header pins to breadboard
- Wire positive pin of LED to pin A1 or GPIO pin 25(same pin) (pinout found here)
- Wire negative pin of LED to positive speaker pin and 330 ohm resistor, negative speaker pin and resistor should end at ground.
- Wire 5v out pin on board to A line in the epee socket, Wire b line in socket to D9 pin on board
Building the program:
- Go to tools and set board to ESP32 dev module, set port to the port where you board is plugged in.
- We first must find the MAC address of the ESP32 board, using the included get_mac.ino program. The MAC address will be output to the serial monitor, you must manually convert it to the correct format seen in Fencer1.ino and Fencer2.ino (0xYY where YY is the corresponding 2 characters in the mac address).
- Set uint8_t broadcastAddress at line 27 in Fencer1.ino to the found MAC address of the board you are using for Fencer2.ino and set uint8_t broadcastAddress at line 27 in Fencer2.ino to the MAC address of the board for Fencer1.ino
- Download Fencer1.ino and Fencer2.ino to there respective boards. Use body cord to connect to weapon and test. I use a small portable phone charger plugged into the arduino’s mircro usb port for power while in use.
See this tutorial for explanation of code.