KY-034 Automatic Flashing Color LED

The KY-034 features a 7 color LED that flashes through a sequence of colors, creating a multicolored pattern of flashing light. The sequence is predefined and cannot be modified.

This module can be used in decorative projects, and it is compatible with Arduino, ESP32, Raspberry Pi, ESP8266, and other popular microcontroller boards.

KY-034 automatic flashing color led Fritzing Part
KY-034 automatic flashing color LED

KY-034 Specifications

This module has a 5mm color LED and a 10 kΩ SMD resistor. The LED flashes in a predefined pattern of alternating colors.

Working voltage3V — 5V DC
LED modelYB-3120B4PnYG-PM
LED type5mm round head
Board Size16.5mm x 18.5mm [0.65in x 1.73in]

Connection Diagram

Connect the KY-034’s signal pin (S) to pin 13 on the Arduino, then connect the ground pin (-) to GND.

The middle pin and the (-) pin on the KY-034 are connected, and they both act as ground. You only need to connect one of the pins to GND on the Arduino.

Keep in mind that there are similar modules with a different pin configuration. Always check the pins before connecting your board.

KY-034Arduino
SPin 13
GND
Arduino KY-034 connection diagram

KY-034 Arduino Code

In the following sketch, we’ll use the pin 13 on the Arduino to repeatedly turn the LED on the module on for 3 seconds and off for a second.

int ledPin = 13;    // pin to control KY-034

void setup() {                
  pinMode(ledPin, OUTPUT);    // define pin as output
}

void loop() {
  digitalWrite(ledPin, HIGH); // turn LED on
  delay(3000);                // wait for 3 seconds
  digitalWrite(ledPin, LOW);  // turn LED off
  delay(1000);                // wait for a second
}

Downloads

Leave a Comment