Controller 2.4G (PS2) × EV3 × EV3 Classroom

Interactive tutorialEV3

First time? Try the interactive tutorial in your browser first, then follow the steps below with your hub.

This page covers EV3 Classroom (Scratch blocks) only: how to set it up for the Controller 2.4G (PS2) on MINDSTORMS EV3, how to read every value, the commands it supports and examples. Use the switcher above to change product, host or software.

Setup

What you need

  • Sensor: Controller 2.4G (PS2) (EV3 edition, RJ12 plug). A SPIKE edition is not recognised on an EV3.
  • Brick: LEGO MINDSTORMS EV3.
  • Cable: the standard cable in the box, or an original LEGO EV3 cable.
  • Software: LEGO MINDSTORMS EV3 Classroom (Scratch-style blocks, the same as SPIKE). The easiest start for first-time EV3 users.

Install the software

  1. Install EV3 Classroom from the LEGO Education download page.
  2. To open an example: download the .lmsp file → "Open" on the EV3 Classroom home screen → connect the EV3 → "Download and Run" at the bottom right.

Make the software see the sensor

No extension and no driver needed. On the EV3 the sensor emulates an original LEGO sensor (most products show up as an "Infrared Sensor"); use the built-in sensor blocks.

  • Classroom blocks look like Scratch, but the modes are exactly the same as in the official EV3 software: Proximity / Beacon / Remote, with the same ranges. See the readings below.
  • Some products come with MBC My Blocks. They are already inside the example projects; open an example and they are there.

Important

Do not switch modes in the middle of a program. Every time the EV3 switches a sensor mode it stalls for about 1 s. Pick one mode at the start and use it for the whole run.

Wiring

  1. Plug the sensor into EV3 port 1 with the cable (any of 1~4 works; choose the same port in the blocks).
  2. Turn the EV3 on first, then plug in the sensor.
  3. Latch up, push the plug in gently.

Connect the gamepad to the receiver

The PS2 2.4G gamepad and its receiver are paired at the factory; no pairing button needed.

  1. Connect the receiver and turn the controller on.
  2. Switch the gamepad on; it connects by itself.
  3. Watch the green LED on the receiver: on = no gamepad yet; off = gamepad connected.
  4. The ANALOG (or MODE) light on the gamepad must be on for the sticks to give values. The receiver switches to this mode on connect; if the light is off, press the ANALOG button in the middle of the gamepad.

Caution

2.4 GHz is a shared band (Wi-Fi, microwave ovens). With 12 or more sets in use at one venue they may interfere; in that case use the Bluetooth version (PS4 / PS5).

Tip

How to use the Controller PS2 with EV3, the SPIKE App and Pybricks blocks is also summarised in the command guide (PDF).

First test

  1. Download the .lmsp of example 1 on this page, open it, connect the EV3 and press "Download and Run".
  2. If the number on the EV3 screen changes with what is in front of the sensor, everything is connected.

FAQ

  • The number never changes? Unplug the sensor and plug it back in (the EV3 must be on first).
  • Some examples have no Classroom version? Examples marked "Pybricks / EV3 MicroPython / clev3r only" use a mode the Classroom blocks cannot read.
  • The program hiccups now and then? It switches sensor modes; each switch costs about 1 s. Use one mode only.

Reading values

The EV3 sees a stock LEGO sensor; read it with the stock Classroom sensor blocks.

d-pad dpad

d-pad
Range Meaning
0~15 bit Up 1, Right 2, Down 4, Left 8 (added when pressed together), 0~15; 0 when not connected
Value Block Decode Mode
d-pad Infrared Sensor → Proximity the value mode 0

shape buttons shape

shape buttons
Range Meaning
0~15 bit Triangle 1, Circle 2, Cross 4, Square 8 (added when pressed together), 0~15; 0 when not connected; high nibble of 0x22 'R'
Value Block Decode Mode
shape buttons Infrared Sensor → Beacon heading, channel 2 the value mode 1

shoulder buttons shoulder

shoulder buttons
Range Meaning
0~15 bit L2 1, R2 2, L1 4, R1 8 (added when pressed together), 0~15; 0 when not connected
Value Block Decode Mode
shoulder buttons Infrared Sensor → Beacon heading, channel 3 the value mode 1

function buttons func

function buttons
Range Meaning
0~15 bit SELECT 1, L3 2, R3 4, START 8 (added when pressed together), 0~15; 0 when not connected; high nibble of 0x22 'G'
Value Block Decode Mode
function buttons Infrared Sensor → Beacon heading, channel 4 the value mode 1

stick LX / LY / RX / RY stick

stick LX / LY / RX / RY
Range Meaning
-100~+100 (EV3 mode 1, mode 2, mode 4 give a scaled value: 0~99 (50 = centre)) 10 LX, 11 LY, 12 RX, 13 RY: −100 to +100, 0 = centre, right / up positive (raw 0255 with ±7 dead zone); 0 when not connected. EV3 / SPIKE / MATRIX carry 099 (50 = centre) or 1~9 (5 = centre), see each platform
Value Block Decode Mode
LX Infrared Sensor → Beacon proximity, channel 1 the value: 0~99 (50 = centre) mode 1
LY Infrared Sensor → Beacon proximity, channel 2 the value: 0~99 (50 = centre) mode 1
RX Infrared Sensor → Beacon proximity, channel 3 the value: 0~99 (50 = centre) mode 1
RY Infrared Sensor → Beacon proximity, channel 4 the value: 0~99 (50 = centre) mode 1

Not readable here:16 buttons, connected, battery, L2 analog, R2 analog, system keys, gamepad type. Use Pybricks / clev3r for these.

Commands

The EV3 port is read-only, so this software cannot send commands: calibrate with the button on the sensor and change settings over Arduino I2C, mBlock or micro:bit.

Examples

Example 1: Button tester: see the number of every button

What this example does: Mode 1 sends 8 numbers at once: 4 button groups and 4 stick values. This example shows them all on the screen; press and push everything and you will know each value.

What you need:

  • Controller PS2 2.4G receiver (EV3 edition) + gamepad
  • EV3 brick

How to connect: 2.4G receiver in port 1. Turn the PS2 gamepad on; a steady light on the receiver means it is paired.

Download the program (pick your software):

⬇ EV3 Classroom

EV3 Classroom blocks

Controller PS2 Button tester: see the number of every button(EV3 Classroom)

(Too small? Click the picture to open it full size.)

Step by step:

  1. Clear the screen
  2. Repeat forever
    • D-pad: up 1, right 2, down 4, left 8
    • Shape buttons: ▲1, ●2, ✕4, ■8
    • Shoulder buttons: L2 1, R2 2, L1 4, R1 8
    • Function buttons: SELECT 1, L3 2, R3 4, START 8
    • Left stick left/right (50 = centre)
    • Left stick up/down (50 = centre)
    • Right stick left/right
    • Right stick up/down
    • Wait 0.1 s

What you should see: With nothing pressed the buttons read 0 and the sticks 50. Pressing two buttons adds the numbers, for example up + right = 3.

FAQ:

  • The buttons do nothing? Run example 1 first to see if the numbers change. If not, the gamepad is not connected: power-cycle the gamepad, or turn the EV3 on before plugging in the receiver.
  • The robot keeps creeping after you release the stick? The stick centre is not always exactly 50: lower the × 2 in the program, or add a rule "treat 45~55 as 50".

Example 2: Drive with the D-pad

What this example does: Mode 0 reads only the D-pad: up = forward, down = backward, left/right = spin on the spot, release = stop.

What you need:

  • EV3 brick + Education base robot (left wheel on B, right wheel on C)
  • Controller PS2 2.4G receiver (EV3 edition) + gamepad

How to connect: 2.4G receiver in port 1. Turn the PS2 gamepad on; a steady light on the receiver means it is paired.

Download the program (pick your software):

⬇ EV3 Classroom

EV3 Classroom blocks

Controller PS2 Drive with the D-pad(EV3 Classroom)

(Too small? Click the picture to open it full size.)

Step by step:

  1. Repeat forever
    • If D-pad = 1 (up)
      • Up pressed: forward
      • Otherwise:
        • Otherwise, if D-pad = 4 (down)
          • Down pressed: backward
          • Otherwise:
            • Otherwise, if D-pad = 8 (left)
              • Left pressed: spin left
              • Otherwise:
                • Otherwise, if D-pad = 2 (right)
                  • Right pressed: spin right
                  • Otherwise:
                    • Nothing pressed: stop

What you should see: Hold a D-pad button and the robot moves; release it and the robot stops.

FAQ:

  • The buttons do nothing? Run example 1 first to see if the numbers change. If not, the gamepad is not connected: power-cycle the gamepad, or turn the EV3 on before plugging in the receiver.
  • The robot keeps creeping after you release the stick? The stick centre is not always exactly 50: lower the × 2 in the program, or add a rule "treat 45~55 as 50".

Example 3: Left stick controls one motor speed

What this example does: A stick reads 099 with 50 in the middle. Subtract 50 and multiply by 2 to get the -100+100 a motor wants: push further to go faster, push down to reverse.

What you need:

  • EV3 brick
  • One large motor on B
  • Controller PS2 2.4G receiver (EV3 edition) + gamepad

How to connect: 2.4G receiver in port 1. Turn the PS2 gamepad on; a steady light on the receiver means it is paired.

Download the program (pick your software):

⬇ EV3 Classroom

EV3 Classroom blocks

Controller PS2 Left stick controls one motor speed(EV3 Classroom)

(Too small? Click the picture to open it full size.)

Step by step:

  1. Repeat forever
    • Power = (left stick up/down − 50) × 2
    • Motor B runs with power
    • Show the current power on screen

What you should see: Push the left stick up and motor B runs forward, faster the further you push; push down to reverse; release to stop, the screen shows about 0.

FAQ:

  • The buttons do nothing? Run example 1 first to see if the numbers change. If not, the gamepad is not connected: power-cycle the gamepad, or turn the EV3 on before plugging in the receiver.
  • The robot keeps creeping after you release the stick? The stick centre is not always exactly 50: lower the × 2 in the program, or add a rule "treat 45~55 as 50".

Example 4: Two-stick tank drive

What this example does: Left stick drives the left wheel, right stick drives the right wheel, like a tank: push both forward to go forward, one forward and one back to spin.

What you need:

  • EV3 brick + Education base robot (left wheel on B, right wheel on C)
  • Controller PS2 2.4G receiver (EV3 edition) + gamepad

How to connect: 2.4G receiver in port 1. Turn the PS2 gamepad on; a steady light on the receiver means it is paired.

Download the program (pick your software):

⬇ EV3 Classroom

EV3 Classroom blocks

Controller PS2 Two-stick tank drive(EV3 Classroom)

(Too small? Click the picture to open it full size.)

Step by step:

  1. Repeat forever
    • Left wheel power = (left stick up/down − 50) × 2
    • Right wheel power = (right stick up/down − 50) × 2
    • Each wheel runs with its own power

What you should see: Push both sticks forward and the robot drives forward; left forward and right back and it spins right.

FAQ:

  • The buttons do nothing? Run example 1 first to see if the numbers change. If not, the gamepad is not connected: power-cycle the gamepad, or turn the EV3 on before plugging in the receiver.
  • The robot keeps creeping after you release the stick? The stick centre is not always exactly 50: lower the × 2 in the program, or add a rule "treat 45~55 as 50".

Example 5: ✕ to grab, ● to release: control a gripper

What this example does: Use the shape buttons to control a medium motor (gripper) on port A: ✕ closes, ● opens, nothing pressed stops.

What you need:

  • EV3 brick
  • Medium motor on A (built as a gripper)
  • Controller PS2 2.4G receiver (EV3 edition) + gamepad

How to connect: 2.4G receiver in port 1. Turn the PS2 gamepad on; a steady light on the receiver means it is paired.

Download the program (pick your software):

⬇ EV3 Classroom

EV3 Classroom blocks

Controller PS2 ✕ to grab, ● to release: control a gripper(EV3 Classroom)

(Too small? Click the picture to open it full size.)

Step by step:

  1. Repeat forever
    • If shape buttons = 4 (✕)
      • ✕ pressed: gripper turns to close
      • Otherwise:
        • Otherwise, if shape buttons = 2 (●)
          • ● pressed: gripper turns to open
          • Otherwise:
            • Nothing pressed: gripper stops

What you should see: Hold ✕ and the gripper closes, hold ● and it opens, release and it stops.

FAQ:

  • Close and open are swapped? Swap 40 and -40.
  • The buttons do nothing? Run example 1 first to see if the numbers change. If not, the gamepad is not connected: power-cycle the gamepad, or turn the EV3 on before plugging in the receiver.
  • The robot keeps creeping after you release the stick? The stick centre is not always exactly 50: lower the × 2 in the program, or add a rule "treat 45~55 as 50".

Note

These examples have no version for this software: Example 6: Start only when the gamepad is connected

More questions

  • The EV3 shows an infrared sensor? Expected: the sensor emulates a LEGO sensor so the stock blocks can read it.
  • A short freeze when switching modes? The EV3 needs about 1 s per mode change. Stick to one mode during a run.

Still stuck? Contact us with your software and a screenshot of the program.

Downloads

Sources

  • Host and software list:_build/guides.json
  • Values and commands:_build/protocol/ps2.json (single source of truth)
  • Setup:_build/guides/software/ev3-classroom.en.md、_build/guides/product/ps2/ev3-classroom.en.md
  • Examples:sensors/ps2/ev3-examples.md
Email for a quoteBuying Guide