Science Fair Projects Using Lego Mindstorms: Bomb Detecting Robot

Updated on December 14, 2017
VirginiaLynne profile image

VirginiaLynne is an educator and mom of 5. Her Science Fair articles are based on her experience helping her children do their projects.

Lego NTX Science Fair Project

If you have a Lego Mindstorms NXT Robot or have participated in Lego League, you might want to consider using that robot for a science fair project. Below is an example of two years of science fair projects that my son did in 7th and 8th grade. He won at the local level both years, and also placed 2nd at State one year.

You are welcome to use the plans below to develop your own research project. The format of the graphs he used are given, but you will need to do your own building, programming and testing.

Lego Robot Bomb Detector

Lego Mindstorms NXT
Lego Mindstorms NXT | Source

Lego NXT Science Fair Project Abstract

Guided robots are used by the military to find bombs. The purpose of my experiment was to create an unguided robot. Here is how my project was done:

  1. First, I wrote two computer programs: one used the robot’s touch sensor to allow it to locate a corner, turn and start the second program.
  2. The second program activated the light sensors and started the robot on an algorithm of continuous XY loop sweeps which allowed it to find the mirror “bomb.”
  3. Using 4 x 4 beams, I constructed three test maps: a box, a box with an obstacle, and two rooms separated by a wall.
  4. I made the robot out of 2 Lego Mindstorms NXT kits and a few extra Lego parts.
  5. I threw a disc behind my back into the map to randomly place the robot and bomb.
  6. Next, I started the robot and timed how long it took for the robot to complete its first program of finding a corner, and then how long it took to find the bomb.
  7. I also noted how many XY sweeps it required. I did ten trials in each box.

My results:

  1. We found that the robot found the “bomb” every time, and it took longer for every map, the time increasing as the difficulty did.
  2. The robot found the “bomb” mostly on the first X scan throughout the entire experiment, contrary to what I had predicted.
  3. The X/Y scan process was more efficient than I had expected.

Lego Science Project

Click thumbnail to view full-size
Lego robot using light sensor to find mirrors.Lego robot finding "bomb" mirrors.Lego Robot touch sensor.Lego Robot in room.Lego Robot in Room with ObstacleLego Robot in two rooms
Lego robot using light sensor to find mirrors.
Lego robot using light sensor to find mirrors. | Source
Lego robot finding "bomb" mirrors.
Lego robot finding "bomb" mirrors. | Source
Lego Robot touch sensor.
Lego Robot touch sensor. | Source
Lego Robot in room.
Lego Robot in room. | Source
Lego Robot in Room with Obstacle
Lego Robot in Room with Obstacle | Source
Lego Robot in two rooms
Lego Robot in two rooms | Source

Research Problem

What is the most efficient search strategy for an unguided robot to detect a bomb?


Searches will take place over a ten-minute period. Success will be measured by both speed and percentage of successful searches. The right turning software search strategy will be both the fastest and the most efficient.


  1. Two Lego Mindstorms NXT kits
  2. Mindstorms NXT programming CD
  3. Computer to program on
  4. USB cable to transfer program
  5. Extra Lego pieces
  6. Maze (12’ x 12’) constructed of 4”x4” wooden beams. Within the 12’ x 12’ square, maze pattern is created with 1’ and 2’ long segments. Two mazes will be created using either right or random angles. No fasteners will be used; the weight of the 4x4s is enough to keep robot contained.
  7. “Bomb” target will be made of a flat LED flashing light and will be detected by the light sensors in order to simulate the search for a bomb using a bomb sensor.

Procedure for NXT Lego Science Project

  1. Create boundary walls of maze with 4x4s
  2. Create maze pattern with small 4x4 pieces. Place sensor at (a) the center or (b) the edge of the maze.
  3. Place robot in middle of one side of the maze, facing the center of the maze. Start run.
  4. Measure time taken to locate target. If target still not located after 10 minutes, halt experiment and record as “undetected”.
  5. The robot will be wheeled, with have a CPU in the center, which will have the program downloaded onto it and will control all of the sensors and motors. A touch sensor will be pointed straight forward to detect walls.
  6. Four search strategies will be tested:
  • Right turn search strategy: The robot is programmed to move forward until it encounters a wall sensed by its touch sensor, then takes a 90 degree right turn.
  • Right turn/left turn search strategy: Same as previous, except robot alternates between right and left turns.
  • Double turn strategy: Same as previous, except turns right for two wall encounters, then left for two encounters and so on.
  • 135 degree turn strategy: At each wall encounter, robot turns 135 degrees right or left (alternating with each encounter).

7. Repeat steps 2-4 for each combination of parameters. Four replicates will be done for each set, with each replicate starting from one of the four sides of the maze.

  • Four replicates x 2 sensor positions in maze x 2 maze patterns = 16 runs per search pattern
  • Four search patterns x 16 runs = 64 runs total

Lego NXT Used in Real Science Research


I will not let the robots escape from the testing area. I will not use parts or programs from a stranger on the Internet or in real life. I will have an adult watching and helping with the preparation, testing, and clean-up.

Data Comparison for Lego NXT Science Project

  1. The number of successful target locations per 16 runs will be calculated for each search pattern. Significant differences between search patterns will be determined by statistical methods. This will determine the most efficient search pattern.
  2. The search times for each successful run will be analyzed to statistically compare search patterns. This will determine the fastest search pattern.

Data Table for Lego Mindstorms Science Fair Project

2 Rooms
Time trial 1
Time trial 2
Time trial 3
Time trial 4
Time trial 5
Time trial 6
Time trial 7
Time trial 8
Time trial 9
Time trial 10

Mindstorms Programing Algorithm

XY programing algorithm
XY programing algorithm | Source

Abstract Year 2: Can Robots Find Bombs Independently?

The robot, algorithm, and program from my Year 1 project, "Can Robots Find Bombs?" was not as independent as an actual bomb-finding robot should be. Its limitations were that robot had to be placed at a right angle and it had to be adjusted every once in a while.

The robot, program, and algorithm in this Year 2 project, "Can Robots Find Bombs Independently?" fixes both of those problems. The robot can be placed at any angle anywhere in all three maps, does not require adjusting, and is a lot faster. The changing-angle algorithm searches the open space quickly, then moves to the next area gradually. It is less predictable than the X-Y sweep algorithm, but is more efficient.

Lego Robot Cleaning Machine

NTX Lego Science Fair Project Year 2

Last year I made a project, Can Unguided Robots Find Bombs? which involved building and programming a robot that was capable of:

  • Navigating three simple maps made of 2x2 wood planks
  • Being able to do so after being placed randomly inside the map
  • Using light sensors to detect 3 1” mirrors in a triangle pattern placed randomly somewhere on the map

However, I had a few problems with last year’s robot.

  • The robot had to be set parallel to the wood planks, to ensure that the algorithm worked properly.
  • The robot occasionally got off track by a few centimeters, and I would have to adjust it to keep it from going off the planned path.

This year, I was able to fix those problems. The new robot and algorithm do not need to be set at a particular angle to the wall, so as well as randomly putting the robot in a spot, I was also able to randomly pick a direction for the robot to be facing. As well as that, I did not touch the robot during the testing, except for when I put down the robot and pressed the button to initiate the program.

Because of this, the robot would be a lot more practical in a real life situation than last year’s robot. Ideally a person would start the robot and let the robot run without having to watch or make changes to the robot’s trajectory, and my new robot makes that possible.

Robot Design Lego NXT Science Fair Year 2

The results are a lot more dependent on the design of the robot this year than they were last year. The robot last year was not designed to get itself unstuck because the program was designed to make that not happen. The new algorithm is simpler but can occasionally get the robot stuck in a corner, grinding against the wall without the touch sensor bumping the wall, etc.

Because of this a very good robot needed to be built that could get the robot out of a pickle. This year the robot has a frame around it to prevent the robot from getting its wheels stuck on the walls, and to make the robot parallel to the wall if the robot came to the wall at an angle loose enough that the touch sensor didn’t bump the wall.

As well as adding a frame, I added several toothed gears and rubber parts to the end of the touch sensor to get more traction and to help the robot get out of corners if it gets stuck.

Lego Mindstorms Robots

Procedure Year 2

  1. Get robot from previous experiment
  2. Redesign the old robot with a frame around the vertical NXT brick, motors on the back, two light sensors pointing downward, one multi-directional wheel in between the light sensors, one touch sensor pointing forward in front of the multi-directional wheel, and a platform in front of the NXT brick holding on the sensors and wheel.
  3. Make a program with a changing-angle algorithm. The robot will move until it detects a wall with the touch sensor, then it will turn to the right at a 90 degree angle. The angle will continue to change until it reaches a 180 degree angle, then the robot will start over at 90 degrees.
  4. Test the new algorithm with the redesigned robot in the same three robots from Can Unguided Robots Find Bombs? and record results in time that the robot takes to find the bomb and whether the robot needed any human interference.

Program Design Lego NXT Science Fair Project Year 2

My algorithm for this year (changing-angles) is a lot different than my algorithm from last year (X-Y sweep). X-Y sweep depended on the robot always making the turns exactly right and being totally exact. I realized that attempting that, for my purposes and with the robot and software I am using, would be too difficult to perfect. So changing-angles is both simpler and less dependent upon perfect turns and exact angles.

Questions & Answers

  • What was your hypothesis statement for your science fair project?

    Can a robot be built that can detect bombs automatically?


    0 of 8192 characters used
    Post Comment
    • profile image

      Luqman Jibril 

      2 years ago

      Hi. I love your work. I'd like to ask if you could share the building instructions with me. It'll be great to use it in my class with my kids here.

    • VirginiaLynne profile imageAUTHOR

      Virginia Kearney 

      4 years ago from United States

      Hi Mike--we don't have the code anymore but it wasn't too complicated. You can probably figure it out by looking at the diagrams.

    • profile image

      Mike R 

      4 years ago

      Virginia would you happen to have the program(code) for the robot. I would like to see if I can recreate the code you and your son originally put together.

    • VirginiaLynne profile imageAUTHOR

      Virginia Kearney 

      5 years ago from United States

      Brandon--try looking up these keywords: "bomb detector," "engineering," "robotics." You could also look up "How Bomb Detectors Work" and "Weapons engineers"

    • profile image

      Brandon Akinseye 

      5 years ago

      I am doing a science fair project for the lego nxt bomb detector.

      For the bibliography I need 5 websites and I have 4 so far and I need some more information like the engineering question

    • ExpectGreatThings profile image


      6 years ago from Illinois

      As the parent of a newborn, 5 and 3 year old, I can't wait to be able to do stimulating and challenging projects like this! Well done! - Ginger


    This website uses cookies

    As a user in the EEA, your approval is needed on a few things. To provide a better website experience, uses cookies (and other similar technologies) and may collect, process, and share personal data. Please choose which areas of our service you consent to our doing so.

    For more information on managing or withdrawing consents and how we handle data, visit our Privacy Policy at:

    Show Details
    HubPages Device IDThis is used to identify particular browsers or devices when the access the service, and is used for security reasons.
    LoginThis is necessary to sign in to the HubPages Service.
    Google RecaptchaThis is used to prevent bots and spam. (Privacy Policy)
    AkismetThis is used to detect comment spam. (Privacy Policy)
    HubPages Google AnalyticsThis is used to provide data on traffic to our website, all personally identifyable data is anonymized. (Privacy Policy)
    HubPages Traffic PixelThis is used to collect data on traffic to articles and other pages on our site. Unless you are signed in to a HubPages account, all personally identifiable information is anonymized.
    Amazon Web ServicesThis is a cloud services platform that we used to host our service. (Privacy Policy)
    CloudflareThis is a cloud CDN service that we use to efficiently deliver files required for our service to operate such as javascript, cascading style sheets, images, and videos. (Privacy Policy)
    Google Hosted LibrariesJavascript software libraries such as jQuery are loaded at endpoints on the or domains, for performance and efficiency reasons. (Privacy Policy)
    Google Custom SearchThis is feature allows you to search the site. (Privacy Policy)
    Google MapsSome articles have Google Maps embedded in them. (Privacy Policy)
    Google ChartsThis is used to display charts and graphs on articles and the author center. (Privacy Policy)
    Google AdSense Host APIThis service allows you to sign up for or associate a Google AdSense account with HubPages, so that you can earn money from ads on your articles. No data is shared unless you engage with this feature. (Privacy Policy)
    Google YouTubeSome articles have YouTube videos embedded in them. (Privacy Policy)
    VimeoSome articles have Vimeo videos embedded in them. (Privacy Policy)
    PaypalThis is used for a registered author who enrolls in the HubPages Earnings program and requests to be paid via PayPal. No data is shared with Paypal unless you engage with this feature. (Privacy Policy)
    Facebook LoginYou can use this to streamline signing up for, or signing in to your Hubpages account. No data is shared with Facebook unless you engage with this feature. (Privacy Policy)
    MavenThis supports the Maven widget and search functionality. (Privacy Policy)
    Google AdSenseThis is an ad network. (Privacy Policy)
    Google DoubleClickGoogle provides ad serving technology and runs an ad network. (Privacy Policy)
    Index ExchangeThis is an ad network. (Privacy Policy)
    SovrnThis is an ad network. (Privacy Policy)
    Facebook AdsThis is an ad network. (Privacy Policy)
    Amazon Unified Ad MarketplaceThis is an ad network. (Privacy Policy)
    AppNexusThis is an ad network. (Privacy Policy)
    OpenxThis is an ad network. (Privacy Policy)
    Rubicon ProjectThis is an ad network. (Privacy Policy)
    TripleLiftThis is an ad network. (Privacy Policy)
    Say MediaWe partner with Say Media to deliver ad campaigns on our sites. (Privacy Policy)
    Remarketing PixelsWe may use remarketing pixels from advertising networks such as Google AdWords, Bing Ads, and Facebook in order to advertise the HubPages Service to people that have visited our sites.
    Conversion Tracking PixelsWe may use conversion tracking pixels from advertising networks such as Google AdWords, Bing Ads, and Facebook in order to identify when an advertisement has successfully resulted in the desired action, such as signing up for the HubPages Service or publishing an article on the HubPages Service.
    Author Google AnalyticsThis is used to provide traffic data and reports to the authors of articles on the HubPages Service. (Privacy Policy)
    ComscoreComScore is a media measurement and analytics company providing marketing data and analytics to enterprises, media and advertising agencies, and publishers. Non-consent will result in ComScore only processing obfuscated personal data. (Privacy Policy)
    Amazon Tracking PixelSome articles display amazon products as part of the Amazon Affiliate program, this pixel provides traffic statistics for those products (Privacy Policy)
    ClickscoThis is a data management platform studying reader behavior (Privacy Policy)