Table of Contents

lamaPLC: TM1650 7-Segment Display with I²C like or Modbus Communication

TM1650 7-Segment Display with Modbus Communication

The TM1650 is a popular, cost-effective integrated circuit (IC) used to drive 4-digit, 7-segment LED displays while minimizing the number of microcontroller I/O pins required.

The TM1650 7-segment display uses a proprietary 2-wire serial protocol that is very similar to I²C, but it is not a standard, addressable I²C device. It uses a clock (SCL) and a data line (SDA) to communicate with a microcontroller.

TM1650 Key Features

TM1650 7-Segment Display with Modbus CommunicationTM1650 7-Segment Display with Modbus CommunicationTM1650 7-Segment Display with Modbus Communication

TM1650 Technical Specifications

FeatureDetail
Operating Voltage3V to 5.5V
Display Digits4 Digits, 8 Segments (including the decimal point)
Interface Type2-wire serial (I²C-like) or with TP8485E RS-485 Modbus
Key Scan Capabilit4-key input matrix
Brightness Level8 levels

TM1650 and Arduino Wiring Diagram for I²C communication

If you'd like to support the development of the site with the price of a coffee — or a few — please do so here.

Here's a handy tip: you can quickly save this page as a PDF by clicking “export to PDF” in the menu on the right side of the screen.

2026/02/14 22:38

TM1650 and Arduino I²C example code

#include <Wire.h>
#include <TM1650.h>
 
TM1650 d;
 
void setup() {
  Wire.begin();        // Start I²C communication
  d.init();            // Initialize the display
  d.displayOn();       // Turn display on
  d.setBrightness(4);  // Set brightness (0 to 7)
}
 
void loop() {
  // Display a fixed number
  d.displayString("1234");
  delay(2000);
 
  // Simple counter
  for (int i = 0; i <= 100; i++) {
    d.displayString(String(i).c_str());
    delay(100);
  }
}

Key Features

TP8485E IC: RS-485 Transceiver

The TP8485E is a robust RS-485 transceiver designed for industrial communication networks.

TM1650 and TP8485E Modbus Features

Modbus connection characteristics:
Default Modbus settings: 9600 baud, 8N1, RTU communication, slave ID: 1

After powering up, a number, such as “0013”, flashes briefly. The first digit represents the slave ID (1), and the second indicates the baud rate (3: 9600).

The “write multiple registers” Modbus function (10) works, with three pieces of information (signal, number of digits, brightness) (2.468 / low brightness 1: TX 01 10 00 00 00 03 06 09 a4 00 03 00 01 a6 00)

The registers must be written one at a time using the “write single register” function (6). (Send 1234: TX: 01 06 00 00 04 d2 0b 57)

AddressFunction
0To display Data send
1Position of the decimal Point
2Set Brightness
3Set flash
4Set Baudrate (Range 0 – 7 corresponds to 0:1200 1:2400 2:4800 3:9600 4:19200 5:38400 6:57600 7:115200)
5Set the Address

TM1650 and TP8485E Modbus Wiring

TP8485E (RS-485):

TM1650 (Display):

TM1650 and TP8485E Modbus Arduino Example Code

This sketch receives a 4-digit number over RS-485 and displays it on a 7-segment display. You will need the TM1650 library by Anatoli Arkhipenko.

#include <Wire.h>
#include <TM1650.h>
 
#define RS485_CONTROL_PIN 2  // Pin to toggle RE/DE on TP8485E
TM1650 d;
 
void setup() {
  // Initialize RS-485
  Serial.begin(9600);
  pinMode(RS485_CONTROL_PIN, OUTPUT);
  digitalWrite(RS485_CONTROL_PIN, LOW); // Set to RECEIVE mode initially
 
  // Initialize TM1650 Display
  Wire.begin();
  d.init();
  d.displayOn();
  d.setBrightness(4);
  d.displayString("WAIT");
}
 
void loop() {
  if (Serial.available() > 0) {
    // Read incoming string from RS-485 (e.g., "1234")
    String receivedData = Serial.readStringUntil('\n');
    receivedData.trim(); // Clean whitespace
 
    if (receivedData.length() > 0) {
      d.displayString(receivedData.c_str());
    }
  }
}
 
// Function to send data back via RS-485 if needed
void sendRS485(String msg) {
  digitalWrite(RS485_CONTROL_PIN, HIGH); // Switch to TRANSMIT mode
  Serial.println(msg);
  Serial.flush();                        // Ensure all data is sent
  digitalWrite(RS485_CONTROL_PIN, LOW);  // Switch back to RECEIVE mode
}

Display topics on lamaPLC




This page has been accessed for: Today: 1, Until now: 53