Jump to main content

Build a Speedy Light-Tracking Robot (BlueBot Project #2)

1
2
3
4
5
229 reviews

Abstract

Have you ever seen a cat chase a laser pointer or a flashlight beam? What if you could make a robot do that? In this project, you will build a robot that can automatically drive toward a bright light source. The robot uses a simple electronic circuit to track light, so there is no computer programming required! You can also do three other robotics projects using the same kit of parts, so this is a great way to get started with robotics before moving on to more advanced projects.

Summary

Areas of Science
Difficulty
 
Time Required
Short (2-5 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 for Electronics and Circuits if you have not used a breadboard before.
Material Availability
A kit is available from our partner Home Science Tools. See the Materials section for details.
Cost
High ($100 - $150)
Safety
Short circuits can get very hot and present a burn hazard. Be careful to follow the directions in the Procedure in order to avoid short circuits when building your robot.
Credits

Ben Finio, PhD, Science Buddies

Thanks to Howard Eglowstein, Science Buddies, for help with circuit design.

Objective

Build a light-tracking robot and make adjustments to improve the robot's performance.

Introduction

Have you ever wanted to build your very own robot, but did not know where to start? In this project, you will build a fun, relatively simple robot, with no computer programming required. The robot in this project uses light sensors, which are electronic components that can detect light; they will help the robot follow a flashlight beam—just like a cat uses its eyes to track a laser pointer. Figure 1 and the video show what the robot looks like and how it works.

An assembled chassis with a breadboard and battery pack for a light-following robot
Figure 1. The light-following robot that you will build in this project.


A demonstration of the light-following robot.

Can you figure out how you would steer the robot, based on watching the video? Figure 2 shows a diagram of how the robot reacts to a flashlight. A flashlight can be used to "guide" the robot by steering it forward, left, or right.

Diagram of a light-following robot using light sensors to turn or remain on a straight path

Two photoresistors are placed on the front of a robot chassis. If a flashlight does not shine any light at the photoresistors the robot will not move. The robot's wheels receive power based on the level of light that each sensor receives. A light closer to the left photoresistor will increase the speed of the right-side wheels of the robot causing it to turn towards the left. The same principles applys to the right side of the robot.


Figure 2. A diagram showing how the robot reacts to light.

How exactly does this work? The robot uses a special electronic circuit to control the speed of two motors through the use of two light sensors. The motors are connected to the robot's wheels, which allow it to drive around. Figure 3 shows a simplified diagram of this process (continue reading for a more detailed description of the circuit). If both light sensors detect the same amount of light, the wheels spin at the same speed, so the robot goes straight. If one light sensor detects more light than the other, one wheel will spin faster, which will make the robot turn.

Simplified flow chart on a circuit detecting light and powering a motor connected to wheels to move a robot
Figure 3. A simplified diagram of how the robot works. The robot's circuit detects bright light (for example, from a flashlight). The circuit then sends electrical signals to the robot's motors to turn them on. The motors drive the robot's wheels, which make the robot move and steer.

In this engineering project, you will follow step-by-step directions to build a light-following robot. You will then follow the Engineering Design Process to make some adjustments to your robot to improve its performance. 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 an 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 uses 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 diodes and transistors, 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
A battery pack that can hold four double A batteries
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
A breadboard
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
A switch with three leads
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
Six jumper wires of different lengths
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
A direct current 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).
MOSFET
A metal-oxide-semiconductor field-effect transistor or MOSFET
A MOSFET is a special type of transistor, which acts like a control valve to let electrical current flow. As an analogy, think of how a valve can control the flow of water through a garden hose. In this circuit, the MOSFETs control the flow of current through the motors. See the Help section for more detailed information about MOSFETs, including what MOSFET stands for.
Diode
A diode
A diode is like a one-way valve for electricity. It only lets current flow in one direction. In this circuit, diodes are used to protect the MOSFETs from voltage spikes that can be caused by abruptly stopping the motors.
Potentiometer
potentiometer
A potentiometer is a type of variable resistor. Resistors resist the flow of electrical current. Turning the knob adjusts its resistance. In this circuit, potentiometers are used to adjust the robot's sensitivity to light levels.
Photoresistor
A photoresistor with two lead wires
A photoresistor, also called a "photocell" or "light-dependent resistor (LDR)", is a resistor that is sensitive to light. In darkness, it has a very high resistance. In bright light, it has a very low resistance. In this circuit, two photoresistors are used to detect light and help the robot steer.
Table 1. Pictures and descriptions of each circuit component used in this project.

So, how exactly do you combine all of these different components into a circuit that allows you to steer a robot left and right? There are two main parts to the circuit that can be connected together:

Can you see how these two things can be connected to control a robot that responds to light? The trick is to connect the output of the voltage divider to the input of the MOSFET. Figure 4 shows a diagram of this process.

Two flow charts describe the relationship between a voltage divider, MOSFET and motor

When a photoresistor does not detect a high enough light intensity only low voltage power is sent to the MOSFET. If the MOSFET doesn't receive enough power no current flows to the motor and the motor stops. When a photoresistor detects high intensity light it sends high voltage to the MOSFET. The MOSFET is able to pass a current to the motor and the motor will turn the wheels of the robot.


Figure 4. A diagram illustrating how the circuit works.

Remember that the robot actually has two copies of this circuit, one on the left and one on the right. A light sensor that detects more light will cause the motor to spin faster. So, when the two sensors detect different light levels, one motor will spin faster than the other, causing the robot to turn.

There are different factors that influence the robot's performance. The potentiometers are used to adjust the sensitivity of the light sensors (meaning, change the voltage they output for a certain amount of light). The photoresistors are on long, flexible leads (kind of like antennas) that let you aim them in different directions. How do you think these factors could affect how the robot performs? In this project, you will build your own robot and find out. Move on to the Materials and Procedure sections to get started building your robot.

Remember that if you would like a complete technical explanation of how the robot works, including a full circuit diagram, see the Help section.

Terms and Concepts

Questions

Bibliography

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 used in this project:

  • Lindblom, J. (n.d.). Voltage Dividers. SparkFun Electronics. Retrieved June 4, 2014.
  • Storr, W. (2014, June 2). The Mosfet. Electronics Tutorials. Retrieved June 4, 2014.
  • Lindblom, J. (n.d.). Resistors. SparkFun Electronics. Retrieved June 19, 2014.

Materials and Equipment Buy Kit

Recommended Project Supplies

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

View 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

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 5. 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.
An assembled chassis with a breadboard and battery pack for a light-following robot
Figure 5. A completed BlueBot chassis with breadboard and battery pack on top.

An assembled chassis with a breadboard and battery pack for a light-following robot
Figure 5. A completed BlueBot chassis with breadboard and battery pack on top.

Assembling Your Circuit

If you purchased your kit before December 2, 2019, use these instructions to complete your assembly.
  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 for Electronics and Circuits to learn 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 6. 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. 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
A switch with three leads
Circuit diagram symbol for a switch
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
A purple jumper wire
Circuit diagram symbol for a jumper wire
J2 to (+) bus Color does not matter.
Jumper wire
A purple jumper wire
Circuit diagram symbol for a jumper wire
J12 to (-) bus Color does not matter.
Jumper wire
A purple jumper wire
Circuit diagram symbol for a jumper wire
J19 to (-) bus Color does not matter.
Jumper wire
A purple jumper wire
Circuit diagram symbol for a jumper wire
Left side (+) bus to right side (+) bus Color does not matter.
Jumper wire A purple jumper wire Circuit diagram symbol for a jumper wire Left side (-) bus to right side (-) bus Color does not matter.
Potentiometer G11, H12, G13 Be careful not to break the pins.
Potentiometer G18, H19, G20 Be careful not to break the pins.
Jumper wire A purple jumper wire Circuit diagram symbol for a jumper wire E11 to F11 Color does not matter.
Jumper wire A purple jumper wire Circuit diagram symbol for a jumper wire E18 to F18 Color does not matter.
MOSFET Breadboard diagram symbol for a MOSFET C11, C12, C13 Writing should face to the left, large silver tab should face to the right.
Note: the writing on your MOSFET may differ from the picture. This is OK.
MOSFET Breadboard diagram symbol for a MOSFET C18, C19, C20 Writing should face to the left, large silver tab should face to the right.
Note: the writing on your MOSFET may differ from the picture. This is OK.
Jumper wire A purple jumper wire Circuit diagram symbol for a jumper wire A13 to (-) bus Color does not matter.
Jumper wire A purple jumper wire Circuit diagram symbol for a jumper wire A20 to (-) bus Color does not matter.
Photoresistor A photoresistor A11 to (+) bus Direction does not matter.
Photoresistor A photoresistor A18 to (+) bus Direction does not matter.
Diode A diode Breadboard diagram symbol for a diode A12 to (+) bus Gray band must face to the left.
Optional: Shorten the leads.
Diode A diode Breadboard diagram symbol for a diode A19 to (+) bus Gray band must face to the left
Optional: Shorten the leads.
Top motor A DC motor Breadboard diagram symbol for a DC motor Red lead to (+) bus
Black lead to E19
When the robot is driving forward, this is the "right" motor.
Bottom motor A DC motor Breadboard diagram symbol for a DC motor Red lead to (+) bus
Black lead to E12
When the robot is driving forward, this is the "left" motor.
Battery holder A battery holder for four double A batteries Red lead to J1
Black lead to (-) bus
Do not insert batteries until the circuit is complete.
AA battery A double A battery Breadboard diagram symbol for a double A battery 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 with step-by-step instructions viewable online.



A fully wired breadboard for a light-following robot
Figure 6. Your completed circuit should look like this.

Testing the Robot

You are finally ready to start testing your robot! Remember that now you will need to follow 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. Turn the robot's power switch "on" by sliding it up, toward row 1 on the breadboard. 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. Re-check your wiring against the breadboard diagrams in the previous section.
The wheels spin forward. Your robot works! Move on to the next step.
One or both wheels spin backwards. Reverse the red and black wires for that motor if a wheel is spinning backwards.
The wheels do not spin at all. Try holding the robot's light sensors up to a bright light. Turn the potentiometer knobs all the way clockwise. The wheels should start spinning.
The wheels still do not spin. Part of your circuit is connected incorrectly. Re-check your circuit against the wiring diagrams, and see the Help section for more details.
Table 3. What to do the first time you turn on your robot.
  1. The potentiometers adjust your robot's sensitivity to ambient light levels (the normal light levels in a room). Your goal is to make sure the robot does not respond to regular ambient light, and that it does follow around a brighter flashlight beam.
    1. Turn both potentiometers all the way counterclockwise. This should turn the motors off (for more information on how the circuit works, see the Help section).
    2. Slowly turn the potentiometers clockwise, one at a time. This gradually increases the circuit's sensitivity to ambient light. Eventually, the motors should start spinning slowly.
    3. Turn the potentiometers slightly counterclockwise again, until the motors just turn off. You have set the motors just below the threshold for detecting ambient light.
    4. Now, aim a flashlight directly at your robot's light sensors, or hold the robot very close to a light. This brighter amount of light should activate the sensors and cause the motors to spin.
    5. Depending on the lighting in the room, you may need to continue to adjust the potentiometers slightly. For example, an open window on a sunny day or a bright lamp in a corner might cause the robot to move. Your goal is to make sure the robot does not respond to these light sources, and that it only responds to your flashlight. If your potentiometers are adjusted asymmetrically (one is turned farther than the other), this may cause your robot to steer more in one direction.
  2. Put the robot on the floor and try guiding it with a flashlight. Make sure you aim the flashlight at the photoresistors and not at the front of the robot or the floor in front of the robot. Can you control whether the robot goes forward, left, or right? It might be rather difficult to steer; go to the next step to find out why.
  3. The photoresistors have long, flexible leads that let you adjust their aim. Which way they are facing can have a big impact on how easy the robot is to steer. If they are right next to each other, they will always get hit by the same amount of light, so it will be very hard to steer the robot left or right. If they are too far apart, it will be hard to illuminate them evenly, so it will be hard to make the robot go straight. You can also adjust whether they are aimed forward or up, straight ahead or outward, or even diagonally. Try adjusting the photoresistors to different positions, and see which position makes it the easiest to steer your robot. Figure 7 shows several different positions for the photoresistors.
Two light sensors are placed in four different orientations on a breadboard

Two photoresistors are placed on a breadboard and their orientation to each other is adjusted to detect light more efficiently.


Figure 7. Different positions and orientations for the photoresistors. Top left: Photoresistors close together, facing forward. Top right: Photoresistors spaced apart, facing forward. Bottom left: Photoresistors spaced apart, facing upward. Bottom right: Photoresistors spaced apart, facing diagonally outward.
  1. Continue to make adjustments to the photoresistors and potentiometers until you can easily guide your robot around with a flashlight. Can you navigate the robot through a maze or obstacle course using the flashlight?
  2. There are several other robotics projects you can do with your chassis. See the Variations section for some ideas.

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 a Speedy Light-Tracking Robot (BlueBot Project #2).

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.

Global Connections

The United Nations Sustainable Development Goals (UNSDGs) are a blueprint to achieve a better and more sustainable future for all.

This project explores topics key to Industry, Innovation and Infrastructure: Build resilient infrastructure, promote sustainable industrialization and foster innovation.

Variations

  • There are three other projects you can do with your BlueBot kit. Since you have already assembled your chassis, all you need to do is build a new circuit.
  • Use the long male-female jumper wires that came with your kit, and mount the light sensors to the front of your robot's chassis, angled down toward the floor. Can you now get the robot to "chase" a flashlight beam aimed at the floor in front of it (kind of like a cat chasing a laser pointer)?
  • A "bristlebot" is a small robot that uses vibration motors instead of geared DC motors, and toothbrush heads instead of wheels. You can put the same circuit you used in this project on a bristlebot to build a miniature version of the robot. See the Science Buddies project Build a Light-Tracking Bristlebot for directions.
  • The Arduino is a very popular type of microcontroller used in robotics. It lets you write a computer program that can read inputs from sensors and use them to control motors. This gives you more precise "control" over you robot's behavior. Can you build a programmable light-tracking robot by adding an Arduino to your chassis? See our How to Use an Arduino page to learn more.

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: 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 and expose it to light, 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 the Science Buddies reference How to Use a Breadboard.
  • 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 row 1 at the top of the breadboard).
  • Turn both potentiometers all the way clockwise, then hold the robot directly up to a bright light source. Do the wheels spin?
  • If not, turn both potentiometers all the way counterclockwise (just in case you put them in the breadboard backwards). Hold the robot directly up to a bright light source. Do the wheels spin?
  • 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.
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 away from light instead of toward it, 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.
Breadboard diagram for a completed light-following robot



Breadboard diagram for a completed light-following robot
Figure 8. On the top, the motor's red wires are connected to the power bus, and the black wires are connected to the MOSFET's drain pins (holes E12 and E19). If this configuration makes your robot drive backwards, just switch the red and black wires for each motor, to match the image on the bottom. Connect the black wires to the power bus, and the red wires to the MOSFET drains. Do not worry about violating standard color-coding conventions; all this does is reverse the direction in which the motors spin.
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 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.
  • Check the output of the light sensor.
    • Measure the voltage between the first MOSFET's gate (row 11 on the left side of the breadboard) and ground. This is the output of the light sensor. The voltage should change when you turn the potentiometer. It should also change when you shine bright light on the photoresistor. If the voltage does not change at all, then your photoresistor and potentiometer may be wired incorrectly. Repeat this for the second half of the circuit (MOSFET gate at row 18).
    • If the voltages changes, and goes above roughly 3–4 V with bright light, then your motors should turn on. If you previously checked to make sure your motors work (see above), and they still will not turn on, then the problem is elsewhere in your circuit. You know the individual components 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 does the light sensor work?
A: 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 9). 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 9. 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 10 shows a simplified explanation of how a MOSFET works. A votage 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 10. 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 Table 1, into a single circuit that can control two motors to allow a robot to steer left and right in response to light? Figure 11 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 11. A complete circuit diagram for the light-following rbot.

The circuit diagram might look confusing at first, but if you look closely (refer to the symbols in Table 3 if necessary), you will see that 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 four AA batteries, which provide about 6 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 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.
  • Finally, each motor has a diode connected across its terminals. Motors can create large voltage spikes when they abruptly come to a stop (this has to do with the relationship between electrical current and magnetic fields, if you want to do more research on the explanation). The diodes help prevent damage to the MOSFET by safely discharging the current generated by the voltage spike.
Q: What are the circuit diagram symbols for the components in this project?
A: Table 4 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
A battery pack that can hold four double A batteries
Breadboard diagram symbol for a battery pack
Circuit diagram symbol for a battery
Breadboard
A breadboard
Breadboard diagram symbol for a breadboard
n/a
Switch
A switch with three leads
Breadboard diagram symbol for a switch
Circuit diagram symbol for a switch
Jumper wire
Six jumper wires of different lengths
Breadboard diagram symbol for a jumper wire
Circuit diagram symbol for a jumper wire
DC Motor
A direct current motor
Breadboard diagram symbol for a direct current motor
Circuit diagram symbol for a direct current motor
MOSFET
A metal-oxide-semiconductor field-effect transistor or MOSFET
Breadboard diagram symbol for a MOSFET
Circuit diagram symbol for a MOSFET
Diode
A diode
Breadboard diagram symbol for a diode
Circuit diagram symbol for a diode
Potentiometer
A potentiometer
Breadboard diagram symbol for a potentiometer
Circuit diagram symbol for a potentiometer
Photoresistor
A photoresistor
Breadboard diagram symbol for a photoresistor
Circuit diagram symbol for a photoresistor
Table 4. A picture, a breadboard diagram symbol, and a circuit diagram symbol for each of the components used in this project.
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.

Careers

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:

    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

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 Speedy Light-Tracking Robot (BlueBot Project #2)." Science Buddies, 18 Nov. 2023, https://www.sciencebuddies.org/science-fair-projects/project-ideas/Robotics_p022/robotics/light-following-robot. Accessed 19 Mar. 2024.

APA Style

Science Buddies Staff. (2023, November 18). Build a Speedy Light-Tracking Robot (BlueBot Project #2). Retrieved from https://www.sciencebuddies.org/science-fair-projects/project-ideas/Robotics_p022/robotics/light-following-robot


Last edit date: 2023-11-18
Top
We use cookies and those of third party providers to deliver the best possible web experience and to compile statistics.
By continuing and using the site, including the landing page, you agree to our Privacy Policy and Terms of Use.
OK, got it
Free science fair projects.