Hi, I'm Proxy303, a robotics specialist. In this tutorial, I will be teaching you how to build your own robot like one of mine.
I'm not talking about one of those over-glorified remote-control cars that people call robots. One of the very definitions of a robot is that it can't be remote control. The robot you will build today is one that you build, wire, and program. Then it's autonomous. That means it isn't controlled externally. It controls itself. After it's built and programmed, the robot does everything else itself.
There are five main components of any robot:
You will need:
You may want:
Assemble the robot chassis you bought. Make sure everything is assembled properly.
With the Runt Rover Whippersnapper, everything just snaps together. If your chassis is held together by screws, then make sure that they are tight, and that your bot is sturdy. Trust me, there's nothing worse that having your project just fall apart on you - sometimes literally! Also, make sure that there's room inside the chassis. Imagine buying everything, spending over 70 dollars, only to find that one of your major components doesn't fit inside the bot!
Also, make sure the motors are attached properly and can turn freely. Sometimes, a piece of the chassis sticking out can block the motors, so make sure there's nothing that could stop the motors from turning.
Connect the left side motors to each other, in parallel. Do the same for the right motors. Make sure the left side red wires are grouped with the left side black wires, and same for the right side. Connect a red wire to both RED wires of the right side. Connect another red wire to both of the BLACK wires of the left side (I know, it seems backwards on the left side, but this is to accommodate for the fact that opposite-sided motors spin the opposite direction.) Repeat for the black wires. Be sure to keep the wires for the sides grouped together. Also, be sure that the LEFT side motors are reversed from how you would normally wire it.
Before you use a motor driver, you NEED to know how it works. IF YOU CONNECT IT WRONG, YOU CAN DESTROY THE MICRO-CONTROLLER AND/OR THE MOTOR DRIVER!
A motor driver is a type of isolated circuit controller, meaning that there is no physical connection between the motor power area and the logic control area. Most good ones are designed to avoid any electrical leakage into the micro-controller (that could damage or destroy it.) Also, most good ones are usually at least $15, so if you spot a $2 one online, don't buy it! I personally found one like that, and just as an experment, I stuck a heatsink on it and hooked it up. The seller said the driver was rated for 12V. I connected it to 9V, and it started smoking. Turns out, the chip they used was only rated for 3V!
A motor driver has 2 input areas: The power inputs and the logic inputs. It also has two output areas: the right and left sides. Here are all of the pins and what they do:
A motor driver lets you control a high-voltage motor with a low-voltage logic signal. The reason there are two inputs per motor is so that you can also control the direction.
Connect outputs 1A and 1B of your motor driver to the right-side motors. Connect outputs 2A and 2B to the left-side motors (Remember! BACKWARDS!)
Install the motor battery somewhere inside your robot chassis, and connect it to the power input of your motor driver, with + to power input and - to GND.
If you are using a pre-assembled module, then you're good.
If you are just using an IC, be sure it's wired properly, and be sure to put a heatsink on it! These chips heat up a lot, which is why most good drivers have heatsinks.
Attach your micro-controller to the robot. I used the Arduino Uno Rev3. Connect four digital outputs of the micro-controller to the logic input of the motor driver. Connect the micro-controller's ground pin to the GND slot of the motor driver. Do not connect the 5V pin on the motor driver to the micro-controller! This is used for powering certain types of motors, not as a power input, and certainly not for a micro-controller. If you do this, you could damage the micro-controller. You should only connect the logic pins and the common ground pin on the motor driver to the micro-controller.
These connections are used to control the motors, using the logic inputs of the driver.
Go back and make sure everything is good. Check your wiring, make sure the left motors are connected backward, be sure your 5V output on the micro-controller is not connected to the 5V out on the motor driver, and check for any other issues. Be sure all your screws are tight, your wires are plugged in, your motors aren't blocked, and no wires are broken.
If everything's good, then go on to the next step.
Insert the batteries into the robot chassis. If they fall out, they could slow down or stop your robot, so be sure to secure them inside the chassis. Use a mounting bracket, some glue, or just tape them in place if you plan on taking them out often. Also, make sure your battery connections are good. I once had a robot that refused to move, and I went in circles for hours, checking my programming, rewiring the motors, and being unable to find the problem. I even ended up buying a new micro-controller, only to find that one of the wires to my motor battery had come loose inside the chassis. This is a perfect example why you should always check for other issues before replacing a part!
Use small mounting screws to securely attach everything. Screw the motor driver and micro-controller onto the robot chassis, and be sure that the motors are secure. Be sure that the breadboard is securely attached too.
Use zip ties or small pieces of tape to organize your wires. You don't need to do this, but it certainly makes the robot look better, and makes it easier to keep track of what wires go to what. Also, if you don't have zip ties, or need to easily replace the wires, you could group them by color. For instance, you could use green wires from the micro-controller to the motor driver, red wires for power, black wires for GND, and blue wires from the motor driver to the motors.
Hook up the micro-controller to a computer and program it. Start simple, and don't overwhelm yourself. Begin with something as simple as making the robot move forward. Can you make it turn? Go backward? Spin in circles? Beware, the programming requires a lot of patience, and usually takes the longest. Refer to the graph above.
It's up to you!
Congrats! You now have a working robot! Please post in the comments if you built it, and what attachments you added.
If anything goes wrong, please refer to the troubleshooting help below:
The robot doesn't turn on at all
You know that the robot is on because most motor drivers and micro-controllers have lights that indicate that they are on. If they don't turn on, then:
The robot turns on but doesn't move
If you have confirmed that the robot is on, but it doesn't move at all, then:
The robot turns on but moves in an abnormal way
If the robot turns on, but starts moving in an unintended way (for instance, goes in circles when it should be going forward), then:
If the robot doesn't respond to sensors
If the robot turns on and moves around in a normal way, but doesn't "listen" to sensors or doesn't respond in the right way, it's almost always one of two things.
Thanks!