Official Hobby Components Online Store | Buy Electronic Kits, Components, Boards, Shields, Modules

Shift Register vs I2C Expander: Adding Outputs to Arduino

Shift Register vs I2C Expander: Adding Outputs to Arduino

By Official Hobby Components Online Store | Buy Electronic Kits, Components, Boards, Shields, Modules | Published: 2026-10-16

Category: Comparisons

Compare the 74HC595 shift register and I2C port expanders like the PCF8574 for Arduino pin expansion, with clear trade-offs and when to use each.

Quick Answer

If you need many simple on/off outputs and want the lowest cost per pin, use a 74HC595 shift register. If you need a few outputs and want to save microcontroller pins, use an I2C expander like the PCF8574. The trade-off is pin count versus wiring simplicity and current drive.

How the 74HC595 Shift Register Works

The 74HC595 is an 8-bit serial-in, parallel-out shift register. You send data one bit at a time using three microcontroller pins: data, clock, and latch. Once latched, the eight outputs hold their state until you update them again. This makes it ideal for driving LEDs, relays, or other low-current loads. Because it is a shift register, you can chain multiple chips to add 8, 16, 24, or more outputs while still using only three microcontroller pins. The 74HC595 can source or sink enough current for standard LEDs, but for higher-power loads you will need a driver like a transistor or a dedicated driver IC. The DIP-16 package is breadboard-friendly, and our 74HC595 8 bit Serial Shift Register (DIP 16) (Pack of 5) gives you five chips for under $1.40, which is a very low cost per output.

How I2C Port Expanders Work

I2C port expanders like the PCF8574 communicate over the two-wire I2C bus (SDA and SCL). Each expander has a unique I2C address, so you can connect several on the same bus without using extra pins. The PCF8574 provides 8 quasi-bidirectional I/O pins, but they are not true push-pull outputs; they can sink current but source very little. That makes them better for inputs or for driving loads that need a low signal, such as pulling a transistor base low. Because I2C is a bus, wiring is simpler: just two wires for data plus power and ground. However, the trade-off is speed and current capability. I2C is slower than the shift register's serial interface, and the limited source current means you often need external drivers for LEDs or relays. Also, each I2C device needs a unique address, so you can only have a limited number on one bus.

Key Differences: Speed, Current, and Pin Cost

The 74HC595 wins on speed and current drive. It can be updated very quickly, making it suitable for multiplexing or PWM-like effects if you toggle the latch rapidly. Its outputs can source or sink enough current for standard LEDs directly. The I2C expander is slower and has weaker output drive, but it uses only two microcontroller pins total, regardless of how many expanders you chain. The shift register uses three pins per chain, but you can chain many chips without address conflicts. Cost per output is lower with the 74HC595, especially when you buy packs like the 5-pack we offer. For I2C expanders, the cost per pin is higher, and you may need additional driver components for loads that require more current.

Practical Wiring and Code Considerations

Wiring a 74HC595 is straightforward: connect VCC and GND, then connect SER (data) to a microcontroller pin, SRCLK (clock) to another, and RCLK (latch) to a third. You can daisy-chain by connecting Q7' of one shift register to SER of the next. For I2C expanders, connect SDA and SCL to your microcontroller's I2C pins, and set the address pins to avoid conflicts. In code, the 74HC595 uses shiftOut() or SPI, while the PCF8574 uses Wire library commands. If you need to read inputs, the PCF8574 can do that, but the 74HC595 cannot read; it is output-only. That is a key limitation: if your project needs both inputs and outputs, you might need a different expander or a combination.

When to Choose Each Option

Choose the 74HC595 when you need many outputs, fast updates, and direct LED drive. It is perfect for LED matrices, 7-segment displays, or driving many relays through a driver. Choose an I2C expander when you are short on microcontroller pins and need only a few outputs, or when you want to add inputs as well. I2C is also better when you have multiple devices on the same bus and want to minimize wiring. If you need to drive motors, consider a dedicated shield like the Motor Drive Shield L293D for Arduino, which handles the current and provides a convenient interface. For simple status indicators, a few 3mm Diffused LED (White) driven directly from a 74HC595 or through a transistor from an I2C expander can work well. And if you are prototyping with DIP chips, a Black, 28 Pin ZIF Socket makes swapping ICs easy and reduces pin damage.

Trade-offs at a Glance

  • Pin cost vs. wiring simplicity: 74HC595 uses 3 microcontroller pins per chain but can add many outputs cheaply. I2C expanders use only 2 pins total but cost more per output and have address limitations. Choose shift register for many outputs; choose I2C for few outputs and minimal pins.
  • Output current and speed: 74HC595 can source/sink enough current for LEDs and updates quickly. I2C expanders have weak source current and slower update rates. For direct LED drive or fast updates, use 74HC595. For low-current signals or inputs, I2C is fine.
  • Input capability: 74HC595 is output-only. I2C expanders like PCF8574 can read inputs, but with quasi-bidirectional pins. If you need inputs, an I2C expander is more flexible; otherwise, shift register is simpler for outputs.

Product Facts

  • 74HC595 8 bit Serial Shift Register (DIP 16) (Pack of 5): Contains 5 74HC595 8 bit Serial Shift Register (DIP 16) ICs. Datasheet is available on our support forum here. Please note that the manufacturer of this chip is subject to change. Five shift registers give you up to 40 outputs for a very low cost, and the DIP package is easy to breadboard. The datasheet helps you verify pinout and timing.
  • Motor Drive Shield L293D for Arduino: This Motor Drive Shield L293D for Arduino is designed to help you add motor control to your projects. It provides two interfaces for 5V servos, connected to the Arduino's high-resolution dedicated timer, allowing for precise servo operation. Compatible with Arduino Uno boards (board not included). Includes two 5V servo interfaces for your project needs. If your project needs to drive motors or servos, this shield handles the current and provides a neat interface, so you do not need to build a driver from discrete components.
  • 3mm Diffused LED (White): Standard high quality 3mm white LED in a white diffused / frosted package. Suitable for power and status indicators, back-lighting, message displays, 3D cubes, etc. Price is based on one (1) LED. The more you buy, the lower the cost drops. These LEDs are ideal for testing your new outputs. The diffused package gives a soft glow, and the price drops with quantity, so you can buy enough for a full project.
  • Black, 28 Pin ZIF Socket: These ZIF, or Zero Insertion Force sockets incorporate a lever which actuates the zero insertion force (ZIF) mechanism to help reduce damage to devices. These 2.54mm DIP sockets provide an excellent test and burn-in interface for dual in-line packages with a 2.54mm pitch and body width of 0.3. If you are swapping 74HC595 chips or other DIP ICs during prototyping, a ZIF socket prevents bent pins and makes testing easier.

Which Should You Use?

Best for

  • Projects needing many outputs (LEDs, relays) on a budget
  • Fast updating requirements like multiplexing or PWM
  • Direct drive of low-current loads without extra transistors

Not for

  • Projects that need to read inputs (choose I2C expander)
  • When you must minimize microcontroller pins to just two
  • High-current loads without additional drivers

Shop Related Products

Motor Drive Shield L293D for Arduino

Motor Drive Shield L293D for Arduino

$1.41 $2.08

Shop Now
74HC595 8 bit Serial Shift Register (DIP 16) (Pack of 5)

74HC595 8 bit Serial Shift Register (DIP 16) (Pack of 5)

$1.35 $1.82

Shop Now
3mm Diffused LED (White)

3mm Diffused LED (White)

$0.30 $0.41

Shop Now
Black, 28 Pin ZIF Socket

Black, 28 Pin ZIF Socket

$0.56 $0.91

Shop Now