On the EV3, the SharpShot Vision shows up as a LEGO Infrared Sensor, so you do not import a library or add an extension: you read it with the Infrared Sensor blocks. Proximity gives the camera mode number, the heading and proximity of the 4 beacon channels are the 8 main values, and the 4 remote channels are 4 more values. What each value means depends on the mode chosen in the camera menu. Work down the steps on the left and the blocks on the right grow with you; these pictures were taken in EV3-G after opening each program (English interface).
Verified on EV3 hardwareRun on real EV3 bricks on 2026-11-03 with shipping firmware v1.0-261101: the stock EV3 firmware (EV3-G infrared blocks, all 13 camera modes read slot by slot) and Pybricks v4 examples 1~4; ev3dev / EV3 MicroPython v2 checked against the mode table only (same as the LEGO infrared sensor). The EV3 edition cannot take commands from the hub; switch camera modes in the camera MENU.
1
Start: Start block + Loop, pick the camera mode
You read the sensor again and again, every 0.1 seconds.
Open the EV3 software (EV3-G) and make a new project.
Drag a Loop from the orange Flow Control tab and attach it after the green Start block (it repeats forever by default).
Drag a Wait block into the loop, choose the Time mode and set it to 0.1 seconds.
Plug the camera into port 1 with an EV3 cable (the hub powers it). Choose the camera mode and sub-option in the camera's MODE menu and click the same mode number below (mode number = camera mode × 10 + sub-option). The table in step 2 changes to what each value means in that mode.
2
Meet the reading blocks (Infrared Sensor)
Drag the Infrared Sensor block from the yellow Sensors tab and pick a Measure mode at the bottom left (Proximity, Beacon or Remote); the number at the top right is the port: choose 1. The table shows, for the mode you picked in step 1, which mode reads each value, what you get and how to read it:
Every value is a whole number from −127 to 100. Keep one program on Beacon (or on Remote) only: every infrared mode change makes the EV3 pause for about 1.1 seconds. To split tens and ones, use the math blocks: divide by 10 and round down, and the remainder after dividing by 10.
See the table for all 13 modes
Mode number 11 = Colour tracking ① Max colours
Block
What you get
Range
Read
Measure → Proximity
Camera mode number (e.g. 13 = colour tracking ③ standard, 51 = object detection ① list)
11–52
①
Measure → Beacon, channel 1: Heading
Colour 1 X×10+Y (8×6 grid)
0, 11–86
②
Measure → Beacon, channel 1: Proximity
Colour 2 X×10+Y (8×6 grid)
0, 11–86
②
Measure → Beacon, channel 2: Heading
Colour 3 X×10+Y (8×6 grid)
0, 11–86
②
Measure → Beacon, channel 2: Proximity
Colour 4 X×10+Y (8×6 grid)
0, 11–86
②
Measure → Beacon, channel 3: Heading
Colour 5 X×10+Y (8×6 grid)
0, 11–86
②
Measure → Beacon, channel 3: Proximity
Colour 6 X×10+Y (8×6 grid)
0, 11–86
②
Measure → Beacon, channel 4: Heading
Colour 7 X×10+Y (8×6 grid)
0, 11–86
②
Measure → Beacon, channel 4: Proximity
Colour 8 X×10+Y (8×6 grid)
0, 11–86
②
Measure → Remote, channel 1
Colour 9 X×10+Y (8×6 grid)
0, 11–86
②
Measure → Remote, channel 2
Colour 10 X×10+Y (8×6 grid)
0, 11–86
②
Measure → Remote, channel 3
Colour 11 X×10+Y (8×6 grid)
0, 11–86
②
Measure → Remote, channel 4
Colour 12 X×10+Y (8×6 grid)
0, 11–86
②
① tens = camera mode, ones = sub-option (e.g. 13 = colour tracking ③ standard)
② tens = X cell (1–8, left→right), ones = Y cell (1–6, bottom = 1); 0 = not seen. In pixels: X ≈ tens×20−10, Y ≈ 129−ones×20
Mode number 12 = Colour tracking ② Multi-colour
Block
What you get
Range
Read
Measure → Proximity
Camera mode number (e.g. 13 = colour tracking ③ standard, 51 = object detection ① list)
11–52
①
Measure → Beacon, channel 1: Heading
Colour 1 X×10+Y (8×6 grid)
0, 11–86
②
Measure → Beacon, channel 1: Proximity
Colour 2 X×10+Y (8×6 grid)
0, 11–86
②
Measure → Beacon, channel 2: Heading
Colour 3 X×10+Y (8×6 grid)
0, 11–86
②
Measure → Beacon, channel 2: Proximity
Colour 4 X×10+Y (8×6 grid)
0, 11–86
②
Measure → Beacon, channel 3: Heading
Colour 5 X×10+Y (8×6 grid)
0, 11–86
②
Measure → Beacon, channel 3: Proximity
Colour 6 X×10+Y (8×6 grid)
0, 11–86
②
Measure → Beacon, channel 4: Heading
Colour 7 X×10+Y (8×6 grid)
0, 11–86
②
Measure → Beacon, channel 4: Proximity
Colour 8 X×10+Y (8×6 grid)
0, 11–86
②
① tens = camera mode, ones = sub-option (e.g. 13 = colour tracking ③ standard)
② tens = X cell (1–8, left→right), ones = Y cell (1–6, bottom = 1); 0 = not seen. In pixels: X ≈ tens×20−10, Y ≈ 129−ones×20
The other 4 values are not used in this mode (always 0) and are left out.
Mode number 13 = Colour tracking ③ Standard
Block
What you get
Range
Read
Measure → Proximity
Camera mode number (e.g. 13 = colour tracking ③ standard, 51 = object detection ① list)
11–52
①
Measure → Beacon, channel 1: Heading
Colour 1 X×10+Y (8×6 grid)
0, 11–86
②
Measure → Beacon, channel 1: Proximity
Colour 1 area (% of the picture)
0, 1–100 %
③
Measure → Beacon, channel 2: Heading
Colour 2 X×10+Y (8×6 grid)
0, 11–86
②
Measure → Beacon, channel 2: Proximity
Colour 2 area (% of the picture)
0, 1–100 %
③
Measure → Beacon, channel 3: Heading
Colour 3 X×10+Y (8×6 grid)
0, 11–86
②
Measure → Beacon, channel 3: Proximity
Colour 3 area (% of the picture)
0, 1–100 %
③
Measure → Beacon, channel 4: Heading
Colour 4 X×10+Y (8×6 grid)
0, 11–86
②
Measure → Beacon, channel 4: Proximity
Colour 4 area (% of the picture)
0, 1–100 %
③
① tens = camera mode, ones = sub-option (e.g. 13 = colour tracking ③ standard)
② tens = X cell (1–8, left→right), ones = Y cell (1–6, bottom = 1); 0 = not seen. In pixels: X ≈ tens×20−10, Y ≈ 129−ones×20
③ % of the whole picture; 0 = not seen
The other 4 values are not used in this mode (always 0) and are left out.
Mode number 14 = Colour tracking ④ Fine
Block
What you get
Range
Read
Measure → Proximity
Camera mode number (e.g. 13 = colour tracking ③ standard, 51 = object detection ① list)
11–52
①
Measure → Beacon, channel 1: Heading
Colour 1 X×10+Y (8×6 grid)
0, 11–86
②
Measure → Beacon, channel 1: Proximity
Colour 1 W×10+H (8×6 grid)
0, 11–86
③
Measure → Beacon, channel 2: Heading
Colour 1 count
0–15
④
Measure → Beacon, channel 2: Proximity
Colour 1 area (% of the picture)
0, 1–100 %
⑤
Measure → Beacon, channel 3: Heading
Colour 2 X×10+Y (8×6 grid)
0, 11–86
②
Measure → Beacon, channel 3: Proximity
Colour 2 W×10+H (8×6 grid)
0, 11–86
③
Measure → Beacon, channel 4: Heading
Colour 2 count
0–15
④
Measure → Beacon, channel 4: Proximity
Colour 2 area (% of the picture)
0, 1–100 %
⑤
① tens = camera mode, ones = sub-option (e.g. 13 = colour tracking ③ standard)
② tens = X cell (1–8, left→right), ones = Y cell (1–6, bottom = 1); 0 = not seen. In pixels: X ≈ tens×20−10, Y ≈ 129−ones×20
③ tens = width in cells, ones = height in cells (1 cell = 20 px: width ≈ (tens−1)×20+10 px); 0 = not seen
④ how many blobs of this colour (0–15)
⑤ % of the whole picture; 0 = not seen
The other 4 values are not used in this mode (always 0) and are left out.
Mode number 21 = Colour at points ① Hue
Block
What you get
Range
Read
Measure → Proximity
Camera mode number (e.g. 13 = colour tracking ③ standard, 51 = object detection ① list)
① tens = camera mode, ones = sub-option (e.g. 13 = colour tracking ③ standard)
② positive = hue code×100÷240 (red 0, yellow ≈17, green ≈33, cyan 50, blue ≈67, purple ≈83; back to the hue code = reading×240÷100, ±2); negative = black/white/grey: −1 to −8 white→grey, −9 to −15 black
Mode number 22 = Colour at points ② Hue + saturation
Block
What you get
Range
Read
Measure → Proximity
Camera mode number (e.g. 13 = colour tracking ③ standard, 51 = object detection ① list)
① tens = camera mode, ones = sub-option (e.g. 13 = colour tracking ③ standard)
② positive = hue code×100÷240 (red 0, yellow ≈17, green ≈33, cyan 50, blue ≈67, purple ≈83; back to the hue code = reading×240÷100, ±2); negative = black/white/grey: −1 to −8 white→grey, −9 to −15 black
③ tens = saturation÷10, ones = value÷10 (e.g. 74 = saturation in the 70s, value in the 40s)
The other 4 values are not used in this mode (always 0) and are left out.
Mode number 23 = Colour at points ③ Hue + sat + value
Block
What you get
Range
Read
Measure → Proximity
Camera mode number (e.g. 13 = colour tracking ③ standard, 51 = object detection ① list)
11–52
①
Measure → Beacon, channel 1: Heading
S1 hue code ÷100 (hundreds)
0–2
②
Measure → Beacon, channel 1: Proximity
S1 hue code remainder after ÷100
0–99
③
Measure → Beacon, channel 2: Heading
S1 saturation
0–100
④
Measure → Beacon, channel 2: Proximity
S1 value (brightness)
0–100
⑤
Measure → Beacon, channel 3: Heading
S2 hue code ÷100 (hundreds)
0–2
②
Measure → Beacon, channel 3: Proximity
S2 hue code remainder after ÷100
0–99
③
Measure → Beacon, channel 4: Heading
S2 saturation
0–100
④
Measure → Beacon, channel 4: Proximity
S2 value (brightness)
0–100
⑤
① tens = camera mode, ones = sub-option (e.g. 13 = colour tracking ③ standard)
② hundreds of the hue code (0–2): hue code = this×100 + the next value
③ hue code remainder after ÷100 (0–99)
④ saturation 0–100: bigger = more vivid
⑤ value 0–100: 0 = black
The other 4 values are not used in this mode (always 0) and are left out.
Mode number 30 = Colour order
Block
What you get
Range
Read
Measure → Proximity
Camera mode number (e.g. 13 = colour tracking ③ standard, 51 = object detection ① list)
11–52
①
Measure → Beacon, channel 1: Heading
Hue of block 1 from the left (EV3: positive = hue, negative = black/white)
−15–100
②
Measure → Beacon, channel 1: Proximity
Hue of block 2 from the left (EV3: positive = hue, negative = black/white)
−15–100
②
Measure → Beacon, channel 2: Heading
Hue of block 3 from the left (EV3: positive = hue, negative = black/white)
−15–100
②
Measure → Beacon, channel 2: Proximity
Hue of block 4 from the left (EV3: positive = hue, negative = black/white)
−15–100
②
Measure → Beacon, channel 3: Heading
Hue of block 5 from the left (EV3: positive = hue, negative = black/white)
−15–100
②
Measure → Beacon, channel 3: Proximity
Hue of block 6 from the left (EV3: positive = hue, negative = black/white)
−15–100
②
Measure → Beacon, channel 4: Heading
Hue of block 7 from the left (EV3: positive = hue, negative = black/white)
−15–100
②
Measure → Beacon, channel 4: Proximity
Hue of block 8 from the left (EV3: positive = hue, negative = black/white)
−15–100
②
Measure → Remote, channel 1
Hue of block 9 from the left (EV3: positive = hue, negative = black/white)
−15–100
②
Measure → Remote, channel 2
Hue of block 10 from the left (EV3: positive = hue, negative = black/white)
−15–100
②
Measure → Remote, channel 3
Hue of block 11 from the left (EV3: positive = hue, negative = black/white)
−15–100
②
Measure → Remote, channel 4
Total number of blocks
0–18
③
① tens = camera mode, ones = sub-option (e.g. 13 = colour tracking ③ standard)
② positive = hue code×100÷240 (red 0, yellow ≈17, green ≈33, cyan 50, blue ≈67, purple ≈83; back to the hue code = reading×240÷100, ±2); negative = black/white/grey: −1 to −8 white→grey, −9 to −15 black
③ blocks in the picture. Red's hue is 0, so read this first to know how many values are real
Mode number 41 = Line following ① Black line
Block
What you get
Range
Read
Measure → Proximity
Camera mode number (e.g. 13 = colour tracking ③ standard, 51 = object detection ① list)
11–52
①
Measure → Beacon, channel 1: Heading
Near offset
−100–100
②
Measure → Beacon, channel 1: Proximity
Middle offset
−100–100
②
Measure → Beacon, channel 2: Heading
Far offset
−100–100
②
Measure → Beacon, channel 2: Proximity
Line angle
−90–90
③
Measure → Beacon, channel 3: Heading
Near line width %
0–100
④
Measure → Beacon, channel 3: Proximity
Junction type×10 + line flags
0–57
⑤
Measure → Beacon, channel 4: Heading
Junction distance %
0–100
⑥
Measure → Beacon, channel 4: Proximity
Colour of the marker line just crossed
0, 1–16
⑦
Measure → Remote, channel 1
Near line left edge
−100–100
⑧
Measure → Remote, channel 2
Near line right edge
−100–100
⑧
Measure → Remote, channel 3
Far line width %
0–100
④
Measure → Remote, channel 4
Marker lines crossed so far
0–99
⑨
① tens = camera mode, ones = sub-option (e.g. 13 = colour tracking ③ standard)
② −100 to 100: line on the left = negative, right = positive (looking forward from behind the robot), 0 = centre
③ line leaning to the upper right = positive, upper left = negative (degrees)
④ line width as % of the picture width
⑤ tens = junction (0 none, 1 cross, 2 T, 3 left, 4 right, 5 dead end), ones = line flags (near 1 + mid 2 + far 4: 7 = all three, 0 = no line)
⑥ how far the junction is: 0 = bottom of the picture, 100 = top
⑦ target colour of the marker line just crossed; 0 = none yet
⑧ left / right edge of the near line (−100 to 100, like the offset)
⑨ lines crossed so far (0–99)
Mode number 42 = Line following ② White line
Block
What you get
Range
Read
Measure → Proximity
Camera mode number (e.g. 13 = colour tracking ③ standard, 51 = object detection ① list)
11–52
①
Measure → Beacon, channel 1: Heading
Near offset
−100–100
②
Measure → Beacon, channel 1: Proximity
Middle offset
−100–100
②
Measure → Beacon, channel 2: Heading
Far offset
−100–100
②
Measure → Beacon, channel 2: Proximity
Line angle
−90–90
③
Measure → Beacon, channel 3: Heading
Near line width %
0–100
④
Measure → Beacon, channel 3: Proximity
Junction type×10 + line flags
0–57
⑤
Measure → Beacon, channel 4: Heading
Junction distance %
0–100
⑥
Measure → Beacon, channel 4: Proximity
Colour of the marker line just crossed
0, 1–16
⑦
Measure → Remote, channel 1
Near line left edge
−100–100
⑧
Measure → Remote, channel 2
Near line right edge
−100–100
⑧
Measure → Remote, channel 3
Far line width %
0–100
④
Measure → Remote, channel 4
Marker lines crossed so far
0–99
⑨
① tens = camera mode, ones = sub-option (e.g. 13 = colour tracking ③ standard)
② −100 to 100: line on the left = negative, right = positive (looking forward from behind the robot), 0 = centre
③ line leaning to the upper right = positive, upper left = negative (degrees)
④ line width as % of the picture width
⑤ tens = junction (0 none, 1 cross, 2 T, 3 left, 4 right, 5 dead end), ones = line flags (near 1 + mid 2 + far 4: 7 = all three, 0 = no line)
⑥ how far the junction is: 0 = bottom of the picture, 100 = top
⑦ target colour of the marker line just crossed; 0 = none yet
⑧ left / right edge of the near line (−100 to 100, like the offset)
⑨ lines crossed so far (0–99)
Mode number 43 = Line following ③ Coloured line
Block
What you get
Range
Read
Measure → Proximity
Camera mode number (e.g. 13 = colour tracking ③ standard, 51 = object detection ① list)
11–52
①
Measure → Beacon, channel 1: Heading
Near offset
−100–100
②
Measure → Beacon, channel 1: Proximity
Middle offset
−100–100
②
Measure → Beacon, channel 2: Heading
Far offset
−100–100
②
Measure → Beacon, channel 2: Proximity
Line angle
−90–90
③
Measure → Beacon, channel 3: Heading
Near line width %
0–100
④
Measure → Beacon, channel 3: Proximity
Junction type×10 + line flags
0–57
⑤
Measure → Beacon, channel 4: Heading
Junction distance %
0–100
⑥
Measure → Beacon, channel 4: Proximity
Colour of the marker line just crossed
0, 1–16
⑦
Measure → Remote, channel 1
Near line left edge
−100–100
⑧
Measure → Remote, channel 2
Near line right edge
−100–100
⑧
Measure → Remote, channel 3
Far line width %
0–100
④
Measure → Remote, channel 4
Marker lines crossed so far
0–99
⑨
① tens = camera mode, ones = sub-option (e.g. 13 = colour tracking ③ standard)
② −100 to 100: line on the left = negative, right = positive (looking forward from behind the robot), 0 = centre
③ line leaning to the upper right = positive, upper left = negative (degrees)
④ line width as % of the picture width
⑤ tens = junction (0 none, 1 cross, 2 T, 3 left, 4 right, 5 dead end), ones = line flags (near 1 + mid 2 + far 4: 7 = all three, 0 = no line)
⑥ how far the junction is: 0 = bottom of the picture, 100 = top
⑦ target colour of the marker line just crossed; 0 = none yet
⑧ left / right edge of the near line (−100 to 100, like the offset)
⑨ lines crossed so far (0–99)
Mode number 51 = Object detection ① Object list
Block
What you get
Range
Read
Measure → Proximity
Camera mode number (e.g. 13 = colour tracking ③ standard, 51 = object detection ① list)
11–52
①
Measure → Beacon, channel 1: Heading
Object 1 code (colour×10 + shape)
0, 10–89
②
Measure → Beacon, channel 1: Proximity
Object 1 X×10+Y (8×6 grid)
0, 11–86
③
Measure → Beacon, channel 2: Heading
Object 2 code (colour×10 + shape)
0, 10–89
②
Measure → Beacon, channel 2: Proximity
Object 2 X×10+Y (8×6 grid)
0, 11–86
③
Measure → Beacon, channel 3: Heading
Object 3 code (colour×10 + shape)
0, 10–89
②
Measure → Beacon, channel 3: Proximity
Object 3 X×10+Y (8×6 grid)
0, 11–86
③
Measure → Beacon, channel 4: Heading
Object 4 code (colour×10 + shape)
0, 10–89
②
Measure → Beacon, channel 4: Proximity
Object 4 X×10+Y (8×6 grid)
0, 11–86
③
Measure → Remote, channel 1
Object 5 code (colour×10 + shape)
0, 10–89
②
Measure → Remote, channel 2
Object 5 X×10+Y (8×6 grid)
0, 11–86
③
Measure → Remote, channel 4
Number of objects
0–8
④
① tens = camera mode, ones = sub-option (e.g. 13 = colour tracking ③ standard)
③ tens = X cell (1–8, left→right), ones = Y cell (1–6, bottom = 1); 0 = not seen. In pixels: X ≈ tens×20−10, Y ≈ 129−ones×20
④ % of the whole picture; 0 = not seen
⑤ ×2 gives the angle 0–179° (the camera sends (angle+1)÷2, within 1°)
The other 4 values are not used in this mode (always 0) and are left out.
3
Show it on the EV3 screen
Use the Text block from the red Data Operations tab to join a name (for example C1) and the reading, then feed it into the green Display block (mode Text → Grid, Y = the line). The yellow and orange lines are data wires. Put a "Display → Reset Screen" block before the loop. Functions are grouped by camera mode; dashed ones belong to another mode (clicking one switches the mode for you). Click a function and the blocks and result change to its example.
Simulated camera view: drag things in the picture and watch the output change
The view is a sketch: values come straight from where things are on screen (X 0–159 left→right, Y 0–119 top→bottom, area % = width × height ÷ whole picture); a hue code is the color the paper or block really has (red 0, yellow 40, green 80, blue 160, purple 200, white table 244, black tape 252). It is not the camera's own algorithm, and real numbers vary with the light. Color tracking assumes 4 colors were taught on the camera: color 1 red, 2 green, 3 blue, 4 yellow. In object detection you pick each shape yourself (the camera does not judge it here); objects 1, 2… are sorted by area, largest first; X, Y is the shape's centroid (white dot), the dashed box is its bounding box, and the angle is the rotation you set.
An example for every function
Every function has a small program you can copy (camera in port 1); the badge shows which modes it works in. "Try it" jumps to step 3 (and switches the mode if needed).
Full examples
Complete programs (turn toward a blob, follow a line) are too wide for one EV3-G screen, so there are no pictures here. They work just like the EV3 Classroom tutorial full examples: sensor → compare (or math) → Move Tank. Python versions are on the EV3 examples page.
Good to know
Plug the camera into port 1. For another port, change the port number on the block. Switch the EV3 on first, then plug in the camera; if the numbers never change, unplug it and plug it in again.
The mode number must match the camera menu. An EV3 program cannot switch the camera mode, and one value means different things in different modes; read the mode number with Proximity and check it at the start.
Use Beacon only or Remote only in one program. Each infrared mode change makes the EV3 pause for about 1.1 seconds, and a racing robot can lose control.
When the camera is unplugged: the EV3 cannot read it, the number becomes "not a number" and the screen shows ----; each reading waits about 1.2 seconds. The program does not stop and recovers when you plug it back in. Tick "Unplug the sensor" to see it.
Colours are taught on the camera. "Target 1" is colour 1; sample spots are also set on the camera. The EV3 only reads the numbers.