LEGO Mindstorms ShooterBot: Patrol and Destroy

Hello there,

A week ago I wrote the first part about my experience building ShooterBot, the first and most basic robot you can build using LEGO Mindstorms 8547 Set. This article completes ShooterBot as described in the instructions.

IMG_1908

Ads by Google

ShooterBot patrols and shoot

Ok, things get interesting. If you recall the previous steps ShooterBot was able to move and shot balls, at random. Quite impressive at first but little usefulness later. But fear no more, just by adding the Ultrasonic sensor you can turn your ShooterBot into a fierce fearless guardian, more or less…

The Ultrasonic sensor detects object in front of the robot and after warning the intruder it shoots a color ball if threat is still present.

So just follow the instructions and make sure to plug Ultrasonic Sensor into Port 4.

The NXT-G program is something like this

shooterbot-patrol-shoot

LEGO Mindstorms NXT file: Download

And it looks like this once it is uploaded into ShooterBot

Bugs and problems

This is the last step, so if you had no problems on the previous robots this one should be fairly straight.

Problem: No objects detected

Perhaps you forgot to plug the Ultrasonic sensor? Maybe the distance is too short?
I had some issues with what I believed 20 centimeters were and what Ultrasonic sensor thought. Try increasing the distances.

Problem: No ball fired

Motor A is plugged, right? Are there balls still inside ShooterBot?

Problem: Lights doesn’t light

When we removed the Color Sensor to make room for the ball shooter artifact maybe you forgot to plug it again.
Also make sure that you are using the On check mark on NXT-G for the color you want to light.

Problem: ShooterBot speaks and shoots too fast

I had this problem. You need to add a delay after the warning light and sound AND before the code that does one rotation of motor A if the Ultrasonic sensor detects something.
Usually 1-2 seconds is more than enough.

Changes to do on your own

Light-bulb-moment

There are several things that can really improve the way ShooterBot works. Here are some ideas for you:

  • Make sure Ultrasonic sensor and ball cannon are aligned. As you can see in the video the object is detected and warned but the ball miss the target everytime.
  • ShooterBot could patrol so predefined path and detect threads on some points of the path.
  • When ShooterBot runs out of ball it keep shooting. Save battery, don’t shoot.

If you have any problem, any idea or need any help just write it here I will do my best to help.

Regards,
Miguel

Leave a Reply