Part

Laser module, KY-008

A red laser diode behind a resistor between S and GND: S high lights the beam.

See every part
  • 3 pins
  • 1 setting
  • In 1 project
  • In 2 lessons
Drawn live by the editor's own code, at the size you see it.
Laser module, KY-008 as drawn in the Mokxi simulator
At a glance

The Laser module, KY-008 in brief

What it is, and every setting the properties panel gives it.

The KY-008 is a 650 nm red laser diode in a brass barrel on a three-pin board. The diode and its resistor sit in series between S and GND, so the signal pin is the supply: a pin driven high runs the laser, low turns it off and analogWrite() dims it. The middle pin, VCC, is not connected on most modules and not in the model. The resistor property is the series resistor, 100 ohm by default, an assumption because the boards are sold without a schematic: a 5 V pin runs the beam at full brightness and a 3.3 V pin at a little over half. Treat any real laser module with the care a laser deserves.

Family
Outputs
Pins
3
resistor
100
Pins

3 pins

Named as the editor names them, so a wire lands where you expect it.

Pin
What it does
S
High lights the laser. The current comes from this pin.
VCC
The middle pin. Not connected on most modules, and not in the model.
GND
Ground.
How to use it

How to wire a KY-008 laser module to an Arduino

Two wires for the laser: S to pin 7 and GND to GND. The laser runs from the pin itself, so the pin is the supply. The pan servo’s signal is on pin 9 and the tilt servo’s on pin 10, with a button on pin 2 to GND using INPUT_PULLUP, and 5 V and ground rails for the servos and the laser.

A round is a minute of the dot wandering around the floor: pick a spot, glide to it a degree at a time, pause, pick another. Then the laser goes off and the servos rest until the button asks for another round. The tilt never goes above 60 degrees from straight down, so the dot stays on the floor and out of anyone’s eyes. Keep a real laser pointed away from eyes the same way.

Part pin
Board pin
S
Pin 7
GND
GND
VCC
Not wired

A 3.3 V pin runs the beam at a little over half brightness through the default 100 ohm. Use a smaller resistor if you need more, within the pin’s current limit.

Cat laser toylive0.000 s 0.00x
Hold the button
This is the simulator itself, running here. Click anything to open it in the editor.
The laser on, and a servo tilted down
#include <Servo.h>

const int LASER = 7;
const int PAN = 9;
const int TILT = 10;

Servo pan, tilt;

void setup() {
  pinMode(LASER, OUTPUT);
  pan.attach(PAN);
  tilt.attach(TILT);
  digitalWrite(LASER, HIGH);
}

void loop() {}
Common errors

Common Laser module, KY-008 errors and fixes

What goes wrong
The fix
The laser does not light.
S is the supply. Drive it high and wire GND. The middle pin is not connected on most modules.
The beam is dim on a 3.3 V board.
The pin runs it at a little over half brightness through the series resistor. Lower the resistor within the pin’s limit.
The dot goes where it should not.
Limit the servo angles in the sketch, as the toy does: tilt never goes above 60 degrees from straight down.
Questions

Questions and answers

Does the KY-008 need a resistor?

It has one on the board, in series with the diode, 100 ohm by default in the model. The signal pin is the supply.

How do I dim a laser module?

Drive S with analogWrite() on a PWM pin.

What is the middle pin of the KY-008?

VCC, which is not connected on most modules and not in the model.

How it is modeled

What is true about the Laser module, KY-008, here

In its help article’s own words: what the simulation gets right, and where it stops.

Modeled

The supply is the signal. There is no driver on the board: the diode's current comes from S itself, the way it does on the real module.

Dimming. The brightness follows the average of a PWM signal, as an eye sees it.

Not modeled

The lasing threshold (a real diode below it glows dimly instead of lasing), the light's power, and the beam's spread.

From Laser module, KY-008, in full.

Projects

See the Laser module, KY-008 in a project

One built-in project uses it. It opens in the editor, already wired.

Lessons

Where it turns up in a lesson

2 lessons place it in their own circuits.

Boards

The boards it is shown on

This board has a built-in project with the Laser module, KY-008 in it.

Wire up the Laser module, KY-008

Open the editor and push it into the breadboard. It is free, and it runs on your own machine.