Feature Lighting - Entertainment Unit


LED Boards

I recently brought a few components from Sure Electronics which included aluminium based LED boards. They caught my eye given the cheap price, US$2.04 (at the time of writing this article) and come completely assembled ready to be connected to 12-13.8V. Here's what they look like;

LED_Board 12103409331219459471


They throw a soft, wide angle light pattern which suits general purpose lighting effects, and that's exactly what I ended up using them for in one of my "Sunday afternoon" projects. The first piece of furniture that could benefit with a little lighting that came to mind was the entertainment unit. It has several storage compartments which would serve great places to mount the LED's and throw some light around. You could use any LED's to do a job like this, though the above modules flood light very well and are extremely easy to secure in place. Here's what the entertainment unit looked like before and after the modification;

Before After

The result is a soft (or harsh if desired) "radio-active" type glow, though the above photos really struggle to give it the justice - especially with low ambient light. So they are mounted in the above pictures, though I couldn't settle with just that - next on the plan was dimmable light control (with a PIC of course!).


Control Box

An early revision of the light dimmer included a Logic Level N-Channel FET being driven exclusively by the 5V PIC. It worked OK, though the FET was not saturating enough for my liking (without the FET "turning on" completely, the LED's were not driving at full brightness). Sure I could have ordered a better model LL FET with a lower Vgs, or I could cater for any type of FET and include a proper driving circuit (transistor driven Vcc instead of direct Vdd).

In hindsight a P-Channel Fet could have been used as the N-Channel inverts the operation. I originally compensated with software, though in the final revision I simply reversed the polarity of the potentiometer. All that said, you could use any method you like to drive the LED's, I chose the FET approach as it scales to larger projects quite well (can drive ++Amps compared to heavy duty transistors/darlington arrays). Not shown above is the external circuit to attach the LED modules. I made it separate as I didn't want a whole loom of wiring hanging out of the control box - a lead terminated with 2.5mm DC Sockets on either end connects to the two boxes and keeps things looking clean. Here's the main control box with potentiometer fitted to the top:



Top view of the control box. This is what sits on-top
of the entertainment unit.



The completed PCB board with components fitted.





Mounting the LED Boards

Mounting the LED boards were pretty easy. Pilot dril holes and some short 4AG screws did the job fine. I also used phone-line cable holders to route the cables neatly around the entertainment unit. Here's a shot of an installed LED strip;


One of the earlier photo's showed the entertainment unit with the LED's turned on - its in that shot that its noticeable that all the compartments have upper over-hanging bits of timber. Hiding the light source "adds" to this feature lighting approach, and can be used in similar methods on over-hanging bars or other features around the house.


PIC Program

And of course the program itself. Briefly put, the PIC grabs the 10-bit ADC value of channel 0 (the brightness control potentiometer), and places it into the 10-bit duty cycle buffer. Simple eh. Works beautifully to ;)

Note - you will need the Swordfish User Module Pack. Download the zip file and unpack the contents in your Swordfish User Module directory.

Lighting Program (Swordfish PICBasic)
    Device = 18f2520
    Clock = 32
    Include "InternalOscillator.bas"
    Include "ADC.bas"
    Include "PWM2.bas"
    Const gamma(64) As Byte = ( 012222333,
                                239255 )
    Function GetBrightness(Channel As Byte) As Byte
        Result = ADC.Read(Channel) / 16    ' Result 0..63
      End Function
    // Start Of Program...
    OSCTUNE.6 = 1          // enable PLL
    ADCON1 = %00000000     // configure 18F2520 ADC module
    ADCON2.7 = 1
    While True
        // sample ADC channel 0, and fill duty cycle buffer with the result
        CCPR1L = gamma((GetBrightness(0)))

(A BIG thanks to Mike for the code snippet for gamma correction)

With the above program there's 1024 bits of resolution for brightness control; allowing the LED's to go from completely off to hard-on.

Feel free to post comments below =)

Forum Activity

Member Access