AED 19.95
Low stock
1
Description
The RobotDyn I2C 8-bit I/O Expander Module, featuring the PCA8574AD IC, is a versatile expansion board designed for seamless integration into Arduino and other program development platforms. Utilizing the I2C interface, this module enhances your project's capabilities by providing an additional 8 I/O pins, ultimately extending the functionalities of your electronic applications.
Features:
- I2C Interface: The module is built around the PCA8574AD IC and utilizes the I2C interface. This enables easy integration into Arduino and other program development platforms, allowing for the efficient expansion of I/O pins.
- Multiple I/O Pins: With 8 I/O pins, this module allows for enhanced connectivity and control in your projects. Each pin can be individually addressed, providing flexibility in managing different components.
- Address Configuration: The board features three jumpers that can be used to choose I2C addresses, allowing for successive connection with 8 different addressing options. This flexibility enables control of up to 64 extra I/O pins with eight distinct addresses, making it suitable for complex projects.
- Modular Expansion: Up to 8 modules can be linked in a row, providing the option to use various I2C addresses for each connected module. Each linked module must have a unique I2C address to ensure proper communication.
- Pull-up Resistor Control: The J1 and J2 jumpers on the rear surface of the board allow for the enabling or disabling of pull-up resistors connected to the SDA and SCL pins. This feature enhances compatibility and control over the communication bus.
Specifications:
- Operating Voltage: 5V
- I2C Interface: 8-bit
- Successive Connection: Up to 8 different addressing options
- I/O Pins: 8
- Address Configuration: Jumper-controlled with a table provided on the back of the card
- Pull-up Resistor Control: Enabled or disabled via J1 and J2 jumpers
- Compatibility: Arduino and other platforms
Package Included:
- 1 x RobotDyn I2C 8-bit I/O Expander Module, PCA8574AD
Connection and Programming Instructions:
For Arduino:
- Connect VCC to 3.3 volts, GND to GND.
- To use the default 0x20 address, connect the address selection pins A0, A1, and A2 to GND.
- Connect SCL to A5 on Arduino and SDA to A4 on Arduino.
- Utilize 10K resistors for pull-up on both SCL and SDA buses.
For NodeMCU:
- Connect Pins A0, A1, and A2 to GND.
- SCL is connected to D1, and SDA is connected to D2.
- Utilize 10K resistors for pull-up on both SCL and SDA buses.
Programming:
- A library for this module can be downloaded here.
- Use the provided I2C Scanner code to determine the module's address.
- Additional example code is provided for basic functionality, such as blinking Pin 0 on the module.
The code to be uploaded :
/** * I2CScanner.ino -- I2C bus scanner for Arduino * 2009,2014, Tod E. Kurt, http://todbot.com/blog/ * Modified by Ashish Adhikari: https://www.youtube.com/user/tarantula3 **/ #include "Wire.h" extern "C" { #include "utility/twi.h" // from Wire library, so we can do bus scanning } // Scan the I2C bus between addresses from_addr and to_addr. // On each address, call the callback function with the address and result. // If result==0, address was found, otherwise, address wasn't found // (can use result to potentially get other status on the I2C bus, see twi.c) // Assumes Wire.begin() has already been called void scanI2CBus(byte from_addr, byte to_addr, void(*callback)(byte address, byte result) ) { byte rc; byte data = 0; // not used, just an address to feed to twi_writeTo() for( byte addr = from_addr; addr <= to_addr; addr++ ) { rc = twi_writeTo(addr, &data, 0, 1, 0); callback( addr, rc ); } } // Called when address is found in scanI2CBus() // (like adding I2C comm code to figure out what kind of I2C device is there) void scanFunc( byte addr, byte result ) { Serial.print("ADD: "); Serial.print(addr, HEX); Serial.print( (result==0) ? " found!":" "); Serial.print( (addr%4) ? "\t":"\n"); } byte start_address = 8; // lower addresses are reserved to prevent conflicts with other protocols byte end_address = 200; // higher addresses unlock other modes, like 10-bit addressing void setup(){ Wire.begin(); Serial.begin(9600); // Changed from 19200 to 9600 which seems to be default for Arduino serial monitor Serial.println("\nI2CScanner ready!"); Serial.print("starting scanning of I2C bus from "); Serial.print(start_address, DEC); Serial.print(" to "); Serial.print(end_address, DEC); Serial.println("..."); // start the scan, will call "scanFunc()" on result from each address scanI2CBus( start_address, end_address, scanFunc ); Serial.println("\ndone"); } void loop(){}
Simple code to Blink Pin 0 on the Module:
#include "Arduino.h" #include "PCF8574.h" // Set i2c address you need to be sure about the adress using the I2C scanner code PCF8574 pcf8574(0x39); void setup() { Serial.begin(115200); // Set pinMode to OUTPUT pcf8574.pinMode(P0, OUTPUT); pcf8574.pinMode(P1, INPUT); pcf8574.begin(); } void loop() { pcf8574.digitalWrite(P0, HIGH); delay(1000); pcf8574.digitalWrite(P0, LOW); delay(1000); }