• Skip to main content
  • Skip to primary sidebar

Homemade Circuit Projects

Get free circuit help 24/7

Circuits for Beginners | Basic Circuits | LED Driver | Hobby Circuits | Transistor Circuits

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

ask questions through comments

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

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);
}

get free help for circuit diagrams

You'll also like:

  • 1.  Electronic Voting Machine with SD Card Module
  • 2.  Arduino Tachometer Circuit for Precise Readings
  • 3.  How to Interface Servo motors with Arduino
  • 4.  Mobile Phone Controlled Robot Car Using DTMF Module
  • 5.  Arduino 2-Step Programmable Timer Circuit
  • 6.  GSM Fire SMS Alert Project

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!

Subscribe for the Latest Posts


 

Primary Sidebar



Categories

  • 3-Phase Power (15)
  • 324 IC Circuits (19)
  • 4017 IC Circuits (52)
  • 4060 IC Circuits (25)
  • 555 IC Circuits (98)
  • 741 IC Circuits (19)
  • Amplifiers (59)
  • Arduino Engineering Projects (83)
  • Audio Projects (94)
  • Battery Chargers (83)
  • Car and Motorcycle (94)
  • Datasheets (46)
  • Decorative Lighting (Diwali, Christmas) (32)
  • DIY LED Projects (89)
  • Electronic Components (97)
  • Electronic Devices and Circuit Theory (35)
  • Electronics Tutorial (109)
  • Fish Aquarium (5)
  • Free Energy (34)
  • Fun Projects (12)
  • GSM Projects (9)
  • Health Related (19)
  • Heater Controllers (28)
  • Home Electrical Circuits (100)
  • How to Articles (20)
  • Incubator Related (6)
  • Industrial Electronics (28)
  • Infrared (IR) (40)
  • Inverter Circuits (98)
  • Laser Projects (12)
  • LM317/LM338 (21)
  • LM3915 IC (25)
  • Meters and Testers (64)
  • Mini Projects (156)
  • Motor Controller (66)
  • MPPT (7)
  • Oscillator Circuits (24)
  • PIR (Passive Infrared) (8)
  • Power Electronics (33)
  • Power Supply Circuits (74)
  • Radio Circuits (9)
  • Remote Control (47)
  • Security and Alarm (61)
  • Sensors and Detectors (118)
  • SG3525 IC (5)
  • Simple Circuits (74)
  • SMPS (29)
  • Solar Controllers (60)
  • Timer and Delay Relay (53)
  • TL494 IC (5)
  • Transformerless Power Supply (8)
  • Transmitter Circuits (40)
  • Ultrasonic Projects (14)
  • Water Level Controller (45)


Circuit 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


You can also Chat with me here:

Facebook
Twitter
YouTube
Instagram
My Facebook-Page
Quora



© 2022 · Swagatam Innovations

We use cookies on our website to give you the best experience.
Cookie settingsAccept All
Privacy & Cookies Policy

Privacy Overview

This website uses cookies to improve your experience while you navigate through the website. Please visit the Privacy Policy Page for more info.
Necessary
Always Enabled
Necessary cookies are absolutely essential for the website to function properly. This category only includes cookies that ensures basic functionalities and security features of the website. These cookies do not store any personal information.
Non-necessary
Any cookies that may not be particularly necessary for the website to function and is used specifically to collect user personal data via analytics, ads, other embedded contents are termed as non-necessary cookies. It is mandatory to procure user consent prior to running these cookies on your website.
SAVE & ACCEPT