petefats
Description
Recoil is an ESP8266 based target practice game. It consists of a single server, one or many targets and one or many web-based scoreboards operating in a closed ecosystem. Each element is powered by a 18650 lithium ion battery and contains a small module to provide charging and battery protection. The same PCB is used for all elements however the firmware they run is role-based.
Server
First and foremost, the server acts as an AP for all other devices. It broadcasts its own SSID, issues DHCP and provides concurrence between the known targets and web clients. It also acts as both a web server and websocket endpoint. The web server is used to serve static HTML/JS to web scoreboards, while the websocket interface is used for all other messaging. Targets are tracked via their chip ID. Each is also allocated a name and a color, which are used by to help identify which target is which. The server also manages the various modes of game play, enabling and disabling the individual targets based on the rules of the game chosen. Individual targets are represented by WS2812 leds (one per target) to give a simple visual indication of the play field. In addition, the server outputs a JSON object that is used by the web scoreboards to display game and target data.
Targets
Targets main job is to facilitate game play and detect impact. Upon startup, they connect to the AP, request DHCP, then issue a registration packet to the server. Depending on the current state of game play, as dictated by the server, they will enable or disable themselves. When enabled, they will report impact detected by a piezo connected through the ESP8266's ADC, registering a "hit" with the server. Targets are also responsible for storing their own individual settings in EEPROM. When a target's name or color is updated by the web scoreboard, it's saved locally and reused at next power up.
Web Scoreboard
Any browser based device can act as a web scoreboard. Simply connecting to mDNS address "recoil.local" will display the current environment. From here you can rename targets and change their color. This page is also used to select the current game mode and display/reset the target hit counters. Essentially, this portion acts like a HUD for the system and can be displayed on multiple devices at the same time.
Game Modes
All-on
Simple game where all targets are enabled and simply count hits.
Round-the-world
Targets are enabled 1 at a time and cycle to the next once hit.
Whack-a-mole
Targets are enabled 1 at a time at random. If the enabled target isn't hit before the timer expires, a new target is selected.
Blackout
All targets are enabled. Once a particular target is hit, it is disabled. This repeats until all targets have been disabled and the game resets.
Parts
1x 2 screw terminal 5.0MM
1x 3 screw terminal 3.5MM or ws2811 connector
1x 4DIP switch 2.54mm
1x 6 Pin header
1x LM1117 3.3 regulator
2x Capacitor 16v 100uf
1x Capacitor 6.3v 1000uf
1x 6x6x4.5mm tactile switch
1x 3v3 Zener diode
1x 0805 resistor 1M
1x 0805 redistor 470k
1x 35mm Piezo Element
1x 18650 Lithium Ion
1x 18650 Battery Holder
1x 5V Micro USB 1A 18650 Lithium Battery Charger
http://www.ebay.com/itm/5PCS-5V-Micro-U ... 1414928326
1x JST XH 2.5-2 Pin Male/Female Connector
http://www.ebay.com/itm/50-SETS-JST-XH- ... 1639548157
Links
Github
Video
Images
Attachments
https://epartsconnect.com
Live realtime stock market prediction website. https://www.stocksignalslive.com my latest creation. Uses AI and machine learning.
New site featuring ESP8266 and ESP32 projects. tutorials, and news.
http://EverythingESP.com
ESP8266.com Founder and Administrator
The Mind Factory (get more from your 3D printer)
Home of the ESP8266, ESP8285, and ESP32 microcontrollers....