• Skip to main content
  • Skip to primary sidebar

Homemade Circuit Projects

Get free circuit help 24/7

New Projects | Privacy Policy | About us | Contact | Disclaimer | Copyright | Videos 

You are here: Home / Arduino Engineering Projects / Arduino RGB Flowing Sequential Light Circuit

Arduino RGB Flowing Sequential Light Circuit

Last Updated on June 1, 2019 by Swagatam

This Arduino RGB sequential light generator circuit will generate a smooth flowing red, green blue pattern over the connected RGB LED.

The LED used here is a four pin 30mA RGB LED, common anode type, meaning the common pin for this LED will need to be assigned a continuous positive for the required operations. The LEDs that are specified as common cathode require a continuous negative or ground for the RGB illuminations.

The hardware required for this project:

One Arduino UNO board.
One 220 ohm, 1/4 watt resistor
One RGB, 5mm, 30 mA LED (common anode type)
Link Wires
Soldering iron,
9V adapter AC/DC

caution electricity can be dangerous

The connection details of the proposed RGB LED sequential light circuit using Arduino can be seen in the above diagram.

The connections are pretty easy to implement, just insert the LED leads to the Arduino burg pinouts, switch the the power socket and visualize the RGB LED running the red, green, blue illuminating in a sequential manner.

The code is fully customizable as per the individual preferences and selections,

Code:

Then sketch code for this RGB LED sequential flowing light circuit can be found as given below:

/*
RGB LED color flow
Displays a [fairly] smooth
sequence of colors on an RGB LED

by Jeremy Fonte
Copyright (c) 2012 Jeremy
Fonte.  All rights reserved.
This code is released under the
MIT license:

https://opensource.org/licenses/MIT*/

int r = 0;
int g = 0;
int b = 0;

int ri = 1;
int gi = 3;
int bi = 2;

// the setup routine runs once when you press reset:
void setup() {
// initialize the digital pin as
an output.
pinMode(8, OUTPUT);
pinMode(9, OUTPUT);
pinMode(10, OUTPUT);
pinMode(11, OUTPUT);

digitalWrite(9, HIGH);
}

// the loop routine runs over and over again forever:
void loop() {
r = r + ri;
g = g + gi;
b = b + bi;

if(r > 255) {
r = 255;
ri = -1 * random(1, 3);
}
else if(r < 0) {
r = 0;
ri = random(1, 3);
}

if(g > 255) {
g = 255;
gi = -1 * random(1, 3);
}
else if(g < 0) {
g = 0;
gi = random(1, 3);
}

if(b > 255) {
b = 255;
bi = -1 * random(1, 3);
}
else if(b < 0) {
b = 0;
bi = random(1, 3);
}

analogWrite(8, r);
analogWrite(10, g);
analogWrite(11, b);
delay(20);
}

You'll also like:

  • 1.  230 Volts Bulb String Light Circuit for Diwali and Christmas
  • 2.  Making an Automatic Stopwatch for Runners, Athletes and Sportpersons
  • 3.  How to Make a Cheap LED Name Plate with Illuminated Back Light
  • 4.  Mp3 Player Using DF Player – Full Design Details
  • 5.  Digital Capacitance Meter Circuit Using Arduino
  • 6.  Arduino PWM Signal Generator Circuit

About Swagatam

I am an electronic engineer (dipIETE ), hobbyist, inventor, schematic/PCB designer, manufacturer. I am also the founder of the website: https://www.homemade-circuits.com/, where I love sharing my innovative circuit ideas and tutorials.
If you have any circuit related query, you may interact through comments, I'll be most happy to help!

New Posts

  • Sound Activated Remote Control Circuit
  • High Voltage DC Motor Speed Regulator Circuit
  • High Efficiency Solar Charger Circuits using Switching Regulators
  • Mobile Signal Vibrator Circuit
  • AC 220V Over Current Monitor and Cut OFF Circuit


Primary Sidebar

Categories

  • 3-Phase Power (15)
  • 324 IC Circuits (19)
  • 4017 IC Circuits (52)
  • 4060 IC Circuits (26)
  • 555 IC Circuits (99)
  • 741 IC Circuits (20)
  • Arduino Engineering Projects (83)
  • Audio and Amplifier Projects (118)
  • Battery Chargers (83)
  • Car and Motorcycle (96)
  • Datasheets (77)
  • Decorative Lighting (Diwali, Christmas) (33)
  • Electronic Components (101)
  • Electronic Devices and Circuit Theory (36)
  • Electronics Tutorial (120)
  • Fish Aquarium (5)
  • Free Energy (34)
  • Fun Projects (14)
  • GSM Projects (9)
  • Health Related (20)
  • Heater Controllers (30)
  • Home Electrical Circuits (106)
  • How to Articles (20)
  • Incubator Related (6)
  • Industrial Electronics (28)
  • Infrared (IR) (40)
  • Inverter Circuits (98)
  • Laser Projects (12)
  • LED and Light Effect (95)
  • LM317/LM338 (21)
  • LM3915 IC (25)
  • Meters and Testers (67)
  • Mini Projects (152)
  • Motor Controller (68)
  • MPPT (7)
  • Oscillator Circuits (25)
  • PIR (Passive Infrared) (8)
  • Power Electronics (35)
  • Power Supply Circuits (81)
  • Radio Circuits (10)
  • Remote Control (49)
  • Security and Alarm (64)
  • Sensors and Detectors (127)
  • SG3525 IC (5)
  • Simple Circuits (75)
  • SMPS (29)
  • Solar Controllers (62)
  • Timer and Delay Relay (54)
  • TL494 IC (5)
  • Transformerless Power Supply (8)
  • Transmitter Circuits (41)
  • Ultrasonic Projects (16)
  • Water Level Controller (45)

Calculators

  • AWG to Millimeter Converter
  • Battery Back up Time Calculator
  • Capacitance Reactance Calculator
  • IC 555 Astable Calculator
  • IC 555 Monostable Calculator
  • Inductance Calculator
  • LC Resonance Calculator
  • LM317, LM338, LM396 Calculator
  • Ohm’s Law Calculator
  • Phase Angle Phase Shift Calculator
  • Power Factor (PF) Calculator
  • Reactance Calculator
  • Small Signal Transistor(BJT) and Diode Quick Datasheet
  • Transistor Astable Calculator
  • Transistor base Resistor Calculator
  • Voltage Divider Calculator
  • Wire Current Calculator
  • Zener Diode Calculator

© 2023 · Swagatam Innovations