Jump to main content

Build a Light-Tracking Bristlebot


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.


Areas of Science
Time Required
Very Short (≤ 1 day)
Material Availability
All the electronics parts needed for this project can be found in a kit from our partner Home Science Tools.
Average ($40 - $80)
No issues

Ben Finio, PhD, Science Buddies

Recommended Project Supplies

Get the right supplies — selected and tested to work with this project.

View Kit


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


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 based on 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: 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.

Photo of a light-following bristlebot
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 are sensitive to light. 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 section). You can also check out the Science Buddies Electricity, Magnetism, & Electromagnetism Tutorial to learn more about electricity in general.

Terms and Concepts

These terms are used in the Introduction:

These circuit terms are referenced in the Procedure:

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



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

These references will be helpful for advanced students who want to learn more about circuits, including the specific circuit concepts used in this project:

Materials and Equipment Buy Kit

Disclaimer: Science Buddies participates in affiliate programs with Home Science Tools, Amazon.com, Carolina Biological, and Jameco Electronics. Proceeds from the affiliate programs help support Science Buddies, a 501(c)(3) public charity, and keep our resources free for everyone. Our top priority is student learning. If you have any comments (positive or negative) related to purchases you've made for science projects from recommendations on our site, please let us know. Write to us at scibuddy@sciencebuddies.org.

Experimental Procedure

Assembling Your Robot's Body

Follow the steps in this slideshow to build your robot's body. Make sure you read the captions below each image for important notes about each step. You can also watch a video that shows how to assemble the robot.

Slideshow Images

1. Cut the heads off two toothbrushes with slanted bristles.

2. Do not use toothbrushes with straight bristles for this project, or your robot will not work.

3. Peel the paper backing off the bottom of the breadboard to expose the sticky tape.

4. Mount the battery holder to the sticky tape, as shown. Make sure it is centered on the breadboard.

5. Insert the AAA batteries into the battery holder. Press the flat ends of the batteries up against the metal springs.

6. Attach the two toothbrush heads on either side of the battery holder. Make sure to mount them symmetrically.

7. Attach the two vibration motors to the sides of the breadboard using double-sided foam tape. Make sure the small weights on the motors can spin freely and not get stuck.

End of Slideshow Images

Assembling Your Robot's Circuit

If you have never used a breadboard before, you should refer to the Science Buddies resource How to Use a Breadboard for Electronics and Circuits before you continue.

Build the circuit on your robot's breadboard by following along with the slideshow. Make sure you read the captions below each image for important notes about each step. You can also skip to this part of the video to see the circuit assembly steps.

Slideshow Images

1. Identify these parts in your bristlebot kit.

2. Orient your robot's body so the battery pack wires are facing to your right.

3. Some of the jumper wires in your kit might be longer than necessary. Bend them into U-shapes, as needed, to fit them into the breadboard.

4. Your breadboard does not have row and column labels printed on it. The diagram has labels for reference, but you will need to count the holes on your breadboard.

5. Connect the short yellow jumper wire from E1 to F1.

6. Connect the short red jumper wire from E8 to F8.

7. Connect the short black jumper wire from E11 to F11.

8. Connect the short yellow jumper wire from E15 to F15.

9. Connect the long black jumper wire from F2 to G11. Bend this wire slightly to the right to make room for the power switch later.

10. Connect the medium black jumper wire from H11 to F16.

11. Connect the long black jumper wire from C3 to C11.

12. Connect the medium black jumper wire from D11 to C17.

13. Insert a potentiometer's pins into H1, H2, and H3.

14. Insert a potentiometer's pins into H15, H16, and H17.

15. Insert the MOSFET's pins into D1, D2, and D3. The text on the MOSFET must face to your left; the large metal tab must face to your right.

16. Insert the MOSFET's pins into D15, D16, and D17. The text on the MOSFET must face to your left; the large metal tab must face to your right.

17. Insert the photoresistor's leads into A1 and A8. Direction does not matter.

18. Insert the photoresistor's leads into B8 and A15. Direction does not matter.

19. Insert the power switch's pins into G7, G8, and G9. Direction of switch does not matter. Slide the switch down toward row 17 of the breadboard (this is the 'off' position).

20. Connect the top motor's red lead to J8 and the blue lead to E16.

21. Connect the bottom motor's red lead to I8 and the blue lead to E2.

22. Connect the battery pack's red lead to J7 and the black lead to J11.

End of Slideshow Images

Testing Your Robot

To learn how to use your robot, you can watch this video, or follow the steps below. If you run into trouble and your robot does not work as described, the video also includes troubleshooting information, and you can check out the FAQ section of this project.

  1. Make sure you slide your robot's power switch down toward row 17 when holding the robot, as shown in the circuit assembly slideshow. This is the "off" position.
  2. Bend the photoresistors' leads so they face up, outward, and slightly away from each other. The photoresistors sense light and help your robot steer left and right. If they are directly next to each other, they will have trouble sensing different amounts of light.
  3. Turn the white knobs on both of your potentiometers all the way counter-clockwise.
  4. Turn the robot on by sliding the power switch up.
  5. Slowly start turning one of the potentiometers clockwise. You should eventually see one of the motors start to spin, and feel and hear the robot vibrate. Make sure your hands are not blocking light to the photoresistors when you do this.
  6. Turn the potentiometer back down until the robot just stops vibrating.
  7. Repeat steps 5–6 with the other potentiometer.
  8. You have just set the robot's sensitivity to light slightly below the ambient light levels in the room (for more details on how this works, see this question in the FAQ). That means that the motors will only spin if they are exposed to brighter light. You can test this by holding the robot directly up to a lamp.
  9. Now, if you aim a flashlight directly at the robot's photoresistors (not at the ground in front of the robot), it should move, and you should be able to steer it left and right by aiming at only one photoresistor at a time.
  10. Practice steering your robot around with a flashlight. It might not work perfectly at first, and may require some tinkering on your part. If your robot has trouble steering:
    1. Try adjusting the aim of the photoresistors. Make sure they are not too close together or it will be difficult to make the robot steer left and right; or too far apart or it will be difficult to make the robot go straight.
    2. Try adjusting the potentiometers to change the robot's sensitivity to light.
    3. If your robot has severe steering problems (for example, it will only turn sharply to one side), make sure the toothbrushes are mounted symmetrically.
    4. If your robot does not work at all (does not respond to changes in light, or moves all the time regardless of light), there is probably something wrong with your circuit. See the FAQ section for help.
  11. Slide the power switch back to the "off" position to save battery power when you are not using your robot.

Using Your Robot in a Science Fair Project

If you want to enter your robot in a science fair, just building it might not be enough. How could you use your robot to do an experiment? Here are a few ideas:

  • Build a maze or obstacle course for your robot and challenge people to guide the robot through it using a flashlight. Is there a learning curve to operating the robot? Do people complete the maze faster on subsequent runs?
  • Measure how fast the robot moves when exposed to different intensities of light.
  • Measure how fast the robot moves on different surfaces.
  • Measure how fast the robot moves or how easy it is to steer with different types of toothbrushes for feet. Be very careful when peeling toothbrush heads off the bottom of the breadboard, as this can ruin the sticky tape if you do it too quickly.
  • If you have access to a multimeter, use it to measure the resistance of the potentiometers. How do they affect the robot's speed when exposed to a constant source of light? How does the threshold at which the motors start spinning change?

Explore More!

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


For troubleshooting tips, please read our FAQ: Build a Light-Tracking Bristlebot.

icon scientific method

Ask an Expert

Do you have specific questions about your science project? 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.


Explore More!

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

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: Why are my motors not spinning at all?
A: If your motors do not spin at all when you turn the power switch on and adjust the potentiometers, 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. For an overview of some other common mistakes you can make when using a breadboard, see the Common Mistakes section of the breadboard tutorial. Here are some specific things you can check with this robot:
  • 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 the MOSFETs are facing the right direction. When the robot as oriented as shown in the slideshow in the Procedure, the writing on the MOSFETs should face to the left, and the large metal tabs should face to the right.
  • Make sure you turned your robot "on" by sliding the power switch "up," towards row 1 on the breadboard when the robot is oriented as shown in the slideshow.
  • 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. The robot will not work in very dim light.
Q: I think my motors are broken. How can I check?
A: Remove all of the motor leads from the breadboard, but leave the rest of the circuit assembled. Testing only one motor at a time, connect one of the motor's leads to hole I7 and the other lead to hole I11. This connects the motor directly to the battery pack, "skipping" the rest of the circuit, and should make your motor spin. Note that it does not matter which color lead you connect to which hole; reversing the colors will just reverse the direction in which the motor spins. Test each one of your motors. If they both spin, you know that your motors are not broken and the problem is elsewhere in your circuit if your robot is not functioning.

If your motors do not spin, that does not guarantee that they are broken. You could have the batteries inserted into the battery holder incorrectly. Double check that the "+" symbols on the batteries line up with the "+" symbols inside the battery holder.

Q: Why does my robot not drive forward at all?
A: If your robot curves slightly off to one side when driving forward, 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. If you use toothbrushes with straight bristles, or toothbrushes with equal-length 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. 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.

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 2). 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 (Ω).
Circuit diagram for a voltage divider
Figure 2. 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 3 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.

A simplified diagram shows electricity moving into a MOSFET through the drain lead and out of the source lead
Figure 3. 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 4 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.
Circuit diagram for a light following robot
Figure 4. 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.


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

Career Profile
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… Read more
Career Profile
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… Read more
Career Profile
Have you ever seen an assembly line in a factory on TV? Or have you ever gone on a factory tour? Did you notice all of the conveyor belts and machines working so quickly together? Advanced manufacturing technicians make sure all of these machines keep running. They maintain and repair the electrical and mechanical parts of these machines. They know how fluid systems, like pumps, and gas systems work. Gas systems use compressed air to power machines to clamp, stack, and move items. Technicians… Read more
Career Profile
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… Read more
Career Profile
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

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:


    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

News Feed on This Topic

, ,

Cite This Page

General citation information is provided here. Be sure to check the formatting, including capitalization, for the method you are using and update your citation, as needed.

MLA Style

Science Buddies Staff. "Build a Light-Tracking Bristlebot." Science Buddies, 3 June 2021, https://www.sciencebuddies.org/science-fair-projects/project-ideas/Robotics_p012/robotics/build-a-light-tracking-bristlebot. Accessed 16 May 2022.

APA Style

Science Buddies Staff. (2021, June 3). Build a Light-Tracking Bristlebot. Retrieved from https://www.sciencebuddies.org/science-fair-projects/project-ideas/Robotics_p012/robotics/build-a-light-tracking-bristlebot

Last edit date: 2021-06-03
Free science fair projects.