Button Domination Timer (DOMINATOR) is a device - stopwatch for sports such as Airsoft, Paintball. The stopwatch uses an Arduino control microcontroller (Arduino Uno / Nano) or a separate chip (Atmel) ATmega328P, which controls the entire system logic. The stopwatch includes an LCD character display measuring 16x2 (16 characters x 2 lines), or 20x4, on which the times of individual teams are displayed. There are 2 teams in the game - RED team and GRE team that play against each other and occupy the imaginary point that is formed by this device - DOMINATOR. At the beginning of the game, the display shows the times 00 hours, 00 minutes, 00 seconds for RED team , GRE team .
Button Domination Timer uses button input for the action of occupying a point by a team member, as well as for input of a referee and eraser entity. Thus, a total of 4 buttons for 4 system entities, the switching buttons connected in the INPUT_PULLUP mode are used. Pressing the button feeds the GND signal to the Arduino digital input terminal (Active-LOW switching signal). Button DOMINATOR is available in two versions: The basic version that responds immediately to a point occupancy button. The advanced version requires you to hold down the button for 5 seconds to successfully occupy a point. The times are displayed on an LCD character display measuring 16x2 or 20x4, which communicates with the control microcontroller via the I2C bus. If a team member of the RED team occupies a point by pressing a button, a buzzer is triggered, which announces a change in the point with a short beep. Then the RED team's LED at this station will light up and the display will start adding time for that team.
If the point is occupied by the GRE team and a team member presses the appropriate button, the buzzer sounds again, the GRE team LED lights up, the RED team time is paused and the GRE team time is calculated, which point he occupied. If the organizer (referee) presses his button, both times are paused until a member of one of the teams makes user input. This type of input is thus suitable for starting a break, but can also end the game for evaluation. Button Domination Timer has a fourth button for the eraser entity, which pauses and resets both times to initial values as after starting the Button Domination Timer stopwatch. Used to restart the game, initialize a new game. The project is suitable for Airsoft events, sports facilities, or Airsoft teams, which can build the equipment. The advantage of the Button Domination Timer system is that it can be cloned and create X points with the same configuration via machine code, which can be loaded into an unlimited number of Arduino boards and chips and guarantees identical application operation. Players can thus score more points in the game, while at the end of the game the time is added up as long as which point was occupied by which team.
Buttons are connected in INPUT_PULLUP mode, they use an internal 20 kΩ PULLUP resistor, which holds the logic level HIGH on the digital input. When the button is pressed, the LOW signal is fed to the digital input. Based on the button type and the firmware version used, the Arduino can verify the button hold length, while the counter logic is executed independently (the counter is active while the button is held). When the condition of the change at the point is met, the Arduino triggers a buzz, applying digital states to the LEDs. System logic is executed every 1000 ms - 1 Hz routine (timed via the millis () function, i.e. via Timer 0), regardless of the state of the digital inputs. In this routine, an active team check is performed, followed by time. Time is dynamically plotted on a 20x4 or 16x2 LCD character display. Display communicates with the Arduino via an I2C bus with a clock signal (SCL) of 100 kHz - Standard Speed. Rewriting of the display thus takes up to approx. 15 ms, while only the line of the given team that is active at the point is overwritten. With serious interest, the firmware for DOMINATOR can be extended to 3 or 4 teams.
Arduino Uno / Nano (ATmega328P) | I2C converter for LCD display |
GND | GND |
5V | Vcc |
A4 (Hardware SDA) | SDA |
A5 (Hardware SCL) | SCL |
Arduino Uno / Nano (ATmega328P) | Buzzer |
GND | GND |
5V | Vcc |
D5 | IN |
Arduino Uno / Nano (ATmega328P) | LED diodes |
GND | GND |
D4 | IN (RED) |
D3 | IN (GREEN) | Arduino Uno / Nano (ATmega328P) | Pushbuttons (INPUT_PULLUP) |
GND | GND |
D6 | IN (GREEN) |
D7 | IN (ERASER) |
D8 | IN (Rozhodca) |
D9 | IN (RED) |
Firmware name (in button_dominator folder) | Designed for | Download |
0x27.ino.hex | LCD character display size 16x2 or 20x4 with I2C converter, which communicates at address 0x27. This firmware can be tested directly in on-line Simulator Wokwi that is accessable via browser: https://wokwi.com/projects/333897447732413011 | Download firmware |
0x3F.ino.hex | LCD character display size 16x2 or 20x4 with I2C converter, which communicates at address 0x3F | Download firmware |
The Wire library is built into the Arduino IDE, no installation is required. The program can be compiled and verified communication via I2C bus with LCD character display. I2C converter should be connected to Arduino to hardware I2C outlets (SCL to A5, SDA to A4) before loading the program, it is enough even without display. The retrieved display address must be provided for a successful build for Arduino along with the UID of the RFID cards.
#include <Wire.h> void setup() { Wire.begin(); Serial.begin(9600); while (!Serial); // Leonardo: wait for serial monitor Serial.println("\nI2C Scanner"); } void loop() { byte error, address; int nDevices; Serial.println("Scanning..."); nDevices = 0; for(address = 1; address < 127; address++ ) { // The i2c_scanner uses the return value of // the Write.endTransmisstion to see if // a device did acknowledge to the address. Wire.beginTransmission(address); error = Wire.endTransmission(); if (error == 0) { Serial.print("I2C device found at address 0x"); if (address < 16) Serial.print("0"); Serial.print(address,HEX); Serial.println(" !"); nDevices++; } else if (error==4) { Serial.print("Unknown error at address 0x"); if (address < 16) Serial.print("0"); Serial.println(address,HEX); } } if (nDevices == 0) Serial.println("No I2C devices found\n"); else Serial.println("done\n"); delay(5000); // wait 5 seconds for next scan }