Skip to content

Lukk17/Sniper

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

21 Commits
 
 
 
 
 
 
 
 

Repository files navigation

Sniper

Smart airsoft target — Arduino-based hit detection, Flutter mobile app, Wi-Fi web interface for shot counting and miss tracking. Built for shooting practice.

Platform Framework PlatformIO Flutter Dart License

Features

  • Real-time hit detection with a piezo vibration sensor
  • Shot counter and miss tracking from the app
  • Native Flutter app for Android and iOS
  • Built-in web UI — any browser on the LAN works, no install needed
  • Fully local: ESP8266 runs its own Wi-Fi access point, zero cloud
  • Live WebSocket link with sub-100 ms latency

Architecture

flowchart LR
    S[Piezo sensor] -->|analog| ESP[ESP8266 NodeMCU]
    ESP -->|drives| L[Red / Green LEDs]
    ESP -->|Wi-Fi AP<br/>SSID: Sniper| W{{WebSocket + JSON}}
    W --> M[Flutter mobile app]
    W --> B[Browser<br/>Flutter web build<br/>served from LittleFS]
Loading

Tech stack

Firmware (sniper_firmware/)

  • Arduino C++ on ESP8266 (NodeMCU v2), built with PlatformIO
  • Piezo vibration sensor for hit detection, red/green status LEDs
  • ESPAsyncWebServer — async HTTP + WebSocket server
  • ArduinoJson — message serialization
  • LittleFS — onboard filesystem hosting the Flutter web build
  • Custom flash partitioning (sniperPartitions.ld, eagle.flash.4m3m.ld)

Mobile / Web client (sniper_client/)

  • Flutter (Dart, SDK 2.18+), Android / iOS / Web targets
  • web_socket_channel — real-time link to the target
  • intl — formatting
  • flutter_launcher_icons — app icon generation

Communication

  • Wi-Fi (ESP8266 acts as a softAP, SSID Sniper)
  • WebSocket transport with JSON payloads for shot events, hit/miss counters, and LED control
  • Flutter web build is served directly from the ESP filesystem, so any browser on the network gets the same UI as the mobile app

Hardware / BOM

Part Notes
NodeMCU v2 (ESP8266) Main MCU + Wi-Fi
Piezo vibration sensor Hit detection (analog)
Red LED Status / hit indicator
Green LED Status / ready indicator
2× current-limiting resistors (~220 Ω) One per LED
5 V power source USB or battery

Pin map

Function NodeMCU pin GPIO
Piezo sensor A0 A0
Red LED D6 12
Green LED D7 13

Quick start

Firmware

cd sniper_firmware
pio run -t uploadfs   # upload Flutter web build to LittleFS
pio run -t upload     # flash firmware

Mobile app

cd sniper_client
flutter pub get
flutter run

Then connect your phone to the Sniper Wi-Fi network (password: bulletproof) and launch the app — or open the ESP's IP in any browser.

Modules

License

MIT


Target icons created by Freepik - Flaticon

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Packages

 
 
 

Contributors