limchengwei
Published © CC BY

Tunable RGB LED Stick PCB

Thank you JLCPCB for sponsoring this project. Please order your PCB at jlcpcb.com/RAT

IntermediateWork in progress3 hours261
Tunable RGB LED Stick PCB

Things used in this project

Hardware components

JLCPCB Customized PCB
JLCPCB Customized PCB
×1
Arduino Nano R3
Arduino Nano R3
×1
Single Turn Potentiometer- 10k ohms
Single Turn Potentiometer- 10k ohms
×6
WS2812B Addressable RGB LED
×16
Female Header 15 Position 1 Row (2.54mm)
×2
DIP Switch 2 Pin SMD
×1

Software apps and online services

Arduino IDE
Arduino IDE

Hand tools and fabrication machines

Hot Air Station, Industrial
Hot Air Station, Industrial
Solder Paste, Rework
Solder Paste, Rework
Soldering iron (generic)
Soldering iron (generic)
Solder Wire, Lead Free
Solder Wire, Lead Free

Story

Read more

Schematics

Tunable RGB LED Stick Schematic PDF

Tunable RGB LED Stick Schematic

Tunable RGB LED Stick PCB

Tunable RGB LED Stick Gerber

Code

Tunable RGB LED Stick Code

Arduino
#include <FastLED.h>

#define NUM_STRIPS 2
#define NUM_LEDS_PER_STRIP 16
CRGB leds[NUM_STRIPS][NUM_LEDS_PER_STRIP];

#define Pot_H A0
#define Pot_S A1
#define Pot_V A2
#define Pot_R A3
#define Pot_G A4
#define Pot_B A5

int i, j;

void setup()
{
  pinMode (Pot_H, INPUT);
  pinMode (Pot_S, INPUT);
  pinMode (Pot_V, INPUT);
  pinMode (Pot_R, INPUT);
  pinMode (Pot_G, INPUT);
  pinMode (Pot_B, INPUT);
  FastLED.addLeds<WS2812B, 2, RGB>(leds[0], NUM_LEDS_PER_STRIP);   //GRB
  FastLED.addLeds<WS2812B, 3, RGB>(leds[1], NUM_LEDS_PER_STRIP);   //GRB
}

void loop()
{
  int Pot_H_val = map(analogRead(Pot_H), 0, 1023, 0, 255);
  int Pot_S_val = map(analogRead(Pot_S), 0, 1023, 0, 255);
  int Pot_V_val = map(analogRead(Pot_V), 0, 1023, 0, 255);
  
  int Pot_R_val = map(analogRead(Pot_R), 0, 1023, 0, 255);
  int Pot_G_val = map(analogRead(Pot_G), 0, 1023, 0, 255);
  int Pot_B_val = map(analogRead(Pot_B), 0, 1023, 0, 255);

  for (i=0; i<16; i++)
  {
    leds[0][i] = CHSV(Pot_H_val, Pot_S_val, Pot_V_val);
    FastLED.show();
  }
  for (j=0; j<16; j++)
  {
    leds[1][j] = CRGB(Pot_G_val, Pot_R_val, Pot_B_val);
    FastLED.show();
  }
  delay (10);
}

Credits

limchengwei
24 projects • 4 followers
Contact

Comments

Please log in or sign up to comment.