You could buy something like that for a few bucks.
Yeah, but I didn’t want to be tied to any API, app or remote control.
My intention was not to create a standard of DIY lights.
There are lots of options to buy or build better than this.
My idea was to control the whole process and use the LEDs as I please.
Where to startNecessary things:A broken LED bulb (0US$).
A board with an ESP8266 chip (~5US$).
I used the Wemos D1 mini because it is widely used.
A tiny 5v adapter (~2US$).
The one I’ve used is not an iPhone adapter.
It’s a cheaper replica but it does its job pretty well.
NeoPixel LED Ring, 16 x 5050 Ws2812 (~3US$).
A few thin wires (0US$).
A broken micro-USB connector (optional).
Connect and test the ringFirst, solder the ring and the Wemos like this:Basic Wiring (D6 is not mandatory)Install Arduino IDE (https://www.
Test the ring with this example made by Shae Erisson with some minor modifications:Necessary library: https://github.
Choose the board: LOLIN(WEMOS) D1 R2 & mini.
Select the USB port:5.
Burn the example:Burning Code with Arduino IDEFinally, It should look like this:Dummy example runningBut it feels like:3.
Let’s burn the final codeYou have 2 options =>3.
SHORTCUTDownload the project code: https://github.
com/cervgon/RRGGBB_Multicolor_LampOpen the lamp_begins file and change the SSID with your wifi network name and its password.
Then choose the local IP.
If you don’t know how the local IP should be, the easiest way to get it for any OS is visiting this site: https://www.
In my case, the local IP of my laptop is 192.
3, so I’ve chosen 192.
200 for the lamp.
Please, check twice the first 3 numbers of the IP and the gateway.
Otherwise it won’t work.
Lines 73 and 74 of the example.
Now, burn it in the same way you did with the project file you have changed.
Step by step.
Please read the comments of each code file.
Let’s set some colors.
It’s very simple.
Just call the local IP slash the HEX colors separated with hyphens.
With this code example, you can set 2^n colors up to 16: 1,2,4,8,16.
One color2 colors8 colors4.
Back to the board.
Let’s make it red (#ff0000).
Go to your browser and GET:http://192.
200/ff0000It should look like this:http://192.
x/ff0000Instead of using your browser, you can use the Postman app.
Let’s set 2 colors(#ff0000 and #00ffa2).
200/ff0000-00ffa2It should look like this:4.
Let’s make a rainbow.
Let’s connect everything (complete wiring)WiringI left the micro USB port of the Wemos free in order to update the board and fix potential bugs.
If you want, you can solder both cables (VCC and GND) to the Wemos board, but that could be impractical.
You can use other digital pinout.
D6 isn’t mandatory.
Keep in mind that it is important to leave about 20cm (8") of cable between the 5v adapter and the tip of the cable in order to make the installation easier.
Detach the 5v adapter and solder the cablesProtect the soldering using hot glue6.
Assemble everythingHot glue the LED ring to the bulb caseTry to leave the antenna free like the picture abovehttp://192.
x/ff0000Top View: My new lock-screen wallpaper7.
ShortcutsIf you are an iOS user, you might use the Shortcuts application.
It’s really useful to create routines.
Let’s create one using the bulb.
Watch OS appI’ve built this app for my apple watch in order to handle the lights from it.
You can change the quantity of colors in the picker using the crown.
Every colors triggers a GET call like GET http://192.
x/hex_color_hereWatchOS Color Picker7.
Notifications instead of triggering manuallyI’ve crafted a Drip Irrigation System for my wife’s plants.
As you can see in the picture below, there is a tank full of water with 3 pumps inside it, one per each group.
Those pumps provide the plants with water.
At the top of the tank, there is an ultrasonic sensor connected to a Wemos which triggers notifications when the water level is too low or too high.
Too much water notification7.
Do whatever you wantMIND BLOWNConclusionThere are 256³ (16 million) possible colors using #RRGGBB notation using only one value.
If you use more than one color at the same time, the number goes too high.
I think it would be (256³)¹⁶=256⁴⁰⁹⁶ possible combinations.
So, enjoy playing with it.
In the second part, I’ll make the network changing easier without needing to burn the code again, and I’ll add more features.
Bonus Track: data backupI forgot to mention that using the lamp_with_data_backup code, every time you set a combination of colors, those values will be saved in the memory of the board.
So, if the power goes down or you unplug the power cable, the lamp will reconnect itself to the network and it will set the saved combination of colors.
Suggestions are more than welcome! Made with ❤.. More details