Remote Color Picker for House LEDs
I wanted to get just the right color on my house LEDs to emulate the warm color of patio lights. So, I built a remote control that has knobs for the red, green, and blue colors and an OLED display to show the RGB values. It connects via WiFi (mesh) to the house LEDs, so I can see them live while standing in the yard.
The ESP8266 modules allow the WiFi connection, and I was using them already for the house LEDs since they need more RAM than an Arduino offers. I have a web site controlling the house LEDs for some holidays, and I have used app based control setups like Blynk, but the visceral feel of turning a knob while watching the colors change is really nice. I made a push button color picker before, and the potentiometers are easier to use.
The color picker can also be used stand-alone to get the right colors for various holidays (like the perfect orange for Halloween) and events.
Parts
The house LED side of this system is covered in a previous Instructable:
Wemos D1 Mini microcontroller. This is a compact and inexpensive format for the EPS8266 microcontroller. There are two in this project - one on the house LEDs, which I already had, and one in the remote. I also made a stand alone color picker with an Arduino Nano on a terminal shield, so that one had minimal soldering.
LED - I used one WS2811 LED in the remote to see the color - the remote can be used as a generic color picker. I used this LED since it is the same as the type I have on the house, so the colors though the plastic are the same.
ADS1115 4 channel analog to digital converter. Since the D1 Mini only has one analog input, I used this I2C ADC chip on a carrier board to convert the three potentiometers to digital values for the LED colors.
OLED - I used a 128x64 SSD1306 OLED to display the RGB values so I can use them in programs. You can fit in in a 128x32 OLED, but the 128x64 allows each color to have it's own line. I also have a version with a 16x2 character LCD, but the OLED is a slightly nicer, though smaller, display.
10K Potentiometers. I used small ones that had colored knows. Red and Blue were provided, and I used a green marker to color a white knob.
DC power jack - I used a 2.1mm DC power jack so I can power it with any 5V cell phone battery.
2.1mm to USB wire - connects any 5V USB battery to the power jack.
26 gauge silicone wire. This is really easy to use to make all the connections.
Project box. I had this waterproof one around from another project, but any box will do.
Heat shrink tubing. I used a few pieces of 3mm tubing and a couple pieces of 5mm tubing. I use 20mm tubing on the D1 Minis, and 16mm on Arduino Nanos and the ADS1115
M2x10mm screws, washers, and nuts - I used (4) of these to mount the OLED display.
Testing the Setup
To build the circuit, you can use solderless prototypoing boards. I added screw terminals to a D1 Mini, and the ADC to try it out. I used lever nuts for the connections. Once I had it all working, I soldered the wires instead, though I could have left them as is and put them in the box.
Wiring and Assembly
I soldered wires to the D1 Mini, the LED, the ADC, the OLED display, the potentiometers, and the DC jack first. Then, I soldered the connections together. The LED data pin connects to D6 on the Di Mini. The I2C wires for the ADC and OLED connected to D1(SCL) and D2(SDA) on the D1 Mini. All the power and ground wires were connected together (8 of each). I shrink wrapped all the connections.
One thing to watch out for is that the DC jack has to have it's nut added before soldering the wires! You can see in the pictures how I had to cut and re-attach those wires. Doh!
For the box, drill holes using a 3/16" or so bit, then a step drill bit to make it easier. I used tape to allow for the layout marks. I put the LED on the side so it is not as bright when you are testing it (15/32" hole).
For the potentiometer knobs, red and blue came in the kit, and I used a green marker to color in a white one.
It's a jumbly mess, but insulated, and easy to make!
The Code
There are two code files. The first is for the remote sender. It changes the color of it's LED and sends the color commands to the receiver once it is connected. The LED will blink when not connected. The LED on the remote will change colors quickly, but sends the color command to the receiver once a second to avoid flooding the mesh communication channel.
The receiver is connected to the house LEDs. Since it uses mesh code, any number of receivers will work. Right now, the receiver just shows the color chosen, and I use the R, G & B values on the sender to program a separate controller. It could save the color in EEPROM on the receiver, however, and then it could just be left on the house. I have numerous dedicated controllers for the house LEDs, so I did not add that feature at this time.
This is programmed for a patio light effect for non-holidays, so it lights up every fourth LED. You can change that as needed to any lighting setup you would like.
The potentiometers are not very steady. I tried some higher quality ones, and they were only slightly better. So, there is code to average the values a bit and expand/constrain the endpoints. It works OK, but is not perfect - the 256 levels in one turn on those pots is pushing it. Even higher quality ones may work better, as well as multi-turn potentiometers. For this application, it was OK.