Component guide · Intermediate · 3 min read
Ultrasonic Material Detection Sensors

DFRobot SEN0560 and LDRobot STU-22L for Floor Type Recognition
By Geekobot Learning Team · Updated 29 Oct 2026
On this page
Ultrasonic material detection sensors tell a robot what kind of surface is below it. They send a short ultrasonic pulse and measure how strongly it reflects: hard floors echo strongly, carpets and rugs absorb it. Robot vacuums use this to raise suction on carpet or avoid mopping it. The DFRobot SEN0560 and LDRobot STU-22L give a UART reading or a simple IO output.
Key specs at a glance
- Principle
- Ultrasonic echo strength and time of flight
- Detects
- Hard floor versus carpet or soft surfaces
- Interface
- UART and IO output
- Supply
- About 3.3 to 5 V
- Mounting height
- A few cm above the floor (check datasheet)
- Use
- Robot vacuums, cleaning robots
Models in this guide
These are alternatives. Pick the one that fits your project; you only need one.
What the Ultrasonic material detection sensors is
Ultrasonic material detection sensors detect double sheets, labels, splices or presence of materials using sound, in packaging and printing machines.
Mount the sensor facing straight down at the height in the datasheet; tilting it changes the echo strength.
Calibrate thresholds on your own floors; different tiles and rugs reflect differently.
Ultrasonic material detection sensors pinout
The pins on the Ultrasonic material detection sensors and what each one does.
| Pin | Function |
|---|---|
| VCC, GND | Power |
| TX, RX | UART |
| IO | Material output (high or low) |
- VCC, GND
- Power
- TX, RX
- UART
- IO
- Material output (high or low)
Wiring the Ultrasonic material detection sensors
Connect the Ultrasonic material detection sensors like this.
| Ultrasonic material detection sensors pin | Arduino Uno | ESP32 |
|---|---|---|
| VCC | 5 V | 3.3 V |
| GND | GND | GND |
| IO | D2 | GPIO 27 |
| TX | D10 | GPIO 16 |
- VCC
- Arduino Uno:
- 5 V
- ESP32:
- 3.3 V
- GND
- Arduino Uno:
- GND
- ESP32:
- GND
- IO
- Arduino Uno:
- D2
- ESP32:
- GPIO 27
- TX
- Arduino Uno:
- D10
- ESP32:
- GPIO 16
Example code
A minimal sketch to check the part works.
const int IO = 2; // level meaning depends on the model; check the datasheet
void setup() { Serial.begin(115200); pinMode(IO, INPUT); }
void loop() {
Serial.println(digitalRead(IO) ? "Soft surface (carpet)" : "Hard floor");
delay(200);
}Setup and tuning
pick double-sheet detection or label sensors for your material.
align emitter and receiver at the specified distance and angle.
teach single sheet and double sheet in the setup.
connect PNP or NPN outputs to the PLC.
works with paper, foil and transparent films.
What you need
Shop this list4 of 5 found in our store · ₹3,086
DFRobot SEN0560 Ultrasonic ToF Material Detection Sensor Module w/ ZH1.5T-4P Connector: the part this guide coversDFRobot SEN0560 Ultrasonic ToF Material Detection Sensor Module w/ ZH1.5T-4P Connector₹1,679
LDRobot STU-22L Ultrasonic Material Detection Sensor – UART/IO Interface: another version this guide coversLDRobot STU-22L Ultrasonic Material Detection Sensor – UART/IO Interface₹949
ESP32-WROOM-32 38-pin development board: for Wi-Fi logging and dashboardsESP32-WROOM-32 38-Pin Development Board₹389- Uno R3 development board: the controller used in the wiring tableFind this part
HC-SR04 ultrasonic range finder: the classic low-cost ultrasonic sensorHC-SR04 Ultrasonic Range Finder Sensor Module for Arduino₹69Closest match, check the specs
Alternatives and when to choose them
- DYP obstacle sensors: obstacle detection.
- IR obstacle modules: cliff detection.
- HC-SR04: distance.
Common mistakes to avoid
- Misalignment.
- Skipping teach.
- Wrong PNP/NPN choice.
- 24 V into microcontroller pins.
Frequently asked questions
How does a double sheet sensor work?
Sound passes one sheet more easily than two, so it detects doubles.
Can it detect clear labels?
Yes. Ultrasonic sensors detect clear labels that light sensors miss.
Why does it give false doubles?
The emitter and receiver are misaligned, or the teach settings are wrong.
Can I connect it to an Arduino?
Yes, through an optocoupler, because the outputs run at 24 V.
Does colour matter?
No. Ultrasonic sensing ignores colour and print.
Parts for this guide
Keep learning
Sources
Written by the Geekobot team from manufacturer datasheets. Always check the datasheet for the exact part and variant you buy.

