/Gesture-Controlled-Nerf-Turret

Mounted Nerf blaster that is controlled via user gesture and movements

Primary LanguageC

Gesture Controlled Nerf Turret

Picture of project

Youtube demonstration video

Video of project

A Gesture Controlled Mounted Nerf Gun

To get started with this project, run MDK-ARM/mpu6050.uvprojx with Keil uVision Installed

To configure IO with STM32F103VEx, run mpu6050.ioc with STM32CubeMX Installed

Background

This project started out as school project for a course named ELEC3300 at HKUST. In this course, we were required to create a micro-controller related project using the STM32 platform. However, this project lives on as an independent project that is continually refined and developed

Introduction

This project allows the user to control a turret mounted nerf blaster with only the movement of their arms. A microcontroller takes in inputs from various sensors such as Gyroscopes, Accelerometers and Magnetometers in order to accurately map the user's motion to a position on the turret. To fire the turret, a Electro-Myograph sensor connected to the the user's forearm allows the user to open his or her fist akin to Iron Man in order to trigger the fire signal.

Sensor Inputs

The turret relys mainly on four sensors for input, namely the Accelerometer, Gyroscope, Magnetometer and EMG sensor

Accelerometer

The accelerometer used is the MPU6050 chip on board the GY-521 module. It is used to measure the angle relative to the ground that the user's arm is pointed at, thus it is used to sense whether the user's hand is pointing up or down. This is done by finding the accleration vector in the Z axis and applying an arbitrary quadratic filter in order to map it onto an appropriate range

Magnetometer

The magnetometer used is the HMC5883 or in our case the knockoff QMC5883 chip on board the GY-273 module. It is used to find the orientation that the user's arm is pointing at, by finding the angular difference from a pre-set reference point or "relative north". This data is then used to rotate the swivel base for which the blaster is mounted on

Magnetometer

Gyroscope

The gyroscope used is the MPU6050 which also combines gyroscope functionality is used to smooth out jerks and vibrations in the user's motion. The data collected from the gyroscope can be used as a filter for the Acceletometer and Magnetometer inputs in order to minimize oscillations.

Gyroscope

EMG Sensor

The EMG Sensor is used to detect electrical impulses generated by muscles in order to control the relay that activates the firing mechanism.

EMG Sensor

Turret

The turret is created from laser-cut sheets of acrylic stacked together to form the structure. The base plate and the blaster mount are both actuated by MG996R hobby servos that are powered by an external 6V battery power source. The control input for these servos are PWM with a 1-2ms variable duty cycle signal to control it from a range of -120 to 120 degrees. Hence the turret has an effective rotation of field of view of 240 degrees.

Blaster

The blaster requires an extensive amount of modification to its fire control mechanisms in order to facilitate control via an electronic trigger. The blaster comes with manual push switches to control firing; instead of manipulating the physical switch, a relay activated control was retrofitted into the blaster in order to allow the firing of the blaster to be controlled by a 1 wire GPIO signal.

GPIO controlled relay

GPIO Relay

Before modifications

Before Modifications

After modifications

After Modifications

Further development

The current version of this project has reached its engineering and technical potential. A second version of this project will focus on refining the mechanical components of this project, including the strenthening of the turret structure, improved blaster mounting methods, more powerful servos etc. In addition to improving the mechanical turret, the blaster will also be modified in such a way which will allow it to be fired without being tethered to the turret. Hence, being able to be used as a standalone blaster, but at the same time be fixed to the turret to become externally controlled.

Concept of the upcoming turret structure

Concept picture