relay (HIGH)- send code via RS-232 connection to Radio Ra 2 lighting system.

Hello,

Thank You very much in advance for all your help ! and happy new year 2015.

I have a lighting control system in my house ( radio ra 2 ) and I have a wireless alarm system ( Lynx L5100 ).

Radiora 2 has two ways to be controlled: 1st : TCP/IP communication, 2nd RS-232 serial interface.
My alarm system has a N/O relay .

So what I want to do is when I set my alarm AWAY or STAY mode and if for any reason it gets activated I like to send a command to my lighting control system to turn all my lights on in my house by using the relay on the alarm system.

Radio ra 2 is all programmed and good to go , I have programmed a lutron keypad to control all the lights in my house . So I just need to send a code to lutron main controller when the relay on the alarm system is closed.

I think I know how to read a pin on Arduino, but I really don't know how to send a serial code using the serial connection on Arduino.
this is what Lutron commands looks like .

The RS232 connection has the following communication settings:

• Baud Rate 9600
• 8 data bits
• No parity bit
• 1 stop bit
• No flow control

Integration ID (example)
#DEVICE, 1, Component Number, Action Number, Parameters
Example DEVICE Commands
#DEVICE(Main controller ID(1),Keypad Button(4),Action(1)
I can always buy a wireless siren but I like to see if I can do this while I can learn more about Arduino and electronics.

this is so far what I have done so far. :smiley: it might not be right, so this is why I need your help :grin:

int AlarmRelay = 2;
char address1
char address2
char address3

void setup() {

Serial.begin(9600);

pinMode(AlarmRelay, INPUT);

digitalWrite(AlarmRelay,LOW);
}

void loop() {

address1 = OUT

if (AlarmRelay == HIGH) {

Serial.println('1,2,3');
} else {

digitalWrite(AlarmRelay, LOW);
}
}

If the alarm is controlling the relay the Arduino should treat the relay as a switch and use digitalRead() to read its value. Set the input pin with pinMode(pin, INPUT_PULLUP); and connect the relay so when it is activated it connects the pin to Arduino GND. Then digitalRead(pin); will give LOW when the relay is activated - otherwise HIGH.

To start with just experiment to get that to light an LED so you know it works properly.

You should be able to use Serial.print() to send the message to the lighting system. You just need to figure out exactlyw what command is required. Again, experiment with this separately from the alarm system.

You should be aware that standard RS232 uses higher voltages that will damage an Arduino. If the lighting system uses those voltages you will need a conversion chip such as a Max232.

Another thing to think about is that an Uno only has one serial connection (pins 0 and 1) which is normally used for communication with the PC including programming. It may be simplest to use the SoftwareSerial library to create a second serial port on different pins for comms with your lighting system.

...R

Hi Robin2,

Thank you for your help, I am going to try this up tonight.

Radio Ra 2 can be controller over ip so I was thinking if if would be possible to use and Ethernet shield on Arduino uno to control my lighting system .

Happy new year.

I too am going to hop onto this topic. I'm looking to get an arduino to communicate with the radiora2 repeater but my goal is to have it be a bridge between the radiora2 and smartthing shield. I have zero knowledge of arduino but this seems to be the only way I can make this bridge between the two.