The first time I saw the Luminch One by Francisco Castro, I was surprised by the simplicity and the magical experience. However, since there never can be enough magic, I decided to make one with a little twist: the Luminch Color.
The Luminch Color not only allows to turn the lamp on and off with a simple swipe gesture and to dim or brighten the lamp by holding your hand above the lamp, it also allows changing the color simply by touching the sides near the bottom. With these four sides, you can change the color to red, green or blue, or back to white.
The magical experience of infrared distance sensing and capacitive touch aside, this design also naturally decouples light intensity from color and saturation. Since the human eye has different sensitivities for different colors, I also made a first attempt at mixing the colors in such a way that the human eye experiences it as a uniform color space. In other words: the perceived light intensity doesn't change (much*) when changing color, and the perceived color doesn't change (much*) when changing light intensity. As such, this project was also an experiment in different color spaces (most notably sRGB and CIELAB).
(* Note that for an actual uniform experience, it is important to calibrate the LED and electronics. As I don't have the equipment for that, this is just a best effort. Also, it would be good to have more than 8 bit PWM resolution, especially for the settings with low intensity. Unfortunately, the Arduino used in this design is limited to only 8 bit.)
Step 1: Materials
1 x Ikea Grono (small version)
1 x USB wall charger (5 Volt, capable of at least 1 Ampere)
1 x USB cable (1.8 meter)
1 x Strip board (at least 8.5 x 12.0 cm)
1 x Arduino Uno
1 x Infrared sensor jumper wire (3-pin JST)
1 x Capacitor 100 uF / 25V
Break away male headers
Break away female headers
1 x RGB power led (capable of 350 mA per color, for example MULTICOMP OSW-8339)
1 x Infrared distance sensor (Sharp GP2Y0A02YK0F or GP2Y0A21YK)
3 x NPN transistor BC337
3 x Resistor 220 Ohms, 1/4 W
1 x Resistor 100 Ohms, 1/4 W
2 x Resistor 68 Ohms, 1/4 W
1 x Resistor 9 Ohms, 4 W (I used 2 x 18 Ohms, 2 W in parallel)
2 x Resistor 6 Ohms, 1.2 W (I used 2 x 3 Ohms, 0.6 W in series)
4 x Copper strips, 3.5 x 8.5 cm
Step 2: Circuit diagram
The circuit is a simple extension of the original circuit from Francisco. However, since I used an LED that could handle more current, I used different resistor values.
As this circuit could potentially draw more than 0.5 Ampere over USB, I added a simple jumper that can switch between high power (up to 1 A) or low power (less than 0.5 A) operation. This jumper is shown in the photo above: the right header has 68 Ohm, 100 Ohm and 68 Ohm resistors while the left header has 0 Ohm resistors (simply soldering the connection points together). These resistors are resistors R46, R41 and R47 in the schematic.
WARNING! Always place the 60 / 100 / 68 Ohm resistors when connecting the lamp to the computer or any other device that cannot supply 1 Ampere! If you do connect the lamp with the 0 Ohm resistors to such a device, you risk permanently damaging the device, potentially causing a fire, burning down the house and neighborhood and causing a nuclear meltdown. (Okay, the latter risks are probably negligible, but in any case: please be careful when connecting the lamp to your computer.)
The capacitive touch is not shown in the diagrams, but it is formed by simply connecting the copper strips directly to A1 - A4 on the Arduino. The exact pinout is:
Step 3: Heat up your soldering iron!
I forgot to take a lot of pictures during the process. Furthermore, I also had to redo some small steps a few times, as I hadn't planned it very well from the start. However, I hope these pictures and the description of the original Luminch One are sufficient to recreate the Luminch Color.
Here are a few note though:
Step 4: Program the Arduino
Place the 68 / 100 / 68 Ohm jumpers to prevent drawing too much current from your computer.
Download the code from https://github.com/admarschoonen/luminch-color. Open configuration.h and select the correct distance sensor (see lines 8 and 10). Next, program the Arduino.
Test the circuit by swiping on / off and changing colors. Does everything work? Congratulations! You can now unplug the lamp from the computer, replace the 68 / 100 / 68 Ohm jumpers with 0 Ohm jumpers and plug the lamp into the 5 V / 1 A wall charger.
Want to change anything in the software? Please go ahead, but remember to always place the 60 / 100 / 68 Ohm resistors when connecting the lamp to the computer or any other device that cannot supply 1 Ampere to prevent any damage to equipment.
Is something not working? See next page for help.
Step 5: Trouble shooting
Here are some tips to help you finding the problem in your Luminch Color.
Start by uncommenting line 68 of configuration.h (#define TEST_ELECTRONICS) to enable a test program. This program cycles red, green and blue with low and high intensities. If something is wrong with the led electronics, this allows you to more easily locate where the issue is.
This test program also shows debug output on the serial port (115200 baud) for the capacitive touch and distance sensor. The debug output shows something like:
raw: 543; avg: 544; delta: 1; state: 1 raw: 568; avg: 569; delta: 1; state: 1 raw: 494; avg: 493; delta: -1; state: 1 raw: 551; avg: 552; delta: 1; state: 1 raw: 54; distance: 2642
The first 4 columns (raw, avg, delta and state) show the state of the first capacitive touch button (red). The most important is state. This value can be between 0 and 4 and has the following meaning:
Columns 5 - 8 show the same information for the second capacitive touch button (green), 9 - 12 show this information for the third button (blue) and 13 - 16 show this for the 4th button (white). Finally, columns 17 and 18 show the information from the distance sensor (both raw and processed values).
If one of the capacitive touch sensors is not working, it could be one of the following cases: