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:
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 kit
- The Intelligent Hub
- New elements
- Basic projects to learn more
One 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.
Overview of the kit
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 Hub
- A sticker sheet
- One base
- 14 bags of building elements
- External sensors (one distance sensor, one color sensor)
- Motors (four small motors)
- A booklet
We will explore these parts in greater detail throughout this chapter to understand them better.
The cables for motors and sensors
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:
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.
One other change to the kit from previous models is the lack of a remote. In previous models, you had an IR sensor and remote. In this kit, you use your phone or another Bluetooth-enabled controller. I don't think many will have any issues with this and will be excited to pair their Xbox or PlayStation controllers to their robots. The possibilities with Bluetooth are going to really open up some exciting features.
Let's dive into some specific parts and pieces worth exploring.
The Intelligent Hub
Another upgrade to this kit from previous versions is the size of the Intelligent Hub. The Hub is much smaller, which allows for more unique builds especially when combined with some of the new elements. The bulkiness of the EV3 and NXT is no longer going to be an issue. The way the Intelligent Hub is designed allows the builder to position the Intelligent Hub in a variety of ways to allow more easily building designs:
The LED screen is one of the most noticeable changes to the Intelligent Hub. In previous models, we had a screen where the programmer could program on the Intelligent Hub and have various elements of text, data, and graphical images displayed on the screen. On this Intelligent Hub, we are given a 5x5 LED screen. The days of programming on the Intelligent Hub are gone with this new design. However, keep in mind that it is now so much easier to get your programs to the Intelligent Hub. Once your Intelligent Hub is paired to your software, you can make changes instantly, so this feature is no longer needed.
The new Intelligent Hub has an LED design that reminds me of my 8-bit glory days of playing Tetris. These LED blocks allow you to gather some basic data on your sensors, then switch programs, and you are able to write out words that scroll across the screen. Additionally, you use the arrow buttons to scroll through your programs and you are able to store 10 programs.
Using the large button on the Intelligent Hub, you can gather some quick data and test your sensors and motors by plugging them in and gaining some quick information.
The Intelligent Hub has the gyro sensor built in. In the EV3, the gyro was a sensor we had to attach much like the touch, color, and ultrasonic sensors. This is a nice touch to the Intelligent Hub especially now that the Intelligent Hub has been reduced from eight ports to six. While at first you might be sad to only have six ports, remember this could prove to be helpful as these six ports can be both input and output. Looking back at the EV3, it had four ports for motors and four ports for sensors. The new Intelligent Hub allows the user to use any port for any motor or sensor. If you have been using EV3 for as long as I have, then you'll realize that this means you could potentially have six motors running off the hub or six sensors, whereas in the previous models, we were limited to four or fewer.
The Intelligent Hub also contains an accelerometer, an internal speaker, and a rechargeable lithium-ion battery. These functions expand the Intelligent Hub to allow the builder to do some really exciting projects. We will explore some of these features later, but it is a great reminder that the Intelligent Hub now serves as more than just the brains of the operation. It has several new features to expand what we can do with our robots without having to use ports. For example, you can now run your program tethered to your device or connect via Bluetooth for a wireless experience, as well as using your phone/tablet as a controller.
For the sake of exploring the kit, I would like to highlight a few key elements that I believe are great to have that the previous EV3 kit did not provide.
A quick note about the elements is that while many of the pieces are not necessarily new, there are several that come in the kit that are in a very nice-looking teal color. This will be a huge bonus for many builders looking to expand and coordinate their builds to have a more polished look. Teal is a great color choice, allowing the build designs to look really sharp. It is a great added color compared to the white, gray, and black of EV3 while not feeling too colorful like the SPIKE Prime. I like the colors of both kits, but I really like having choices in how my robots look.
Let's examine a few specific elements that come in the kit that are worth exploring a bit more deeply.
I fell in love with this piece when I purchased the SPIKE Prime kit. That kit provided two of these. The Robot Inventor provides one of these in that wonderful teal color, which is a very beautiful color scheme with this kit:
This plate allows the builder to build right upon it for stationary robots as well as a starting point for other robot builds, such as a vehicle or another mechanism. The possibilities this element provides the builder are huge. It is the piece I wish I always had.
The kit provides six of these tires. These tires are great. They are all the same 56 mm size and are all black. They are one piece that is nice compared to the previous wheels. They are easy to clean for smooth driving and having six of these wheels to build with will allow the builder to build some excellent designs:
There are three sizes of these elements that come in the kit. These black frames provide a nice way to build some larger robots and to build more secure structures. You don't realize how much you need these elements until you build with them. Once you have them in your collection, you come to depend on them quite a bit:
The kit comes with a new gear differential that I know many builders will love. I do not have an extensive history with this aspect of building, but from what I have read and discussed, this piece will prove to be quite useful as builds on vehicles and robots are designed and built:
I love that this kit comes with two mudguard elements. What I love about these elements, and all elements of LEGO, is that while the pieces were designed for a purpose, they can be remixed for all sorts of new ideas. As you explore the kit, consider how you can use pieces in new ways. For example, these elements could prove to be helpful in designing a moving mouth, handles to carry, the frame of a face, and so on:
This piece might be my favorite, but as an educator, it would easily be a headache! I know this kit does not come with a touch/force sensor, but the fact that it comes with two of these is great for coming up with new ideas. While there is fun in creating robots that shoot projectiles, such as Blast, which is one of the five builds, these can prove to be helpful in some other build ideas. And who doesn't love to launch projectiles?! This is a great addition to this kit to increase engagement and excitement:
Next, let's look at sensors!
This kit is limited when it comes to external sensors. In previous kits, the builder was given a variety of sensors to use. Keep in mind that while this kit only provides two external sensors, there are sensors built into the Intelligent Hub. Overall, you are given the following sensors:
- Inbuilt sensors:
- External sensors:
The Intelligent Hub itself contains an accelerometer and gyroscope, which is great as you can use the data they collect to write some quality code with your robots. Another neat feature of the Intelligent Hub and these sensors are the gesture controls that allow the builder to create code based on tap, free fall, and shake using these sensors:
There are a few more details worth mentioning. The color sensor has been upgraded compared to previous versions. The color sensor is able to identify a small dose of color to make decisions. The sensor can also detect eight colors. Finally, it can identify these colors in both dark and bright light, which is very helpful. The sensor allows the coder to use color and reflection light.
The distance sensor is relatively similar to previous models except for a few changes. First, it has lights around the eye parts of the sensor that can be activated. The builder can program these lights, which is a cool feature.
The sensor is more accurate than previous models, but the range has been reduced from 250 cm to 200 cm. This will not impact many builders but is worth noting. You can choose distance settings of inches, centimeters, or percent.
Overall, the kit provides the builder with four motors and two sensors along with the sensors built into the Intelligent Hub itself, providing countless opportunities for building and coding.
This kit provides the builder with four motors. These motors have a top speed of 185 RPM along with a max torque of 18 Ncm. Additionally, the motors have sensors that allow you to gather data on both speed and position when using the app. One thing you will notice is that these medium motors are smaller than the medium motors of previous kits, but are much easier to build within your designs. This is a nice feature to allow the builder to create more fluid and precise builds. The shape also allows for easier builds than previous models where the motors had some unique shapes that could challenge how the builder created their creations:
The new motors are different from the NXT and EV3 motors. In the previous kits, you were able to put an axle all the way through the motor. These new motors do not allow the builder to do this build. At first, I did not like this, but I realized quickly that it did not prevent any builds from being successful.
One key advantage to these motors is their absolute positioning. This helps with the alignment of motors and to have more precise positioning when using robots that require motors to be synced.
Now that we have a better understanding of the elements of the kit, it is time to explore the software to bring the builds to life.
Using the Mindstorms software, you can adjust the sensor settings by clicking on the sensor icon and adjusting as needed. The following screenshots show how you can use the software to gather data on your motors and sensors and make the necessary adjustments to the needs of your build:
- In order to access the Hub connection, you will need to open up a new program or any existing program you have already started.
- In the upper right-hand corner, there is an Intelligent Hub icon that you will click on to open up the interface:
You will notice a green dot on the upper right corner of the brick icon which means the Hub is connected. If the color dot is pink then that means your Intelligent Hub is disconnected.
- You will see this screen that will showcase all the motors and sensors currently plugged in and activated on the Intelligent Hub:
- Select a motor or sensor and click the white triangle below the icon to choose the various types of data readings that you can use for your projects:
- For the inbuilt sensors, click on the sensor you want to see the information for, and then move your Intelligent Hub around to see the data readings change:
When you boot up the software, you will have the choice to build any of the five robots already loaded up for you to build and use the code provided. Follow the instructions online provided in the software. If you need more information about the software and hardware and details about the kit, then head to https://www.lego.com/en-de/themes/mindstorms/about and you will get what you need from this page.
I find having the software on a computer or laptop for coding is quite helpful because of the larger screen and being able to store programs into my system. It is a good idea to have the software installed on your tablet or phone because these are good for the remote control feature of the software. Explore all the options to find what works best for you as a designer.
To get started, with version 10.0.3 (713488), LEGO updated the software to give you an option to get a quick overview of the sensors and builds and how they work with the Intelligent Hub. If you have any experience with Mindstorms, then you won't necessarily need this, but it is a great addition for those who are new to the Mindstorms robotics systems.
However, this little build and coding activity is a great start to explore much of the content shared in this chapter.
Beyond this quick intro screen, you are prompted right away with the screen featuring the five robot builds, where you can choose any of them and build, code, and expand based on all the activities each robot provides.
This is a great time to explore these builds if you want to learn more about what this kit can do. These builds will give you ideas on how to build certain parts of robots as well as seeing how the coding platform operates. While this chapter has been mostly informative, take the time to build these models to experience what this robot kit is capable of making:
Once you have had your fill of those robots, then it is time to begin to build your own projects. When you are ready to create your own builds and programs, you can scroll down to Other and get started on your ideas.
You will have the choice to program with blocks or Python, as shown in the following screenshot:
When you choose Word Blocks, you will get a Scratch-like interface to explore and build. This is a drag-and-drop application. You can see how the software looks when you choose the block coding option:
The software is a Scratch-based programming platform. It uses a drag-and-drop coding process that many will already be familiar with if you have used Scratch, Blockly, MakeCode, or Code.org, and so you will be quite comfortable with the interface. The layout of colors on the black backdrop makes it easy to organize, find blocks, and explore the interface.
If you are looking to see even more blocks and add your Xbox or PlayStation controller, be sure to add the necessary extensions to your software by clicking on the gray-outlined blocks at the bottom of your screen, as shown here:
There is also a Python coding option within the software that will allow those who know how to program in Python to really push the boundaries of coding. This is a very important feature to bring this kit to the next level of experience and expertise. The following screenshot showcases what the Python coding interface looks like in the software if you wish to go down this route:
I know that not everyone knows how to code in Python, so for the sake of this book, we will stick with the graphical interface for ease of understanding.
Having both options to code and program within the software is a huge bonus to prior kits. The option for text programming is going to allow the LEGO community to see some incredible projects being developed.
If you are new to Python, there is a manual icon on the side of the screen to help you see how the blocks look in Python, named Knowledge Base:
Once you click on the Knowledge Base icon, you will be provided with a menu of options to help with your learning and coding journey. Simply choose the topic you need help with, as shown in the following screenshot:
The one fundamental difference to this programming environment compared to the LEGO SPIKE Prime kit is that lessons are missing. Of course, this is designed for retail instead of education like the SPIKE Prime, so that makes sense, but it's still worth pointing out. However, please check out the lessons to expand your skills as there is compatibility between the two. You can find the lessons here: https://education.lego.com/en-us/lessons?products=SPIKE%E2%84%A2+Prime+Set.
When you boot up the software, there are no introductions or any quick demos. Instead, you have to decide to build one of the five robots to get started, or hopefully, you have enough confidence to get started without guidance. One bonus of this software is that with each robot build, there are several activities to expand on the robots to learn some new build techniques and use to inspire the building of your own creations.
One crucial part of the programming software is being able to access data from your motors and sensors. You can access the Intelligent Hub through the software to gather all the data on your motors and sensors to be able to enhance your coding and build ideas.
On your software interface, at the top left of your screen, you can see some basic data or you can click on the Intelligent Hub icon to open up a new screen to dive deeper:
Creating a rock, paper, scissors wrist game
So far, you have been doing a lot of reading, so let's take some time to do a quick build that covers some of the concepts shared about this new and exciting kit. You are going to build a fun little game of rock, paper, scissors that you can wear on your wrist.
You will need the following parts:
- One Intelligent Hub
- 12 black connector pins
- One black 7x11 open frame
- Two black 5x7 open frames
- Two teal 9L beams
- Two gray H connector brackets
- Eight gray connector pins with a stop bush
Locate four black connector pins. Flip the Intelligent Hub over to the back side and insert the four pins into the middle pin holes on the top and bottom of the Hub:
It is time to locate the following parts:
- Two teal 9L beams
- Four black connector pins
Be sure to leave the bottom pin hole of the open frame open:
- One black 7x11 open frame
- Four black connector pins:
You need to locate the following parts:
- Two gray H connector brackets
- Eight gray connector pins with a stop bush:
Use these parts to secure the bottom open frame to the sides of this build. If you want to add this to your wrist, insert your wrist first and then secure it with these parts. If you have a tiny wrist, then hold onto the side so it does not fall off when you shake it playing the game!
Coding a rock, paper, scissors wrist game
You are now going to code this wrist game to be able to randomly choose rock, paper, or scissors. You can play it against yourself or use it against another human. If you have a friend that has a kit, then you can both build one and compete this way:
- Using the default yellow when program starts block, add a purple Light block named write Hello. You will need to change the word from Hello to Left:
- Add two yellow Events blocks named when Left Button pressed. Make one that activates when the setting is set for the left button and the second block set for the right button.
- Go to the pink My Block sections of the coding blocks and make two new blocks. Name one
start gameand the other
playagain. Add these new blocks to the yellow blocks. Add the start game block for the left button and playagain for the right button:
- In the previous step when you created these blocks, you should have seen two new pink blocks show up in your coding canvas named define playagain and define Start Game. Locate define playagain:
- Under the define playagain block, add a sound effect by adding a purple play sound block named play sound Cat Meow until done. Change the audio file to one of your choice. Under this block, add a Light block named turn on Smiley Face for 2 seconds. Click the face and change the graphic to your choice. In this example, an
Xwas made. Add another light block underneath this one, turning off all the lights. Finally, add a final purple Light block named write Hello and change Hello to Left.
- You will follow a similar process for the other define Start Game block. Locate this pink block. Add a purple play sound block named play sound Cat Meow until done. Change the audio file to your choice. Add a purple Light block named turn on Smiley Face for 2 seconds. Change this block to the number
3in the graphical interface and change it from
1second. Right-click the purple play sound block you just added and choose duplicate. Duplicate these two blocks two times so you don't have to keep dragging blocks. Change the
2and the other to a
1to create a countdown timer. Last, create another pink My Block and name it
Rps. Add this block to the end of this code:
- Add a purple Light block named turn on and change the smiley face to the four squares in the corners.
- Add an orange Control block named wait until. Add a blue Sensor block of Hub is shaken to the diamond space.
- Go to the orange Variable block and make a variable named
Rps_Random. Add the set Rps_Random block to the code. Use a green Operator block named Pick Random and select numbers 1-3.
- Add an orange Control block named If. Drag in a green Operator block that compares with the = sign. On one side of the equals sign, add your Rps_Random block, and on the other side, insert the number
- Within that If block, add a purple Light block named turn on and turn on all the lights to symbolize paper.
- Add one more purple Light block named set Center Button light to and choose a color.
- Right-click this If block you just created and duplicate it two more times. For these two copies, change the numbers to
1. Change the design from paper (all lights) to a smaller square for rock for one, and for the other, design a pair of scissors.
- Add an orange Control block named Wait and choose
5seconds so that you have time to see your game choice.
- Add a purple Light block named write Hello and change it to
In the end, your code should look like this:
How it works is the game will tell you Left on the screen to indicate to press the left button. This will trigger the start game My Block, which will do a countdown timer to show your choice. Once it counts down, it will then move to Rps, where the code will wait for you to shake the Intelligent Hub before displaying a choice of rock, paper, or scissors. After it displays the choice for 5 seconds, it will then tell you Right, so when you press the right button, it will reset the screen and wait for you to press left again to play the game.
Making your own game
- Design your own icons for rock, paper, and scissors.
- Convert this to a flip a coin (heads or tails) game.
- Convert this game from rock, paper, scissors to the rolling of a die. Can you rewrite the code so that when you shake the Intelligent Hub it mimics the random roll of a die?
- Add an option where you can choose from the three games to play/use.
To wrap up this chapter, let's do a quick review of what we covered. We explored the overall look of the new LEGO Mindstorms Robot Inventor kit. We examined the parts and elements that come with the kit, along with the sensors. Additionally, we took some time to look at the programming software.
Now that we have a basic understanding of the kit and some featured elements, let's finally get to the building of robots. Let's take what we have learned to start building some fun smart robots to challenge our thinking and creativity.
If you have not taken the time to build any of the five robots that are in the software, I would encourage you to take some time to build them and explore the ideas shared. None of these builds are required for the builds in this book, but they do provide a good foundation for the parts and building.
A few of these builds will reference certain build features from these five builds to showcase how these ideas inspire new ideas.
In the next chapter, we will start with a robot arm and claw, a classic build that is always great to build to explore the parts, programming, and use of sensors.