Ks0111 keyestudio EASY plug Collision Sensor: Difference between revisions

From Keyestudio Wiki
Jump to navigation Jump to search
No edit summary
No edit summary
Line 5: Line 5:
It is a digital on-off input module necessary for elementary electronic.<br>
It is a digital on-off input module necessary for elementary electronic.<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>
By programming, it can be used for the light, sound device, key function of LCD display, 3D Printer position feedback, or other devices. <br>
<span style="color: red">'''Note: ''' </span> this sensor needs to be used together with EASY plug control board.<br>
<span style="color: red">'''Note: ''' this sensor needs to be used together with EASY plug control board. </span><br>


<br>
<br>
Line 21: Line 21:
<br>
<br>
==Connect It Up ==
==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.
Connect the EASY Plug Crash sensor to control board using an RJ11 cable. <br>
<br>[[File:ks0111.jpg|500px|frameless|thumb]]<br>
<br>[[File:Led碰撞.png|500px|frameless|thumb]]<br>


<br>
<br>
==Upload the 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.
Below is an example code. Open or drag below code to [https://wiki.keyestudio.com/Getting_Started_with_Mixly  Mixly Blocks] and upload. <br>
<pre>
<br>[[File:ks0397 6.1.png|500px|frameless|thumb]]<br>
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);
}
}
</pre>


<br>
<br>
==What You Should See==
==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:ks0397 6-1.png|500px|frameless|thumb]]<br>
<br>[[File:ks0111 Result.jpg|500px|frameless|thumb]]<br>
<br>
When an object crashes the metal switch of the sensor, the LED is turned off. If no crash happened, LED is turned on.
<br>[[File:ks0397 6-3.png|500px|frameless|thumb]]<br>
<br>[[File:ks0397 6-4.png|500px|frameless|thumb]]<br>
<br>
You should be able to see the value printing on the monitor.
<br>[[File:ks0397 6-2.png|500px|frameless|thumb]]<br>
 
 
<br>
==Extension Experiment ==
 
<span style="color: brown"> <big>'''Switch Controlling Relay'''</big></span><br>
 
'''Hookup Guide'''<br>
Connect the EASY Plug Crash sensor and relay module to control board using an RJ11 cable.
<br>[[File:继电器碰撞.jpg|500px|frameless|thumb]]<br>
<br>
 
'''Upload the Code'''<br>
Below is an example code.
<br>[[File:ks0397 6.2.png|500px|frameless|thumb]]<br>
 
<br>
'''What You Should See'''<br>
<br>[[File:ks0397 6-5.png|500px|frameless|thumb]]<br>
If crash the limit switch, the LED on the relay module is turned on.
<br>[[File:ks0397 6-6.png|500px|frameless|thumb]]<br>
 
<br>
<span style="color: red">'''Troubleshooting:'''</span>
* '''Program Not Uploading?'''<br>
This happens sometimes, the most likely case is a confused Board and serial port, you should firstly select your proper board and port. <br>
If it doesn’t, make sure you have assembled the circuit correctly and verified and uploaded the code to your board.
 
<br>


<br>
<br>
==Resources ==
==Resources ==
'''Download the PDF:'''<br>
'''Download the Arduino Code and PDF:'''<br>
https://drive.google.com/open?id=1mP-b2u7qwjHDYp-27PQ6zavx3AfS7cTI
https://drive.google.com/open?id=1Sqc5QkXZ4KItag_iYbaFT5SPmAHhowLX


'''Download the Code:'''<br>
'''Download the Mixly Code and Datasheet:'''<br>
https://drive.google.com/open?id=1QL4vkMdyNsq1wynMAzaV_TGK4Kw_SxVA
https://drive.google.com/open?id=1_6QPW_C3VHyvkt39fpD4zBxOX6VA-GHH
   
   


<br>
<br>
==Buy from ==
==Buy from ==
*'''Official Website:'''  http://www.keyestudio.com/ks0111.html
*[https://www.keyestudio.com/keyestudio-rj11-easy-plug-collision-crash-sensor-module-for-arduino-steam-p0092.html '''Official Website''' ]


*[https://www.aliexpress.com/store/product/2016-New-Keyestudio-EASY-plug-Collision-Crash-Sensor-Module-for-Arduino/1452162_32643659215.html?spm=2114.12010612.8148356.26.4f5f484elrtsGa  Shop on aliexpress ]
*[https://www.aliexpress.com/store/product/2016-New-Keyestudio-EASY-plug-Collision-Crash-Sensor-Module-for-Arduino/1452162_32643659215.html?spm=2114.12010612.8148356.26.4f5f484elrtsGa  Shop on aliexpress ]

Revision as of 15:49, 6 May 2019

Keyestudio EASY plug Crash 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.

thumb


Upload the Code

Below is an example code. Open or drag below code to Mixly Blocks and upload.

thumb


What You Should See


thumb

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

thumb

You should be able to see the value printing on the monitor.
thumb



Extension Experiment

Switch Controlling Relay

Hookup Guide
Connect the EASY Plug Crash sensor and relay module to control board using an RJ11 cable.
thumb

Upload the Code
Below is an example code.
thumb


What You Should See

thumb
If crash the limit switch, the LED on the relay module is turned on.
thumb


Troubleshooting:

  • Program Not Uploading?

This happens sometimes, the most likely case is a confused Board and serial port, you should firstly select your proper board and port.
If it doesn’t, make sure you have assembled the circuit correctly and verified and uploaded the code to your board.



Resources

Download the Arduino Code and PDF:
https://drive.google.com/open?id=1Sqc5QkXZ4KItag_iYbaFT5SPmAHhowLX

Download the Mixly Code and Datasheet:
https://drive.google.com/open?id=1_6QPW_C3VHyvkt39fpD4zBxOX6VA-GHH



Buy from