27,59 €
LEGO MINDSTORMS Robot Inventor is the latest addition to the LEGO MINDSTORMS theme. It features unique designs that you can use to build robots, and also enable you to perform activities using the robot inventor application.
You'll begin by exploring the history of LEGO MINDSTORMS, and then delve into various elements of the Inventor kit. Moving on, you'll start working on different projects which will prepare you to build a variety of smart robots. The first robotic project involves designing a claw to grab objects, and helps you to explore how a smart robot is used in everyday life and in industry. The second project revolves around building a working guitar that can be played and modified to meet the needs of the user. As you advance, you'll explore the concept of biomimicry as you discover how to build a scorpion robot. In addition to this, you'll also work on a classic robotic challenge by building a sumobot. Throughout the book, you'll come across a variety of projects that will provide you with hands-on experience in building creative robots, such as building a Dragster, Egg Decorator, and Plankton from Spongebob Squarepants.
By the end of this LEGO book, you'll have got to grips with the concepts behind building a robot, and also found creative ways to integrate them using the application based on your creative insights and ideas.
Das E-Book können Sie in Legimi-Apps oder einer beliebigen App lesen, die das folgende Format unterstützen:
Seitenzahl: 287
Veröffentlichungsjahr: 2021
Learn to play with the LEGO MINDSTORMS Robot Inventor kit and build creative robots
Aaron Maurer
BIRMINGHAM—MUMBAI
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(s), 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 of the companies and products mentioned in this book by the appropriate use of capitals. However, Packt Publishing cannot guarantee the accuracy of this information.
Commissioning Editor: Wilson D'souza
Publishing Product Manager: Sankalp Khattri
Senior Editor: Arun Nadar
Content Development Editor: Mrudgandha Kulkarni
Technical Editor: Nithik Cheruvakodan
Copy Editor: Safis Editing
Project Coordinator: Shagun Saini
Proofreader: Safis Editing
Indexer: Priyanka Dhadke
Production Designer: Alishon Mendonca
First published: April 2021
Production reference: 1070521
Published by Packt Publishing Ltd.
Livery Place
35 Livery Street
Birmingham
B3 2PB, UK.
ISBN 978-1-80056-840-2
www.packt.com
Aaron Maurer, also known as Coffeechug, is the STEM lead for 21 school districts in Iowa, helping to expand STEM, computer science, makerspace, and purposeful play into K-12 classrooms. Aaron was also a FIRST (For Inspiration and Recognition of Science and Technology) LEGO League coach for 8 years with much success, working with phenomenal kids.
He has a master's degree in secondary education. Aaron is also a member of NCCE, LEGO Education Master Educator, OBS Digital Innovator and All-Star, PITSCO TAG, Microsoft Innovative Educator Expert and Fellow, Minecraft Global Mentor, and micro:bit champion.
Finally, Aaron was a finalist for the Iowa Teacher of the Year award in 2014.
You can find more of his work at www.coffeeforthebrain.com.
Khushboo Samkaria (Rana) lives in India with her husband, Vivek, and son, Agastya. She is a certified LEGO Serious Play (LSP) practitioner with more than 8 years of experience working globally with LEGO education partners and organizing FIRST (For Inspiration and Recognition of Science and Technology) programs. She is devoted to the mission of helping young innovators to understand the real world using an interdisciplinary approach, STEM (Science, Technology, Engineering, Math), and has interacted with more than 100,000 kids and adults globally since 2011. Currently, she works with various organizations to help them tap their unused knowledge and ideas using the LSP approach so that they can succeed in this period of intense change, such as the COVID-19 pandemic.
If you're interested in becoming an author for Packt, please visit authors.packtpub.com and apply today. We have worked with thousands of developers and tech professionals, just like you, to help them share their insight with the global tech community. You can make a general application, apply for a specific hot topic that we are recruiting an author for, or submit your own idea.
Welcome to this book. I am so excited to have the opportunity to share with you a passion of mine as an educator who has hands-on experience with LEGO, transforming learning and engagement with students, a parent who has spent countless hours building and creating stories with my kids, an Adult Fan of LEGO (AFOL) with my own LEGO collection to fulfill my hobby, and, of course, just someone who loves the energy of the LEGO community and the continuous positive sharing of remarkable ideas.
I have one major goal with this book: I want this book to be a permission slip for you to build and make. Sometimes when we read books such as these, we build as suggested in the book and that is the extent of the creative process. Being an educator who has spent time in elementary and middle schools, I have learned that not providing the answer is the true facilitator of creativity. What I have created is a series of builds not only for you to explore the new LEGO Robot Inventor Kit but also the world of smart robots that impact our daily lives.
So, each chapter will explore a smart robot concept to explore along with a model robot to build. However, each build has been designed for you to add your own touch. You will see suggestions and ideas to apply the learning of the chapter into new layers of building. I hope you love the freedom to take the ideas and build your own version.
With this permission slip, I cannot wait to see what you create. Make sure you share!
Here we go. Let's go explore the new LEGO MINDSTORMS Robot Inventor Kit that is now available.
The audience of this book is robot enthusiasts, LEGO lovers, hobbyists of tinkering, educators, students, and anyone who is looking to learn about the new LEGO Robot Inventor Kit. The book is designed to go beyond basic builds to intermediate and advanced builds, but keeping it open enough to explore how to add personal flare to the builds and code.
Anyone can complete these builds regardless of background. If you have a growth mindset and love learning, then that is all you need to be successful with the robots in this book.
Chapter 1, History of MINDSTORMS, focuses on a very brief and quick history of the LEGO MINDSTORMS timeline. This chapter serves as information and context for this new MINDSTORMS Robot Inventor Kit 51515. It provides a backdrop of how we have arrived at this new kit.
Chapter 2, Getting Started with the Robot Inventor Kit, is focused on getting familiar with the various parts and components available in the LEGO Robot Inventor Kit and finishes with a small build to explore the basics of the kit.
Chapter 3, Building an Industrial Robot Claw, is focused on how the user can use different components available in the Robot Inventor Kit to build a working model of a robotic arm.
Chapter 4, Building a LEGO Guitar, is focused on combining robotics and music by using the Robot Inventor Kit to make a guitar that is playable and codable to our unique needs and musical tastes.
Chapter 5, Building a Scorpion, is focused on how to build a scorpion robot designed around the famous features of this creature. In particular, you will be building the stinger and a body style similar to a scorpion along with some additional features that the kit provides.
Chapter 6, Building a Solid Sumobot, is focused on how to build a sumobot that will endure battle in a sumo arena while utilizing sensors to be more effective in a strategy designed for success.
Chapter 7, Building a Dragster, is focused on how to build a dragster to see how it turns out in terms of speed and design.
Chapter 8, Building an Egg and Ornament Decorator, is focused on building a robot that will spin around objects such as eggs or ornaments for you to be able to design patterns using markers and other art materials.
Chapter 9, Creating Plankton from SpongeBob SquarePants Part 1, is focused on building the main component of Plankton for the robot to showcase animatronics.
Chapter 10, Creating Plankton from SpongeBob SquarePants Part 2, is focused on building the rest of Plankton by adding the final details to the build and programming the robot to be interactive.
To be successful and get the most out of this book, you will need the following materials and software:
If you are using the digital version of this book, we advise you to type the code yourself or access the code via the GitHub repository (link available in the next section). Doing so will help you avoid any potential errors related to the copying and pasting of code. The programming software can be used on computers and/or tablets/phone. You may want to explore and experiment with both platforms to find out what you prefer.
You can download the example code files for this book from GitHub at https://github.com/PacktPublishing/Smart-Robotics-with-LEGO-MINDSTORMS-Robot-Inventor/. In case there's an update to the code, it will be updated on the existing GitHub repository.
We also have other code bundles from our rich catalog of books and videos available at https://github.com/PacktPublishing/. Check them out!
Code in Action videos for this book can be viewed at http://bit.ly/2Ovna4w.
We also provide a PDF file that has color images of the screenshots/diagrams used in this book. You can download it here: http://www.packtpub.com/sites/default/files/downloads/9781800568402_ColorImages.pdf.
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: "You will drop in another Set Action block with the condition of 4 to activate that code sequence in our main program."
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: "Insert another If block nested in the Forever block and underneath our first If block."
Tips or important notes
Appear like this.
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.
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.
This chapter is going to focus on a very brief and quick history of the LEGO Mindstorms timeline. This chapter serves as information and context for the new Mindstorms Robot Inventor Kit 51515. It will provide a backdrop of how we have arrived at this new kit.
It is hard to believe that LEGO has been in the robotics environment for over 20 years. Today the educational and consumer world is saturated with robots. We see them everywhere, from toys to day-to-day life products, and all over the industrial and economic world.
Back in 1998, LEGO released Lego Mindstorms: The Robotics Invention System. There were some other products created by LEGO prior to this kit, but for all intents and purposes, we are going to focus on this first RCX Mindstorms kit, 9719, as the kicking-off point for our quick journey through the robotic systems over time.
The reason we are going to do a quick dive into the incredible history of LEGO Mindstorms is to realize how far technology has progressed and to pave the way for understanding what this new kit is providing us. I think it is easy to overlook how accessible some of this incredible technology has become to help us to learn and bring our ideas to life.
For the sake of brevity, we are only going to focus on the Mindstorms line. Please realize that there are so many other incredible products, such as the WeDo, STEAM Park, Coding Express, and Boost to name a few. There are even robot kits that were designed by LEGO prior to the RCX.
Finally, this chapter is not going to explore all the coding platforms and languages because that can get quite lengthy and complicated. If you are interested in learning more about coding platforms, then please explore the chart maintained by David Lechner and Seshan Brothers as it is the best reference of all that is possible; it can be accessed from the Further reference section at the end of this chapter.
In this chapter, we're going to cover the following main topics:
1998 – LEGO Mindstorms: The Robotics Invention System (RCX)2006 – LEGO Mindstorms NXT2013 – LEGO Mindstorms EV32020 – LEGO SPIKE Prime2020 – LEGO Mindstorms Robot Inventor KitFor this chapter, there are no technical requirements.
If we start several years prior to 1998 and look back to 1982, LEGO had a new product line called Technic (have you heard of it?). A few years into this new line of products, LEGO began to work with Seymour Papert (one of my educational heroes) to create programmable LEGO. Papert even has a book called Mindstorms (ironic?). One of Papert's colleagues, named MitchResnick (from MIT Lifelong Kindergarten), who I have had the pleasure of meeting, presented a prototype to LEGO in Billund and things started to take shape.
Fast forward to 1998, when LEGO released the Robot Command eXplorer (RCX):
Figure 1.1 – RCX 2.00 brick hub
You'll know this brick as the yellow brick that started a journey unlike any other – a powerful programming device with 32 KB of RAM with no USB (not available to the public until September 1998), no Wi-Fi (cell phones were just emerging with games such as Snake), or anything we would expect today. It used a LEGO IR tower to send code from the computer to the RCX brick. If you still have Windows 98, ME, or XP, you could still boot up and code today.
Cue the fond memories of the gray and orange NXT robotics kit. Heading back in time, I vividly remember hosting my first robotics summer camp for students when I found out I had access to seven of these kits. This was also the time when I first dipped my toe into the FIRST LEGO League:
Figure 1.2 – LEGO Mindstorms NXT brick
In 2006, LEGO updated the robot line with the NXT. I am sure many of you remember, recognize, or have fond memories of using the NXT. There were two versions of this kit, retail (8527) and educational (9797). Additionally, the kits had an upgrade to NXT 2.0 (8547). More importantly, the programming interface was LabVIEW, which is what many of us grew to love with the NXT and EV3. It was also with this robotic kit that there started to be a huge list of various programming languages made available by third parties if you did not want to use block-based coding.
In 2009, LEGO upgraded this kit with an NXT 2.0 (8547) that provided some updates with a new color sensor that was available in the retail version of this product. This brick allowed the user to program images and edit sounds. Additionally, it had four buttons to navigate on the brick. What I loved most about this kit was that there was a sound sensor that was provided in the education kit (9797). You could activate the robot based on sound. While this sensor went away in future kits, I find it fascinating that as we explore smart robots in this book, LEGO was ahead of its time as almost all of us now have an Alexa, Siri, or Cortana device that is activated by sound and voice.
In terms of the retail kits, the color sensor found in NXT 2.0 replaced the light sensor found in NXT 1.0 in the retail kit.
We now enter the era of LEGO robotics when almost everyone reading this book spent more hours than they care to admit building, programming, and designing robots using the LEGO EV3. Whether you build as a hobby as a child or Adult Fan of LEGO (AFOL), enter competitions such as FIRST LEGO League, teach in education settings, or simply just love using LEGO to bring ideas to life, we can all agree that the EV3 is a rather robust robotic kit that allows the builder to accomplish just about anything:
Figure 1.3 – LEGO Mindstorms EV3 brick
Because this kit has been around for a while, and also due to its popularity, there are so many third-party sensors and add-ons available that the sky is truly the limit when it comes to designing ideas.
Just like the NXT, LEGO released two versions of this kit. There was the retail version and the educational version. Again, builders used a version of LabVIEW to program, but recently you could also program this brick in Python to really push its capability. As technology and accessibility have improved, you could also do all the programming online using tools such as MakeCode, providing new pathways for people to get involved in programming.
There were some subtle differences between the two kits, but enough to make it worth mentioning:
Retail: Had a total of 601 pieces and included two large motors, one medium motor, one touch sensor, one color sensor, one infrared sensor, and one remote controlEducation: Had a total of 541 pieces and included one EV3 programmable brick, two large motors, one medium motor, two touch sensors, one color sensor, one gyroscopic sensor, and one ultrasonic sensorAdditionally, the education version also had an expansion kit (45560), which provided some new elements not seen before and bonus builds to really help engage students in new ways of building and programming.
The changes and upgrades in elements are interesting to follow as technology continues to change in our world all around us. Perhaps the most important feature to take note of as these kits continued to be upgraded is the fact that while the EV3 had a USB cable and Bluetooth like the NXT, it always allowed for Wi-Fi, bringing more opportunities to builders.
Regardless of the kit that you used, this has been our world. Builders have done some incredible things with these kits that really helped to transform LEGO from a toy to a legit product of engineering and coding marvel.
2020 ended up being a big year for LEGO. This kit was originally slated for release in August 2019, but it did not actually hit the market until January 2020. This is a fascinating kit to explore because it marked a shift to a new era of STEM, robotics, and marketing for the LEGO audience:
Figure 1.4 – LEGO SPIKE Prime brick
This kit is a LEGO Education product, but it is available on the main LEGO site. We see a transition away from making two kits, one retail and one education. Instead, it is available to all, which is a smart move as the boundaries of learning have become so intertwined, with virtual learning, homeschool, after-school events, and regular school.
This kit is designed for an upper elementary and middle school audience (grades 6–8). The builder will notice some changes from previous kits. First, the color scheme is brighter and more alive compared to the whites, grays, and blacks of the previous kits. There are a host of new elements that make building so much nicer.
Another big change is the move away from LabVIEW to a Scratch-based programming interface. Depending on who you are and your previous experience using LabVIEW, you'll either love or dislike this move. However, moving forward, having all the robot kits using one interface will make the product line much nicer to work with and interact with various kits.
One big difference between this kit and previous kits is the connectors. The connectors are a much thinner wire. While this will help with programming and building, it does mean that all of our previous sensors and motors are not compatible with these new kits. By the time this book is published, I am sure a third-party company will have devised an adapter, but in the meantime, we will have to use the new elements and only use the wires provided instead of finding the length that we desire.
The LEGO SPIKE Prime kit also has an expansion kit (45680) that contains over 600 more elements to build new projects and robots and to help make the robot competitive in events such as FLL.
Finally, SPIKE Prime contains many lessons, build guides, and more for parents and teachers to get started with their students/children with building on the LEGO Education website as well as in the software. This has always been a strong point of LEGO products, providing support and resources to go along with an amazing product. Even adults will find these useful to get used to the new coding interface that is Scratch-based versus LabVIEW.
It should also be noted that the LEGO SPIKE Prime is not technically in the official Mindstorms progression of robotic kits by LEGO, but it is included as it is so close to the new Inventor Kit and marks a shift in the new brick structure for LEGO. As we explore in Chapter 2, Getting Started and Understanding the Robot Inventor Kit, you will see many similarities between the SPIKE Prime and Robot Inventor, which is why this kit is included in this history of Mindstorms.
With this new design of the brick, you can program the LED matrix on the Intelligent Hub. It is worth noting that in previous models of the bricks, you could program the screen with graphics, words, and data. It is referred to as programmable LED due to the fact that the design approach to the screen has changed, using a 4x5 LED array.
All of this history brings us to the latest LEGO robotics kit, the LEGO Mindstorms Robot Inventor Kit (51515). Let's take a look at what we know about this kit.
First, just to be clear, this is the kit that is designed to be the new robot in the Mindstorms product line. The SPIKE Prime is designed for a specific age and this kit is the new version of the Mindstorms. You will notice on the LEGO site that EV3 is now marked as retiring soon.
There are many similar features that compare to the SPIKE Prime. First, the hub is the same, with a rechargeable hub. The hub works with an app to allow Bluetooth programming and building. The difference between the brick hubs is simply the color scheme. The Robot Inventor brick has a teal color while the SPIKE Prime has a yellow color:
Figure 1.5 – LEGO Mindstorms Robot Inventor Hub
We will explore in greater detail the new parts, elements, coding, platforms, and more in the next chapter, where we will take a deeper dive into the contents of the kit. That is the reason you are reading this book, so be prepared to learn about the kit through hands-on experience.
As we took a trip down memory lane, we witnessed how LEGO has evolved their products as technology, costs, and opportunities present themselves. It is crazy to think that this work has been going on since the 90s. Depending on your experience and when you first entered the Mindstorms world, we all have a favorite product. Whether you are a die-hard NXT fan, still hanging on to the glory of EV3, or excited about the new possibilities of the Robot Inventor Kit, we are fortunate to have such cool robotics to bring the ideas in our minds to life.
Change is always happening and sometimes we like change and sometimes we don't. As our world changes daily, so do the opportunities we have to build, program, and play. This latest kit by LEGO is going to provide us with so many wonderful opportunities to bring the ideas in our heads into the real world. Let's take a closer look at the new kit and explore the new elements included in the kit, along with some of the new programming features, so we can begin to understand the platform to design some smart robots.
In the next chapter, we will dive into the new parts, elements, coding apps, and more that come with the Mindstorms Robot Inventor Kit.
Let's get started with exploring the kit. We have over 900 elements to build robots, upgraded sensors, a new Intelligent Hub compared to previous versions, and new programming platforms to bring our robots to life and control:
Figure 2.1 – The front of the box when you get your hands on this amazing kit
To begin with, we are going to examine what the new elements in this kit are for us to build within our designs, how the sensors have changed, and the new Intelligent Hub. As we explore, we will take a closer look at some excellent features of this kit to start learning more about this LEGO Mindstorms product.
Finally, we will do some exploration of the new programming interface and how we use code to bring our ideas to life. The end goal of this chapter is to make sure you understand all the possibilities and to build a foundation of basic knowledge of the kit to begin to build some of the exciting ideas to follow in the upcoming chapters. This would also be a perfect time to build some or all of the five robots that come with the software to see how everything works and operates. There is not any specific building in this chapter, but it serves as an understanding of what can be achieved with the parts.
In this chapter, we're going to cover the following main topics:
Overview of the kitThe Intelligent HubNew elementsSensorsProgrammingBasic projects to learn moreOne of the creative constraints when designing the builds in this book is to only use the parts, sensors, and elements contained in the kit. There will not be any additional parts needed to complete any of these builds. You will need LEGO Mindstorms Robot Inventor Kit 51515.
For software, you will need to download the LEGO Mindstorms Inventor software on either your computer, phone, or tablet. Please check the site to ensure your hardware is compatible with the software. You can find all hardware compatibility information on the LEGO site at https://www.lego.com/en-us/service/device-guide/mindstorms-robot-inventor.
You can access the code for this chapter here: https://github.com/PacktPublishing/Smart-Robotics-with-LEGO-MINDSTORMS-Robot-Inventor/blob/main/Chapter%202%20Rock%20Paper%20Scissors%20Code.lms.
If you would like a more detailed photo-by-photo build process of the robot, please head here: https://bit.ly/3eS6Cif.
This kit comes with 949 elements to build, design, and bring your ideas to life. When you open the box, you will find that the inside of the box has outlines to organize your elements. However, I don't think that many will use this grid unless you are crafty and install some cardboard walls to make it usable. Additionally, to have both box pieces on a table occupies a lot of space. While a nice feature, it is better if you use a leftover Mindstorms storage container or any other sorting trays you have sitting around. Or you could be like most people and just dump all the elements and spend time trying to find that one piece.
Coming from the space of education, I miss the plastic tub with sorting trays. The latest tub from SPIKE Prime has two trays that come together, which is super nice. I really wish we had this with this kit.
The kit does not have a manual to build robots, but the software comes with five robot builds to help a builder learn some new build techniques and to get started with building robots. The software provides the builder with the build instructions, then you connect the Intelligent Hub, download the software, test to make sure it works, and then modify to make the build and/or the code to your own style. It is quite nice once you get started with the software to see what it all provides.
Here is what the kit provides:
One micro USB cable One Intelligent HubA sticker sheetOne base14 bags of building elements External sensors (one distance sensor, one color sensor)Motors (four small motors)A bookletWe will explore these parts in greater detail throughout this chapter to understand them better.
One of the biggest changes that the builder will notice right away is the cable connections. If you have not used SPIKE Prime and this is your first transition to the new Intelligent Hub, then you will notice that the cables are different. They are flat and smooth:
Figure 2.2 – Flat wires and wire clips
The kit comes with clips to help with wire organization and building, which is an excellent new upgrade to the building kits. No more rubber bands and looping cables. These clips are really nice to hide cables and manage them to allow your builds to look much more polished. The downside to these new cables is that these cables, sensors, and motors are no longer compatible with previous kits. If you are like me, then you'll have a lot of NXT and EV3 parts that you love that are no longer compatible with these new features. Another downside at this time is the cables are of fixed length. In previous kits, the cables were separate from the elements, so you had a wide range of wire sizes to fit your build. I am sure it won't be long before third-party companies create extensions, but in terms of the actual kit, all your wire lengths are the same, so plan your builds accordingly.
