Collision Switch Module

From Wiki
Jump to: navigation, search


The Crash sensor is a miniature snap-action switch. It is also known as micro switch, an electric switch activated by a small physical force.
Collision Switch Module(front).pngCollision Switch Module(rear).png


  • Special module with ports compatible with the expansion board of sensor.
  • Output low level when the module is activated; keep outputting high level at the state of release.
  • Applied in the detection of collision and touching impact.

Introduction of Pins

Introduction of Pins
     Switching signal output
     positive pole
     negative pole


Getting an impact, the switch outputs low level, or else it outputs high level.
Collision Switch Module schematic diagram.png

Experimental Procedures For Arduino

Step 1: Connect the circuit:

Creshsensor Uno Board
D0 2

Collision Switch Module(Fritzing).png
Step 2: Compile and upload the code Using SunFounder Uno

int ledPin = 13;                // choose the pin for the LED
int inputPin = 2;               // Connect sensor to input pin 3

void setup() {
  Serial.begin(9600);           // Init the serial port

  pinMode(ledPin, OUTPUT);      // declare LED as output
  pinMode(inputPin, INPUT);     // declare Micro switch as input

void loop(){
  int val = digitalRead(inputPin);  // read input value
  if (val == LOW) {                // check if the input is HIGH
digitalWrite(ledPin, HIGH);      // turn LED ON
Serial.println("Switch Pressed!");
  } else {
    digitalWrite(ledPin, LOW);     // turn LED OFF 

When the module detects the impact, the serial port will output “Switch Pressed!”Meanwhile, the LED on the pin 13 of the UNO board will light up.