LEGO® Education SPIKE™ Prime Sensors

Dec 2020

Sensors provide robots with information about their environment. With the sensors that come with SPIKE Prime, you can make a robot respond to being touched, react when someone or something comes too close, follow a line, or determine its orientation.

Force sensor (touch, tap, force)

The force sensor gives your robot a sense of touch. The touch sensor detects when it is being pressed or released. It can even be programmed to wait until it is both pressed and released (we call this bumped).

Key features

  • Sensor sample rate: 100Hz
  • Touch sensing activation zone: 0-2mm
  • Force sensing activation zone: 2-8mm
  • Activation on force: 2.5-10 newtons
  • Resolution 0.1 newtons
  • Accuracy +/1 0.65 newtons

Challenge suggestions

  • Create a "cookie clicker"-style game that display the number of times a force sensor has been pressed.
  • Build a robot hand (or venus fly trap!) that closes when something touches it.
  • With one or two force sensors, create a simple remote control. Set the motor speed proportional to the amount of force.
  • Make a robot begin its programmed action when a touch sensor is pressed. This is particularly useful if, for example, the buttons on the EV3 bricks are difficult to reach.

Color sensor (color, light)

The color (or colour) sensor can detect color as well as intensity of reflected or ambient light. It can also be use as a light source.

The color sensor has three different modes: color, reflected light intensity, and ambient light intensity.

  • Color senors modes (UK version)

    Color - In this mode, the colour sensor can differentiate eight different LEGO® colors. Each LEGO color is also represented by a value (see "Color and light data table" below). The sensor can also output the raw red, green, and blue (RGB) values separately.
  • Reflected light intensity - In this mode, the color sensor emits a light and measures the amount reflected back into itself from the surface you are testing. The intensity of the light is measured as a percentage from 0 to 100, with 0 being very dark, and 100 being very bright.
  • Ambient light intensity (Python only)- In this mode, the colour sensor measures the amount of light in its environment, without producing its own light source. Ambient light intensity is measured as a percentage from 0 to 100, with 0 being very dark, and 100 being very bright.

Key features

  • Sensor sample rate: 100Hz
  • Optimal reading distance: 16 mm (depending on object size, color, and surface)
  • LED output
    • Color: white - temperature 4000K
    • Controlled individually (3 LEDs in total)*
    • Output power: controllable from 0-100%*

*Note: At the time of writing, these functions aren't supported in the SPIKE App.

Challenge suggestions

  • Sort LEGO bricks based on their colour.
  • Drive across different coloured pieces of paper, responding to each colour with a different action
  • Create a barcode reader.
  • Program your robot to respond to masking tape placed on dark carpet.
  • Program a robot to stop when it reaches the edge of a table (ie. it detects no reflected light)
  • Follow the edge of a black line on a light background. As with detecting colour, for best results, the colour sensor needs to be between 1-2 cm away from the surface you are trying to measure.
  • Program your robot to respond differently based on the amount of light in a room, or if another light source shone onto the robot, such as a torch.

Colour and light data table

ModeOutput rangeColour-1 = No object0 = Black (LEGO:26; R:0, G:0, B:0)1 = Bright reddish violet (LEGO:124; R:144, G:31, B:118)

3 = Blue (LEGO:23; R:30, G:90, B:168)

4 = Medium azur (LEGO:322; R:104, G:195, B226)

5 = Green (LEGO:28; R:0, G:133, B:43)

7 = Yellow (LEGO:24; R:250, G:200, B:10)9 = Red (LEGO:21; R:180, G:0, B:0)

10 = White (LEGO:01; R:244, G:244, B:244)

Reflected light0% = no reflection, 100% = very reflectiveAmbient light

(Python only)

0% = dark, 100% = bright

Distance sensor (distance)

The distance sensor measures distance to an object or surface using an ultrasonic transceiver (meaning that it both sends and receives ultrasonic signals). The sensor works by sending out high frequency sound waves that bounce off any object in range, and measuring how long it takes the sound to return to the sensor.

The sensor can also be used as an output device, using four light segments around the "eyes" that can be controlled individually.

Additionally, the back of the sensor can be removed and the cable dettached, effectively becomming a LEGO Power Functions 2.0 (LPF2) breakout cable. This may provide some opportunities for 3rd-party developers and advanced users. For example, see Mindsensor's Breadboard Connector Kit.

Key features

  • Distance Sensing from 50 to 2000 mm
  • Fast distance sensing from 50 to 300 mm
  • White light output around the sensor “eyes” divided into four segments – two upperand two lower segments

Challenge suggestions

  • Program a robot to move around a room, avoiding objects in its path.
  • Drive towards an object or a wall, slowing down as it gets closer.

Gyroscope/accelerometer (rotation/orientation)

The SPIKE Prime Hub

In addition to the sensors described above, the SPIKE Prime hub itself has a number of built-in sensors. These include a three-axis gyroscope and a three-axis accelerometer.

The gyro sensor detects rotational motion in three axes. For each axis, the sensor measures the rate of rotation in degrees per second and keeps track of the total angle of rotation in degrees.

 

• Accelerometer/tilt mode (three-axis) • Gestures as tap, free fall, and shake

orientation (i.e. front, back, top bottom, right side, left side)

acceleration and angular velocity

Image from https://commons.wikimedia.org/wiki/File:Yaw_Axis_Corrected.svg

 

Challenge suggestions

  • Program your robot to turn a specified angle.
  • Program a robot to detect if it has fallen over.
  • Display how far your robot has turned.
  • Create a balancing robot.

Large and medium motors (rotation)

Both the large and medium motors are equipped with an internal rotation sensor. The rotation sensor can be used to measure how far a motor has turned (or has been turned). Rotation sensors can detect an amount of rotation in degrees or full rotations. You can also use the rotation sensor to find out what power level a motor is currently running at.

ZERO!!!

Challenge suggestions

  • Create a combination lock.
  • Create a trundle wheel, by attaching a wheel to the motor and using it to display the distance travelled.

Sensors included in the core and expansion sets

Here's a summary of the sensors included in the SPIKE Prime core and expansion sets

SensorCore Set (45678)Expansion Set (45680)Force sensor10Color sensor11Distance sensor10Medium motor (rotation)20SPIKE Prime Hub (gyro, accelerometer)10

 

Related Articles

Up Arrow
FEEDBACK
Up Arrow