Repository with project - wiring diagrams, machine codes for testing - Github: Airsoft - DOMINATOR - Arduino
If you are interested in firmware for the Configurable DOMINATOR in machine code (.hex), contact me: martinius96@gmail.com
Arduino LCD Rotary Encoder Stopwatch Schematics Button Menu Paintball Domination Timer

Configurable Domination Timer - stopwatch for Airsoft | Paintball


Entities in the project configurable Domination Timer:

Tím RED - tlačidlo pre používateľský vstup
Team RED
Tím GRE - tlačidlo pre používateľský vstup
Team GRE

Project description - Configurable Domination Timer:


Domination Timer is a device - a stopwatch for sports such as Airsoft, Paintball, which allow you to measure the time of occupying a point with a resolution of seconds. The stopwatch is equipped with a 16x2 / 20x4 LCD character display. After switching on the device, it is possible to switch between menu items on the display using the rotary encoder - KY-040. Through the items, it is possible to start the Domination Timer game mode, which responds to user buttons (inputs), or it is possible to set the time of team occupancy before the game in the configurable mode. This parameter represents the required length of holding the button until the team successfully occupies the point. This configurable parameter is implemented for the number of seconds. The second configurable parameter is the automatic end of the game to reach a certain number of hours of the stopwatch with the UNLIMITED option - when the stopwatch counts to infinity, or after the maximum display time on the display - 99 hours, 59 minutes, 59 seconds. Stopwatch is using Arduino microcontroller (with AtMega chip) or a it can use that chip stadalone. Chip controls whole Domination Timer settings, logic of stopwatch etc. There are 2 teams in the game - RED team and GRE team, which play against each other and occupy the imaginary point that is formed by this device - Domination Timer. 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 entity. Thus, a total of 2 buttons for 3 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). Switch buttons are used, not switch buttons (they would not react to the system logic, all software would always be "pressed"). The configurable Domination Timer responds to the length of the press, which is set in the configuration menu via an encoder. It is required to hold the button for a given time. The system does not respond to short presses. In the extended version, it is also possible to set point neutralization (stopping the time of the active team at the point if a member of the other team holds the button at least 50% of the required time) 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 launched, 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 the team member presses the appropriate button, the buzzer sounds again, the GRE team LED lights up, the RED time is paused and the time of the GRE team that occupied the point is counted. The referee must stop both buttons at the same time to stop both times. Times are stopped until the point is reoccupied by some of the teams in the system This type of input is thus suitable for starting a break, but it can also end the game for its evaluation. The new game is implemented by resetting the entire Arduino board via the RST button, or by disconnecting and reconnecting the power supply. In the menu it is also possible to configure the activity / inactivity of the buzzer, which can also be included in the game. Domination Timer game mode uses a buzzer to announce the current occupation of a point. Eraser does not exist in this type of Domination Timer. A second game can be implemented in the system - countdown, which allows you to set a minute countdown while it must be stopped. The player stops the countdown by holding both buttons for a certain time (based on the configuration menu for the length of pressing from Domination Timer).


Compatible control hardware - Configurable Domination Timer:


Control microcontroller Arduino Uno
Arduino Uno
Control microcontroller Arduino Nano
Arduino Nano
Control microcontroller AtMega328P DIP
AtMega328P - DIP28
Control microcontroller AtMega328P SMD
AtMega328P - SMD

Compatible peripherals - Configurable Domination Timer:


LCD character display 16x2 / 20x4
LCD character display 16x2 / 20x4
I2C converter for LCD display
I2C converter for LCD display
Rotary 360 ° encoder (KY-040)
Rotary 360° encoder (KY-040)
Buzzer
Buzzer
2x LED diodes
2x LED
2x pushbutton
2x pushbutton

Wiring diagram - Configurable Domination Timer


Configurable Domination Timer - schematics

Configurable Domination Timer at runtime - testing


Configurable Domination Timer for Airsoft, Paintball

Wiring - Configurable 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) Rotary encoder - KY-040
GND GND
5V +
D3 CLK
D4 DT
D5 SW
Arduino Uno / Nano (AtMega328P) LED diodes
GND GND
D6 IN (RED)
D7 IN (GREEN)
Arduino Uno / Nano (AtMega328P) Pushbuttons (INPUT_PULLUP)
GND GND
D8 IN (RED)
D9 IN (GRE)
Arduino Uno / Nano (AtMega328P) Buzzer
D10 IO
GND GND

Test program (Shareware) - Configurable Domination Timer


Shareware version (.hex) available for Configurable Domination Timer project.The version allows you to measure a maximum of 60 seconds for each team. When this time is reached, the stopwatch stops. The goal of the version is to verify compatibility with your hardware. Machine codes based on the I2C address of the converter 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 the AVRDUDE software - part of the Arduino IDE, or with a GUI interface via the 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 for uploading a program to Arduino Uno / Nano (AtMega328P):
  • For firmware with I2C display address 0x27 (example COM port 21 and 115200 baud / s): avrdude -CC: avrdude.conf -v -patmega328p -carduino -PCOM21 -b115200 -D -Uflash:w:encoder_0x27.ino.hex:i
  • For firmware with I2C display address 0x3F (example COM port 21 and 115200 baud / s):avrdude -CC: avrdude.conf -v -patmega328p -carduino -PCOM21 -b115200 -D -Uflash:w:encoder_0x3F.ino.hex:i
  • XLoader is a Windows application (executable .exe tool) with a simple graphical interface, which allows the selection of firmware - machine code (.hex), the target platform and can dynamically show the COM port on which the device is located.
  • By simply clicking on Upload, the 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 the number of bytes uploaded.
  • If you are using Arduino Nano with OLD Bootloader, you ned to use upload speed 57600 baud/s and not standard value 115200 baud/s!
  • The firmware can be downloaded from the repository: HERE. The firmware is in the /firmware/encoder_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 - Shareware for Configurable Domination Timer


    Firmware name (in folder encoder_dominator) Designed for Download
    encoder_0x27.ino.hex LCD character display size 16x2 or 20x4 with I2C converter, which communicates at address 0x27. Download firmware
    encoder_0x3F.ino.hex LCD character display size 16x2 or 20x4 with I2C converter, which communicates at address 0x3F. Download firmware