Project Repository - Shareware Firmware for Button Dominator: Domination Timer firmware
If you are interested in purchasing software for Button DOMINATOR, contact: martinius96@gmail.com
Arduino LCD Pushbutton RC522 Stopwatch Schematics Airsoft Paintball DOMINATOR

Button Domination Timer - stopwatch for Airsoft | Paintball


Entities in the Button Domination Timer project:

RED team - user input button
RED team
GRE team - user input button
GRE team
Referee - user input button
Referee
Eraser - user input button
Eraser

Button DOMINATOR project description


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.


LCD 20x4 output for RFID Domination Timer:


LCD character display 20x4 - Arduino Domination Timer - DOMINATOR

Compatible control hardware for Button Domination Timer:



Peripherals for Button Domination Timer:



The principle of functionality of the Button Domination Timer project on the hardware side:


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.

RFID Dominator - hra pre 4 tímy
Maximum time range that can be listed on the system: 99 hours, 59 minutes, and 59 seconds
Consumption: approx. 20mAh with 5V power supply. Convenient to power via power bank, charger from a phone with USB output.

Button Domination Timer at runtime in Airsoft game


Airsoft Dominator RFID

Button Domination Timer - demonstration of system functionality and logic


Table connection of terminals - Button Domination Timer - fully corresponds to the wiring diagram:

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)

Wiring diagram - Button Domination Timer:


Airsoft Dominator RFID

Test Program (Shareware) - Button Domination Timer with machine code


Source code - Button Domination Timer based on Arduino
Shareware version (.hex) is available for free for Button Domination Timer project. The version allows you to measure a maximum of 15 seconds of captured time at point for each team. The main goal of the version is to verify compatibility with your hardware. Machine codes based on the I2C converter address for the LCD display are available in the Github repository. The most used addresses are 0x27 and 0x3F. If you do not know the address of your converter, use the built-in example in Arduino IDE -> I2C Scanner, which will write the address to the UART interface (Serial monitor). Machine code can be uploaded to the Arduino Uno microcontroller via AVRDUDE software - part of the Arduino IDE, or with a GUI interface via XLoader - easier to use.

  • AVRDUDE must be run via the CMD (command line) installed with the Arduino IDE. Located in C: /Users/User/Documents/ArduinoData/packages/arduino/tools/avrdude/6.X.X-arduino/bin
  • Sample command to upload a program to Arduino Uno / Nano (ATmega328P):
  • avrdude -CC: avrdude.conf -v -patmega328p -carduino -PCOM21 -b115200 -D -Uflash: w: sketch.ino.hex: i
  • XLoader is a Windows application (executable .exe tool) with a simple graphical interface , which allows you to select the firmware - machine code (.hex), the target platform and can dynamically show the COM port on which the device located.
  • By simply clicking on Upload, machine code can be uploaded automatically (XLoader uses the AVRDUDE tool similar to the Arduino IDE). The XLoader window informs about the successful upload in the form of a list of bytes uploaded.
  • Firmware can be downloaded from the project repository: HERE. The firmware is in the /firmware/button_dominator folder divided according to the address of the I2C converter (you found out from the I2C scanner output on the UART interface).

    Available firmware - Button Domination Timer

    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
    For the latest Chinese Arduino Nano clones that have an "Old Bootloader", you need to upload at 57600 baud / s! For other versions with the newer Bootloader 115200 baud / s (this speed is also used in the AVRDUDE command to load machine code).

    Uploading the Shareware version of the Button Domination Timer project to Arduino via XLoader


    XLoader - Arduino - AVRDUDE - Tlačidlový DOMINATOR - testovací program

    General video tutorial for uploading firmware to Arduino via XLoader



    I2C Scanner - a program for reading the address of the I2C converter for the LCD display


    Expected output of I2C Scanner:


    Výpis I2C adresy, na ktorej komunikuje I2C prevodník pre displej 16x2 / 20x4

    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
    }