For a few years, I have been looking into different ways of controlling home lighting. The goal is to be able to turn lights on and off using a computer interface, enabling lights various types of remote control and automation:

  • Turned on at sunset and off at midnight
  • Using a remote control, or mobile phone
  • Voice control using Alexa or Google Home
  • Switch off all the lights in a room at once

However, I am also keen to ensure that lights can still be turned on and off using a light switch, as normal, even if part of the system fails.

RS Pro Logic 110v-240v no LCD

The first home automation system I tried was X10. I had a Marmitek AD10 connected to the landing lights. What was great about this is that it worked really well with the existing home lighting wiring. It had two control inputs:

  • Input 1 responds to a change of state, so can be used with a normal light switch (switching the circuit on or off will toggle the light).
  • Input 2 toggles between on/off when it receives a pulse - so can be used with a retractive switch (that springs back like a doorbell).

Sadly there are a couple of reasons why I stopped using X10:

  1. The main reason is that while the system worked fine for a few months, some kind of power line interference meant that it stopped working reliably.
  2. The modules seemed to have a short life expectancy and I had a couple completely stop working. Replacing them got expensive.
  3. As is typical of X10, the module only responds to commands and does not broadcast its status. This means that if someone operates the switch, it is not possible for a computer to know if the lights are currently on or off.

RS Pro Logic

I have been aware of the Modbus control protocol for a while but never tried it out partly due expense. Modbus is typically used in industrial control and automation applications to control Programmable Logic Controllers. At its most basic, it allows you to send messages to multiple devices connected to a serial port bus, switching on and off outputs and reading inputs.

While searching the RS website, I found they had an own-brand range of Programmable Logic Controllers, under the brand name RS Pro Logic.

RS Pro Logic 110v-240v no LCD

There are four different versions of the RS Pro Logic available:

(Prices correct at time of publishing)

There are also expansion modules (extra IO), RS-485 adaptors and memory cards available in the range.

While not cheap, they are cheaper than I was expecting. And while you can only control a single output with the X10 module, you can control 4 outputs with the RS Pro Logic module.

There is surprisingly little documentation about the RS Pro Logic module on the RS website. All they provide is a datasheet and software download. When I asked for a manual, they sent me a copy of the manual for the Genie NX - so it is clearly a re-branded/white-label version of that.

Apart from the supplier’s website, there isn’t a lot of information about the Genie NX on the Internet. Although I did find that Mark Empson has done some YouTube Videos about programming them using the Windows control software.

Getting Set Up

I decided to buy the ‘110v-240v with no LCD’ version of the module. I liked the idea of keeping the mains voltages contained within a properly designed enclosure. Keeping those mains voltages away from anything I was making myself makes me feel a lot safer. Because it takes in 230v in, it also doesn’t need a separate power supply. As it was going to be hidden away somewhere I didn’t see the need for an LCD and it brought the price down a bit.

To test the RS Pro Logic module, I built a test rig, with one input (a retractive switch) and one output (a 13-amp socket).

My Test Rig

By default, the module does nothing when you first switch it on (apart from responding to Modbus commands). To do anything autonomously then you need to programme it using the free RS Logic Pro Windows Software.

As a non-Windows User, this was a major detractor to buying an RS Logic Pro. Thankfully, it is possible to download a free copy of Windows 7 as a Virtual Machine from modern.ie. After running Windows in the VirtualBox hypervisor, I was able to install the RS Pro Logic software easily.

Simple Configuration Screenshot

The screenshot above demonstrations one of the simplest configurations it is possible to set up:

  • I1 (Input 1) is connected to Q1 (Output 1)
  • When I1 is turned on and off, Q1 will be turned on and off.

Performing state toggle

Switching an output high when an input is high is very straightforward, but I found setting up an input to toggle an output a bit more complex:

Toggle Configuration Screenshot

The programme file, shown in the screenshot, can be download here: toggle.h53.

This is a description of each of the 4 rows in the ladder:

  1. I1 (Input 1) is connected to T1 (Timer 1). T1 is configured to emit a 0.1s ‘Single Pulse’ - Mode C. This means that however long the input button is pressed, T1 will only emit a 100ms pulse.
  2. The current state of Q1 (Output Relay 1) is connected to T2. T2 is in ‘Single On/Off’ - Mode M. This delays the current state of the relay by 500ms.
  3. Row 3 checks for a pulse from T1. If T1 is high and the former state of the relay (T2) is low, then it sets the relay to high.
  4. Row 4 does the opposite. If T1 is high and the former state of the relay is high, then it sets the relay to low.

The reason for the timers is because the module behaves like electronic logic gates. Rather than executing a sequence of commands, as software would, the logic is instantaneous. So setting Q1 to the inverse of Q1 results in nothing happening, rather than rapidly turning it on and off.

This solution seems a little over-complex for the simplicity of the problem. Please let me know if you think there is a better way of doing this.

In Part 2 of my blog post, I will explore how to control the RS Pro Logic using the Modbus protocol from Node-RED.