Remote Controlled Car - Controlled Using Wireless Xbox 360 Controller

by hlazaro in Circuits > Raspberry Pi

3889 Views, 1 Favorites, 0 Comments

Remote Controlled Car - Controlled Using Wireless Xbox 360 Controller

20180404_145940.jpg

These are instructions in order to build your own remote controlled car, controlled using a wireless Xbox 360 controller.

Parts Required

Base:

Additions:

  • 2x white 5mm 2 pin LED
  • 2x red 5mm 2 pin LED
  • 4x yellow 3mm 2 pin LED
  • 3x blue 3mm 2 pin LED
  • 3x red 3mm 2 pin LED
  • 1x 330 OHM resistor
  • 4x 100 OHM resistor

Assemble Your Car

Follow the given instructions in your car kit in order to assemble it.

Wire It All Together

20180321_153045.jpg
pasted image 0.png
20180404_163804.jpg
20180402_222932.jpg

For the motors, first wire them to your motor controller, then wire the motor controller to your Raspberry Pi. Depending on which pins you use, you may have to alter the code given in the next step.

For the lights, a wiring diagram and example is provided as an image. Also wire these to your Raspberry Pi.

Coding

There are two python libraries that must be downloaded:

Xbox: https://github.com/FRC4564/Xbox
WiringPi: https://github.com/WiringPi/WiringPi-Python

The Xbox library allows us to take control of our car via remote receiver. As the Raspberry Pi has a limited number of PWM pins, WiringPi is used to emulate them so all wheels behave the same way.

Download the included code and save it somewhere on your Raspberry Pi. Some pins may be different, depending on how your wires are set up.

You will also have to make sure your code can run automatically when the Pi boots.

Downloads

Final Touches

20180404_145931.jpg
20180404_145935.jpg

Connect the Xbox 360 wireless receiver into one of the Pi's USB ports, as well as your power source.

At this point your car should be running.

  • Right trigger moves the car forward
  • Left trigger moves it backwards
  • Both triggers at the same time slows the car down
  • Left stick controls the amount of power that goes into each wheel, turning the car