Water Surface Lamp

12,326

152

3

Introduction: Water Surface Lamp

This Instructable will show you how to make an atmosphere lamp that lights up just like making little waves on the water surface. It can be placed on your table, shelf, or bedside to create a harmonious atmosphere, bringing an absorbing experience to the user. To do this, you'll first want to gather the following materials:

Step 1: Parts, Tools, Supplies

Step 2: Circuit Diagram and Code

1. Simulate the final lighting effect:When people touch the center area to turn it on, the light effect will be like water waves, as if a hand touches the water surface.

2. The connection method of the touch sensor switch is shown in Figure 2. The open blue wire is to connect the conductive tape.

3. Connect the touch sensor and Neopixel rings with Arduino Uno, and play with the code to get a desired color affect.

You can change the code as follows according to your own Neopixel rings:

#define BUTTON_PIN   4 
#define PIXEL_PIN    6    
#define PIXEL_COUNT 111
#define BRIGHTNESS 50

bool oldState = HIGH;
int showType = 0; 
#define PIXEL_COUNT 111

Total number of leds.

void startShow(int i) {
  switch(i){
    case 0: colorAll(strip.Color(0, 0, 0), 0);    // Black/off
            break;
    case 1: 
      colorlast4(strip.Color(0, 255, 255), 0);
      for(int i=0; i<3; i++){ // change to i<2 to reduce from 3 to 2 repeats
      // adjust last value in each of these function calls to control speed
      // (more than 200 milliseconds for slower, less than 200 for faster)
      colorInnerRing(strip.Color(0, 150, 150), 200);
      colorInnerRing(strip.Color(0, 255, 255), 0);
      colorMiddleRing(strip.Color(0, 150, 150), 200);
      colorInnerRing(strip.Color(0, 150, 150), 0);
      colorMiddleRing(strip.Color(0, 255, 255), 0);
      colorOuterRing(strip.Color(0, 150, 150), 200);
      colorInnerRing(strip.Color(0, 0, 0), 0);
      colorMiddleRing(strip.Color(0, 150, 150), 0);
      colorOuterRing(strip.Color(0, 255, 255), 200);
      colorInnerRing(strip.Color(0, 0, 0), 0);
      colorMiddleRing(strip.Color(0, 0, 0), 0);
      colorOuterRing(strip.Color(0, 150, 150), 200);
      colorOuterRing(strip.Color(0, 0, 0), 0);  
    //colorAll(strip.Color(0, 0, 0), 0);
            break;}
}
colorInnerRing(strip.Color(0, 150, 150), 200);

Adjust the color of the leds.

void colorInnerRing(uint32_t c, uint8_t wait) {
  for(uint16_t i=0; i<12; i++) {
    strip.setPixelColor(i, c);
  }
  strip.show();
  delay(wait);
}
for(uint16_t i=0; i<12; i++)

In this line, "I'' stands for the number of leds. The inner Neopixel ring has 12 leds, so the code will be "I=0; I<12".

Step 3: Built the Circuit

1. Fix the position of Neopixel rings with nylon ties.

2. Build your circuit according to the circuit diagram above. You can test them on a breadboard first before soldering them together.

3. Plugin your Arduino board to your computer.

4. Download Arduino IDE if you haven’t already. Copy the code and run it in your Arduino IDE. Don’t forget to install the Adafruit NeoMatrix libraries before running the code if you never used an LED matrix before. Read this Adafruit-NeoPixel-Uberguide about NeoMatrix libraries, it will tell you the basics about NeoMatrix and how to install the libraries.

5. Download the code provided and upload the code to your Arduino.

6. Power supply with power bank.

Step 4: Assembly

1. Cut the cardboard. Cut a hole in the middle and make four supporting plates under the cardboard

2. Hide the Arduino Uno, the touch sensor and wires underneath.

3. Fix the rounded conductive tape in the center of the cardboard.

4. Secure the lamp on the cardboard with nylon ties.

5. Connect the power and test it.

6. Put everything into the bowl.

7. Stick a Neopixel strip around the inside of the bowl.

8. Cover the bowl with acrylic sheet.

Step 5: Final Outcome

Be the First to Share

    Recommendations

    • Game Design: Student Design Challenge

      Game Design: Student Design Challenge
    • For the Home Contest

      For the Home Contest
    • Big and Small Contest

      Big and Small Contest

    3 Comments

    0
    qin_0329
    qin_0329

    Question 4 months ago

    I don't know how to solve this problem
    Compilation error: Adafruit_NeoPixel.h: No such file or directory

    2
    WilkoL
    WilkoL

    2 years ago

    I like it! So I tried to make it, but as I did not have neopixel rings I made it with led-strips (ebay). I have made it with pulse-width modulation to simulate the wave-function. See https://youtu.be/4hcCU3rrJ7c


    The code for the ATTINY2313:

    #define F_CPU 8000000UL

    #include <avr/io.h>
    #include <avr/interrupt.h>
    #include <avr/pgmspace.h>
    #include <util/delay.h>


    const uint8_t sigmoid[256] PROGMEM =
    {
    1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
    1, 1, 2, 2, 2, 2, 2, 2, 2, 3, 3, 3, 3, 4, 4, 4, 5, 5, 6, 6, 7, 7, 8,
    9, 10, 10, 11, 13, 14, 15, 16, 18, 20, 22, 24, 26, 28, 31, 34, 37, 40,
    43, 47, 51, 55, 59, 64, 69, 74, 79, 85, 91, 96, 102, 109, 115, 121,
    128, 134, 140, 146, 153, 159, 164, 170, 176, 181, 186, 191, 196, 200,
    204, 208, 212, 215, 218, 221, 224, 227, 229, 231, 233, 235, 237, 239,
    240, 241, 242, 244, 245, 245, 246, 247, 248, 248, 249, 249, 250, 250,
    251, 251, 251, 252, 252, 252, 252, 252, 251, 251, 251, 250, 250, 249,
    249, 248, 248, 247, 246, 245, 245, 244, 242, 241, 240, 239, 237, 235,
    233, 231, 229, 227, 224, 221, 218, 215, 212, 208, 204, 200, 196, 191,
    186, 181, 176, 170, 164, 159, 153, 146, 140, 134, 128, 121, 115, 109,
    102, 96, 91, 85, 79, 74, 69, 64, 59, 55, 51, 47, 43, 40, 37, 34, 31,
    28, 26, 24, 22, 20, 18, 16, 15, 14, 13, 11, 10, 10, 9, 8, 7, 7, 6, 6,
    5, 5, 4, 4, 4, 3, 3, 3, 3, 2, 2, 2, 2, 2, 2, 2, 1, 1, 1, 1, 1, 1, 1,
    1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1
    };


    volatile uint8_t teller = 0;
    volatile uint8_t compare[8];


    int main(void)
    {

    DDRB = 0x3F; //PB0 .. PB5 output

    TCCR0A = 0x00; //normal mode
    TCCR0B = (1 << CS00); //prescaler = 1
    TIMSK = (1 << TOIE0); //interrupt on overflow

    sei();


    while (1)
    {
    teller++;
    _delay_us(10);
    }
    }

    ISR (TIMER0_OVF_vect)
    {
    static uint8_t counter = 0xFF;
    static uint8_t pinlevel = 0x3F;

    PORTB = pinlevel;

    if (counter++ == 0x00)
    {
    pinlevel = 0xFF;
    compare[0] = pgm_read_byte (& sigmoid[(teller + 0) % 256]);
    compare[1] = pgm_read_byte (& sigmoid[(teller + 43) % 256]);
    compare[2] = pgm_read_byte (& sigmoid[(teller + 86) % 256]);
    compare[3] = pgm_read_byte (& sigmoid[(teller + 129) % 256]);
    compare[4] = pgm_read_byte (& sigmoid[(teller + 172) % 256]);
    compare[5] = pgm_read_byte (& sigmoid[(teller + 215) % 256]);
    //compare[6] = pgm_read_byte (& sigmoid[(teller + 192) % 256]);
    //compare[7] = pgm_read_byte (& sigmoid[(teller + 224) % 256]);
    }

    if (counter == compare[0]) pinlevel &= ~0x01;
    if (counter == compare[1]) pinlevel &= ~0x02;
    if (counter == compare[2]) pinlevel &= ~0x04;
    if (counter == compare[3]) pinlevel &= ~0x08;
    if (counter == compare[4]) pinlevel &= ~0x10;
    if (counter == compare[5]) pinlevel &= ~0x20;
    //if (counter == compare[6]) pinlevel &= ~0x40;
    //if (counter == compare[7]) pinlevel &= ~0x80;
    }

    IMG_5289.JPGschematic.jpg
    0
    Qttting_F
    Qttting_F

    Reply 2 years ago

    Love it!!! Thanks for sharing!!!!