Congratulations on your purchase of a Seattle Robotics Society Level 1 Robot Kit!
Here are suggested steps for getting your robot assembled and running.
Read through the “Computer Requirements” and “Recommended Equipment” sections to be sure you have the
materials you need.
Compare your kit’s parts with the lists in the “Kit Contents” section to verify that you can correctly identify each of
the parts in the kit.
The sections after that work well as a tutorial, with step-by-step instructions for assembling the controller board and
chassis, guidance for setting up the programming software on your computer, explanations of the basics of
programming the Atmel ATmega16 microcontroller, and an introduction the programs. The programs themselves
contain comments to explain the concepts in more detail.
The sections at the end, “AVR Robot Controller 1.1 Hardware Description” and “AVR Robot Controller 1.1
Schematic,” are included for reference.
Computer Requirements
To program the robot, you will need one of the following connections:
• a DB-25 parallel port -- this will work with the programming cable included in the kit. (Note that it will
most likely not work to use a USB-to-parallel converter; they do not provide full parallel port functionality,
just what's necessary for printing!)
• a DB-9 serial port and an AVR-ISP programmer -- the AVR-ISP can be purchased from Digi-Key (part
number ATAVRISP-ND) for $29.
• a USB port with a USB-to-serial converter and an AVR-ISP programmer -- USB-to-serial converters are
available from a variety of places, including Fry's Electronics; the AVR-ISP can be purchased from Digi-Key
(part number ATAVRISP-ND) for $29.
To communicate with the robot, you will need either:
• a DB-9 serial port, or
• a USB port with a USB-to-serial converter.
Recommended Equipment
The robot is powered with 6 AA batteries, which are not included in the kit. We recommend rechargeable batteries
(NiMH or NiCd).
The following items will be necessary (or useful) for construction. Please bring as many of these items as possible to
the workshop sessions. There will be a small quantity available to use during the workshop.
This optional add-on kit provides parts to terminate sensor wires and align them in housings for easy connection to
the board sockets. The default kit has wires tinned and inserted directly into the sockets.
Digi-Key http://www.digikey.com/
Jameco http://www.jameco.com/
Barello.net http://www.Barello.net/Commerce/
McMaster-Carr http://www.mcmaster.com/
Pololu http://www.pololu.com/
Solarbotics http://www.solarbotics.com/
Samtec http://www.samtec.com/
Future Electronics http://www.future-active.com/
Mark III Robot Store http://www.junun.org/MarkIII/
Make An Impression http://www.makeanimpression.net/
B.G. Micro http://www.bgmicro.com/
All Electronics http://www.allelectronics.com/
4 11-3-2005
AVR Robot Controller 1.1 Assembly Instructions
AVR Robot Controller 1.1 Assembly Instructions
Preparation
Identify the parts used in the AVR Robot Controller (ARC).
Refer to the Kit Contents section for a list of parts in each
bag.
• Anti-Static Bag: everything except the QRB1134 light
sensors.
• Electro-Mechanical Bag: everything except the velcro,
mounting squares, shrink tubing, and rubber bands.
• Loose items: the battery holder, 4-conductor cable, and
ribbon cable.
It is recommended that you return unused items to their
original locations so that you can find them later!
Soldering Overview
The ARC can be assembled using a fine tip 25-40wt
soldering iron, thin 60:40 rosin core solder, flush side
cutters and a pair of small needle nose pliers. Additional
items that are useful are a solder tip cleaner (damp sponge
or cloth), paste solder flux and a small gauge wire stripper
(18-26). Because it is fairly small you need a well-lighted
area to work in. A magnifying glass might be useful for
inspecting solder joints.
The side cutters are used to trim component leads flush to the board after soldering them. With a little practice the
side cutters can be used to strip wire as well: the trick is to cut into the insulation, but not the wire, and then pull the
end off.
The key to obtaining a good solder joint is to get everything hot enough so that the solder “wets” the surface and
wicks into the spaces between the wire and what you are soldering it to. First clean the iron tip by wiping it across a
damp sponge. Then tin the tip with a bit of fresh solder. Then place the tip against the pin and the solder pad, i.e.
wedging it in the corner of the two. Then touch the solder to the pin or the board near to the tip. Usually it takes just
a fraction of a second to get the joint hot enough to melt the solder. Then leave the tip on the joint for a couple
seconds more until the solder visibly wicks into the hole. If the hole looks empty you can put another touch of solder
on. When done, snip the excess lead material off flush to the bottom of the board. Usually cleaning and tinning the
tip is needed only between rounds of soldering or after soldering 20-30 joints in a row.
You need a workspace as well. The ARC uses static-sensitive components and you need to exercise care while
assembling it. The best is an anti-static mat with a wrist strap and grounding it to the same ground as the soldering
iron uses. An alternative is to work on a bare wooden surface. Wood neither conducts nor accumulates static
electricity. Sometimes you can obtain a sheet of conductive foam and work on that. Keep it grounded through a
large resistor (e.g.1-2 meg ohms) and make sure some exposed skin touches the surface before you pick up static
sensitive parts (anything that looks like an IC). Once the board is assembled and the IC’s inserted, it is much less
sensitive to static discharge.
11-3-2005 5
AVR Robot Controller 1.1 Assembly Instructions
Prepare Boards
The PCB comes with a serial adapter and a programming adapter that need to be detached. First break the long line
of holes. You might find it easier to break if you run a razor knife along the top and bottom of the line of holes. Then
snap the two smaller boards apart. Finally, if you want, you can sand or file the rough edges smooth.
Controller
The control board has been designed with oversized holes to facilitate hand assembly and disassembly. The problem
is that components will fall out when the board is turned upside down. If you assemble from shortest to tallest
components, then it is possible to load several parts onto the board, cover it with a piece of conductive foam or
cardboard and turn it over. Still, parts will tilt and move about. The trick is to solder one pin of each part into place,
turn the board over and re-position the parts by re-heating the soldered pin while pushing on the other side with your
finger. When all the parts are positioned to your satisfaction, then turn the board back over and finish soldering the
rest of the pins.
The picture on the right shows the completed ARC board for the SRS Level 1 Robot Kit. The “front” of the board is
at the top of the picture. This refers to how the board will be mounted on the robot, and is used to describe locations
in the instructions below.
Solder Components
Part locations are labeled on the board, but some labels are incomplete due to solder pad location, and some parts
have changed. Please read the instructions to ensure that parts are installed correctly.
The following list is in order of shortest to tallest component. All the components in each section can be soldered at
one time, or each component can be soldered in separately.
Important: Note the locations for the 180 and 4.7k resistors at
the top of the picture. They are installed in locations marked 680
and 33k, respectively. (R3 and R8 remain 680 ohms, as shown at
the bottom of the picture.) These resistors are selected to work
well with the Fairchild QRB1134 phototransistors (light sensors)
in the kit. For more information, read the section titled “Left,
Center, and Right Floor Sensor Inputs.”
Orientation of the resistors is not important. Resistors do not
have “polarity,” so it does not matter which end goes into each
hole on the board.
The diode is inserted with the band toward the end of the arrow
on the board. If you know what you are doing and want
maximum power you may omit the diode, replacing it with a short piece of wire. This will remove the reverse
battery protection that prevents destruction of the H-Bridge chip and/or attached servos. The voltage regulator
protects the rest of the board from battery reversal.
6 11-3-2005
AVR Robot Controller 1.1 Assembly Instructions
Small capacitors and LEDs
The picture on the right shows the locations for:
8 - 0.1uF capacitors
1 - red LED
1 - green LED
Orientation of the small capacitors is not important.
Note that one of the capacitors (second from the top) will be
under the microcontroller. Be sure that it sticks up no higher
than the DIP socket (to be installed in the next step). You may
need to bend the capacitor’s leads a bit to get it to sit close
enough to the board. Another option is to mount the capacitor
“lying down” by gently putting right angle bends into the leads
before inserting them into the board.
The red LED is power and the green LED is program. The LEDs
have a flat side that is oriented toward the near edge of the board
(the edge at the bottom of the picture). There is a long and a
short lead; the short lead should be near the edge of the board
and the longer lead toward the center of the board.
All ICs can be mounted directly on the board. However, if you are a beginner or an experimenter, you probably
should use the DIP sockets so the ICs are easy to replace. Make sure the notch on the bottom of the socket
matches the notch in the markings on the board (on the left side in the photos).
If you want to maximize the power handling capabilities of the 754410 H-bridge,
you must solder that chip directly onto the board. The ground plane of the board
provides the heat sink needed for maximum power output. This is not
recommended for beginners.
Bend the leads of the voltage regulator half-way through the fat part, near the b
ody
of the IC, as shown in the picture on the right. This will align the mounting hole
over the hole in the PCB and the IC should lie flat when soldered in. (Board
location is shown in the picture in the next section.)
Switch and resonator
In this step you will install:
1 - switch
1 - ZTT-16.0 resonator
Install in the locations identified in the picture on the right (which shows the
lower right corner for the board). Orientation is not important for the switch or
resonator. The resonator is optional. The ATmega16 has an internal 1, 2, 4, or 8
MHz oscillator. In addition, it can operate with an external source of up to
16MHz, which this resonator provides.
Install the sockets along on the front of the board (as shown at
the top of the picture). The headers should be installed with the
shorter end of the pins inserted into the board. Install the 1x3 pin
headers in the locations marked JP5 (serial communications),
JP13 (power), and “servo.” Install the 2x3 pin headers (motors)
at the back of the board, in the locations marked LEFT and
RIGHT. Install the 2x5 pin header (programming) in the location
marked JP9.
Install the shorting jumper on the “servo” header. The picture on
the right shows the jumper positioned to select “Bat.” The other
option is “5V.” Either setting is fine for Level 1. Please see “Left
and Right Motor Connectors” in the ARC 1.1 Hardware Description section for details.
Large capacitors
In this step you will install:
3 - 47uF capacitors
Pay attention to the orientation of these devices. The longer lead goes into the hole marked with a ‘+’. The gold
bar on the side of the capacitor should be on the side marked with a ‘-’ sign.
Cleaning and Inspection
After all components are installed, inspect the bottom of the board with a magnifying glass. Look at each solder pad
and make sure that the solder is shiny and has a “wet” look. Reheating and applying a touch of solder can rework
pads that are incompletely filled with solder or look gray and dull.
Look for solder bridges between pads or pins that are close together. If you used a fine tip iron and no more solder
than needed for a good joint, you shouldn’t have any bridges.
You can clean the flux (from the solder) from the board with denatured ethanol (alcohol). Use an old toothbrush to
scrub all the pads with the alcohol.
The ends of the battery holder’s wires are already stripped and tinned. Place one
wire into the “trough” of a female crimp pin, with the insulation just barely
reaching into the area between the two triangles. Using needle-nose pliers, fold
over one triangle to hold the wire in place for soldering (as shown in the picture
on the right). Apply a small amount of solder between the bare wire and pin, then crimp the pin closed using needlenose pliers or a specially-designed crimp tool. Repeat with the other wire.
Insert the crimp pins into the housing with the flat part of the pin against the
flat part of the connector. The black wire must go into the middle location of
the housing; the red wire can go on either side.
8 11-3-2005
AVR Robot Controller 1.1 Assembly Instructions
Install Chips
Be sure to inspect the board before applying power. Connect the battery pack to the 3-pin header next to the switch
(JP13). With the switch in the on position (toward the near edge of the board) the red power LED should light.
Now you can install the various chips. (Turn off power to the board first.) All chips are installed with the notch (pin
1) oriented away from the switch and voltage regulator (the notch is on the left side in the photos above). The RS232
driver is installed in the location closer to the ATmega16; the 754410 H-bridge is near the 2x3 headers.
Serial Cable
The kit includes materials to make a serial interface cable that can be used to connect the ARC board to your PC.
This is useful when debugging your programs as it allows the program to tell you what is going on.
For this step, you will need:
1 - serial adapter PCB (the one with “Gnd Tx Rx” labeling)
1 - DB9 solder cup
3’ - 4-conductor cable
3 - female crimp pins
1 - 1x3 connector housing
1 - cable tie
Strip one inch of gray insulation from each end of the 4-conductor cable to expose the wires. Snip off the bare
wire and one of the four insulated wires.
Strip 1/4” of insulation from the ends of each remaining wire and tin the exposed ends.
Trim the tinned wire to 1/8” long.
Solder to the crimp pin sockets and crimp the pins to the wire, as shown in the pictures below.
Insert the crimped pins into the connector housing. The pins
should snap into place when inserted correctly.
Mark the 3-pin socket with Rx, Tx, and GND, as shown in the
picture on the right. A piece of masking tape (not included) works
well. Each line will have a corresponding label on the PCB.
Solder the DB9 connector to the board, paying attention to the
orientation so each solder cup covers a pad.
Solder the wires to the board, referring to the socket connector to
determine which color wire to use for each signal.
Fasten the cable to the board using the cable tie. This provides strain relief.
Finished Serial Connector
11-3-2005 9
AVR Robot Controller 1.1 Software Tools
Programming Cable
The kit is supplied with material to make a programming cable that works
with the BASCOM Basic Compiler or the AVRDUDE program (included
in the WinAVR suite for C/C++ programming). BASCOM and AVRDUDE
work with any third party programmer that has an Atmel 10-pin
programming socket, so you only need to build the cable if you don’t
already own a programmer.
The programmer uses a male DB25 connector that plugs directly into a PC
printer (parallel) port.
Solder the resistors, header, and DB25 connector to the board.
Hold an IDC connector with the sockets aiming down and the “pin 1” arrow on the right side. Align the ribbon cable
with the red stripe toward you, and slide the cable into the connector from the right
side until the edge of the cable just aligns with the left side of the connector. The
red stripe should be aligned with the arrow. Gently press on the top of the
connector to crimp it together. You may find it useful to use a vise or pliers, but be
careful, squeeze gently, and try to apply even pressure. After the connector is
together, fold the cable over the top so that it extends to the left. Insert a strainrelief clip into the top. The final result should look like the picture on the right.
Install the second IDC connector on the other end of the cable in the same way. Plug one end of the cable into the
programming adapter, aligning the red stripe with pin 1, which is next to the “JP6” label. The other end plugs into
the programming header on the ARC board, with the red stripe aligned with the caret by pin 1.
AVR Robot Controller 1.1 Software Tools
This is a good point to test your robot controller. This section explains the basic terminology and procedure for
programming, and has instructions for loading your microcontroller with a program that will flash the green LED.
There are three main steps in teaching your robot to do something:
1. Write instructions (a “program”) for the robot to follow.
2. Translate (“compile”) those instructions into binary code that the robot can execute.
3. Convey (“download”) the binary code to the robot’s microcontroller using a special cable (the “programmer”).
Options for the first two steps are discussed below in the Tool Options section.
To download your program, you need to connect your computer to your robot using one of the following options:
• The least expensive option is to use the programmer included as part of the kit. It can be used for either BASIC or
C/C++ on Windows if you have a (DB-25) parallel port on your machine. (Note that it will most likely not work
to use a USB-to-parallel converter; they do not provide full parallel port functionality, just what's necessary for
printing!)
• If you are using a Mac, or a Windows machine without a parallel port, you can purchase an AVR-ISP
programmer from Digi-Key (part number ATAVRISP-ND) for $29. That programmer hooks up to a (DB-9) serial
port. You will also need to get a USB-to-serial converter if your machine does not have a serial port.
10 11-3-2005
AVR Robot Controller 1.1 Software Tools
Tool Options
Free, high-quality tools are available for the Atmel AVR series of microcontrollers. On Windows systems, two
popular options are the BASCOM (BASIC) compiler and the WinAVR suite of tools for C/C++ programming. Mac
OS X supports the avr-gcc C/C++ compiler (which should work equally well on Linux and FreeBSD).
The following sections each provide instructions for installing a compiler and downloading a simple program to
your ARC board. Choose the option that best suits your needs and follow the steps in that section.
BASCOM on Windows
BASCOM-AVR is an “integrated development environment” (IDE) that provides an editor, BASIC compiler, and
downloader. This is a good starting point for people new to programming.
You can download the BASCOM-AVR DEMO from http://www.mcselec.com. This site also provides information
on installing BASCOM.
Copy the “BASCOM Samples” folder from http://www.seattlerobotics.org/WorkshopRobot/Level1/
Workshop CD’s “Samples” folder) to a convenient place on your hard drive.
Start the BASCOM-AVR program. Use File/Open to open FlashLED.bas in the “01aFlashLed” folder (in BASCOM
Samples).
While power to the ARC board is off, plug the programming cable into the ISP header on the board and the parallel
(printer) port of a PC. (If you have an AVRISP or STK200/300 compatible programming cable you can use that
with BASCOM by changing the programmer in the Options/Programmer menu. (The kit’s programmer uses the
default “Sample Electronics programmer” option.) Please refer to the BASCOM documentation for additional
information.)
Turn on power to the ARC board, click on the Compile button (or use menu Program/Compile), then click on the
Run button (Program/Send To Chip). The Sample programmer should pop up with the ARC CPU identity listed
(m16). Click on the Auto-Program button (menu: Chip/Autoprogram) and the program should load in a couple
seconds. Close the Sample programmer window.
The green program LED flashes with a one second cycle time after a successful download. If the LED flashes very
slowly, then the oscillator options for the CPU have not been set and the CPU is likely running off the factory
default 1 MHz internal oscillator. You can re-program the chip to run off the external crystal/resonator, or the
internal 8 MHz oscillator by reading about the fuse bits and programming them appropriately. See “Customizing the
Microcontroller” below.
(or the
WinAVR (avr-gcc) on Windows
WinAVR (pronounced “whenever”) is a suite of software development tools for the Atmel AVR series of
microprocessors. It includes the avr-gcc compiler for C and C++, AVRDUDE downloader, and Programmers
Notepad editor.
You can download the WinAVR suite from http://sourceforge.net/projects/winavr/
a good idea to uncheck the option “Add Directories to PATH.” (Adding the WinAVR tools to the path may cause
grief for other apps since that puts Cygwin (Linux emulation) files before system files.)
If you are using an “NT” version of Windows (e.g. NT 4.0, 2000, XP, 2003), you will need to do the following to set
up AVRDUDE (it enables communication with the ports needed for downloading):
• Launch a Command Prompt (from the Programs menu, choose Accessories, then Command Prompt).
• At the prompt, type:
• Then type:
• You should see output from this program, ending with a “Success” message. Close the command prompt window.
Copy the “C Samples” folder from http://www.seattlerobotics.org/WorkshopRobot/Level1/
“Samples” folder) to a convenient place on your hard drive.
11-3-2005 11
cd c:\WinAVR\bin and hit Enter
install_giveio and hit Enter
. When you run the installer, it is
(or the Workshop CD’s
Loading...
+ 23 hidden pages
You need points to download manuals.
1 point = 1 manual.
You can buy points or you can get point for every manual you upload.