This instructable will show you what I did to create my own Raspberry Pi Zero + Xbee RC transmitter
Teachers! Did you use this instructable in your classroom?
Add a Teacher Note to share how you incorporated it into your lesson.
Step 1: Raspberry PI and Xbee RC Transmitter
Step 2: Configure the Raspberry Pi UART
The Raspberry Pi (all variations) are extremely versatile and are now the cornerstone of an ecosystem of many easy to solder add-ons that make these devices REALLY handy. Unfortunately the one thing that Raspberry Pi is missing (currently) is a breakout board or turnkey GPIO interface for XBee (ZigBee) radios. XBee devices are a great way to communicate between all kinds of devices without a lot of dicing and slicing protocols or data formats and make it very easy to integrate USB devices and send their data to other remote devices. To begin, start with any version of the Raspberry Pi. In this Instructable I used a Raspberry Pi zero, and configured the serial console to free up the UART using this Instructable.
Step 3: Write a Python Script to Read Game Controller Values
This bit of Python code reacts to the events raised by the game controller and transmits the value of the input on the control that raised the event. This code will send data as fast as the baud rate set on the XBee radios. In this example the radios are set to 57600 but could be set to their highest baud rate. The game controller is a Logitech USB game controller. The code used is below:
for event in pygame.event.get():
sOut="Axis:" + str(event.axis) + ";Value:" + str(event.value)
sOut="Hat: + str(event.hat) + ";Value:" + str(event.value)
sOut="Button Down:" + str(event.button)
sOut="Button Up:" + str(event.button)
Step 4: Conclusion
The final build of this uses an auxiliary phone battery to power the Raspberry Pi, which powers the XBee and Logitech game controller. In a future project I will add a vacuum formed plastic cover that will enclose the Raspberry PI Zero, XBee Radio, and power supply, all attached to the game controller in one nice, neat bundle. This RC transmitter build makes it very easy to send control data to just about anything. In my next build I will send the data to a hexapod robot that I rescued from Goodwill. Hope you find this instructable helpful. Happy Building!
Step 5: Wire the Raspberry Pi Zero to the XBee Radio
As shown in the diagram, connect the Pi GPIO pin 1 (3.3v) to XBee pin 1. Connect the Pi GPIO pin 6 (Gnd) to XBee pin 10, and Pi GPIO Pin 8 (TX) to XBee pin 3 (Din). You can also use an XBee breakout board which will require you to connect the Pi GPIO pin 2 (5v) to the 5v pin on the breakout board
Participated in the
Remote Control Contest 2017