Component guide · Beginner · 3 min read
Collision and Crash Sensor Modules for Robots

Elecrow Crowtail Collision 2.0, HS-S31-L, Keyestudio Collision Sensor and KY-036 Metal Touch Sensor
By Geekobot Learning Team · Updated 29 Oct 2026
On this page
A collision sensor is a small lever micro switch on a board with a pull-up resistor and an LED. When the robot hits something, the lever closes and the output changes, usually going LOW. Use one on each front corner of a robot as a bumper. The KY-036 is different: it senses a touch on its metal pin and gives digital and analog outputs.
Key specs at a glance
- Collision type
- Lever micro switch with pull-up resistor
- Output
- Digital, LOW when pressed on most modules
- Supply
- 3.3V to 5V
- Connector
- 3-pin header, PH2.0 or Crowtail
- KY-036
- Metal touch pin, LM393 comparator, digital and analog out
- Indicator
- LED on contact
Models in this guide
These are alternatives. Pick the one that fits your project; you only need one.
What the Collision (crash) sensor modules and KY-036 metal touch sensor is
Collision modules use a lever micro switch to tell a robot it has bumped into something, and metal touch modules sense a finger on a metal pin.
Fit collision modules at the front of a robot so the lever touches an obstacle before the chassis does. In code, stop and reverse the motors when any bumper reads LOW.
The KY-036 detects the small signal from a finger touching its metal pin. Set the sensitivity with the potentiometer until the LED only lights on touch.
Collision (crash) sensor modules and KY-036 metal touch sensor pinout
The pins on the Collision (crash) sensor modules and KY-036 metal touch sensor and what each one does.
| Pin | Function |
|---|---|
| VCC | 3.3-5V |
| GND | Ground |
| OUT / D0 | Digital output |
| A0 (KY-036) | Analog output |
| Lever | Switch actuator |
- VCC
- 3.3-5V
- GND
- Ground
- OUT / D0
- Digital output
- A0 (KY-036)
- Analog output
- Lever
- Switch actuator
Wiring the Collision (crash) sensor modules and KY-036 metal touch sensor
Check your module: a few versions go HIGH on contact. Watch the LED and serial output once.
| Collision (crash) sensor modules and KY-036 metal touch sensor pin | Connection | Note |
|---|---|---|
| VCC | 5V | Or 3.3V |
| GND | GND | Common |
| OUT | D2 | LOW on collision |
- VCC
- Connection:
- 5V
- Note:
- Or 3.3V
- GND
- Connection:
- GND
- Note:
- Common
- OUT
- Connection:
- D2
- Note:
- LOW on collision
Example code
Replace the print with your motor stop and reverse code.
const int BUMPER = 2;
const int LED = 13;
void setup() {
Serial.begin(9600);
pinMode(BUMPER, INPUT_PULLUP);
pinMode(LED, OUTPUT);
}
void loop() {
if (digitalRead(BUMPER) == LOW) {
digitalWrite(LED, HIGH);
Serial.println("Collision! Stop and reverse.");
delay(300);
} else {
digitalWrite(LED, LOW);
}
}Setup and tuning
connect OUT to a digital pin; most modules read LOW when pressed.
if the module has no resistor, use INPUT_PULLUP.
ignore changes for 20 to 50 ms after the first one.
fit the switch so the lever is hit before the robot's body touches the obstacle.
in code, stop, reverse and turn when a collision is detected.
What you need
Shop this list5 of 6 found in our store · ₹475
Elecrow Crowtail Collision Sensor 2.0 Module – 5V/3.3V Compatible: the part this guide coversElecrow Crowtail Collision Sensor 2.0 Module – 5V/3.3V Compatible₹94
HS-S31-L Collision Sensor – PH2.0 3P Terminal: another version this guide coversHS-S31-L Collision Sensor – PH2.0 3P Terminal₹143
Keyestudio Collision Sensor Module – Digital Switch Sensor for Arduino Robots: another version this guide coversKeyestudio Collision Sensor Module – Digital Switch Sensor for Arduino Robots₹156
KY-036 Metal Touch Sensor Module: another version this guide coversKY-036 Metal Touch Sensor Module₹33- Uno R3 development board: the controller used in the wiring tableFind this part
Dupont jumper wires: for the connectionsDupont Jumper Wires (40 pcs)₹49Closest match, check the specs
Alternatives and when to choose them
- IR obstacle sensor: detect before contact.
- TCRT5000 line sensor: line following.
- E18-D80NK IR switch: longer range detection.
Common mistakes to avoid
- Reading the switch without debounce.
- Powering the module at 5 V with a 3.3 V board.
- Mounting the lever where the robot hits the obstacle first.
- Assuming the output is HIGH when pressed.
Frequently asked questions
Why does my collision sensor trigger several times?
Switch contacts bounce. Add a short debounce delay in code.
Is the output HIGH or LOW when pressed?
Most modules give LOW when pressed; check yours with the serial monitor.
Can I use it with an ESP32?
Yes. It works at 3.3 V; power it from 3.3 V so the output is safe.
What does the metal touch sensor detect?
It detects a touch on its metal pin through a small signal from your body.
Where should I mount the switch on a robot?
At the front corners, with the lever sticking out past the body.
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.

