Labs / Electronic modules

GraftSense - Isolated TTL to RS485 Module (Open Version)

Author: Li Zisheng · Source: FreakStudio open documentation, v1.2 · License: CC BY 4.0 · Driver code (communication/ttl_rs485_code): MIT License

Contents
GraftSense - Isolated TTL to RS485 Module (Open Version)
GraftSense - Isolated TTL to RS485 Module (Open Version)

I. Module Introduction

Isolated TTL to RS485 module is a communication interface module based on the JSM485ESA chip, integrating an isolated power supply and communication isolation IC to realize bidirectional conversion between TTL and RS485 levels with electrical isolation function. It is compatible with 3.3V/5V power supply, supports high-speed communication, and is suitable for scenarios with high anti-interference requirements such as industrial control and the Internet of Things, building a safe and reliable isolated communication bridge between TTL devices and RS485 devices.

II. Introduction to Main Chips

JSM485ESA is a half-duplex transceiver chip designed for RS485 and RS422 communication systems. It supports a data rate up to 2Mbps, and features control pins for driver enable (DE) and receiver enable (/RE). Its receiver adopts 1/4 unit load input impedance, allowing up to 28 loads on a single bus, and supports tri-state output. It offers ±5KV ESD protection (contact/air discharge) as well as short-circuit protection for pins A and B. Housed in an SOP8 package, this chip is suitable for low-power transceiving, electricity meters, access control systems, industrial control local area networks and other scenarios, making it a highly EMI-resistant RS485 interface chip.

2.1 Chip Overview

GraftSense - Isolated TTL to RS485 Module (Open Version)

2.2 Pin Definition

GraftSense - Isolated TTL to RS485 Module (Open Version)

2.3 Functional Block Diagram

2.4 Performance Parameters

GraftSense - Isolated TTL to RS485 Module (Open Version)
GraftSense - Isolated TTL to RS485 Module (Open Version)
GraftSense - Isolated TTL to RS485 Module (Open Version)
GraftSense - Isolated TTL to RS485 Module (Open Version)
GraftSense - Isolated TTL to RS485 Module (Open Version)
GraftSense - Isolated TTL to RS485 Module (Open Version)

2.5 Reference Circuit

GraftSense - Isolated TTL to RS485 Module (Open Version)

2.6 Chip Configuration

We can adjust the terminal resistor of the RS485 module on the board as required:

GraftSense - Isolated TTL to RS485 Module (Open Version)
GraftSense - Isolated TTL to RS485 Module (Open Version)

None.

2.8 PCB Routing Precautions

None.

III. Instructions for Circuit Engineering and Module Usage

3.1 Circuit Source Engineering

To obtain the circuit source project, please follow the official account [Freak Embedded]

3.2 Module Usage Instructions

3.2.1 Basic Instructions for Module Usage

The schematic diagram of this module is shown below:

SCH_Isolated TTL to RS485 Module_v1.0_2025-11-23.pdf 1.7 MB

GraftSense - Isolated TTL to RS485 Module (Open Version)
GraftSense - Isolated TTL to RS485 Module (Open Version)

This module provides a UART interface: the MRX (corresponding to the UART MCU serial port RXD) is actually connected to the module's TXD pin, and the MTX (corresponding to the MCU serial port TX) is actually connected to the module's RXD pin;do not cross-connect them under any circumstances.

When we need to connect a computer to a RS485 module, a USB to 485 adapter is required:

GraftSense - Isolated TTL to RS485 Module (Open Version)

Common USB to 485 adapters use the FT232 chip, and we need to install the corresponding driver. In addition to being downloadable from FTDI 's official website: https://ftdichip.com/drivers/vcp-drivers/ .

Double-click the left mouse button and follow the steps below to install:

GraftSense - Isolated TTL to RS485 Module (Open Version)

3.2.2 Basic Knowledge of RS485 Communication

RS-232 Communication Protocol has the following drawbacks, which make it difficult to be applied in long-distance and industrial scenarios:

Therefore, subsequent engineers developed the RS-485 Communication Protocol. Compared with the RS-232 interface, RS-485 has remarkable advantages in terms of transmission distance, anti-interference capability, multi-device communication and other aspects:

GraftSense - Isolated TTL to RS485 Module (Open Version)

Unlike RS-232 or TTL, RS-485 operates in half-duplex mode in most applications, meaning only one device can transmit data at a time while all other devices are in the receiving state; therefore, an additional protocol is required to coordinate communication between devices.

GraftSense - Isolated TTL to RS485 Module (Open Version)

A typical RS-485 bus topology consists of multiple devices connected in series on a main trunk line; each device is equipped with an independent transmitter and receiver, and shares a pair of communication lines (A and B). We usually use twisted pair cables to reduce electromagnetic interference and noise. Meanwhile, for long-distance or high-speed transmission, terminal resistors (typically 120 ohms) are usually added at both ends of the bus to avoid signal reflection and interference.

In the RS-485 master-slave communication architecture, different devices can be divided into two roles:

The communication process can be summarized as follows:

GraftSense - Isolated TTL to RS485 Module (Open Version)
GraftSense - Isolated TTL to RS485 Module (Open Version)
Needs to be redrawn + add Chinese

With the exception of the daisy-chain bus (which connects devices in series one after another to form a single-path communication link), other topologies are not recommended for use in RS-485 communication, as they will cause severe signal reflection and interference issues. If a topology such as a star topology must be used, it is mandatory to deploy RS-485 hubs or repeaters to avoid signal reflection and interference:

GraftSense - Isolated TTL to RS485 Module (Open Version)
RS485 hub
GraftSense - Isolated TTL to RS485 Module (Open Version)
Connection diagram of the RS485 hub; needs to be redrawn + Chinese text to be added

When using RS-485 communication, it is imperative to note that RS-485 signal lines and power lines must not be routed together, as power lines generate strong electromagnetic interference that will disrupt the signal lines transmitting data; meanwhile, RS-485 bus requires single-point grounding, meaning there shall be only one grounding point on the bus. If multiple grounding points occur, potential differences between ground wires will be caused, which further leads to common-mode interference and affects the stability of communication.

GraftSense - Isolated TTL to RS485 Module (Open Version)

RS-485 communication can also achieve full-duplex data transmission, with TX and RX having separate dedicated lines for communication; however, in this mode, slave devices cannot communicate directly with each other, and all data transmission between them must be routed through the master device.

3.2.3 Communication Connection of RS485

TTL to RS485 interface conversion, point-to-point, half-duplex communication, applicable for interface conversion scenarios:

GraftSense - Isolated TTL to RS485 Module (Open Version)

TTL to RS485 interface conversion, point-to-multipoint, half-duplex communication, suitable for expanding communication nodes:

GraftSense - Isolated TTL to RS485 Module (Open Version)

Through two sets of TTL and RS485 interface conversion, point-to-point, half-duplex communication, it is suitable for extending the communication distance of TTL:

GraftSense - Isolated TTL to RS485 Module (Open Version)

3.3 Application Experiment

Here, we use the GraftPort-RP2040 development board for testing, and will based on an isolated TTL-to-RS485 module to communicate with the main controller via the UART interface.

Here, we first use the HY2.0-4P cable to connect the module to the GraftPort-RP2040 development board's UART1 interface. Meanwhile, you need to connect the isolated TTL to RS485 module 's RS485-A and RS485-B pins to the adapter' s T/R+ and T/R- pins, connect the GND of both devices, then connect the adapter to the computer via a USB port. The physical connection diagram is shown below:

The module connections are shown in the following table:

development board pins

Module Pins

Description

Pin 8

MTX

UART data transmission line, corresponding to the transmit pin of the development board

Pin 9

MRX

UART data transmission line, corresponding to the receiving pin of the development board

In this hardware connection step, we use the RS485 adapter to interface with the XCOM software, and meanwhile realize communication with the microcontroller via the isolated TTL to RS485 module; the corresponding serial communication parameter configuration of the XCOM software is as follows:

GraftSense - Isolated TTL to RS485 Module (Open Version)

After completing the settings, we click Open Serial Port, and that's it.

Import UART 485 Loopback Test - MicroPython Driver Code

Next, copy the test code for verifying the function of the verification module below main.py into our project:

# Python env   : MicroPython v1.23.0
# -*- coding: utf-8 -*-
# @Time    : 2025/09/04 10:00
# @Author  : 侯钧瀚
# @File    : main.py
# @Description : 485 serial loopback test code

# ======================================== Import Modules =========================================

from machine import UART, Pin
import time

# ======================================== Global Variables ============================================

# Test message counter
count = 1

# ======================================== Functions ============================================

# ======================================== Custom Classes ============================================

# ======================================== Initialization ==========================================

# Power-on delay of 3 s
time.sleep(3)
print("FreakStudio: UART loopback test started. Sending data every 2 seconds...")

# Initialize UART1: TX=Pin8, RX=Pin9, baud rate 9600
uart = UART(1, baudrate=9600, tx=Pin(8), rx=Pin(9))

# ========================================  Main Program  ===========================================

try:
    while True:
        # Build test message with counter
        test_msg = f"Test message {count}: Hello, UART loopback!"
        print(f"\nSent: {test_msg}")

        # Send message
        uart.write(test_msg.encode('utf-8'))

        # Wait a short time to receive data
        time.sleep(0.1)

        # Read and print received data
        if uart.any():
            received = uart.read(uart.any()).decode('utf-8')
            print(f"Received: {received}")
        else:
            print("Received: No data (check connections)")

        # Increment counter and wait 2 seconds before the next send
        count += 1
        time.sleep(2)
except KeyboardInterrupt:
    print("\nTest stopped by user")

To flash the code, open a terminal and use the mpremote tool to connect to the main controller; the output is as follows:

GraftSense - Isolated TTL to RS485 Module (Open Version)

It can be seen that our module can normally complete the loopback test function of the serial port.

IV. Drivers

ttl_rs485_code.zip 8 KB

None.

VI. Revision History

Document Version

Revision Date

Modifier

Revised Content

v1.0

2025-11-22

Li Zisheng

Initialize Document

The BOM sheet has not been finally checked, the driver has not been re-verified, and the 3.3 application experiment

Not yet specified.

v1.1

2025-12-29

Li Zisheng

Added application experiments and production files

v1.2

2025-12-31

Sin Ruili

Create an open version of the document based on the internal document version v1.1.

VII. Relevant Materials

7.1 Chip Datasheet

C5381783_RS-485-RS-422 Chip_JSM485ESA_Datasheet_WJ974414.PDF 2.3 MB

7.2 Unique Icons for PCB Silk Screen

GraftSense - Isolated TTL to RS485 Module (Open Version)