SLOTTED OPTICAL SWITCH# Technical Documentation: H22B1 Opto-Interrupter/Slot-Type Optical Switch
 Manufacturer : QTC  
 Component Type : Phototransistor-Based Opto-Interrupter / Slotted Optical Switch  
 Document Version : 1.0  
 Last Updated : October 2023
---
## 1. Application Scenarios
### Typical Use Cases
The H22B1 is a slotted optical switch consisting of an infrared LED and a phototransistor aligned in a U-shaped housing. It is primarily employed for non-contact object detection, position sensing, and motion control in embedded systems.
 Primary Functions: 
*    Object Detection:  Detecting the presence or absence of an opaque object within its slot.
*    Position Sensing:  Determining the position of a rotating shaft via an attached slotted disk (e.g., in motor encoders).
*    Edge Detection:  Sensing the leading or trailing edge of materials in feed mechanisms.
*    Limit Switching:  Providing non-contact end-of-travel signals for linear or rotary actuators.
*    RPM Measurement:  Counting rotations per minute by detecting slots or spokes on a rotating wheel.
### Industry Applications
*    Consumer Electronics:  Paper detection in printers, scanners, and copiers; disc tray position sensing in optical drives.
*    Industrial Automation:  Conveyor belt object counting, robotic arm position feedback, spindle speed monitoring in CNC machinery.
*    Automotive:  Wiper blade park position detection, gear position sensing in transmissions, throttle valve position feedback.
*    Office Equipment:  Paper jam detection, toner level sensing, document feeder synchronization.
*    Medical Devices:  Fluid level detection in infusion pumps, cassette presence sensing in analyzers.
### Practical Advantages and Limitations
 Advantages: 
*    Non-Contact Operation:  Eliminates mechanical wear, ensuring high reliability and long operational life.
*    Fast Response Time:  Capable of detecting high-speed events, suitable for RPM measurement and encoder applications.
*    Simple Interface:  Easy to integrate with microcontrollers using basic pull-up resistors and digital input pins.
*    Immunity to Environmental Factors:  Less susceptible to dust, moisture, and vibration compared to some mechanical switches (though not sealed).
*    Cost-Effective:  A low-cost solution for basic presence/absence detection.
 Limitations: 
*    Object Dependency:  Requires an opaque object to interrupt the beam. Transparent, reflective, or very thin materials may not be reliably detected.
*    Slot Width Constraint:  The physical size of the object must be compatible with the fixed slot width (~3mm typical for H22B1).
*    Ambient Light Sensitivity:  Although modulated IR reduces interference, intense ambient light (especially sunlight or incandescent bulbs) can saturate the phototransistor. A protective shroud or housing is often necessary.
*    Alignment Sensitivity:  The object must pass cleanly through the slot; misalignment can cause inconsistent triggering.
*    Limited Sensing Distance:  Effective only over the gap distance (slot depth). Not suitable for long-range detection.
---
## 2. Design Considerations
### Common Design Pitfalls and Solutions
| Pitfall | Consequence | Solution |
| :--- | :--- | :--- |
|  Insufficient LED Current  | Weak IR signal, leading to unreliable detection or reduced sensing distance. | Calculate and set the LED forward current (`I_F`) using a series resistor per the datasheet (typically 10-20mA). |
|  Missing Pull-Up Resistor  | Phototransistor output floats, causing erratic digital readings. | Always use a pull-up resistor (e.g., 1kΩ to 10kΩ) on the phototransistor collector. |
|  Ignoring Ambient Light  | False triggering or failure to trigger in bright environments. | Use the component in an enclosed housing, add