Phipps Electronics

Order within the next 

FREE SHIPPING OVER $199

50,000+ ORDERS

WORLDWIDE SHIPPING

SSL SECURED

Using the Yin Yi 2 Colour 3mm LED Module KY-029 with Arduino

Contents

Introduction

In this tutorial, we will learn about the KY-029 module, what is a 2-colour LED and we will build a simple 2-colour blinker using an Arduino and the KY-029 module.

Yin Yi 2 Colour 3mm LED Module KY-029

The KY-029 Module will be our main component for this tutorial. This module has a 2-colour LED mounted on a breakout board. Figure 1 shows the module as seen in fritzing.

Figure 1: KY-029 Yin Yi 2 Colour 3mm LED Module

Pin Out

The KY-029 module has three pins.

PinDescription
(-)GND
middleRed
SGreen

What is a 2-Colour LED

A 2-color LED is simply two different coloured LED’s assembled in one package. The colour of each LED is Red and Green.

Project - Arduino 2 Colour Blinker

After learning about the KY-029 module and the 2-colour LED, it is now time to build a project using the module. Our project will alternate the color (red/green) of the LED every one-second.

Components

For this project, we need the following components:

  • Arduino Uno board (1 pc.)
  • KY-029 Yin Yi 2 Colour 3mm LED Module (1 pc.)
  • Jumper wires

 

Wiring Diagram

The below image shows the connection between the Arduino Uno and the KY-029 Yin Yi 2 Colour 3mm LED Module. The two 330-ohm resistors are needed between the Arduino and the Green and Red pins of the KY-029 to protect the LED from over-current.

The KY-029 module pins are connected to the Arduino Uno board as follows:

Component PinResistorUNO Board Pin
(-)noneGND
middle330-ohm resistor8
S330-ohm resistor9

Code

Below is the Arduino sketch for our project. I have added comments to explain important parts of the code. Save the code as KY-029.ino and upload it to your Arduino board.

				
					// Arduino and KY-029 module
void setup() {
pinMode(8, OUTPUT); // module's red pin
pinMode(9, OUTPUT); // module's green pin
digitalWrite(8, LOW); // switch off red
digitalWrite(9, LOW); // switch off green
}
void loop() {
digitalWrite(8, HIGH); // switch on red
delay(1000); // wait 1 second
digitalWrite(8, LOW); // switch off red
digitalWrite(9, HIGH); // switch on green
delay(1000); // wait 1 second
digitalWrite(9, LOW); // switch off green
}
				
			

Project Test

Apply power to your Arduino Uno board. The KY-029 should alternate colour every one-second.

SUBSCRIBE FOR NEW POST ALERTS

Subscribe to be the first to know when we publish a new article!
List Subscriptions(Required)

POPULAR POSTS

Scroll to Top