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

Part

# Two-color LED, KY-011

Red and yellow-green dice under one lens on a shared leg. PWM the two legs for orange and yellow.

See every part

- 3 pins
- 1 setting
- In 2 projects

Drawn live by the editor's own code, at the size you see it.

At a glance

## The Two-color LED, KY-011 in brief

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

The KY-011 is a two-color LED, a red and a yellow-green die under one 5 mm lens with a shared middle leg, the KY-029 at 3 mm. Its legs are R, C and G. On the usual common-cathode part C goes to ground and each colored leg gets its own 220 ohm resistor from a PWM pin, 9 and 10 on an Uno, or any two GPIOs on an ESP32, where 3.3 volts still lights both dice with less current. Lighting both mixes orange and yellow, so analogWrite() walks the color between red and green. Mokxi models each die as its own LED, 2.0 volts for the 644 nanometer red and 2.2 for the 571 nanometer green, about 13.4 and 12.5 milliamps through 220 ohms from 5 volts, with an 8 millisecond eye average that turns PWM into a mixed color. The common property switches to common anode, where a low leg lights. The classic mistake is one resistor in the common leg, so the two dice share its current and turning one off brightens the other; the modules have no resistors on board either. The two-lead bipolar kind, reverse breakdown and heat are not modeled.

Family

Outputs

Pins

3

common

cathode (or anode)

cathode (the usual part, and the KY-011's), where C goes to ground
and a high leg lights its die, or anode, where C goes to the supply and a low
leg lights.

Pins

## 3 pins

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

Pin

What it does

R

Anode of the red die.

C

The common, the middle leg: both dice's cathodes (or anodes, see below).

G

Anode of the yellow-green die.

How to use it

## How to use the KY-011 two-color LED with an Arduino

The middle leg, C, goes to ground; R goes to PWM pin 9 and G to PWM pin 10, each through its own 220 ohm resistor. The KY-011 module has none on board. Light both dice and the lens glows orange or yellow, so analogWrite() on the two pins walks the color from red to green.

The level light here reads a knob on A0: below halfway the red die stays full and the green one comes up, above halfway the green stays full and the red goes down. Put one resistor in the common leg instead of two and the dice share its current, so turning one off brightens the other.

Part pin

Board pin

R

Pin 9, through 220 ohm

G

Pin 10, through 220 ohm

C

GND

On an ESP32 any two GPIOs do, with analogWrite() or ledcWrite(); 3.3 V still lights both dice, with less current through the same 220 ohm.

Click to open it in the editor

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 color walk, from the level light

How it is modeled

## What is true about the Two-color LED, KY-011, here

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

### Modeled

Two dice, two currents. Each die is the same Shockley-equation LED as
the LED, conducting on its own between its leg and the
common, so one die on does not change the other's current.

The drops of this part. The KY-011 sheet gives 644 nm red and 571 nm green,
both at 2.0 to 2.5 V and 20 mA. 571 nm is the yellow-green GaP die, not the 3 V
InGaN green of a modern single-color LED, so the model uses 2.0 V for red and
2.2 V for green. On 220 ohm from 5 V they run at about 13.4 and 12.5 mA, nearly
even, which is why one resistor value suits both legs here when it does not on
an RGB LED.

Perceived color. The brightness is an 8 ms average, the plain LED's, so PWM
reads as the mixed color rather than a flicker between red and green.

### Not modeled

The two-lead bipolar kind, whose two dice sit back to back across two legs and
change color with the direction of the current. Reverse breakdown, heat, and the
small differences in brightness between a red and a green die at the same
current: here 20 mA is full brightness for either.

From Two-color LED (KY-011), in full.

Projects

## See the Two-color LED, KY-011 in a project

2 built-in projects use it. Each opens in the editor, already wired.

Boards

## The boards it is shown on

This board has a built-in project with the Two-color LED, KY-011 in it.

- Arduino Uno R3

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 Two-color LED, KY-011

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
