
Driving an RGB LED — SIK Circuit 3
Інструкції
Parts & Introduction
Parts & Introduction
An RGB LED contains three tiny LEDs (red, green, blue) in one package. By mixing different brightness levels of each color, you can create any color in the rainbow. This experiment introduces analogWrite() for PWM output.
Parts Needed
- 1x Arduino Uno + USB cable
- 1x Breadboard
- 1x RGB LED (Common Cathode)
- 3x 330Ω Resistors
- 5x Jumper Wires
RGB LED Pin Order (flat edge facing you): Red, Ground (longest pin), Green, Blue.
Матеріали для цього кроку:
SparkFun Inventors Kit - V3.21 набір
Arduino Uno R31 штука
Breadboard1 штука
RGB LED (Common Cathode)1 штука
330 Ohm Resistor3 штук
Jumper Wires5 штукНеобхідні інструменти ({count})
Hardware Hookup
Hardware Hookup
Wiring Instructions
- Place the RGB LED in the breadboard. Identify pins from the flattened edge: Red, GND (longest), Green, Blue.
- Connect the GND pin (longest, second from left) to the GND rail.
- Connect the Red pin through a 330Ω resistor to Arduino Pin 9.
- Connect the Green pin through a 330Ω resistor to Arduino Pin 10.
- Connect the Blue pin through a 330Ω resistor to Arduino Pin 11.
Pins 9, 10, and 11 are all PWM-capable (marked with ~ on the board).
Матеріали для цього кроку:
RGB LED (Common Cathode)1 штука
330 Ohm Resistor3 штук
Breadboard1 штука
Jumper Wires5 штукArduino Code
Arduino Code
Open the Arduino IDE and upload the following sketch to your Arduino board.
Матеріали для цього кроку:
Arduino Uno R31 штукаНеобхідні інструменти ({count})
Test & Experiment
Test & Experiment
What You Should See
The LED cycles through 8 solid colors (off, red, green, blue, yellow, cyan, purple, white) for 1 second each, then smoothly fades through the entire color spectrum.
Troubleshooting
- Incorrect colors: With four pins close together, it's easy to misplace one. Double-check each connection.
- Red too bright: The red diode is often brighter. Try a higher-value resistor on the red pin, or reduce in code:
analogWrite(RED_PIN, redIntensity/3).
Experiments to Try
- Add a potentiometer to control which color is displayed.
- Create your own color sequences — try a "sunrise" effect (dark red → orange → yellow → white).
Матеріали
6- $105.00
- 1 штукаЗаповнювач
- 1 штукаЗаповнювач
- Заповнювач
Required Equipment
Equipment this kind of build typically needs — buy from any maker below.
- CriticalSoldering Iron·
Helping Hands Soldering Stand
Solder Tip Tinner and Cleaner
SparkFun Solder-able Breadboard - Mini
Soldering Iron
Solder Wire
Soldering Flux Paste (50g, Rosin-Based) - RecommendedBreadboard·
JST to Breadboard Jumper (3-pin)
Breadboard - Translucent Self-Adhesive (Clear)
Solderless Breadboard 830 Points (3-Pack)
SparkFun Solder-able Breadboard - Mini
Breadboard Power Supply USB - 5V/3.3V
Breadboard - RecommendedDust Mask / Respirator·
Full-Face Gas Mask (ABEK multi-gas cartridge)
Dust Mask
Venetian Mask Blank (Papier-Mache)
Full-Face Respirator
Respirator Fit Test Kit
Respirator with Acid Gas Cartridge - RecommendedMultimeter·
Multimeter Tweezer Probes
Digital Multimeter - Basic
Digital Multimeter Pro
Multimeter
Digital Multimeter (Auto-Range, True RMS)
Digital Multimeter - RecommendedSafety Glasses·
Safety Sign (Caution/Warning)
Splash-Proof Safety Goggles
Reflective Safety Vest Kit (DIY)
Chemical Splash Goggles
Safety Netting for Rockfall
Steel-Toed Safety Boots - RecommendedWire Strippers·
Wire Strippers
Wire Stripper & Crimping Tool (AWG 10-22)
Wire Stripper - RecommendedWork Gloves·
Boxing Gloves (Training)
Leather Gauntlet Gloves
Cotton Gloves
Welding Gloves
Heavy-Duty Gloves
Leather Work Gloves - OptionalFire Extinguisher·
ABC Fire Extinguisher
Fire Extinguisher - OptionalFirst Aid Kit·
First Aid Kit
Mountain First Aid Kit (Altitude)
Workshop First Aid Kit
Bow Release Aid - OptionalHelping Hands / Third Hand·
Helping Hands Soldering Stand
Helping Hands
PCB Holder Helping Hands (with Magnifier)
Helping Hands (Third Hand)
You can swap these in
Can't get one of the materials? Swap it for an equivalent — these work just as well.
- Instead of Arduino Uno R3, try:
Prototyping Shield for Arduino Uno (3-Pack)
Arduino Uno R3 Board
Arduino Uno - Instead of Resistor 330 Ohm 1/6 Watt PTH - 20 pack, try:
Resistor 10K Ohm 1/6th Watt PTH - 20 pack
AVR ISP Shield - PTH Kit
Resistor 1.0M Ohm 1/6th Watt PTH - 20 pack - Instead of Breadboard, try:
Solder-able Breadboard - Instead of LED - RGB Diffused Common Cathode - 5mm, try:
LED - RGB Clear Common Cathode - 5mm
Recommended for this build
Products makers often use with builds like this one.
5mm LED Assortment Kit (300pcs, 5 Colors)Used together and in similar builds
Resistor 10K Ohm 1/6th Watt PTH - 20 packFrequently used with this build's materials
Diode KitFrequently used with this build's materials
BC547 NPN Transistor (50-Pack)Frequently used with this build's materials
Push Button - 33mmFrequently used with this build's materials
Piezo ElementFrequently used with this build's materials
PotentiometerFrequently used with this build's materials
Servo MotorFrequently used with this build's materialsRelated blueprints
Other builds that share materials, tools, or techniques with this one.






CC0 Суспільне надбання
Це креслення випущено під ліцензією CC0. Ви можете вільно копіювати, змінювати, поширювати та використовувати цю роботу для будь-яких цілей без запиту дозволу.
Підтримайте мейкера, купуючи продукти через його креслення, де він отримує Комісію мейкера встановлену вендорами, або створіть нову ітерацію цього креслення та включіть його як зв'язок у власне креслення для розподілу доходу.