This module (right)
(See it here) can be used to send Arduino serial data over long distances (up to 1 Km) using RS485 signals. Schematic diagram: (third image down).
The
RS485 serial bus interfacestandard transmits differential balanced signals. This has strong anti-interference ability in the common mode, allows a twisted pair transmitter driver on a number of connected devices. The communication distance is up to 1200 meters, the rate is up to 20Mbps, and it can be used in high noise environments, such as industrial automation.
In an RS485 network at any time only one device is in the sending state, and all other equipment
should be in the receiving state. Each Arduino controls its RE / DE pin control to specify the device which is sending data to the RS485 network, or receiving data from the RS485 network.
Example RS485 Network Diagram:
NOTE: (APOLOGIES! Again on the TODO List! These examples will be updated Real Soon Now!
Below are simple example Software Sketches that show the Master sending data to the two slaves, and controlling their LEDs. Each slave is in receive mode and receives the same data.
The modules shown above have RE and DE connected together and to Arduino pin2. This is the "Direction" control.
You can cut and paste these examples into a new page in the Arduino IDE. Then they need to be loaded into the 3 Arduinos. THEN you connect the COM port outputs to RS-485.
Here is the code for the host S:
Here is the code for the slave CA:
Here is the code for the slave CB:
This example only shows one-way data transmission, but in fact in the RS485 network supports two-way "half-duplex" communication. More code would need to be added to control the relationship between the nodes.
RS485 serial communications; RS485 module
See RS485 Example of hardware and software HERE:
There is also a USB-to-RS485 Module (right) for use on PC's. (See it Here):
See the example RS485 Network Diagram (scroll down).
For many details about RS485 See THIS Page:
RS485 Overview:
The RS485 serial bus interfacestandard transmits differential balanced signals. This has strong anti-interference ability in the common mode, allows a twisted pair transmitter driver on a number of connected devices. The communication distance is up to 1200 meters, the rate is up to 20Mbps, and it can be used in high noise environments, such as industrial automation.In an RS485 network at any time only one device is in the sending state, and all other equipment should be in the receiving state. Each Arduino controls its RE / DE pin control to specify the device which is sending data to the RS485 network, or receiving data from the RS485 network.
Example RS485 Network Diagram:
NOTE: (APOLOGIES! Again on the TODO List! These examples will be updated Real Soon Now!
Below are simple example Software Sketches that show the Master sending data to the two slaves, and controlling their LEDs. Each slave is in receive mode and receives the same data.
The modules shown above have RE and DE connected together and to Arduino pin2. This is the "Direction" control.
You can cut and paste these examples into a new page in the Arduino IDE. Then they need to be loaded into the 3 Arduinos. THEN you connect the COM port outputs to RS-485.
Here is the code for the host S:
Here is the code for the slave CA:
Here is the code for the slave CB:
This example only shows one-way data transmission, but in fact in the RS485 network supports two-way "half-duplex" communication. More code would need to be added to control the relationship between the nodes.
Other Links to Information:
https://sites.google.com/site/jpmzometa/arduino-mbrt (RS485 ModBus communications)
http://real2electronics.blogspot.com/2009/09/arduino-and-rs485-english-version.html
http://www.embeddedsys.com/subpages/resources/images/documents/microsys_art_RS485.pdf