AI

The **MT-034** typically refers to a standard **Infrared (IR) Speed Sensor Module** (often utilizing the LM393 comparator) used in Arduino and robotics projects to measure motor RPM, position, or speed.
Below is the breakdown of its electronic components and specifications.
---
### 1. Core Component Breakdown
| Component | Function |
| :--- | :--- |
| **Infrared Transmitter** | An IR LED that emits a continuous beam of light across the "groove" or "slot." |
| **Infrared Receiver** | A phototransistor that detects the IR light. If an object blocks the slot, the signal changes. |
| **LM393 Voltage Comparator** | The "brain" of the module; it converts the analog signal from the receiver into a clean digital HIGH/LOW signal. |
| **Potentiometer** | Allows the user to adjust the sensitivity/threshold of the sensor. |
| **LED Indicators** | Usually two: One for **Power** and one for **Signal Output** (lights up when the slot is blocked). |
---
### 2. Technical Specifications
| Parameter | Value |
| :--- | :--- |
| **Operating Voltage** | 3.3V to 5V DC |
| **Output Type** | Digital Switch Output (0 and 1) |
| **Slot Width** | Approximately 5mm to 10mm (model dependent) |
| **Comparator Chip** | LM393 |
| **Pinout** | VCC, GND, DO (Digital Out), AO (Analog Out - optional) |
---
### 3. Pin Configuration (Interface)
1. **VCC:** Connects to 3.3V - 5V power supply.
2. **GND:** Connects to the ground of the microcontroller.
3. **DO (Digital Output):** Connects to a digital pin on an Arduino/ESP32. This pulses every time a "tooth" of a code wheel passes through the slot.
4. **AO (Analog Output):** Provides a real-time voltage level based on the obstruction (rarely used for speed, mostly for calibration).
---
### 4. Working Principle
The module works on the **Photoelectric Effect**:
* When the slot is **empty**, the IR receiver receives light, and the DO pin outputs **LOW**.
* When an object (like a motor encoder disk) **blocks** the slot, the IR path is broken, and the DO pin outputs **HIGH**.
* By counting how many times the signal toggles per second, the microcontroller can calculate the **RPM (Revolutions Per Minute)**.
---
### 5. Basic Arduino Code Example
```cpp
const int sensorPin = 2; // DO connected to Pin 2
void setup() {
pinMode(sensorPin, INPUT);
Serial.begin(9600);
}
void loop() {
int sensorState = digitalRead(sensorPin);
if (sensorState == HIGH) {
Serial.println("Slot Blocked");
} else {
Serial.println("Slot Clear");
}
delay(100);
}
```
- ⤷
How do I calculate RPM using this sensor and an encoder disk?
- ⤷ What is the difference between the LM393 and other comparators in this module?
- ⤷ Can this sensor work in direct sunlight?