Home SensorsKit Arduino and KY-034 7 color flashing LED

Arduino and KY-034 7 color flashing LED

by shedboy71

In this article, we connect an KY-034 7 color flashing LED to an Arduino Uno

If the  KY-034 7 color flashing LED module is supplied with voltage, a color sequence is automatically emitted by the LED. The LED has 7 different colors and thus also all resulting mixed colors.

Working voltage 3V — 5V DC
LED model YB-3120B4PnYG-PM
LED type 5mm round head

Parts Required

You can connect to the module using dupont style jumper wire.

This should work with other Arduino board – I have tried an Uno and Mega

Name   Link
Arduino Uno
37 in one sensor kit
Connecting cables

 

Schematic/Connection

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

The middle pin and the (-) pin are connected on this particular module, and they both act as ground.

Code Example

int ledPin = 11;    // 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
}

 

Serial Monitor Output

N/A

Links

https://github.com/getelectronics/ArduinoCode/tree/main/37%20Sensor%20Kit/KY-034_7_Color_Flash

 

 

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