Desktop Color Lamp

by globalelectrotech_mid in Circuits > LEDs

229 Views, 1 Favorites, 0 Comments

Desktop Color Lamp

WhatsApp Image 2022-12-04 at 00.39.34.jpg
4.jpg
3.jpg
2.jpg
1.jpg

Hey guys this is a "Desktop Table Lamp" which can be used as decorative items in PC tables or at other places as a decorating item.


The WS2812B LED strip has three pots(VCC, Signal Input and GND respectively) for changing individual colors (R, G, and B), which can be used too create more than 15 million colour combinations.


Let's talk about the build process in detail.



Supplies

1.PNG
  • ARGB LED Strip (WS2812 LED Strip) x22(in my case)
  • Arduino Nano x1
  • 6v 600 mAh Lipo Battery x1
  • Jumper cables

Attach the WS2812 LED Strip to the White Container

2.PNG

I attached the WS2812 LED Strip to the white container using some masking tape.


The reason I am using this white container is that it will diffuse the light evenly in all directions.

Connect the WS2812 LED Strip With the Arduino

3.PNG

Then I connected the LED Strip to the Arduino Nano using jumper cables according to the connection diagram. I choose digital pin 7 (D7) as the signal input pin for the LED Strip.


The battery I am using is a 6v 600mAh lipo battery, which I collected from an old Bluetooth speaker.

Coding

// Sample 1

#include <FastLED.h>


#define LED_PIN   7

#define NUM_LEDS  23


CRGB leds[NUM_LEDS];


void setup() {


 FastLED.addLeds<WS2812, LED_PIN, GRB>(leds, NUM_LEDS);


}


void loop() {


 for (int i = 0; i <= 22; i++) {

  leds[i] = CRGB ( 0, 0, 255);

  FastLED.show();

  delay(40);

 }

 for (int i = 0; i <= 22; i++) {

  leds[i] = CRGB ( 0, 255, 0);

  FastLED.show();

  delay(40);

 }

 for (int i = 0; i <= 22; i++) {

  leds[i] = CRGB ( 255, 0, 0);

  FastLED.show();

  delay(40);

 }

 for (int i = 0; i <= 22; i++) {

  leds[i] = CRGB ( 255, 255, 0);

  FastLED.show();

  delay(40);

 }

 for (int i = 0; i <= 22; i++) {

  leds[i] = CRGB ( 255, 0, 255);

  FastLED.show();

  delay(40);

 }

 for (int i = 0; i <= 22; i++) {

  leds[i] = CRGB ( 0, 255, 255);

  FastLED.show();

  delay(40);

 }

 for (int i = 0; i <= 22; i++) {

  leds[i] = CRGB ( 255, 255, 255);

  FastLED.show();

  delay(40);

 }

 }



// Sample 2

#include <FastLED.h>


#define LED_PIN   7

#define NUM_LEDS  23


CRGB leds[NUM_LEDS];


void setup() {


 FastLED.addLeds<WS2812, LED_PIN, GRB>(leds, NUM_LEDS);


}


void loop() {


 int a, b, c;

 for(a=0, b=255, c=0 ; b>=0;a++, b--, c++){

  for (int i = 0; i <= 22; i++) {

   leds[i] = CRGB ( a, b, c);

   FastLED.show();

  }

 }

for(a=255, b=0, c=255 ; a>=0;a--, b++, c--){

  for (int i = 0; i <= 22; i++) {

   leds[i] = CRGB ( a, b, c);

   FastLED.show();

  }

 }

for(a=255, b=255, c=0 ; a>=0;a--, b--, c++){

  for (int i = 0; i <= 22; i++) {

   leds[i] = CRGB ( a, b, c);

   FastLED.show();

  }

 }

 }

We Need to Add Water to the Container

4.PNG
5.PNG

I poured some water in the transparent container. Because of transparency the light will not diffuse evenly. So I mix some white colour to the water.


This will work like a charm.

Sealing the Container

6.PNG

Then I seal the container with some hot glue to prevent water leakage and cover the container plastic lid to cover all the electronics.



YouTube Video Link

Desktop Table Lamp using #ws2812b LED Strip and #arduino_nano || Global ElectroTech

There is the detailed video of the project.