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 Pin | Connection |
|---|---|
| Left | 5V |
| Right | GND |
| Middle | Arduino Analog Pin |
Example:
-
Red Pot → A0
-
Green Pot → A1
-
Blue Pot → A2
RGB LED Connections (Common Cathode)
| LED Pin | Connect To |
|---|---|
| Red | PWM Pin 9 (via 220Ω resistor) |
| Green | PWM Pin 10 (via 220Ω resistor) |
| Blue | PWM Pin 11 (via 220Ω resistor) |
| Cathode | GND |
If using Common Anode RGB LED, logic must be inverted.
Working Principle
-
Arduino reads analog values (0–1023) from each potentiometer.
-
These values are mapped to PWM range (0–255).
-
PWM signals control brightness of Red, Green, and Blue channels.
-
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
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
BEGINNER PROJECTS (Foundation Skills)
- Ultrasonic Distance Measurement
- Traffic Light Simulation with 7-Segment Display
- 7-Segment Display Counter
- Kids Piano Circuit (8-Key Version)
- 16×2 LCD Display with Text Output
- LCD I2C to Arduino UNO
- Temperature Measurement using Arduino UNO
- LDR Controlled Street Light
INTERMEDIATE PROJECTS (Build Your Skills)
- Servo Motor Control Using Potentiometer
- DC Motor Speed Control
- Temperature Controlled Fan
- PIR Based Theft Alert System
- LPG Gas Leakage Detection System
- Automatic Door Locking System
- Soil Moisture Based Automatic Watering System
- Simple Digital Clock using Arduino UNO
- Automatic Voting Machine (EVM)
- Joystick Control using Arduino Uno
- RGB Lamp Control using Arduino Uno
ADVANCED PROJECTS (Master Level)
- Home Automation Using Arduino UNO
- Bluetooth RC Car using Arduino Uno
- Obstacle Avoiding Robot
- Line Follower Robot
- Radar System Using Arduino UNO
- Automatic Parking System
- Bi-Directional People Counter using Arduino Uno
- Automatic Plant Watering System
- NeoPixel LED Ring Control using Arduino Uno
- Smart Gloves for Bedridden People

Comments
Post a Comment