Introduction
In this tutorial, we will learn about the KY-034 module, how it works and we will build a simple project using the KY-034 module and an Arduino.
Auto Flashing Colourful LED Module KY-034
The KY-034 Module will be our main component for this tutorial. This module has a flashing LED mounted on a breakout board with a resistor. Figure 1 shows the module as seen in fritzing.

Pin Out
The KY-034 module has three pins.
Pin | Description |
---|---|
(-) | GND |
Middle Pin | +5V |
S | Signal |
How it Works
The LED automatically flashes when power is applied and the light changes colour every flash.
Project - Arduino Light Flasher
After learning about the KY-034 module and how it works, it is now time to build a project using the module. Our project will supply power to the KY-034 module, which will cause it to flash.
Components
For this project, we need the following components:
- Arduino Uno board (1 pc.)
- KY-034 Automatic Flashing Colourful LED Module (1 pc.)
- Jumper wires
Wiring Diagram
The image below shows the connection between the Arduino Uno and the KY-034 Automatic Flashing Colourful LED Module.
The KY-034 module pins are connected to the Arduino Uno board as follows:
Component Pin | UNO Board Pin |
---|---|
(-) | GND |
Middle Pin | 8 |
S | No Connection |
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-034.ino and upload it to your Arduino board.
// Arduino and KY-034 module
void setup() {
pinMode(8, OUTPUT); // module is connected to pin 8
}
void loop() {
digitalWrite(8, HIGH); // switch on red
delay(2000); // wait 2 seconds
digitalWrite(8, LOW); // switch off red
delay(2000); // wait 2 seconds
}
Project Test
Apply power to your Arduino Uno board. The KY-034 module will repeatedly blink while changing colour for 2 seconds, switch off for 2 seconds, and process repeats indefinitely.