Specifications
| Type | Reflective optical sensor: an infrared emitter and a phototransistor side by side, looking out of the front of the board. Analog output only |
|---|---|
| Sensor | Vishay TCRT5000, 10.2 × 5.8 × 7 mm, emitter about 950 nm, with a filter that blocks visible light |
| Range | Best at 2.5 mm; above a fifth of that peak from 0.2 to 15 mm, against a reflecting card (Vishay). It measures light coming back, not distance |
| SIGNAL | The phototransistor's collector, 4.7 kΩ up to VCC and 100 nF to GND. More light back reads lower: down to around a volt over white paper close up, VCC over black tape or open air |
| Supply | Your board's logic voltage: 3V3 on an ESP32, ESP32-S3 or Pico, 5V (or 3V3) on an Uno. A dark surface puts VCC on SIGNAL |
| Current | About 18 mA at 3.3 V and 32 mA at 5 V, all the time: the emitter is lit through 120 Ω whenever the block has power, and nothing switches it off |
| At 5 V | About 31 mA, half the TCRT5000's 60 mA maximum, and about 117 mW in a 120 Ω rated 125 mW: inside it, and warm. Worked out, not measured |
| Speed | SIGNAL climbs back through 4.7 kΩ into 100 nF: a 0.47 ms time constant, most of the way in about a millisecond |
| Pins to wire | 3 of the 4: GND, VCC and SIGNAL. NC is connected to nothing on the board |
| Header | 4-pin right-angle male, 2.54 mm pitch: GND, VCC, NC, SIGNAL, with GND on the square pad |
| Board | 22.4 × 30.4 mm, two 4.8 mm mounting holes 16 mm apart. The front prints ANALOG, the back USED FOR PROXIMITY DETECTION |
| In the box | 1 × TK57 block. It also ships inside the TinkerBlock kits |
What it does
It tells your board how much infrared comes back from whatever is in front of it. The black housing near the top is a Vishay TCRT5000: an infrared LED under the blue dome and a phototransistor under the black one, side by side, looking out of the front of the board. Something pale and close sends the emitter's light back into the receiver; something dark, or nothing at all, does not.
The receiver hangs from a 4.7 kΩ pull-up, so SIGNAL is a voltage that
falls as more light comes back: down to around a volt over white paper
a few millimetres away, VCC over black tape or open air. The front prints
ANALOG, and it means it. There is no comparator, no threshold potentiometer
and no indicator LED on this board. Read SIGNAL with analogRead, and the
threshold is a number in your sketch.
It measures light coming back, not distance. The TCRT5000 sees best at 2.5 mm and falls to a fifth of that by 15 mm, so grey card near and white paper farther away can read the same. It suits jobs where the height is fixed: following a line, finding a table's edge, counting marks on a belt or slots in a wheel.
The page this replaces said the output was digital "on some variants", that SIGNAL went to a digital pin, and that it took 3.3 V and 5 V alike. It is analog only, and 5 V on VCC is 5 V on SIGNAL, which only a 5 V board's pins can take.
Two things to know before wiring
- VCC is your board's logic voltage. Over a dark surface SIGNAL rises to VCC, and a 3.3 V pin must not see 5 V. So VCC goes to 3V3 on an ESP32, an ESP32-S3 or a Pico, and to 5V on an Uno, where the block's 120 Ω resistor runs warm but inside its rating.
- The emitter is always on. The block takes about 18 mA from 3.3 V, about 32 mA from 5 V, whenever it has power. On a battery, switch its VCC.
Wiring, in four lines
- GND to your board's GND.
- VCC to 3V3 on an ESP32, ESP32-S3 or Pico; to 5V on an Uno.
- SIGNAL to an analog pin: GPIO 4 on an ESP32-S3, GPIO 34 on an ESP32, A0 on an Uno, GP26 on a Pico.
- NC to nothing: it is connected to nothing on the board.
Then analogRead(pin) is low over white paper and high over black tape.
Where to start
The handbook below is nine short articles, each with a working figure. The first reading is the whole build in three wires and a few lines, and a counter that learns calibrates itself and counts each mark once.
For how it works, read light out, light back and near is not a number. For which VCC your board takes, VCC is your logic voltage. If the numbers are wrong, when the reading is wrong.
When it doesn’t work
- It reads the same over the line and off it.
- The line is not dark in infrared. Some black inks and plastics reflect 950 nm almost as well as paper. Test the real surface with the first reading sketch, and use matte black electrical tape for a line.
- Does it give a digital output?
- No. This board has no comparator and no potentiometer, only the sensor, a pull-up and a filter capacitor, so SIGNAL is a voltage. Read it with analogRead and choose the threshold in your sketch.
- Should VCC go to 3V3 or 5V?
- To the voltage your board's pins run at: 3V3 on an ESP32, an ESP32-S3 or a Pico, 5V on an Uno. Over a dark surface SIGNAL rises to VCC, and a 3.3 V pin must not see 5 V. The Uno's pins take 5 V, and it reads the block from its 3.3V pin too, over two thirds of its range.
- It works indoors, not near a window.
- Sunlight carries infrared, and the receiver cannot tell it from the emitter's own. The emitter is always on, so the board cannot subtract the room's light. Mount the sensor close to the surface and shade it.
- Can I measure distance with it?
- Not reliably. The reading depends on the surface as much as the distance, and it rises again closer than 2.5 mm. Use the TK50 ultrasonic sensor for distance.
- Which way does it look?
- Out of the front, the side with the parts and the pin names. For a line follower, the block hangs face down with its two domes 2 to 5 mm over the floor.