RGB LEDs With Potentiometers

by Maevenkp in Circuits > Arduino

36 Views, 0 Favorites, 0 Comments

RGB LEDs With Potentiometers

Screenshot 2024-09-19 11.16.14 AM.png
Schematic.png

This circuit consists of 4 RGBs and 3 potentiometers that blink with an Arduino code. The potentiometers make it possible for the RGBs to change brightness and color.

We started with the circuit for a blinking LED which was then evolved into what we have here.

Supplies

  1. (1) Bread Board
  2. (1) Arduino Board
  3. (1) Type Mini B cord
  4. (3) Potentiometers
  5. (4) RGB LEDs
  6. (4) Resistors
  7. (21) Wires
  8. App - Arduino IDE

LEDs, Resistors, and Potentiometers

Step 1.jpg
LEDs, Resistors, Potentiometers.jpg

NOTE: The 1st port is for the most left leg and the 2nd port is for the most right leg

(All parts are listed starting from the left side of the images)

LEDs:

  1. RGB 1 = h1 to h3
  2. RGB 2 = h8 to h11
  3. RGB 3 = h20 to h23
  4. RGB 4 = h26 to h29


Resistors:

The leg of the resistor should align with the longest leg of the RGBs

  1. Resistor 1 = d2, f2
  2. Resistor 2 = d9, f9
  3. Resistor 3 = d21, f21
  4. Resistor 4 = d27, f27


Potentiometers:

  1. Pot 1 = i5 to i7
  2. Pot 2 = i12 to i14
  3. Pot 3 = i17 to i19

Wiring of RGB 1

Screenshot 2024-09-19 7.52.42 PM.png

The wires used in all the images correspond with the same colored wires as in the Tinkercad schematic. If the picture is too hard to read then please refer to the schematic. (This applies for all wires *except* the Arduino Wires)


For RGB 1, the wires go with the following ports:

Green - h4 to h17

Red - g1 to f5

Blue - g3 to h12

Wiring of RGB 2

Screenshot 2024-09-19 7.53.06 PM.png
Screenshot 2024-09-19 7.53.11 PM.png

Red - h5 to g8

Blue - g10 to g12

Wiring of RGB 3

Screenshot 2024-09-19 7.54.20 PM.png
Screenshot 2024-09-19 7.53.58 PM.png

Green - g14 to g23

Blue - h19 to g22

Wiring of RGB 4

Screenshot 2024-09-19 7.55.39 PM.png
Screenshot 2024-09-19 7.55.51 PM.png

Green - g19 to g29

Blue - h14 to g28

Negative Wires

Screenshot 2024-09-19 7.56.56 PM.png

One terminal of the wire should go to the following ports:

  1. Wire 1 = a1
  2. Wire 2 = a9
  3. Wire 3 = a21
  4. Wire 4 = a27

The other terminal of the wire should connect to the Negative ports of the bread board that line up with their "a" ports.

Positive Wires

Screenshot 2024-09-19 8.00.37 PM.png
Screenshot 2024-09-19 8.00.18 PM.png

One terminal of the wire should go to the following ports:

  1. Wire 1 = h6
  2. Wire 2 = h13
  3. Wire 3 = h18

The other terminal of the wire should connect to the Positive ports of the bread board that line up with their "h" ports.

Arduino Wires

Screenshot 2024-09-19 8.01.25 PM.png

Positive wire (red) connects "8" on the Arduino to farthest right port in the positive line of ports

Negative wire (black) connects "GND" on the Arduino to farthest right port in the negative line of ports

Arduino Code

Copy the following code into an Arduino sketch in order to operate this circuit. Read the comments to understand what each line does. Here is a link to the code we referenced to create our code: Example Code

---------------------------------------------------------------------------------------------


int redPin = 8; //initializes and defines the variable that controls the RGBs

void setup()
{
  pinMode(redPin, OUTPUT); //sets the RGBs to pin mode
}

void loop()
{
  blinkLed(); //makes the RGBs blink
}

void setColor(int red) //sets the color of the RGBs (red)
{
  analogWrite(redPin, red);
}

void blinkLed()
{
  setColor(255); // makes the RGBs glow red
  delay(1000); //sets the amount of time the RGBs will glow red
  setColor(0); // turns the RGBs off
  delay(1000); //sets the amount of time the RGBs will be off
}

Have Fun With the Circuit

The file below is a video of the possible things you could do with the potentiometers and RGBs. Have fun and thanks for following along!


Credits: Connor, Allyson, Maeven, Keanu, and Jessica