Stufin
Home Quick Cart Profile

M5 Stack COMMU Module Extend RS485/TTL CAN/I2C Port

Buy Now on Stufin

Component Name

M5 Stack COMMU Module Extend RS485/TTL CAN/I2C Port

Description

The M5 Stack COMMU Module Extend RS485/TTL CAN/I2C Port is a versatile communication module designed for IoT applications, robotics, and automation systems. This module provides multiple serial communication interfaces, allowing users to connect and control various devices and sensors. The module is compact, easy to use, and compatible with the M5 Stack ecosystem.

The COMMU Module Extend provides the following communication interfaces

RS485A half-duplex serial communication interface, allowing for long-distance communication up to 1200 meters. It is suitable for industrial control systems, building automation, and security systems.

TTL CAN

1 Mbps baud rate, ISO 11898-2 compliant

I2C3.3V/5V tolerant, 100 kHz/400 kHz baud rate

Key Features

  • Multiple Communication Interfaces: The module provides three separate communication interfaces, allowing users to connect multiple devices and sensors.
  • Compact Design: The module is designed to be compact and easy to integrate into IoT projects and prototypes.
  • M5 Stack Compatibility: The module is compatible with the M5 Stack ecosystem, making it easy to integrate with other M5 Stack modules and development boards.
  • Easy to Use: The module is easy to use, with clear labeling and a simple connection interface.
  • Robust Design: The module is designed to be robust and reliable, with a durable construction and high-quality components.
  • Wide Operating Temperature: The module operates over a wide temperature range, making it suitable for use in various environmental conditions.
  • Low Power Consumption: The module has low power consumption, making it suitable for battery-powered IoT devices and applications.

Operating Voltage

5V

Current Consumption

<50mA

RS485Half-duplex, 1200 meters distance, 115.2 kbps baud rate

Dimensions

25 x 25 x 10 mm (1 x 1 x 0.4 inches)

Weight

10g

Applications

The M5 Stack COMMU Module Extend RS485/TTL CAN/I2C Port is suitable for a wide range of IoT applications, including

Industrial automation

Robotics

Building automation

Security systems

Environmental monitoring

Medical devices

Automotive systems

Consumer electronics

Pin Configuration

  • M5 Stack COMMU Module Extend RS485/TTL CAN/I2C Port Documentation
  • The M5 Stack COMMU Module is an extension module designed for the M5Stack ecosystem, offering a range of communication interfaces, including RS485, TTL, CAN, and I2C. This documentation provides a detailed explanation of the module's pins, their functions, and how to connect them.
  • Pinout Structure:
  • The COMMU Module has a total of 16 pins, organized into four rows of four pins each. The pinout structure is as follows:
  • Row 1:
  • 1. GND: Ground pin, provides a common ground connection for the module.
  • 2. VCC: Power supply pin, typically 5V or 3.3V, depending on the application.
  • 3. RX: Receive pin for TTL serial communication.
  • 4. TX: Transmit pin for TTL serial communication.
  • Row 2:
  • 1. CAN_H: High-level signal pin for CAN bus communication.
  • 2. CAN_L: Low-level signal pin for CAN bus communication.
  • 3. RS485_A: Non-inverting signal pin for RS485 communication.
  • 4. RS485_B: Inverting signal pin for RS485 communication.
  • Row 3:
  • 1. SCL: Clock pin for I2C communication.
  • 2. SDA: Data pin for I2C communication.
  • 3. VBUS: VCC power supply pin for the I2C interface.
  • 4. GND: Ground pin for the I2C interface.
  • Row 4:
  • 1. INT: Interrupt pin, can be used to trigger interrupts on the host microcontroller.
  • 2. RO: Read-only pin, used for configuring the module's communication mode.
  • 3. DI: Data input pin, used for configuring the module's communication mode.
  • 4. GND: Ground pin, provides a common ground connection for the module.
  • Pin Connection Guidelines:
  • When connecting the COMMU Module to your M5Stack or other microcontrollers, follow these guidelines:
  • Use a stable power supply (VCC) and ensure it matches the voltage requirement of your microcontroller.
  • Connect the GND pins to a common ground point to ensure proper signal transmission.
  • For RS485 communication, connect the RS485_A and RS485_B pins to the corresponding pins on your RS485 device.
  • For CAN bus communication, connect the CAN_H and CAN_L pins to the corresponding pins on your CAN bus device.
  • For I2C communication, connect the SCL and SDA pins to the corresponding pins on your I2C device. Ensure the VBUS pin is connected to the VCC power supply.
  • For TTL serial communication, connect the RX and TX pins to the corresponding pins on your serial device.
  • The INT pin can be connected to an interrupt pin on your microcontroller to trigger interrupts.
  • The RO and DI pins can be used to configure the module's communication mode, following the documentation specific to your application.
  • Important Notes:
  • Ensure proper isolation and termination for RS485 and CAN bus communication to prevent signal reflection and noise.
  • Use a suitable I2C pull-up resistor configuration to ensure reliable communication.
  • Always refer to the relevant documentation and datasheets for specific communication protocols and device connections.
  • By following this documentation and adhering to the pin connection guidelines, you can successfully integrate the M5 Stack COMMU Module into your IoT project and leverage its diverse communication interfaces.

Code Examples

M5 Stack COMMU Module Extend RS485/TTL CAN/I2C Port Documentation
Overview
The M5 Stack COMMU Module is a versatile communication module designed for the M5 Stack ecosystem, providing extended connectivity options for various applications. This module features multiple communication protocols, including RS485, TTL CAN, and I2C, making it an ideal solution for industrial automation, IoT, and robotics projects.
Pinout and Interfaces
The module has the following interfaces:
RS485: 2-pin screw terminal (TX+, TX-)
 TTL CAN: 4-pin header (CAN_H, CAN_L, VCC, GND)
 I2C: 4-pin header (SDA, SCL, VCC, GND)
 Power: 3-pin header (VCC, GND, EN)
Example 1: RS485 Communication with Modbus
In this example, we will demonstrate how to use the RS485 interface to communicate with a Modbus slave device using the M5 Stack COMMU Module.
Hardware Requirements
M5 Stack Core Board
 M5 Stack COMMU Module
 Modbus slave device (e.g., temperature sensor)
 RS485 cable
Software Requirements
M5 Stack Arduino Library
 ModbusRTU Library (available on GitHub)
Code Example
```c++
#include <M5Stack.h>
#include <ModbusRTU.h>
#define RS485_RX_PIN 16
#define RS485_TX_PIN 17
ModbusRTU modbus;
void setup() {
  M5.begin();
  Serial.begin(115200);
  
  // Initialize RS485 interface
  pinMode(RS485_RX_PIN, INPUT);
  pinMode(RS485_TX_PIN, OUTPUT);
  modbus.begin(RS485_RX_PIN, RS485_TX_PIN);
}
void loop() {
  // Read temperature from Modbus slave device
  uint16_t temp = modbus.readHoldingRegister(0x0000, 1);
  
  // Print temperature value
  Serial.print("Temperature: ");
  Serial.print(temp);
  Serial.println(" C");
  
  delay(1000);
}
```
Example 2: I2C Communication with OLED Display
In this example, we will demonstrate how to use the I2C interface to communicate with an OLED display using the M5 Stack COMMU Module.
Hardware Requirements
M5 Stack Core Board
 M5 Stack COMMU Module
 OLED display (e.g., SSD1306)
 I2C cable
Software Requirements
M5 Stack Arduino Library
 SSD1306 OLED Library (available on GitHub)
Code Example
```c++
#include <M5Stack.h>
#include <SSD1306.h>
#define I2C_SDA_PIN 21
#define I2C_SCL_PIN 22
SSD1306 display(0x3C, I2C_SDA_PIN, I2C_SCL_PIN);
void setup() {
  M5.begin();
  Serial.begin(115200);
  
  // Initialize I2C interface
  Wire.begin(I2C_SDA_PIN, I2C_SCL_PIN);
  
  // Initialize OLED display
  display.init();
}
void loop() {
  // Clear display
  display.clearDisplay();
  
  // Print "Hello World!" on display
  display.setTextSize(2);
  display.setTextColor(WHITE);
  display.setCursor(0, 0);
  display.print("Hello World!");
  
  // Update display
  display.display();
  
  delay(1000);
}
```
Example 3: CAN Bus Communication with Vehicle
In this example, we will demonstrate how to use the TTL CAN interface to communicate with a vehicle's CAN bus using the M5 Stack COMMU Module.
Hardware Requirements
M5 Stack Core Board
 M5 Stack COMMU Module
 CAN bus interface (e.g., OBD-II)
 Vehicle with CAN bus support
Software Requirements
M5 Stack Arduino Library
 CAN bus library (e.g., CAN-BUS Library for Arduino)
Code Example
```c++
#include <M5Stack.h>
#include <CANBUS.h>
#define CAN_RX_PIN 18
#define CAN_TX_PIN 19
CANBUS canbus;
void setup() {
  M5.begin();
  Serial.begin(115200);
  
  // Initialize CAN bus interface
  pinMode(CAN_RX_PIN, INPUT);
  pinMode(CAN_TX_PIN, OUTPUT);
  canbus.begin(CAN_RX_PIN, CAN_TX_PIN);
}
void loop() {
  // Read vehicle speed from CAN bus
  uint16_t speed = canbus.read(0x010C, 1);
  
  // Print vehicle speed
  Serial.print("Vehicle Speed: ");
  Serial.print(speed);
  Serial.println(" km/h");
  
  delay(1000);
}
```
These examples demonstrate the versatility of the M5 Stack COMMU Module and its ability to interface with various devices and protocols.