Source: https://mokxi.com/parts/laser
Updated: 2026-11-16

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.

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.

Hold the button

This is the simulator itself, running here. Click anything to open it in the editor.

Open this project in the editor Read the full tutorial

The laser on, and a servo tilted down

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.

### Learn articles

2 lessons

- Arduino Laser Module (KY-008): Wiring and Code
- "Does Not Name a Type" Arduino Error: How to Fix It

Boards

## The boards it is shown on

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

- Arduino Uno R3

Keep going

## Keep going

- Arduino Servo Motor with a Potentiometer
- Arduino Button Debounce: See the Bounce, Then Fix It
- Hobby servo
- LED
- Pushbutton

More parts

## The rest of the bench

Every one of these is drawn and simulated the same way.

Full-size breadboard

A real 0.1 inch grid with the rails and the center channel, 63 columns wide.

Jumper wires

Drag from any pin or hole to any other. Corners snap, and you can drag them.

Power

A supply rail at the voltage you choose.

Ground

The other end of every circuit.

LED

Lights when current flows. Five colors, and the brightness is what your eye would see.

Filament lamp

A tungsten bulb in a holder: an inrush when it is switched on cold, tens of milliseconds to warm up, and dim on half its voltage.

Resistor

Any value you like, with the color bands drawn to match.

ESP32-C3-DevKitM-1

A RISC-V board that runs your firmware at 160 MHz on the real memory map.

Pushbutton

A 12 mm tactile switch. Hold it while the simulation runs.

Raspberry Pi Pico

The RP2040 board on our own Cortex-M0+ core. Pick a program and press Run.

Raspberry Pi Pico W

Raspberry Pi Pico W (RP2040). The same board and the same pinout as a Pico, with the CYW43439 on it. The WiFi is simulated (no radio; real internet through the Cloud panel’s switch), and the on-board LED, which hangs off that chip rather than off GP25, is driven through the same path. Everything else is the Pico.

Raspberry Pi 4 Model B

Raspberry Pi 4 Model B: the 40-pin header, driven by main.py with RPi.GPIO or gpiozero.

See every part

## 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.

Start building free Open the editor
