Difference between revisions of "I2C Address Converter Module SKU: CQRADDR001"

From CQRobot-Wiki
Jump to: navigation, search
(Created page with "thumb|200px|right|4-CH 16-Bit ADS1115 ADC Module =='''Description'''== The 4-channel 16-bit ADS1115 ADC Module is a high-precision analog-to-digital con...")
 
(Raspberry Pi Example and Test Code)
 
(36 intermediate revisions by the same user not shown)
Line 1: Line 1:
[[File:CQRADC001.jpg|thumb|200px|right|4-CH 16-Bit ADS1115 ADC Module]]
+
[[File:CQRADDR001.jpg|thumb|200px|right|I2C Address Converter Module]]
 
=='''Description'''==
 
=='''Description'''==
The 4-channel 16-bit ADS1115 ADC Module is a high-precision analog-to-digital conversion solution based on the TI ADS1115IDGSR chip. This module provides four 16-bit precision analog input channels, supports both 3.3V and 5V operation, and features a hardware-configurable I2C address. The module also integrates an NTC temperature measurement interface, enabling multi-channel signal acquisition and temperature monitoring.
+
LTC4316 I2C Address Translation Module is a practical I2C bus expansion tool designed to resolve I2C device address conflicts. This module can translate the fixed hardware address of an I2C device into a different communication address, enabling multiple devices with identical addresses to operate simultaneously on the same I2C bus.
 
----
 
----
  
 
=='''Features'''==
 
=='''Features'''==
*'''High-Precision 16-bit ADC Chip:''' Based on the TI ADS1115IDGSR chip, it provides four 16-bit resolution analog input channels, enabling high-precision signal acquisition.
+
*'''Efficient Address Conflict Solution:''' Based on the LTC4316IMS chip, it can translate the fixed hardware address of an I2C device into 127 distinct communication addresses, effectively resolving address conflicts on the I2C bus.
*'''Flexible Input Modes:''' Supports 4 single-ended inputs or 2 differential inputs, suitable for various sensor signal measurement scenarios.
+
*'''Wide Voltage Operating Range:''' Supports power supply voltages from 2.25V to 5.5V, ensuring compatibility with various logic level systems.
*'''Configurable I2C Address:''' Configurable via the ADDR pin, supporting 4 I2C addresses to facilitate multi-device networking.
+
*'''Hardware-Level Transparent Translation:''' Configures address offsets through a resistive voltage divider network and performs real-time address translation, remaining entirely transparent to both master and slave devices.
*'''Wide Sampling Rate Range:''' Supports programmable sampling rates from 8 SPS to 860 SPS, meeting the requirements of different applications.
+
*'''Flexible Address Configuration:''' Enables independent configuration of the high 3-bit and low 4-bit address offsets via the XORH/XORL pins using resistor voltage division, with support for quick switching via DIP switches.
*'''Integrated NTC Temperature Measurement Interface:''' Onboard MF52AT 10KΩ NTC temperature sensor interface with a B value of 3950K, ideal for temperature monitoring applications.
+
*'''Industrial-Grade Protection Design:''' Features separate interfaces for the master side (SCLIN/SDAIN) and slave side (SCLOUT/SDAOUT), providing clear signal flow isolation.
*'''Dual-Voltage Compatible Design:''' Supports 3.3V/5V dual-voltage operation, with a built-in LP5907 LDO providing stable 3.3V power.
+
*'''Standard Interface Compatibility:''' Equipped with dual interfaces—HY2.0mm 4P connectors and 2.54mm pin headers—for easy connection to various development boards and sensor modules.
*'''Automatic Level Conversion:''' I2C signals are automatically converted to 3.3V levels when powered by 5V, allowing direct connection to 3.3V microcontrollers.
 
*'''Standard Interface Design:''' Equipped with HY2.0mm 4P connectors and 2.54mm pin headers for easy connection to various development boards.
 
 
----
 
----
 +
 +
=='''Certification Documents'''==
 +
 +
[[Media:CQRADDR001-CE-Certification.rar]]
 +
 +
[[Media:CQRADDR001-FCC-SDOC-Certification.rar]]
  
 
=='''Pin Description and Size'''==
 
=='''Pin Description and Size'''==
 
[[image:CQRobot.jpg|thumb|1000px| center]]
 
[[image:CQRobot.jpg|thumb|1000px| center]]
[[image:CQRADC001-1.jpg|thumb|1000px| center]]
+
[[image:CQRADDR001-1.jpg|thumb|1000px| center]]
[[image:CQRADC001-2.jpg|thumb|1000px| center]]
+
[[image:CQRADDR001-2.jpg|thumb|1000px| center]]
 
----
 
----
  
 
=='''Specification'''==
 
=='''Specification'''==
 
{|
 
{|
| style="text-align: center;" | [[File:CQRADC001-3.jpg|1150px|left]]
+
| style="text-align: center;" | [[File:CQRADDR001-3.jpg|1150px|left]]
| style="text-align: center;" | [[File:CQRADC001-8.jpg|1150px|right]]
+
| style="text-align: center;" | [[File:CQRADDR001-4.jpg|1150px|right]]
 
|}
 
|}
  
 
=='''Working Principle'''==
 
=='''Working Principle'''==
[[image:CQRADC001-4.jpg|thumb|1000px| center]]
+
[[image:CQRADDR001-5-1.jpg|thumb|1000px| center]]
 
----
 
----
  
=='''Power Supply and Sensor Compatibility'''==
+
=='''Address Configuration'''==
This module supports dual-voltage operation at 3.3V/5V. When powered at 3.3V, all I/Os are at 3.3V level; when powered at 5V, the I2C signals are automatically converted to 3.3V for communication with the host, while also allowing measurement of 5V sensor signals. The module includes built-in protection circuits to prevent damage from overvoltage and provides a 3.3V LDO output to power external sensors.
+
 
 +
 
 +
*'''The module sets the address conversion value through voltage divider resistors at the XORH and XORL pins.'''
 +
 
 +
 
 +
[[image:CQRADDR001-711.jpg|thumb|1000px| center]]
 +
 
 +
 
 +
[[image:CQRADDR001-721.jpg|thumb|1000px| center]]
 +
 
 +
 
 +
*'''How to determine the resistance of welding resistor:'''
 +
 
 +
 
 +
First, based on the data sheet, the module determines whether a specific bit in the I2C address is inverted by the voltage of the XORH or XORL pins (i.e., VXORH or VORL relative to VCC). In Table 2 and 3, a bit value of 1 indicates inversion, while 0 indicates no inversion.
 +
 
 +
 
 +
[[image:CQRADDR001-73.jpg|thumb|1000px| center]]
 +
 
 +
[[image:CQRADDR001-75.jpg|thumb|1000px| center]]
 +
 
 +
 
 +
Assuming the VCC is now 5V, set A3-A0 to the 1 0 0 0 mode (A3 inverting while A2-A0 not). This requires VOXRL/VCC to be 0.53125±0.015, general formula: [VCC/(R1+R2)]R1=VXORL.
 +
 
 +
 
 +
Given the VCC of 5V and RLB of 100kΩ, the target VXORL should be 0.53125×5V=2.65625V. Substituting all parameters into the formula yields R2 ≈ 88.23529kΩ.
 +
 
 +
 
 +
Since this calculated R2 is not the exact common resistance, it should be matched with the closest common resistance value and verified through formula validation.
 +
 
 +
 
 +
Under this circumstance, the closest common resistance value to 88.23529kΩ is 86.6kΩ, so VXORL≈2.67953V, or VXORL/VCC≈0.53906. This ratio falls within 0.53125±0.015, making 86.6kΩ a suitable resistance value for RLT.
 +
 
 +
 
 +
[[image:CQRADDR001-76.jpg|thumb|1000px| center]]
  
Important: When measuring 5V sensors, the module must be powered at 5V. In this case, the I2C signals remain at 3.3V level and can be directly connected to 3.3V host GPIO. Note that the SDA and SCL pins on this module are limited to 3.3V.
 
 
----
 
----
  
 
=='''Connections and Examples'''==
 
=='''Connections and Examples'''==
{|
 
| style="text-align: center;" | [[File:CQRADC001-5.jpg|1150px|left]]
 
| style="text-align: center;" | [[File:CQRADC001-6.jpg|1100px|right]]
 
|}
 
'''Configuration Method:'''
 
Use a jumper cap to connect the ADDR pin to the corresponding voltage level point. After configuration, restart the power for the changes to take effect.
 
  
'''Using an I2C Address Conversion Module for Configuration:'''
+
[[image:CQRADDR001-7.jpg|thumb|1000px| center]]
When using an I2C address conversion module, all ADS1115 modules can be set to the same hardware address. Address differentiation is achieved by selecting channels on the conversion module, eliminating the need to modify hardware jumper configurations.
+
 
 +
----
 +
=='''Arduino Example and Test Code'''==
 +
 
 +
[[File:CQRADDR001-77.jpg|700px]]
 +
 
 +
*'''Sample Code:'''
 +
 
 +
 
 +
<pre>
 +
#include <Wire.h>
 +
 
 +
void setup() {
 +
  Serial.begin(9600);
 +
  Wire.begin();
 +
  Serial.println("Scan available I2C devices:");
 +
}
 +
 
 +
void loop() {
 +
  for(int addr = 1; addr < 127; addr++) {
 +
    Wire.beginTransmission(addr);
 +
    if(Wire.endTransmission() == 0) {
 +
      if(Wire.requestFrom(addr, (byte)1) > 0) {
 +
        Serial.print("✅ Available devices: 0x");
 +
        if(addr < 16) Serial.print("0");
 +
        Serial.println(addr, HEX);
 +
        while(Wire.available()) Wire.read();
 +
      }
 +
    }
 +
  }
 +
  delay(3000);
 +
}
 +
</pre>
 +
 
 +
 
 +
*'''Test Results:'''
 +
 
 +
 
 +
[[File:CQRADDR001-78.jpg|700px]]
 +
 
 +
 
 +
Set the serial port to 9600. Open the serial port debugger to view the bidirectional I2C address. After toggling the DIP switch to change the address, power on again. The new address will appear in the serial port debugger.
 +
 
 
----
 
----
 +
=='''Raspberry Pi Example and Test Code'''==
 +
 +
'''First, visit the Raspberry Pi official website to download the system. You must select the download option in the frame below; otherwise, the sensor will not function properly.'''
 +
 +
*Download link: https://www.raspberrypi.com/software/operating-systems/#raspberry-pi-os-legacy-64-bit
 +
 +
[[File:CQRADDR001-791.jpg|700px]]
 +
 +
*Schematic Diagram of Raspberry Pi 4B pins:
 +
 +
[[File:CQRADDR001-80.jpg|700px]]
 +
 +
[[File:CQRADDR001-81.jpg|700px]]
 +
 +
[[File:CQRADDR001-82.jpg|700px]]
 +
 +
Create a folder and a “.c” file, then write the code.
 +
 +
[[Media: I2C.rar]]
  
=='''Used in Conjunction with the TDS Meter Sensor (ASIN: B08KXRHK7H)'''==
+
You can directly add to the compressed file.
[[image:CQRADC001-7.jpg|thumb|1000px| center]]
+
 
'''Example Program'''
+
[[File:CQRADDR001-83.jpg|700px]]
 +
 
 +
gcc -Wall -g -o I2C I2C.c -lm
 +
 
 +
./I2C
 +
 
 +
Go to the folder created in the terminal, use GCC cross-compilation and run the file.
 +
 
 +
*'''Sample Code:'''
 +
 
 +
<pre>
 +
include <stdio.h>
 +
#include <stdlib.h>
 +
#include <unistd.h>
 +
#include <fcntl.h>
 +
#include <sys/ioctl.h>
 +
#include <linux/i2c-dev.h>
 +
int main() {
 +
    int file;
 +
    char filename[20];
 +
   
 +
    printf("Scan available I2C devices...\n\n");
 +
   
 +
    snprintf(filename, 19, "/dev/i2c-1");
 +
    file = open(filename, O_RDWR);
 +
    if (file < 0) {
 +
        printf("Error: Unable to open I2C bus\n");
 +
        return 1;
 +
    }
 +
   
 +
    printf("The discovered I2C device address:\n");
 +
   
 +
    for (int addr = 0x03; addr <= 0x77; addr++) {
 +
        if (ioctl(file, I2C_SLAVE, addr) >= 0) {
 +
            unsigned char buffer[1];
 +
            if (read(file, buffer, 1) == 1) {
 +
                printf("0x%02X\n", addr);
 +
            }
 +
        }
 +
    }
 +
   
 +
    close(file);
 +
    printf("\nScan completed\n");
 +
return 0;}
 +
</pre>
 +
 
 +
 
 +
*'''Test Results:'''
 +
 
 +
 
 +
[[File:CQRADDR001-85.jpg|700px]]
 +
 
 +
 
 +
After toggling the DIP switch to change the address, power on again.
 
----
 
----
 +
=='''Sensor Does Not Work Properly'''==
 +
 +
'''Answer:'''
 +
 +
*Ensure the sensor wiring is correctly connected to the development board;
 +
 +
*Verify that the board program is properly burned.
  
=='''Sample Code'''==
+
----

Latest revision as of 04:23, 29 January 2026

I2C Address Converter Module

Description

LTC4316 I2C Address Translation Module is a practical I2C bus expansion tool designed to resolve I2C device address conflicts. This module can translate the fixed hardware address of an I2C device into a different communication address, enabling multiple devices with identical addresses to operate simultaneously on the same I2C bus.


Features

  • Efficient Address Conflict Solution: Based on the LTC4316IMS chip, it can translate the fixed hardware address of an I2C device into 127 distinct communication addresses, effectively resolving address conflicts on the I2C bus.
  • Wide Voltage Operating Range: Supports power supply voltages from 2.25V to 5.5V, ensuring compatibility with various logic level systems.
  • Hardware-Level Transparent Translation: Configures address offsets through a resistive voltage divider network and performs real-time address translation, remaining entirely transparent to both master and slave devices.
  • Flexible Address Configuration: Enables independent configuration of the high 3-bit and low 4-bit address offsets via the XORH/XORL pins using resistor voltage division, with support for quick switching via DIP switches.
  • Industrial-Grade Protection Design: Features separate interfaces for the master side (SCLIN/SDAIN) and slave side (SCLOUT/SDAOUT), providing clear signal flow isolation.
  • Standard Interface Compatibility: Equipped with dual interfaces—HY2.0mm 4P connectors and 2.54mm pin headers—for easy connection to various development boards and sensor modules.

Certification Documents

Media:CQRADDR001-CE-Certification.rar

Media:CQRADDR001-FCC-SDOC-Certification.rar

Pin Description and Size

CQRobot.jpg
CQRADDR001-1.jpg
CQRADDR001-2.jpg

Specification

CQRADDR001-3.jpg
CQRADDR001-4.jpg

Working Principle

CQRADDR001-5-1.jpg

Address Configuration

  • The module sets the address conversion value through voltage divider resistors at the XORH and XORL pins.


CQRADDR001-711.jpg


CQRADDR001-721.jpg


  • How to determine the resistance of welding resistor:


First, based on the data sheet, the module determines whether a specific bit in the I2C address is inverted by the voltage of the XORH or XORL pins (i.e., VXORH or VORL relative to VCC). In Table 2 and 3, a bit value of 1 indicates inversion, while 0 indicates no inversion.


CQRADDR001-73.jpg
CQRADDR001-75.jpg


Assuming the VCC is now 5V, set A3-A0 to the 1 0 0 0 mode (A3 inverting while A2-A0 not). This requires VOXRL/VCC to be 0.53125±0.015, general formula: [VCC/(R1+R2)]R1=VXORL.


Given the VCC of 5V and RLB of 100kΩ, the target VXORL should be 0.53125×5V=2.65625V. Substituting all parameters into the formula yields R2 ≈ 88.23529kΩ.


Since this calculated R2 is not the exact common resistance, it should be matched with the closest common resistance value and verified through formula validation.


Under this circumstance, the closest common resistance value to 88.23529kΩ is 86.6kΩ, so VXORL≈2.67953V, or VXORL/VCC≈0.53906. This ratio falls within 0.53125±0.015, making 86.6kΩ a suitable resistance value for RLT.


CQRADDR001-76.jpg

Connections and Examples

CQRADDR001-7.jpg

Arduino Example and Test Code

CQRADDR001-77.jpg

  • Sample Code:


#include <Wire.h>

void setup() {
  Serial.begin(9600);
  Wire.begin();
  Serial.println("Scan available I2C devices:");
}

void loop() {
  for(int addr = 1; addr < 127; addr++) {
    Wire.beginTransmission(addr);
    if(Wire.endTransmission() == 0) {
      if(Wire.requestFrom(addr, (byte)1) > 0) {
        Serial.print("✅ Available devices: 0x");
        if(addr < 16) Serial.print("0");
        Serial.println(addr, HEX);
        while(Wire.available()) Wire.read();
      }
    }
  }
  delay(3000);
}


  • Test Results:


CQRADDR001-78.jpg


Set the serial port to 9600. Open the serial port debugger to view the bidirectional I2C address. After toggling the DIP switch to change the address, power on again. The new address will appear in the serial port debugger.


Raspberry Pi Example and Test Code

First, visit the Raspberry Pi official website to download the system. You must select the download option in the frame below; otherwise, the sensor will not function properly.

CQRADDR001-791.jpg

  • Schematic Diagram of Raspberry Pi 4B pins:

CQRADDR001-80.jpg

CQRADDR001-81.jpg

CQRADDR001-82.jpg

Create a folder and a “.c” file, then write the code.

Media: I2C.rar

You can directly add to the compressed file.

CQRADDR001-83.jpg

gcc -Wall -g -o I2C I2C.c -lm

./I2C

Go to the folder created in the terminal, use GCC cross-compilation and run the file.

  • Sample Code:
include <stdio.h>
#include <stdlib.h>
#include <unistd.h>
#include <fcntl.h>
#include <sys/ioctl.h>
#include <linux/i2c-dev.h>
int main() {
    int file;
    char filename[20];
    
    printf("Scan available I2C devices...\n\n");
    
    snprintf(filename, 19, "/dev/i2c-1");
    file = open(filename, O_RDWR);
    if (file < 0) {
        printf("Error: Unable to open I2C bus\n");
        return 1;
    }
    
    printf("The discovered I2C device address:\n");
    
    for (int addr = 0x03; addr <= 0x77; addr++) {
        if (ioctl(file, I2C_SLAVE, addr) >= 0) {
            unsigned char buffer[1];
            if (read(file, buffer, 1) == 1) {
                printf("0x%02X\n", addr);
            }
        }
    }
    
    close(file);
    printf("\nScan completed\n");
return 0;}


  • Test Results:


CQRADDR001-85.jpg


After toggling the DIP switch to change the address, power on again.


Sensor Does Not Work Properly

Answer:

  • Ensure the sensor wiring is correctly connected to the development board;
  • Verify that the board program is properly burned.