Jump to main content

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

1
2
3
4
5
298 reviews

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!

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 avoid short circuits when building your robot. See the Procedure for more information.
Credits
Ben Finio, PhD, Science Buddies
A video demonstration of the motion-activated robot.

Objective

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

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, and you can watch the video for a demonstration.

Photo of a robot designed to activate when it detects motion
Figure 1. The motion-activated guard robot you will build in this project.

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.

A large infrered sensor in a white housing used in home security systems
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
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.
PIR Sensor
A passive infrared motion sensor or PIR 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" (3.3 V) when it detects motion. This output can be used to activate other things in the circuit.
Male-female jumper wire
Four male to 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:

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

Two flow charts describe the relationship between a PIR sensor, MOSFET and motor

When a passive infrared sensor does not detect any motion 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 PIR sensor does detect motion 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 3. A diagram explaining the robot's operation.

Terms and Concepts

General terms:

Circuit components:

Advanced terms (see Help section):

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:

Materials and Equipment Buy Kit

Recommended Project Supplies

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

View Kit

building robots teaches problem solving, fine motor coordination, and 21st century skills

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

An assembled chassis with a breadboard and battery pack for a motion-detecting robot
Figure 4. 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.
  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
A switch with three leads
Circuit diagram symbol for a switch
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
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
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.
MOSFET A metal-oxide-semiconductor field-effect transistor or 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 not match the picture exactly. This is OK.
MOSFET A metal-oxide-semiconductor field-effect transistor or 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 not match the picture exactly. 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.
Diode A12 to (+) bus Gray band must face to the left.
Optional: Shorten the leads (see Figure 5).
Diode A19 to (+) bus Gray band must face to the left.
Optional: Shorten the leads (see Figure 5).
PIR sensor A passive infrared motion sensor or PIR sensor Breadboard diagram symbol for a PIR sensor GND pin to (-) bus

OUT pin to J15

VCC pin to (+) bus
Color-code wires to make connections easier. Connect black wire to GND, blue wire to OUT, and red wire to VCC. See slides 13 and 14 in slideshow.
Jumper wire A purple jumper wire Circuit diagram symbol for a jumper wire E11 to G15 Color does not matter.
Jumper wire A purple jumper wire Circuit diagram symbol for a jumper wire E18 to F15 Color does not matter.
Top motor A direct current motor Red lead to (+) bus
Black lead to E12
When the robot is driving forward, this is the "right" motor
Bottom motor A direct current motor Red lead to (+) bus
Black lead to E19
When the robot is driving forward, this is the "left" motor.
Battery holder A battery pack that can hold four double A batteries Red lead to J1
Black lead to (-) bus
Do not insert batteries until circuit is complete.
AA 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 Images


1. Blank breadboard.


2. Insert power switch into holes F1, F2, F3. Direction of switch does not matter.


3. Connect jumper wire from hole J2 to (+) bus.


4. Connect jumper wire from left (+) bus to right (+) bus.


5. Connect jumper wire from left (-) bus to right (-) bus.


6. Insert MOSFET into holes C11, C12, C13. Writing must face to the left.


7. Insert MOSFET into holes C18, C19, C20. Writing must face to the left.


8. Connect jumper wire from hole A13 to (-) bus.


9. Connect jumper wire from hole A20 to (-) bus.


10. Bend the diode's leads down by 90 degrees and trim them so they fit into the breadboard.


11. Insert diode into hole A12 and (+) bus. Gray stripe must face to the left.


12. Insert diode into hole A19 and (+) bus. Gray stripe must face to the left.



13. Connect a red male-female jumper wire to the VCC pin of the PIR sensor, a blue wire to the OUT pin, and a black wire to the GND pin.



14. Connect PIR sensor: GND pin to (-) bus, OUT pin to J15, VCC pin to (+) bus.



15. Connect jumper wire from hole E11 to G15.



16. Connect jumper wire from hole E18 to F15.



17. Connect top motor's red wire to (+) bus, black wire to hole E19.



18. Connect bottom motor's red wire to (+) bus, black wire to hole E12.



19. Connect battery holder's red wire to hole J1, black wire to (-) bus.

End of Slideshow Images




A fully wired breadboard for a motion-detecting robot
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.


Double sided tape is used to mount a PIR sensor towards the front of a 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. Your PIR sensor has two small orange knobs on it, labeled Sx and Tx (Figure 7). These knobs can be adjusted using a small Phillips-head screwdriver. Tx adjusts the "delay on time," or how long the sensor will remain on after detection motion. This value can range from 3 to 200 seconds. To start, we recommend turning this knob all the way counter-clockwise to set the delay to 3 seconds (otherwise, your robot will drive forward too far when it detects motion). You can increase the delay later if you want. Sx adjusts the sensor's sensitivity to motion.
    Two adjustment screws on a white PIR circuit board are labelled as RP1 and RP2
    Figure 7. Adjustment knobs on the PIR sensor. Sx adjusts sensitivity and Tx adjusts delay time.

  3. 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 8. You can also adjust which way the PIR sensor is facing (forward, down, up, or to the side).
A small cardboard tube is taped over a PIR sensor that is attached to the front of a robot chassis
Figure 8. 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).

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.
  • 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 How to Use an 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 Make a Motion Sensor Alarm with a Raspberry Pi project—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 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.
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 9.
Breadboard diagram shows two motors, a battery pack and a passive infrared sensor wired to a guard robot circuit


Breadboard diagram of a circuit board, battery pack and two motors wired to a breadboard
Figure 9. 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 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 10 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.

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: Figure 11 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 a motion activated robot
Figure 11. 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
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
PIR Sensor
A passive infrared sensor
Breadboard diagram symbol for a passive infrared sensor
Circuit diagram symbol for a passive infrared sensor
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.

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

Finio, Ben. "Build a Motion-Activated Guard Robot (BlueBot Project #1)." Science Buddies, 18 Nov. 2023, https://www.sciencebuddies.org/science-fair-projects/project-ideas/Robotics_p024/robotics/guard-robot. Accessed 19 Mar. 2024.

APA Style

Finio, B. (2023, November 18). Build a Motion-Activated Guard Robot (BlueBot Project #1). Retrieved from https://www.sciencebuddies.org/science-fair-projects/project-ideas/Robotics_p024/robotics/guard-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.