rs_485 - dwilson2547/wiki_demo GitHub Wiki

RS-485 Communications: A Technical Overview


Introduction

RS-485 is a standard for serial communication that supports multi-point, long-distance, and noise-resistant data transmission. It is widely used in industrial environments for connecting multiple devices over a single pair of wires.


Key Features

  • Differential Signaling: Uses two wires (A and B) to transmit data, improving noise immunity.
  • Multi-Drop Network: Supports up to 32 or 256 devices (depending on driver strength) on a single bus.
  • Long Distance: Up to 1200 meters (4000 feet) at lower speeds.
  • Half-Duplex or Full-Duplex:
    • Half-Duplex: Uses 2 wires for bidirectional communication (one direction at a time).
    • Full-Duplex: Uses 4 wires for simultaneous bidirectional communication.
  • High Noise Immunity: Ideal for industrial environments.
  • Baud Rate: Supports speeds up to 10 Mbps (distance-dependent).

Physical Interface

Wiring

  • 2-Wire (Half-Duplex): Uses A and B for data transmission.
  • 4-Wire (Full-Duplex): Uses A+, B+ for TX and A-, B- for RX.
Wire Description
A Non-inverting (positive) signal
B Inverting (negative) signal
GND Optional ground reference

Connectors

  • Commonly uses screw terminals or DB-9 connectors.

Electrical Characteristics

  • Voltage Levels:
    • Logic 1 (Mark): A is negative with respect to B (-1.5V to -5V).
    • Logic 0 (Space): A is positive with respect to B (+1.5V to +5V).
  • Common Mode Voltage Range: -7V to +12V.
  • Termination: Requires 120Ω resistors at both ends of the bus to prevent signal reflections.

Protocol Basics

  • Asynchronous or Synchronous: Typically uses UART for asynchronous communication.
  • Data Format: Similar to RS-232 (start bit, data bits, parity, stop bit).
  • Baud Rate: Configurable (e.g., 9600, 19200, 115200 bps).

Network Topology

  • Bus Topology: All devices share the same A and B lines.
  • Termination: Required at both ends of the bus to prevent signal reflections.
  • Biasing: Optional pull-up/pull-down resistors to ensure idle bus state.

Advantages

  • Long Distance: Up to 1200 meters.
  • Multi-Drop: Supports multiple devices on a single bus.
  • Noise Immunity: Differential signaling rejects common-mode noise.
  • High Speed: Faster than RS-232 for long-distance communication.

Limitations

  • Complexity: Requires proper termination and biasing.
  • Collision Risk: Half-duplex mode requires careful timing to avoid data collisions.
  • No Built-in Error Correction: Relies on higher-layer protocols.

Common Applications

  • Industrial Automation: PLCs, sensors, and actuators.
  • Building Automation: HVAC, lighting control.
  • Telecommunications: Base stations, remote terminals.

Troubleshooting Tips

  1. Check Termination: Ensure 120Ω resistors are present at both ends.
  2. Verify Wiring: Confirm A and B are correctly connected (not reversed).
  3. Grounding: Avoid ground loops; use a single ground reference if possible.
  4. Signal Quality: Use an oscilloscope to check for noise or reflections.
  5. Baud Rate: Ensure all devices use the same baud rate.

Example: Wiring a 2-Wire RS-485 Bus

Device 1 ----A----[Twisted Pair]----A---- Device 2 ----B----------------B----/

  • Add 120Ω termination resistors between A and B at both ends.

Comparison: RS-485 vs. RS-232

Feature RS-485 RS-232
Devices Up to 256 1-to-1
Distance Up to 1200 meters Up to 15 meters
Noise Immunity High Low
Wiring Differential (2 or 4 wires) Single-ended
Speed Up to 10 Mbps Up to 115200 bps

Resources

⚠️ **GitHub.com Fallback** ⚠️