Ks0021 keyestudio Collision Sensor: Difference between revisions

From Keyestudio Wiki
Jump to navigation Jump to search
No edit summary
No edit summary
Line 7: Line 7:
You can make a collision flasher using collision module and built-in LED on interface 13. <br>
You can make a collision flasher using collision module and built-in LED on interface 13. <br>
Connect the collision sensor to pin 3, when the collision sensor senses a collision signal, the LEDs on main board and module will light up simultaneously.
Connect the collision sensor to pin 3, when the collision sensor senses a collision signal, the LEDs on main board and module will light up simultaneously.
<br>[[File:211.png|500px|frameless|thumb]]<br>


<br>[[File:211.png|500px|frameless|thumb]]<br>
<br>
==More Details==
* If collision happens upfront of where collision module is installed, module outputs low level signal; no collision, outputs high level signal.
* Module reserves M3 mounting hole, convenient for fixation on a car.
* With switch indicator light, if there is collision, light is on; no collision, light is out.


<br>
<br>
==Specification==
==Pin Definition==
*1. If collision happens upfront of where collision module is installed, module outputs low level signal; no collision, outputs high level signal.
* + pin: 3v-12v power supply 
*2. Module reserves M3 mounting hole, convenient for fixation on a car.
* - pin: GND 
*3. Module size: 3.1cm * 2.1cm
* S pin: High-low level output
*4. With switch indicator light, if there is collision, light is on; no collision, light is out.


<br>
<br>
==Pin definition==
*1 +   3v-12v power supply 
*2 -  GND 
*3 S  Gigh-low level output
==Connection Diagram ==
==Connection Diagram ==
<br>[[File:212.png|700px|frameless|thumb]]<br>


<br>[[File:212.png|500px|frameless|thumb]]<br>
<br>
 
==Sample Code ==
==Sample Code ==
<pre>
<pre>
int Led=13;// set pin for LED  
int Led=13;// set pin for LED  
Line 48: Line 46:
digitalWrite(Led,HIGH);
digitalWrite(Led,HIGH);
}
}
}</pre>
}
</pre>


<br>
==Resources ==
==Resources ==


'''Video'''
* '''Video'''<br>
 
http://video.keyestudio.com/ks0021/
http://www.keyestudio.com/wp/ks0021/
 
'''PDF'''


* '''PDF and Code'''<br>
https://drive.google.com/open?id=1EHXHvlzEPRlGdd1bNCtZk9Vw38Lq8vya
https://drive.google.com/open?id=1EHXHvlzEPRlGdd1bNCtZk9Vw38Lq8vya


<br>
==Get One Now==
==Get One Now==
'''Official Website'''
'''Official Website'''
Line 65: Line 64:
http://www.keyestudio.com/keyestudio-collision-sensor.html
http://www.keyestudio.com/keyestudio-collision-sensor.html


'''ebay'''


https://www.ebay.com/itm/Keyestudio-Collision-Crash-Sensor-Module-for-Arduino-Raspberry-Pi-Micro-bit-/132588894112


[[Category: Sensor]]
[[Category: Sensor]]

Revision as of 15:02, 12 April 2019

Introduction

Collision sensor, also known as electronic switch, is a digital on-off input module necessary for elementary electronic learning.
By programming, it can realize control over light, sound device, key choice function of LCD display, etc.
Using 3P sensor cable to connect it to sensor shield, it can be installed to 4WD alloy mobile robot platform to realize collision detection function. It is both convenient and efficient.

Note:
You can make a collision flasher using collision module and built-in LED on interface 13.
Connect the collision sensor to pin 3, when the collision sensor senses a collision signal, the LEDs on main board and module will light up simultaneously.
thumb


More Details

  • If collision happens upfront of where collision module is installed, module outputs low level signal; no collision, outputs high level signal.
  • Module reserves M3 mounting hole, convenient for fixation on a car.
  • With switch indicator light, if there is collision, light is on; no collision, light is out.


Pin Definition

  • + pin: 3v-12v power supply
  • - pin: GND
  • S pin: High-low level output


Connection Diagram


thumb


Sample Code

int Led=13;// set pin for LED 
int Shock=3// set pin for collision sensor
;int val;// set digital variable val
void setup()
{ 
pinMode(Led,OUTPUT);// set pin LED as output
pinMode(Shock,INPUT);// set collision sensor as input
}
void loop()
{
val=digitalRead(Shock);// read value on pin 3 and assign it to val
if(val==HIGH)// when collision sensor detects a signal, LED turns on.
{
digitalWrite(Led,LOW);
} else
{
digitalWrite(Led,HIGH);
}
}


Resources

  • Video

http://video.keyestudio.com/ks0021/

  • PDF and Code

https://drive.google.com/open?id=1EHXHvlzEPRlGdd1bNCtZk9Vw38Lq8vya


Get One Now

Official Website

http://www.keyestudio.com/keyestudio-collision-sensor.html