RGB LAMP CONTROL USING ARDUINO AND POTENTIOMETER

 

 RGB Lamp Using Arduino UNO and 3 Potentiometers

This project uses the Arduino Uno to control an RGB LED with three potentiometers. Each potentiometer controls the brightness of one color channel—Red, Green, and Blue.

By rotating the knobs, you can mix different light intensities and create thousands of custom colors. This project demonstrates:

  • Analog input reading

  • PWM (Pulse Width Modulation) output

  • RGB color mixing

  • Basic electronics interfacing


 Components Required

  • Arduino Uno

  • RGB LED (Common Cathode recommended)

  • 3 × 10kΩ Potentiometers

  • 3 × 220Ω Resistors

  • Breadboard

  • Jumper wires

  • USB cable / 5V supply


 Circuit Connections

 Potentiometers

Each potentiometer has 3 pins:

Pot PinConnection
Left5V
RightGND
MiddleArduino Analog Pin

Example:

  • Red Pot → A0

  • Green Pot → A1

  • Blue Pot → A2


 RGB LED Connections (Common Cathode)

LED PinConnect To
RedPWM Pin 9 (via 220Ω resistor)
GreenPWM Pin 10 (via 220Ω resistor)
BluePWM Pin 11 (via 220Ω resistor)
CathodeGND

 If using Common Anode RGB LED, logic must be inverted.


 Working Principle

  1. Arduino reads analog values (0–1023) from each potentiometer.

  2. These values are mapped to PWM range (0–255).

  3. PWM signals control brightness of Red, Green, and Blue channels.

  4. Mixing intensities produces different colors.


 RGB Color Mixing Concept

  • Red + Green = Yellow

  • Red + Blue = Magenta

  • Green + Blue = Cyan

  • Red + Green + Blue = White

  • All Off = Black

By adjusting brightness levels, you can create millions of color combinations.


 Arduino Code

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

int redPot = A0;
int greenPot = A1;
int bluePot = A2;

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

void loop() {
int redValue = analogRead(redPot);
int greenValue = analogRead(greenPot);
int blueValue = analogRead(bluePot);

redValue = map(redValue, 0, 1023, 0, 255);
greenValue = map(greenValue, 0, 1023, 0, 255);
blueValue = map(blueValue, 0, 1023, 0, 255);

analogWrite(redPin, redValue);
analogWrite(greenPin, greenValue);
analogWrite(bluePin, blueValue);
}

 How It Works

  • analogRead() reads knob position.

  • map() converts 0–1023 to 0–255.

  • analogWrite() generates PWM signal.

  • PWM adjusts LED brightness.

  • Combined output produces mixed color.


 What Students Learn

✅ Analog input reading
✅ PWM signal generation
✅ RGB color mixing
✅ Basic circuit design
✅ Arduino programming fundamentals
✅ Electronics troubleshooting


 Advanced Improvements

You can enhance this project by adding:

  •  Automatic color fade mode

  •  Sound-reactive RGB lamp

  •  Bluetooth control (via HC-05)

  •  Push-button color presets

  •  OLED display showing RGB values

  •  Brightness master control


 Applications

  • DIY mood lamp

  • Study room ambient light

  • Decorative lighting

  • Beginner electronics lab project

  • STEM exhibition demo


Comments