Build and Code Creative Robots with LEGO BOOST - Ashwin Shah - E-Book

Build and Code Creative Robots with LEGO BOOST E-Book

Ashwin Shah

0,0
27,59 €

-100%
Sammeln Sie Punkte in unserem Gutscheinprogramm und kaufen Sie E-Books und Hörbücher mit bis zu 100% Rabatt.

Mehr erfahren.
Beschreibung

LEGO BOOST is a feature-rich creative toolbox that helps kids to develop science, technology, engineering, and mathematics (STEM) skills in a fun way. The LEGO BOOST kit consists of motors, sensors, and more than 840 LEGO pieces to bring various multifunctional robots to life. This book will take you on an interesting and enjoyable journey where you will have fun building robots while developing your problem-solving and logical thinking skills.
This book is an end-to-end guide that will take you from a beginner to expert level of robot building with LEGO BOOST and Scratch. Starting with the unboxing and a brief introduction to LEGO BOOST, you'll quickly get your first robotic model up and running. You'll understand how to use the electronic and non-electronic components and have fun building a range of intriguing robotics projects with increasing complexity and advanced functionality. Throughout the book, you'll work on a variety of amazing projects, such as building your own R2D2, a fictional character from Star Wars, that will pique your curiosity to learn robotics and help you explore the full potential of the LEGO BOOST kit. Once you've had fun working with the projects, you'll be introduced to an interesting challenge for you to solve by yourself!
By the end of this book, you'll have gained the skills to build creative robotics projects with the LEGO BOOST creative toolbox, and have built on your logical thinking and problem-solving skills.

Das E-Book können Sie in Legimi-Apps oder einer beliebigen App lesen, die das folgende Format unterstützen:

EPUB
MOBI

Seitenzahl: 185

Veröffentlichungsjahr: 2021

Bewertungen
0,0
0
0
0
0
0
Mehr Informationen
Mehr Informationen
Legimi prüft nicht, ob Rezensionen von Nutzern stammen, die den betreffenden Titel tatsächlich gekauft oder gelesen/gehört haben. Wir entfernen aber gefälschte Rezensionen.



Build and Code Creative Robots with LEGO BOOST

Unleash your creativity and imagination by building exciting robotics projects

Ashwin Shah

BIRMINGHAM—MUMBAI

Build and Code Creative Robots with LEGO BOOST

Copyright © 2021 Packt Publishing

All rights reserved. No part of this book may be reproduced, stored in a retrieval system, or transmitted in any form or by any means, without the prior written permission of the publisher, except in the case of brief quotations embedded in critical articles or reviews.

Every effort has been made in the preparation of this book to ensure the accuracy of the information presented. However, the information contained in this book is sold without warranty, either express or implied. Neither the author, nor Packt Publishing or its dealers and distributors, will be held liable for any damages caused or alleged to have been caused directly or indirectly by this book.

Packt Publishing has endeavored to provide trademark information about all the companies and products mentioned in this book by the appropriate use of capitals. However, Packt Publishing cannot guarantee the accuracy of this information.

Group Product Manager: Wilson D'souza

Publishing Product Manager: Mohd Riyan Khan

Senior Editor: Arun Nadar

Content Development Editor: Sulagna Mohanty

Technical Editor: Arjun Varma

Copy Editor: Safis Editing

Project Coordinator: Shagun Saini

Proofreader: Safis Editing

Indexer: Pratik Shirodkar

Production Designer: Nilesh Mohite

First published: November 2021

Production reference: 1131021

Published by Packt Publishing Ltd.

Livery Place

35 Livery Street

Birmingham

B3 2PB, UK.

ISBN 978-1-80107-557-2

www.packt.com

To my mother, Meena, and father, Rajesh, for always being a rock-solid support pillar for me across the phases of my life. To my wife, Ushma, for her never-ending motivation, my daughter, Misha, for being my source of inspiration, and to Mr. Manoj, for his unwavering faith in me. Last but not least, to each family member of RoboFun Lab!

– Ashwin Shah

Foreword

I am excited to write the foreword for this book, Build and Code Creative Robots with LEGO BOOST, which is specifically designed for kids aged 8 to 12 years as well as for LEGO enthusiasts. Today, robotics is the key to executing the industrial revolution 4.0 across the globe. I see robotics as an interdisciplinary branch that includes a lot of learning and application from control systems, coding, and mechanics! If students learn about robotics during their time at school, they can get exposure to their field of choice in a fun and hands-on way, which can shape their career in a much better way. In this book, Ashwin has tried to build a strong base for robotics learning using the LEGO BOOST kit, with increasing levels of complexity. If you follow these chapters one after the other, I am sure that you will be able to build and code your own robots with unique mechanisms. The use of the Scratch programming language to code your BOOST robot is a welcome move from Ashwin and it will help you all to easily code your robots since many of you will be using Scratch programming at school. I am sure you will be able to complete the capstone project and that it will excite you to explore the challenging yet amazing world of various robotics competitions for your age group.

You will gain a lot of technical knowledge to build and code robots and will be able to innovate further using this robotics kit. Remember one thing: the basics that you will learn throughout this book will help you build on your robotics knowledge when you gradually explore more challenging robotics kits, sensors, and programming languages in the times to come.

Wishing you all a very happy and fun-filled time while building and coding these robots.

Mr. Manoj Patel

Director and CEO, RoboFun Lab Pvt. Ltd.

Contributors

About the author

Ashwin Shah is an electronics and communication engineer from India. Teaching is his passion and he started working at the tender age of 16 as a doubt solver for younger kids at after-school classes. Today, he is a successful edupreneur who runs his own STEM-based robotics, coding, and IoT institute – RoboFun Lab. Being one of the pioneers of STEM education in India, he has taught over 3,000 students and trained 200+ educators thus far. He has trained 100+ teams for prestigious STEM competitions with 50+ national and 12+ international awards in the bag. Most of his students are now pursuing careers/education in STEM at prominent universities. Ashwin was a state-level badminton player during his college days.

About the reviewer

Anita Kumari is a STEM and robotics educator with 13+ years' experience in schooling students. Her major interests are LEGO robotics, STEM, coding, and Arduino. Born and raised in the beautiful Kullu valley of Himachal Pradesh, she studied electronics and communication engineering at the Govt. Polytechnic College, Kandaghat, HP. Working in both the trainer and STEM content development roles has given her broad experience of writing content for school children that is engaging and exciting at the same time.

I'd like to thank my parents, siblings, relatives, friends, and mentors for guiding and supporting me. I greatly appreciate my in-laws, thank you for always being supportive and adjusting to my odd routines.

To my daughter, Sunanda: Even at the age of 8 years, you never trouble me while I am working. I'd also like to thank Packt Publishing for the opportunity to review this wonderful book.

Table of Contents

Preface

Chapter 1: Introduction to the LEGO BOOST Kit

Technical requirements

Wonders with LEGO BOOST

The difference between machines and robots

Introduction to the electronic and non-electronic parts of the BOOST kit

The importance and efficient usage of various pegs

Time for a challenge

Activity #1

Summary

Further reading

Chapter 2: Building Your First BOOST Robot – Tabletop Fan

Technical requirements

Building the tabletop fan

Programming the tabletop fan

Running your tabletop fan at different speeds

Time for a challenge

Summary

Further reading

Chapter 3: Moving Forward/Backward Without Wheels

Different types of movement

Technical requirements

Building a robot without wheels

Let's code the robot without wheels

Activity #1

Activity #2

Activity #3

Time for a challenge

Summary

Further reading

Chapter 4: LEGO BOOST Rover

Technical requirements

Building the BOOST rover

Making the rover move

Activity 1

Activity 2

Time for a challenge

Summary

Further reading

Chapter 5: Getting into Gear – My First Geared Robot

Technical requirements

Using different types of gears based on your requirements

Understanding some important terminologies

Building the geared robot

Let's code the robot in gear up and gear down mechanism

Activity 1

Activity 2

Time for a challenge

Summary

Further reading

Chapter 6: Building a Forklift

Technical requirements

Building the forklift robot

Let's code the robot to lift different loads

Activity #1

Activity #2

Activity #3

Activity #4

Activity #5

Time for a challenge

Summary

Further reading

Chapter 7: Building a Helicopter

Technical requirements

Building a helicopter

Let's code the robot to perform various tasks

Activity #1

Activity #2

Activity #3

Activity #4

Activity #5

Time for a challenge

Summary

Further reading

Chapter 8: Building R2-D2

Technical requirements

Building the R2-D2 robot

Let's code the robot to move on a specific path

Activity

Time for a challenge

Summary

Further reading

Chapter 9: Building an Automatic Entrance Door

Technical requirements

Building an automatic entrance door

Let's code the door to open under certain conditions

Activity #1

Activity #2

Time for a challenge

Summary

Further reading

Chapter 10: Building a Candy Dispenser Robot

Technical requirements

Building a candy dispenser

Let's code the robot to dispense candies based on different colors of LEGO brick detected

Activity #1

Activity #2

Activity #3

Time for a challenge

Summary

Further reading

Chapter 11: Building a Color-Sorter Conveyor Belt

Technical requirements

Building a color-sorter conveyor belt robot

Let's code the robot to sort different colored LEGO bricks

Activity #1

Activity #2

Activity #3

Activity #4

Time for a challenge

Summary

Further reading

Chapter 12: Building a BOOST Racing Car

Technical requirements

Building the racing car

Let's code the robot to run on different racetracks

Activity #1

Activity #2

Activity # 3

Time for a challenge

Summary

Further reading

Chapter 13: Final Challenge

Technical requirements

Building the robot

Let's code

Activity #1

Activity #2

Activity #3

Activity #4

Activity #5

Summary

Further reading

Bonus Chapters

Chapter 14: The Grabbing Robot

Technical requirements

Building the grabbing robot

Let's code the robot to grab, displace, and drop a bottle

Activity #1

Time for a challenge

Summary

Further reading

Chapter 15: Obstacle Avoidance Robot

Technical requirements

Building the obstacle avoidance robot

Let's code the robot to avoid obstacles

Activity #1

Activity #2

Time for a challenge

Summary

Further reading

Chapter 16: The BOOST Humanoid

Technical requirements

Building a line-following robot

Let's code the robot to follow the line

Activity #1

Time for a challenge

Summary

Further reading

Chapter 17: The Moon Rover

Technical requirements

Building the moon rover

Let's code the robot to perform different tasks

Activity #1

Time for a challenge

Summary

Further reading

Other Books You May Enjoy

Preface

Build and Code Creative Robots with LEGO BOOST teaches a range of interesting robotics projects with detailed building instructions. You'll learn how to use motors, sensors, and Scratch programming to build modern-day smart robots while developing your STEM skills in a fun way.

Who this book is for

This book will help 7-12-year-old children who want to learn robotics with LEGO BOOST to develop their creativity, logical thinking, and problem-solving skills. Teachers, trainers, and parents who wish to teach robotics with LEGO BOOST and Scratch will also find this book useful.

What this book covers

Chapter 1, Introduction to the LEGO BOOST Kit, introduces you to the fascinating world of LEGO BOOST and the infinite possibilities of creation that it comes with. You shall understand how the hub works and how to connect the hub to your tablet.

Chapter 2, Build Your First BOOST Robot – Tabletop Fan, will show you how to build a simple table fan using the LEGO bricks and BOOST Hub given in the kit. You will be introduced to the world of programming and given a basic task to turn the fan on and off. A challenge to change speeds is provided in the Pursue section.

Chapter 3, Moving Forward/Backward Without Wheels, covers one of the most interesting ways to learn about the basics of movement and the importance of wheels – moving without wheels! With open-ended discussions, you shall explore various ways in which an object can move even in the absence of wheels. You will tinker with some cool activities to control the robot's movement in the absence of wheels!

Chapter 4, LEGO BOOST Rover, covers how to build your first robot with wheels. More concepts of programming, such as various kinds of turns, will be introduced in this chapter. You will be given more programming tasks, such as making robots move in specific shape patterns and eventually using loops to reduce data redundancy.

Chapter 5, Getting into Gear – My First Geared Robot, introduces you to the various kinds of gears available in the BOOST kit with their specific usage. You shall understand the concepts of gear ratio and gearing up and gearing down in detail and relate them to the term "torque." You will then build your own geared car with various gear combinations and explore firsthand how different gear combinations affect movement.

Chapter 6, Building a Forklift, covers how to build your own forklift robot and understand how a load is moved easily in industry using this vehicle. Your forklift will be completely autonomous and will pick up a load from one place, travel to the destination, and place it.

Chapter 7, Building a Helicopter, covers building a helicopter. We have probably all seen a helicopter and a few of us would have taken a ride in one too. How about building your own helicopter with rotating blades that can move from one place to another? You will be taught the basic concepts of flying and activities will be set accordingly.

Chapter 8, Building R2-D2, covers building an R2-D2 robot. Those of us who are Star Wars fans know R2-D2. With this activity, you will apply your knowledge of gears to create the movement of R2-D2 and complete some fun challenges.

Chapter 9, Building an Automatic Entrance Door, provides yet another simple but effective application of a distance sensor – automated entrance doors. You will build your own entrance door with the help of a pulley mechanism as well as a color sensor in this project.

Chapter 10, Building aCandy Dispenser Robot, teaches you how a color sensor works in real life. You shall build a cool candy dispenser robot that will drop different-colored candies based on the color of the LEGO brick detected by the color sensor.

Chapter 11, Building a Color Sorter Conveyor Belt, teaches you how to build a cool industrial application, a conveyor belt with a basic robotic arm. It will be able to sort three different colors at three different places using a color sensor.

Chapter 12, Building a BOOST Racing Car, covers how to build your own race car with a steering wheel mechanism. You shall learn about advanced concepts in programming and use the steering option to control this car. You will make this an autonomous car capable of traversing a complex path.

Chapter 13, Final Challenge, provides a final challenge that you will have to use your own creativity, logical thinking, and problem-solving skills to crack. You will have to build and code your own robot with no guidance from the book except hints and some common references. This will help students and parents understand how your learning has progressed through this book.

Chapter 14, The Grabbing Robot, covers how to build your own grabber robot that can grab things from one point and place it elsewhere. Like the forklift, this robot will be capable of holding objects of any shape. Students will learn about the complex application of gears and build a sturdy robot capable of grabbing and displacing.

Chapter 15, Obstacle Avoidance Robot, introduces you to the world of sensors and explains how color sensors work along with various practical examples. You will be introduced to the programming logic when sensors are involved.

Chapter 16, The BOOST Humanoid, covers how to build a humanoid structure using your BOOST kit and attach a color sensor to it at the bottom. You will learn about the basic concept of line following and then program the robot to follow the black line path given.

Chapter 17, The Moon Rover, covers how to build a moon rover that will be capable of sending sensed data to the main station and perform tasks such as dropping water in barren land and collecting samples from green land.

To get the most out of this book

To effectively perform all the projects hands-on, you must have a LEGO BOOST kit along with a laptop for programming. Basic knowledge of the Scratch programming language would be an added advantage.

If you are going to use Scratch 3.0 online, you must create an account there so that you can effectively save your programs and use them for future reference. If you are going to install it on your computer, please download it from here: https://scratch.mit.edu/download. You also need a set of six AAA-sized rechargeable batteries for your BOOST Hub.

After you are done reading this book, I would love to see you building more complex robots using your own creativity and innovation. Building a 3D printer is a worthwhile option to consider. You can also explore various LEGO-based robotics competitions and aim to participate in them to showcase your creativity and innovation.

Download the color images

We also provide a PDF file that has color images of the screenshots/diagrams used in this book. You can download it here: https://static.packt-cdn.com/downloads/9781801075572_ColorImages.pdf.

Conventions used

There are a number of text conventions used throughout this book.

Code in text: Indicates code words in text, database table names, folder names, filenames, file extensions, pathnames, dummy URLs, user input, and Twitter handles. Here is an example: "Simply swap the motor ports in the if else condition and the robot will follow the left edge of the line."

A block of code is set as follows:

Figure 10.61

Bold: Indicates a new term, an important word, or words that you see onscreen. For example, words in menus or dialog boxes appear in the text like this. Here is an example: "Display Green brick detected before dispensing. Once the candies are dispensed, display Three candies dispensed."

Tips or important notes

Appear like this.

Get in touch

Feedback from our readers is always welcome.

General feedback: If you have questions about any aspect of this book, mention the book title in the subject of your message and email us at [email protected].

Errata: Although we have taken every care to ensure the accuracy of our content, mistakes do happen. If you have found a mistake in this book, we would be grateful if you would report this to us. Please visit www.packtpub.com/support/errata, selecting your book, clicking on the Errata Submission Form link, and entering the details.

Piracy: If you come across any illegal copies of our works in any form on the Internet, we would be grateful if you would provide us with the location address or website name. Please contact us at [email protected] with a link to the material.

If you are interested in becoming an author: If there is a topic that you have expertise in and you are interested in either writing or contributing to a book, please visit authors.packtpub.com.

Reviews

Please leave a review. Once you have read and used this book, why not leave a review on the site that you purchased it from? Potential readers can then see and use your unbiased opinion to make purchase decisions, we at Packt can understand what you think about our products, and our authors can see your feedback on their book. Thank you!

For more information about Packt, please visit packt.com.

Share Your Thoughts

Once you've read Build and Code Creative Robots with LEGO BOOST, we'd love to hear your thoughts! Please click here to go straight to the Amazon review page for this book and share your feedback.

Your review is important to us and the tech community and will help us make sure we're delivering excellent quality content.

Chapter 1: Introduction to the LEGO BOOST Kit

Welcome to the first chapter of this book! I am sure you all are excited to learn about your BOOST kit and start building new robots with the kit in each new chapter! Just before we begin with the construction of our first robot, let's try to learn the basics!

In this chapter, you shall be unboxing your BOOST kit and exploring various electronic and non-electronic parts given in the kit in a fun and hands-on way. We will cover the following topics in this chapter:

The difference between machines and robots Using the various electronic and non-electronic parts that come with your BOOST kit Building your first model with this BOOST kit

Technical requirements

In this chapter, you will need the following:

A LEGO BOOST kit with six AAA batteries, fully charged

Wonders with LEGO BOOST

The LEGO BOOST kit comes heavily loaded with electronic and non-electronic parts. If you learn how to use this kit properly, the sky is the limit. The BOOST kit comes with three motors, built-in gyro sensors, and an external (a separate electronic piece that can be attached to the BOOST Hub) color sensor as well as an ultrasonic sensor. You can make some cool creations with this kit, such as the following:

A 3D printerA humanoidA color sorterA line follower

You can stretch your creativity to its limit using this BOOST kit to build and code anything and everything that you can imagine.

The difference between machines and robots

You might have come across the question "How do you differentiate between a machine and a robot?" Let's try to understand this with a simple example of a fan and an air conditioner.

Imagine how a fan works. When you turn on the switch, the fan starts working, and when you turn off the switch, the fan stops working. In a simple statement, a fan takes an input (turn on/off the switch) and directly gives us an output (it either starts moving in a clockwise direction in the on condition or stops working when the switch is off).

A machine is something that takes an input and directly gives you an output. Can you think of at least four such machines in and around you and write them down?

Names of the machines around you:

The following figure represents the input and output mechanism in a fan:

Figure 1.1 – Input/output mechanism of a fan

Now, let's try to understand how an air conditioner works:

You turn on the main switch and turn on the air conditioner.You set the desired temperature for the air conditioner to maintain – say, for example, 26 degrees Celsius.If your room temperature reaches more than 26 degrees Celsius, your air conditioner will throw cool air in the room. If the room temperature is less than 26 degrees Celsius, your air conditioner will throw normal air in the room.

So, how is it different from a fan? In your air conditioner, you have a temperature sensor that measures the temperature of the room all the time and a processor that acts based on the input received from this temperature sensor. So, what is happening here is the following:

Input: You set up the temperature through your air conditioner remote.Process: The air conditioner's processor processes this input and compares it with the input received from the room temperature sensor and decides the action accordingly.Output