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. it might not be right, so this is why I need your help
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);
}
}