LEGO Mindstorms and SPIKE Prime are great products with vast capabilities, but are often so complex that many people don't know how to use them. LEGO provides a walk-through of a few projects to build, which are cool, but after building these many people get stuck on "now what?" This book answers that question by showing the underlying principles required to build their own ideas.
This book is a hands-on tour of how machines work with LEGO-there's nothing like building a machine with your own two hands to understand how it works. It includes aspects of software engineering, mechanical engineering, and electrical engineering. As parts and associated engineering concepts are presented, they will be shown in their practical use with graphical step-by-step assembly instructions.
The concepts conveyed are mostly learned through building examples, with text explanation to reinforce the ideas being learned. Every engineering concept has a building example to go with it, in a quick build of less than 15 assembly steps. At the end of each chapter there's a project to tie the concepts of the chapter together of a little more complexity, involving 15 to 30 steps. These assembly steps are drawn with a computer aided design program that looks like the diagrams that LEGO produces for its products, so readers will be familiar with the look of the assembly directions.
What You'll Learn
Who This Book Is For
The knowledge presumed in this book is basic familiarity in building with LEGO, having past experience with building a set of moderate complexity of more than a 100 pieces. Basic familiarity with operating a personal computer is also assumed, such as to install an app.
Likely interested readers are: LEGO fans looking for ways to build new and better inventions, middle-school and high-school age students who have an interest in science, math, and engineering, adults who like to learn how things work and tinker with inventions, and educators who use the SPIKE Prime set and are looking for new ideas for lesson plans.
Grady Koch is the author of several books about LEGO and the founder of the website hightechlego.com. He has a Ph.D. in Electrical Engineering and 35 years of experience as a research engineer at NASA Langley Research Center, where he has built optical and laser instruments that have been flown on aircraft and orbited the Earth. He has three patents in the field of lidar for studying the atmosphere and is the author or contributor of over 200 journal and conference publications. Throughout his career, Dr. Koch has mentored many interns and found that students sometimes need a little help in making the transition of what they've learned in classroom to real-world practice. These ideas of applying knowledge to practice are incorporated into his LEGO books.
Chapter 1: The Hub
Assembling and Charging the Hub
Controls and Displays
Front Panel Buttons
Displays and Speaker
LEGO Mounting Points
Exercise: The Motor Spinner
Building the Motor Spinner
Activating the Motor
Project: The Distance Spinner
Building the Distance Spinner
Using the Distance Spinner
Summary
Chapter 2: Programming
Using the Robot Inventor App
Installing and Updating the App
The Interface
Connecting the Hub
Updating the Hub Operating System
Exploring the Hub Screen
The Program Design Process
Writing the Algorithm
Drawing the Flowchart
Writing the Code
Coding in Word Blocks
Writing the Program
Writing Comments
Coding in Python
The Completed Program
Importing Code
Creating an Object and Assigning it to a Variable
Displaying Text on the Hub Screen
Beeping the Hub Speaker
Setting the Center Button Light
Waiting Ten Seconds
Ending the Program
Downloading and Running Code
Debugging and Troubleshooting
Project: The Dance Floor
The Word Blocks Code
The Python Code
Defining a Variable
Beginning the Loop and Checking for a Button Press
Setting the Center Button Light Color
Beeping the Hub Speaker
Lighting Up a Pixel
Setting the Tempo with a Delay
Incrementing a Variable
Checking the Value of a Count
Summary
Chapter 3: Building Elements
Liftarms
Straight Liftarms
Bent Liftarms
Rectangular Liftarms
Connecting Liftarms
Pins
Axles and Bushes
Exercise: Building Triangular Structures
Connectors
Exercise: Building Symmetric Objects with Connectors
Project: Mechanical Linkages
The Universal Joint
The Eccentric
Summary
Chapter 4: Gears
Gears in the MINDSTORMS Robot Inventor Set
Spur Gears
Beveled Gears
Speeding Up Rotation, or "Gearing Up"
Slowing Down Rotation, or "Gearing Down"
Exercise: The Many-Geared Machine
Direction of Rotation
Calculating the Gear Ratio for more than two Gears
Exercise: The Torque Demonstrator
Lowering Torque by Gearing Down
Increasing Torque by Attempting to Raise the Speed (and Failing)
Exercise: The Compound-Gear Spinner
Project: Two-Speed Transmission
Summary
Chapter 5: Mechanisms
Exercise: The Ratchet
Exercise: The Cam
Exercise: The Differential
Assembling the Differential
Building the Differential Demonstrator
Exercise: Turntables
Project: The Mechanized Cannon
Summary
Chapter 6: Motors
Speed and Angle
Exercise: The Speed and Angle Demonstrator
Controlling the Motor's Speed in Word Blocks
Controlling the Motor's Speed in Python
Setting the Motor's Angle in Word Blocks
Setting the Motor's Angle in Python
Exercise: Understanding Torque and Stall
Exercise: Powering a Vehicle with a Tank Drive System
Building the Tank
Programming the Tank
The Word Block Code
The Python Code
Exercise: Using a Motor as a Rotation Sensor
Building the Position Mimic
Programming the Position Mimic
The Word Blocks Code
The Python Code
Project: The Rear-Wheel Drive Car
Building the Rear-Wheel Drive Car
Programming the Rear-Wheel Drive Car
The Word Blocks Code
The Python Code
Summary
Chapter 7: The Motion Sensor
Tilt Angle: Yaw, Pitch, and Roll
Exercise: Programming with Tilt Data
Measuring Tilt Angles in Word Blocks
Measuring Tilt Angles in Python
Orientation
Exercise: Generating Cat Sounds Based on the Hub's Orientation
The Word Blocks Code
The Python Code
Other Motion Sensor Measurements: Gyro Rate and Acceleration
Project: The Up Pointer
Building the Up Pointer
Programming the Up Pointer
The Word Blocks Code
The Python Code
Summary
Chapter 8: The Distance Sensor
Using the Distance Sensor
Exercise: The Ultrasonic Tape Measure
Programming the Ultrasonic Tape Measure
The Word Blocks Code
The Python Code
Project: The Scanning Cannon
Building the Scanning Cannon
Programming the Scanning Cannon
The Word Blocks Code
The Python Code
Summary
Chapter 9: The Color Sensor
Exercise: The Brightness Beeper
Programming the Brightness Beeper
The Word Blocks Code
The Python Code
Project: The Color Sorter
Building the Color Sorter
The Baseplate
The Chute
The Pusher
The Basket
Final Assembly
Programming the Color Sorter
The Word Blocks Code
The Python Code
Summary
Appendix: Parts lists for Exercises and Projectsapter 1: The Hub.- Chapter 2: Programming.- Chapter 3: Building Elements.- Chapter 4: Gears.- Chapter 5: Mechanisms.- Chapter 6: Motors.- Chapter 7: The Motion Sensor.- Chapter 8: The Distance Sensor.- Chapter 9: The Color Sensor