Home Store Project Ideas Project Guide Ask An Expert Blog Careers Teachers Parents Students
Create Assignment

Build an Obstacle-Avoiding Robot (BlueBot Project #4)

Recommended Project Supplies
Get Your Project Supplies
Get the right supplies — selected and tested to work with this project.
Skip the hassle of searching for supplies. Kit includes supplies hand-picked to deliver the best results for this project.
View Kit
Difficulty
Time Required Average (6-10 days)
Prerequisites You will need to know how to use a breadboard to do this project. See the Science Buddies reference How to Use a Breadboard if you have not used a breadboard before.
Material Availability A kit is available from our partner Home Science Tools.
Cost High ($100 - $150)
Safety Short circuits can get very hot and present a burn hazard. Be careful to avoid short circuits when building your robot. See the Procedure for more information.

Abstract

In the animal kingdom, many different critters use whiskers to help them find their way around in the dark, through murky waters, or even to help them hunt prey. Whiskers can be very useful when the animals cannot rely on sight. Did you know that you can also build a robot that uses "whiskers" to find its way around? This project will show you how to build a simple robot that uses whiskers as "bump sensors" to help the robot detect when it is about to bump into an obstacle, so it can turn around and avoid crashing. Can you design a robot that can drive around on its own without crashing and getting stuck?

Objective

Build a basic obstacle-avoiding robot and improve the design to help it avoid getting stuck.

Credits

Ben Finio, PhD, Science Buddies

Cite This Page

MLA Style

Finio, Ben. "Build an Obstacle-Avoiding Robot (BlueBot Project #4)" Science Buddies. Science Buddies, 16 Oct. 2017. Web. 21 Nov. 2017 <https://www.sciencebuddies.org/science-fair-projects/project-ideas/Robotics_p028/robotics/obstacle-avoiding-robot>

APA Style

Finio, B. (2017, October 16). Build an Obstacle-Avoiding Robot (BlueBot Project #4). Retrieved November 21, 2017 from https://www.sciencebuddies.org/science-fair-projects/project-ideas/Robotics_p028/robotics/obstacle-avoiding-robot

Share your story with Science Buddies!

I did this project I Did This Project! Please log in and let us know how things went.


Last edit date: 2017-10-16

Introduction

Have you ever gotten up to go to the bathroom in the middle of the night and stubbed your toe or hit your shin on a piece of furniture in the dark? It hurts! As humans, we rely heavily on our eyesight to get around. Many other animals are active at night, swimming through murky waters, or crawling into tiny, dark spaces where relying on eyesight is not a good option. Some of them evolved whiskers to help them "feel" their way around in the dark by detecting nearby surfaces, air currents, or even to help them hunt for prey.

What does this have to do with robots, you ask? Engineers want to design robots that are autonomous, meaning they can move around on their own without direct human control. One important part of autonomous operation is avoiding crashing into things. In robotics, this is called obstacle avoidance. Using a camera and a computer to let a robot "see" obstacles with computer vision can be complicated and expensive. One much simpler approach is to use the robotic equivalent of whiskers that stick out from either side of the robot, like the ones shown in Figure 1. These whiskers can be used to detect obstacles and make the robot turn away before it crashes. The video after Figure 1 shows a demonstration of the robot.

Obstacle avoiding robot with lever switches
Figure 1. The obstacle-avoiding robot you will build in this project.

A video demonstration of the obstacle-avoiding robot.

Can you figure out how the robot works, based on watching the video? The robot has two wheels attached to motors (and a third "roller" wheel that keeps it from falling over). The direction in which the wheels spin can be used to steer the robot. Normally, both wheels spin forward, which causes the robot to move forward. However, when a whisker bumps into an obstacle, it causes the wheel on the opposite side of the robot to spin backwards. This makes the robot steer away from the obstacle. Figure 2 illustrates this concept.

steering for an obstacle-avoiding robot
Figure 2. A diagram showing how the obstacle-avoiding robot steers. The blue arrows represent the direction in which the wheels spin. When neither whisker detects an obstacle, both wheels spin forward and the robot drives forward (top image). When the left whisker hits something, the left wheel keeps spinning forward, but the right wheel spins backward, causing the robot to turn right (left image). The opposite is true for the right whisker (right image). If both whiskers hit obstacles, the robot will go in reverse (bottom image).

How do the whiskers make the wheels spin in one direction or the other? This depends on an electrical circuit. A circuit is a path through which electricity can flow. Circuits can be very simple, like a battery that lights up a single lightbulb, or very complicated, like the kind inside your computer. In this robot, a circuit uses electrical signals from the whiskers to control two motors that drive the wheels. Figure 3 shows a flow chart for how the robot works.

block diagram for operation of an obstacle avoiding robot
Figure 3. A flow chart showing how the robot works. Whiskers provide input signals to a circuit that controls motors, which turn wheels and make the robot move.

In this science project, you will follow step-by-step directions to build a basic obstacle-avoiding robot, like the one shown in the video. The robot is able to drive around and automatically avoid some obstacles by turning away from them. However, the robot is not perfect. Sometimes it will get stuck, especially if it drives straight into an obstacle that was directly ahead (so neither whisker detects it). Your goal will be to use the engineering design process to improve your robot and help it avoid getting stuck.

While previous experience with electronics will be helpful in building the robot, it is not required. If you would like to get started building your robot right away, you can move on to the Procedure. For more information about how the robot works and what the different parts of the circuit do, continue reading the rest of the Introduction. For a detailed explanation of the robot's circuit (for advanced students or robotics/electronics hobbyists), including a complete circuit diagram, see the Help section.

Technical Note

The rest of the Introduction contains more details about the electronic components used in the circuit. The following information is provided as a reference, and you do not need to fully understand it in order to do the project. If are ready to just start building the robot, you can move on to the Procedure.

If you would like to read the rest of the Introduction, it will help if you are familiar with basic electronics terms like voltage, current, and resistance. Science Buddies has many beginner and intermediate level electronics projects, an Electronics Primer, and a Electricity, Magnetism, & Electromagnetism Tutorial that can help you learn more about these topics. You can also refer to the Bibliography for more information.

For a complete technical explanation of how the circuit works, including a circuit diagram, see the Help section.

The circuit you will build in this project involves a variety of electronic components. All of the components are combined on a chassis, or plastic base for the robot, which includes wheels. Some of the components, like batteries and switches, you probably use every day (even if you do not notice it). Others, like an H-bridge, might be new to you if you have not done an electronics project before. Table 1 has pictures and descriptions of each component you will use in this project. For a more detailed explanation of what each component does in the circuit, see the Help section.

Item NamePicture Description
Battery pack
4xAA battery holder
This is the power supply for your robot. Battery packs come in all shapes and sizes. The one in this project holds 4 AA batteries.
Breadboard
breadboard picture
A breadboard allows you to quickly and easily connect wires and electronic components in order to build a circuit. The connections are not permanent, so you can easily move things around if you make a mistake.
Switch
SPDT switch
You use switches every day to turn lights and appliances on and off. This is a tiny switch that fits on a breadboard, to let you turn your robot on and off.
Jumper wire
jumper wires
Jumper wires are short wires used to make electrical connections on a breadboard. They come with many colors of plastic insulation, which makes it easy to color-code and organize complicated circuits.
DC Motor
DC motor
Electrical current causes a motor to spin. Two motors drive the robot's wheels. This type of motor runs on direct current (DC) from a battery (as opposed to alternating current [AC] from a wall outlet).
H-bridge
L293D h-bridge motor driver
An H-bridge is a special type of chip designed to allow bi-directional control of a DC motor. This is unlike a MOSFET (used in the other robotics projects listed in the Make It Your Own section), which only allows a motor to spin in one direction.
10 kΩ resistor
resistor
A resistor resists the flow of electrical current. In this project the resistors are used as "pull down" resistors that "pull" the value of a pin on the H-bridge down to 0 V.
Lever switch
SPDT lever switch
Two lever switches act as your robot's bump sensors. Electrically, they work the same as the robot's power switch, but the physical shape is different; they have long levers that act like "whiskers" to detect when the robot bumps into something.
Table 1. Pictures and descriptions of each circuit component used in this project.

Terms and Concepts

General electronics and robotics terms:

  • Whisker
  • Autonomous
  • Obstacle avoidance
  • Circuit
  • Voltage
  • Current
  • Resistance
  • Chassis

Circuit components:

  • Battery pack
  • Breadboard
  • Switch
  • Jumper wire
  • DC motor
  • Male-female jumper wire
  • Bump sensor
  • Digital logic
  • H-bridge
  • Dual in-line package (DIP)

Questions

  • How do animals use whiskers? What advantages do whiskers provide?
  • How are antennae similar to whiskers and how are they different? What types of animals have whiskers, and what types have antennae?
  • What are some different methods robots use for obstacle avoidance?
  • Can you find some real-life examples online of obstacle-avoiding robots?

Bibliography

Check out this reference if you want to learn more about how whiskers work in animals:

These beginner references will be useful if you are just starting out with electronics and robotics:

These references will be useful for students who want to learn more about how the circuit works, and about electronics in general:

These references contain specific information about some of the circuit components and concepts used in this project:

News Feed on This Topic

 
, ,
Note: A computerized matching algorithm suggests the above articles. It's not as smart as you are, and it may occasionally give humorous, ridiculous, or even annoying results! Learn more about the News Feed

Materials and Equipment Product Kit Available

  • BlueBot: 4-in-1 Robotics Kit, available from our partner Home Science Tools. You will need the following components from the kit (the kit also contains additional parts for three other projects). See Table 1 in the Introduction for pictures if you are not sure what a part looks like.
    • Blue plastic robot chassis (includes wheels, motors, and 4xAA battery holder)
    • AA batteries (4)
    • Breadboard
    • Jumper wire kit
    • Power switch
    • L293DN H-bridge motor driver
    • 10 kΩ resistors (4) (brown, black, orange, gold stripes)
    • Lever switches (2)
  • You will also need the following materials, not included in the kit:
    • Double-sided foam tape
    • Scotch® tape or glue
    • Popsicle sticks (2)
    • Scissors
    • Materials to make an "obstacle course" or arena for your robot, like stacks of books or small cardboard boxes. Note that the cardboard boxes will need something heavy inside to weigh them down, or else the robot might just push them around.
    • Optional: Wire cutters (can be used to shorten the metal leads on some parts of your circuit, making the circuit "neater")
    • Optional: Needle-nose pliers or tweezers (make it easier to handle small circuit components)
    • Lab notebook
 Recommended Project Supplies
     Get Your Project Supplies
Get the right supplies — selected and tested to work with this project.
Skip the hassle of searching for supplies. Kit includes supplies hand-picked to deliver the best results for this project.
Project Kit: $109.95
View Kit

Remember Your Display Board Supplies

ArtSkills sparkle letters

Holographic Poster Letters

ArtSkills buy now button
ArtSkills vinyl letters

Vinyl Letters & Numbers

ArtSkills buy now button
ArtSkills supplies trifold

ArtSkills Trifold with Header

ArtSkills buy now button

Share your story with Science Buddies!

I did this project I Did This Project! Please log in and let us know how things went.

Experimental Procedure

Note: This engineering project is best described by the engineering design process, as opposed to the scientific method. You might want to ask your teacher whether it's acceptable to follow the engineering design process for your project before you begin. You can learn more about the engineering design process in the Science Buddies Engineering Design Process Guide.

Assembling Your BlueBot Chassis

  1. Follow the instructions in the video to assemble your robot chassis.
    1. Your kit comes with printed directions for assembling the chassis, but we recommend watching the video so you fully understand how all the parts fit together.
    2. The blue plastic parts come with a thin layer of protective plastic coating. Peel this coating off before assembling your chassis.
    3. We also recommend using double-sided foam tape to attach the battery holder to the top of the chassis, as shown in Figure 4. The printed directions recommend putting the battery holder in-between the two chassis plates, but this makes it harder to change the batteries.
    4. You will have some extra parts when you are done, including screws, nuts, and blue plastic gears. Put these parts aside for now; you will not need them for this project.

assembled bluebot robot chassis
Figure 4. A completed BlueBot chassis with breadboard and battery pack on top.

Assembling Your Circuit

  1. To build your circuit, you will need to know how to use a breadboard. Watch the video and see the Science Buddies reference How to Use a Breadboard.
  1. Now that you know how to use a breadboard, you are ready to assemble your BlueBot circuit. Table 2 shows a list of all the components in the circuit and where they go on the breadboard. You can download and print a PDF of this table—complete with checkboxes to track each step—to use while you are building your robot. You can also view a slideshow that shows breadboard diagrams of the circuit. Follow along in the table and/or slideshow to build your circuit one component at a time. Your finished circuit should look like the one in Figure 5. Pay attention to these notes:
    1. Remember to push all components firmly into the breadboard.
    2. All references to orientation (up, down, left, and right) assume you have the breadboard "right-side up," so the writing is facing you.
    3. Your jumper wire kit comes with an assortment of colors, and the colors may vary. It does not matter what color jumper wires you use. Your colors do not need to match the colors in the diagrams. In general, you should use the shortest wires possible, to help keep your circuit neat.
    4. Your lever switches act as bump sensors, so they need to be mounted on the front of your robot, not on the breadboard. You also need to attach popsicle sticks to the levers to extend the robot's "whiskers." See Figures 6 and 7 for instructions on how to mount the lever switches to your robot's chassis.
    5. Insert the batteries last. If you see or smell smoke when you insert the batteries, you have a short circuit somewhere. Immediately remove the batteries and re-check your wiring.
Component Picture Symbol Breadboard holes Note
Power switch
SPDT switch
switch symbol
F1, F2, F3 The direction in which it is facing does not matter, but make sure to slide the switch down (toward row 30, away from row 1), this is the "off" position.
Jumper wire
jumper wire
jumper wire symbol
J2 to (+) bus Color does not matter.
Jumper wire
jumper wire
jumper wire symbol
Left side (+) bus to right side (+) bus Color does not matter.
Jumper wire jumper wire jumper wire symbol Left side (-) bus to right side (-) bus Color does not matter.
H-bridge motor driver L293D h-bridge motor driver H bridge breadboard symbol Left side: holes E15 to E22

Right side: holes F15 to F22
The semi-circular "notch" in one end of the chip must face up (towards row 15).
You may need to bend the pins together slightly to get them to fit into the breadboard.
Note: the writing on your H-bridge might not match the picture exactly. This is OK.
10 kΩ resistor 10 kilo ohm resistor 10k resistor breadboard symbol J16 to (-) bus Brown, black, orange, gold stripes. Direction does not matter.
10 kΩ resistor 10 kilo ohm resistor 10k resistor breadboard symbol J21 to (-) bus Brown, black, orange, gold stripes. Direction does not matter.
10 kΩ resistor 10 kilo ohm resistor 10k resistor breadboard symbol A16 to (-) bus Brown, black, orange, gold stripes. Direction does not matter.
10 kΩ resistor 10 kilo ohm resistor 10k resistor breadboard symbol A21 to (-) bus Brown, black, orange, gold stripes. Direction does not matter.
Jumper wire
jumper wire
jumper wire symbol
J15 to (+) bus Color does not matter.
Jumper wire
jumper wire
jumper wire symbol
J18 to (-) bus Color does not matter.
Jumper wire
jumper wire
jumper wire symbol
J19 to (-) bus Color does not matter.
Jumper wire
jumper wire
jumper wire symbol
J22 to (+) bus Color does not matter.
Jumper wire
jumper wire
jumper wire symbol
A15 to (+) bus Color does not matter.
Jumper wire
jumper wire
jumper wire symbol
A18 to (-) bus Color does not matter.
Jumper wire
jumper wire
jumper wire symbol
A19 to (-) bus Color does not matter.
Jumper wire
jumper wire
jumper wire symbol
A22 to (+) bus Color does not matter.
Top lever switch SPDT lever switch breadboard diagram symbol for lever switch Red wire to (+) bus
Black wire to B21
White wire to B16
See Figures 6 and 7 for mounting instructions.
Bottom lever switch SPDT lever switch breadboard diagram symbol for lever switch Red wire to (+) bus
Black wire to I21
White wire to I16
See Figures 6 and 7 for mounting instructions.
Top motor DC motor motor symbol Red lead to C17
Black lead to C20
When the robot is driving forward, this is the "right" motor.
Bottom motor DC motor motor symbol Red lead to H17
Black lead to H20
When the robot is driving forward, this is the "left" motor.
Battery holder 4xAA battery holder battery holder symbol Red lead to J1
Black lead to (-) bus
Do not insert batteries until circuit is complete.
AA battery AA battery battery symbol N/A Insert into battery holder. Make sure (+) signs on batteries line up with (+) signs in battery holder.
Table 2. List of circuit components and locations. A printable PDF version is available.

slideshow 1 obstacle avoiding robot circuit slideshow 2 obstacle avoiding robot circuit slideshow 3 obstacle avoiding robot circuit slideshow 4 obstacle avoiding robot circuit slideshow 5 obstacle avoiding robot circuit slideshow 6a obstacle avoiding robot circuit slideshow 7 obstacle avoiding robot circuit slideshow 8 obstacle avoiding robot circuit slideshow 9 obstacle avoiding robot circuit slideshow 11 obstacle avoiding robot circuit slideshow 12 obstacle avoiding robot circuit slideshow 13 obstacle avoiding robot circuit slideshow 14 obstacle avoiding robot circuit slideshow 15 obstacle avoiding robot circuit slideshow 16 obstacle avoiding robot circuit slideshow 17 obstacle avoiding robot circuit slideshow 18 obstacle avoiding robot circuit slideshow 19 obstacle avoiding robot circuit slideshow  20 obstacle avoiding robot circuit slideshow  21 obstacle avoiding robot circuit slideshow  22 obstacle avoiding robot circuit bending and cutting resistor leads
slideshow 0 line tracking holder
Click through the slideshow for step-by-step breadboard diagrams of the circuit.


breadboard circuit for an obstacle avoiding robot
Figure 5. Your completed circuit should look like this.
  1. Use double-sided foam tape to attach the lever switches to the front of your robot, and to attach popsicle sticks to the lever switches, as shown in Figures 6 and 7.
mounting lever switches to an obstacle avoiding robot
Figure 6. Use double-sided foam tape to mount the lever switches to the front of your robot. You can decide exactly where you want to put the switches; for example, whether you attach them to the top or bottom plate of the chassis. Note that you might end up adjusting them later.


attaching popsicle stick 'whiskers' to an obstacle avoiding robot
Figure 7. Use tape to attach popsicle sticks to the metal arms of the lever switches to act as "whiskers."

Testing Your Robot

You are finally ready to start testing your robot! Remember that now you will need to follow the The Engineering Design Process to get your robot working. Follow these steps to learn how to use your robot.

  1. Double-check your circuit against the breadboard diagrams in the previous section. Remember that just one misplaced wire can prevent the circuit from working properly.
  2. Hold the robot's chassis in one hand, so the wheels are off the ground.
    1. Turn the robot's power switch "on" by sliding it up, toward row 1 on the breadboard.
    2. Your robot's wheels should start spinning forward. If you press down on the popsicle stick attached to either lever switch, that should cause the wheel on the opposite side of the robot to spin backward. Check Table 3 to see what you should do next.
Observation What to do
I see or smell smoke. Immediately turn your robot off. You have a short circuit somewhere. Recheck your wiring against the breadboard diagrams in the previous section.
Each wheel spins forward when I turn the robot on, and each wheel goes in reverse when I press the lever switch on the opposite side of the robot. Your robot works! Move on to the next step.
One or both wheels spin backwards when I turn the robot on. If a wheel is spinning backwards, reverse the red and black wires of that motor. See the Help section for more details.
The wheels spin when I turn the robot on, but do not change direction when I press the lever switches. You have an error in your circuit somewhere. Re-check your circuit against the breadboard diagrams in the previous section. Remember that just one misplaced wire can prevent your circuit from working.
Pressing a lever switch causes the wheel on the same side of the robot to switch direction. You have your two motors or your two lever switches' wires reversed. Swap one set of connections, but not both (for example, take the motor wires that are plugged in to the right side of your breadboard and switch them with the motor wires on the left side of your breadboard).
The wheels do not spin at all when I turn the robot on. See the Help section for troubleshooting information.
Table 3. Troubleshooting procedure for the first time you turn on your robot.
  1. Once you have your robot's circuit working, try putting it down on the floor and aiming it toward a wall at about a 45 degree angle. The robot should drive toward the wall, touch the wall with one of its "whiskers," then turn away and keep driving. You can also try putting your hand or foot in front of the robot's whiskers as it drives around, forcing it to turn.
  2. Your robot might not work perfectly; sometimes it might get stuck or fail to turn. This is where the engineering design process really comes into play. Think about what you can do to improve your robot. Here are some suggestions to get you started:
    1. Do the popsicle sticks come loose or fall off? Is the connection between the popsicle sticks and the lever switches sturdy enough?
    2. What happens if you change the position or angle of the lever switches? Is it better for the "whiskers" to be pointing straight out to the side, or angled slightly forward or backward?
    3. What happens if your robot drives straight into an obstacle, without hitting either whisker? Can you think of a way to fix this?
  3. Once you have your robot working, see if you can get it to navigate a more complicated "obstacle course" or maze. Can it automatically bounce off several obstacles and keep driving without getting stuck? Can you let it drive around a room in your house or school and just bounce off the existing furniture and walls? How long can it drive before it gets stuck? What other improvements could you make to help prevent the robot from getting stuck?

Explore More!

Looking for more robot fun? Explore the World of Robotics with This Suite of Projects!

Troubleshooting

For troubleshooting tips, please read our FAQ: Build an Obstacle-Avoiding Robot (BlueBot Project #4).

Communicating Your Results: Start Planning Your Display Board

Create an award-winning display board with tips and design ideas from the experts at ArtSkills.
ArtSkills button poster gallery 350
ArtSkills button design tips 350
ArtSkills button for more tips 210 h

Share your story with Science Buddies!

I did this project I Did This Project! Please log in and let us know how things went.

If you like this project, you might enjoy exploring these related careers:

female robotics engineer adjusting robot

Robotics Engineer

Have you watched "The Transformers" cartoon series or seen the "Transformers" movies? Both shows are about how good and evil robots fight each other and the humans who get in the middle. Many TV shows and movies show robots and humans interacting with each other. While this is, at present, fantasy, in real life robots play a helpful role. Robots do jobs that can be dangerous for humans. For example, some robots defuse landmines in war-stricken countries; others work in harsh environments like the bottom of the ocean and on the planet Mars. At the heart of every robot is a robotics engineer who thinks about what a robot needs to do and works with several engineering disciplines to design and put together the perfect piece of equipment. Read more
robotics technician

Robotics Technician

Robots are no longer futuristic machines. Robots are here and now and are used in manufacturing, health care, service industries, and military applications. They perform tasks that are repetitive and hazardous—things that humans don't want to do or are unsafe to do. But robots are still machines, which means they require humans to build, maintain, program, and keep them functioning efficiently. Robotics technicians work with robotics engineers to build and test robots. They are responsible for installing and maintaining robots and keeping them in working order for their employers. If you are interested in working with robots, your future is here and now. Read more
electrical engineer aligning laser

Electrical & Electronics Engineer

Just as a potter forms clay, or a steel worker molds molten steel, electrical and electronics engineers gather and shape electricity and use it to make products that transmit power or transmit information. Electrical and electronics engineers may specialize in one of the millions of products that make or use electricity, like cell phones, electric motors, microwaves, medical instruments, airline navigation system, or handheld games. Read more
Mechanical engineer building prototype

Mechanical Engineer

Mechanical engineers are part of your everyday life, designing the spoon you used to eat your breakfast, your breakfast's packaging, the flip-top cap on your toothpaste tube, the zipper on your jacket, the car, bike, or bus you took to school, the chair you sat in, the door handle you grasped and the hinges it opened on, and the ballpoint pen you used to take your test. Virtually every object that you see around you has passed through the hands of a mechanical engineer. Consequently, their skills are in demand to design millions of different products in almost every type of industry. Read more


Variations

Explore More!

Looking for more robot fun? Explore the World of Robotics with This Suite of Projects!

Share your story with Science Buddies!

I did this project I Did This Project! Please log in and let us know how things went.

Frequently Asked Questions (FAQ)

If you are having trouble with this project, please read the FAQ below. You may find the answer to your question.
Q: My wheels do not spin at all. What should I do?
A: If your wheels do not spin at all when you turn the robot on, there are several troubleshooting steps you can try:
  • Double-check your circuit to make sure that it exactly matches the breadboard diagrams from the procedure.
  • Make sure all of your jumper wires and component leads are pressed firmly into the breadboard. You can read about other common breadboard mistakes in the the Common Mistakes section of our breadboard tutorial.
  • Make sure your batteries are properly inserted into the battery pack, and that the "+" symbols on the batteries line up with the "+" symbols on the battery pack.
  • Make sure the power switch for your robot is toggled "on" (the slider should be pushed toward the top of the breadboard).
  • If you have been using your robot for a long time, or did some of the other BlueBot projects first, your batteries may be dead. Try putting fresh batteries in your robot if none of the other steps work.
  • If your robot still does not turn on, follow these steps to see if the problem is with your power switch:
    • Remove the power switch from the breadboard, flip it around, and put it back into the same breadboard holes (F1, F2, and F3). If you are confused about which way to rotate the switch, see this video.
    • Slide the power switch to the "on" position ("up" towards row 1 of the breadboard) and try testing your robot again. If your robot works after making this change, you can continue with the project, but please contact us at scibuddy@sciencebuddies.org to let us know this happened.
    • If your robot still does not work after flipping the power switch around, bypass the power switch entirely. Connect the battery pack's red lead directly to the breadboard's power bus instead of hole J1. This connects the battery pack directly to the rest of the circuit. To turn the robot off again, you will have to temporarily disconnect this wire.
    • Now, re-try testing your robot. If your robot works, you can continue with the project, but please contact us at scibuddy@sciencebuddies.org to let us know the switch did not work in either direction.
    • If your robot still does not work, even after you have tried the previous steps, the problem is elsewhere in your circuit and not with the power switch. If you are having trouble figuring out what is wrong with your robot, you can ask a question in our Ask an Expert: Answers to Your Science Questions forums.
Q: Only one of my robot's wheels is spinning. What is wrong?
A: Your robot's circuit consists of two identical halves that drive the two motors. If only one wheel is spinning, chances are you just have something placed incorrectly on the breadboard in one half of the circuit. Very carefully double-check all of your writing on the side of the motor that is not working. It only takes one misplaced component or jumper wire to prevent the motor from spinning!
Q: My robot is going backwards! What should I do?
A: If your robot is driving backwards, all you need to do is switch the breadboard connections of the red and black leads from each motor. This is shown in Figure 8.
obstacle avoiding robot circuit


obstacle avoiding robot circuit with motor leads reversed
Figure 8. If one or both of your robot's wheels spins backwards, switch the red and black wires for that motor. Look closely at the top and bottom images here — notice how the red and black wires for each motor have been switched, while everything else in the circuit remains the same.

If only one wheel rotates backwards, switch the breadboard connections of the red and black leads from the motor powering that wheel only.

Q: I have double-checked everything and my robot still does not work. How can I check if something is broken?
A: If you are having trouble figuring out why your robot will not work, you can try asking a question in our Ask an Expert: Answers to Your Science Questions forums. If you have access to a multimeter, you can also use that to help troubleshoot your circuit. See the Science Buddies reference How to Use a Multimeter if you need help using a multimeter. There are several steps you can take to check individual parts of your circuit (depending on your multimeter's probes, you may need alligator clips and additional jumper wires to take these measurements).
  • Try plugging your motor's leads directly into the buses on your breadboard (for each motor, one lead to the power bus, one lead to the ground bus). If the motors turn on, then you know that they are working, and the problem is elsewhere in your circuit. If the motors do not turn on, that does not necessarily mean they are broken. There might be a problem with your power supply (see next point).
  • Check your breadboard's power supply.
    • Set your multimeter to measure DC volts. Four fresh AA batteries should provide just over 6 V.
    • Turn your power switch on and measure the voltage between the breadboard's buses. If you do not read a voltage, there may a problem with your power switch (see the first question in this FAQ), but you should also double check that your power switch and the red jumper wire from hole J2 to the power bus are in the right place.
    • Unplug the red and black battery pack leads and measure the voltage of the battery pack directly. If you get a reading, then you know your battery pack is working, and the problem is with your breadboard connections or the power switch. If you do not get a reading, make sure all the batteries are in the correct orientation in your battery pack, and that none of the metal clips and springs that hold the batteries in place are loose.
  • Test the pins on the H-bridge. See the How does the circuit work? question for explanations of what the different pins do. Specifically:
    • Pins 1, 8, 9, and 16 should all be at about 6 V when your robot is on. If they are not, then your H-bridge chip may not be properly receiving power. Check your jumper wire conections to the power bus.
    • Pins 4, 5, 12 and 13 should all be at 0 V because they are connected to ground. Make sure you did not accidentally connect them to the power bus instead.
    • Pins 2, 3, 6, and 7 should all toggle between 0 V and 6 V when you press one of the bumper switches. Pins 6 and 7 should always have the opposite value of pins 2 and 3 (e.g. when pins 2 and 3 are at 6 V, pins 6 and 7 should be at 0 V and vice versa). If not, make sure you have the resistors and bumper switches all connected correctly.
    • The same applies to pins 10, 11, 14, and 15 when you press the other bumper switch.
  • If the motors work when you plug their leads directly into the buses, and the voltages on the H-bridge chip appear correct, then you know the individual components in your circuit are functioning so nothing is "broken." Double and triple-check all your breadboard connections. Remember that just one misplaced wire can prevent the whole circuit from working.
Q: How can I make my robot go faster?
A: Your robot's motors use a lot of electrical power. As the batteries drain, they might have trouble powering the L293D and the motors at the same time, which can result in your robot getting stuck easily or failing to turn. To fix this, you can use two different battery packs: one to power the motors, and one to power the rest of the circuit. To add a second battery pack, use the 3xAA battery pack that comes in your BlueBot kit (you will need three more AA batteries, since the kit only comes with four) and follow these steps, as shown in Figure 9:
  1. Remove the jumper wire that goes from hole A22 to the (+) bus.
  2. Move the 4xAA battery pack's red wire to hole A22. Note: This wire now bypasses the breadboard's power switch. To turn the robot "off" completely, you will need to disconnect this wire.
  3. Plug the 3xAA battery pack's red wire into hole J1, and the black wire into the (-) bus. You will need to mount the 3xAA battery pack to the chassis with double-sided tape. You can put it in between the top and bottom chassis plates, or on top of the 4xAA battery pack.

For an explanation of how this works, see the L293D's datasheet and the answer to the next question in this FAQ. Pin 8 on the L293D (labeled VCC2 in the datasheet) is the power source for the motors connected to the chip. Pin 16 (labeled VCC1) is the "logic-level" voltage. These two voltages do not need to be the same. You can actually power the motors with up to 36 V (do not try that in this project — it would destroy your motors!).

extra battery pack for obstacle avoiding robot
Figure 9. Circuit diagram for adding the 3xAA battery pack to your robot. It is essential to remove the jumper wire connecting hole A22 to the (+) bus, or else you will short the two battery packs together.
Q: How does the circuit work? What is the circuit diagram?
A: The circuit diagram for the robot is shown in Figure 10. If you do not know how to read a circuit schematic, see the How to Read a Schematic reference. The circuit depends on the L293D chip, a type of "H-bridge," also referred to as a "motor driver." The chip can control two motors in forward and reverse. Its operation depends on digital logic, which consists of "highs" and "lows" (also referred to as 1 and 0 or on and off). Since the circuit has two symmetric halves, this explanation will just explain one half of it.
  • The L293D has two input pins (2 and 7). These control two output pins (3 and 6), which are connected to the motor. If an input pin is high, its output pin will also be high (about 6 V with four fresh AA batteries). If the input pin is low, its output pin will also be low (0 V). (note: this is a simplified explanation of how the L293D works, specific to this circuit. You can read more details about the L293D in its official datasheet).
  • Both input pins have pull-down resistors, that "pull down" their voltage to 0 V by default. This will be important later on. You can read this tutorial to learn more (note that the tutorial is about pull-up resistors, but the concept is exactly the same for pull-down resistors).
  • In order for the motor to spin, current must flow through it, which means its wires must be at two different voltages. If both wires are at 6 V, or both wires are at 0 V, the motor will not spin at all. However, if one wire is at 6 V and the other wire is at 0 V, current will flow through the motor and it will spin. Reversing the voltages just reverses the direction the motor spins.
  • The lever switch's "common" pin is connected to the positive voltage supply (V+). The other two pins are connected to the input pins (2 and 7) of the L293D. So, at any given time, one of those input pins will be shorted directly to V+, a logical "high." Since the resistance to V+ is much lower than the resistance to ground through the pull-down resistor, this brings the input pin's voltage up to V+. The other input pin remains at 0 V, because it is connected to ground through the pull-down resistor.
  • When the lever switch switches positions, this switches the voltages (V+ and 0 V) on the two input pins, causing the motor to switch directions.
circuit diagram for an obstacle avoiding robot
Figure 10. The circuit diagram for the robot.
Q: What are the circuit diagram symbols for the components in this project?
A: Table 3 shows a picture, a breadboard diagram symbol, and a circuit diagram symbol (when applicable) for each component in the project.

Item namePicture Breadboard Diagram Symbol Circuit Diagram Symbol
Battery pack
4xAA battery holder
battery holder symbol
battery circuit diagram symbol
Breadboard
breadboard picture
breadboard diagram symbol of a breadboard
n/a
Switch
SPDT switch
switch symbol
spdt switch circuit diagram symbol
Jumper wire
jumper wires
jumper wire symbol
jumper wire circuit diagram symbol
DC Motor
DC motor
motor symbol
DC motor breadboard symbol
Male-female jumper wire
male-female jumper wires
jumper wire symbol
jumper wire circuit diagram symbol
H-bridge
L293D h-bridge motor driver
H bridge breadboard symbol
H bridge circuit symbol
10 kΩ resistor
resistor
10k resistor breadboard symbol
resistor circuit symbol
Lever switch
SPDT lever switch
breadboard diagram symbol for lever switch
spdt switch circuit diagram symbol
Table 3. Circuit components used in this project, along with their respective breadboard diagram symbols and circuit diagram symbols.
Q: How did you make the breadboard diagrams for this project?
A: The breadboard diagrams for this project were created using Inkscape, a free vector graphics program. You can find free scalable vector graphic (SVG) files for many circuit components on Wikimedia Commons. There are other free programs specifically for making breadboard diagrams, such as Fritzing.

Ask an Expert

The Ask an Expert Forum is intended to be a place where students can go to find answers to science questions that they have been unable to find using other resources. If you have specific questions about your science fair project or science fair, our team of volunteer scientists can help. Our Experts won't do the work for you, but they will make suggestions, offer guidance, and help you troubleshoot.

Ask an Expert

Contact Us

If you have purchased a kit for this project from Science Buddies, we are pleased to answer any question not addressed by the FAQ above.

In your email, please follow these instructions:
  1. What is your Science Buddies kit order number?
  2. Please describe how you need help as thoroughly as possible:

    Examples

    Good Question I'm trying to do Experimental Procedure step #5, "Scrape the insulation from the wire. . ." How do I know when I've scraped enough?
    Good Question I'm at Experimental Procedure step #7, "Move the magnet back and forth . . ." and the LED is not lighting up.
    Bad Question I don't understand the instructions. Help!
    Good Question I am purchasing my materials. Can I substitute a 1N34 diode for the 1N25 diode called for in the material list?
    Bad Question Can I use a different part?

Contact Us

Related Links

News Feed on This Topic

 
, ,
Note: A computerized matching algorithm suggests the above articles. It's not as smart as you are, and it may occasionally give humorous, ridiculous, or even annoying results! Learn more about the News Feed

Looking for more science fun?

Try one of our science activities for quick, anytime science explorations. The perfect thing to liven up a rainy day, school vacation, or moment of boredom.

Find an Activity