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

Build a Motion-Activated Guard Robot (BlueBot Project #1)

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

Abstract

Do you ever wish you could hire someone to guard your favorite toys, or keep certain people from coming into your room? What if you could make a robot to do it for you? This project will show you how to build a simple security robot controlled by a motion-detecting sensor. When someone comes near your valuables or enters the room, the robot will spring to life and (hopefully) scare them away!

Objective

Build a motion-activated guard robot and adjust its behavior to avoid false alarms.

Credits

Ben Finio, PhD, Science Buddies

Cite This Page

MLA Style

Finio, Ben. "Build a Motion-Activated Guard Robot (BlueBot Project #1)" Science Buddies. Science Buddies, 11 Aug. 2017. Web. 25 Sep. 2017 <https://www.sciencebuddies.org/science-fair-projects/project-ideas/Robotics_p024/robotics/guard-robot>

APA Style

Finio, B. (2017, August 11). Build a Motion-Activated Guard Robot (BlueBot Project #1). Retrieved September 25, 2017 from https://www.sciencebuddies.org/science-fair-projects/project-ideas/Robotics_p024/robotics/guard-robot

Share your story with Science Buddies!

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


Last edit date: 2017-08-11

Introduction

Have you ever seen a movie with a guard robot or a battle droid, and wished you could have your own? While this project will not show you how to build a robot that can fly or shoot lasers, you can build a simple motion-activated robot that will suddenly come to life to scare away intruders. Figure 1 shows a picture of the robot, followed by a video demonstration.

Motion activated guard robot with PIR sensor.
Figure 1. The motion-activated guard robot you will build in this project.



A video demonstration of the motion-activated robot.
A video demonstration of the motion-activated robot. https://www.youtube.com/watch?v=lY-hOy6UbZs

How does the robot detect motion and know when to turn on? The robot can detect infrared (IR) light, which is a type of electromagnetic radiation. Humans can only see a small part of the electromagnetic spectrum (visible light), but there are many other types of electromagnetic radiation, like radio waves, x rays, and ultraviolet light. Infrared light is given off by warm objects, like a human body or a hot stove top, but it is just outside the range of what humans can see.

The robot relies on a special type of sensor to detect infrared light. Sensors are electronic components that can tell a robot or computer something about its surroundings. For example, cameras and microphones are types of sensors (very similar to eyes and ears for a human). This robot uses a passive infrared (PIR) sensor, which is designed to detect changes in infrared light. So, if a person is not moving, even though they still emit infrared light, they will not trigger the sensor. If a person walks by the sensor, however (or an intruder walks past the robot!), the sensor will detect a moving source of infrared light. The sensor is connected to a circuit, or group of other electronic parts, that turn on the robot's motors to make it move.

You might have actually encountered PIR sensors in everyday life, even if you did not realize it. They are very commonly used in home security systems, since they can "see" a person walking through a room, even at night! They are also used in energy-saving lighting systems to make motion-activated lights. The lights can automatically turn on when someone walks into a room, and will turn off if no movement has been detected for a certain period of time. Figure 2 shows the type of PIR sensor you might see in a house, school, or other building.

PIR motion sensor for home security system
Figure 2. The type of PIR sensor you might see as part of a home security system or motion-controlled lighting system.

PIR sensors are usually designed to have a very wide field of view, or area that the sensor can "see." This can be great for a security system when you need a sensor to see an entire room, but it can be annoying if you only want your robot to guard a specific area. Watching for changes over a large area can create a false alarm and cause the robot to turn on accidentally. In this project, you will follow directions to build a motion-activated robot, then follow the Engineering Design Process to make adjustments to your PIR sensor's field of view to help avoid false alarms.

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 section 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 requires 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
4xAA battery holder
This is the power supply for your robot. Battery packs come in all shapes and sizes. The one in this project holds 4 AA batteries.
Breadboard
breadboard picture
A breadboard allows you to quickly and easily connect wires and electronic components in order to build a circuit. The connections are not permanent, so you can easily move things around if you make a mistake.
Switch
SPDT switch
You use switches every day to turn lights and appliances on and off. This is a tiny switch that fits on a breadboard, to let you turn your robot on and off.
Jumper wire
jumper wires
Jumper wires are short wires used to make electrical connections on a breadboard. They come with many colors of plastic insulation, which makes it easy to color-code and organize complicated circuits.
DC Motor
DC motor
Electrical current causes a motor to spin. Two motors drive the robot's wheels. This type of motor runs on direct current (DC) from a battery (as opposed to alternating current [AC] from a wall outlet).
MOSFET
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
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.
PIR Sensor
passive infrared (PIR) motion sensor
The passive infrared sensor acts as a motion detector. It has an output put that stays "low" (0 volts [V]) when it does not detect motion, and goes "high" (5 V) when it detects motion. This output can be used to activate other things in the circuit.
Male-female jumper wire
male-female jumper wires
This is a special type of jumper wire that comes with a female connector on one end and a male connector on the other end.
Table 1. Pictures and descriptions of each circuit component used in this project.

How do you combine all these components to control the motors and make the robot move forward? While the full details are in the Help section, there are two basic things that will help you understand:

  • The PIR sensor outputs a high voltage when it detects motion, and a low voltage when it does not detect motion.
  • The MOSFETs act like valves that control the flow of electricity through the motors. When a MOSFET's input receives a high voltage, the MOSFET makes the motor turn on (which spins a wheel). When a MOSFET's input receives a low voltage, the MOSFET makes the motor shut off (so the wheel stops).

Can you see how these two things could be set up to control a motor, and spin a wheel, based on whether or not the sensor detects motion? You need to connect the output of the sensor to the input of the MOSFET. Figure 3 shows a simplified diagram of this process (remember to refer to the Help section for the full explanation).

block diagram for behavior of motion activated robot
Figure 3. A diagram explaining the robot's operation.

Terms and Concepts

General terms:

  • Infrared (IR) light
  • Electromagnetic radiation
  • Electromagnetic spectrum
  • Sensor
  • Passive infrared (PIR) sensor
  • Circuit
  • Field of view
  • Voltage
  • Current
  • Resistance
  • Chassis

Circuit components:

  • Battery pack
  • Breadboard
  • Switch
  • Jumper wires
  • DC motor
  • MOSFET
  • Transistor
  • Diode
  • Male-female jumper wire

Advanced terms (see Help section):

  • Gate
  • Drain
  • Source
  • Threshold voltage
  • Saturation
  • N-channel MOSFET
  • P-channel MOSFET

Questions

  • What is infrared light? How is it different from visible light?
  • How does a passive infrared (PIR) sensor work?
  • What are some everyday uses of PIR sensors?
  • How can a PIR sensor be used to control a robot?
  • How could adjusting a PIR sensor's field of view change when the robot is activated?

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:

News Feed on This Topic

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

Materials and Equipment Product Kit Available

  • BlueBot Kit, available in the Science Buddies Store. You will need the following components from the kit (the kit also contains additional parts for three other projects). See the Background section for pictures if you are not sure what a part looks like.
    • Blue plastic robot chassis (includes wheels, motors, and 4xAA battery holder)
    • AA batteries (4)
    • Breadboard
    • Jumper wire kit
    • Power switch
    • Diodes (2)
    • MOSFETs (2)
    • PIR sensor
    • Male-female jumper wires (3)
  • You will also need the following materials, not included in the kit:
    • Double-sided foam tape
    • Scissors
    • Small Phillips head screwdriver (for assembling the chassis)
    • Paper towel tube
    • Optional: Wire cutters (can be used to shorten the metal leads on some parts of your circuit, making the circuit "neater")
    • Optional: Needle-nose pliers or tweezers (make it easier to handle small circuit components)
    • Lab notebook
building robots teaches problem solving, fine motor coordination, and 21st century skills
 Recommended Project Supplies
     Get Your Project Supplies
Get the right supplies — selected and tested to work with this project.
Skip the hassle of searching for supplies. Kit includes supplies hand-picked to deliver the best results for this project.
Project Kit: $99.95
View Kit

Remember Your Display Board Supplies

ArtSkills sparkle letters

Holographic Poster Letters

ArtSkills buy now button
ArtSkills vinyl letters

Vinyl Letters & Numbers

ArtSkills buy now button
ArtSkills supplies trifold

ArtSkills Trifold with Header

ArtSkills buy now button

Share your story with Science Buddies!

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

Experimental Procedure

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

Assembling Your BlueBot Chassis

  1. Follow the instructions in the video to assemble your robot chassis.
    1. Note that your kit does come with printed directions for assembling the chassis, but we recommend watching the video so you fully understand how all the parts fit together.
    2. Note that we recommend using double-sided foam tape to attach the battery holder to the top of the chassis, as shown in Figure 4. The printed directions recommend putting the battery holder in-between the two chassis plates, but this makes it harder to change the batteries.

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

Assembling Your Circuit

  1. To build your circuit, you will need to know how to use a breadboard. Watch the video and see the Science Buddies reference How to Use a Breadboard.
  1. Now that you know how to use a breadboard, you are ready to assemble your BlueBot circuit. Table 2 shows a list of all the components in the circuit and where they go on the breadboard. You can download and print a PDF of this table—complete with checkboxes to track each step—to use while you are building your robot. You can also view a slideshow that shows breadboard diagrams of the circuit. Follow along in the table and/or slideshow to build your circuit one component at a time. Your finished circuit should look like the one in Figure 5. Pay attention to these notes:
    1. Remember to push all components firmly into the breadboard.
    2. All references to orientation (up, down, left, and right) assume you have the breadboard "right-side up," so the writing is facing you.
    3. Your jumper wire kit comes with an assortment of colors, and the colors may vary. It does not matter what color jumper wires you use. Your colors do not need to match the colors in the diagrams. In general, you should use the shortest wires possible, to help keep your circuit neat.
    4. You will use male-female jumper wires to connect the PIR sensor to the breadboard. These wires act like "extension cords" that allow you to attach the sensor to the front of your robot. You do need to keep track of the wire colors when connecting the PIR sensor, since you need to connect the three pins in the right order.
    5. Insert the batteries last. If you see or smell smoke when you insert the batteries, you have a short circuit somewhere. Immediately remove the batteries and re-check your wiring.

Component Picture Symbol Breadboard holes Note
Power switch
SPDT switch
switch symbol
F1, F2, F3 Direction it is facing does not matter, but make sure to slide switch down (toward row 30, away from row 1), this is the "off" position.
Jumper wire
jumper wire
jumper wire symbol
J2 to (+) bus Color does not matter.
Jumper wire
jumper wire
jumper wire symbol
Left side (+) bus to right side (+) bus Color does not matter.
Jumper wire jumper wire jumper wire symbol Left side (-) bus to right side (-) bus Color does not matter.
MOSFET MOSFET mosfet breadboard symbol C11, C12, C13 Writing should face to the left, large silver tab should face to the right.
Note: the writing on your MOSFET may not match the picture exactly. This is OK.
MOSFET MOSFET mosfet breadboard symbol C18, C19, C20 Writing should face to the left, large silver tab should face to the right.
Note: the writing on your MOSFET may not match the picture exactly. This is OK.
Jumper wire jumper wire jumper wire symbol A13 to (-) bus Color does not matter.
Jumper wire jumper wire jumper wire symbol A20 to (-) bus Color does not matter.
Diode diode diode breadboard symbol A12 to (+) bus Gray band must face to the left.
Optional: Shorten the leads (see Figure 5).
Diode diode diode breadboard symbol A19 to (+) bus Gray band must face to the left.
Optional: Shorten the leads (see Figure 5).
PIR sensor passive infrared (PIR) motion sensor PIR sensor breadboard symbol (-) pin to (-) bus

OUT pin to J15

(+) pin to (+) bus
Color-code wires to make connections easier. Connect black wire to (-), blue wire to OUT, and red wire to (+). See slides 13 and 14 in slideshow.
Jumper wire jumper wire jumper wire symbol E11 to G15 Color does not matter.
Jumper wire jumper wire jumper wire symbol E18 to F15 Color does not matter.
Top motor DC motor motor symbol Red lead to (+) bus
Black lead to E12
When the robot is driving forward, this is the "right" motor
Bottom motor DC motor motor symbol Red lead to (+) bus
Black lead to E19
When the robot is driving forward, this is the "left" motor.
Battery holder 4xAA battery holder battery holder symbol Red lead to J1
Black lead to (-) bus
Do not insert batteries until circuit is complete.
AA battery AA battery battery symbol N/A Insert into battery holder. Make sure (+) signs on batteries line up with (+) signs in battery holder.
Table 2. List of circuit components and locations. A printable PDF version is available.

slideshow 0 line tracking robot circuit Insert power switch into holes F1, F2, F3. Connect jumper wire from hole J2 to (+) bus. Connect jumper wire from left (+) bus to right (+) bus. Connect jumper wire from left (-) bus to right (-) bus. Insert MOSFET into holes C11, C12, C13. Writing must face to the left. Insert MOSFET into holes C18, C19, C20. Writing must face to the left. Connect jumper wire from hole A13 to (-) bus. Connect jumper wire from hole A20 to (-) bus. Insert diode into hole A12 and (-) bus. Gray stripe must face to the left. Insert diode into hole A19 and (-) bus. Gray stripe must face to the left. Connect PIR sensor: (-) pin to (-) bus, OUT pin to J15, (+) pin to (+) bus. Connect jumper wire from hole E11 to G15. Connect jumper wire from hole E18 to F15. Connect top motor's red wire to (+) bus, black wire to hole E19. Connect bottom motor's red wire to (+) bus, black wire to hole E12. Connect battery holder's red wire to hole J1, black wire to (-) bus. diodes with leads bent and trimmed jumper wires connected to PIR sensor
slideshow 0 line tracking holder
Click through the slideshow for step-by-step breadboard diagrams of the circuit.


circuit for a motion activated robot with PIR sensor
Figure 5. Your completed circuit should look like this.
  1. After you have completed your circuit, mount the PIR sensor to the front of your robot chassis using double-sided foam tape, as shown in Figure 6.


mounting PIR sensor to robot chassis
Figure 6. Mount the PIR sensor to the front of your robot using double-sided foam tape.

Testing Your Robot

You are finally ready to start testing your robot! Remember that now you will need to follow the engineering design process to get your robot working. Follow these steps to learn how to use your robot.

  1. Double-check your circuit against the breadboard diagrams in the previous section. Remember that just one misplaced wire can prevent the circuit from working properly.
  2. Hold the robot's chassis in one hand, so the wheels are off the ground, and the PIR sensor is facing away from you and any other sources of infrared light, like other people, animals, or an open window (sunlight contains some infrared light).
    1. Turn the robot's power switch "on" by sliding it up, toward row 1 on the breadboard.
    2. Your robot's wheels should spin briefly as the PIR sensor "boots up," then come to a stop. Check Table 3 to see what you should do next.
Observation What to Do
I see or smell smoke. Immediately turn your robot off. You have a short circuit somewhere. Recheck your wiring against the breadboard diagrams in the previous section.
Each wheel spins forward when I turn the robot on. Your robot works! Move on to the next step.
One or both wheels spin backwards when I turn the robot on. Reverse the red and black wires of the motor if the wheel is spinning backwards. See the Help section for details.
The wheels did not spin at all when I turned the robot on. See the Help section for troubleshooting steps.
Table 3. Troubleshooting procedure for the first time you turn on your robot.
  1. Now, try waving your hand in front of the PIR sensor. This should make your robot's wheels spin. If your robot is not working, see the Help section.
  2. Try to discover other ways that you can activate the robot. What happens if you put the robot on the floor and then walk in front of it? What happens if you wave an inanimate object, like a ruler, in front of the sensor, or throw a crumpled piece of paper in front of the robot?
  3. You might discover that it is actually too easy to activate the robot, because the PIR sensor has such a wide field of view. For example, if you try to hide the robot under a desk or table, it might jump out too early when someone walks by. This is where the engineering design process really comes into play. Can you figure out how to modify the sensor's field of view? For example, you could partially cover the sensor with a shortened paper towel tube, like in Figure 7. You can also adjust which way the PIR sensor is facing (forward, down, up, or to the side).
PIR sensor field of view narrowed with paper towel tube
Figure 7. Partially covering the sensor with a shortened paper towel tube will help narrow its field of view.
  1. Continue making adjustments to your PIR sensor, as needed. You do not want the robot to activate too early or too late. What works best for the situation in which you want to use the robot? For example, do you want the robot to wait in a room and drive toward whoever walks in? Do you want to hide it around a corner or under a table? Once you have your robot working just the way you like it, leave it set up to "guard" something, and scare away the next person who comes by!

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 Motion-Activated Guard Robot (BlueBot Project #1).

Communicating Your Results: Start Planning Your Display Board

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

Share your story with Science Buddies!

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


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.
  • The sensor's circuit board has a jumper that you can use to toggle the detection range between 15 or 30 feet. You can read more about how to do this on the sensor's datasheet. How does adjusting the jumper affect the performance of your robot?
  • The other robots in your BlueBot use something called differential steering. They use two different sensors to help the robot steer left and right. In this project, you only used one sensor to make the robot drive forward. Can you use two PIR sensors to make a motion-tracking robot that will actually follow a person around? This might be more difficult than it sounds, so be ready for a challenge!
  • 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 your robot's behavior. Can you build a programmable motion-activated guard robot by adding an Arduino to your chassis? For example, using the other parts in your BlueBot kit (the H-bridge "motor driver" found in the Obstacle-Avoiding project), you can make a robot that drives forward when it detects motion, then goes in reverse to "hide" again. You could also make the robot wait a certain amount of time after detecting motion before it drives forward. See our Getting Started with Arduino page to learn more.
  • You can also use a PIR sensor to make a homemade alarm system, using a tiny programmable computer called a Raspberry Pi. See the Science Buddies Raspberry Pi Projects Kit—specifically the Invader Alert! project—to learn more.

Explore More!

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

Share your story with Science Buddies!

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

Frequently Asked Questions (FAQ)

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


motion activated robot circuit with motor leads reversed
Figure 8. In the top image, the motors' red leads are connected to the power bus, and the black leads are connected to the MOSFETs' drain pins (holes E4 and E27). If this configuration causes your robot to go backwards, just switch the red and black wires for each motor, as shown in the bottom image. Connect the black wires to the power bus, and the red wires to holes E4 and E27. Do not worry about violating the color-coding convention for positive and negative; all this does is reverse the direction in which the motors spin. If only one motor is spinning backwards, only switch the wires for that motor.
Q: My robot keeps moving on its own, even when no one walks in front of the sensor! What is happening?
A: Remember that the PIR sensor is very sensitive, and has a rather wide field of view. So, it is possible to trigger the sensor even if you are to the side of the robot and not directly in front of it. There could also be other sources of infrared light in the room, or something in the room could reflect infrared light from your body towards the sensor. To make sure you are not triggering the sensor accidentally, try putting the robot under an upside-down cardboard box, or putting it in a dark closet to block out all possible sources of infrared light. If you can still hear the robot's wheels spinning, then there may be something wrong with your circuit that is causing them to spin independently of the sensor. If this is the case, you should double-check all of your wiring. If your robot stops moving when you put it under a box, then that means you were accidentally triggering the sensor somehow.
Q: I have double-checked everything and my robot still does not work. How can I check if something is broken?
A: If you are having trouble figuring out why your robot will not work, you can try asking a question in our Ask an Expert: Answers to Your Science Questions forums. If you have access to a multimeter, you can also use that to help troubleshoot your circuit. See the Science Buddies reference How to Use a Multimeter if you need help using a multimeter. There are several steps you can take to check individual parts of your circuit (depending on your multimeter's probes, you may need alligator clips and additional jumper wires to take these measurements).
  • Try plugging your motor's leads directly into the buses on your breadboard (for each motor, one lead to the power bus, one lead to the ground bus). If the motors turn on, then you know that they are working, and the problem is elsewhere in your circuit. If the motors do not turn on, that does not necessarily mean they are broken. There might be a problem with your power supply (see next point).
  • Check your breadboard's power supply.
    • Set your multimeter to measure DC volts. Four fresh AA batteries should provide just over 6 V.
    • Turn your power switch on and measure the voltage between the breadboard's buses. If you do not read a voltage, there may a problem with your power switch (see the first question in this FAQ), but you should also double check that your power switch and the red jumper wire from hole J2 to the power bus are in the right place.
    • Unplug the red and black battery pack leads and measure the voltage of the battery pack directly. If you get a reading, then you know your battery pack is working, and the problem is with your breadboard connections or the power switch. If you do not get a reading, make sure all the batteries are in the correct orientation in your battery pack, and that none of the metal clips and springs that hold the batteries in place are loose.
  • Measure the voltage of your PIR sensor's output pin (labeled OUT on the sensor, connected to row 15 on the right side of the breadboard). It should read 0 V when the sensor is not triggered, and between 5–6 V when the sensor detects motion.
  • If the motors work when you plug their leads directly into the buses, and the output voltage of the PIR sensor increases when you wave your hand in front of it, but the robot still does not work, 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 PIR sensor work?
A: See the references from LadyAda and Glolab Corporation in the Bibliography for detailed descriptions of how PIR sensors work.
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 9 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 PIR sensor's output.

how a MOSFET works
Figure 9. 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: Figure 10 shows a complete circuit diagram for the robot. Refer to Table 4 for a list of individual circuit components and their respective circuit symbols. If you need help learning how to read a circuit diagram, refer to the SparkFun reference How to Read a Schematic. Here is a description of how the circuit works:
  • The batteries supply a voltage, Vbatt to the circuit. When the switch is closed, V1 = Vbatt. When the switch is open, V1 is "floating", so the circuit does not receive any power.
  • The PIR sensor receives power from its VCC pin and is connected to the circuit's ground through its GND pin. The sensor is digital—it outputs a logical "low" or "high" from its OUT pin depending on whether or not it detects motion. A "low" signal is 0 V, and a "high" signal is approximately 5 V.
  • 5 V is above the MOSFET's threshold voltage. So, when the sensor goes "high," this turns on both MOSFETs (notice how the OUT pin of the sensor is connected to the gate pin of both MOSFETs). This allows current to flow through the motors, and the robot drives forward.
  • 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.
circuit diagram for motion activated robot
Figure 10. A complete circuit diagram for the motion-activated robot.
Q: What are the circuit diagram symbols for the components in this project?
A: Table 4 shows a picture, breadboard diagram symbol, and circuit diagram symbol (when applicable) for each component in the project.
Item namePicture Breadboard Diagram Symbol Circuit Diagram Symbol
Battery pack
4xAA battery holder
battery holder symbol
battery circuit diagram symbol
Breadboard
breadboard picture
breadboard diagram symbol of a breadboard
n/a
Switch
SPDT switch
switch symbol
spdt switch circuit diagram symbol
Jumper wire
jumper wires
jumper wire symbol
jumper wire circuit diagram symbol
DC Motor
DC motor
motor symbol
DC motor breadboard symbol
MOSFET
MOSFET
mosfet breadboard symbol
mosfet breadboard symbol
Diode
diode
diode breadboard symbol
diode breadboard symbol
PIR Sensor
passive infrared (PIR) motion sensor
PIR sensor breadboard symbol
PIR sensor circuit diagram symbol
Table 4. A picture, breadboard diagram icon, and 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.

Ask an Expert

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

Ask an Expert

Contact Us

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

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

    Examples

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

Contact Us

Related Links

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

female robotics engineer adjusting robot

Robotics Engineer

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

Robotics Technician

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

Electrical & Electronics Engineer

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

Mechanical Engineer

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

News Feed on This Topic

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

Looking for more science fun?

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

Find an Activity