
6 buttons

Formulation of the problem
Good day, Habrausers!
A couple of weeks ago, a representative of the kickboxing federation of our region set the task for me to do something that would reduce the time of the competition by 30% by the method of automation, cybernization, mechanization, and other “actions”. He is a simple, straightforward person, and strong so that I could not refuse. The task was accepted.
Having studied the rules of the battle, and recalling past competitions, it was found that 20-30% of the competitions take the following items:
- Referee's collection of referee notes after three rounds
- handing over notes to the head judge
- scoring
- summarizing the battle
On average, about 3-5 minutes.
The task was as follows: it is necessary to quickly transmit information about the points to the head judge, that is, "program 6 buttons."
Decision selection
To solve the problem, the following hardware options were considered:
- Manipulators Mouse on each referee's table and transfer of information from them
- A certain joystick on each referee's table and the transfer of information to the head judge
The first solution to the technical part of the problem was noted immediately because I had a hard time imagining how a USB mouse would behave at a distance of 15-20 meters from the head judge's computer.
The second option seemed to me more real.
I assigned the data collection center to the ARDUINO controller.
Execution
Stage 1 General Scheme

On the tables of the side judges there are referee panels, which have 2 buttons: red and blue. Information about the presses of these buttons is collected by the Arduino controller and transmitted to the program installed on the laptop.
The program analyzes the button presses and provides information on the outcome of the battle and the points gained by the fighter.
The chief judge, based on the results of the battle, announces the winner.
Stage 2 wiring diagram

With the circuit, everything is simple, I put each separate button on a separate input of the microcontroller. Resistors used 2.4 kOhm. I did not use the shift register because I do not know how to work with it, and for the current task there are more than enough PINs.
Manufacture
Stage 3 Production of remotes
Remote control composition:
- Box
- Circuit Board Piece
- Buttons
- Pieces of wire
- Red and blue electrical tape
- RJ45 Connector






Stage 4 Controller Production
Controller composition:
- Screwdriver box
- Arduino
- circuit board
- Pieces of wire
- Insulating tape
- RJ-45 patchchords
- USB wire


Programming
Stage 5 program for the controller
In the program for the controller, everything is taken from the examples. We are waiting for the buttons to be pressed, given the rattling of the contacts and the helmet all the COM port:
Controller sketch
#include
#define BUTTON7 7
#define BUTTON6 6
#define BUTTON5 5
#define BUTTON4 4
#define BUTTON3 3
#define BUTTON2 2
#define LED 13
int state7 = 0;
int prevstate7 = 0;
int state6 = 0;
int prevstate6 = 0;
int state5 = 0;
int prevstate5 = 0;
int state4 = 0;
int prevstate4 = 0;
int state3 = 0;
int prevstate3 = 0;
int state2 = 0;
int prevstate2 = 0;
Bounce bouncer7 = Bounce( BUTTON7,5 );
Bounce bouncer6 = Bounce( BUTTON6,5 );
Bounce bouncer5 = Bounce( BUTTON5,5 );
Bounce bouncer4 = Bounce( BUTTON4,5 );
Bounce bouncer3 = Bounce( BUTTON3,5 );
Bounce bouncer2 = Bounce( BUTTON2,5 );
void setup() {
Serial.begin(115200);
pinMode(BUTTON7,INPUT);
pinMode(BUTTON6,INPUT);
pinMode(LED,OUTPUT);
}
void loop() {
// 7 кнопка начало
bouncer7.update ( );
int value7 = bouncer7.read();
if ( value7 == HIGH) {
digitalWrite(LED, HIGH );
state7 = 1;
} else {
digitalWrite(LED, LOW );
state7 = 0;
}
if(state7 != prevstate7){
if(state7 == 1){
Serial.println("7");
}
}
prevstate7 = state7;
// 7 кнопка конец
// 6 кнопка начало
bouncer6.update ( );
int value6 = bouncer6.read();
if ( value6 == HIGH) {
digitalWrite(LED, HIGH );
state6 = 1;
} else {
digitalWrite(LED, LOW );
state6 = 0;
}
if(state6 != prevstate6){
if(state6 == 1){
Serial.println("6");
}
}
prevstate6 = state6;
// 6 кнопка конец
// 5 кнопка начало
bouncer5.update ( );
int value5 = bouncer5.read();
if ( value5 == HIGH) {
digitalWrite(LED, HIGH );
state5 = 1;
} else {
digitalWrite(LED, LOW );
state5 = 0;
}
if(state5 != prevstate5){
if(state5 == 1){
Serial.println("5");
}
}
prevstate5 = state5;
// 5 кнопка конец
// 4 кнопка начало
bouncer4.update ( );
int value4 = bouncer4.read();
if ( value4 == HIGH) {
digitalWrite(LED, HIGH );
state4 = 1;
} else {
digitalWrite(LED, LOW );
state4 = 0;
}
if(state4 != prevstate4){
if(state4 == 1){
Serial.println("4");
}
}
prevstate4 = state4;
// 4 кнопка конец
// 3 кнопка начало
bouncer3.update ( );
int value3 = bouncer3.read();
if ( value3 == HIGH) {
digitalWrite(LED, HIGH );
state3 = 1;
} else {
digitalWrite(LED, LOW );
state3 = 0;
}
if(state3 != prevstate3){
if(state3 == 1){
Serial.println("3");
}
}
prevstate3 = state3;
// 3 кнопка конец
// 2 кнопка начало
bouncer2.update ( );
int value2 = bouncer2.read();
if ( value2 == HIGH) {
digitalWrite(LED, HIGH );
state2 = 1;
} else {
digitalWrite(LED, LOW );
state2 = 0;
}
if(state2 != prevstate2){
if(state2 == 1){
Serial.println("2");
}
}
prevstate2 = state2;
// 2 кнопка конец
}
Stage 6 combat control program

Firstly, I immediately share the code Download the source code .
All code is written by XE3 Delphi since I taught it at school. And a small narrative:
- Using the ComPort 4.11 component, connect to the com-port and listen to it
- depending on the battle settings, listen to the port and display the results in labelX.caption
- at the end of the battle, print the result
The program was written in one night, so there can be no talk of beauty.
Competition preparation
Routing the cables from the central unit to the side judges





Job judge

About how the program works
Competition Results
As a result of two day competitions, a full set of awards was played, more than 150 fights were held.
Thanks to the time saved, the athletes left their cities 4 hours ahead of schedule

conclusions
- The equipment worked with a bang, without a single failure
- The length of the wires from the central unit to the buttons was 20 meters, while testing the buttons on a 100 meter cable
- The program needs to rework the interface, which is what I’m doing for the preparation of boxing competitions
- The program needs additions related to the output on the scoreboard and sound effects
- Using a standard network cable for connecting buttons and connectors significantly reduced the cost of the entire design
Thanks for attention.
UPD-1: By buttons.
specially selected such buttons for the following reasons:
1. tactile feedback. clicks when pressed
2. buttons do not have free play
3. buttons with free play have no pleasantness; they work earlier than the click is felt
4. users of the system are people with muscles, not lovers of cute buttons
5. LED feedback is useless because the judge’s eyes are directed at ring, not on hands
UPD-2: the budget of this assembly is unlikely to have exceeded 3,000 rubles
UPD-3 At the request of the source on github