Hello. I am quite new to Arduino and have been working on a project and trying to learn as much as I can as I implement it.The scope of the project is as follows: To control lights using sensor inputs and display their status on Adroit Scada.I have two types of relay switch boards:
2 channel Rs 232 relay switch board scm pc controller
4 channel Rs 232 relay switch board scm pc controller
I need to control them using Arduino Mega 2560 via a TTL to Rs 232 converter.
My problem is in coding.All the examples I have come across are using relays that have a digital interface making it easier to connect them to the arduino digital pins but mine have an rs 232 interface.
I have researched on the same but cant find the solution. If anyone can help I will be most grateful. Thanks in advance
First you need to read the datasheet/instructions for the relay boards, so that you know the Baud rate that you can transmit data, and also the data that you need to send.
If you provide us a link to the relay boards or their datasheets, then we will be able to give further assistance.
You'll have to find more information about the commands, or figure out yourself which command code does what.
it may be easier to get ordinary relay boards, with digital inputs. If you buy such complicated boards next time, chose only those with according Arduino libraries and example code.