April 16, 2026

Control a LEGO Spike Robot with Motion: Using the Gyroscope

Control LEGO Spike Essential with Motion: Using a Gyroscope

Introduce

Today we are going to learn how to control a robot in a completely different way. Instead of pressing buttons or using a controller, we will use motion. The LEGO SPIKE hub has a built-in gyroscope that can detect how it is tilted, and we will use that to drive our robot.


Engage

Think about the different ways you control things in your life.

  • How do you change the channel on a TV?
  • How do you control a remote control car?
  • What do you use to play a video game?

All of these use buttons, joysticks, or touch controls.

What if you could control something just by moving your hand?
Have you ever played a game where you tilt a device to steer?

Today, your hand becomes the controller.


Build & Explore

You are going to build a simple driving robot using:

  • Two motors
  • Two wheels
  • A stable base
  • A sliding piece or support on the front

Important challenge:

  • The hub cannot be attached to the robot
  • You must hold the hub in your hand to control it

As you build, think about:

  • How can you keep your robot balanced?
  • How can you make it turn smoothly?
  • Where should the wires go so they don’t get in the way?

Once built, explore:

  • What happens when you tilt the hub forward?
  • What happens when you tilt it left or right?

Explain

The hub contains a gyroscope. A gyroscope measures orientation and movement.

It tracks three types of motion:

  • Pitch: tilting forward and backward
  • Roll: tilting side to side
  • Yaw: rotating left and right

We use this data in our code to control the motors.

For example:

  • Tilt forward → robot drives forward
  • Tilt backward → robot reverses
  • Tilt left → robot turns left
  • Tilt right → robot turns right

When the hub is flat, the robot should stop.

You will use movement blocks with two motors to control direction, and tilt blocks to detect motion.


Elaborate

Now that your robot works, how can you improve it?

Try these ideas:

  • Add a stop block at the start of each command to prevent glitches
  • Adjust motor speed for smoother driving
  • Redesign the base to make it more stable
  • Add decorations to turn your robot into a vehicle or character

Think bigger:

  • Could this control system be used in a wheelchair?
  • How might this help control machines in hard-to-reach places?
  • How could you use tilt control in a game or another robot design?

Evaluate

Answer these questions to show your understanding:

  1. What does a gyroscope measure?
  2. What are pitch, roll, and yaw?
  3. Why do we use two motors with movement blocks?
  4. Why might the robot behave incorrectly if commands overlap?
  5. How does adding a stop block improve performance?
  6. What is one way you improved your robot design?

Sprattronics Learning Lab

Maximize your education!
Arctic Animal Science: Reindeer Adaptations

1. Introduction & Build Welcome to the Arctic Tundra! The Arctic tundra is a challenging place to live. Temperatures can become extremely cold, snow can cover the ground, and finding food can become difficult. Yet reindeer survive here year after year. How do they do it? Reindeer have special adaptations that help them survive in […]

Read More
Arctic Animal Science : Walruses

Welcome to the Arctic Ocean! The Arctic Ocean is the smallest and shallowest of Earth's five oceans. It surrounds the North Pole and is one of the coldest ocean environments on Earth. Much of the Arctic Ocean is covered by sea ice, especially during the coldest parts of the year. Even though the environment is […]

Read More
Arctic Animals: Engineering in a Frozen World

Welcome to the Arctic! The Arctic is the far northern region of Earth. It surrounds the North Pole and includes everything north of the Arctic Circle, an imaginary line located at about 66.5° north latitude. The Arctic is one of the coldest places on Earth. Much of the land is treeless, and the region is […]

Read More
Get the Gold

Get the Gold! LEGO® Education Computer Science & AI Grade 3 - 5 Unit 1 • Lesson 1 Student Sheet Mission A treasure of gold is waiting! Your job is to build a horse and carriage, then write a program that helps your robot travel from the castle to the gold and safely back home […]

Read More
LEGO Education Computer Science & AI Kit: The Ultimate Getting Started Guide

LEGO Education Computer Science & AI Kit: The Ultimate Getting Started Guide You Placed Your Order and the Kit is on the Way... Now What? Congratulations! You've ordered the LEGO Education Computer Science & AI Set. Whether you're a classroom teacher, homeschool parent, after-school educator, or robotics enthusiast, you're about to unlock dozens of engaging […]

Read More
Control a LEGO Spike Robot with Motion: Using the Gyroscope

Control LEGO Spike Essential with Motion: Using a Gyroscope Introduce Today we are going to learn how to control a robot in a completely different way. Instead of pressing buttons or using a controller, we will use motion. The LEGO SPIKE hub has a built-in gyroscope that can detect how it is tilted, and we […]

Read More
linkedin facebook pinterest youtube rss twitter instagram facebook-blank rss-blank linkedin-blank pinterest youtube twitter instagram