Components / LEDs and lights / Slotted optical switch (H21A1)

Slotted optical switch (H21A1)

IR LED and phototransistor in a U-shaped slot.

Colour / typeIR
PackageSlot sensor
PolarityLED and transistor pins marked
OptoelectronicsReviewedMPN H21A1Used in 3 projects
In short

What is the Slotted optical switch (H21A1) and what is it used for?

IR LED and phototransistor in a U-shaped slot. Makers use it for encoder wheels, end stops.

How it works

An IR LED shines across a slot onto a phototransistor, and anything in the slot breaks the beam.

Key specifications

LED and switch specValue
Colour / typeIR
PackageSlot sensor
PolarityLED and transistor pins marked

Pinout

A KIR LED anode and cathode
C EPhototransistor collector and emitter

How to use it

Feed the LED through 220 Ω from 5 V, pull the collector up with 10 kΩ and read it. Put a slotted disc in the gap to count turns.

Applications

Alternatives

Buy at

Common questions

What is the Slotted optical switch (H21A1) used for?

In maker projects: encoder wheels, end stops.

How does the Slotted optical switch (H21A1) work?

An IR LED shines across a slot onto a phototransistor, and anything in the slot breaks the beam.

What can I use instead of the Slotted optical switch (H21A1)?

Photo interrupter module (end stop).