submission By: Dan McGrath introduction – Why automate your lights?  Well, to be honest, most of my home is automated, so it seemed the obvious thing to do.  There are great deals of benefits in automating parts of your house, illumination in specific just makes life easier, lights coming on when you walk into a space is much better than changing them on yourself! ….and since they turn themselves on, they turn themselves off too, so you can’t forget!

Design – I’ve never been sure about X10, to be fair I’ve never tried it either, however my believing is that DMX has been in utilized for extremely elaborate illumination systems for years, as well as is understood to be extremely robust as well as reliable, as well as that’s what I wanted, so I selected DMX.

The dimmers I have selected support both 0-10v signal as well as DMX, as well as you can utilize both at when if you like, this is excellent for me as I’ve set them such that concern is always provided to the 0-10v signal, so you have the choice of manually overriding the settings that the house automation system sets.

Installation – Ok, lets begin at the light switches themselves.  Each space has either a double (two lights) or a single dimmer manage mounted on the wall.  The photos below show the dimmer manage units mounted in the wall, you’ll see they are still unfinished, I’m not able to discover appropriate looking knobs, like the simple white ones you get on a common dimmer, so up until I do, there are none.

These ‘control units’ look just like common UK single blanking plates with variable resistors sticking out of the front, as well as that’s since that is what they are!  below are some photos showing the insides of these units.  very first the single dimmer.  You’ll notice likewise that there is a little black gadget at the bottom of the unit:

This is a temperature sensor that I utilize to manage the heating, it utilizes the exact same enclosure as the dimmer units as well as the exact same run of cabling, however they are two separate systems.
The double units are a bit more hectic inside, however essentially just two singles in the exact same box.

These dimmer manage units are linked utilizing Cat5e cabling back to my understairs cupboard, where the rest of the set is.  The manage units can be quickly disconnected from the wall by unplugging their RJ45 plug from the connector. Each dimmer place in the home has a single run of Cat5e to everything house ran back to under the stairs. The units themselves just act as a potentiometer, the variable resistors have 3 legs, looking from the front, the leftmost one is grounded, the middle one (the wiper) is the output, as well as the right one gets 10 Volts DC.

Notice the utilize of heatshrink sleeving as well as a dab of epoxy to hold whatever in place, this makes for a more trustworthy system I’ve discovered linking them up in this method means that as you turn them clockwise from off to on, the voltage on the middle leg rises slowly from 0v to 10v – This is utilized to manage the dimmer units manually.

Above are some photos of exactly how the dimmer manage cabling terminates under the stairs, I’ve utilized common Cat5e cabling throughout as it is affordable as well as great quality, I’ve likewise utilized RJ45 plugs as well as connectors for the exact same reasons, this illumination system has nothing to do with ethernet, tcp-ip or the like, I’m just utilizing the cabling as well as connectors normally connected with this kind of thing.

In the photo above, each yellow patch cord represents a dimmer manage location, I’ve utilized the RJ45 wall sockets as a means of linking these cat5e runs as much as both the dimmers as well as the temperature sensor manage board. The dimmers themselves are 4 channel units that support both DMX as well as 0-10v signal to manage their output.

I didn’t explain this extremely well originally, so right here is some more info on exactly how the 0-10v signal as well as DMX work together.  The setting of the 0-10v signal (i.e the setting of the dimmer manage unit) will (if brighter) override the DMX setting. This isn’t ideal, as it does mean you can leave lights on by mistake, as turning the dimmer all the method up will force the light to stay on.

However, we don’t really utilize the dimmer controls manually, the lights come on immediately if it is both dark outside (there is a light sensor in the garden) as well as if somebody is in the space (the PIR sensors tell the server if this is the case).  So there is never any type of requirement to turn the lights on yourself!

The other prospective issue is if the system turned the light on, as well as you really wished to turn it off, turning the dimmer manage down would have no impact either. In truth though, the dimmer racks have a configuration switches on them, should I ever experience a problem where the server did something I didn’t like, I might either flick one of the DIP switches on the rack, or unplug the DMX lead!!  Here’s a link right here to the dimmer rack direction handbook which most likely explains it better!

The dimmer units take the 0-10v signal on a 5pin DIN connector (1 pin is ground the other 4 represent the 4 channels) as well as they take the DMX signal on a 3pin XLR connector. DMX gadgets can be daisy chained as each one has its own id set, if you look carefully at the photo above you can see an orange cable (0-10v signal), a purple cable (DMX daisy chain link) as well as a yellow cable (DMX in from the DMX controller)
Here are some more photos of the dimmer racks:

Across the front of the rack you can see a bundle of 1mm T&E cable, each one of these goes to a different illumination place throughout the house. rather just this cable runs from the dimmer directly to the light fitting in the ceiling, this does make the wiring of any type of light fittings extremely easy, as there is just a single cable to contend with. These cables are linked to the dimmer racks utilizing male IEC connectors (the male version of a kettle lead)

The DMX signals to manage the dimmers come from the system pictured above. This gadget takes a RS232 (serial) signal from my house automation server as well as converts it into the DMX protocol. This enables me to manage the illumination throughout the home automatically, as well as means that you don’t really have to utilize the dimmer manage units in each room, this is truly the whole point of automating the lighting, I have sensors in each space (standard security PIR sensors) that are being monitored by my house automation system, if motion is detected then the server sends a serial signal to the DMX controller to bring up the lights in that space etc…
Additionally it means that you can operate your lights over the internet, via SMS, IVR etc.. which can be useful.

Above are some photos of the DMX controller fitted in its box, it has three connections, power (12v dc), serial in as well as DMX out.  There is likewise a link right here to the dmx controller direction manual.

Finally a picure of the rear of the server that links to the DMX interface, this server is utilized to manage the DMX interface, more about that in the software application section below.

Software – all of my other house automation (security, heating, power, cctv etc..) is written (badly in parts) utilizing perl.
This illumination job is no different, although it does represent my very first attempts at utilizing web services.
For the web services I’ve utilized Apache 2.x as well as the Soap::Lite module for perl, to really talk serial to the DMX controller, I have utilized the perl module Device::SerialPort.  The whole great deal runs under Redhat Linux I phone call the web services from my actual house automation application like this: (note this is a part of a much larger program)

# Lights off if no motion for ten minutes as well as motion more just recently in the hallway
if ( $epoch – $in11_lastmove > 600 && $in11_lastmove < $in23_lastmove && $kitchenlights == 1 ) { &send_lights_soap(1,0) ; $kitchenlights = 0 ; } The actual subroutine being called is here: sub send_lights_soap { $soap_response = SOAP::Lite -> uri(‘’)
-> proxy(‘’)
-> send( “$_[0]” , “$_[1]” ) ;

$res = $soap_response->result ;

And as this is a web service, the actual serial interface as well as web service code resides on one more machine on my network, the web service code appears like this:

#!/usr/bin/perl -w

use SOAP::Transport::HTTP;
-> dispatch_to(‘Lights’)
-> handle;

# phone call as       -> uri(‘’)
#               -> proxy(‘’)
#               -> send(“” , “”)
package Lights;
sub send {

use Device::SerialPort ;
my $port = Device::SerialPort->new(“/dev/ttyS0”) ;

$port->baudrate(9600) ;    $port->parity(“none”) ;
$port->handshake(“none”) ; $port->databits(8) ;
$port->stopbits(1) ;       $port->read_char_time(0) ;
$port->read_const_time(1) ;

my ($class , $channel , $intensity ) = @_;

# send data out
$port->write( pack “C”, $channel ) ;
$port->write( pack “C”, $intensity ) ;
sleep(1) ;

$port->close() ;

return “Done! I utilized $class with chn $channel as well as inten $intensity”;

Fairly simple code, I’m sure you’ll agree, as well as finest of all, since it runs webservices, I can spread these nodes out across my network as well as phone call them easily.  furthermore you may have noticed that like most people I’ve RFC1918 addressed my network, however with a appropriate NAT rule, these services can quickly be called from anywhere with an Web connection, meaning that I can manage my lighting, heating etc.. from anywhere (even a GPRS or 3G phone!)

Conclusion – Well, I hope you’ve enjoyed what I’ve done, I like my automated lights! great luck if you choose to do something similar



Single Blanking Plate

Cat5e Cable

10kohm Linear Pot

RJ45 Barrel Connector

RJ45 plug (10pack)

5pin DIN male Plug

XLR 5pin male Plug

XLR 3pin female Line Socket

XLR 3pin male Plug

IEC male Plug

RS232 to DMX Converter (item 1-463)

Soundlab 4channel DMX dimmer (G018VA)


DMX Dimmer Packs from Amazon

This article was reproduced with kind permission of Dan McGrath from his original article at

Want More? – Follow us on Twitter, Like us on Facebook, or sign up for our RSS feed. You can even get these news stories delivered via email, directly to your inbox every day.

Share this:




Leave a Reply

Your email address will not be published.