Go Down

Topic: Does anyone know how to wire up the KY-008 Laser Transmitter Module? (Read 15462 times) previous topic - next topic

nickgammon

I got a batch of these "KY-008 Laser Transmitter Module" (for Arduino, heh) from eBay.

The wiring information is sparse, and after extensive searching I've read that you put +5V to the "-" pin and Gnd to the "S" pin, and vice-versa. I've also found that the middle pin is "the middle pin".

Here are a couple of them (from the same batch):





You will note that the "-" and "S" pins are reversed. Also one has a 1k resistor and one has a 10k resistor (R1).

The resistor, whose purpose is not totally clear, seems to connect the middle pin to the upper pin.

It's almost as if some are wired on the underside of the board, however that doesn't totally make sense (the other side is not marked "S" and "-").

They appear to work if you apply Gnd to the lower pin (in the photo) and +5V to the upper pin. However if you apply +5V to the middle pin they are much duller (presumably the resistor is in series).

They appear to consume around 30 mA.

Does anyone have any suggestions about wiring? The 10k series resistor seems a bit much, presumably a smaller resistor would be required for current limiting…
Please post technical questions on the forum, not by personal message. Thanks!

More info: http://www.gammon.com.au/electronics

Paul__B

I do not have one but have looked at the pictures before.

This is part of the three terminal "sensor shield" series - uses standard servo cables for connection.  The actual current limiting resistor for the laser is about 91 ohms, and mounted on the PCB chip that is in the laser cartridge proper.  The 1k/ 10k is a "pull-up" resistor provided for no particular reason.

If you connect it to an Arduino pin using the pins actually connected to the laser, it will operate.  That's about it. :)

Oh yes, the brass part is always positive.

nickgammon

OK, thanks. I didn't spot the 91R resistor on the laser body. I see it now:


Please post technical questions on the forum, not by personal message. Thanks!

More info: http://www.gammon.com.au/electronics

Wawa

I have seen someone mention in a review that the 1k/10k connection is for PWM.
Leo..

nickgammon

I measured a VF of 1.96V, so with a 91R resistor you would expect 33.4 mA from 5V, which agrees with what I saw.

With 1.091k it would be 2.78 mA so maybe that is designed to go directly to an Arduino output pin.
Please post technical questions on the forum, not by personal message. Thanks!

More info: http://www.gammon.com.au/electronics

Paul__B

Maybe not.

This is a laser!

It has a threshold for amplification, below which it becomes a common LED.  Lasers can only be amplitude modulated over a limited range. PWM, yes - generally PCM.  There just might be a reason for a "keep-alive" current - I am not sure, but I suspect the extra resistor is just someone's idea of making it match other "sensor shield" devices.

Enjoying the twilight down there? :smiley-lol:

nickgammon

Since you asked ... this morning there was a loud "hiss" then a flash of lightning, then a loud clap of thunder almost immediately.

Various gadgets around the house went into spasms. The router had to be rebooted. My son's Minecraft server had to be rebooted. I had to be rebooted (just kidding).
Please post technical questions on the forum, not by personal message. Thanks!

More info: http://www.gammon.com.au/electronics

Paul__B


nickgammon

Please post technical questions on the forum, not by personal message. Thanks!

More info: http://www.gammon.com.au/electronics

rydepier

It seems that some boards were screen printed incorrectly and the manufacturers page simply recommended reversing the connections. I have had a number of these lasers from Chinese sources and found none of the incorrectly marked ones. With the laser pointing away from you the right hand pin, normally marked with a '-' is connected to ground. Ignore the middle pin and the left hand pin, normally marked 'S' should be taken HIGH to turn the laser ON. The simple Blink sketch can be used to check the laser and it responds well to PWM.

nickgammon

Please post technical questions on the forum, not by personal message. Thanks!

More info: http://www.gammon.com.au/electronics

Paul__B

There cannot be terribly many exceptions to the brass shell being the positive.

Not to say that whilst most laser pointers are - therefore - configured so that the positive of the battery goes first in the battery sleeve, I have two of them (purple) whose batteries must actually be fitted the other way around.  This initially caused me much angst!

jgrina

#12
Aug 16, 2015, 05:22 am Last Edit: Aug 16, 2015, 07:17 am by Nick Gammon Reason: Added code tags.
I spent two evenings searching for information on the Keyes KY-008 laser module. The search included two reads through the information in the forum. I recognize some of the names on the list, and started with teir info, then searched the Internet for more info.

The module appears in the Keyes sensor shield group, as Paul_B pointed out. However there is little or no information about connections or usage. I went through eBay listings for the rest of the first evening, trying to find out more, but nothing was useful. I did encounter on sketch which had PWM working, I think, but it was late, or early, depending on your time zone, and I lost track of the sketch.

On day two, I decided to try the marginal information that I had.  It was no big deal, I bought two modules for ~$2.00, so I decided to keep working with one until it stopped working. There was one other clue. One of the listings had a module plugged into an Arduino board, no jumpers.  I could see that the "-" and "S" pins were plugged into GND and 5V, but could not see the middle pin. So I connected "-" and GND; pin 13 (LED) to "S" and ran the classic Blink example from the library. AHah! The laser and pin 13 LED blinked at exactly the same time. I added in the "middle" pin to the the connections, just in case there was a need for a full 5V source.

I called the new sketch Wink, not Blink, and played with it a bit. Seemed to work fine.

So then I used the AnalogWrite program from Tom Igoe to fade the laser in and out, switching to pin 11 because pin 13 does not support AnalogWrite PWM.

Several listings indicated that the "middle" pin had no function, and it appears they are right. Connecting gnd to "-" and the pwm pin (11), to the "S" pin works just as well, whether the "middle" pin is connected or not.

So, does this help to use the mysterious module?

I'm not happy about so many vendors selling this module with no idea of how it works, but the price is right. Even the Youtube tutorials were not very helpful about using it.

-------------------------------------------------------------------------------------------

 
Code: [Select]
/*
 _Wink

 This example code is in the public domain.

 Originally Mega analogWrite() test

 This sketch fades LEDs up and down one at a time on digital pins 2 through 13.
 This sketch was written for the Arduino Mega, and will not work on previous boards.

 The circuit and sketch were written by Tom Igoe for the Arduino Mega, but I changed it
 to an Arduino Uno as a single Laser.

 created 8 Feb 2009
 by Tom Igoe
 modified 15 Aug 2015
 by Jim Grina
*/

int laserPin = 11;// a pmw pin connected to the S pin
                   // the 3 pin Laser board has - connected to Arduino ground
                   // and 5V power to the "middle" pin

// the setup function runs once when you press reset or power the board
void setup()
{
 // initialize digital pin 11 as an output.
 pinMode(laserPin, OUTPUT);
}

// the loop function runs over and over again forever
void loop()
{

  for (int brightness = 0; brightness < 255; brightness++)
  {
    analogWrite(laserPin, brightness);
    delay(2);
  }
  for (int brightness = 255; brightness >= 0; brightness--) {
     analogWrite(laserPin, brightness);
     delay(2);
   }
   // pause off between cycles of Laser:
   delay(200);
}


Moderator edit: [code] ... [/code] tags added. (Nick Gammon)

TomGeorge

Everything runs on smoke, let the smoke out, it stops running....

nickgammon

Please post technical questions on the forum, not by personal message. Thanks!

More info: http://www.gammon.com.au/electronics

Go Up