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!
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
Digestion Dash: The Ultimate Body Adventure!

Digestion Dash: The Ultimate Body Adventure! Get ready to race through the human body in Digestion Dash! In this game, you’ll follow food on an epic journey—from the first bite all the way to the end. Along the way, you’ll play mini-games and learn how your digestive system turns food into nutrients your body can […]

Read More
Build a LEGO Elevator!

Architecture Week Challenge: Build a LEGO Elevator! Can you design and build a working elevator using LEGO Robotics? This week at Sprattronics Learning Lab, your mission is to take your minifigures from low to high—just like real engineers do in skyscrapers around the world! Watch the Challenge Video First Before you start building, watch this […]

Read More
Can You Design a Video Game About Animal Senses?

Can You Design a Video Game About Animal Senses? Your Challenge Create a video game where the main character survives using its senses. You’ll need to: Your mission is to design a game that shows how animals sense, process information, and respond in order to survive. Why Animal Senses Make Great Video Games Animals experience […]

Read More
Interactive Weather Game

Interactive Weather Game: Learn the Water Cycle by Controlling a Cloud If you’re looking for a hands-on way to teach the water cycle and basic weather science, this browser-based game offers an engaging, intuitive experience. Players control a cloud, collect water vapor, release rain, and watch plants grow as they explore how water moves through […]

Read More
LEGO Baseplate Builder

Free 16x16 LEGO® Plate Builder: Create Custom LEGO Challenge Cards Unlock your creativity and kickstart your next building session with the Sprattronics LEGO Plate Builder. This free digital tool is designed specifically for educators, parents, and LEGO fans to design 16x16 LEGO Challenge Cards in seconds. Whether you are looking for a quick STEM warmup or a way […]

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