Frankfort: RGBW LED Ambiance Lighting

RGBW LED ambiance lighting with automation for Højskole dorm room

Similar projects worth following
I am currently studying at Silkeborg Højskole in Denmark and wanted to add a few personal touches to my otherwise spartan dorm room. My main grievance was the lack of lighting, being a bit of a night owl (aren’t we all?) the existing lighting was not sufficient, and given that permanent additions are out of the question I needed a temporary solution that was not too expensive, after all I am only here for five months.

With white walls, a white ceiling and a set of wall mounted cupboards the room lends itself to indirect lighting with LED strip and having developed an RGB LED strip controller for a past project back home it looked to be a simple endeavour and I would soon be showing it off to my fellow students, a little bit of jealousy never hurts… Well nothing ever goes exactly as planed, so here's my recount of developing a temporary lighting system for my home away from home.

The premise was(is) pretty straight forward: An RGBW LED ambient lighting system that allowed for both automatic and manual control modes, was not too expensive, could be installed temporarily in my dorm room and most of all required almost not tools whatsoever to build. Being almost 20,000km away from home meant that I would have to make do with the most basic of hand tools that I had brought with me, if I needed something more elaborate it wasn't just a quick trip round the corner to get it.

The features:

  • LED strip would use 5050 sized SMD LEDs and be RGBW;
  • The system would be capable of setting any combination of intensity levels through push buttons, resulting in almost endless colour selection. Single press brings colour up to full, if held the intensity starts to drop and will hold at the desired level when the push button is released;
  • Cross fade mode to cycle through the spectrum, perhaps using the push button as a 'Tap Timer' to set the rate;
  • A sound activated party mode, what dorm room lighting system would be complete without 'Party Mode'? Maybe I need a big red button, or missile switch covers, or even dual keys to activate it? That can wait;
  • Reset switch to return to a non-illuminated state;
  • Simple occupancy sensing, if the system is in automatic mode it will ramp the red LED's up to 70% over a 10 second period upon sensing motion, hold there for as long as motion is detected plus three additional minutes then ramp down to 30% over 10 seconds and hold for a further minute then fade to off. This will function as orientation lighting at night;

Having developed an RGB LED controller a few years back for another project I already had a functional set of basic code that I could build off and I figured that I could just order the parts I needed from the usual places on the internet and have them delivered, no different to what I would have done back home. That was until I looked into the import rules in Denmark. That threw a spanner in the works, the first of many.

  • 1 × Arduino Uno Clone
  • 1 × 5 meter roll of RGBW LED Strip
  • 8 × Tactile Push Buttons
  • 4 × TIP31 Power Transistors
  • 8 × 10KΩ Resistors

View all 10 components

  • When Hardware Guys Write Code…

    The Reverend10/31/2014 at 06:36 0 comments

    With parts on the way my next step was to start working on the software side of the project. Now I am a hardware guy, I know that you can do amazing things with software, and if it means less mucking around with 'Hard Logic' and greater flexibility then I am all for it. However, I often have no idea where to start when it comes to the actual code. That is one of the main reasons why I have chosen the Arduino platform for this project, for the simplicity of coding, the number of code examples available and because I don't have the facilities to spin my own PCBs at the Højskole a ready made development board simplifies the situation considerably. Another advantage with this is that I had some of the code from a previous project that I could reuse.

    A couple of years back I was asked by a family member if we could do some 'Fancy Lighting' with the glass splash-back behind his stove in the kitchen of the new house that he was building, the 'fancy' solution ended up being an RGB LED strip lighting through the glass, the effect was pretty cool and has become a talking point at parties.

    I wrote the original code with help from a friend and while it wasn't the most elegant it was functional and fit for purpose. I planned to reuse elements of this code, making it more elegant where possible.

    The controller would have eight push buttons, four power transistors, one PIR sensor and one microphone. The intention was to build it in stages, first the pushbuttons and power transistors to provide basic control, then adding code to allow the LEDs to cross fade, next a PIR would be added and finally the microphone, other coding elements, for example a tap tempo button to control the crossfade rate, could be explored after that. The code would have to grow along with the hardware, and after many long nights, countless uploads and lots of debugging I think I have ended up with a pretty robust foundation. At this stage only the first and second stages have been implemented; basic control and crossfading, and it functions really well. The following snippet is the code in its current iteration.

    /*===================[ RGBW LED CONTROLLER ]=============================================================================================




    *Created: 14/09/2014

    *Author: D. Blackler


    *The code is designed for the Arduino Uno, it takes inputs from eight(8) momentery push buttons, one(1) microphone and one(1) PIR sensor and outputs a

    * PWM signal to a length of RGBW LED strip via three(4) power transistors. The input push buttons

    * are as follows:


    * Button Momentery Hold

    * Red Red 100% Length determines % of red in mix

    * Green Green 100% Length determines % of green in mix

    * Blue Blue 100% Length determines % of blue in mix

    * White White 100% Length determines intensity of white

    * Fade Starts cross fade cycle

    * Reset Resets colour mix to all off




    /*===================[ REVISION HISTORY ]===========================================================================================


    * Revision 1: 14/09/2014

    *-First created and formatted

    * Revision 2: 17/10/2014

    *-First generation functional code












    /*===================[ PIN DEFINITIONS ]===========================================================================================*/

    #define REDPB 2

    #define GREENPB 3

    #define BLUEPB 4

    #define WHITEPB 5

    #define FADEPB 7

    #define RESETPB 8

    #define REDPIN 6

    #define GREENPIN 9

    #define BLUEPIN 10

    #define FADESPEED 15 // The higher this number, the slower the cross fade speed will be

    // Initialize global variables

    int FADE = 0; //Crossfade indicator initialised to 0

    /*===================[ SETUP ]=====================================================================================================*/...

    Read more »

  • Ordering Parts

    The Reverend10/19/2014 at 20:10 0 comments

    Having sketched up the basics of the design in one of my many 'FIELD NOTES' notebooks, I always seem to have a pile of active ones, I was able to write up a list of the parts that I thought I would need for the project. Bearing in mind that I had no parts on hand and would have to get anything that I needed and I didn't want to have excess leftover that I would have to deal with when I leave Denmark at the end of the year. So at the very least I needed:

    • Arduino Uno;
    • Breadboard;
    • Breadboard Jumper Wires;
    • Tactile Push Buttons;
    • TIP31 Power Transistors;
    • 100Ω Resistors;
    • 10KΩ Resistors;
    • Hookup Wire;
    • 12V 5A Power Suppy;
    • RGBW LED Strip – About five meters worth;

    With this list inhand I turned to my old friends 'ebay', 'Deal Extreme' and 'Banggood' (Which despite its questionable name is a very useful DX type supplier) in search of economically priced parts for my project. Having researched the import requirements for New Zealand in the past I had developed a 'safe figure' of $200 (US$160), and knew that anything under that had no customs requirements. I had no such 'safe figure' for Denmark, after some digging on the internet I discovered that in order to avoid 23% VAT being charged at the border I needed to keep my orders below 80kr. That's about USD $13, so not a lot to play with, especially given that I needed a five meter roll of RGBW LED strip.

    After some clever splitting and staggering of orders I had parts on the way and I could focus on developing the code, and some hardware schematics while I waited. Shipping from china was meant to take less the 30 days, so I had some time.

View all 2 project logs

Enjoy this project?



Similar Projects

Does this project spark your interest?

Become a member to follow this project and never miss any updates