DIY WiFi RGB LED Soft Lamp

7,644

75

16

Introduction: DIY WiFi RGB LED Soft Lamp

About: I'm an IT guy, maker, hobbyist, really like to make different things with kids and play/test with them in a spare time.

This lamp is almost whole 3D printed, including the light diffuser other parts cost about 10$. It has lots of preconfigured, light animation effects and static light colors with autoplay loop feature. Lamp stores last used setting to the internal memory, so it could be configured once and used like usual lamp with power switcher. No app required, it could be controlled by using any device where browser is available. It also can operate in 2 modes, as standalone and part of home WiFi network.

Supplies:

• 1 x Double Side Prototype PCB 4*6 cm

• 1 x HLK-PM01 AC-DC 220V to 5V Step-Down Power Supply Module or something similar

• 1 x Wemos D1 Mini WiFi Development Board Micro USB

• RGB I2C LED strip with 60 LEDs/m

• 4 x M3 nuts

• 2 x M3x6 screws

• 5 x M3x12 screws

• power cord with plug and switcher on it

• some jumper wires

• 3 x header pins

• soldering tools

• 3D printer with Clear and Black filament

Step 1: 3D Print Parts

All attached STL models, except diffuser could be printed with any desirable settings.

Here is an example:

Layer Height: 0.2

Supports: NO (YES only for the base model)

Walls: 0.8 mm

To get more smooth light it's better to bring diffuser in VASE mode and over extrude plastic, to achieve this, set flow to 120%, see attached image.

I'd recommend to print LED tower first, it'll allow to faster switch to the next step.

Step 2: Soldering

First of all we have to stick the LED stripe to the LED tower. If you're using the same LED stripe, like me (60 leds/m) then cut 3 pieces, 1 with 10 LEDs, 2 other with 9 LEDs. Use attached image, as reference and stick the LED stripe to the tower and make sure that all arrows on the stripe are in the same direction and pointed from the bottom to the top. Solder the wires to the stripe as shown on wiring diagram.

Take the PCB and cut it between the AC power pins, like shown on image. Insert the AC module into PCB holes, solder it. Do the same with Wemos board. Please note that there is no need in soldering all pins for Wemos board, we need only 3 of them. Insert the pins header and solder it. Connect all of that with wires.

Step 3: Configure and Upload Software

In nowadays there is plenty of different libraries, code and other stuff, that was done by different people, this example based on Jason Coon's work.

We have to download and configure Arduino IDE, thanks to Steve Quinn, who already created a comprehensive guide of doing this in his Instructable, so there is no need in typing all of that.

Once previous step done - open the sketch in Arduino IDE.

Find the line "const bool apMode = false;" and make a decision, how you're going to use this lamp, "true" means that it'll be operated in standalone mode and device to control it have to be connected via WiFi directly to it.

Find the "#define NUM_LEDS 10" line and set the number of pixels equal to the length of the longest LED stripe.

Open the Secrets.h tab in Arduino IDE and fill the file based on your choice before.

Save and upload the sketch to the ESP board. Use "ESP 8266 Sketch Data Upload" menu and upload other files from sketch to the SPIFS. Once this done you can connect the LEDs and access the lamp by typing http://magiclamp in your browser , if you have set "const bool apMode = false;".

For the AP (standalone) mode you have to find WiFi Network called "MagicLamp + numbers" and connect to it by using password that you have set in "Secrets.h" file. After this done - connect to the lamp by typing http://192.168.4.1 in your browser. A page will be loaded with many control options.

Step 4: Assembling

When you have all parts printed, finished soldering and successfully uploaded and tested software - we can assemble this lamp.

• screw the electronics holder to the base lid

• unsolder the ac wire from the PCB and thread it through the cable hole in the base

• solder the wire back to its place

• snap the PCB on its place

• fix the AC wire by cable clamp

• stick the LED towed with less to the base by using 2 sided sticky tape or glue

• connect LED wires with PCB

• close the base with the lid and use 3 screws to fix it

• put the diffuser on top of the lamp (be careful it have to be pushed tightly and gently)

That's it!

Now you can turn it on and find some light animation that you'll love.

Thank you for reading.

Indoor Lighting Contest

Participated in the
Indoor Lighting Contest

Be the First to Share

    Recommendations

    • Microcontroller Contest

      Microcontroller Contest
    • Automation Contest

      Automation Contest
    • Make it Glow Contest

      Make it Glow Contest

    16 Comments

    0
    ton.twaalfhoven
    ton.twaalfhoven

    7 weeks ago

    Hi Igor,
    I made a lamp. In wifi mode it works fine but i can't get it to work in ap mode. I can connect with the ssid. I provided a password in the secrets.h file but when connecting to the lamp it does not ask for a password. But when i open my browser nothing happens
    I hope that you can give me some pointers. By the way i'm a newbie when it comes to programming so that's probably the problem.

    Regards Ton

    0
    JulezR
    JulezR

    Question 1 year ago

    Hey Igro. Very nice project! Where can i find the code of your Project?

    0
    IgorM92
    IgorM92

    Answer 1 year ago

    Hello. Nice to hear that this project people likes. Not sure what has happened but zip file has disappeared and was found in the project's library. I've reattached the zip file file with the code to the step #3.
    Kind regards, Igor

    0
    JulezR
    JulezR

    Reply 1 year ago

    Thank you very much!

    0
    RayS47
    RayS47

    1 year ago

    Great project. I calculate the power for the 28 LEDs to be close to 9W (18W/meter @ 60LEDs/m) but your 5V supply is only 3W. Does that work because you never run all the LEDs on full white?

    0
    IgorM92
    IgorM92

    Reply 1 year ago

    Hello. Thank you for your attention to details. There is an option in the code (Line:50) that says ```#define MILLI_AMPS 600``` which sets the max current to use and prevent the power supply to the overload, in our case it's 3W (600mA). So, even if you set the max power in the web interface it'll be limited by this option.
    Note: On practice, even this brightness is more than enough for such king of lamp.

    0
    EmanuelG33
    EmanuelG33

    1 year ago

    Hello Igor, really nice lamp! I've printed all things (I just used white PLA for the diffuser instead of transparent) but I don't get the code work. :-(
    The wemos connects to my WiFi and get an IP, but in my browser it shows only
    "Not found: /"
    Maybe you can help me, please. Is there a file missing or am I doing something wrong?

    Thank you!

    0
    IgorM92
    IgorM92

    Reply 1 year ago

    Hello. Thank you for the kind words. Sound like you forgot to upload the html files to the ESP file system. https://take.ms/8oE1F
    Please read the notes and let me know if you'll be experiencing any issues.

    0
    EmanuelG33
    EmanuelG33

    Reply 1 year ago

    Hello Igor, thanks for your reply. I had some issues with SPIFF upload (old tool) but I get it managed. So I uploaded the webfiles with 2M SPIFFS flashsize (1M didn't work) and the webserver is running :-)
    But unfortunately no control for the LEDs. Only the first glows white and the second green. I tried WS2811 and WS2812 for LED_TYPE but it didn't work.
    Any suggestions?

    0
    EmanuelG33
    EmanuelG33

    Reply 1 year ago

    Yeah! It works :-)
    The problem was the wrong pinnumber!
    your code: #define DATA_PIN 4 (but correct is D4 for wemos D1 corresponding to your picture above)
    Thanks for your help and this nice lamp. You got my vote!

    0
    IgorM92
    IgorM92

    Reply 1 year ago

    Nice that you got this stuff working. Apologies for the late response, it's a weekend and kids have occupied almost all my attention. Noted about the code, fixed that by adding the commend in the code and rue-load the ZIP file. I'm using the ESP 12F modules soldered on wemos board and all works fine with DATA_PIN 4 . Hope that our messages will help other, who will be doing this project.
    Kind regards, Igor

    0
    jeanniel1
    jeanniel1

    1 year ago

    You got my vote!

    0
    IgorM92
    IgorM92

    Reply 1 year ago

    WHOA!
    Thank you very much!

    0
    alcurb
    alcurb

    1 year ago

    Very nice project. I look forward to seeing the video and see what the browser page looks like in action.

    0
    IgorM92
    IgorM92

    Reply 1 year ago

    Hi. Thank you for the kind words and reminder about the video. Please have a look at the top of the page, you'll find a demo for the interface in desktop browser.

    0
    alcurb
    alcurb

    Reply 1 year ago

    Wow. That looks like a lot of fun and surprising the wee Wemos can do all of that. Very cool.