HOW DO YOU BUILD YOUR OWN MICRO RC SURVEILLANCE ROBOT?
Why don't I show you how?
Almost every roboticist has wanted to create a small Surveillance Robot at some point in their time. The biggest problem being the Receiver/Transmitter pairs are always too expensive. My solution: Extract the RC receiver from a small RC car and modify it for our purposes.
By the end of this tutorial, you will create and modify an RC robot to do:
1. Direct Radio Control using the remote's joysticks.
2. Computer control via a microcontroller connected to the remote.
Later, I plan on making this base teleoperational. When I do, I'll be sure to document it and continue the tutorial for it!!!!!!!!!!
It will used the receiver from a $10 ZipZaps RC car purchased at a RadioShack (US) or a Microz GT car purchased at The Source (Canada). Any inexpensive RC car, though, will do. It will also use a wireless camera and 2 Solarbotics gear motors.
The main goal of this robot always remains the same; to be able to perform surveillance that you could watch on your television or on your computer (this depends on the camera used). I broke this tutorial into steps for simplicity and organization of categories (why should you put the construction of chassis with building the electronics? :P)
Now for some general examples of the design for the robot (you don't have to follow my example exactly). The image at the top of the page shows an angled view of the robot.
This is a bottom view of the robot. You can see the motors and the caster, aswell as the wheels.
This is an image of the front of the robot, where the camera is clearly visible.
NOTE: The camera depicted in the image above IS NOT the one that will be used in the tutorial! That camera was inserted to give a generalization of how the robot should appear when completed!
All these images were created using Google Sketchup, a free and useful CAD software which is popular amongst roboticists.
Now, during this tutorial, I will expect that the following tools are available for use:
- a soldering iron
- Solder wick or a soldering vaccuum
- a basic saw
- small set of screw drivers
- possibly a drill
- small pair of pliers
- a glue gun
None of these tools are 100% required, since you may have a better idea of how you want to build your RC Robot, but to follow this tutorial, those are some things I expect you to have.
Please vote for me in the SoR Contest!!!!!!!!
Feedback is much appreciated!
PART 1: Basic RC Robot
PART 2: Computer Control
PART 3: Basic Teleoperation
So here's a list of parts used for my robot starting at the joystick control, then to computer control, and moving onto teleoperation.
- NOTE!!!! The ZipZaps and Microz GT series has been discontinued. The new series is called XMODS, and is supposedly 100% compatible with ZipZaps RC cars. The previous series can still be purchased on ebay.
Castor Wheel... ...Prace Varies
#2 Sized Screws and nuts... ...$2.50
Plywood... ...Price Varies
Total: $44.97 (Excluding hardware parts) plus camera of choice.
Included with the previous parts...
Note: You only require one of these two MCU kits
Total: BS2... ...$114.94 PICKit 1... ...$80.97
Total: BS2... ...$114.94
PICKit 1... ...$80.97
Another 9V Snap Connector...
Still to come...
So Here are the hours I spent building this robot. The time you take will likely be less because I've already done much of the designing for you, and all you have to do is throw together the pieces (figuratively, not literally of course =P) while following my instructions.
****NOTE****: These numbers are due to change at any time.
Contemplation and Research: 35 Hours
Designing: 20 Hours
Mechanical Assembly: 10 Hours
Electrical assembly: 9 hours (due to change)
Documentation: 20 Hours (due to change)
Total hours (up to date): 92 Hours
PART 1 Explanation
I should give you a brief explanation of the method behind Part 1. Basically, we are going to remove the RC receiver from a cheap micro RC car (a ZipZap) and transform it into a decent RC Receiver to connect to the drive motors of this robot. The idea is that the outputs from the Receiver are strong enough (since it has built-in motor drivers and because we use two AA batteries to power it) to drive two gear motors that will allow use to move a small robot platform for surveillance. We will be building the Chassis of this robot. Then attach a wireless camera to it and Voila! Instant RC Surveillance at a very low cost of ~$45 (plus the camera you are going to use).
PART 2 Explanation
Now we go a little more indepth into the robotics Arena as we work on making the robot controllable by a microcontroller (or a computer, depending on how you create the circuit). The microcontroller acts as an interface for the computer. In order to do this, we will be hacking into the RC transmitter (the remote) to interface it with a microcontroller. I will also show you some basic programs you can use to control the robot.
PART 3 Explanation
In this final part, we will plunge ourselves completely into the world of robotics as I demostrate how we can implement basic teleoperation by adding a microcontroller to the robot itself. This microcontroller will take signals from the receiver and then perform a specific function based on that signal.
I give this warning for your own good! Any member or user of The Society of Robots WILL NOT be held accountable for any injuries you inflict upon yourself from this tutorial! The SoR nor I will be held accountable if you damage any product while modifying it for this tutorial! You should be well aware of your actions and be sure of how you will perform them! Read all instructions and safety manuals before using any tools that are potentially dangerous! Always be afraid of any tool that can cause you harm! Follow all safety measures. It's all fun until someone gets hurt (including the people around you!)
This forum thread can show some injuries someone can receive from robotics: Wounded in Battle - 2789
Considering that this is an RC Robot, the first part we should get is the receiver.
First, go to any store that sells small RC Cars, such as RadioShack or The Source, where there are ZipZaps and Microz GT cars. As I said earlier, any cheap car will do.
Here's a video of me dissablembling a ZipZaps and a Microz GT Car:
In this tutorial, I will use the ZipZaps receiver. The Extraction of the receiver is similar to the Microz car, and almost any car for that matter.
First, you must remove the aesthetic portion of the chassis.
Now you'll need your small screwdrivers. Remove the single screw that's holding the main cover on. Remove the cover. There will be a small plastic tab that will need to be broken, just break it.
Now remove the screw holding down the circuit board. Be cautious, for this is to be your RC receiver on the robot.
Now, Just cut the wires from the motors and the battery asclose as you can to th board. You may want to salvage those for much smaller applications.
Now that you have your receiver, you need to solder wires onto it and a battery connector. Cut 2 Red and 2 Black wires of the same length, any length will do. Strip half a centimeter of insulation of the ends of each wire.
Before we start soldering on the receiver, I IMPLORE YOU TO FOLLOW ALL SAFETY PRECAUTIONS AND MESURES IN ORDER TO ENSURE THE SAFETY OF YOURSELF AND THE OTHERS AROUND YOU!!! Wear eye protection, wear a mask, whatever. Just STAY SAFE!!!
Now you may heat up your soldering iron. First we must remove and lefover solder from the receiver using a solder vacuum (sucks up molten solder) or a solder wick (draws out molten solder). Be careful not to remove the small surface mount transistors, for they are CRUCIAL to this robot.
Now, solder on the wires to the contacts of the board. Remeber, all you should need is 1 or 2 seconds of applying heat and a quick dab of solder. The transistors may try to move around, but keep them still. Don`t apply too much heat, else you risk frying the transistors.
Now, Solder on the battery snap connector leads using the correct polarities. (Using reverse polarities just won`t cut it, trust me, I`ve tried... ...okay, it was by accident, but still, reversed polarity is typically a BAD THING!)
Now for the final part of hacking the receiver; crimping on the connectors. To do this, you could use the nice Molex crimpers that are out there... ...but I don't own one. Instead, I used a small pair of pliers I typically use for electronic prototyping. They work just as well. If you are going to use the Molex crimper, then read this and follow its steps untill all your wires are done. That tutorial does use different contacts and headers, but the principals are generally the same. If you will use pliers (like me) then keep reading.
Place the contact on the wire so that one pair of flaps is covering the insulation. If you must trim the wire a little, then do so. Now, carefully fold the flaps on the insulation around it, one over the other, to create a firm bond. Do the same on the non-insulated sections.
Next, we must insert the contacts into the housings. On the contact, you will notice a small tab on the back.
This is called the locking tab. Insert this into the housing so that the tab locks into the small rectangle hole. Don't insert it backwards, else you won't be able to get it out! Repeat these steps for all the wires.
There! You're done hacking into the receiver. This is what the finished product should look like.
If you want to run a functionality test, hook it up to a multi-meter, insert a 3V battery pack and turn on the transmitter. Your output should be around 2.5V to 3V while pushing on the joysticks.
WAIT A SEC!!!!!!! What happens if I don't use that ZipZaps car? What if I use a different toy altogether?
Well, first determine where the motors were connected. You can easily do this by probing around with a multi-meter. Afterwards, just follow the rest of the steps for wiring connectors to the receiver.
Moving on to the Construction of the Chassis.
OK then, Time to construct the chassis of our 'bot (or "body", if you will).
The chassis is mainly constructed of of wood. The only non-wood parts are the motor brackets, and the castor (depending on the type you use or how you build your own). Many people become surprised about the use of wood because it may not sound or seem "robotic" enough. Infact for the majority of the robots I have ever built/seen consisted of some wooden part of the body (if not the whole body itself).
Ok, first, lets observe the design of the chassis. I wanted to create something with a simple, yet efficient design that will allow easy contruction and accessibility to any features added. A circle was too complex, a rectangle too bulky, but the trangle would not look very sturdy, nor decent, aswell as there isn't enough space to create a modify-able platform. Instead, I used the rectangle design, but tapered it off to form a sort of trapezoid in the end of the robot. The design consists of the assembly of very few pieces: one wooden body piece, 2 motor brackets with the motors, and the castor. In total, without the castor, the chassis is 13.7cm long (have you figured out why I called this the MICRO RC Surveillance Robot?) It is 8.8cm wide. At the tapered end, it is about 3cm wide. The tapered portion is 4cm long. It is about .5cm thick.
The first part with the custruction of the robot is to trace out the chassis on a piece of wood. I chose to use plywood, which is many thinner layers of wood glued together to form a single, lightweight, strong, yet cost efficient piece of wood.
Once you traced it out, feel free to cut through the template using a basic hacksaw, or even a rotary hand tool. Smooth out the edges with sand paper or a rotary hand tool.
Time to add the castor. If you bought one from Home Depot, then just attach it on the tapered end of the robot using screws. If you wish you may be creative like me, and build your own castor. I cut a piece of structural wire and threaded it through an RC AirCraft wheel. Then I just hot glued it to the chassis and placed a couple tabs of glue on the loop so that the wheel doesn't move too far off to either side.
Time to heat up that soldering iron again as we solder the leads of the motors to some wires that will serve as connectors or extensions to our receiver. Poke a wire through the loop on the motor lead and carefully twist the wire. Don't break the lead off (a mistake I made on BOTH my motors). Now solder it on. While you solder, it might be wise to remove the motor from the plastic gearbox in which it's contained. Just undo the strap holding downthe motor and gently pull it out. When you're done, slide it back in and replace the strap.
Once the Wire is soldered on, you can either crimp on another Molex connector, or just strip the tips of the wires and leave them as is.
Repeat for all the leads on both motors.
Now for the final step of the chassis.
Mark out the four holes you will be using to attach the motor brackets to the wooden portion of the chassis and drill them out using a small drill bit. Place the motors and attach the brackets to the chassis using the #2 sized screws and nuts.
Now for a finished view on the bottom of the robot.
You can really see the similarities between the CAD image and this final version.
If the brackets don't hold the motors well on their own, try inserting a #5 screw through the hole in the upper corner of the bracket, or use tape or velcro to create a stronger bond.
One last step. Take each wheel and insert the slotted side onto the motor shaft. Screw it in place with the screws included in the packaging.
There! The chassis is done!
Next we will Finish Up on Part 1 of the robot.
Ok, So now we have 2 main parts of the robot (three, depending on whether you've bought your camera or not). Now you need to put them all together.
We will start with the connections between the motors and the Receiver. If you are using Molex housings on both the motors and the receiver, then cut 2 pieces of the .001" pin header off of the strip you received. Each piece must contain 4 pin-headers.Place those headers back-to-back so the smaller ends on both headers are touching and solder them together. Plug the motors into one end of the header row and plug the transmitter into the the other end.
If you are not using Molex housings on the motors, then just insert the striped ends of the wires into the molex connectors on the receiver.
Put you batteries on the robot. I find a little tape (esspecially hockey tape) works well to hold it in place. Snap in that 3V battery connector and place the robot on the floor. Turn on your transmitter. Now you're going to need to test and determine which motor is controlled by which joystick, since each joystick controls one H-Bridge motor driver on the Receiver. After that, play around with your little robot as long as you want.
But we're forgetting something: your wireless camera.
To set up you camera, follow the instructions included with it. Then mount it on the front of your robot using hot glue, double sided tape, or even scews if they're included. Mine required a nine volt battery, so I placed it next to the three volt battery pack.
Once the camera is set up, I like to give my robos a cleaner, more contained look. You could use twist ties, tie wraps, but I prefer elastic bands. For the receiver, I also used a small piece of tape to hold it in place as the elastic is wrapped around.
Your Micro RC Surveillance robot has been completely built! You may now survey anywhere you like within the respective range of the receiver, and you'll be able to view it from the comfort of your TV or even your computer!
In Part 2 of this tutorial, I will show you how to boost the range of your transmitter, aswell as how you can control the robot with your own computer.
Here os a quick demo of the Manual RC control on this robot.
So earlier, in Part 1, we hacked the RC Receiver and modified it to suit our needs. Now, though we are going to control our robot through the computer. This means that we will be hacking into our remote's transmitter, so we can electronically send signals to it through a microcontroller.
I warn you that after tampering with the remote of your car, you MAY OR MAY NOT be able to use it as a remote again. If you follow instructions carefully, there may be a chance that you can use it as is later.
First, remove the battery cover and take out any batteries remaining in the compartment. Then unscrew the four screws holding the covers of the receiver together.
Remove the cover and cut the power wires as close as you can to the battery holder.
Now remove the four screws holding down the circuit board. Gently pull it out.
Can you see the contacts where the signal is sent? Scratch some of the insulation covering the PCB on the area where the signal is produced. Don't scratch the center bit!
Solder wires on the exposed copper traces, and reassemble the casing with the wires sticking out of the top.
You're done hacking!
Now we construct a board to host your transmitter, and to make it transmit signals from the microproccessor. If you bought the BASICStamp BOE(Board of Education) or own a similar board (like me, I own the TAB SumoBot board), then your lucky, since the BOE comes with direct connections to the output pins on the BS2, allowing you to connect your transmitter directly. I connected the outputs with P0 through P3.
The other option I will demonstrate is using the PICKit 1. It can also be directly connected to the transmitter because it has an expansion header row, though you may be nor interested in constructing a separate breadboard for it instead.
If you are going to connect the Transmitter directly to the PICKit 1, insert the PIC16F684 Microcontroller you received with the kit into the evaluation socket. Now connect you four signal wires to RA4 (two from the top), and RA2 to RA0 (seven to nine from the top). You will also need to connect the two power wires to the board. Ground (the black wire) goes on the bottom socket, V+ (the red wire) goes in the socket just above Ground.
The advantage with directly connecting the transmitter to the PICKit is that you can easily change the program for controlling the robot with the click of a mouse. The disadvantage: leaves little room for prototyping.
First take your solderless breadboard and insert the microcontroller to help plan the placement of the componeents. We will be using the PIC16F684, the one included in the kit.
Now we shall wire the voltage regulator. Insert it to the breadboard. Connect pin 1 to the positive power bus, pin 2 to ground's power bus, and pin 3 to pin 1 on the microcontroller. Place the 100uF capacitor between ground and V+. Make sure the side with the thick square line os connected to ground (otherwise it will explode... ...LITEARALLY!) Connect pin 14 to Ground.
All that's left is to connect your transmitter. I connected mine to RA0-RA2, and RA4. Connect the power wires to the unregulated power buses.
The advantage of using a solderless breadboard for hosting the circuit is there is lots of room for experimental prototyping. The Disadvantage: Must be removed from circuit board and placed into the evaluation socket, then must be removed again after being reprogrammed.
Now all that's left in Part 2 is The Program.
So if you decided to use the BS2 for transmitting the RC signals, you'll need to download the PBASIC 2.5 software for free from Parallax.com .
Open a new file and save it as anything you want. Copy the following code into the window and click "Run".
This is the test program I wrote for the robot to go forwards and back, and left and right for half second delays.
' RC Surveillance Robot Test Program. Change the length of delays (in milliseconds) and decide when you would like the robot to turn or change direction by modifying the following code.
DIR0 = 1 ' P0 through P3 is an output
DIR1 = 1
DIR2 = 1
DIR3 = 1
PAUSE 500 ' Delay 500ms
OUT0 = 0 ' Motors Forward
OUT1 = 1
OUT2 = 0
OUT3 = 1
PAUSE 500 ' Pause half second
OUT0 = 1
OUT1 = 0 ' Motors Backwards
OUT2 = 1
OUT3 = 0
PAUSE 500 ' Pause half second
OUT0 = 0
OUT1 = 1
OUT2 = 1
OUT3 = 0
PAUSE 500 ' Turn for half a second
OUT0 = 1
OUT1 = 0
OUT2 = 0
OUT3 = 1 ' Turn the other way for half a second
LOOP ' Repeat
If you decided to use the PIC16F684, then follow the instructions to downloading MPLab IDE and Hi-Tech's PICC Lite Compiler.
After, go to "Project", and then "New Project". Name it what you want and choose a directory. Then, you will need to download all the files at the bottom of this page. Two of these are header files, the other two are C program files.
Next, make sure your project files window is open. Right click on the section called "Header Files" and add the files always.h and delay.h. Then, right click on "Source Files" and add the files delay.c and Transmitter.c.
Voila! Compile and program the code to you microcontroller. Turn on your circuit and your robot will do sequenced movements!!!
In the third and final part of this tutorial, I will demonstrate how you can implement basic teleoperation onto you Micro RC Surveillance Robot!
|C and Header Files.zip||5.01 KB|
Now, we begin transforming our RC Robot into something that is teleoperated. In a sense, some would argue with me, saying this robot is indeed not truly teleoperated, yet just an advanced form of remote control. I respectfully disagree =P A teleoperational robot is one where a basic Radio signal is interpretted by the robot's micro-computer, which commands the robot to do more complex/larger tasks that would be more difficult for a single human alone. For more info, Check out the Radio Control Tutorial on the mainpage.
Because I wanted to limit myself to supplies I already had, I decided to make a $50 Robot like board using the PIC16F684. Of course, the pin-count is smaller, but general principles remain the same, like the pin headers for the servos and sensors, and the power regulation circuit. If the programmer you own requires a header then just add it as necessary. You can also use the actual $50 Robot board if you please.
I'll also do an example using the Axon MCU, since it is an incredibly flexible robot microcontroller platform and has plenty of open source code.
Since the $50 Robot is so well documented, I decided just to show you my final product with a couple clarifications.
Adding the board to the robot is easy. I just used some of those...what do you call them...stand-offs, to elevate the board from the robot body to ensure the board is safe from shorting or damaging itself from our chassis.
Afterwards, just plug in you're receiver to the inside row of pin headers (these are for the inputs). You will likely have to trim off the alignment tabs in order to make sure they Molexx connectors fit. You can still use then in typical Molexx pin headers afterwards, just be more cautious of the correct orientation. Connect to your batteries and motors, then you're done!
Now we need to program the robot.
At first, I started working on the PIC board. For odd reasons, it did not work. So I'll get back to you on that.
For the AVR board, I found the Axon would be the best candidate. So, Here's some of the programming I did:
//variable declaration for RC inputs
unsigned int L1=100; //Left motor output 1
//unsigned int L2=100; // " " " 2
//unsigned int R1=100; // Right Motor output 1
//unsigned int R2=100; // " " " 2
void refresh_ADC(void) //Sensor Refresh Subroutine
L1=a2dConvert8bit(2); //ADC port 2, 3, 4, and 5
int Set_Value=100; //Set comparison value
refresh_ADC(); //Refresh sensor Value
// Place custom code here
//rprintf("Input Signal L1=%d ",L1);
// Place custom code here
//rprintf("Input Signal L1=%d ",L1);
This is only a segment of the whole program which is meant to go in control.c That code only does the ADC conversion for you the section commented out that says "custom code here" is where your own robot code goes. For starters, I tested on moving a servo back and forth.
Something else about this set-up; it is helpful to use a pull-up or pull-down resistor. I discovered this first when testing out the program, making a servo do pre-sequenced movements. When the servo kept moving after having released the controls, I knew there was something wrong. I used the SoR Scope to monitor the outputs of the RC receiver. The voltage level would vary ~70-120 (on a scale from 0 to 255).
This has it's advantages in a sense that you could leave the controls and ignore the robot while it does it's task. The problems being that (1) Eventually, the voltage may drift below the "High" level, and (2) To compensate for the fluctuating voltage, you must turn the controls in the opposite direction in order to bring it back down.
So we've built the robot. Great! But what improvements and be done? What if there's something not working? Well, here are a few issues I had:
1. The castor I built had good potential, but there were issues with it. It created a lot of friction while turning because it would occasionally get stuck in any slight imperfections on the metal ring. A solution for this is is to buy a conventional swivel castor with ball bearings.
2. Battery Wires on the receiver. I had to resolder them about 3 to four times! Why? Because there was excesive movement and gradually, the wires would wear down and snap. A solution for this is to take hot glue that's non-conductive and to put som glue over the connection, limiting the amount of movement on the solder joint.
3. Radio Interference. The Radio transmission from the camera would block out all wireless internet in my house. Unfortunately, I do not know a solution for this, so take it as a warning.
4. One of the motors aren't working! First check if your battery is plugged in. If it is, unplug it and check for shorts. If there are no visible shorts in the circuit, then you may have a broken wire or your connection is not very strong. Did you check the Transmitter batteries?
More to come if I find anymor issues!
So this is just a page with all of the videos for the Micro RC Surveillance Robot. Enjoy!
Here is the Shake Test! Not only did I do one shake test, but I did the same test (vigorous shake, then roll it on the ground a lot) five times!!!!! (Of course, I only filmed it a couple times)
NOTE: Unfortunately, I couldn't Turn on the carpet rug. Too much traction
Here's is me extracting the receiver from a ZipZaps and a Microz GT Car.
And here's a manual RC Control Demo.
Soon, there'll be a final video of the robot (Computer and RC Control). Expect it in a couple Days!