Robot Explores Rooms, Follows Lines, and Battles in Mini-Sumo

Roundabout is the robot featured in the book Intermediate Robot Building.
Roundabout has a several variations of circuit boards and body styles for
different tasks and different levels of complexity depending on the builder’s skill.

Even though different body styles and colors are shown off in the videos on this page, they all include the stock circuitry and source code.
No alterations were made in order to demonstrate the behaviors below.

Roundabout Motherboard In Sandwich

The easiest version of Roundabout is a single circuit board (the motherboard) with a non-programmable off-the-shelf 74AC14 inverter chip for a brain.
Roundabout’s motherboard is the same size, has the same mounting holes, and has the same motor, battery, and switch connectors as Sandwich.
As such, the most basic version of Roundabout can simply be dropped into Sandwich’s body (after adding some eye holes).

Roundabout motherboard installed in Sandwich’s robot body

Roundabout uses modulated infrared emitters that bounce light off of walls and obstacles and into a pair of Panasonic PNA4602M detectors.
(The PNA4602 has been replaced by the almost identical Vishay TSOP4038.)
The dual H-Bridge motor drivers allow Roundabout to steer clear of detected obstacles by commanding the motors to go forwards, go backwards, brake, or turn.

Click to see a movie of Roundabout (in Sandwich body) navigating a room.

The video begins with the robot aimed slightly towards the wall to demonstrate that the robot gradually curves away until it is parallel to the wall.

Tips for successful room exploring:

The floor must be smooth and flat.

Clear the room of smaller objects.

Place bright-colored objects near table and chair legs, since the legs can be too narrow for the robot to notice by themselves.
Or, place chairs and tables against the walls, since walls reflect enough infrared to dissuade the robot from approaching.

Adjust the infrared emitter output (R7) such that the robot stays far enough away from walls and cabinets, but not so far away as to simply circle the center of the room.

Although Sandwich’s body fits perfectly, the externally exposed wheels can get caught on obstacles.
Also, because Sandwich’s wheels are in the rear, the robot can’t spin in place.
But, by making a custom circular body out of colorful plastic (see the top of this page) or whatever you prefer,
the motors and wheels can be mounted in a more advantageous location for a room explorer.

Roundabout works fine with only a motherboard, but frankly it gets boring pretty fast.

Roundabout Motherboard, Daughterboard, And Floorboard

Roundabout can be greatly improved by adding two additional boards: the daughterboard and the floorboard.

The floorboard is fairly simple, either containing a pair of photoresistors
or a pair of faster-acting, more-sensitive amplified photodiodes (TAOS TSL257 light-to-voltage converters).
In either case, the floorboard provides Roundabout with the ability to see the reflectivity of the floor
so that the robot can follow lines or see the edges of a mini-sumo ring.

Roundabout motherboard and daughterboard

Roundabout’s daughterboard snaps on top of the existing motherboard.
The daughterboard contains a microcontroller brain, DIP switch, pushbutton, and an audio amplifier.
Yes! This robot plays songs as it performs and can emit different tones and buzzing noises to assist in debugging or validating behaviors.

The microcontroller contains a number of different algorithms (selectable by DIPSwitch settings)
that interpret the inputs (infrared detectors, floor sensors, and pushbutton)
and controls the outputs (motors, bicolor LEDs, and speaker) to allow the robot to perform a variety of functions.
As such, the robot can be a room explorer, line follower, and mini-sumo participant all-in-one.

Note: If you want to recreate this robot yourself but you don’t want to learn to program a microcontroller,
you can obtain the pre-programmed chip from Solarbotics.
If desired later on, you can download the HC08 source code from the online resource page (listed in the Appendix of the book)
and reprogram the chip with your modifications.

Roundabout Modes

Room Explorer Mode (fast motors)

Robot plays “Ode to Joy”.

Initially, the robot doesn’t move, but the infrared sensors are active and you can wave your hand
or an object in front of each sensor and watch the LEDs turn from green (no detection) to red (detection).

Press and release the pushbutton for the robot to start driving around.
The robot will turn to avoid a wall or object (your foot, perhaps?) and will back up if both sensors detect something at the same time.
Turn off the power or change the DIP switch settings to stop.

Click to see a long 2.2 MB movie of Roundabout avoiding obstacles.

As you can see from this video, Roundabout with a daughterboard is a much more capable room explorer
because the microcontroller can perform more sophisticated processing than can a 74AC14 logic chip.

Bright (more reflective) and red-colored objects are easier for the infrared sensors to see.
You can influence the robot’s choice of directions by placing these types of objects in the locations that you don’t want the robot to go.

A lot of toys were rearranged to get the robot to take the turns I desired in the above video.
I was frustrated at first, until I remembered that the robot is programmed simply to avoid -- not to follow a particular path or pattern that I have in mind.
The robot has no concept of destination, and is perfectly satisfied to turn around several times, back out, or avoid the obstacle maze all together.
Driving around with no particular place to go is the very nature of this robot.

Room Explorer Mode (slow motors)

Same as above, but the robot spends more time backing up and turning to the side.
This permits the robot to operate properly with slower motors or where you want more radical turning.

Some experimentation will determine which mode is appropriate for your motors and courses.
Turn off the power or change the DIP switch settings to stop.

Line-Following Mode (light line)

Robot plays “Oh, When the Saints Go Marching In”.

Center the robot over a light-colored line on the floor until both LEDs turn green.
If either floor sensor sees too much brightness (each floor sensor should see dark floor since the light line is supposed to start between the sensors), then the corresponding bicolor LED turns red.
If both LEDs are red (both floor sensors see a light floor), then the robot emits a disapproving tune to suggest that perhaps the wrong line-following mode has been chosen (light line vs. dark line).

Press and release the pushbutton for the robot to start following a light line.
Turn off the power or change the DIP switch settings to stop.

Click to see a movie of Roundabout following a light line on a dark surface.

Roundabout is a more successful line-follower than Sandwich.
Although both robots can skip over gaps and ignore crossing lines, Roundabout can take 90 degree turns.

Part of the reason is the slower motors and centered wheels in Roundabout.
However, the most significant reason is that Roundabout has an H-bridge motor driver (not just two transistors)
that permits the robot to brake a wheel (pivot) or reverse a wheel (rotate in place).

Line-Following Mode (dark line)

Robot plays “Fur Elise”.

Same as above, except the robot follows a dark line and the LEDs turn red when the floor sensors see dark, not light.
Turn off the power or change the DIP switch settings to stop.

Click to see an 880 KB movie of Roundabout following a dark line on a light surface.

This video begins with Roundabout purposely in the wrong DIP switch mode (to follow a light line).
You can hear the robot complain until the mode is corrected (follow a dark line).

An interesting feature of this course shape is that it exercises both left and right turns, unlike a simple oval, which only exercises a turn in one direction.

Demo Mode

Robot demonstrates and exercises most of its features.
An excellent mode to verify that a newly assembled Roundabout is working properly.
Press and release the pushbutton to step through each demonstration.

Robot plays the firmware version number.
You can figure out the version number by simply counting the low notes.
A high beep represents a “.”.
For example, “low (pause) high beep (pause) low low low low low” is “1.5”.
Each press of the pushbutton tests a different part of the robot.

Green LED demo: Both LEDs turn green.

Red LED demo: Both LEDs turn red.

Independent LED demo #1: Right LED (nearest pushbutton) turns red. Left LED turns green.

Independent LED demo #2: Right LED turns green. Left LED turns red.

Infrared sensor demo: Each LED turns red or green depending on if an object is detected.

Frequency demo: Plays middle C continuously. This can be pretty annoying, but if you hook an oscilloscope or multimeter
to the speaker connector it should show between 257 Hz and 265 Hz.
The robot is trying to play exactly 261.63 Hz, but the internal oscillator isn’t that accurate.

Forward motor demo: Both motors rotate clockwise (when each is viewed from the outside of the robot).
The robot should drive forward. This is usually when you discover one or both motors are
wired backwards, their connectors are flipped (left and right swapped), or are working intermittently (the robot doesn’t drive straight).
In this demo, the robot does not use the floor or infrared sensors, it simply provides full power to both motors,
therefore the robot should drive relatively straight forward.

Left motor demo: Only the left motor is powered. The robot turns right.

Right motor demo: Only the right motor is powered. The robot turns left.

Floor sensor sound demo: Floor sensor readings are converted to a frequency.
This is probably the coolest demo.
The brighter or more reflective the surface the robot sees with the floor sensors, the higher the pitch.
It’s fun to lift the robot up and down and listen to the sound.

Idle demo: If the robot isn’t active (following line, sumo battle, and so on) the robot
will play a little tune every thirty seconds to indicate it is waiting for a button press.

Click to see a 1 MB movie of Roundabout exercising its LEDs, sensors, and motors.

Test Mode

Robot plays “Clementine”.

This mode is left empty in the robot to allow you to add your own mode
or to test code snippets without affecting the rest of the robot.

Mini-Sumo Mode (fast motors)

Robot plays “La Cucaracha”.

Bicolor LEDs turn red when the corresponding sensor can see the opponent.
Try to position the robot so that both LEDs turn red.

Press the pushbutton to get ready, and release when the round starts.
The robot counts down five seconds while playing musical scales, flipping the LED color every half second.
Turn off the power or change the DIP switch settings to stop.

Click to see a movie of Roundabout quickly beating Pound Of Wood.

Notice that after disposing of Pound Of Wood that Roundabout rushes the edge again several times to aggressively insure the opponent is out of the ring!

Roundabout’s circular plastic body is about the worst possible shape for mini sumo.
Chapter 5 of Intermediate Robot Building shows how to bury the motors inside of the wheels
and Figure 17-19 on page 390 shows a more effective body with a scoop.

Mini-Sumo Mode (slow motors)

Robot plays “La Cucaracha”.

Same as above, except the robot spends more time backing up and turning upon reaching the edge of the sumo ring.
This should compensate for slower motors.

If the robot turns around too far (thus heading back towards the sumo ring edge), try the fast motor mode instead.
Turn off the power or change the DIP switch settings to stop.

Variations On A Theme

This version of Roundabout is fully functional and complete (motherboard, daughterboard, floorboard, speaker, and so on), but is built on a Ziploc container as opposed to a custom-made frame.

Although Sandwich also uses a Ziploc container for a body, this body is slightly different in that the motors are centered (not at the rear)
and Sandwich-specific features (like a line-following switch) aren’t included since this robot wasn’t a retrofit.

Making Roundabout

If you want to build this robot or learn more about the modules contained within, complete step-by-step instructions, as well as schematics,
wiring diagrams, part numbers, and part suppliers appear in the book, Intermediate Robot Building.