arduino 74hc595 rgb leds with 20 effects I RGB leds projects

Mr.ElectroUino
1

arduino 74hc595


In this blog, I will show you how to make an RGB-led circuit with 20 effects by using Arduino UNO and shift registers 74hc595.

How many RGB LEDs can an Arduino control? 

The answer is 2 RGB LEDs is controlled by Arduino Uno because one RGB LEDs require 3 PWM pins to control the brightness and color, but there is only six PWM pin in Arduino Uno.

RGB LEDs


How to control multiple LEDs with Arduino?

As you know, we have only 6 PWM pins and, if we want to control multiple LEDs by Arduino Uno is not possible, so that's why we are using shift registers 74hc595 to control multiple LEDs. By using numerous shift registers as a daisy chain technique, we can run as many LEDs as you want.


So in this tutorial, I will show you how to make a circuit and how to program it.


Let's start with gathering components for RGB-led effects.

  1. Arduino Uno
  2. Shift registers (74hc595) X 5
  3. RGB LEDs X 12
  4. 270-ohm Resistor X 36
  5. Full-size breadboard X 2
  6. Jumper Wire.

Circuit Diagram:

Arduino 74hc595 rgb leds circuit diagram

The circuit diagram seems complex, but it's not that I'll guide you through step by step to build the circuit.


Take a breadboard after that, start placing shift registers on the breadboard and make sure that each IC having a gap in-between.


Now we have to connect RGB LEDs, but there are two types of RGB LEDs.

  1. Common anode LED
  2. Common cathode LED

Common anode LED and Common cathode LED


In this tutorial, I'm using a common cathode LED, so bend the tall lead (cathode pin) of the led and connect it to the GND terminal of the breadboard. Do the same for all RGB LEDs.


*For common anode LED circuit diagram and code should be different.


Next, connect a 220-ohm resistor to each pin of the RGB LED to protect the led from high current.

 

Next, connect shift register pins 16 (VCC) and 10 (SRCLR) to the breadboard 5v terminal and connect pins 8 (GND) to the breadboard GND terminal.


To build a daisy chain circuit, we have to connect the shift register to another.


Now, connect a jumper wire between shift register pin 9 (Q7`) to another shift register pin 14 (DS) for sending data to another IC. Do the same for other shift registers.


Connect a jumper wire between shift register pin 13 (OE) to another shift register pin 13 (OE). OE pin is used to control the brightness of the LEDs. Do the same for other shift registers.


Connect a jumper wire between shift register pin 12 (RCLK) to another shift register pin 12 (RCLK). Do the same for other shift registers.


Connect a jumper wire between shift register pin 11 (SRCLK) to another shift register pin (SRCLK). Do the same for other shift registers.


Now we have to connect RGB LEDs to the shift register.

  • Connect led pin 1 to shift register pin 15 (Q0).
  • Connect led pin 2 to shift register pin 1 (Q1).
  • Connect led pin 3 to shift register pin 2 (Q2).
  • Connect second led pin 1 to shift register pin 3 (Q3).
  • Connect second led pin 2 to shift register pin 4 (Q4).
  • Connect second led pin 3 to shift register pin 5 (Q5).
  • Connect third led pin 1 to shift register pin 6(Q6).
  • Connect third led pin 2 to shift register pin 7(Q7).
  • Connect third led pin 3 to another shift register pin 15(Q0).

Repeat the same process for other RGB LEDs.


Next, we need to connect the shift register (74hc595) to the Arduino Uno to control it.  

  • Connect the shift register Pin 14 (DS) to the Arduino pin 12.
  • Connect the shift register Pin 13 (DS) to the Arduino pin 11.
  • Connect the shift register Pin 12 (RCLK) to the Arduino pin 10.
  • Connect the shift register Pin 11 (SRCLK) to the Arduino pin 9.

Now, we have to supply the power to the circuit:
  •  Connect the Arduino 5v pin to the breadboard 5v terminal, and connect the Arduino GND pin to the breadboard GND terminal.


Now the circuit is completed. 
Connect your Arduino to the computer and upload the code.
Now enjoy the effects.


Code for 74hc595 RGB LEDs with 20 effects.

 Watch This Tutorial: 


If you like this video so subscribe to my channel and comment down on what next video you want to see?

#TAGs

arduino 74hc595, 74hc595 projects, arduino rgb led rainbow code, 74hc595 led chaser, arduino shift register projects, arduino led projects, arduino 74hc595 rgb

Post a Comment

1Comments

  1. Target 100 like in this video👍 and complete 500 subscribers ❤️ then I'll upload the code.
    THANK YOUU❤️❤️

    please code noww!!

    ReplyDelete
Post a Comment