Introduction: Introduction: SpurtBot ShadowRunner

About: I'm a robotics hobbyist and general tinkerer, among other things. Check out my blog or the LetsTalkRobots Playlist on YouTube: http://www.youtube.com/user/appterranova
Intro

Spurt is an abbreviation of: School Projects using Robot Technologies. The SpurtBot ShadowRunner is a simple shadow avoiding robot. It will go straight until the sensor is in shadow, then back up and turn.

NOTE:After you have built and enjoyed your Shadow Runner, you may be able to adapt it by creating new circuits to control its behavior. I have an earlier Instructable on building a line following robot based on a similar design, but without the solderless breadboard. With a few alternative components, you should be able to adapt the SpurtBot as a line follower. Or create a whole new behavior with a circuit of your own design!

I designed this robot to be used for teaching young kids. Children can work with an assistant to build their very own SpurtBot that they can take home. If you want you can pre-build part of the robots so that wires are pre-soldered, and stripped. This way kids just need to assemble the kit.

The video below may be helpful, if you want to see someone walk through the build



Learning Objective

I've used this design and similar to run single day workshops and multi-day robotics classes for children. By making this simple robot, children and students of all ages will learn several basic concepts used in robotics. These concepts include differential steering and motor control, sensors, and automated behaviors. In addition, students will gain experience with hands on construction and prototyping a circuit on a solderless breadboard.

A version of these instructions can be found at:
http://letsmakerobots.com/node/31744

Behavior

The Shadow Runner will run from shadows. That is, it will drive forward in normal lighting conditions, but if you cover its light sensor with your hand or it runs into shadow, it will reverse and turn.

In many cases, this will remove the robot from shadow and it will start to drive forward again. A disadvantage of this simple robot is that if it drives too far into shadow, it will just spin in circles on one wheel! Then you will have to ‘rescue’ it.

Note that the Shadow Runner needs a well lit room to operatate properly.


Circuit

Refer to the circuit diagram in the second picture. When the photo resistor sees light, the robot will drive forward. Both left and right motors are receiving 9V via the normally closed contact of the relay.

When the photo resistor is in shadow, its resistance increases dramatically, and the voltage divider formed with the potentiometer (a ‘pot’ is a variable resistor) now increases the voltage at the input of the two BC337 transistors. These transistors work like electrical switches. They turn on when they get enough voltage to their base input. When used together in a Darlington array, they can provide a lot of current. When they turn on, they provide current to the coil inside the relay, turning it on.

Now the left motor will get ground on its + lead, and 9V on its - lead, reversing the motor.

The right motor's - lead is hard wired to ground from the battery. Since the + lead of the right motor is now also getting ground, the right motor will stop.

This combination causes a stop, backup and turn maneuver. If this maneuver removes the shadow from the photo resistor, it will revert the relay to its normal position, and both motors will drive forward again. If the robot stays in shadow, it will spin in circles with the right motor stopped and the left in reverse.

Step 1: Gather Your Materials

Learning Objective

I've used this design and similar to run single day workshops and multi-day robotics classes for children. By making this simple robot, children and students of all ages will learn several basic concepts used in robotics. These concepts include differential steering and motor control, sensors, and automated behaviors. In addition, students will gain experience with hands on construction and prototyping a circuit on a solderless breadboard.

Parts/Materials
Tools/Supplies
  • Wire cutters
  • Wire strippers
  • Needle nose pliers
  • Hot glue gun and glue sticks
  • Sharp scissors
  • Pen or pencil

Step 2: Attach the Dowel

Mark the center of the dowel as a guide, and use the hot glue gun to attach the dowel on top of the craft stick. The dowel should be about 3/5th back from one end of the craft stick. 

You want to be sure the dowel is square with the craft stick. I like to use the corner of a table to hold the two pieces of wood at 90 degrees while the hot glue is drying.

Step 3: Attach the Bearings

Next place one bearing flat on its side. Hold the craft stick and dowel so that one end of the dowel is directly over the hole in the bearing. Being careful not to apply any pressure to the craft stick, push down firmly on the other end of the dowel until it is inserted fully into the bearing. 

The end of the dowel should be flush with the surface of the side of the bearing, as shown in the picture below.

Now repeat the process with the other bearing, so that you have one bearing on each side of the dowel. While you insert the second bearing, be careful to press down on the top of the dowel, rather than on the edges of the first bearing, or you might wind up with the dowel inserted too far into the first bearing.

Also be sure that the bearings are mounted at 90 degrees to the dowel. Congratulations, you now have a ‘rolling chassis’ for your SpurtBot.

Step 4: Attach the Motors

The motors need to be positioned carefully. Before you mount your motors, keep the following things in mind.
  • The motor shafts need to be parallel to the rolling surface of the bearings. In other words, the motor shafts should be at 90 degrees to the craft stick and parallel to the dowel.
  • You don’t want too much space between the motor shaft and the bearing, because it will add too much tension to the wheel when the bands are installed.
  • To keep tension roughly equal on both bearings, you want both motors positioned the same distance from the bearings.
  • I generally place the motors directly against the wooden dowel, which sets the distance right for the band tension and keeps the motor shafts parallel to the dowel.
  • The shaft of the right motor should be positioned directly behind the right bearing. The shaft of the left motor should be positioned directly in front of the left bearing.
  • The shaft should overlap both sides of the bearing a little bit, so the tension bands will stay on the wheels.
OK, time to glue the motors on! Don’t sweat the points above too much. If you mess it up, hot glue is easy to remove and you can try again.

Start with the right motor, which will be mounted to the rear of the dowel. Position the motor and get a good feel for where it will go, noting the points above. Once you are ready, place a generous amount of hot glue on the craft stick and the dowel on the side the motor will touch.

CAUTION: Hot glue is, well… HOT. It will stick to your skin and burn you. The end of the hot glue gun is very hot. Don’t touch it, and don’t let it touch anything that can burn.

Pull the hot glue gun away quickly, and place it safely on the table. Working quickly, grab the right motor and place it on the SpurtBot. You will have a few moments as the glue hardens, so check that the shaft is positioned as you want it. Then hold it still for a minute while the glue dries.

After the glue is dry, you can break off the little annoying threads of hot glue that inevitably happen.

If you are happy with the way your right motor was mounted, repeat the procedure with the left motor. Remember that the left motor will be mounted in front of the dowel, with the shaft facing the left side of the robot.

Step 5: Attach the Breadboard

Peel the backing off the adhesive tape on the back of the solderless breadboard, and attach it to the SpurtBot chassis directly in front of the left-front motor.

This should be the side of the craft stick that is longer, as shown in the picture below.

Note that the breadboard should be attached so that the widest side rests against the front motor. Make sure your breadboard is centered on the craft stick, so the weight will be balanced.

Step 6: Attach the Half-Bead

Flip your SpurtBot over and hot glue the half-round bead to the underside of the craft stick at the front (near the breadboard).

Flip your SpurtBot back over so it is top-side up. Be sure that the balance is so that the bot now rests on the half-round bead at the front of the robot.

Step 7: Test the Motors

You need to know which way your motors will turn when you connect power to them. So we are going to test them.

Insert the 9V battery into the battery holder.

Start with the right motor, which is mounted behind the dowel with its shaft behind the right bearing.

Looked at from the right side, the bearing needs to turn clockwise for the SpurtBot to move forward. Since the motor will be attached to the bearing directly using a band, the right wheel motor also needs to turn clockwise.

Temporarily attach the black wire from the battery holder to one lead of the motor and the red lead from the battery holder to the other lead of the motor. Note which way it is spinning when viewed from the right side of the robot.

If it is spinning clockwise, mark the motor lead attached to the red wire with a ‘+’ and the motor lead attached to the black wire with a ‘-’.

If the motor is turning counter-clockwise, then you need to reverse the markings. Mark the motor lead attached to the red wire with a ‘-’, and mark the motor lead attached to the black wire with a ‘+’.


Now test the left motor. Repeat the above procedure, making sure the motor will turn counter-clockwise when viewed from the left side when you attach the battery leads.

Take your time with this step. As they say in carpentry, “Measure twice, cut once.”

Step 8: Connect the Motor Wires

Because we are using a solderless breadboard, it is best to use solid core wire. If you use stranded wire, you will need to twist the ends of the wire and use a soldering iron to ‘tin the leads’.

I like to use red wire for the motor terminals marked with a ‘+’, and black or grey wires for the motor terminals marked with a ‘-’.

Cut two red wires and two black/grey wires, each about 5 ¼ inches long. Carefully strip about 1/8 inch of insulation from one end of each wire.

Solder the red wires to the ‘+’ terminals of each motor, and the black/grey wires to the ‘-’ terminals of each motor.

Then strip about ¼ inch of insulation from the other end of each wire, so they can be inserted into the solderless breadboard when needed.

Step 9: Attach the Battery Holder

Insert the 9V battery into the battery holder and place it on top of the motors with the wires from the battery holder to the rear of the SpurtBot.

The front of the battery holder should be about even with the forward edge of the front motor. You want to be sure the front edge of the battery holder doesn’t interfere with your access to the breadboard. However, don’t set the battery too far back, or it might put too much weight on the back and and cause the front of the SpurtBot to lift. 

Also be sure the battery holder is positioned so that it is centered left to right on either side of the craft stick, to keep the balance even.

Once you are happy with where you plan to place the battery holder, hot glue it to the top of the motors.

Step 10: Cut the Traction Bands

Using a pair of sharp scissors, cut the ridged edge from the neck of the balloon.

Now cut two bands from the end of the neck, a tiny bit wider than the width of the bearings. Try to keep the cuts nice and straight.

You can fit the traction band onto the left bearing and motor shaft now. Start by stretching one band over the bearing on the opposite side from the motor shaft. Extend the band around the motor shaft.

Now carefully rotate the bearing. The band should tend to align itself onto the bearing and motor shaft.

Repeat for the right motor shaft.

Hurray! The chassis of the SpurtBot is done, and it is time to build the circuit!

Step 11: Add the Relay

Take a close look at the markings on the top of the relay. There is line marked on the left side. Insert the relay into the breadboard, with that line on the left side of the SpurtBot.

Note: If you used  a diffeent DPDT relay than the one listed in step 1, you will have to connect it according to the pin diagram in the datasheet for your relay, referring to the circuit diagram in the Intro.


Important: The relay must be placed with one set of pins on one side of the central groove, and one set of pins on the other side. This prevents the relay contacts from shorting out.

You want the relay positioned a bit right of center on the breadboard. There should be five free rows of breadboard contacts to the right of the relay, as shown in the picture below.

Step 12: Wire the Relay

Next, prepare two pieces of wire, each about 2 inches long. Strip about ¼ inch of insulation from each side of each wire.

These wires will cross connect the contacts of the relay.

Pin 1 of the relay is a the top-left. Pin 2 is to its right, and the pin numbers increment as you count along the top and then wrap around the bottom pins.

Start by inserting one end of one wire at pin 4 of the relay. Connect the other side of the same wire to pin 9 of the relay, as shown in the picture below.

Next, connect the second wire to pin 2 of the relay. Connect the other side of the same wire to pin 7 of the relay. As shown in the picture below, the two wires now cross over the top of the relay. 

Step 13: Connect the + Voltage Wires

The circuit will need 9V power at a few points, so lets connect that next.

Prepare a piece of red wire, about 1 ½  inches long. Strip about ¼ inch of insulation from each side of the wire.

Insert one side of the wire at the edge of the breadboard closest to the front motor, and in-line with pin 8 of the relay. Insert the other side of this wire in the bottom-right hole of the breadboard.

Your breadboard should now look like the first picture below.

Prepare a second piece of red wire, about 3 inches long. Strip about ¼ inch of insulation from each side of the wire.

Insert one side of the wire just above the other red wire at the bottom-right of the breadboard. Since each row of five contacts on breadboard are connected internally, these two wires are now electrically connected. Cool, huh?

Now insert the other side of the wire just below the center groove of the breadboard, leaving two empty holes to the left, as shown in the second picture below.

Step 14: Connect the - Voltage Wires

The circuit will also need a ground (0V) connect at a few points.

Start by connecting the black wire from the battery holder. Insert this wire along the top edge of the breadboard, in-line with pin 1 of the relay, as shown in the first picture below.

Prepare a black or grey wire about 1 inch long and strip ¼ inch of insulation from each side. Insert one side of this wire in-line with the ground connection from the battery. Insert the other side of this wire two spaces to the right of the first, leaving one open hole between them. This connects the ground connection to pin 3 of the relay, as shown in the second picture below.

We are now done with jumper wires. All that is left is inserting components and connecting the motors. Let’s go!

Step 15: Insert the Diode

Insert the diode over the relay, between pin 1 and pin 10 of the relay. Refer to relay pinout diagram and picture below.

Important: The black stripe on the diode MUST be at the bottom of the relay, closest to pin 10!

Step 16: Insert the Transistors

Take a look at the two transistors. Notice that each transistor has three pins, and one side of the transistor is flat while the other is rounded.

Take the first transistor and spread the pins out a bit. Holding the transistor with the flat side facing the rear of the SpurtBot, insert the left-most pin into the bottom edge of the breadboard, three holes from the left edge of the breadboard. This will connect it in-line with the longer red jumper wire inserted in a previous step. There should be two empty holes to the left of the left transistor pin.

The center pin of the transistor should also be inserted in the bottom edge of the breadboard, leaving two empty holes between it and the left pin.

The right pin of the transistor should also be inserted in the bottom edge of the breadboard, leaving one empty hole between it and the center pin.

See the first picture below for comparison.

Now take the second transistor and spread out the pins a bit. This transistor will also be inserted with the flat edge towards the rear of the Spurtbot, just like the first one.

Insert the left most pin of the second transistor just above the left most pin of the first transistor, so that they are in the same connected row of holes on the breadboard.

The center pin of the second transistor should be inserted two spaces to the right of the left pin, leaving one open hole between them.

The right most pin of the second transistor should be inserted in the hole just to the right of the center pin of the same transistor. This connects the center pin of the first transistor with the right most pin of the second transistor.

See the second picture below for comparison.

Together, these two transistors for a Darlington array.


Step 17: Insert the Photocell

Insert one pin of the photocell at pin 1 of the relay, just above the diode connection.

Insert the other pin of the photocell just above the center pin of the second transistor (the one more towards the front of the SpurtBot).

Pinch the two leads of the photocell slightly, being very careful not to let them touch each other. Then take a piece of 3/16 inch shrink tubing about ¾ inch to 7/8 inch long, and place it over the photocell.

This will prevent stray light from interfering with the operation of the photocell.

Note: If you find the SpurtBot is not sensitive enough to light during testing, even after adjusting the potentiometer, you can trim the length of the shrink tubing so that the photocell is closer to the opening. You want to keep the photocell lower than the top edge of the tubing. Don't cut it now, wait until testing.

Step 18: Insert the Potentiometer

Examine the potentiometer. Notice that it has three pins, with the center pin offset from the left and right pins.

You will insert the potentiometer with the center pin towards the right side of the SpurtBot.

The center pin should be inserted just below the central groove of the breadboard, in the same row of holes as the pin of the photocell and center pin of the top-most transistor.

The right pin of the potentiometer should be inserted in the same row of holes as the long red wire and the left pins of the two transistors.

Note that the left pin of the potentiometer will sit in the central groove of the breadboard. It is not connected to anything.

For now, adjust the potentiometer so that its indicator is at the top. This is the center position. The potentiometer will be adjusted later if needed for the ambient light conditions.

Step 19: Insert the Motor Wires

Next, connect the motor wires. We are almost done!

In this step, keep in mind that the right motor is the one at the rear of the SpurtBot. It has its shaft facing right, but its wires on are the left side of the SpurtBot.

Also, there will be several connections that mention the relay pins, so below is that picture again for your reference.

Let’s connect the right motor first (meaning the motor that runs the right wheel). Take the ‘-’ connection, which should be a black or grey wire, and insert it in the upper edge of the breadboard, two holes to the right of the black wire from the battery holder. This leaves one empty hole between them. Due to the short jumper wire we inserted earlier, this motor connection is now electrically connected to ground. Refer to the first picture below.

Then, take the ‘+’ red wire from the right motor, and insert it just above the wire connected to pin 4 of the relay. Refer to the second picture below.

Now let’s connect the left motor. Take the ‘-’ connection, which should be a black or grey wire, and insert it just below the wire connected to pin 7 of the relay. Refer to the third picture below.

Lastly, take the ‘+’ connection from the left motor, which should be a red wire, and connect it in the upper edge of the breadboard, in the same row of holes as the ‘+’ connection from the right motor. This connect the ‘+’ terminals of both motors together, and also to pin 4 of the relay.  Refer to the forth picture below

Step 20: Test Your Shadow Runner!

You power up your SpurtBot by inserting the red wire from the battery pack into one of the holes at the lower right corner of the breadboard. This will connect 9V power to your circuit by connecting the battery to the two red wires you inserted earlier.

1) Bring your SpurtBot where there is plenty of light, and power it up. The left wheel should start moving forward immediately. The right may not spin until you adjust the potentiometer for the ambient light conditions. Adjust it if needed. If you can get both wheels running forward in the light you did good. Skip the table below and move on to the next test. Otherwise, check the table below for likely causes and solutions.

ConditionLikely CauseSolution
Both wheels run forwardYou did everything rightEnjoy!
No wheels turnMissing connectionCheck power and ground connections first, then all other connections.
Left wheel doesn’t turnMissing connectionCheck motor connections for left wheel, then other circuit connections.
Right wheel doesn’t turnNeeds more lightAdjust potentiometer or bring to a brighter spot in the room.
If adjusting the potentiometer doesn't work, you can trim the length of the shrink tubing over the photocell, as described in Step 17.
Right wheel turns backwardsReversed motor wiresTry swapping the ‘+’ and ‘-’ wires of the motor.
Left wheel turns backwards, while the right wheel is moving.Reversed motor wiresTry swapping the ‘+’ and ‘-’ wires of the motor.

2) Now cover the photocell with your hand. The right wheel should stop and the left wheel should reverse.

ConditionCauseSolution
Right wheel stops and the left wheel reverses.You did everything rightEnjoy!
Left wheel stops and the right wheel reversesYou did it backwards, so your bot will spin the opposite direction in shadow, but will work just fine. Enjoy!
Both wheels turn forward, even in shadow.Photocell circuit is too sensitive.Adjust the potentiometer
One wheel stops and the other wheel reverses in shadow, but the bot does not return to forward running state when not in shadow.The photocell circuit needs adjusting, or there is not enough ambient lightAdjust the potentiometer or find a brighter spot in the room.
You can also try cutting the shrink tubing a little shorter.


3) Everything working? Go play with your new robot! Otherwise, re-check your steps and try again!

Robot Challenge

Participated in the
Robot Challenge

Education Contest

Participated in the
Education Contest

Wheels Challenge

Participated in the
Wheels Challenge