Hardware components | ||||||
| × | 1 | ||||
| × | 1 | ||||
| × | 1 | ||||
Software apps and online services | ||||||
| ||||||
Hand tools and fabrication machines | ||||||
| ||||||
|
From last few weeks we are seeing many posts about the Impossible Floating table. Using the same concept I have designed a Lithophane Floating Lamp. Lithophane Floating Lamp is a desk lamp, having the photos you desire to have on it. Its can be a best gift for your loved ones. The lamp has different color modes which can be triggered using a push button or a IR sensor.
Circuit Diagram For Push Button
*You can choose the mode of triggering the lamp color modes either by push button or IR sensor.
*The code for both the option is same.
*Make all the connections as shown in circuit diagram.
*I have used WS2811 LEDs, I will recommend you to use any addressable LED Strip so that it can be more continent.
*The code for both the option is same.
*Make all the connections as shown in circuit diagram.
*I have used WS2811 LEDs, I will recommend you to use any addressable LED Strip so that it can be more continent.
Circuit Diagrams for IR Sensor
*You can choose the mode of triggering the lamp color modes either by push button or IR sensor.
*The code for both the option is same.
*Make all the connections as shown in circuit diagram.
*I have used WS2811 LEDs, I will recommend you to use any addressable LED Strip so that it can be more continent.
*The code for both the option is same.
*Make all the connections as shown in circuit diagram.
*I have used WS2811 LEDs, I will recommend you to use any addressable LED Strip so that it can be more continent.
#include <FastLED.h>
#define LED_PIN 3
#define NUM_LEDS 20
#define LED_TYPE WS2811
#define COLOR_ORDER RGB
#define BRIGHTNESS 255
CRGB leds[NUM_LEDS];
#define UPDATES_PER_SECOND 100
char ir_pin=A0;
int ir_value=0;
int mode=0;
CRGBPalette16 currentPalette;
TBlendType currentBlending;
void setup()
{
Serial.begin(9600);
pinMode(ir_pin, INPUT_PULLUP);
FastLED.addLeds<LED_TYPE, LED_PIN, COLOR_ORDER>(leds, NUM_LEDS);
FastLED.setBrightness( BRIGHTNESS );
currentPalette = RainbowColors_p;
currentBlending = LINEARBLEND;
}
void fadeall()
{
for(int i = 0; i < NUM_LEDS; i++)
{
leds[i].nscale8(250);
}
}
void loop()
{
ir_value=digitalRead(ir_pin);
if(ir_value==LOW)
{
mode++;
delay(1000);
}
if(mode==0)
{
leds[0] = CRGB(255, 255,255);
leds[1] = CRGB(255, 255,255);
leds[2] = CRGB(255, 255,255);
leds[3] = CRGB(255, 255,255);
leds[4] = CRGB(255, 255,255);
leds[5] = CRGB(255, 255,255);
leds[6] = CRGB(255, 255,255);
leds[7] = CRGB(255, 255,255);
leds[8] = CRGB(255, 255,255);
leds[9] = CRGB(255, 255,255);
leds[10] = CRGB(255, 255,255);
leds[11] = CRGB(255, 255,255);
leds[12] = CRGB(255, 255,255);
leds[13] = CRGB(255, 255,255);
leds[14] = CRGB(255, 255,255);
leds[15] = CRGB(255, 255,255);
leds[16] = CRGB(255, 255,255);
leds[17] = CRGB(255, 255,255);
leds[18] = CRGB(255, 255,255);
leds[19] = CRGB(255, 255,255);
FastLED.show();
}
if(mode==1)
{
leds[0] = CRGB(0, 242, 2554);
leds[1] = CRGB(0, 242, 255);
leds[2] = CRGB(0, 242, 255);
leds[3] = CRGB(0, 242, 255);
leds[4] = CRGB(0, 242, 255);
leds[5] = CRGB(0, 242, 255);
leds[6] = CRGB(0, 242, 255);
leds[7] = CRGB(0, 242, 255);
leds[8] = CRGB(0, 242, 255);
leds[9] = CRGB(0, 242, 255);
leds[10] = CRGB(0, 242, 255);
leds[11] = CRGB(0, 242, 255);
leds[12] = CRGB(0, 242, 255);
leds[13] = CRGB(0, 242, 255);
leds[14] = CRGB(0, 242, 255);
leds[15] = CRGB(0, 242, 255);
leds[16] = CRGB(0, 242, 255);
leds[17] = CRGB(0, 242, 255);
leds[18] = CRGB(0, 242, 255);
leds[19] = CRGB(0, 242, 255);
FastLED.show();
}
if(mode==2)
{
leds[0] = CRGB(255, 70,0);
leds[1] = CRGB(255, 70,0);
leds[2] = CRGB(255, 70,0);
leds[3] = CRGB(255, 70,0);
leds[4] = CRGB(255, 70,0);
leds[5] = CRGB(255, 70,0);
leds[6] = CRGB(255, 70,0);
leds[7] = CRGB(255, 70,0);
leds[8] = CRGB(255, 70,0);
leds[9] = CRGB(255, 70,0);
leds[10] = CRGB(255, 70,0);
leds[11] = CRGB(255, 70,0);
leds[12] = CRGB(255, 70,0);
leds[13] = CRGB(255, 70,0);
leds[14] = CRGB(255, 70,0);
leds[15] = CRGB(255, 70,0);
leds[16] = CRGB(255, 70,0);
leds[17] = CRGB(255, 70,0);
leds[18] = CRGB(255, 70,0);
leds[19] = CRGB(255, 70,0);
FastLED.show();
}
if(mode==3)
{
static uint8_t hue = 0;
for(int i = 0; i < NUM_LEDS; i++) {
leds[i] = CHSV(hue++, 255, 255);
FastLED.show();
fadeall();
delay(10);
}
for(int i = (NUM_LEDS)-1; i >= 0; i--) {
leds[i] = CHSV(hue++, 255, 255);
FastLED.show();
fadeall();
delay(10);
}
}
if(mode==4)
{
static uint8_t startIndex = 0;
startIndex = startIndex + 1;
FillLEDsFromPaletteColors( startIndex);
FastLED.show();
FastLED.delay(1000 / UPDATES_PER_SECOND);
}
if(mode==5)
{
FastLED.clear();
FastLED.show();
}
if(mode==6)
{
mode=mode-6;
}
}
void FillLEDsFromPaletteColors( uint8_t colorIndex)
{
uint8_t brightness = 255;
for( int i = 0; i < NUM_LEDS; i++) {
leds[i] = ColorFromPalette( currentPalette, colorIndex, brightness, currentBlending);
colorIndex += 3;
}
}
Mukesh Sankhla
22 projects • 34 followers
🧑💻Passionate software engineer at Siemens, dedicated to driving digitalization by day.
🧑🏭By night, I'm a Maker.
Comments