

That should complete your hardware setup. I have powered my Uno from an external 5v power supply, as I did not want to pull too much current from the regulator on the actual Uno clone.Also, connect the other leg of the LED to ground. Now connect 4 LEDs, through a suitable resistor ( 640 ohms up to 1k ohm ) to pin P0 and P1 on both of the PCF8574 IO extenders.Connect all 5v (Vcc) lines to 5v on the Arduino, and all Ground (GND) lines to GND on the Arduino.I chose to use that as well as A4 and A5, as the bus hung itself up when connected to the breadboard. Connect all SCL pins on the I2C devices together serially, and connect that to the Arduino SCL pin ( That is usually A5)Ī note: On my Uno clone, there is an additional I2C breakout at the top of the device, near the USB adapter.Connect all SDA pins on the I2C devices together serially, and connect that to the Arduino SDA pin ( That is usually A4).I suspect that that is due to the fact that they may already be included on some of my devices. The amount of stray capacitance floating around on the breadboards, and small momentary push-button switches, made for a very impressive but unreliable mess of wires, with no real learning value to it 😉 Maybe some more on that later when I do a decent real-world example using these technologies 🙂Īs the total distance between the devices is relatively short, it was not necessary to use pull-up resistors on the I2C bus in my setup. With DuPont wires and breadboards being the reliable things they are, I decided that, after initial testing, I will not show you how to do button inputs on the PCF8574 at this stage. Wire.h and PCF8574.h to control the I2C IO extenders andĪdafruit_GFX, Adafruit_SSD1306.h and SPI.h to control the SSD1306 128×32 OLED display. LiquidCrystal_I2C.h to control the LCD screen, This will be an extremely short post, as it builds on skills that we have already covered.Ģx PCF8574 I2C Io Extenders address 0x20 and 0x21Īll of these devices will be controlled from Arduino Uno, using the following libraries Today I will continue my series on I2C by showing you how to use multiple devices on the I2C bus.
