Introduction: Hijack RGB Flood Light With Arduino or ESP8266
So I found some great little RGB flood lights on amazon and upon looking into the guts of them, I realised that you can hook them straight up to an arduino and esp8266 and control them using PWM.
I now use two of them in my living room as accent lighting and have them set for certain scenes.
I use openhab running on a raspberry pi to control them and I can even control them with amazon Echo (US), though that is slightly beyond the scope of this instructable I hope to find time to write that up!
Hope you enjoy, this is my first instructable for a very long time so please let me know what you think.
Step 1: Gather Parts
The parts list is as follows:
1. 10W RGB Flood Light: Ebay (UK), Ebay (US), Ebay (China)
2. ESP8266-12 Module: Ebay (UK), Ebay (US), Ebay (China)
3. LD1117 3.3V Regulator: Ebay (UK), Ebay (US), Ebay (China)
4. 100uF Capacitor: Ebay (UK), Ebay (US), Ebay (China)
5. 12V 1A DC Power Supply: Ebay (UK), Ebay (US), Ebay (China)
6. A selection of resistors (I used 10K, but really you can make do with whatever)
(I have attached links to multiple sites as prices change regularly so please do shop around and be sure to check amazon vs ebay)
Full disclosure: I do earn a tiny commission if you buy through the links above but I would never recommend a link to a product that I haven't used myself. This project was not designed to be a money maker. Thank you :-)
Step 2: Disassemble Flood Light and Identify RGB PWM Inputs.
This particular flood light is a simple screw together design.
The chassis comprises of three aluminium sections that all unscrew.
Removing the top section that holds the lens in place reveals the PCB with the LED array and control circuitry.
The first thing that I did was to identify which of the transistors controlled which colour array.
Hopefully the manufacturer does not have too many variations between board revisions, which would mean you can copy the image above, and solder wires directly to them. I have colour coded for Red, Green and Blue to make it easier for you. Interestingly though the transistor controlling the red LED was connected to the existing microcontroller via a resistor, so I left this in the circuit.
It is also important for this step to remove the existing control components from the PCB with a hot air gun and some tweezers, as can be seen in the picture above. It wasn't absolutely necessary to remove the infrared receiver, but I thought I could use it in other projects.
Next just solder on some wires to the PWM pins going to the transistors and poke them through out to the other section of the light chassis, which is where we'll go to next.
Step 3: ESP8266 and Power Wiring
I have attached a schematic for this part as it says what you need to do much more clearly than I ever could.
Basically wire your red, green and blue LEDs to pins 12, 14 and 15 of the ESP8266 via a 10K resistor.
Then wire up the ESP power circuit as per the schematic, in the picture it shows that I have soldered it directly to the power supply/driver board for the LEDs but I did end up changing the orientation and didn't manage to grab another picture.
The idea here is to keep everything as compact as possible, as it will need to fit inside of the chassis.
To achieve this I spliced the resistors inline with the wires and covered them with heatshrink.
Please avoid my mistake and don't solder the resistor directly onto the ESP. I found this made them more difficult to work with than if I had done a true inline splice (as in wire-resistor-wire-esp rather than wire-resistor-esp).
Also the photo does look slightly different to the schematic, I didn't use pin 15 originally and this was a mistake as pin 15 is great at pwm. Love that pin. It rules.
Step 4: Program It!
Using your preferred method, write the code for your ESP!
You can really choose to control it however you want, and there are amazing people out there doing amazing things with the ESP.
MY particular route was to use a MQTT home server in the form of openHAB that the light would then log on to and listen for colour commands. Using this method also allows me to use amazon Alexa and google home for control extremely easily. (As I said before, I hope to be able to write instructables for that process as I've had a great time doing it but am currently spending most of my free time building a new website (that will probably involve tutorials for those pieces any way)).
I have attached the code for that to this 'ible, above (or below, wherever it appears).
I must say, I used to only develop in arduino IDE for ESP8266 but since I have started this particular project I am definitely being converted over to Lua scripts, they are great and a much less stressful time when uploading and debugging etc.
Once upon a time, I did write a program in arduino that did the following:
ESP boots, can't connect to wifi, starts access point mode
client connects with phone, automatically opens browser with colour control page (basic html)
in the page, there was also an option to connect it to your router.
Once it was on the network, any control system could be programmed to send http requests pretty easily.
If I can find that code somewhere I will upload it, but have recently built a new PC so that file could be on any mixture of drives around the place.
Step 5: Cram It All Back Together!!
In order to insulate all of the pieces, I wrapped them all with PVC electrical tape.
Be ESPecially careful with this step, I did burn out one of my voltage regulators when not paying proper attention.
Also I find keeping the wires longer makes this step much easier because of all of the twisting involved screwing everything back together.
Step 6: Place the Lights Around the House and Enjoy!!!
Place the lights in your preferred location, plug them in with the 12V power supply and away you go!!
If you don't like the prism effect of the lens, it can be easily removed, this gives a less focused, more general glow. Flipping the lens back to front had some pretty great effects too.
In the pictures you can see that I have used it to accentuate my nixie clock that I love so much.
Thanks for reading!
Participated in the
Invention Challenge 2017
2 years ago
could you have the lights turn on at a certain time.... if so how? how much modification would be necessary/ how easy would it be to implemnetn ?
Question 4 years ago on Introduction
Thanks very much for your project. Very nice.
Concerning to the wifi I have e question. Everything is inside the metal housing including the wifi antenna. Did you have any connection problems? What about the possible distance. I am planning to use them outside powered by battery.
Answer 3 years ago
No problem with the connection, but i have a pretty strong WiFi signal in my apartment, so not a true test i suppose. Let me know how you got on with that!!
5 years ago
CAN YOU PLEASE AHOW HOW CONETC IT TO OPENHAB.. items RULES sITEMAP
5 years ago
Quite fancy. Are you able to change the color on a timer or is it only manually changed?
Reply 5 years ago
Right now I have it set up through my home automation system so I can change it manually, as part of the lighting scenes or via a timer or a reaction to a website, such as instructables views using this script https://www.instructables.com/id/Automatically-Track-Views-on-Your-Instructable-Wit/
It is also possible to create dynamic animations etc.
5 years ago
5 years ago
I use openhab 2, controlling my hue lights, temperature of the livingroom
Also an calendar and still busy improving it
Would like to see your openhab tutorial and maybe this as an example
Reply 5 years ago
OK great, well I am spending more time than I probably should right now working on it so will let you know when it is up.
5 years ago
I like to build this
Please could u include openhab code also?
Reply 5 years ago
I will do, I was planning on making a full tutorial series on openHAB, do you currently use it or setting up first time?