Radio Control
Creating Advanced Radio/Remote Control using the Make Controller and Xbee
CONCEPT
When we think of remote sensing using Xbee modules connected to the MC, we usually think of situations where environmental conditions are detected. This is typically one or more of the following:
- Detection of movement in a remote location
- Detection of humidity, climate etc.
- Monitoring of circuitry in remote areas.
Generally there is a central computer or Microcontroller that takes action based on feedback from these remote devices. One or more Xbee modules are generally used as remote nodes where sensors are placed.
We can also think of this situation backwards, where the Xbee is the master and the MC the slave. This can be implemented in remote control applications. In this scenario a user will manipulate the inputs on an Xbee, and the make controller will take action as a result.
This can be any type of action, but one such application can be a substitute for radio control. Multichannel radio control modules are very expensive, require additional hardware to avoid crosstalk, are not expandible, and are not user configurable. By connecting an Xbee to a generic controller, one can relay button and control messages to the MC and have it take action based on custom firmware.
My car includes the following features that were not available off the shelf.
Currently Functioning:
- Speed boost
- Swiveling fog light
- Dual airsoft cannons
- Vertical tilt on cannon platform
- Headlights
- Horn
Planned:
- Laser sight
- Camera (fully controllable)
- Smoke-screen
IMPLEMENTATION
Controller Implementation
I grabbed an oldwingman USB controller for PC gaming, and began hacking away. By hacking the internal PCB and modifying the traces I was able to pull leads from the buttons/sticks.
Using 4 of the 9 inputs on the Xbee, I tapped into the dual analog sticks. Each of these has perpendicular potentiometers that are ideal for connecting to an Xbee input. Each axis translates directly into an analog signal between 0 and 1023. By keeping track of where these connect to the xbee, we can determine inside of firmware the exact position of each analog stick.
The additional 5 xbee inputs were used by buttons. with some additional circuitry, these same inputs could be used for an expanded set of even more digital buttons, but that is beyond the scope of this project. I kept track of each button and wired them all to the xbee and finally powered the entire controller with 2 AA batteries. Using the Xbee Pro model I've found that this consumes FAR less power than the standard RC style pistol controller. The range is also excellent as expected with the Pro's range specifications. It was also necessary to build a small prototype PCB in order to connect everything together.

Firmware
As mentioned above, it is necessary to create custom firmware in order to interpret the signals correctly.
As messages are received from the remote, firmware can decode the packages and interpret the button signals.
The Firmware should be grouped into 3 parts:
Initialization
- Reset outputs to safe startup position
- Listen for an active remote controller
- Run any extra startup processes like light detection etc.
Normal Operation
A 'while true' loop should take care of:
- Listen for new messages.
- Determine if messages are from the correct remote (i.e. channel, module number).
- Interpret data into button signals using logic.
- Activate components based on signals.
Problem Operation
When batteries are depleted or the car drives outside of its range, the output commands should be updated. If this doesn't happen, the car will continue doing what it did before, this could result in a crash or other undesired operation. The following should be included in the firmware:
- A counter to determine how long it's been since the last message.
- A way to catch when the signal power goes dangerously low.
- A routine to execute when a problem occurs. Stop car, quit firing guns, straighten weels, power down, etc.
My firmware stops all activity on all outputs, resets the servos, and emits an audio signal when contact is lost between car and remote.
Here is the firmware I created
http://makingthings.com/Members/tunell/firmwares-of-all-colors/make.c/view
Mounting Microcontroller
Mounting the controller is potentially the easiest part. I oriented the controller so that the main power input could be spliced in easily to the main NiMH battery leads. This was spliced in parallel with the power leads on the PWM driver for the rear wheels. Two servo outputs were used for the front wheels (turning control) and rear wheels (speed control).
I used 1" brass standoffs and a rotary tool to physically mount the controller on the main body of the car. I stiffened the suspension a bit to compensate for the extra weight. As always, it's important to leave extra space undre the microcontroller in order to avoid shorting the pins on the botoom of the App Board. It may also be desirable to use some kind of enclosure if you're planning on running your vehicle near water. I accidentally drove mine into the water while playing at the beach. Fortuantely nothing was damaged.
Mounting Accessories
Now it's time to mount any accessories. I added a servo controlled platform to raise and lower some airsoft guns. These guns were tricky to mount, but worked in the end. I also mounted a rotational searchlight on this platform, eventually a camera will go on this and be fully pan/tilt controllable. I used components from the Erector set to mount the headlights. These sets also include excellent hinge systems, which allow for rotational motion.
FINISHED PRODUCT
After remounting the controller and making all the necessary electrical connections, you can see that the car looks good, and is also a breeze to control.








