Ks0121 keyestudio EASY plug Photo Interrupter Module: Difference between revisions

From Keyestudio Wiki
Jump to navigation Jump to search
No edit summary
Line 21: Line 21:


==Connect It Up ==
==Connect It Up ==
Connect the EASY Plug photo interrupter module to control board using an RJ11 cable. Then connect the control board to your PC with a USB cable.
Connect the EASY Plug Photo Interrupter module and LED module to control board using RJ11 cables. Then connect the control board to your PC with a USB cable.
<br>[[File:ks0121.jpg|500px|frameless|thumb]]<br>
<br>[[File:光折断灯.jpg|600px|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 10.1.png|600px|frameless|thumb]]<br>
// photo interrupter module
int Led = 13 ;// define LED Interface
int buttonpin = 6; // define the photo interrupter sensor interface
int val ;// define numeric variables val
void setup ()
{
  pinMode (Led, OUTPUT) ;// define LED as output interface
  pinMode (buttonpin, INPUT) ;// define the photo interrupter sensor output interface 
}
void loop ()
{
  val = digitalRead (buttonpin) ;// digital interface will be assigned a value of 3 to read val
  if (val == HIGH) // When the light sensor detects a signal is interrupted, LED flashes
  {
    digitalWrite (Led, HIGH);
  }
  else
  {
    digitalWrite (Led, LOW);
  }
}
</pre>


<br>
<br>
==What You Should See==
==What You Should See==
Done uploading the code, powered on, if pick up a piece of paper in the groove part on the module, you should see the indicator LED on the control board is turned on. If move the paper, the LED is turned off.   
Done uploading the code, powered on, if pick up a piece of paper to cover the light on the groove part of module, you should see the LED is turned on. If no interruption, the LED is off.  <br>
<br>[[File:ks0121 Result.jpg|500px|frameless|thumb]] [[File:ks0121 Result1.jpg|500px|frameless|thumb]]<br>
<br>[[File:ks0397 10-1.png|600px|frameless|thumb]]<br>
<br>[[File:ks0397 10-2.png|600px|frameless|thumb]]<br>
 
 
<br>
<br>
==Extension Experiment==


<span style=color:red><big>'''Adding 4-digit LED Display'''</big></span><br>
<br>
'''Hookup Guide'''<br>
Connect the EASY Plug crash sensor, 4-digit LED display and LED module to control board using RJ11 cables. <br>
<br>[[File:光折断数码管灯.jpg|600px|frameless|thumb]]<br>
<br>
'''Upload the Code'''<br>
Below is an example code.<br>
<br>[[File:ks0397 10.2.1.png|600px|frameless|thumb]]<br>
<br>[[File:ks0397 10.2.2.png|600px|frameless|thumb]]<br>
<br>
'''What You Should See'''<br>
<br>[[File:ks0397 10-3.png|600px|frameless|thumb]]<br>
Done uploading the code, if pick up a piece of paper to cover the light on the groove part, the LED is turned on. If no interruption, the LED is off.
<br>[[File:ks0397 10-5.png|600px|frameless|thumb]]<br>
You should be able to see the number of covering the light is showed on the 4-digit LED display, or on the monitor.
<br>[[File:ks0397 10-4.png|600px|frameless|thumb]]<br>
<br>
==Resources ==
==Resources ==
'''Download the PDF:'''<br>
'''Download the Arduino Datasheet:'''<br>
https://drive.google.com/open?id=1bUzBV5--XSbR5vWkbP1shRLCVHCnZW3j
https://drive.google.com/open?id=1bUzBV5--XSbR5vWkbP1shRLCVHCnZW3j
'''Download the Mixly Code and PDF:'''<br>
https://drive.google.com/open?id=1zTJzCmowa5YxaQNBA_qTRAN3bHRXSo4i


<br>
<br>
==Buy from ==
*[https://www.keyestudio.com/new-keyestudio-easy-plug-photo-interrupter-module-for-arduino-steam-p0063-p0063.html  Official website]


==Buy from ==


* Official website: http://www.keyestudio.com/ks0121.html






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

Revision as of 11:00, 7 May 2019

Keyestudio EASY plug Photo Interrupter Module

Introduction

This is a high performance EASY Plug photo interrupter module.
The upright part on the module combines an infrared light emitting diode and shielded infrared detector.
By emitting a beam of infrared light from one end to another end, the sensor can detect an object when it passes through the beam.
Useful for many applications such as optical limit switches, pellet dispensing, general object detection, etc.
Note: this module needs to be used together with EASY plug control board.

Specification

  • Connector: Easy plug
  • Supply Voltage: 3.3V to 5V
  • Interface: Digital


Technical Details

  • Dimensions: 38mm*20mm*18mm
  • Weight: 4.8g


Connect It Up

Connect the EASY Plug Photo Interrupter module and LED module to control board using RJ11 cables. Then connect the control board to your PC with a USB 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

Done uploading the code, powered on, if pick up a piece of paper to cover the light on the groove part of module, you should see the LED is turned on. If no interruption, the LED is off.

thumb

thumb



Extension Experiment

Adding 4-digit LED Display


Hookup Guide
Connect the EASY Plug crash sensor, 4-digit LED display and LED module to control board using RJ11 cables.

thumb


Upload the Code
Below is an example code.

thumb

thumb


What You Should See

thumb
Done uploading the code, if pick up a piece of paper to cover the light on the groove part, the LED is turned on. If no interruption, the LED is off.
thumb
You should be able to see the number of covering the light is showed on the 4-digit LED display, or on the monitor.
thumb



Resources

Download the Arduino Datasheet:
https://drive.google.com/open?id=1bUzBV5--XSbR5vWkbP1shRLCVHCnZW3j

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



Buy from