Crash Collision Sensor Detection Module [S230]
https://www.youtube.com/watch?v=1yeZcZQk-Y8
*GitHub : https://github.com/rdiot/rdiot-s230.git
* Specs
Wrobot Crash Sensor is arduino compatible and can be used for for robot collision detection, touch collision detection.
It is based on the high sensitivity crash sensor.
With the Arduino sensor expansion board, in combination, it can be very easy to achieve robot collision detection, touch collision detection.
When touch, output low level ; when release, maintain a high level
Wrobot Crash Sensor pin definitions : (1) Output (2) Vcc (3) GND
Features :
1.Based on the high sensitivity crash sensor
2.Can be used for robot collision detection, touch collision detection
3.Type : Digital
4.Sensitivity : High
5.Power Supply : 5V
6.Pin Definitions : (1) Output (2) Vcc (3) GND
7.When touch, output low level ; when release, maintain a high level
8.Apply to a variety of platforms including Arduino/51/AVR/ARM
* Contents
- connect
OUT - D3
VCC - 5V
GND - GND
- Key Code
int
ledPin = 13;
// choose the pin for the LED
int
inputPin = 3;
// 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 == HIGH) {
// check if the input is HIGH
digitalWrite(ledPin, LOW);
// turn LED OFF
}
else
{
digitalWrite(ledPin, HIGH);
// turn LED ON
Serial.println(
"Switch Pressed!"
);
}
delay(50);
}
'2) Sensor > Vibration_Collision' 카테고리의 다른 글
Ceramic Piezo Vibration Sensor [S133] (0) | 2016.09.09 |
---|---|
Knock sensor module (KY-031) [S040] (0) | 2016.09.09 |
Vibration switch module (KY-002) [S039] (0) | 2016.09.09 |