Skip to main content

Lesson 1: What is a Bumper Sensor?

In this Lesson, you will learn what a sensor is and why you would use sensors with a VR Robot. The first sensor that you will learn about is the Bumper Sensor. You will learn how the Bumper Sensor works and how to use the VR Robot Bumper Sensors in a VEXcode VR project.

Learning Outcomes

  • Identify that the Bumper Sensor is a type of switch.
  • Identify that the Bumper Sensor reports a value of either FALSE (released) or TRUE (pressed).
  • Identify that the Bumper Sensor can be used to cause a VR Robot action when pressed or released.
  • Identify that the <Pressing bumper> block is a Boolean that reports if the Bumper Sensor is pressed.
  • Describe why the Bumper Sensor would be used in a VEXcode VR project.

Bumper Sensor

The VR Robot has two Bumper Sensors located on the front.

Front of the VR Robot. Two Bumper Sensors on the front of the robot are shown in bright orange with a red box surrounding them. One sensor is on the front right of the robot the other is on the front left.

A Bumper Sensor is a switch that reports if it is pressed or released.

  • The Bumper Sensor will report a sensor value of TRUE when the Bumper Sensor is pressed.
  • The Bumper Sensor will report a sensor value of FALSE when the Bumper Sensor is released.

The Bumper Sensor is pressed by walls in the Wall Maze Playground, or by the outer walls surrounding other Playgrounds.

VR Wall Maze Playground. The camera angle shows a 3/4 view of the Field with the VR robot in front. This shows that the wall maze has 3d walls that the robot will collide with if driving forward.

The Bumper Sensor is used to determine if the VR Robot is touching an object or wall. Use the <Pressing bumper> block in a VEXcode VR project to check the condition of the Bumper Sensor.

Read the Bumper Sensor - Robot Features - VEX VR article for detailed information on how the Bumper Sensor works.

<Pressing bumper> Block

<Pressing bumper> is a Boolean reporter block. It reports TRUE if the Bumper is pressed, and FALSE if it is not pressed.

Bumper pressed block in VEXcode that reads Left Bumper pressed question mark. The block is hexagonally shaped.

Using Switch Blocks

This is the Switch <Bumper pressed> block.

Hexagonal shaped switch block with the following Python command inside: left underscore bumper dot pressed. A set of parentheses is at the end of the command.

The <Pressing bumper> block is used with blocks from the Control category that accepts hexagonal Boolean blocks.

VEXcode VR workspace with the Control category of blocks shown in the toolbox to the left hand side.

In the following example, the VR Robot will drive forward until the Left Bumper is pressed. Once the Left Bumper is pressed, the VR Robot will stop driving.

VR Project with a when started block and four blocks attached beneath. The blocks read drive forward, wait until left bumper pressed, stop driving. The LeftBumper Pressed block is nested inside of the wait until, so it reads as one command.

Apply

Sensors are essential to robotics. For a VR Robot to truly be considered a robot, it must be able to sense and interact with its environment. This is commonly referred to as the Sense → Think → Act decision loop.

Flowchart that shows the Sense Think Act loop. The Sense section has a sub-label that reads sense the environment. An arrow points from Sense to Think. Think has a sub-label that reads Make decisions based on sensor data from environment. An arrow points from Think to Act. Act has a sub-label that reads Carry out decisions. An arrow points from Act to Sense.

A VR 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).

Sensors enable a VR Robot to interact with its environment, and allow the user to create more dynamic projects. These dynamic projects require a VR Robot to interact and respond to changing environments.

In this Unit, you are introduced to the Bumper Sensor, a sensor that can detect physical contact. The Bumper Sensor is used to inform a VR Robot when it has made contact with an object or wall. A VR Robot can then use the reported information from the Left Bumper Sensor to make decisions. In the example below, the VR Robot will drive forward, then make a 90 degree right turn after the Left Bumper Sensor is pressed, detecting contact with an object or wall.

VR Project with a when started block and four blocks attached beneath. The blocks read drive forward, wait until left bumper pressed, turn right for 90 degrees. The LeftBumper Pressed block is nested inside of the wait until, so it reads as one command.

Questions

Please select a link below to access the lesson quiz.

Google Doc / .docx / .pdf