Devices & Components
VooGenzek 5 PCS 5V KF301 1-Channel Relay Module Board Shield Low Level Trigger for PIC AVR DSP ARM MCU Compatible with Arduino, with LED Indicator
ELEGOO Electronic Fun Kit Bundle with Breadboard Cable Resistor, Capacitor, LED, Potentiometer (235 Items) for Arduino
HTK1633
Software & Tools
Arduino IDE
Project description
Code
Boxing timer project
cpp
1/*************************************************** 2Boxing timer project. 3Karl Smith 28/08/2025 4***************************************************/ 5 6//required libraries 7#include <Wire.h> 8#include <Adafruit_GFX.h> 9#include "Adafruit_LEDBackpack.h" 10 11Adafruit_7segment seconds_matrix = Adafruit_7segment(); //seconds count down 4x7 segment display 12Adafruit_7segment rounds_matrix = Adafruit_7segment(); //rounds count up 4x7 segment display 13 14int boxled = 13; //box LED output pin 15int restled = 12; //rest LED output pin 16int start = 3; //start button input 17int startled = 11; //'press start' button LED 18int buzzer = 10; //buzzer relay 19 20//***************** Timing & rounds parameters:********************************** 21int boxtime = 180; // Enter length of boxing rounds in seconds 22int resttime = 60; // Enter rest time between rounds in seconds 23int NumRounds = 12; // Enter number of rounds 24//******************************************************************************* 25 26 27void setup() { 28#ifndef __AVR_ATtiny85__ 29 Serial.begin(9600); 30#endif 31 seconds_matrix.begin(0x70); //address for seconds count down display (no links shorted) 32 rounds_matrix.begin(0x71); //address for rounds count up display (A0 shorted) 33 //initialise digital pins 34 pinMode(boxled, OUTPUT); 35 pinMode(restled, OUTPUT); 36 pinMode(start, INPUT_PULLUP); 37 pinMode(startled, OUTPUT); 38 pinMode(buzzer, OUTPUT); 39 digitalWrite(buzzer, LOW); //buzzer off 40} 41 42//Box function 43void box(int round) { 44 for (uint16_t boxcounter = boxtime; boxcounter > 1; boxcounter--) { // 'boxcounter > 1' as buzzer delay 1sec 45 digitalWrite(boxled, HIGH); // Box LED on 46 seconds_matrix.println(boxcounter); // write seconds left of round to seconds matrix 47 seconds_matrix.writeDisplay(); 48 rounds_matrix.println(round); // Write round number to rounds matrix 49 rounds_matrix.writeDisplay(); 50 delay(1000); // 1000mS = 1sec 51 } 52 seconds_matrix.println(1); // write 1 seconds left of round to seconds matrix, to compensate for 'boxcounter > 1' above, as buzzer delay 1sec 53 seconds_matrix.writeDisplay(); 54 digitalWrite(buzzer, HIGH); // buzzer on for 1 sec 55 delay(1000); 56 digitalWrite(buzzer, LOW); 57 digitalWrite(boxled, LOW); // Box LED off 58} 59 60// Rest between rounds function 61void rest() { 62 for (uint16_t restcounter = resttime; restcounter > 1; restcounter--) { // 'boxcounter > 1' as buzzer delay 1sec 63 digitalWrite(restled, HIGH); // Rest LED on 64 seconds_matrix.println(restcounter); //write seconds left of rest to seconds matrix 65 seconds_matrix.writeDisplay(); 66 delay(1000); //1000mS = 1sec 67 } 68 seconds_matrix.println(1); // write 1 seconds left of rest period to seconds matrix, to compensate for 'boxcounter > 1' above, as buzzer delay 1sec 69 seconds_matrix.writeDisplay(); 70 digitalWrite(buzzer, HIGH); // buzzer on for 1 sec 71 delay(1000); 72 digitalWrite(buzzer, LOW); 73 digitalWrite(restled, LOW); // Rest LED off 74} 75 76void loop() { 77 digitalWrite(buzzer, LOW); //start with buzzer off 78 rounds_matrix.println(" "); //Clear rounds display before start 79 rounds_matrix.writeDisplay(); 80 digitalWrite(startled, HIGH); // Turn 'Press start' LED on 81 int startrounds = digitalRead(start); //read start button 82 if (startrounds == LOW) { 83 digitalWrite(startled, LOW); // Turn 'Press start' LED off 84 for (uint8_t rounds = 1; rounds < NumRounds + 1; rounds++) { // count rounds 85 if (rounds < NumRounds) { 86 box(rounds); 87 rest(); 88 } else if (rounds == NumRounds) { 89 box(rounds); 90 seconds_matrix.println(" "); //clear display when rounds complete 91 seconds_matrix.writeDisplay(); 92 digitalWrite(buzzer, HIGH); 93 delay(1000); 94 digitalWrite(buzzer, LOW); 95 } 96 } 97 } 98}
Downloadable files
3D file for boxing timer box
Includes arduino mounts, requires heat inserts
Boxing timer box v4.stl
3D print file for boxing timer fasica
Tolerance fits, some hot glue required
file.None
3D file for boxing timer button booster
Big button that can be activated with boxing glove
push button booster v1.stl
Documentation
Circuit schematic
pdf schematic that matches sketch
Boxing timer schematic.pdf
Photo - need to add cable trunking
LED glare on phone camera, looks great IRL
Image (13).jpg

Comments
Only logged in users can leave comments