Nerf Dart
Sentry Gun
Using
Raspberry Pi 3 and Microsoft Kinect Sensor
Brian Kuo,
Michael Cao, Nicholas McGilvray, Renato Maues
Overview
The purpose of this project is to
construct a sentry gun robot that autonomously tracks movement and fires a Nerf
dart once a target has been found. A Raspberry Pi 3 is used to control the
system consisting of a Microsoft Kinect, 2 DC motors powering the wheels of the
robot, and a servo motor pulling the trigger on a Nerf gun. The Kinect gathers
the depth data, while the tracking algorithm moves the motors to center the
target and enables the servo to pull the gun’s trigger.
Parts Needed
● Raspberry Pi - Adafruit: https://www.adafruit.com/category/175
● Microsoft Kinect v1 (XBOX 360 Kinect)
- Gamestop: http://www.gamestop.com/xbox-360/accessories/xbox-360-kinect-sensor-with-kinect-adventures/78103
● Nerf Gun - WalMart: https://www.walmart.com/ip/Nerf-N-Strike-Mega-BigShock-Blaster/44441064
● Sparkfun Shadow Chassis
● 2 DC Motors
● Dual H Bridge Motor Driver
● Servo Motor
● 5V external Power Supply
Downloading Raspbian onto your Pi
Raspbian is
a unix-based OS built specifically for the Raspberry Pi, and is what the
project is built on since it interfaces well with the Kinect sensor. The
installation guide can be found here: https://www.raspberrypi.org/downloads/raspbian/\. Download Raspbian if you don’t
already have it.
Downloading the Kinect and WiringPi Libraries
Start your project with the free Kinect software libraries
offered by OpenKinect. The libfreenect libraries are found here: https://github.com/OpenKinect/libfreenect. In this library you can find useful
examples that can be useful for further implementation with the Kinect sensor.
The WiringPi libraries are used to
allow the Raspberry Pi to utilize its GPIO pins to talk to each I/O device. The
WiringPi libraries can be found here: http://wiringpi.com/download-and-install/.
Project Source Code
Wiring Tables
The
following wiring tables outlines the connections needed in order to hook up the
Raspberry Pi, Kinect sensor, DC motors, H-Bridge Driver, servo motor, and
external power supply.
H-Bridge Motor Driver,
DC Motors
Raspberry
Pi |
H-Bridge |
DC Motor 1 |
DC Motor 2 |
External 5V
Supply |
GND |
GND (3) |
|
|
GND |
VCC (Pin 1) |
VCC |
|
|
|
|
VMOT |
|
|
+5V |
PWM1 (Pin 3) |
PWMA |
|
|
|
DigitalOut1 (Pin 5) |
AIN1 |
|
|
|
DigitalOut2 (Pin 7) |
AIN2 |
|
|
|
PWM2 (Pin 8) |
PWMB |
|
|
|
DigitalOut3 (Pin 10) |
BIN1 |
|
|
|
DigitalOut4 (Pin 12) |
BIN2 |
|
|
|
|
AO1 |
+Wire |
|
|
|
AO2 |
-Wire |
|
|
|
BO1 |
|
+Wire |
|
|
BO2 |
|
-Wire |
|
Servo Motor
Raspberry
Pi |
Servo
Motor |
5V
External Supply |
PWM3 (Pin 9) |
PWM Wire |
|
|
+5V Wire |
+5V |
|
GND |
GND |
Kinect Sensor
Raspberry
Pi |
Kinect
Sensor |
USB |
USB |
Sentry Gun Robot in Action
https://www.youtube.com/watch?v=WCyDu8QLhGA
Make it Battery Powered
The Nerf
Dart sentry gun can be completely battery operated! The Kinect runs off a 12V
DC power supply, which can be purchased and recharged for later use. Be careful
not to buy one too heavy, or else the robot will not be able to stand the
weight while turning. The Raspberry Pi and subsequent motors can be powered by
a simple 5 V DC supply consisting of AA batteries. These two changes would make
the sentry gun fully operational with no wires attached.