Basic Mindstorms Sensors

Before you start experimenting with the sensors you should have a basic background information about how the sensors work. We will be looking at two basic sensors: the touch sensor and the ultrasonic sensor.

Langlands, Rob. “Lego Mindstorms EV3 Touch Sensor.” 2018. jpeg file

Touch sensor


The touch sensor has a button at the front that can be pressed. When the button is pressed the sensor sends a signal to the EV3 brick, the EV3 brick can then use this signal to make decisions about what it wants to do next.

You can think of the touch sensor as a light switch, when the switch is on (button is pressed) the light is on (signal to the brick). When the switch is off (button is not pressed) the light is off (no signal to the brick).

When you use the sensor in the Mindstorms program you will see there are three options for the touch sensor:

  • 0 (Released) – The button is not being pushed
  • 1 (Pressed) – The button is being pushed
  • 2 (Bumped) – The button has to be pushed first and then released
Langlands, Rob. “Lego Mindstorms EV3 Ultrasonic Sensor.” 2018. jpeg file

Ultrasonic sensor

The ultrasonic sensor looks like it has eyes and it can use these eyes to “see” what’s in front of it. The ultrasonic sensor can’t really see but it there is an obstacle in front of it the sensor can measure how far away the obstacle is.

The ultrasonic uses the same principle bats use to sense their environment: echolocation. The sensor sends out sound that we can’t hear (ultrasonic) and measures how long it takes for that sound to bounce of an obstacle and come back to the sensor. It then uses that time to calculate a distance.

There are different settings for using the ultrasonic sensor in the Mindstorms software, for this class you will always measure distance in centimeters (cm).



Get ready for Mindstorms

Photo Credit: dluders Flickr via Compfight cc

Install the software

Click here for the EV3 Software. Download the file and install it.

Get the Ultrasonic Sensor plugin

Click here to go to the download page. Scroll down, look for “EV3 software blocks” and click on the Ultrasonic sensor to download the block. Don’t delete the file after you install it:

  • Open the Lego Mindstorms EV3 program
  • Create a new Project (and Program)
  • Click Tools (text on the Menu bar, not the icon) –> Block Import Wizard
  • Click Browse and select the file (block) you just downloaded
  • Click Import
  • Restart the program (not your computer)

You are set up now to start using Lego Mindstorms EV3 on your personal laptop.