Read SharpShot Vision with EV3 Classroom in three steps
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 block pictures were built in EV3 Classroom 1.5.3 and exported straight from the software (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: program start + repeat forever, pick the camera mode
You read the sensor again and again, every 0.1 seconds.
Open EV3 Classroom and press "New Project".
Drag "forever" from "Control" and attach it under the yellow "when program starts".
Drag a "wait 1 seconds" block into forever and change the number to 0.1.
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)
Use the Infrared Sensor blocks in "Sensors"; the number at the front of each block is the port: choose 1. The table shows, for the mode you picked in step 1, which block 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
proximity
Camera mode number (e.g. 13 = colour tracking ③ standard, 51 = object detection ① list)
11–52
①
heading to beacon 1
Colour 1 X×10+Y (8×6 grid)
0, 11–86
②
proximity to beacon 1
Colour 2 X×10+Y (8×6 grid)
0, 11–86
②
heading to beacon 2
Colour 3 X×10+Y (8×6 grid)
0, 11–86
②
proximity to beacon 2
Colour 4 X×10+Y (8×6 grid)
0, 11–86
②
heading to beacon 3
Colour 5 X×10+Y (8×6 grid)
0, 11–86
②
proximity to beacon 3
Colour 6 X×10+Y (8×6 grid)
0, 11–86
②
heading to beacon 4
Colour 7 X×10+Y (8×6 grid)
0, 11–86
②
proximity to beacon 4
Colour 8 X×10+Y (8×6 grid)
0, 11–86
②
beacon 1 buttons pressed
Colour 9 X×10+Y (8×6 grid)
0, 11–86
②
beacon 2 buttons pressed
Colour 10 X×10+Y (8×6 grid)
0, 11–86
②
beacon 3 buttons pressed
Colour 11 X×10+Y (8×6 grid)
0, 11–86
②
beacon 4 buttons pressed
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
proximity
Camera mode number (e.g. 13 = colour tracking ③ standard, 51 = object detection ① list)
11–52
①
heading to beacon 1
Colour 1 X×10+Y (8×6 grid)
0, 11–86
②
proximity to beacon 1
Colour 2 X×10+Y (8×6 grid)
0, 11–86
②
heading to beacon 2
Colour 3 X×10+Y (8×6 grid)
0, 11–86
②
proximity to beacon 2
Colour 4 X×10+Y (8×6 grid)
0, 11–86
②
heading to beacon 3
Colour 5 X×10+Y (8×6 grid)
0, 11–86
②
proximity to beacon 3
Colour 6 X×10+Y (8×6 grid)
0, 11–86
②
heading to beacon 4
Colour 7 X×10+Y (8×6 grid)
0, 11–86
②
proximity to beacon 4
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
proximity
Camera mode number (e.g. 13 = colour tracking ③ standard, 51 = object detection ① list)
11–52
①
heading to beacon 1
Colour 1 X×10+Y (8×6 grid)
0, 11–86
②
proximity to beacon 1
Colour 1 area (% of the picture)
0, 1–100 %
③
heading to beacon 2
Colour 2 X×10+Y (8×6 grid)
0, 11–86
②
proximity to beacon 2
Colour 2 area (% of the picture)
0, 1–100 %
③
heading to beacon 3
Colour 3 X×10+Y (8×6 grid)
0, 11–86
②
proximity to beacon 3
Colour 3 area (% of the picture)
0, 1–100 %
③
heading to beacon 4
Colour 4 X×10+Y (8×6 grid)
0, 11–86
②
proximity to beacon 4
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
proximity
Camera mode number (e.g. 13 = colour tracking ③ standard, 51 = object detection ① list)
11–52
①
heading to beacon 1
Colour 1 X×10+Y (8×6 grid)
0, 11–86
②
proximity to beacon 1
Colour 1 W×10+H (8×6 grid)
0, 11–86
③
heading to beacon 2
Colour 1 count
0–15
④
proximity to beacon 2
Colour 1 area (% of the picture)
0, 1–100 %
⑤
heading to beacon 3
Colour 2 X×10+Y (8×6 grid)
0, 11–86
②
proximity to beacon 3
Colour 2 W×10+H (8×6 grid)
0, 11–86
③
heading to beacon 4
Colour 2 count
0–15
④
proximity to beacon 4
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
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
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
proximity
Camera mode number (e.g. 13 = colour tracking ③ standard, 51 = object detection ① list)
11–52
①
heading to beacon 1
S1 hue code ÷100 (hundreds)
0–2
②
proximity to beacon 1
S1 hue code remainder after ÷100
0–99
③
heading to beacon 2
S1 saturation
0–100
④
proximity to beacon 2
S1 value (brightness)
0–100
⑤
heading to beacon 3
S2 hue code ÷100 (hundreds)
0–2
②
proximity to beacon 3
S2 hue code remainder after ÷100
0–99
③
heading to beacon 4
S2 saturation
0–100
④
proximity to beacon 4
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
proximity
Camera mode number (e.g. 13 = colour tracking ③ standard, 51 = object detection ① list)
11–52
①
heading to beacon 1
Hue of block 1 from the left (EV3: positive = hue, negative = black/white)
−15–100
②
proximity to beacon 1
Hue of block 2 from the left (EV3: positive = hue, negative = black/white)
−15–100
②
heading to beacon 2
Hue of block 3 from the left (EV3: positive = hue, negative = black/white)
−15–100
②
proximity to beacon 2
Hue of block 4 from the left (EV3: positive = hue, negative = black/white)
−15–100
②
heading to beacon 3
Hue of block 5 from the left (EV3: positive = hue, negative = black/white)
−15–100
②
proximity to beacon 3
Hue of block 6 from the left (EV3: positive = hue, negative = black/white)
−15–100
②
heading to beacon 4
Hue of block 7 from the left (EV3: positive = hue, negative = black/white)
−15–100
②
proximity to beacon 4
Hue of block 8 from the left (EV3: positive = hue, negative = black/white)
−15–100
②
beacon 1 buttons pressed
Hue of block 9 from the left (EV3: positive = hue, negative = black/white)
−15–100
②
beacon 2 buttons pressed
Hue of block 10 from the left (EV3: positive = hue, negative = black/white)
−15–100
②
beacon 3 buttons pressed
Hue of block 11 from the left (EV3: positive = hue, negative = black/white)
−15–100
②
beacon 4 buttons pressed
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
proximity
Camera mode number (e.g. 13 = colour tracking ③ standard, 51 = object detection ① list)
11–52
①
heading to beacon 1
Near offset
−100–100
②
proximity to beacon 1
Middle offset
−100–100
②
heading to beacon 2
Far offset
−100–100
②
proximity to beacon 2
Line angle
−90–90
③
heading to beacon 3
Near line width %
0–100
④
proximity to beacon 3
Junction type×10 + line flags
0–57
⑤
heading to beacon 4
Junction distance %
0–100
⑥
proximity to beacon 4
Colour of the marker line just crossed
0, 1–16
⑦
beacon 1 buttons pressed
Near line left edge
−100–100
⑧
beacon 2 buttons pressed
Near line right edge
−100–100
⑧
beacon 3 buttons pressed
Far line width %
0–100
④
beacon 4 buttons pressed
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
proximity
Camera mode number (e.g. 13 = colour tracking ③ standard, 51 = object detection ① list)
11–52
①
heading to beacon 1
Near offset
−100–100
②
proximity to beacon 1
Middle offset
−100–100
②
heading to beacon 2
Far offset
−100–100
②
proximity to beacon 2
Line angle
−90–90
③
heading to beacon 3
Near line width %
0–100
④
proximity to beacon 3
Junction type×10 + line flags
0–57
⑤
heading to beacon 4
Junction distance %
0–100
⑥
proximity to beacon 4
Colour of the marker line just crossed
0, 1–16
⑦
beacon 1 buttons pressed
Near line left edge
−100–100
⑧
beacon 2 buttons pressed
Near line right edge
−100–100
⑧
beacon 3 buttons pressed
Far line width %
0–100
④
beacon 4 buttons pressed
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
proximity
Camera mode number (e.g. 13 = colour tracking ③ standard, 51 = object detection ① list)
11–52
①
heading to beacon 1
Near offset
−100–100
②
proximity to beacon 1
Middle offset
−100–100
②
heading to beacon 2
Far offset
−100–100
②
proximity to beacon 2
Line angle
−90–90
③
heading to beacon 3
Near line width %
0–100
④
proximity to beacon 3
Junction type×10 + line flags
0–57
⑤
heading to beacon 4
Junction distance %
0–100
⑥
proximity to beacon 4
Colour of the marker line just crossed
0, 1–16
⑦
beacon 1 buttons pressed
Near line left edge
−100–100
⑧
beacon 2 buttons pressed
Near line right edge
−100–100
⑧
beacon 3 buttons pressed
Far line width %
0–100
④
beacon 4 buttons pressed
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
proximity
Camera mode number (e.g. 13 = colour tracking ③ standard, 51 = object detection ① list)
11–52
①
heading to beacon 1
Object 1 code (colour×10 + shape)
0, 10–89
②
proximity to beacon 1
Object 1 X×10+Y (8×6 grid)
0, 11–86
③
heading to beacon 2
Object 2 code (colour×10 + shape)
0, 10–89
②
proximity to beacon 2
Object 2 X×10+Y (8×6 grid)
0, 11–86
③
heading to beacon 3
Object 3 code (colour×10 + shape)
0, 10–89
②
proximity to beacon 3
Object 3 X×10+Y (8×6 grid)
0, 11–86
③
heading to beacon 4
Object 4 code (colour×10 + shape)
0, 10–89
②
proximity to beacon 4
Object 4 X×10+Y (8×6 grid)
0, 11–86
③
beacon 1 buttons pressed
Object 5 code (colour×10 + shape)
0, 10–89
②
beacon 2 buttons pressed
Object 5 X×10+Y (8×6 grid)
0, 11–86
③
beacon 4 buttons pressed
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
Put the reading block into "write … at line …" from "Display", use "join" from "Operators" to put a name in front (for example C1), and start with "clear display". 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 you can build and run (camera in port 1, motors in B and C). More examples (Python) are on the EV3 examples page.
Turn toward a blob (mode 13, left wheel B, right wheel C)
!Beacon channel 1 heading = colour 1 X×10+Y: 0 = not seen → spin to search; below 41 (X cells 1–3) → turn left; above 56 (X cells 6–8) → turn right; middle (cells 4, 5) → go straight. Teach "target 1" on the camera first and set the camera menu to mode 13.
Line following (mode 41 black line, left wheel B, right wheel C)
!Beacon channel 1 heading = near offset (line on the left = negative): left wheel 30 + offset×0.3, right wheel 30 − offset×0.3, so it turns toward the line. Not turning enough? Make 0.3 bigger.
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.