# Build a Light-Tracking Bristlebot

 Difficulty Time Required Average (6-10 days) Prerequisites Previous experience using a breadboard to build a circuit will be helpful, but is not required for this project. If you want to start out with a simpler robotics project, check out the Make It Your Own section. Material Availability A kit containing all the electronics parts needed for this project can be found in the Science Buddies Store. Cost Average ($40 -$80) Safety No issues

## Abstract

Sometimes engineers get ideas to build robots from animals in nature. There are robot dogs, robot snakes, robot birds, robot cheetahs, and even tiny robotic insects! In this science project, you will build a robot insect of your own. The robot will automatically drive toward a light source, mimicking a behavior called phototaxis, seen in some insects. You will build your own robot and then make adjustments so it can reliably drive toward a light.

## Objective

Build a light-following bristlebot and make adjustments so it can accurately follow a light source.

## Credits

Ben Finio, Ph.D., Science Buddies

### MLA Style

Science Buddies Staff. "Build a Light-Tracking Bristlebot" Science Buddies. Science Buddies, 7 May 2015. Web. 6 July 2015 <http://www.sciencebuddies.org/science-fair-projects/project_ideas/Robotics_p012.shtml>

### APA Style

Science Buddies Staff. (2015, May 7). Build a Light-Tracking Bristlebot. Retrieved July 6, 2015 from http://www.sciencebuddies.org/science-fair-projects/project_ideas/Robotics_p012.shtml

## Share your story with Science Buddies!

Last edit date: 2015-05-07

## Introduction

Have you ever seen swarms of insects fluttering around a streetlight at night? What about little bugs that quickly seek out a new hiding spot when you look under a rock? This type of behavior is called phototaxis, which means movement in response to light (animals that move toward light have positive phototaxis, and those that move away from light have negative phototaxis). Although it might not always seem like a smart move to make—such as when a mosquito flies into a glowing, electric bug zapper—moving toward or away from light can be a simple way for an insect to successfully decide where to go most of the time.

Now, you might be thinking, "I thought this was a robotics project, so what do insect behaviors have to do with robots?" It turns out that sometimes, engineers like to design robots modeled after things they see in nature. For example, there are robots that use legs to run like animals and robots that fly by flapping their wings like a bird. Robots that are modeled after animals are called biologically inspired robots (or "bio-inspired" for short). In this project, you will build your own miniature, bio-inspired robot, like the one in Figure 1, below: a robot "bug" that will automatically drive toward a light source, just like some real bugs do! The robot is a type of bristlebot, which gets its name because it uses bristles from a toothbrush as feet.

Figure 1. A light-following bristlebot.

So, how do you get a robot to drive toward a light? The robot will use two light sensors, which are special electronic parts that can detect different amounts of light. They act like the robot's "eyes." The light sensors are connected to an electrical circuit, or collection of electronic components that serve a specific purpose, and acts like the robot's "brain." The circuit in your robot will control two vibrating motors, which is like how an insect's brain controls its muscles. The motors will make the robot vibrate and buzz along, and can also steer the robot left and right. All of this might sound complicated, but do not worry! The Procedure for this project will show you, step-by-step, how to build the robot and assemble the circuit, and you will learn about the different circuit parts as you go along. (For a detailed explanation of how the circuit works, including a circuit diagram, see the Help tab). You can also check out the Science Buddies Electricity, Magnetism, & Electromagnetism Tutorial to learn more about electricity in general.

For this project, you will follow the Engineering Design Process to build and improve your light-tracking bristlebot. Specifically, you will first follow a standard set of directions to build the robot and assemble the circuit. Then, you will make adjustments to the robot to make sure it can accurately follow a flashlight. How well can you make your bug track a beam of light? Get ready to build and test to find out!

## Terms and Concepts

These terms are used in the Introduction:

• Phototaxis
• Biologically inspired
• Bristlebot
• Light sensor
• Circuit
• Motor

These circuit terms are referenced in the Procedure:

• Jumper wires
• Potentiometer
• Resistor
• Switch
• Transistor
• MOSFET
• Photoresistor

These terms are used in the advanced explanation in the Help tab:

• Voltage divider
• Ohm's law
• Terms related to the MOSFET:
• Gate
• Drain
• Source
• Threshold voltage
• Saturation
• N-channel MOSFET
• P-channel MOSFET

### Questions

• What is phototaxis? What are the different kinds of phototaxis?
• What are some examples of different types of biologically inspired robots? Hint: Do an internet search for "biologically inspired robot," or think of an animal and do a search for that type of robot, such as a "cheetah robot")
• What are the main parts of the light-tracking bristlebot, and how are they similar to the parts of an insect?
• How is the light-tracking bristlebot able to steer left and right?

## Bibliography

These references will be useful if you are just starting to learn about circuits and electronics:

## 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

The following materials are available in the Science Buddies Store:

• Advanced Bristlebot Kit (1). You will need the following components from the kit:
• 2xAAA battery holder
• AAA batteries (2)
• Mini vibration motors (2)
• Toggle switch
• 10 kΩ potentiometers (2)
• N-channel MOSFETs (2)
• Photoresistors (2)
• 1/2 inch yellow jumper wires (2)
• 1/2 inch red jumper wire
• 1/2 inch black jumper wire
• 3/4 inch black jumper wires (2)
• 1 inch black jumper wires (2)
• Note: this kit also contains materials to build a Build a Solar-Powered Bristlebot

You will also need the following materials, not included in the kit:

• Identical toothbrushes (2); be sure the longest bristles on the brush are all slanted in the same direction. See Figure 3 in the Procedure for details.
• Scissors or wire cutters
• Double-sided foam tape
• Optional: Craft materials to decorate your robot (such as googly eyes, colorful pipe cleaners, etc.)
• Flashlight
• Smooth surface for testing the robot (the toothbrush bristles will get stuck on rough surfaces)
• Lab notebook

## Order Product Supplies

Project Kit: \$59.95

## 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.
Note Before Beginning: This science fair project requires you to hook up one or more devices in an electrical circuit. Basic help can be found in the Electronics Primer. However, if you do not have experience in putting together electrical circuits you may find it helpful to have someone who can answer questions and help you troubleshoot if your project is not working. A science teacher or parent may be a good resource. If you need to find another mentor, try asking a local electrician, electrical engineer, or person whose hobbies involve building things like model airplanes, trains, or cars. You may also need to work your way up to this project by starting with an electronics project that has a lower level of difficulty.

1. Gather all the materials you will need to build your robot. The parts you will need from your Advanced Bristlebot Kit are shown in Figure 2, below.

Figure 2. The parts you will need from your Advanced Bristlebot Kit.
1. In addition to the parts from the kit, you will also need two identical toothbrushes with slanted bristles. It is very important that the longest bristles are all slanted in the same direction. The longest bristles will reach down and touch the ground, acting as the robot's "feet." If the bristles are all slanted in one direction, when the motors vibrate, they will help push the robot forward. However, if the bristles point straight down, or are slanted in multiple directions, the robot might just spin in circles or go sideways instead of straight. Figure 3, below, shows an example of the type of toothbrush you can use.

Figure 3. An example of the type of toothbrush head that will work well for making your robot. Notice how the longest blue bristles are the only ones that touch the ground when the toothbrush head is standing up, and they are all slanted in the same direction. Even though some green and white bristles are slanted in the opposite direction, this is okay because they do not actually touch the ground. Remember that you need two of the exact same type of toothbrush.
1. Have an adult help you carefully use scissors or wire cutters to cut the heads off both toothbrushes, as shown in Figure 3. If you cannot cut all the way through the neck of the toothbrush, you can cut it as deeply as possible, then bend the head back and forth several times to snap it off.

1. Insert the two AAA batteries into the battery holder, as shown in Figure 4, below. Make sure the "+" symbols on the batteries line up with the "+" symbols inside the battery holder, just like you would when putting batteries into any other device.

Figure 4. Put the batteries in the battery holder.
1. Peel the paper backing off the bottom of the breadboard (the white rectangular piece of plastic with holes in it), as shown in Figure 5, below. This exposes a sticky layer on the bottom of the breadboard.

Figure 5. Peel the backing off the bottom of the breadboard.
1. Firmly press the battery holder onto the double-sided tape so it is centered under the breadboard, as shown in Figure 6, below.
1. The battery holder's long side should be lined up with the breadboard's short side, so the battery holder will stick out a little bit on either end of the breadboard.
2. It is important to make sure the battery holder is perfectly centered so that there is room for you to attach a toothbrush head on either side of the battery holder.

Figure 6. Mount the battery holder to the bottom of the breadboard.
1. Firmly press the smooth part of both toothbrush heads onto the sticky part of the breadboard, one on either side of the battery holder, as shown in Figure 7, below. The longest bristles should slant toward the battery holder's wires, which will be the back end of the robot.

Figure 7. Mount the toothbrushes, brush-side up, next to the battery holder.
1. Flip the robot body over so that the holes of the breadboard are on the top. Attach one motor to the side of the breadboard, as follows (and as shown in Figure 8, below).
1. Cut a small piece of double-sided tape.
2. Firmly press the sticky part of the tape onto the side of the breadboard, above the side of one of the toothbrush heads.
3. Peel the paper backing off the tape.
4. Firmly press the motor onto the sticky tape, as shown in Figure 8.
1. The motor's wires should be pointing forward (the opposite direction of the battery holder's wires).
2. The motor has a small semi-circular weight sticking out of the end opposite its wires. This weight will spin when the motor is turned on. Make sure this weight sticks out past the edge of the tape and the breadboard; this will ensure it does not hit them when it spins.

Figure 8. Attach a motor to one side of the breadboard using double-sided tape, as shown here.
1. Repeat step 5 for the other motor and the other side of the breadboard. Your robot body should now look like Figure 9, below.

Figure 9. Attach the second motor to the other side of the breadboard using double-sided tape.

1. Before you start building your circuit, you need to know a little bit about how breadboards work. Refer to Figure 10, below.
1. Breadboards make it very easy for complete beginners to build circuits because they allow you to temporarily connect wires together. If you make a mistake, want to start over, or want to take your robot apart to do a completely different project, you can just pull the wires out of the breadboard.
2. Breadboards are divided into rows and columns. When you hold the breadboard vertically—as shown in Figure 10—the rows run left to right, and the columns run up and down.
3. The mini breadboard you are using in this project has 17 rows and 10 columns. We will refer to the rows by number (1–17) and the columns by letter (A–J). The breadboard does not have labels printed on it, so you will have to count spaces on the breadboard (for example, column C is the third column from the left).
4. An individual hole on the breadboard can be referred to by its column letter and row number. For example, "hole B3" means the hole in the third row of the second column from the left. The instructions will tell you exactly where to place things on the breadboard, based on hole naming.
5. The holes in each half-row (for example, holes A1, B1, C1, D1, and E1 form a half-row. Holes F1, G1, H1, I1, and J1 form another half-row) are electrically connected to each other inside the breadboard. This allows you to connect two wires together electrically. For example:
1. Hole B3 is electrically connected to hole C3, because they are in the same row on one side of the breadboard. So, if you plug one wire into hole B3, and another wire into hole C3, electricity will be able to flow through one wire and into the next wire.
2. Hole B3 is not electrically connected to hole B4, because they are in different rows. If you plug one wire into hole B3 and one wire into hole B4, electricity would not be able to flow between those two wires.
3. Hole B3 is not electrically connected to hole F3, because although they are in the same row, they are on opposite halves of the breadboard. If you plug one wire into hole B3 and one wire into hole F3, electricity would not be able to flow between those two wires.
6. Orient your robot body so that it is like the one in Figure 10. This will help you to easily refer to the breadboard diagrams while assembling your circuit.

Figure 10. A computer diagram of a blank breadboard is shown on the left, with rows labeled 1–17 and columns labeled A–J. Notice how the physical breadboard, on the right, does not have labels printed on it, so you will have to count spaces. (Note: the battery holder and motors are not shown in the diagram on the left.)
1. You will also need to learn a little bit about jumper wires before you start to build your circuit.
1. Jumper wires are pre-cut short pieces of wire used to connect two different holes on a breadboard.
2. Jumper wires come in different colors, which help you stay organized and keep track of where things go in your circuit. All the wires work the same; they just have different colors of plastic on them.
3. Sometimes a jumper wire might be longer than the distance between the two holes you need to connect. If this happens, you can just bend the wire into an upside-down "U" shape, as shown in Figure 11, below.

Figure 11. Yellow jumper wires. The bottom wire is bent into a "U" shape to make it shorter. If a jumper wire is too long for a connection you need to make, you can always do this to make it shorter.
1. Now you are ready to start assembling your circuit. Refer to Figure 12, below.
1. For this step, you will need two 1/2 inch yellow jumper wires, one 1/2 inch black jumper wire, and one 1/2 inch red jumper wire. 1/2 inch wires are the shortest wires in your kit, so they should be easy to pick out.
2. Use a 1/2 inch yellow jumper wire to connect hole E1 to hole F1.
1. Bend the wire into a "U" shape, like in Figure 11, above.
2. Press the metal ends of the wire into the breadboard holes.
3. Use a 1/2 inch red jumper wire to connect hole E8 to hole F8.
1. Remember that the breadboard rows are not labeled, so you will have to count down to row 8. There should be six empty rows between the yellow wire and the red wire.
4. Use a 1/2 inch black jumper wire to connect hole E11 to hole F11.
1. Remember that the breadboard rows are not labeled, so you will have to count down to row 11. There should be two empty rows between the red wire and the black wire.
5. Use a 1/2 inch yellow jumper wire to connect hole E15 to hole F15.
1. Remember that the breadboard rows are not labeled, so you will have to count down to row 15. There should be three empty rows between the black wire and this last yellow wire.
6. Note: The spacing between the wires is important! If you are off by just one row, that will prevent your circuit from working. Take the time to double-check and count the rows to make sure your wires are in the right place.

Figure 12. Connect four jumper wires to the breadboard, as shown here. New connections for this step are highlighted with green squares.
1. Next you will use potentiometers. A potentiometer is a special type of resistor, which resists the flow of electricity.
1. If you have ever used a light with a dimmer switch (a knob you can turn or slider you can slide to adjust a light's brightness), you have used a potentiometer! For more detailed information about what the potentiometer does in your robot's circuit, see the Help tab.
2. Potentiometers actually come in all shapes and sizes. The potentiometer you will use in your circuit is a blue square with three metal pins sticking out of the bottom and a white knob sticking out of the top, like the one shown in Figure 13, below.

Figure 13. This is the type of potentiometer you will use in your circuit. (image credit Jameco Electronics)
1. Connect the two potentiometers to your circuit, as shown in Figure 14, below.
1. Press one potentiometer's pins into holes H1, H2, and H3. The blue body of this potentiometer should sit in the upper-right corner of the breadboard.
2. Press the other potentiometer's pins into holes H15, H16, and H17. The blue body of this second potentiometer should sit in the lower-right corner of the breadboard.

Figure 14. Connect the potentiometers, as shown here and described in step 5.
1. Next you will connect two more jumper wires, as shown in Figure 15, below.
1. Use a 1 inch black jumper wire to connect hole F2 to hole G11.
1. The 1 inch black wires should be the longest black wires in your kit.
2. Important: Bend the wire into an "L" shape (when viewed from above, like in Figure 15), so it does not block the rest of column G. You will need to put another part in that column later.
2. Use a 3/4 inch black jumper wire to connect hole H11 to hole F16.
1. The 3/4 inch black wires are the "medium" black wires in your kit.
3. Note: Remember, it is important to put the jumper wires into the right holes! Double-check the locations of your wires before you continue.
1. One end of each wire should be one row below one of the yellow wires.
2. The other ends of both wires should be in the same row as the right end of the shorter black jumper wire from step 3.

Figure 15. Connect the black jumper wires as shown here and described in step 6. New connections are highlighted in green.
1. Next, connect the wires from the battery holder, as shown in Figure 16, below.
1. Plug the battery holder's red wire into hole J7.
2. Plug the battery holder's black wire into hole J11.
3. Important: if at any point after this step, you notice that part of your circuit feels hot, or you see smoke coming from the breadboard, immediately disconnect the battery holder wires. This means you have a short circuit somewhere and have an improper connection. Disconnecting the battery holder's wires removes electrical power from your circuit, and gives you a chance to double-check your wiring.

Figure 16. Connect the battery holder's wires to the breadboard, as shown here and described in step 7.
1. Connect the red wires from the motors, as shown in Figure 17, below.
1. Connect the top motor's red wire to hole J8.
2. Connect the bottom motor's red wire to hole I8.
3. Note: Remember, it is always important to make sure you put the wires in the right holes. Both motor's red wires should be in the same row as the red jumper wire from step 3. Double-check your wires before you continue.

Figure 17. Connect the red wires from the motors to the breadboard, as shown here and described in step 8.
1. Next you will connect a switch. Switches come in all shapes and sizes. You probably use them to turn things on and off every day. The switch you will use in this project has a black plastic body with three metal pins sticking out of the bottom, like the one shown in Figure 18, below.

Figure 18. The switch you will use to turn your robot on and off. (image credit Jameco Electronics)
1. Connect the switch to the breadboard, as shown in Figure 19, below.
1. Firmly press the switch's metal pins into holes G7, G8, and G9.
2. Important: The switch's plastic body is slightly bulky. Even though it only has three pins, it will actually take up about five rows on the breadboard, and overlap a bit with the adjacent columns (F and H). So, it is very important to make sure that you insert the pins into the proper holes. It is easier to see the pins if you look at the breadboard from the side.
3. The switch can slide back and forth between two positions. Later you will use it to turn your robot on and off. For now, slide the switch "down" (toward row 17 of the breadboard). This will prevent your robot from accidentally turning on while you are still building the circuit.

Figure 19. Connect the power switch to the breadboard, as shown here and described in step 10.
1. Connect the motors' blue wires to the breadboard, as shown in Figure 20, below.
1. Connect the bottom motor's blue wire to hole E2.
2. Connect the top motor's blue wire to hole E16.
3. As always, it is important to put the wires into the right holes. The motors' blue wires should each be one row below the yellow jumper wires you placed in step 3.

Figure 20. Connect the motors' blue wires, as shown here. Note that each motor's blue wire is connected to the opposite end of the breadboard.
1. Next you will use transistors. Transistors are a special type of electronically controlled switch that can be used to turn things on and off.
1. The transistors in this circuit are a special type of transistor called a MOSFET (pronounced "moss-fet"). They are used to control the speed of the vibrating motors. For a more detailed explanation of what MOSFETs are and what they do in the circuit, see the Help tab.
2. Transistors also come in different shapes and sizes. The ones you will use in this project have a black plastic body with three long metal legs sticking out of the bottom, and a big metal tab on one side, like the one in Figure 21, below.

Figure 21. This is the type of transistor you will use in this project. (image credit SparkFun Electronics)
1. Connect the transistors to the breadboard, as shown in Figure 22, below.
1. Orient a transistor so the writing on the front is facing to your left, and the large silver tab is facing to your right.
2. Press the transistor's pins into holes D1, D2, and D3.
3. Orient the second transistor in the same way, so the writing faces to the left and the metal tab faces to the right.
4. Press the second transistor's pins into holes D15, D16, and D17.

Figure 22. Connect the transistors to the breadboard, as shown here and described in step 13.
1. Connect two black jumper wires, as shown in Figure 23, below.
1. Use a 1 inch black jumper wire to connect hole C3 to hole C11.
2. Use a 3/4 inch black jumper wire to connect hole D11 to hole C17.

Figure 23. Connect two black jumper wires, as shown here and described in step 14.
1. Next you will connect the photoresistors. Photoresistors are a special type of resistor that are sensitive to light. They are also called light-dependent resistors (LDRs) or photocells. They act as the light sensors in your circuit.
1. For a more detailed explanation of what the photoresistors do in the circuit, see the Help tab.
2. The photoresistor you will use in this project is a small round piece with two long, skinny metal legs sticking out of it, like the one shown in Figure 24, below.

Figure 24. This is the type of photoresistor you will use in this project. (image credit SparkFun Electronics)
1. Connect the photoresistors to your circuit, as shown in Figure 25, below.
1. Plug the first photoresistor's leads into holes A1 and A8.
2. Plug the second photoresistor's leads into holes B8 and A15.

Figure 25. Connect the photoresistors, as shown here and described in step 16.
1. Your robot is now ready for testing! Optional: You can decorate your robot if you would like. Decorate your robot by adding googly eyes, pipe cleaners, or other arts and crafts materials. Note: Be careful not to damage your circuit; for example, do not get glue in or stick a pipe cleaner end into any of the breadboard holes.

Follow these steps to make sure your robot works. Do not worry if it does not work on the first try; you may have just made a simple mistake connecting your circuit. Luckily, because you used a breadboard, you will be able to make changes easily.

1. Turn both potentiometers all the way counterclockwise. This will turn the sensitivity of your light sensors all the way down.
2. Turn the robot's power switch "on" by sliding it up toward row 1 of the breadboard.
3. Hold your robot near a bright light source, like an open window (if it is sunny out) or under a lamp.
4. Gradually turn one of the potentiometers clockwise.
1. If your circuit is working, eventually you should feel the robot start to vibrate as one of the motors spins.
2. If you feel the robot vibrate, turn the potentiometer all the way back "down" (counterclockwise). You now know that one of your motors works.
3. If you turn the potentiometer clockwise as far as it will go, and the motor never starts spinning, see the Help tab for troubleshooting information.
5. Repeat step 4 for the other potentiometer.
6. Now, turn both potentiometers "up" (clockwise) until both motors just start spinning, and put the robot down on a flat surface.
1. Your robot should move forward! It might not go in a perfectly straight line; this is okay.
2. If your robot does not move forward at all—meaning it goes sideways or even backwards—see the Help tab for troubleshooting information.

1. Now that you have a working robot, you are ready to use the engineering design process to improve its performance. Your goal is to make the robot able to accurately follow a flashlight beam. To accomplish this, there are two different things you need to adjust, which are described in steps 2 and 3, below.
2. First, carefully turn and adjust the potentiometers so the robot responds to direct light from a flashlight, but not ambient (surrounding) light in the room.
1. The potentiometers control the sensitivity of your robot's light sensors. When they are turned all the way "down," the sensors will not respond even to very bright light. When they are turned all the way "up," the robot may still respond to low light levels.
2. You need to adjust the potentiometers so the robot does not move when it is just sitting on a flat surface in a room with ambient lighting (ceiling lights, lamps, open windows, etc.). Otherwise, the robot will always respond to those lights, and it will be difficult to steer with a flashlight.
3. However, you need to make sure the sensors' sensitivity is high enough that the robot will still respond to a flashlight beam. If you turn the potentiometers down too low, then the robot will not respond to any light, even from a flashlight.
4. Spend some time adjusting your potentiometers to find the middle ground.
1. Set your robot down on a flat surface in a room with normal ambient lighting (for example, on your kitchen table). Make sure the power switch is turned "on" (pressed up toward row 1 on the breadboard).
2. If the robot moves on its own, turn the potentiometers down until it stops.
3. Aim your flashlight at the robot's light sensors. If the robot does not move when the light is aimed at the sensors, turn the potentiometers back up slightly and try the flashlight again.
4. Repeat this process until the robot only moves in response to your flashlight, but not to ambient lighting in the room. (Repeating a process like this is called iteration and is an important part of the engineering design process.)
5. Once the robot is working (meaning, it moves when you aim a flashlight at the sensors, but does not move when it is just sitting on a table), think about the process you used. Does the robot work better now than when you started? How many different tries did it take you to get it "just right"? Engineers very rarely get things right on the first try, so it is okay if you had to try more than once!
3. Second, adjust the aim of the light sensors.
1. The photoresistors are attached to long, flexible wires, kind of like antennae on a real insect. You can carefully bend these wires to adjust which way the photoresistors are pointing, which will change how easy it is to steer the robot with your flashlight.
2. When you first built your circuit, the photoresistors were probably standing straight up (see Figure 26, below). However, you can bend the photoresistors' wires to adjust their aim. For example, you can:
1. Put them right next to each other, facing forward.
2. Space them apart slightly, facing forward.
3. Space them apart and face them diagonally outward.
3. Try adjusting the photoresistors to the best position so you can steer the robot with your flashlight.
1. Put your robot down on a flat surface and aim the flashlight at the photoresistors (not at the ground in front of the robot, or at the robot's googly eyes, if it has them).
2. Try to make the robot go straight by shining the flashlight onto both photoresistors at the same time.
3. Try to steer the robot left and right by aiming the flashlight at just one photoresistor at a time.
4. If it is difficult to steer the robot or to make it go straight, adjust the photoresistors and try again. Repeat this process until you think you have the best configuration for steering your robot.
5. Once you are able to reliably steer your robot (meaning, you can make it turn left, right, and go straight), think about the process you used. Is the robot easier to steer now than when you started out? How many times did you have to adjust the light sensors and try again? Remember, iteration is an important part of the engineering design process; it is okay to get it wrong the first time!
4. If you have trouble reliably getting your robot to steer left and right, see the Help tab for troubleshooting information.

Figure 26. Different possible orientations for the robot's light sensors.
1. Enjoy playing with your robot! You could try setting up an obstacle course for your robot and guiding it through with a flashlight; or have a friend build a second robot and race them against each other.
2. When you are done using your robot, slide the power switch back to the "off" position (towards row 17 on the breadboard).

### Explore More!

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

## Variations

• If you think this robotics project is too complicated and want to start out with something easier, check out these lower-difficulty Science Buddies robotics projects:
• Your Advanced Bristlebot Kit also contains parts to make a Build a Solar-Powered Bristlebot. Can you figure out how to combine the two circuits to make a solar-powered, light-following bristlebot?
• The robot in this project is set up to drive toward light (positive phototaxis). Can you change the robot so it moves away from light (negative phototaxis)?
• Can you build a line-following bristlebot that automatically follows a dark line on the floor? See the Science Buddies project Build a Self-Driving Robot that Can Automatically Follow a Line for a circuit design that will allow a robot to automatically follow a line. The circuit is designed for a larger robot with a bigger breadboard (and a 4xAA battery pack instead of a 2xAAA battery pack), so you will need to make some changes to make it fit on your robot.
• If you want to build a bigger, faster light-following robot, check out the Science Buddies project Improve on the Design of a Light-Following Robot.
• Do a more quantitative science experiment by measuring the resistance of the potentiometers at different settings and how this affects the robot's speed. If you need help using a multimeter to measure resistance, see the Science Buddies Multimeter Tutorial.

### Explore More!

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

## Share your story with Science Buddies!

Q: Why is my motor not spinning at all?
A: If your motors do not spin at all when you turn the power switch on and adjust the potentiometers (step 4 in the "Testing Your Robot" section of the Procedure), the most likely cause is simply a misplaced wire. Just one wire pressed into the wrong breadboard hole can prevent the entire circuit from working. Here are the steps you can try:
• Double- and triple-check your robot's wiring against the breadboard diagrams provided in the Procedure. Remember that you need to accurately count rows and columns since your breadboard does not have labels printed on it.
• Make sure all the wires are pressed firmly into the breadboard's holes. You should be able to turn your robot upside-down, and even shake it, without anything falling out. A single loose connection can prevent the robot from working.
• Make sure you properly inserted the batteries into the battery holder. The "+" symbols on the batteries should line up with the "+" symbols inside the battery holder.
• Make sure you are holding the robot in a well-lit room or near a bright source of light, like an open window or a lamp.
Q: Why does my robot not drive forward at all?
A: If your robot curves slightly off to one side when you put it down for the first time (step 6 in the "Testing Your Robot" section of the Procedure), this is normal and nothing to worry about. If your robot goes backwards, sideways, or curves very sharply to one side, the problem is most likely your toothbrushes. Here are some things you can check:
• Make absolutely sure you are using toothbrushes with the longest bristles slanted in one direction, as shown in Figure 3 of the procedure. If you use toothbrushes with straight bristles, or toothbrushes with bristles slanted in both directions, the robot will probably not drive forward.
• Make sure you are using two identical toothbrush heads. Even small differences between different types of toothbrush can affect the robot's steering.
• Make sure the toothbrush heads are mounted straight and parallel to each other, as shown in Figure 7 of the Procedure. If one or both of the toothbrushes are mounted crooked, this could prevent the robot from going straight.
Q: Why does my robot only turn in one direction?
A: If your robot only turns in one direction, the problem could be that only one-half of your circuit is wired correctly. Try the following:
• When viewing the robot from behind, turn the left potentiometer all the way down (counterclockwise) and the right potentiometer all the way up (clockwise).
• Put the robot down on a flat surface in a well-lit area. It should turn to the right (drive in clockwise circles).
• Now, reverse the potentiometers. Turn the left potentiometer all the way up (clockwise), and the right potentiometer all the way down (counterclockwise).
• Put the robot down again. It should turn to the left (drive in counterclockwise circles).

If your robot only turns in one direction, and does not turn in the other direction at all, then there is probably a mistake in your wiring for one half of your circuit. Double-check the diagrams in the Procedure to make sure your robot matches them. If the robot turns more sharply in one direction than the other when you do this, the problem is probably that one or both of your toothbrushes are mounted crookedly. This can cause the robot to veer off to one side. Make sure your toothbrush heads are mounted straight and parallel to each other, as shown in Figure 7 of the Procedure.

Q: Why can I not get my robot to go straight when using the flashlight?
A: Remember that in order to get the robot to drive straight, you need both motors to vibrate at the same time, which means you need to shine your flashlight beam on both photoresistors. If the photoresistors are spaced too far apart or angled sharply away from each other, it might be impossible to hit both of them at once with the flashlight. Try moving the photoresistors closer together or pointing them more forward instead of outward.
Q: Why can I not get my robot to turn left and right when using the flashlight?
A: Remember that in order to get the robot to turn, you need just one motor to vibrate, which means you only need to hit one photoresistor with your flashlight beam. If your photoresistors are too close together and facing in the same direction, it might be impossible to hit just one of them without also hitting the other. Try spacing your photoresistors farther apart or angling them away from each other more.
Q: How does the light sensor work?
A: Note: To understand this answer and some of the following answers about how the circuit works, it will help if you are familiar with voltage, resistance, and current. See the references in the Bibliography to learn more about these topics.

In order to make a light sensor, the photoresistor and potentiometer are combined to make a voltage divider. A voltage divider is a simple circuit made from two resistors, R1 and R2 (Figure 27, below). It takes an input voltage (Vin) and outputs a different voltage (Vout), according to Equation 1 (which can be derived based on Ohm's law—see the Bibliography):

Equation 1:

• Vin is the input voltage in volts (V).
• Vout is the output voltage in volts (V).
• R1 is the first resistance in ohms (Ω).
• R2 is the second resistance in ohms (Ω).

Figure 17. Circuit diagram for a voltage divider.

In your circuit, the photoresistor will be R1 and the potentiometer will be R2. Remember that the resistance of a photoresistor decreases when it is exposed to bright light. From Equation 1, we can see that when R1 is very large (R1 >> R2), Vout gets very small (Vout << Vin). When R1 is very small (R1 << R2), Vout is roughly equal to Vin (Vout ≅ Vin). This means that the light sensor outputs a high voltage when it detects light, and a low voltage when it does not.

Q: How does a MOSFET work?
A: MOSFET stands for metal-oxide-semiconductor field-effect transistor (so you can see why it is a lot easier just to say "MOSFET"). The three pins of a field-effect transistor are called the gate, drain, and source. Unlike a bipolar transistor, which is controlled by a small current applied to the base pin, a field-effect transistor is controlled by a voltage applied to the gate pin, but the gate does not actually draw any current. A voltage applied to the gate causes current to flow between the drain and source pins.

Figure 28, below, shows a simplified explanation of how a MOSFET works. A voltage is applied to the gate pin in order to control the flow of current between the drain and source pins. When the voltage between the gate and source pins (VGS) is below a certain limit, called the threshold voltage (Vth), no current flows. When VGS exceeds Vth, the MOSFET begins to conduct, allowing current to pass through. This is what allows you to use the gate voltage of a MOSFET to turn a DC motor on and off. For this robot, the MOSFET's gate voltage is controlled by the voltage divider.

Figure 28. Simplified explanation of a MOSFET's operation.

The exact description of how a MOSFET works is more complicated than this. As VGS increases past Vth, the current through the MOSFET will continue to increase. Eventually the MOSFET will reach saturation, where no additional current can flow, even if VGS continues to increase. The MOSFET's behavior will also depend on the type of load to which it is attached. The MOSFET used in this project is an N-channel MOSFET, which requires a positive gate voltage to turn on. A P-channel MOSFET requires a negative gate voltage to turn on. Advanced users can refer to the Bibliography for more information on MOSFETs.

Q: How does the circuit work? What is the circuit diagram?
A: The two questions above explain two key components of the circuit: voltage dividers and MOSFETs. How do you combine these, along with all the other components listed in the procedure, into a single circuit that can control two motors to allow a robot to steer left and right in response to light? Figure 29, below, shows the complete circuit diagram for the entire robot (refer to the reference "How to Read a Schematic" in the Bibliography if you are not familiar with circuit diagrams). Look closely and you will see that it is actually two copies of the same circuit, one for each motor.

Figure 29. A complete circuit diagram for the light-following robot.

The circuit diagram might look confusing at first, but it just consists of things you have already read about. Let us just look at the left-hand side of the circuit (the same explanation applies to the right-hand side):

• The battery pack supplies a voltage Vbatt to the circuit. For this project, you will use two AAA batteries, which provide about 3 V.
• The switch controls whether or not the battery pack's positive terminal is connected to the circuit. When the switch is open, V1 is "floating" (not connected to anything), so the circuit has no power. When the switch is closed, V1 is equal to the battery voltage.
• The photoresistor (R1) and potentiometer (R2) form a voltage divider. The input to this voltage divider is V1, and the output is V2.
• The potentiometer can be used to tune the voltage divider's output (can you figure this out by examining how Equation 1, above, depends on R2?). This allows you to adjust the robot's sensitivity to ambient light levels.
• The output of the voltage divider is connected the input (the gate) of the MOSFET. The source of the MOSFET is connected to ground (0 V). So, for this circuit, VGS = V2. When V2 exceeds the threshold voltage Vth, the MOSFET will turn "on."
• The motor is connected between the positive voltage supply and the MOSFET's drain pin. When the MOSFET is "off," the drain pin's voltage is close to the battery voltage, so no current can flow through the motor. When the MOSFET is "on," the drain pin's voltage drops, allowing current to flow through the motor, into the MOSFET's drain pin, then out of its source pin to ground.
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.

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.

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.

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?

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

### 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

### 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

### 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

### Biologist

Life is all around you in beauty, abundance, and complexity. Biologists are the scientists who study life in all its forms and try to understand fundamental life processes, and how life relates to its environment. They answer basic questions, like how do fireflies create light? Why do grunion fish lay their eggs based on the moon and tides? What genes control deafness? Why don't cancer cells die? How do plants respond to ultraviolet light? Beyond basic research, biologists might also apply their research and create new biotechnology. There are endless discoveries waiting to be found in the field of biology! Read more

## 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.