|VCR Remote Control|
|Line Follower Sensors|
|Wireless Spy Cam|
YouTube video of it rolling around the house on 9/7/10.
YouTube video of robot now programmed to go thru a maze
YouTube of first ine follower code
Arty the robot - design and build started July 2010
I had built a robot (Mikey) 20 years ago from spare parts I had and using the 8052 BASIC chip. I built the circuits from scratch using wire warp and TTL chips. The robot had 16K RAM and 16K ROM and used an 8255 for I/O ports and had differential motor design.
Arty is my latest project. It can be an autonomous, rolling around where ever it wants; or it can be a line follower or it can be driven via a radio similar or an RC car. The robot is controlled by an Arduino Mega microcontroller programmed in "C" and is driven by two 12 volt 80 RPM motors. It has Sharp IR GP2Y0A21 receivers, a Radio Shack IR receiver used for remote control and a 12 volt sealed lead acid battery. It has a servo used to sweep the area ahead of it with the Sharp IRR and uses an ultrasound range sensor. It uses an H bridge for the motor control and an Xbee radio for manual control. Lastly, it has 6 IR reflexance detector array to go through mazes and follow line.
When I built my first robot in 1980 there was no internet and
finding robot parts, especially motors and wheels was very, very hard.
When I built my last robot in 1992, the internet was a baby and it was
still very, very hard to find robot parts, especially motors and wheels.
Now it is like Christmas all the time for robot hobbyist! I could
not believe all the robotic web sites that exists now. Sites have
EVERYTHING you need to build your own robot from scratch or from a kit.
Motors and wheel, traditionally the hardest to find, are widely
available in many sizes, voltages, RPMs. You can check around
but I ended up buying almost all my stuff from
Pololu robotics in Las Vegas. Their
web site is excellent for finding stuff and they have forums where you
can ask questions if you need help. They ship fast and the prices are
For me, this was one of the hardest but fun part to figure out. I looked at the robot bases on line but all were too small (couldn't hold my battery) or too expensive. There is a great web site that has more info on hobby robots than probably any other place on line, the Society Of Robots at http://www.societyofrobots.com/ If you go to no other place on line, that site you have to go to. There you will see photos of many robots built by alot of people. Some built using wood, plastic, metal and on even built on a ceiling tile (I kid you not).
For years I didn't build my first robot because I could not find practical motors and/or wheels. I would find a motor but no way to mount a wheel to it. Or I would find one but not two identical motors. For me, the two motor and one idler wheel arrangement is the best of everything. With two motors mounted on one end and the idler wheel mounted on the opposite end, you get both directions and the ability to spin in a tight circle.
About the idler wheel...listen up...
The second problem is 99% of the articles I have seen using idler wheels
show a SWIVEL idler wheel like you see on all chairs and the like. Big
problem. When you back up, the idle wheel swivels around so you don't
back up straight. When you go forward, the idler wheel again turns
around to face the direction of travel. While it is turning, it acts
like a rudder.
Motor Controllers -My first idea was to
build an H bridge using N channel MOSFETs. I have built
Bipolar H bridges before and they worked pretty good. The MOSFETs are
cheap, easy to work with and can easily handle the current. I have the
Robot Bonanza book and it has a schematic for an N channel H
bridge. It was similar to the circuit I had seen so many times before so
I built it assuming it would work right well. Unfortunately it didn't.
Once again I ran into the problem where people write books but have no
idea what they are talking about or don't explain things well enough.
I think the biggest advance in the past 20 years is in the robot
brain, the computer. My last robot used the 8052 with on board BASIC. It
was a great chip. I built the 8052 circuit using my own design and ideas
from magazines. I had to wire up everything, the I/O, the buffers,
serial port, the memory, the CPU, everything. It took up 2 boards and
took a while to wire up and troubleshoot. Then I had to write BASIC code
for it to do anything. There were also the 6800, 68000 and 8085 CPUs
that were very popular but all had to be built from scratch. And those
chips had no BASIC so you were really on your own, having to write in
machine language. And to program them I had to use a serial port from a
PC running at like 300 baud.
At first when I read that most microcontroller used "C" programming language, I stepped back and thought "C? I had been exposed to it years ago but never programmed in it. I always liked BASIC. But once I got the microcontroller up and running, I found "C very easy to learn. It is all in the syntax. And there is so many "C" programs and bits of programs on line that anyone can program in "C". "C" is powerful and well suited for robots. Plus robots don't need or use the fancy, more complicated aspects of "C" so it is easy to pick up.
Sample "C" Code
What is super nice is you don't need to buy a "C compiler or anything else. There is a free Arduino programming environment that runs on your PC where you write your "C" code and then download it to the robot. It compiles and checks for errors and all kinds of neat stuff. I will be the first to say I am not a super programmer and I don't write programs to use the least amount of code or to be the most elegant. I actually write most code on the fly. With that said, attached are a couple of programs I wrote for Arty. The run around the house code. The line follower code. I am always updating the code so you never really finish writing code.
The microcontroller has a built in 5v regulator but because I plan to add lots of things to the robot, I am not relying on that. The microcontroller has one 5v and one ground pin for external circuits so I added my own 5v 7805 voltage regulators on a separate board. One 7805 can only output 1 amp, not enough so I added a second 7805. I added filter caps and pin connectors on the board and it feeds all the 5v requirements except for the microcontroller itself. My original design only used one 7805 but that was enough once I added all the new stuff.
What would be a robot if it couldn't find its way around the
house? One of the things I wanted the robot to do was to be able to roll
around the house autonomously. Sensors help do that. The robot has two
sensors used to move about:
One of the most unique things about Arty is I can control him via
a VCR remote control! A few
years ago Radio Shack sold an IR receiver made to
work with IR remotes. I found one in my junk box and wired to the
microcontroller. Next I found some software that runs on the Arduino
which receives the signal from the RS IR receiver and displays the code
that was sent by the remote. I had an old Sony VCR remote not being used
so I used it to display codes for like STOP, RUN, FORWARD, etc. From
there is was easy to write a program that uses the codes to control the
robot. Since it learns codes, the software will work with any remote
To follow lines (and mazes) I added the Pololu
QTR-8RC Reflectance Sensor Array and then the QTR-8A Reflectance Sensor Array.
They both have 8
pairs of IR LEDs/detectors used to follow lines (like .75" black
electrical tape). The sensors are .375" apart which means 2 are .75"
apart, ideal for black tape. The 8 sensors don't all have to be used and
you can break off the last 2 leaving six which is what I did. The RC
version are the "digital" ones which means you can read a zero or one (as opposed
to the analog one). However, it is not that simple to use. To use it you
have to write a "1" to each sensor, wait a certain time, and then read
the sensor. So I switched to the analog ones instead. You will then get a digital readout such as 001100 or
110000. If you are building a line follower, that is really all you need
to do. But for a maze follower/solver, it gets much more complicated.
With both software and setup. Regarding setup, the height of the sensors
above the floor is very important. Too high and the read angle is too
wide, causing 3 sensors to pick up what only 2 should. Too low to the
floor and they can strike the floor or tape on high spots. I found
around 1/8" to work pretty good.
What good is a robot if it can't communicate while it is running? So I added a 16x2 LCD display. Again the code to drive it is available off the web. I use the display to show me parameters like sensor readings while it is running. It is also a great troubleshooting aid. Plus, it was cheap! The display can show both numbers and characters. I have it mounted inside the body but because the body is clear plastic it works out great. I got the display from http://www.hacktronics.com/LCDs/16-x-2-LCD-Black-on-Green.html?redirected=1.
Not yet added. Another thing I want to add is the Pololu homing beacon IR unit. It is actually 2 units, each with IR beacons at each compass heading. With one as a base, the robot will look for and home to the base unit.
Not yet added. My last robot had a great voice synthesizer, you would send it a text word and it would pronounce it. They don't have anything exactly like that now but they do have circuits that can record and speak x number of words under different conditions. Different web sites sell voice chips, some for less than $20. The problem is they all sound like crap; the are very hard to understand. When it comes to voice technology, it is far, far behind the rest of the robotic field.
The latest modification to the robot has been the addition of Xbee
radios. These 2 way, 2.4 ghz radios can operate up to 300' and can
transmit all kinds of data. I have one mounted on an
Arduino Uno which I use as a transmitter and I have one Xbee mounted
in the robot. The robot Xbee receives commands like forward, reverse and
turn. I don't yet have the robot Xbee permanently mounted.
Another latest addition is a spy cam. I have an old 2.4 ghz wireless color video camera mounted at the top of a short mast. I am hoping to use the video cam to drive the robot around the house. Not sure of the range of the camera. It is old and low tech but we'll see.
|The Arduino Mega, the brains of the robot.||Lots of I/O pins!|
|At last, something not made in China!||Radio Shack IR receiver accepts commands for any TV/VCR remote control|
|Testing out the microcontroller with LEDs||I was going to use this 1" ball as the third wheel but it didn't work out so good.|
|Two motor mounts from Pololu Robotics.||Two wheel hubs from Pololu Robotics makes it very easy to add wheels to motors.|
|Two 3.4" wheels from Pololu Robotics.||Two 3.4" wheels from Pololu Robotics.|
|Servo used to sweep the Sharp IR receiver.||The Sharp GP2Y0A21 IR receiver from Pololu.|
|IRF 540 N Channel MOSFETS which I tried to use for the H bridge motor control but didn't work out good.||Old 5" floppy disk storage unit to be used for the chassis.|
|Sharp IRR mounted on servo which sweeps 110 degrees.||80 RPM 12 volt motors from Pololu Robotics.|
|80 RPM 12 volt motors from Pololu Robotics.||Wheels mounted to hubs mounted to motors.|
|Front view show battery in place.||Underside with furniture caster for third wheel.|
|Left side view.||Third wheel attached with right angle braces not good enough. See description above.|
|Yes, those are Erector set parts!||Bread boarding the circuits on the bench before installing.|
|The MOSFET H bridge motor controller circuit which I ended up not using. See above.||Experimenting with the circuits.|
|The logic board which was to be used for the 4049 and 4011 CMOS chips used to control direction of motors. Now not used. Also mounted at top is the IR receiver for the TV remote control.||The motor controller circuit mounted in the chassis. Too bad but it did not work good enough so I replaced it with a motor controller from Pololu.|
|Logic board mounted.||Logic board, motor controller and microcontroller mounted.|
|First power distribution board design with one 7805 regulator. I updated it with another 7805 and heatsinks.||Motor controller board mounted and wired up.|
|All major parts mounted.||Maxbotix LV-MaxSonar-EZ0 ranger. Notice how small it is.|
|Dual VNH3SP30 Motor Driver board with components mounted.|
|The Radio Shack IR receiver is mounted on this board.||Front view as 8/30/10.|
|Old Sony VCR remote I am using to control the robot when not in autonomous mode.||New caster wheel works much better than old one with swivel.|
|Old and new rear caster wheels.||Some internal wiring.|
|Old power distribution board now with a heat sink on voltage regulator.||Front of the robot now with 2 Sharp IR sensors and MaxBotix sonar ranger.|
|Front view showing Sharp IR sensor and below it the QTR-8A Reflectance Sensor Array from Pololu.||Close up view of the QTR-8A Reflectance Sensor Array.|
|Bottom view show the sensor array, motors and idler wheel.||Rats nest of wires, yeah!|
|Testing out the new display.||The robot now has an 16x2 LCD display.|
|LCD tucked away safe.|
|Arduino Uno, a secondary microcontroller for remote control. It will drive one of the Xbee radios.||Wireless shield which Xbee radio will sit on which will mount to Uno.|
|Two Xbee radios used for remote control. They operate at 2.4 ghz and have a rang of about 100' inside.||Xbee radio mounted on shield. This one is used to transmit joystick commands.|
|These puppies are small, functional and easy to use and cost about $21 each!||Small joystick used to control robot via Xbee radio.|
|Joystick mount to wireless card, with Xbee, mounted on Uno. Just add a 9v battery and this will transmit the codes to the robot so it can be driven like an RC car.||Hard to see under the wires but there are now two 7805s supplying up to 2 amps of power.|
|I added a mast to the robot and added a wireless camera. The mounting is not finished yet.||The wireless camera is mount to the top of the mast and can help me navigate the robot via remote control.|
|The wireless radio part of this project is done.||Mounted Xbee radio on top to keep it away from electrical noise coming from everything down below.|
|Xbee radio mounted up on the "hood".||The Ethernet shield allows for any Arduino to talk over the internet.|
|Various shields and circuits used with Arduinos. The green board is a prototype I got from Radio Shack for $10 and includes sockets, headers, switch, etc.||The Emic voice synthesizer from Parallax. You send it a text word and it speaks it. Very easy to use and sounds pretty good.|
Return to Projects Page