Introduction: How to Fit LED Kitchen Lights With Fade Effect
In this instructable, I will describe my project to replace my under the cabinet kitchen lights with LEDs. I couldn't resist adding a microcontroller as well.
The original lights were flourescent and quite badly fitted. They made a lot of buzzing noise and the bulbs didn't seem to last very long. I got fed up with them and decided that replacing them with LEDs was the way to go. My budget was small so I didn't want to buy expensive designer lights.
To add interest and a bit of practicality, I decided to add a fade-up effect when the lights switch on and have a half-bright mode for those special occasions where dimmer lighting is required.
Step 1: LEDs
After experimenting with some cheap LED strips meant for accent lighting on cars, I did some 'proper' research and settled on the flexible strips of SMD 5050 LEDs. This is an excellent page describing the 5050's vs the 3528 type: http://ezinearticles.com/?All-About-LED-Strips-4---The-Eternal-Debate---SMD3528-Vs-SMD5050&id=4670120 .
You want 5050 LEDs, preferably 3 to each 5cm / 60 per Meter, waterproof (they are covered in a flexible clear plastic and with a adhesive backing.
I got a 5M strip plus power supply from a seller on eBay. Total cost was UKP 50.00.
The LED strips can be cut every 5cm (or 3 LEDs) and are very bright. 5M of LEDs consumes approx 3A (36W at 12V). This is less than the 4 flourescent strips they are replacing.
Step 2: Fader
When the lights were switched on, I wanted a gentle fade up to full brightness. This would provide a bit of interest and be a contrast to the buzzing, flickering startup of the flourescent lights.
Pulse Width Modulation or PWM is the simplest way to fade LEDs and MOSFETs are the simplest way to rapidly switch large(ish) currents. By combining a MOSFET with a microcontroller, I had the most flexible way of controlling the fade.
I used an Arduino to test the concept and my test rig is shown in the photo. I got the circuit idea from here: http://www.ladyada.net/products/rgbledstrip/ I only used 1 channel (White) instead of 3 (RGB).
Using this rig, I was able to develop the fader software easily. It is described in the next step.
Step 3: Software
When power is first applied, fade the LEDs from off to full brightness.
If power is switched OFF before LEDs get to full brightness, then turned back ON, fade the LEDs from off to half brightness.
I used the rig shown to test the software and got the operation as I wanted it. A few useful things to note:
The brightness of the LEDs under PWM is non-linear. This means that the fade reaches a brightness level very quickly that then seems to only slowly get to full brightness. The simple approach to this is to divide the fade into two sections, fade slowly in the first section and then quicker in the last section. I expect there are more complex algorithms for this and I may try them someday. In the meantime, this simple approach works well enough for my kitchen.
I used the built-in EEPROM memory to remember the state of the LEDs. Although I am writing to the same location, over and over, the EEPROM cell will outlast the installation by many years.
Included in the software file is the final application as it is working now and one of my first test apps, the video of which is shown below.
Test of fade up and down:
Step 4: Building the Controller
I had enough parts lying around to build the controller so I didn't have to dedicate a whole Arduino to the project. I've included the schematic and describe the circuit below. I made the circuit on breadboard and wired everything together on the reverse side. The MOSFET tend to get warm so I used an old heatsink I removed from a dead piece of kit to help keep it cool. I mounted the whole thing on a bit of bent metal and hot glued it into this plastic box left over from another project. The whole thing could be a lot smaller. I could have used a smaller processor but I already had the atmega168.
This is a 'minimal Arduino' with a 5V regulated power supply derived from the 12V used to drive the LEDs. The regulator is bog standard 7805. All the ATMega168 needs is power, a reset line held high via a resistor and the connections to the ISP programming pins. I added those because I did not want to socket the processor and have to remove it to re-program it. I added the white LED for convenience - I always like to have a 'heartbeat' to show me that the processor is running my code correctly. I fitted the LED to 'pin 13' so it is arduino compatible (I can run 'blink' to test).
There is a pull down resistor on the MOSFET gate so the LEDs won't inadvertently come on during power cycling.
The power supply and controller box are mounted below the cabinets along with the LEDs.
Step 5: Preparing the Strips
I measured the lengths required under the cabinets and cut the strips to size. I soldered a red wire to the +12V contact and a black one to the GND contact. On the strips I used, these were marked R G and B. It turns out that these strips are also used for 3 colour LEDs and these are the individual connections to the colours. On these white strips, each LED package actually contains 3 separate LEDs so each of the RGB connections needs to be connected to GND. This was the hardest part - persuading the solder to bridge the contacts.
Step 6: Fitting
The wiring arrangement in my kitchen was very simple. A cable carrying switched mains connected to the first flourescent light and the circuit was daisy chained to the other fittings. I connected the mains to the power supply. This provided the 12V needed to drive the LEDs via the fading circuit. I then used the remaining cable to supply the rest of the strips.
If you don't have this arrangement, it is much easier to lay wire capable of handling a few amps at 12V than the thick mains cable.
I cleaned the bottom of the cabinets with detergent followed by white spirit and fixed the pre-cut and wired strips. I used two strips per cabinet and wired the soldered leads to terminal blocks that I fitted to the cabinet with screws.
After connecting the controller to the power supply and all the LEDs to the controller, the job was complete.
After using the lights for a while, some of the adhesive started to pull away. The weight of the wire was pulling the strip off. I fixed that with some staples and they have stayed in place since.
Step 7: Enjoy
You see them go to full brightness, then off. Then on, off, and on again so they go to half brightness.
Runner Up in the
ShamimI3 made it!