Introduction: Protobot - Raspberry Pi + Wifi + Xbox + IMU + Picamera

Picture of Protobot - Raspberry Pi + Wifi + Xbox + IMU + Picamera

RC Car controlled over wifi using an XBox controller featuring:

1. Haptic feedback

2. Pi Camera video feedback

3. Wireless XBox360 control

4. Wifi Telemetry

Full wiki on:

Step 1: MPU6050

Picture of MPU6050

The PI uses a MPU6050 IMU. First off you have to enable I2C on the pi, wire it up then test it using the commands in 'scripts'. Again there may be some dependencies. The server transmits impacts back to the client to transmit to the operator as haptic feedback using the XBOX force feedback.

Install i2c tools...

sudo apt-get install libi2c-dev

Edit the i2c On the pi's BIOS then reboot.

sudo raspi-config

sudo nano /etc/modules

sudo nano /etc/modprobe.d/raspi-blacklist.confsudo i2cdetect -y 1

The MPU605 should appear as 68.

Step 2: Pi Blaster

Picture of Pi Blaster

The PWM on the Pi is done with the Pi blaster Daemon. The server sends data to the servos direct from the Pi and in software to the PI-BLASTER FIFO.

FIFO is at /dev/pi-blaster

To completely turn on GPIO pin 17:

echo "17=1" > /dev/pi-blaster

To set GPIO pin 17 to a PWM of 20%

echo "17=0.2" > /dev/pi-blaster

To test just use a multimeter and some echo commands, write down on paper what you need to send to your servos to get them to do what you want. Check my server code for my values, yours will be close luckily you can control them with the 0-3.3V offered by the PI as the control signal is unipolar.

For the wiring loom I used an IDC connector and some 2.54mm header.

NOTE - (1) I've had issues with this interfering with the PIs windows environment in the past with lockups so I don't tend to boot into the PI X windows interface.(2) sudo chown root, then sudo chmod +s to allow scripts to acces GPIO as non root

Step 3: Wifi

Picture of Wifi

Follow adafruits guide to seting up the wifi using the terminal on the Pi. I found it easier to do it via the command line and had issues with the GUI in x windows.

sudo cp interfaces /etc/network/

Step 4: XBOX 360 Controller Testing

Picture of XBOX 360 Controller Testing

Acquire the windows XBOX wireless driver and install the drivers. There's a tutorial here if you buy a cheap Chinese copy and can't get it working. The LED on the controller will indicate when it's paired. The drivers should already be on linux if it's a recent release, I used Xubuntu 15. Use the following commands to look for or test the XBOX controller.

use cat /proc/bus/input/devices, look at 'Handlers' if unsure!fftest /dev/input/event3, this tests force feedback.jstest /dev/input/js0, this test /dev/input, you should see the joystick FIFOs here.I didn't have to install anything in linux (apart from maybe jstest), all the pain was in windows. Test it in windows first, in 'devices and printers' you can check all the controls work on the gamepad. Then test in linux with jstest and fftest.

Step 5: Installing Gstreamer & Picamera on the Pi

Picture of Installing Gstreamer & Picamera on the Pi

For gstreamer generally I used: as a reference.

Once you are happy you can test the Protobot script cd ~/Protobot./

The server (robot) runs automatically once setup.


Nolan Cash (author)2016-11-13

is there a way... ok i know there has to be a way... so, do you know how to have this work with a PS3/4 controller and the Pi3 with the built in bluetooth and wifi?

lawsonkeith (author)Nolan Cash2016-12-04


get it working with the 360 the ps3/4 should be easy (ish).

About This Instructable




More by lawsonkeith:DIY Christmas decorations with the kidsProtobot - Raspberry Pi + Wifi + Xbox + IMU + PicameraArduino & MPU-6050 IMU controlled Bee Bot / Big Trak clone
Add instructable to: