IR Photoelectric Encoder Sensor 4Pin
The IR Photoelectric Encoder Sensor (4-pin) is a high-precision optical sensor designed to detect rotational speed, direction, and position. It works by emitting infrared light and detecting interruptions caused by a rotating disc with slots, allowing accurate measurement of movement. This makes it an essential component for robotics, automation systems, and motor control applications.
Compact and easy to integrate, the sensor provides fast response and stable performance. Its digital output ensures compatibility with popular microcontrollers such as Arduino, Raspberry Pi, and ESP32. With its durable design and reliable signal detection, this encoder module is widely used in speed monitoring, distance measurement, and motor feedback systems.
How It Works
The IR Photoelectric Encoder Sensor uses an infrared LED and photodiode pair to create an optical gate. When a slotted or reflective disc rotates between them, it interrupts the IR beam. Each interruption generates a pulse, which the microcontroller interprets as a step of movement. By counting pulses over time, the system can calculate rotational speed, displacement, or direction.
Because it uses infrared light, the sensor offers strong resistance to electrical noise and provides stable readings even in complex environments. This makes it a dependable solution for motor encoders and automation projects.
Key Features
High-precision photoelectric sensor
Digital pulse output for easy signal processing
Wide operating voltage: 3.3V – 5V
Fast response time for accurate speed detection
Compact 4-pin design for simple connection
Works with slotted or reflective encoder discs
Compatible with Arduino, Raspberry Pi, and ESP32
Specifications
| Parameter | Value |
|---|---|
| Operating Voltage | 3.3V – 5V DC |
| Output Type | Digital pulse signal |
| Sensor Type | Infrared emitter + photodiode |
| Response Time | Fast, real-time detection |
| Module Dimensions | ~32 mm × 15 mm |
| Pin Count | 4 |
| Compatibility | Arduino, Raspberry Pi, ESP32 |
Pin Configuration
| Pin Label | Description |
|---|---|
| VCC | Power supply (3.3–5V) – |
| GND | Ground |
| D0 | Digital pulse output |
| AO | Optional analog output (if available) |
Applications
Motor speed and position measurement
Robotics and automation systems
Distance and rotation sensing
DIY CNC and 3D printer feedback systems
Smart home devices with motion detection
Educational electronic projects



























