Reader small image

You're reading from  Design Innovative Robots with LEGO SPIKE Prime

Product typeBook
Published inJan 2022
PublisherPackt
ISBN-139781801811576
Edition1st Edition
Concepts
Right arrow
Author (1)
Aaron Maurer
Aaron Maurer
author image
Aaron Maurer

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 classrooms K-12. Aaron is also a former FIRST LEGO League coach for 8 years with much success working with phenomenal kids. He has a Master Educator License with endorsements in 5-12 Psychology – 163; 5-12 World History – 166; 5-12 American History – 158; 5-12 Computer Science – 278; PK-12 Talented and Gifted – 107; 5-8 Middle School Generalist – 182; and K-8 Computer Science – 277. Currently, Aaron is a member of ISTE Making It Happen Award; Lego Education Ambassador and Master Educator; PBS Digital Innovator and All-Star; PITSCO Tag Committee; Microsoft Innovator Educator Expert; Microsoft Innovative Educator Fellow; Global Learning Mentor (formerly Skype Master Teacher); Minecraft Global Mentor; and Makey Makey Ambassador. Finally, Aaron was a finalist for the Iowa Teacher of the Year in 2014.
Read more about Aaron Maurer

Right arrow

Chapter 4: Building a Mechanical Bird

Biomimicry is the study and application of products, systems, mechanisms, and solutions to problems based on biological processes and functions found in nature. It is incredible what you can learn from plants and animals to find solutions to your own problems.

One of the many fascinating animals on our planet is the bird. It is a creature that has some features that are perfect for robot building and creating mechanisms. In this chapter, you are going to build a mechanical bird robot designed around the major features of this creature. You will be building wings and a body to look like a bird flying looking for prey.

Here is what your bird will look like by the end of this chapter:

Figure 4.1 – This is what your build will look like by the end of this chapter

In this chapter, we will break down the building and programming as follows:

  • Building the body frame of the mechanical bird
  • Building the...

Technical requirements

For the building of the robot, all you will need is the LEGO SPIKE Prime Kit. For programming, you will need the LEGO SPIKE Prime app/software.

Access to the code can be found here: https://github.com/PacktPublishing/Design-Innovative-Robots-with-LEGO-SPIKE-Prime/blob/main/Chapter%204%20-%20Bird.llsp.

You can find the code in action video for this chapter here: https://bit.ly/32is4IH

Let's start building it!

Building the body frame of the mechanical bird

The beauty of this robotics kit is that you can easily get started with any type of build because of the new pieces that are included. You are going to use the two yellow 11x19 base plates to create a platform for the bird to be built upon:

  1. Connect these two yellow base plates using two black connector pins along the long side of the base plates.

    Figure 4.2 – Connecting two yellow base plates together

  2. Add two azure 11x15 open frames to each end of the base you just assembled. Use two black connector pins on each end pin hole along with one gray perpendicular four-pin element to secure each open frame in place.

    Figure 4.3 – Attaching two azure open frames to the yellow base plates

  3. Now that the base frame is built to keep the bird in flight, it is time to build the frame of the body of the bird. Start with the Intelligent Hub. On each side of the Intelligent Hub, secure a purple 7x11 open frame using two gray...

Building the wings of the mechanical bird

  1. In order to have a quality-looking bird, you need wings that move and flap just like you see in the wild. These next steps will help create the mechanism for the wings to flap:

  2. Inside each of the purple 7x11 open frames, insert a medium motor using two gray bush stop pins on the top and bottom of the side of each motor.

    Figure 4.8 – Inserting the two medium motors

  3. Just like all previous builds in this book, be sure your motors are in the 0 position by aligning the gray dots on the motor gear and frame. Once you have double-checked the alignment, attach a yellow 3L beam to each of the motors using a tan axle pin and a black connector pin. Once the 3L yellow beam is attached, add another black connector pin to each of the elements on the bottom pin hole.

    Figure 4.9 – Adding yellow 3L beams to medium motors

  4. To add the wing structures, follow these steps:
    1. Start by adding an azure 13L beam to the black connector pin on each of...

Building the head and torso

  1. With the wings now ready, let's continue to build the body to cover up some of the wing mechanisms and bring the bird to life:

  2. To begin this next section, attach the large motor to the top of the Intelligent Hub using four black connector pins. This motor will be used to rotate the head of the bird.

    Figure 4.14 – Attaching the large motor to the Intelligent Hub

  3. On the underside of the large motor, insert a gray 5L axle beam on the motor.

    Figure 4.15 – Inserting an axle beam on the large motor

  4. You are now going to build a submodel that will be used to build out the legs of the bird. Begin this submodel by inserting a tan connector pin on a yellow axle and pin connector #6. In Figure 4.16, you will see what the submodel will look like when complete in the upper right-hand corner:

    Figure 4.16 – Inserting a tan connector pin onto the yellow axle and pin connector

  5. Stack two white axle and pin connector elements using two yellow...

Writing the code

The code for the mechanical bird will use the ultrasonic sensor as both the eyes and to trigger movement. The goal is to mimic a bird in flight looking for prey, so we will work to ensure the legs move with the head gesture as well as the wing mechanics.

The ports

You will connect the ultrasonic sensor into port B. You will plug the large motor into port F. You will plug the two medium motors into ports C and D.

Figure 4.35 – Port view in the software

Calibrating the motors

This first code stack will make sure that the head and wing motors are all set to position 0 before being activated to ensure everything works smoothly and properly:

  1. Under the when program starts block, insert a purple light up block that activates the lights on ultrasonic sensor B lighting up to 0 0.
  2. Add a pink movement block named set movement speed to and make it 15%.
  3. Add a blue set speed to motor block, set it to 10%, and change it to...

Activating the bird

This is just short sample code to get your bird started. You can continuously tinker with your code, changing various settings in the code as well as on the bird to get the bird working the way you choose.

While tinkering, here are some things I tried and found that I liked:

  • Adjust the pins of the blue beams connected to the medium motors for different wing angles and movements.
  • Adjust how the eyes blink, changing the light patterns.

Remember, the beauty of imagination and creativity is taking new learning and transforming it into whatever you desire. Let's explore some other ideas to spark your imagination.

Making it your own

Just like every build, the challenge here is to take this build and code and modify it to your needs. Here are some ideas to explore if you desire:

  • Program the LED on the Intelligent Hub to mimic feather movement.
  • Use the force sensor to trigger another behavior.
  • Add sound effects.
  • Build a model of food that can be clutched in the talons of the bird.

It is now up to you to transform your bird into the creature of your imagination. The possibilities are endless!

Summary

In summary, we explored how to make a mechanism powered by a motor to give the movement of wings of a bird in flight. You explored some new build techniques by using some of the basic elements that are found in the kit to help give a more realistic movement of the legs moving with the head while flying.

Finally, we explored the coding by using code stacks to make decisions. The eyes and head move if the power of motor C is not at 0. Once this motor stops, so do the head and eyes.

In the next chapter, you will explore building another robot by having a go at perhaps the most popular build idea – the sumobot.

lock icon
The rest of the chapter is locked
You have been reading a chapter from
Design Innovative Robots with LEGO SPIKE Prime
Published in: Jan 2022Publisher: PacktISBN-13: 9781801811576
Register for a free Packt account to unlock a world of extra content!
A free Packt account unlocks extra newsletters, articles, discounted offers, and much more. Start advancing your knowledge today.
undefined
Unlock this book and the full library FREE for 7 days
Get unlimited access to 7000+ expert-authored eBooks and videos courses covering every tech area you can think of
Renews at €14.99/month. Cancel anytime

Author (1)

author image
Aaron Maurer

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 classrooms K-12. Aaron is also a former FIRST LEGO League coach for 8 years with much success working with phenomenal kids. He has a Master Educator License with endorsements in 5-12 Psychology – 163; 5-12 World History – 166; 5-12 American History – 158; 5-12 Computer Science – 278; PK-12 Talented and Gifted – 107; 5-8 Middle School Generalist – 182; and K-8 Computer Science – 277. Currently, Aaron is a member of ISTE Making It Happen Award; Lego Education Ambassador and Master Educator; PBS Digital Innovator and All-Star; PITSCO Tag Committee; Microsoft Innovator Educator Expert; Microsoft Innovative Educator Fellow; Global Learning Mentor (formerly Skype Master Teacher); Minecraft Global Mentor; and Makey Makey Ambassador. Finally, Aaron was a finalist for the Iowa Teacher of the Year in 2014.
Read more about Aaron Maurer