Project Parts List:
This project is an amalgam of several RobotGeek kits. Each part is necessary to complete the kit as it is made in this guide.
- 1 x RobotGeek Desktop Roboturret
- 1 x Foam Dart Gun Kit
- 1 x Pixy CMUcam5 w/Mounting Hardware
- 1 x RobotGeek Servo Side Bracket
If you would like to build this project and you already have an Arduino/Geekduino board, you can use the Robot Geek Pan and Tilt Kit w/ Servos instead of the RobotGeek Desktop RoboTurret. You should pick up a Sensor Shield for easier, safer wiring.
You should have followed through the getting started guides for each of the kits and ran the test code. If you haven't completed these, follow through the guide with the links below, and return here when you're finished for further instruction.
- Geekduino Getting Started Guide
- Desktop RoboTurret Getting Started Guide
- Foam Dart Gun Getting Started Guide
- Pixy Getting Started Guide
The Pixy Getting Started Guide will run you through getting the latest firmware, which is necessary to run the version of the Arduino code available in this guide.
You should have assembled the kits while following the getting started guides. If not, follow the Assembly instructions for each of the kits using the links here. Once you have completed these, return here for further instruction.
- Desktop RoboTurret V3 Assembly Guide
- Foam Dart Gun Mount Assembly Guide
- Pixy Mount Assembly Overview
You are going to build the Pixy Mount shown in Option 1 in the Pixy Mount Assembly Overview, attaching it to the Servo Side Mount Bracket. Once you have assembled the Turret with Dart Gun, attach the Pixy Mount with Side Bracket to the Trigger Servo using 4 x M2*6 Bolts, with the camera oriented upside down. This places the camera as close to the barrel of the gun as possible while leaving enough clearance for access to the camera's USB and Ribbon Connectors.
We will be using the Pixy's Breakout Cable to wire this project.
|Device||Sensor Shield Port|
Pixy Black Wire
Pixy Red Wire
||Digital Pin 3|
||Digital Pin 5|
||Digital Pin 6|
||Digital Pin 10|
Pixy Yellow Wire
||Digital Pin 11 (to Signal 'S' Pin)|
Pixy Brown Wire
||Digital Pin 12 (to Signal 'S' Pin)|
Pixy Orange Wire
||Digital Pin 13 (to Signal 'S' Pin)|
Note that not all of the wires on the Pixy's breakout cable are used for this project, leaving you with a bit of a wire mess. Cable ties are useful for managing this.
When wiring with the Sensor Shield, be mindful of your jumpers. Note that the top jumper is set to VIN. This allows your board to send power directly from source to your servos.
You can also wire this without the sensor shield using a pan/tilt kit, foam dart gun kit, Pixy, breadboard, jumper cables, and pin headers.
Note that we've plugged VIN into the voltage rail on the breadboard. This is great for our servos. Do not under any circumstance plug any 5V devices into this rail. Doing so will cause potentially irreversible damage to your device.
Arduino Turret With Dart Gun and Pixy Code:
Extract the code into your Arduino sketchbook folder. You can find
File -> Sketchbook -> desktopRoboTurretV3 -> roboTurret3_dartGun_Pixy
Now load the sketch onto your Geekduino. If everything is hooked up correctly, the servos will move to home position (center).
Running the Code:
- Plug in your Turret using a 6V Power Supply. All of the servos should move to home position (center).
- Hold down the white button on the Pixy until the LED on the front turns red. Let go of the button and find an object of the color you would like the Turret to track, and hold it in front of the Pixy's camera. Press the white button once more to lock in that color.
- Your turret should now be tracking that color. It may try to fire soon after being trained.
- For safety, unplug your turret. Load your turret by pulling on the gun's plunger until it clicks into place, and placing a dart in the chamber. Don't look directly into the chamber.
- Plug your turret back in, and get ready to move! The turret is active, loaded, and ready to hunt down anything of the color you've trained it.
You can leave the Geekduino plugged into your computer's USB port for this process if you would like to see what is happening on the serial monitor. You can also plug in your Pixy via USB and watch it track your object using PixyMon.
PC Control These demos and projects allow the robot to be controlled via a computer.
ArbotiX Commander Control - These demos and projects control the Robot using the ArbotiX Commander, the handheld Arduino based remote control.
Direct Control - These demos and projects control the Robot directly from sensors connected directly to the Robot's control board.
Pose Control - These demos and projects allow you to create and playback a sequence of poses.
Serial Control - These demos and projects control the robot using a serial packet protocol.
Standalone - These demos and projects are deisgned to let your robot function without a computer or additional microcontroller.
Wireless Control - These demos and projects allow you to control the robot wirelessly - usually by replacing the Serial Connection with XBee modules.
Reference - These articles have technical details regarding the control and operation of the robot.
More info here