Actions

KAmod I2C-Mini Out 8: Difference between revisions

From Kamamilabs.com - Wiki

Created page with "__jzpdf__ ===== Description ===== <b>KAmod I2C-Mini Out8 - Expander 8 low-power outputs controlled by I2C with MCP23008</b><br> <br> The KAmod I2C-Mini Out8 module contains 8 outputs with low-power N-MOSFET transistors, with a maximum output current of 1 A and a maximum voltage of 50 V. Thanks to the use of the MCP23008 system, control is via the I2C bus. <center> none|900px|thumb|center </center> ===== Basic features and parameters =====..."
 
(No difference)

Latest revision as of 05:48, 4 June 2025

Description

KAmod I2C-Mini Out8 - Expander 8 low-power outputs controlled by I2C with MCP23008

The KAmod I2C-Mini Out8 module contains 8 outputs with low-power N-MOSFET transistors, with a maximum output current of 1 A and a maximum voltage of 50 V. Thanks to the use of the MCP23008 system, control is via the I2C bus.

Basic features and parameters
  • 8 outputs, which in the active state provide ground (GND) of the connected power supply
  • Outputs with a maximum output current of 1 A and a maximum voltage of 50 V
  • Outputs equipped with protective diodes - allow powering small inductive loads, such as relays, solenoid valves, electric motors
  • Contains an expander type MCP23008
  • Control via I2C interface with a clock speed of max. 1 MHz
  • 3 address lines allow connecting 8 modules to one I2C bus
  • Power supply of the control part: 3...5 V; power supply of outputs: 3...50 V



Standard Equipment
Code Description
KAmod I2C-Mini Out8
  • Assembled and started module
  • 1 x straight goldpin header 12-pin raster 2.54 mm
  • 1 x straight goldpin header 8-pin raster 2.54 mm
Schematic


Output Layout


Designation Function
J2, 0...8
  • 8 outputs with active low state (power supply ground, GND)
J2, VCC
  • power supply input of output circuits, positive pole
J2, G
  • output circuit power supply input, negative pole (GND)


The module outputs are led out as solder points with holes, arranged with a standard 2.54 mm pitch, right at the edge of the board. They allow for soldering wires or goldpins. The pin assignment is shown in the figure below.

Each output is built from an N-MOSFET transistor and a protective diode. The active output supplies the power supply ground (G - GND), the inactive output is in a high impedance state (HiZ). The maximum output current cannot exceed 1 A, and the maximum output voltage cannot exceed 50 V. Thanks to the use of a protective diode, the outputs can directly control inductive loads, e.g. relays, solenoid valves, electric motors, if their parameters do not exceed the maximum current or voltage.

The output circuit should be connected to the power supply of the components connected to the outputs - VCC - positive pole, G - negative pole.

Control signals


Designation Function
SD (J1) SDA (data) signal of the I2C interface
SC (J1) SCL (clock) signal of the I2C interface
RST (J1) Input that resets the system
A0, A1, A2 (J1) Inputs that allow you to set the I2C interface address (bits 2, 1, 0). By default, set to logical 0.


The KAmod I2C-Mini Out8 module is controlled via the I2C interface, which can be clocked with a 100 kHz, 400 kHz or 1 MHz clock signal. The functions of the pins on the J1 connector are as follows:

  • The I2C control interface signals are SD – SDA, and SC – SCL. They are not equipped with pull-up resistors – the control system must contain the appropriate elements.
  • Inputs A0, A1, A2 allow you to set the address (bits no. 2, 1 and 0) that the module connected to the I2C interface will have. By default, these inputs are connected to ground via resistors (pull-down) and assume logical 0 values. Connecting the positive power supply to inputs A0/A1/A2 sets logical 1 for the lowest address bits.
  • All available I2C interface addresses are in the range 0x20...0x27.



Detailed information on communication and configuration of the MCP23008 is available in the technical documentation of this system.

Additional signals are:

  • The reset signal (RST) is used to reset the MCP23008 on the KAmod I2C-Mini Out8 board, which restores all settings to their initial state.



Power
Designation Function
  • V+ (J1)
  • GND (J1)
  • control circuit power supply input, positive pole
  • control circuit power supply input, negative pole (GND)
  • VCC (J2)
  • G (J2)
  • power input for output circuits, positive pole
  • power input for output circuits, negative pole (GND)

The control circuit of the KAmod I2C-Mini Out8 module can be powered by a DC voltage of 3...5 V, connected to the V+ and GND pins on the J1 connector.

The output circuit of the KAmod I2C-Mini Out8 module can be powered by a DC voltage of 3...50 V, connected to the VCC and G pins on the J2 connector.



Dimensions

The dimensions of the KAmod I2C-Mini Out8 board are 31x23.5 mm. There are 2 mounting holes on the board with a diameter of 3.2 mm.



Test program

The test program was written in the Arduino environment for the KAmodESP32 POW RS485 board. The KAmod I2C-Mini Out8 module was connected via the I2C interface.

#include <Wire.h>
//#include <Adafruit_MCP23X17.h>
#include <Adafruit_MCP23X08.h>

//LED
#define LED_PIN         2 
#define MY_DELAY        2000
#define TEST_LED_ON     1
#define TEST_LED_OFF    0

//I2C
#define I2C_SDA         33
#define I2C_SCL         32
#define I2C_FREQ        100000
#define MCP23008_ARD    0x20

TwoWire I2Cbus = TwoWire(0);
Adafruit_MCP23X08 MCPIO;
int i;

//-----------------------------------------------------------------
void setup() {
  Serial.begin(115200);
  Serial.println();
  Serial.println("Hello. KAmod I2C Mini Out 8 test");

  pinMode(LED_PIN, OUTPUT);
  digitalWrite(LED_PIN, HIGH);

  delay(500);
  while(!I2Cbus.begin(I2C_SDA, I2C_SCL, I2C_FREQ)){
    Serial.println("I2C init failed...");
    delay(500);
  }
  while (!MCPIO.begin_I2C(MCP23008_ARD, &I2Cbus)) {
    Serial.println("MCP init failed...");
    delay(500);
  }

  Serial.println("I2C init OK");
  delay(100);
}

//-----------------------------------------------------------------
void loop() {
  if (i & 1){
    digitalWrite(LED_PIN, TEST_LED_ON);
  } else {
    digitalWrite(LED_PIN, TEST_LED_OFF);
  }
  
  Serial.print("Out: ");
  Serial.println(i);

  MCPIO.pinMode(i, OUTPUT);
  MCPIO.digitalWrite(i, TEST_LED_ON);
  delay(100);
  MCPIO.pinMode(i, OUTPUT);
  MCPIO.digitalWrite(i, TEST_LED_OFF);
  delay(100);
  
  i++;
  if (i  >= 8){
    i = 0;
  }
}



Links