Ks0111 keyestudio EASY plug Collision Sensor: Difference between revisions

From Keyestudio Wiki
Jump to navigation Jump to search
No edit summary
Line 1: Line 1:
==EASY plug Collision Sensor==
[[image:ks0109图.jpg|thumb|600px|right|Keyestudio EASY plug Collision Sensor]]
<br>[[File:ks0111-1.png|500px|frameless|thumb]]<br>


==Introduction==
==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 AL alloy mobile robot platform to realize collision detection function. It is both convenient and effecient.<br>
Crash sensor, also known as snap-action switch, is an electric switch that is actuated by very little physical force.  <br>
Note:<br>
It is a digital on-off input module necessary for elementary electronic.<br>
You can make a collision flasher using collision module and built-in LED on interface 13. Connect the collision senser to pin 3, when the collision sensor senses a collision signal, the LEDs on mainboard and module will light up simultaneously.<br>
By programming, it can be used for the light, sound device, key function of LCD display, 3D Printer position feedback, or other devices. <br>
Note: this module needs to be used together with EASY plug control board.<br>
<span style="color: red">'''Note: ''' </span> this sensor needs to be used together with EASY plug control board.<br>
 


<br>
==Specification==
==Specification==
* Interface: Easy plug
* Connector: Easy plug
* If collision happens upfront of where collision module is installed, module outputs low level signal; no collision, outputs high level signal.
* Onboard status indicator LED
* Module reserves M3 mounting hole, convenient for fixation on a car.
* M3 mounting hole, convenient for fixation on other devices.
* With switch indicator light, if there is collision, light is on; no collision, light is out.
* If collision happened, outputs LOW level signal; no collision, outputs HIGH level signal.  
* Size: 39 * 20mm
<br>
* Weight: 7g


==Technical Details==
* Dimensions: 44mm*20mm*18mm
* Weight: 5.5g


==Connection Diagram ==
<br>
<br>[[File:ks0111-2.png|500px|frameless|thumb]]<br>
==Connect It Up ==
Connect the EASY Plug crash sensor to control board using an RJ11 cable. Then connect the control board to your PC with a USB cable.
<br>[[File:ks0111.jpg|500px|frameless|thumb]]<br>


 
<br>
==Sample Code==
==Upload the Code==
Copy and paste below code to [http://wiki.keyestudio.com/index.php/How_to_Download_Arduino_IDE Arduino IDE] and upload. 
<pre>
<pre>
int Led=13;// set pin for LED
int Led=13;// set pin for LED
Line 35: Line 39:
{
{
val=digitalRead(Shock);// read value on pin 9 and assign it to val
val=digitalRead(Shock);// read value on pin 9 and assign it to val
if(val==HIGH)// when collision sensor detects a signal, LED turns on.
if(val==HIGH)// when collision sensor detects a signal, turn LED on.
{
{
digitalWrite(Led,LOW);
digitalWrite(Led,LOW);
Line 45: Line 49:
</pre>
</pre>


<br>
==What You Should See==
When an object crashes the metal switch of the sensor, the indicator LED is turned on. If no crash happened, LED is turned off.
<br>[[File:ks0111 Result.jpg|500px|frameless|thumb]]<br>
<br>
==Resources ==
==Resources ==
 
'''PDF'''<br>
'''PDF'''
 
https://drive.google.com/open?id=1z2R4aw7hkG3j4QieizAMB7aTZiNrDL1x
https://drive.google.com/open?id=1z2R4aw7hkG3j4QieizAMB7aTZiNrDL1x


<br>
==Buy from ==
==Buy from ==
'''Official Website'''
'''Official Website'''<br>
 
http://www.keyestudio.com/keyestudio-easy-plug-collision-crash-sensor-module-for-arduino.html
http://www.keyestudio.com/keyestudio-easy-plug-collision-crash-sensor-module-for-arduino.html


[[category:EASY Plug]]
[[category:EASY Plug]]

Revision as of 10:06, 16 November 2018

Keyestudio EASY plug Collision Sensor

Introduction

Crash sensor, also known as snap-action switch, is an electric switch that is actuated by very little physical force.
It is a digital on-off input module necessary for elementary electronic.
By programming, it can be used for the light, sound device, key function of LCD display, 3D Printer position feedback, or other devices.
Note: this sensor needs to be used together with EASY plug control board.


Specification

  • Connector: Easy plug
  • Onboard status indicator LED
  • M3 mounting hole, convenient for fixation on other devices.
  • If collision happened, outputs LOW level signal; no collision, outputs HIGH level signal.


Technical Details

  • Dimensions: 44mm*20mm*18mm
  • Weight: 5.5g


Connect It Up

Connect the EASY Plug crash sensor to control board using an RJ11 cable. Then connect the control board to your PC with a USB cable.
thumb


Upload the Code

Copy and paste below code to Arduino IDE and upload.

int Led=13;// set pin for LED
int Shock=9// 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 9 and assign it to val
if(val==HIGH)// when collision sensor detects a signal, turn LED on.
{
digitalWrite(Led,LOW);
} else
{
digitalWrite(Led,HIGH);
}
}


What You Should See

When an object crashes the metal switch of the sensor, the indicator LED is turned on. If no crash happened, LED is turned off.
thumb


Resources

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


Buy from

Official Website
http://www.keyestudio.com/keyestudio-easy-plug-collision-crash-sensor-module-for-arduino.html