Reply to topic  [ 1 post ] 
KY-008 650nm 5V Laser sensor Module (HCMODU0104) 
Author Message
Site Admin

Joined: Sun Aug 05, 2012 4:02 pm
Posts: 669
Post KY-008 650nm 5V Laser sensor Module (HCMODU0104)
Image



This 100mW laser module emits a small intense focused beam of visible red light. The example provided below shows how the module can be used with an Arduino and photo resistor module (available here) to perform basic remote signaling.

Warning: This is a low power laser device, however as with all laser devices care should be taken when in use. You should never look directly in to its beam or point the laser at another person. Doing so may cause permanent eye damage. This item is not suitable for children.




Item Code: HCMODU0104
Operating voltage: 5V
Max Current (Laser on): ~30mA


PINOUT
1 – GND
2 – 5V
3 – S (Control: HIGH = Laser on);


This module can be purchased here.

The connection diagram below is for use with the transmit sketch.

Image


Receive Sketch

Code:
/* Laser receive sketch */

/* Sets the threshold level.
   If the 'L' LED stays on when the laser is not on then increase this value.
   If the 'L' doesn't light up when the laser is on then reduce this value */
#define THRESHOLD 100

/* Used to control the 'L' LED on your Arduino */
#define LED_PIN 13

/* Connect the 'S' pin of your LDR module to analogue pin A0 */
#define LDR_PIN A0

void setup()
{
  pinMode(LED_PIN, OUTPUT); // Set the LED pin as an output
}

void loop()
{
  /* Has the laser been detected? */
  if(analogRead(LDR_PIN) < THRESHOLD)
  {
    digitalWrite(LED_PIN, HIGH); //If so then turn the 'L' LED on.
  }else
  {
    digitalWrite(LED_PIN, LOW); //If not then turn the 'L' LED off.
  }
}



Transmit Sketch
Code:
/* Laser transmit sketch. */

/* Connect the 'S' pin of the laser to pin 13 on your Arduino. */
#define LASER_PIN 13


void setup()
{
 pinMode(LASER_PIN, OUTPUT); //Set laser pin as an output
}

void loop()
{
 digitalWrite(LASER_PIN, HIGH); //Turn laser on for 1 second
 delay(1000);
 digitalWrite(LASER_PIN, LOW); //Turnlaser off for 1 second
 delay(1000);
}


Mon Apr 25, 2016 1:32 pm
Profile
Display posts from previous:  Sort by  
Reply to topic   [ 1 post ] 

Who is online

Users browsing this forum: No registered users and 3 guests


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:
Jump to:  
Thank you to phpBB.com & phpBB.ro.
Design created by Florea Cosmin Ionut.
© 2011 All contents of this site are © Hobby Components LTD