Quick answer
Start with pin count and pitch, not brand. For Raspberry Pi 40-pin GPIO, a 2x20 2.54mm IDC female header is the direct fit. For generic board-to-board runs, choose the ribbon cable connector type that matches your header gender and strain relief needs. If you are wiring one-off signals, Dupont jumpers are simpler; IDC wins when you need many conductors terminated in one motion.
Pin count and pitch: the two numbers that decide everything
IDC systems are standardized around pitch, the center-to-center distance between pins. The common hobby pitch is 2.54mm, which matches most Arduino, Raspberry Pi, and prototyping headers. A 2x20 layout gives 40 pins in two rows and is the standard Raspberry Pi GPIO footprint. If your board has 40 pins in two rows, you want a 40 way IDC connector, not a 1x40 strip.
Count the pins on the mating header before ordering, and measure pitch with calipers if the board is not clearly documented. A 2.54mm IDC connector will not seat on a 2.0mm or 1.27mm header, and forcing it bends pins. When a datasheet is missing, treat pitch as unknown and verify physically rather than guessing.
Ribbon cable connector types and termination
Ribbon cable connectors come in female socket, male pin, and edge-card styles. Female IDC sockets are the usual choice for plugging onto a board header. Male IDC headers are used when the ribbon must terminate in a pin field. The termination method matters as much as the shell: mass-termination IDC connectors press all conductors into insulation-displacement slots at once, which is fast but requires the correct tool and cable pitch.
For a reliable crimp, use an IDC crimp tool sized to your connector and cable pitch. A bench vise with flat jaws can work in a pinch, but uneven pressure causes intermittent contacts that are hard to diagnose later. Ribbon cable pitch must match the connector: 2.54mm connectors take 1.27mm pitch ribbon, where conductors sit on 1.27mm centers. Mixing pitches produces misaligned conductors and scrap.
IDC vs Dupont connectors: pick by conductor count and vibration
Dupont jumpers are individual wires with friction-fit housings. They are ideal for one-off signals, breadboards, and quick rework because you can move a single wire without disturbing the rest. IDC is a single assembly that terminates many conductors at once and provides strain relief when the connector is latched or mated correctly.
Choose IDC when you have 10 or more conductors running between two fixed points, when the cable will be handled repeatedly, or when you want a keyed, polarized connection that cannot be plugged in backwards. Choose Dupont when you expect to change pin assignments often, when you need to tap a single signal, or when the run is short and temporary. A common mistake is using Dupont for a 40-pin display or GPIO ribbon, then chasing intermittent faults caused by individual wire movement.
Power and signal runs: keep them separate
Ribbon cable is convenient but not shielded. Keep motor and high-current switching wires physically separated from signal ribbons, and cross at right angles when they must meet. For low-current DC power links, a 2.1mm DC power male plug connector with solder connections gives a secure, repairable joint on a pigtail, while the ribbon handles logic signals. For short speaker or low-current runs, 2 core multi-strand speaker cable is more flexible than ribbon and easier to route around corners.
Match current capacity to the conductor, not the connector shell. A 40 way IDC connector may have 40 contacts, but the ribbon conductors and your power source set the real limit. If a run carries more than a few hundred milliamps, use dedicated power wire rather than spare ribbon conductors.
Shields and stacking: plan the header height before you buy
When you stack a shield on an Arduino Uno, the shield's own headers set the mating height. A Motor Drive Shield L293D for Arduino is compatible with Arduino Uno boards and provides two 5V servo interfaces, so plan your IDC or Dupont runs around those servo headers and the shield's pin field. If you add a 40 way IDC female header on top of an existing stack, check overall height first: the 40 way IDC double female header is 19.5mm overall with 11mm pins, which affects clearance inside an enclosure.
For Raspberry Pi projects, the 40 way IDC double female header is suitable for models with a 40-pin GPIO header and gives you a removable ribbon interface. That is useful when the Pi sits in a case and the ribbon exits to a breakout or HAT. Measure your enclosure depth against the 19.5mm height before committing.
Decision rules for IDC headers and ribbon cables
- Rule 1: Match pin count and pitch first: Count pins and confirm 2.54mm pitch before ordering. For a 40-pin Raspberry Pi GPIO header, use a 40 way (2 x 20) IDC connector. If pitch is undocumented, measure it; do not assume 2.54mm. Wrong pitch is the most common IDC ordering error and cannot be fixed by force.
- Rule 2: Choose termination by volume and rework: Use mass-termination IDC with the correct IDC crimp tool when terminating 10 or more conductors at once. Use Dupont when you need to move individual wires or change pinouts often. If you will re-pin the connector more than twice, Dupont is usually the better choice.
- Rule 3: Match ribbon pitch to connector pitch: 2.54mm IDC connectors require 1.27mm pitch ribbon cable. Check the ribbon marking or measure conductor spacing before crimping, and keep a spare length for mistakes. One mismatched crimp wastes both the connector and the cable section.
- Rule 4: Separate power from signal: Run DC power on dedicated wire such as a 2.1mm DC power plug pigtail or 2 core speaker cable, and keep it physically apart from signal ribbons. Cross at right angles when paths must meet. Ribbon is unshielded; routing discipline prevents noise faults.
- Rule 5: Check height and strain relief before final assembly: Confirm overall header height (for example 19.5mm on the 40 way IDC double female header) against your enclosure, and secure the ribbon so the connector, not the solder joints, takes any pull. Measure once before closing the case; rework after assembly is slower.
Product facts to check before ordering
- 40 Way (2 x 20) IDC Double Female Header: 40 way (2 x 20) IDC double female header with 2.54mm pitch, 19.5mm overall height, 11mm pins, and 40 pins in two rows; suitable for Raspberry Pi models with a 40-pin GPIO header. This is the direct-fit part for a 40-pin Raspberry Pi GPIO ribbon, and the 19.5mm height is the number to check against your enclosure or stacking clearance.
- 2.1mm DC Power Male Plug Connector: 2.1mm DC power male plug connector made from plastic and metal, with solder connections for reliable electrical contact, designed for DC power applications. Use it for a soldered DC power pigtail rather than running power through ribbon conductors, which keeps signal and power paths separate.
- 2 Core Multi-strand Speaker Cable: 2 core multi-strand speaker cable, 0.33mm2 CSA, 2.5A max, white sheath, ribbed polarity, sold in 1 meter multiples. A flexible alternative for low-current power or speaker runs where ribbon cable is too stiff or you need polarity marking; 2.5A max sets a clear current ceiling.
- Motor Drive Shield L293D for Arduino: Motor Drive Shield L293D for Arduino, compatible with Arduino Uno boards (board not included), with two 5V servo interfaces connected to the Arduino's high-resolution dedicated timer. Plan IDC or Dupont runs around the shield's pin field and two servo headers, and keep motor wiring away from signal ribbons.
Is IDC right for your project?
Best for
- Raspberry Pi 40-pin GPIO breakouts and HATs that need a removable ribbon interface
- Board-to-board runs with 10 or more conductors between fixed points
- Projects that benefit from a keyed, polarized connector and strain relief
- Builds where you want to terminate many conductors in one crimp operation
Not for
- Breadboard prototyping where pin assignments change frequently; use Dupont jumpers
- Single-signal taps or short temporary runs where an individual wire is easier
- High-current power distribution; use dedicated power wire and connectors instead of ribbon conductors
- Boards with undocumented or non-2.54mm pitch headers until you measure and confirm the pitch






