LTHZ-21D-R
AI

The **LTHZ-21D-R** is a specific electronic component, typically categorized as a **Photoelectric Sensor (Photo-Interrupter)** or an **Optical Limit Switch**. It is widely used in precision mechanical systems to detect the presence or position of an object by breaking an infrared light beam.
---
## 1. Technical Specifications
The device operates on the principle of an infrared LED paired with a phototransistor.
| Parameter | Description | Typical Value |
| :--- | :--- | :--- |
| **Component Type** | Transmissive Photointerrupter | Slotted / U-shape |
| **Light Source** | Infrared Emitting Diode (IRED) | 940nm wavelength |
| **Detector** | Phototransistor | NPN Type |
| **Slot Width** | Gap for object detection | ~2.0mm to 3.0mm |
| **Mounting Type** | Through-hole / Snap-in | PCB Mount |
| **Operating Voltage** | Vcc | 5V DC (Standard) |
---
## 2. Pin Configuration
Most LTHZ series sensors follow a 4-pin configuration divided into the Input (Emitter) and Output (Detector) sides.
### Input Side (LED)
* **Anode (+):** Power input for the IR LED (requires a current-limiting resistor).
* **Cathode (-):** Ground for the LED.
### Output Side (Phototransistor)
* **Collector:** Connected to the positive supply (often with a pull-up resistor).
* **Emitter:** Connected to the system ground.
---
## 3. Working Principle
The LTHZ-21D-R functions via **Optical Blocking**:
1. **Idle State:** The internal IR LED emits light across the slot. The phototransistor receives this light and stays in a "Conducting" (ON) state.
2. **Detection State:** An opaque object (like a plastic fin or paper) enters the slot and blocks the light beam.
3. **Signal Output:** The phototransistor stops conducting, causing the output voltage to change (usually pulling it HIGH via a resistor). The microcontroller detects this logic change as a "trigger."
---
## 4. Common Applications
* **Printers/Scanners:** Detecting paper presence or the "Home" position of the print head.
* **Optical Encoders:** Counting rotations of a slotted wheel to measure speed or distance.
* **Industrial Automation:** Limit switching for small CNC machines or 3D printers.
* **Security:** Tamper detection in housing units.
---
## 5. Typical Circuit Example
To use this with a microcontroller (like an Arduino), you would implement the following logic:
```cpp
// Basic Logic for LTHZ-21D-R Detection
const int sensorPin = 2; // Connected to Phototransistor Collector
void setup() {
pinMode(sensorPin, INPUT_PULLUP); // Use internal pull-up
Serial.begin(9600);
}
void loop() {
int sensorState = digitalRead(sensorPin);
if (sensorState == HIGH) {
Serial.println("Object Detected (Beam Broken)");
} else {
Serial.println("Path Clear (Beam Unbroken)");
}
}
```
- ⤷
What is the maximum current rating for the IR LED in the LTHZ-21D-R?
- ⤷ How do I calculate the correct pull-up resistor for the phototransistor side?
- ⤷ What are the mechanical dimensions and mounting hole spacing for this sensor?