Introduction: (LED) "Plasma" Lamp
Here's a cool little lamp that is loads of fun to tinker with, mesmerizing to stare at, and even practical for illumination! Even better - most of the parts here are ready to purchase, compile or print!
I discovered this technique by accident when I had a whole bunch of junk from misc. projects piled on my desk - I put one thing on another and it looked very cool! Check out the YouTube video about for a few quick examples of how this lamp looks before we get started on the how-to.
Just be aware, the design of it inherently gives some very weird reflections and in 3D space, so the video doesn't quite capture the true dimensionality of it's appearance.
One neat part is it's web interface - you can access it's control panel from a smartphone or computer and play with the settings. (More on that later).
In terms of being "just a lamp" - I think if we crank it up all the way - the LEDs on the (96 pixels x 3 colors each) will burn like 6.5 Watts! That's a very decent amount of light!
Let's get started:
Supplies
- ESP32 Microcontroller. I use an ESP32 DEVKIT v1.
- NeoPixel LED Pixel Rings (Why build when you can just buy??)
- 3D Printer - Transparent filament (& Black)
Step 1: Making the "Lamp"
The "lamp" part is the heart and soul of this project. It looks like a glass "lamp".
I've included STL files for these. The original CAD design is also available HERE.
These should be printed in transparent filament. In my design they are thin - i.e. the width of a standard printer nozzle. If you are using a program such as PrusaSlicer or Slic3r3D - there is a "vase mode" you should enable for the print.
Unlike normal printing where a printer prints layer-by-layer, "vase mode", or "spiral vase mode" is made for very thin-walled objects. It prints the shell of the object as one continuous spiraling line. It is good for prints like this - though shouldn't be a requirement. If printing like this, you should also only print ONE piece at a time (so there is no jumping of the head from part to part). This also gives a perfect print with no stringing.
Another neat thing here is - once the parts are printed - there is no rule on HOW they must be placed on the lamp bed. Play around and see what looks the best - or even design and print your own. They are all just basic curves with a sweep!
Attachments
Step 2: Making the Other Parts
There are a couple of other parts you could also mix-and match. There is a stand that holds it, (I print in black) - and a flat part that goes around the LEDs to give the lamp parts a flat place to sit. There is also a transparent part I used as a bit of a diffuser. You can optional sand this part a bit to help diffuse the LEDs if you find them too pronounced.
I also played with another part that spaced between the LEDs and diffuser - this gave it more of a focused, square LED look. All parts are in the aforementioned CAD link, and in included STL files.
Attachments
Step 3: Software
I used an ESP32 project for the Espressif IDF (v4.2) development environment. If you've ever messed with an ESP32, you may have opted to use what is perceived as the "simpler" Arduino environment. I started that way too, and came to the realization the the Espressif environment was actually a fantastic, professional-grade, well-supported framework MUCH better suited to any kind of work, from hobbiest to pro. It also does not have a terrible learning curve, and comes with fantastic documentation and examples!
Anyway - my code is available HERE (github). You should have to do little-more then run `idf.py menuconfg` and find the Example Project Settings to configure your Wifi SSID and password, then do an `idf.py build` and an `idf.py flash` to send it to your board. I even have a wonky little CLI you can connect to with `idf.py monitor`. (Pro Tip: You can also build and flash directly from the "monitor" command!)
Step 4: Final Connection
Final connection is pretty simple. Your NeoPixel ring needs +5 and ground - which you can get directly from those pins on the ESP32. The "data" pin from the NeoPixel ring connects to GPIO 18 on the ESP32. That's it!
You might also want a case for your ESP32 - I used THIS ONE which I also designed.
Step 5: Using Your Lamp
The primary way to interact with the lamp is through the web ui. Go to:
http://{ipaddr}/index.html
...to get to the web page. The UI might seem a bit awkward, but it is actually well-situated for most of the things you'll want to do with it.
Ring Settings
Most of the interface is devoted to "setting" various parameters. Note that parameters are only set when they are CHECKED. Global parameters (at the top) apply to the board as a whole,. whereas the "Ring Settings" will be applied to the rights which you have selected in "Change Rings" (0=Outermost, 5=Innermost)
A "huespeed" which is nonzero will overide the color value for a ring - applying instead a color which changes as "huespeed" rate. To turn this off, simply check "huespeed" while leaving it's value as "zero".
Other settings include:
"Angles" - How many wedges to draw per ring.
"Length" - Low long each wedge is
"Width" - Width of the edge of the wedge where the color gradually fades to black.
"Speed" - How fast the ring osccilates
"Mode" - Mode "0" is "normal" - whereas "mode 1" overrides everything and just gives it a random, flickery flame effect.
You can set the parameters for each ring independently, giving it a LOT of different parameters.
Global Settings
Sparkle - number of random white sparkles to apply over the ring.
flicker - Color to randomly "flicker" over pixels
numflicker - How many random "flicker" pixels to add
(Yes, "sparkle" is just like "flicker", but always white).
Presets
If you have a setting you like - you can select a preset slot (0-7) and "save" or "load" it's preset. Note that the lamp will automatically start "Preset 0" on power-on.
Troubleshooting
"idf.py monitor" will give you a serial monitor to show you what is happening.
If your lamp is spontaneously resetting - you are probably trying to turn too many lights on too bright at the same time with too weak of a power supply.