0% found this document useful (0 votes)
33 views

RGB LED Potentiometer Arduino Project Detailed (1)

This document outlines a project that demonstrates controlling an RGB LED using a potentiometer and an Arduino. It includes details on materials, circuit design, Arduino code, testing results, challenges faced, and solutions implemented. The project serves as an introduction to analog input control with Arduino, showcasing dynamic color mixing and brightness adjustment of the LED.
Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
33 views

RGB LED Potentiometer Arduino Project Detailed (1)

This document outlines a project that demonstrates controlling an RGB LED using a potentiometer and an Arduino. It includes details on materials, circuit design, Arduino code, testing results, challenges faced, and solutions implemented. The project serves as an introduction to analog input control with Arduino, showcasing dynamic color mixing and brightness adjustment of the LED.
Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 2

RGB LED Controlled by Potentiometer using Arduino

1. Introduction
This project demonstrates how an RGB LED can be controlled using a potentiometer and an Arduino. The
potentiometer acts as an input device, allowing users to adjust the brightness and mix colors dynamically.
The Arduino reads the potentiometer value and adjusts the LED color accordingly using PWM signals.

2. Materials and Components


- Arduino Uno/Nano/Mini
- RGB LED (Common Cathode or Anode)
- Potentiometer (10k Ohm)
- 3x 220 Ohm Resistors
- Breadboard & Jumper Wires
- USB Cable for Programming

3. Circuit Design
The circuit consists of an RGB LED connected to three PWM pins of the Arduino. A potentiometer is
connected to an analog input pin, which allows the user to control the LED brightness and color mixing. The
Arduino processes the input and adjusts the LED intensity accordingly.

4. Arduino Code

int potPin = A0;


int redPin = 9, greenPin = 10, bluePin = 11;

void setup() {
pinMode(redPin, OUTPUT);
pinMode(greenPin, OUTPUT);
pinMode(bluePin, OUTPUT);
}

void loop() {
int val = analogRead(potPin) / 4;
analogWrite(redPin, val);
analogWrite(greenPin, 255 - val);
analogWrite(bluePin, val / 2);
}

5. Testing and Results


The project was tested by rotating the potentiometer. As the resistance changed, the RGB LED adjusted its
brightness and color mix. The results showed smooth transitions between colors, demonstrating the
effectiveness of PWM control.

6. Challenges and Solutions


1. **LED Flickering**: Resolved by ensuring smooth PWM control.
2. **Inconsistent Color Mixing**: Fixed by calibrating potentiometer input values.
3. **Power Issues**: Used a proper power source to stabilize the circuit.

7. Image of the Output

8. Conclusion
This project is an excellent introduction to Arduino-based analog input control. It demonstrates how to use a
potentiometer to manipulate RGB LED colors dynamically.

9. References
1. Arduino Official Documentation: https://www.arduino.cc
2. PWM in Arduino: https://www.arduino.cc/reference/en/language/functions/analog-io/analogwrite/

You might also like