Component guide · Intermediate · 3 min read
MAX485 RS485 to TTL Module

Pinout, Wiring and Modbus Code
By Geekobot Learning Team · Updated 29 Oct 2026
On this page
The MAX485 module converts a microcontroller's UART into RS485, the two-wire differential bus used by industrial sensors and Modbus devices over long cables (up to about 1200 m). Connect DI to TX, RO to RX and drive the joined DE/RE pins HIGH to send and LOW to receive. Wire A to A and B to B on the bus.
Key specs at a glance
- Standard
- RS485 half duplex
- Speed
- Up to 2.5 Mbps (lower over long cables)
- Distance
- Up to about 1200 m at low baud rates
- Devices
- Up to 32 on one bus (unit loads)
- Supply
- 5 V (MAX485); use MAX3485 or a 3.3 V module for 3.3 V boards
- Pins
- RO, RE, DE, DI to the controller; A, B to the bus
Models in this guide
These are alternatives. Pick the one that fits your project; you only need one.
Option 1MAX485 RS-485 to TTL Module₹28
Option 2MAX485 TTL to RS485 Converter Module – 5V DC₹209
Option 3MAX485 RS485 Transceiver IC₹35
What the MAX485 RS485 module is
RS485 sends each bit as a voltage difference between two wires, A and B, which rejects electrical noise and allows long cables. Many devices share one pair, each with its own address when using Modbus RTU.
The MAX485 is half duplex: it either sends or listens. Your code switches direction with the DE (driver enable) and RE (receiver enable) pins, usually tied together.
MAX485 RS485 module pinout
The pins on the MAX485 RS485 module and what each one does.
| Pin | Function |
|---|---|
| RO | Receiver output, to controller RX |
| RE | Receiver enable, LOW = listen |
| DE | Driver enable, HIGH = send |
| DI | Driver input, from controller TX |
| VCC | 5 V |
| GND | Ground |
| A | Bus A (non-inverting, sometimes D+) |
| B | Bus B (inverting, sometimes D−) |
- RO
- Receiver output, to controller RX
- RE
- Receiver enable, LOW = listen
- DE
- Driver enable, HIGH = send
- DI
- Driver input, from controller TX
- VCC
- 5 V
- GND
- Ground
- A
- Bus A (non-inverting, sometimes D+)
- B
- Bus B (inverting, sometimes D−)
Wiring the MAX485 RS485 module
On an ESP32 the 5 V MAX485 outputs 5 V on RO, so divide it to 3.3 V or use a 3.3 V transceiver. Fit a 120 Ω termination resistor at each end of long buses (many modules have one already).
| MAX485 RS485 module pin | Arduino Uno | ESP32 |
|---|---|---|
| RO | D10 (SoftwareSerial RX) | GPIO 16 (RX2) via divider |
| DI | D11 (SoftwareSerial TX) | GPIO 17 (TX2) |
| DE + RE | D2 | GPIO 4 |
| VCC | 5V | 5V (VIN) |
| GND | GND | GND and bus ground |
| A / B | Device A / B | Device A / B |
- RO
- Arduino Uno:
- D10 (SoftwareSerial RX)
- ESP32:
- GPIO 16 (RX2) via divider
- DI
- Arduino Uno:
- D11 (SoftwareSerial TX)
- ESP32:
- GPIO 17 (TX2)
- DE + RE
- Arduino Uno:
- D2
- ESP32:
- GPIO 4
- VCC
- Arduino Uno:
- 5V
- ESP32:
- 5V (VIN)
- GND
- Arduino Uno:
- GND
- ESP32:
- GND and bus ground
- A / B
- Arduino Uno:
- Device A / B
- ESP32:
- Device A / B
Example code
Install the ModbusMaster library. Address, baud rate, register numbers and scaling come from your sensor's manual.
#include <ModbusMaster.h>
#include <SoftwareSerial.h>
const int DIR = 2;
SoftwareSerial rs485(10, 11); // RO, DI
ModbusMaster node;
void preTx() { digitalWrite(DIR, HIGH); }
void postTx() { digitalWrite(DIR, LOW); }
void setup() {
Serial.begin(9600);
rs485.begin(9600);
pinMode(DIR, OUTPUT); postTx();
node.begin(1, rs485); // slave address 1
node.preTransmission(preTx);
node.postTransmission(postTx);
}
void loop() {
uint8_t r = node.readHoldingRegisters(0x0000, 2); // check your sensor's register map
if (r == node.ku8MBSuccess) {
Serial.print("Reg 0: "); Serial.print(node.getResponseBuffer(0));
Serial.print(" Reg 1: "); Serial.println(node.getResponseBuffer(1));
} else {
Serial.print("Modbus error 0x"); Serial.println(r, HEX);
}
delay(2000);
}Setup and tuning
If nothing answers, swap A and B; labels are not consistent between makers.
connect the ground of all devices over long runs, or use isolated modules.
many modules include pull-up/pull-down bias on A and B; with several modules on one bus, keep bias on only one.
check timing at your baud rate with the UART baud error calculator.
What you need
Shop this list4 of 5 found in our store · ₹321
MAX485 RS-485 to TTL module: the common moduleMAX485 RS-485 to TTL Module₹28
MAX485 TTL to RS485 converter module: alternative boardMAX485 TTL to RS485 Converter Module – 5V DC₹209
MAX485 RS485 transceiver IC: the bare chip for your own PCBMAX485 RS485 Transceiver IC₹35- Uno R3 development board: the controller used in the wiring tableFind this part
Dupont jumper wires: for the connectionsDupont Jumper Wires (40 pcs)₹49Closest match, check the specs
Alternatives and when to choose them
- RS485 and RS232: how the standards differ.
- Modbus RTU with Arduino and ESP32: full Modbus walkthrough.
- CAN bus MCP2515: another robust multi-drop bus, common in vehicles.
Try it: Uart baud rate error calculator
Change the values and the diagram and results update as you type.
Common mistakes to avoid
- Leaving DE/RE floating, so the module never sends or never listens.
- Connecting a 5 V RO output straight to an ESP32 pin.
- No termination on a long cable.
- Assuming A and B labels match on every device.
Frequently asked questions
What is RS485 used for?
Long-distance, noise-resistant serial links to industrial sensors, energy meters, PLCs and VFDs, usually with Modbus RTU.
Does MAX485 work with ESP32?
Power it at 5 V and level-shift RO, or use a 3.3 V transceiver such as the MAX3485.
How many devices can share the bus?
Up to 32 standard loads; more with low-load transceivers.
Do I need a termination resistor?
On long or fast buses, yes: 120 Ω at each end.
Why do I get Modbus timeouts?
Wrong baud rate, address, A/B swapped, or DE/RE not switching at the right time.
Can it do full duplex?
No. The MAX485 is half duplex; use a MAX490-style part for full duplex.
Parts for this guide
Calculators
Terms in this guide
Projects that use it
Put this into practice: 1 step-by-step build in our project library uses parts from this guide.
Keep learning
Sources
- MAX481/MAX483/MAX485 low-power RS-485/RS-422 transceivers datasheet (Analog Devices / Maxim)
- ModbusMaster Arduino library
Written by the Geekobot team from manufacturer datasheets. Always check the datasheet for the exact part and variant you buy.

