Project Name: Smart Gun [CyberGun]
Project Author: Geek Fantasy
What is more attractive than a toy gun is modifying a toy gun!
Step-by-step guide to installing a set of smart devices based on ESP32-Pico-D4 on the launcher (Senbo Long Gecko 2.0)…
Netizens commented:
Display Ammunition Capacity
Chamber and Firing Detection
Shooting Stability Detection
Gun Stability Training
Launcher Data Reporting
To achieve the above functions, how should the circuit be designed?
The entire project is divided into three parts: main control board, sensor board, and programming board.
Main Control Board integrates MCU, MPU6050, LCD, and battery management chip, running the main control program.
Main Schematic Diagram
Main PCB Diagram
Sensor Board integrates an 8-bit GPIO expansion chip, connected to the main board via IIC. Eight GPIOs are connected to eight Hall sensors to detect bullet count and chamber status.
Sensor Schematic Diagram
Sensor PCB Diagram
Programming Board integrates a serial port chip and automatic programming circuit for programming the main control board and serial communication, connected to the main control board via UART bus.
Programming Schematic Diagram
Programming PCB Diagram
Ammunition Capacity + Chamber and Firing Detection Implementation?
Ammunition capacity detection—using seven Hall sensors fixed next to the magazine, to detect the position of a round magnet fixed on the bullet board.
Chamber detection—using a Hall sensor fixed at the front of the gun’s mouth, to detect whether it is chambered.
Installation Diagram 1
Installation Diagram 2
Installation Diagram 3
This circuit is located on the sensor board, installed on the side of the magazine of the launcher. To reduce the number of lines to the main control board, here an I2C interface GPIO expansion chip is used to expand 8 GPIOs, connected to 8 Hall sensors.
Among them, seven Hall sensors correspond to magazine positions 0-6, with a round magnet fixed on the bullet board to trigger different Hall sensors. As the ammunition decreases, the magnet moves up, triggering different Hall sensors, reporting GPIO status through PCA9554W, allowing the main control to collect ammunition capacity.
Programming Board Principle
The main control board has limited space, so the programming board operates independently.
It uses CP2102, combined with two transistors, to achieve automatic programming and automatic switching of LOG mode.
The software part is open source and continues to be updated.
Refer to 【Chapter 4】 for guidance to check the open-source website
Use IDE to program, the program is developed with PlatformIO, you can download the program and compile it for direct programming.
This project is open source!
——Want to replicate ? Want to give a thumbs up to the author ? You can copy the open-source website to go to the original text.
Open Source Website: https://oshwhub.com/anbin/fish-customh552
*This article is reprinted from the “Lichuang Open Source Hardware Platform” user creation. If there is any infringement, please contact to delete