- All products
- Sensors & Modules
- Encoders
- Encoder Photoelectric Speed Sensor Module
- Encoders
This infrared photoelectric slot sensor module is designed for accurate detection of rotating objects and pulse signals. It uses an infrared emitter and receiver pair with a built-in Schmitt trigger to deliver stable digital output, making it suitable for speed measurement and encoder-based applications.
Features:
- Infrared slot-based detection for reliable operation with strong resistance to ambient light interference
- Built-in Schmitt trigger ensures clean and stable digital output signals
- Onboard signal indicator LED for real-time status monitoring
- Suitable for motor speed detection, object interruption sensing, and pulse counting
Specifications:
- Color: As shown in pictures
- Material: Metal, electronic components
- Dimensions: 26.8 x 15 x 18.7 mm
- Mounting Hole Diameter: 3 mm
- Operating Voltage: 3.3V to 5V DC
- Slot Width: 6 mm
- Output Type: Digital (TTL compatible)
Pinout:
- VCC: Connect to 3.3V or 5V power supply
- GND: Connect to system ground
- DOUT: Digital output signal (connect to MCU digital input)
Applications:
- Rotational speed and RPM measurement
- Encoder wheel pulse counting
- Motor feedback systems
- Object detection and position sensing
Code:
The following Arduino example demonstrates how to read pulse signals from the sensor and calculate motor speed in revolutions per minute (RPM). The code assumes one pulse per revolution.
const int sensorPin = 2; // DOUT connected to digital pin 2
volatile unsigned long pulseCount = 0;
unsigned long lastTime = 0;
unsigned int rpm = 0;
void setup() {
pinMode(sensorPin, INPUT);
attachInterrupt(digitalPinToInterrupt(sensorPin), countPulse, FALLING);
Serial.begin(9600);
Serial.println("IR Slot Sensor Speed Measurement");
}
void loop() {
if (millis() - lastTime >= 1000) {
detachInterrupt(digitalPinToInterrupt(sensorPin));
rpm = pulseCount * 60; // 1 pulse per revolution
pulseCount = 0;
Serial.print("Speed: ");
Serial.print(rpm);
Serial.println(" RPM");
lastTime = millis();
attachInterrupt(digitalPinToInterrupt(sensorPin), countPulse, FALLING);
}
}
void countPulse() {
pulseCount++;
}
Note: If your encoder wheel generates multiple pulses per revolution, divide the calculated RPM by the number of pulses per revolution to obtain accurate results.
This infrared photoelectric slot sensor module is designed for accurate detection of rotating objects and pulse signals. It uses an infrared emitter and receiver pair with a built-in Schmitt trigger to deliver stable digital output, making it suitable for speed measurement and encoder-based applications.
Features:
- Infrared slot-based detection for reliable operation with strong resistance to ambient light interference
- Built-in Schmitt trigger ensures clean and stable digital output signals
- Onboard signal indicator LED for real-time status monitoring
- Suitable for motor speed detection, object interruption sensing, and pulse counting
Specifications:
- Color: As shown in pictures
- Material: Metal, electronic components
- Dimensions: 26.8 x 15 x 18.7 mm
- Mounting Hole Diameter: 3 mm
- Operating Voltage: 3.3V to 5V DC
- Slot Width: 6 mm
- Output Type: Digital (TTL compatible)
Pinout:
- VCC: Connect to 3.3V or 5V power supply
- GND: Connect to system ground
- DOUT: Digital output signal (connect to MCU digital input)
Applications:
- Rotational speed and RPM measurement
- Encoder wheel pulse counting
- Motor feedback systems
- Object detection and position sensing
Code:
The following Arduino example demonstrates how to read pulse signals from the sensor and calculate motor speed in revolutions per minute (RPM). The code assumes one pulse per revolution.
const int sensorPin = 2; // DOUT connected to digital pin 2
volatile unsigned long pulseCount = 0;
unsigned long lastTime = 0;
unsigned int rpm = 0;
void setup() {
pinMode(sensorPin, INPUT);
attachInterrupt(digitalPinToInterrupt(sensorPin), countPulse, FALLING);
Serial.begin(9600);
Serial.println("IR Slot Sensor Speed Measurement");
}
void loop() {
if (millis() - lastTime >= 1000) {
detachInterrupt(digitalPinToInterrupt(sensorPin));
rpm = pulseCount * 60; // 1 pulse per revolution
pulseCount = 0;
Serial.print("Speed: ");
Serial.print(rpm);
Serial.println(" RPM");
lastTime = millis();
attachInterrupt(digitalPinToInterrupt(sensorPin), countPulse, FALLING);
}
}
void countPulse() {
pulseCount++;
}
Note: If your encoder wheel generates multiple pulses per revolution, divide the calculated RPM by the number of pulses per revolution to obtain accurate results.