Home Code KY-011 Two color LED module Raspberry Pi example

KY-011 Two color LED module Raspberry Pi example

by shedboy71

In this example we take a look at the KY-011 Two color LED module and connect this to a Raspberry Pi.

As you may have guessed this is a common cathode LED with a red anode and a green anode. You can adjust the amount of each color using PWM.

The module does not include resistors so you need to add these

  • Color: Green + Red
  • Diameter: 3mm
  • Case Color: None
  • Package Type: Diffusion
  • Voltage (V) :2.0-2 .5
  • Using a current (MA): 10
  • Viewing angle: 150
  • Wavelength (NM): 571 +644
  • Luminous intensity (MCD) :20-40; 40-80
  • Stent type: long-legged

Parts List

Name link
Raspberry Pi 4 Aliexpress product link

Amazon. com link

Ebay search

37 sensor kit AliExpress Product link

Amazon link

ebay link

connecting wire Aliexpress product link

Amazon.com link

Ebay link



We use pins 38 and 40 (GPIO 20 and 21) in this example, you can use other GPIO pins but you will have to change the code example.

You need the current limiting resistors

pi and ky-011 layout

pi and ky-011 layout

pi and ky-011 schematic

pi and ky-011 schematic



Code Examples


code on github

You may also like

This website uses cookies to improve your experience. We'll assume you're ok with this, but you can opt-out if you wish. Accept Read More