Skip to main content
Teacher Portal


The Little Red Robot Unit uses the story of Little Red Riding Hood as a vehicle to introduce the coding concept of “Drive until,” using the Eye Sensor to detect an object. The character of the Wolf will be introduced as an obstacle in the 123 Robot’s path, and students will explore how the “Drive until object” Coder card can enable their 123 Robot to stop in front of the Wolf, regardless of its position.

What is a sensor?

A sensor is, in essence, a device that helps a robot to understand the world around it. It does this by collecting and reporting data about its environment, which can then be used in a project to make the robot make decisions, or perform certain behaviors. This sequence can be thought of as a Sense → Think → Act decision loop.Image of Sense, Think, Act decision loop



A 123 Robot uses sensors to collect data from its surroundings (Sense), make decisions based on this information (Think), and turn that information into instructions for behaviors (Act).  

In this Unit, students will code the 123 Robot to detect the Wolf in its path to Grandmother’s house. The project students create carries out the Sense → Think → Act decision loop as the Eye Sensor will "Sense" the presence of an object (the “Wolf”), then it will "Think" or make a decision to stop driving when the object is detected, and then the 123 Robot will Act and stop moving forward.

What is the Eye Sensor?

The Eye Sensor on the 123 Robot is located on the front-facing side, below the white arrow. The Eye Sensor can be used to detect the presence or absence of an object, as well as its color or brightness level.

123 Eye Sensor

In this Unit, the Eye Sensor will be used to detect when an object (Grandmother’s house or the Wolf) is present in the path of the 123 Robot. The position of the Eye Sensor on the 123 Robot means that it can only detect objects directly in front of it. Be mindful of this when you are placing your 123 Robots and wolves with your students so that the materials are setting students up for success.

Correct and Incorrect 123 Setup

For more information about how to code the Eye Sensor with the Coder, see the Coding the VEX 123 Eye Sensor using the Coder VEX Library article.

Strategies for Teaching with the Coder in this Unit

The Coder offers an opportunity for students and teachers to engage with and share code easily, and tangibly, throughout a Lab’s activities. 

Supporting pre or early readers — Coder cards are designed to support pre-readers, or early readers, using icons to represent the words of the card itself, so students can essentially read the images if they cannot yet read the words. Encourage students to use these icon images to help them as they work to build their projects. Reinforce this by referring to the images on the Coder cards when you are naming them with students, like “The When start 123 Coder card, the one with the green arrow, always goes first.” 

Images on the Coder cards
Images on the Coder cards

Check and Share code easily — Once Coder cards are loaded into the Coder, students can hold up their Coder to show their code, just as they would hold up a whiteboard with a math solution on it. Use this strategy during group instruction, as a means for checking students’ accuracy before they start their projects. You can quickly and easily see if the correct Coder cards are used, if they are inserted in the correct order, and make sure that they aren’t upside down or backward. When checking in with groups to facilitate the independent activity, look to the Coders and Coder cards to check progress. 

To learn more about Using the Coder as a Teaching Tool, see this article in the VEX Library.

How does the “Drive until object” Coder card work?

The “Drive until object” Coder card uses data from the Eye Sensor to make the 123 Robot Drive forward until the Eye Sensor reports that an object is detected. When an object is detected, the 123 Robot will stop driving.

123 Drive until object block

This is useful in a project when the exact location of an object or obstacle is unknown, or cannot be planned for. In this Unit, students will first use the “Drive until object” Coder card to see that the 123 Robot can drive to Grandmother’s house successfully with the same project, no matter where it starts its journey. 

Two scenarios

How is sequencing used in this Unit?

Sequence is the order in which Coder cards are executed in a project. The Coder cards run beginning with the card inserted at the top of the Coder, then moving down one at a time. 

In this animation, you can see how the project starts with the “When start 123” card at the top of the Coder, then each Coder card is executed in order from top to bottom. The 123 Robot drives forward four spaces on a 123 Field. The green Highlight Feature on the left of the Coder indicates which individual Coder card is running at that moment. This can provide students with immediate feedback to connect the behaviors of the 123 Robot with specific Coder cards.

Video file

Steps for planning and sequencing Coder cards in a project

  1. First, identify the goal —what needs to be done? For example, drive from the start to Grandmother’s house.
    Identifying the Goal
  2. Then, break down the steps needed to accomplish the goal, and identify the Coder cards needed to accomplish these steps. Here you will need to move forward four steps to reach Grandmother’s house. This can be accomplished with four “Drive 1” cards.
    Steps to Coder Cards
  3. Next, plan the sequence of the project by laying out the Coder cards on the table. Once you are satisfied with their project plan, insert the Coder cards into the Coder beginning from the top and working down.
    Drive into Coder
  4. Select “Start” to test the project and see if the 123 Robot accomplishes the goal identified in the first step.
    Drive four TImes

If you want to change your project, simply remove the Coder cards from the Coder, rearrange the cards, and insert them back into the Coder to update your project.

What Coder cards do you need?

Coder cards represent 123 Robot commands that are inserted into the Coder and used to code the 123 Robot. Below is a list of the main Coder cards used during this Unit. See the Environment Setup section of the Summary in each Lab for more detailed information about organizing and distributing Coder cards to your students.

Coder card Behavior Example
When Start 123 block Starts the project when the ‘Start’ button on the Coder is pressed.  
drive 1 card

123 Robot will drive forward 1 robot length. This is equal to 1 square on the 123 Field.

Drive Forward 1
Drive Forward 2 123 Robot will drive forward 2 robot lengths. This is equal to 2 squares on the 123 Field. Drive 2
drive 4 card 123 Robot will drive forward 4 robot lengths. This is equal to 4 squares on the 123 Field. Drive Forward 4
Drive until object 123 Robot will drive forward until the Eye Sensor detects an object.  Drive Forward until detects object

Offer students additional Coder cards from the Looks or Sounds categories to expand their projects to scare away the Wolf in Play Part 2 of Lab 2. For a full list of Coder cards and their behaviors, see the VEX Coder Card Reference Guide VEX Library article.

Troubleshooting with the Coder

Coding with the Coder and Coder cards inevitably requires some troubleshooting and debugging. While this is a valuable part of the learning process, here are some solutions to the most common issues you may come across in this Unit:

  • The Coder cards fall out when moving the Coder — When having students hold up their Coders with Coder cards in them, remind them to hold it up straight, and not to tip it sideways. If tilted to the right (or the open side of the Coder), the Coder cards can fall out. Since left and right are not always reliable for young students, encourage them not to tilt the Coder in any direction.
  • A Coder card is oriented incorrectly — Remind students to make sure that their Coder cards are inserted in the correct orientation - with the words and images facing them, and the pictures on the right (or open side) of the Coder. If cards are upside down or backward, have students pull them out and reinsert them in the correct direction.
  • A Coder card slot displays a red light when running — If a red indicator light appears beside a Coder card, the Coder card may not be inserted completely into the slot. Remind students to push the Coder cards all the way in, or to take out and reinsert them, if this occurs.
Video file

For more information about how to use the Coder, see the Using the VEX 123 Coder VEX Library article.