O'Reilly logo

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

Building Smart LEGO MINDSTORMS EV3 Robots

Book Description

Build and program smart robots with the EV3.

About This Book
  • Efficiently build smart robots with the LEGO MINDSTORMS EV3
  • Discover building techniques and programming concepts that are used by engineers to prototype robots in the real world
  • This project-based guide will teach you how to build exciting projects such as the objecta-tracking tank, ultimate all-terrain vehicle, remote control race car, or even a GPS-navigating autonomous vehicle
Who This Book Is For

This book is for hobbyists, robotic engineers, and programmers who understand the basics of the EV3 programming language and are familiar with building with LEGO Technic and want to try some advanced projects. If you want to learn some new engineering techniques and take your experience with the EV3 to the next level, then this book is for you.

What You Will Learn
  • Understand the characteristics that make a robot smart
  • Grasp proportional beacon following and use proximity sensors to track an object
  • Discover how mechanisms such as rack-and-pinion and the worm gear work
  • Program a custom GUI to make a robot more user friendly
  • Make a fun and quirky interactive robot that has its own personality
  • Get to know the principles of remote control and programming car-style steering
  • Understand some of the mechanisms that enable a car to drive
  • Navigate to a destination with a GPS receiver
In Detail

Smart robots are an ever-increasing part of our daily lives. With LEGO MINDSTORMS EV3, you can now prototype your very own small-scale smart robot that uses specialized programming and hardware to complete a mission. EV3 is a robotics platform for enthusiasts of all ages and experience levels that makes prototyping robots accessible to all.

This book will walk you through six different projects that range from intermediate to advanced level. The projects will show you building and programming techniques that are used by engineers in the real world, which will help you build your own smart robot.

You'll see how to make the most of the EV3 robotics platform and build some awesome smart robots. The book starts by introducing some real-world examples of smart robots. Then, we'll walk you through six different projects and explain the features that allow these robots to make intelligent decisions. The book will guide you as you build your own object-tracking tank, a box-climbing robot, an interactive robotic shark, a quirky bipedal robot, a speedy remote control race car, and a GPS-navigating robot.

By the end of this book, you'll have the skills necessary to build and program your own smart robots with EV3.

Style and approach

This book will introduce you to the world of smart robots, then guide you through six different projects that can be completed with the LEGO MINDSTORMS EV3. The projects range from intermediate to advanced difficulty. The book will enable you to learn by example, walking you through the building and programming for each project and teaching you about the engineering concepts that allow each smart robot to complete its mission.

Downloading the example code for this book You can download the example code files for all Packt books you have purchased from your account at http://www.PacktPub.com. If you purchased this book elsewhere, you can visit http://www.PacktPub.com/support and register to have the files e-mailed directly to you.

Table of Contents

  1. Title Page
  2. Copyright and Credits
    1. Building Smart LEGO MINDSTORMS EV3 Robots
  3. Packt Upsell
    1. Why subscribe?
    2. PacktPub.com
  4. Foreword
  5. Contributors
    1. About the author
    2. About the reviewer
    3. Packt is searching for authors like you
  6. Preface
    1. Who this book is for
    2. What this book covers
    3. To get the most out of this book
      1. Download the example code files
      2. Download the color images
      3. Robots in action
      4. Conventions used
    4. Get in touch
      1. Reviews
  7. Introduction to Smart Robots
    1. What makes a robot smart?
    2. Examples of smart robots in the real world
      1. Robotic vacuum cleaners
      2. Autonomous cars
    3. Where does the EV3 fit in?
    4. What will we build and why?
    5. Summary
  8. Security Tank – Object-Tracking Robot
    1. Technical requirements
    2. Mechanical design
      1. Drivetrain
      2. Turret
        1. Firing projectiles
        2. Ammo silos
        3. Rotation
      3. Spiked roller
      4. Sensors
    3. Programming
      1. Setting up the program
      2. Beacon check
        1. Setting up the switch
        2. Programming the false case
        3. Change to tabbed view
      3. Following the beacon
        1. Proportional steering
        2. Measuring distance to control speed
        3. K values
        4. Controlling the driving
      4. Aiming the turret
      5. Fire!
        1. Using the compare switch
        2. Program the switch cases
      6. Keeping the beacon in sight
        1. Set up the first switch (right side)
        2. Program the return-to-center (right side)
        3. Programming the left side
      7. Putting it all together
    4. Summary
  9. Omnilander – Ultimate All-Terrain Vehicle
    1. Technical requirements
    2. Mechanical design
      1. Drivetrain – tank tracks reapplied
      2. Climbing mechanism
        1. Hook submechanism
        2. Jack submechanism
      3. Proximity sensors
        1. Ultrasonic sensor
        2. Infrared sensor
    3. Programming
      1. RC
        1. Setting up the loop
        2. Setting up the switch
        3. Configuring the switch cases
      2. Autonomous mode
        1. Setting up the loop and switches
        2. Programming the false case
        3. Programming the true case
        4. Programming the obstacle avoidance sequence
        5. Programming the climbing sequence
        6. Putting it all together
    4. Summary
  10. Timmyton – Interactive Robotic Shark
    1. Technical requirements
    2. Mechanical design
      1. Drivetrain
      2. Cosmetics
        1. Chassis
        2. Pectoral fins
        3. Jaws
        4. Tail
      3. Animating the jaws and tail
        1. Chomping jaws
        2. Wagging tail
      4. Sensors
        1. Infrared sensor
        2. Color sensor
    3. Programming
      1. GUI
        1. Creating the menu graphics
        2. Programming the GUI
      2. Operating modes
        1. Remote control
        2. Jaws
        3. Hungry mode
        4. Funky mode
        5. Autonomous
      3. Putting it all together
    4. Summary
  11. Grunt – Quirky Bipedal Robot
    1. Technical requirements
    2. Mechanical design
      1. Walking mechanism
      2. Cosmetic design
      3. Motorized functions
        1. Mouth
        2. Arms
      4. Sensors
        1. Infrared sensor
        2. Color sensor
        3. Touch sensor
    3. Programming
      1. Setting up a simple AI
        1. Initial code
        2. Nesting the switches
      2. Programming the modes
        1. Hungry mode
        2. Handshake
        3. Remote control
        4. Tantrum
        5. Handshake – alternative trigger
        6. Null case
      3. Putting it all together
    4. Summary
  12. Falcon – Remote Control Race Car
    1. Technical requirements
    2. Mechanical design
      1. Drivetrain
        1. Drive motors
        2. Gear ratios
        3. Differential
        4. Final drive ratio
      2. Steering 
      3. Cosmetic design
      4. Sensors
        1. Infrared sensor
        2. Rotation sensor
    3. Programming
      1. Control scheme
      2. MyBlocks
        1. Centering the steering
        2. Saving code as a MyBlock
        3. Steering left
        4. Steering right
        5. Returning the steering to center
      3. Assembling the program
        1. Accessing your MyBlocks
        2. Getting started
        3. Programming the cases
      4. Putting it all together
    4. Summary
  13. GPS Car – Autonomous EV3 Navigation
    1. Technical requirements
    2. Hardware
      1. Dexter Industries dGPS
        1. Basic principles of GPS navigation
        2. Using the dGPS
      2. HiTechnic compass
        1. Using the compass
      3. Modifying the Falcon
    3. Software
      1. Preparing the EV3 software
      2. GPS test program
        1. Sensor blocks
        2. Text blocks
        3. Display blocks
        4. Wait block
        5. Putting it all together
      3. Autonomous navigation 
        1. Acquiring target coordinates
        2. MyBlocks for car steering
          1. Importing/exporting MyBlocks
          2. Steering left and right
        3. getAngle MyBlock
          1. Program
          2. Save as MyBlock and create parameters
          3. Define parameter inputs/outputs within the code
        4. Writing the program
        5. Putting it all together
    4. Summary
  14. Other Books You May Enjoy
    1. Leave a review - let other readers know what you think