Skip to main content

Introduction

We need to patrol the planet to keep it safe, but don't have time to do it ourselves. Learn how to get your robot to steer itself automatically!

    • Autonomous robots are very important in advanced factories!

    • Watch the video to see some of Amazon's autonomous transport robots moving products around the warehouse.

    • Think how many people would be required to do the job of the robots!

  1. We're going to make our own autonomous robot to patrol the outside of the planet. Assemble your robot like the picture! You will need the line sensor module for this lesson. For best results, mount your line sensor underneath your junior main board as shown
    • We're going to make our own autonomous robot to patrol the outside of the planet.

    • Assemble your robot like the picture!

    • You will need the line sensor module for this lesson. For best results, mount your line sensor underneath your junior main board as shown

    • Just connect the left sensor to A for now.

  2. How does the line sensor work? Let's write a test program to find out. Build the test program in the picture. Can you guess what it will do?
    • How does the line sensor work? Let's write a test program to find out.

    • Build the test program in the picture. Can you guess what it will do?

    • Program your robot and place it on the activity mat, outside the planet - the motor should be off.

    • Then, try moving it onto the planet - the motor should start turning!

  3. Turn the robot over and look at the bottom of the line sensor. You should see 3 LEDs.
    • Turn the robot over and look at the bottom of the line sensor. You should see 3 LEDs.

    • The centre LED is an infrared emitter - just like on your TV remote control! It shines infrared light downwards all the time.

    • The two outer LEDs are infrared receivers - they can sense infrared light.

    • When the robot is on a black surface, infrared light is not reflected and so the receivers give a LO signal.

    • On a white surface, the light is reflected and so the receivers give a HI signal.

    • Using the signal from the sensors (HI or LO), we can detect what colour surface to robot is on!

  4. Let's use the line sensor to stop the robot from driving off the planet.
    • Let's use the line sensor to stop the robot from driving off the planet.

    • Don't forget - the sensor is HI on white backgrounds, and LO on black backgrounds.

    • Put the code blocks in the picture into a program that makes the robot:

    • Drive forward

    • Stop IF it drives off the planet (when the background is black)

  5. Now we have everything we need to drive around the edge of the planet automatically! To do this, your program needs to:
    • Now we have everything we need to drive around the edge of the planet automatically!

    • To do this, your program needs to:

    • Drive forwards

    • Check the sensor

    • If the sensor is LO, we are about to drive off the planet! Turn slightly towards the middle of the planet and then go forwards again.

    • Your robot should drive around the edge of the planet, without getting lost. There is a hint of the blocks you need in the picture if you need help!

    • Try and make your robot drive around the planet as smoothly as you can.

  6. Currently, the robot tries to stay on the white and avoid the black.
    • Currently, the robot tries to stay on the white and avoid the black.

    • Can you change the code so the robot orbits the planet by staying on the black, and turning away from the white?

    • Hint: instead of normally going forwards, you will need to normally be turning towards the centre of the planet.

Finish Line

Tech Camp

Member since: 10/03/2012

119 Guides authored

Team

Tech Camp Staff Member of Tech Camp Staff

6 Members

140 Guides authored