Home / Arduino & Microcontrollers / I2C vs SPI: Choosing and Using Both on Arduino

I2C vs SPI: Choosing and Using Both on Arduino

Arduino & Microcontrollers ✍ Oliver Adam ⏱ 8 min read August 11, 2026

I²C and SPI are the two workhorse buses for attaching peripherals. I²C uses two shared lines and addresses; SPI uses more wires but runs faster and simpler. Most component modules you buy speak one of them often both options on the same board.
> At a glance: 8 minute guide · part 5 of 10 in the complete Arduino guide track · includes a worked example and a quick-reference table.

## I2C: two wires, addressed devices

Here is the working theory in one pass. SDA (data) and SCL (clock) connect every device in parallel, each with a 7-bit address. Pull-up resistors (typically 4. 7 kΩ) are required most modules carry them. Speeds run 100–400 kHz, fine for sensors and small displays. Address conflicts are the classic headache: two devices claiming 0x3C collide.

| P | r | o | p | e | r | t | y |
| — | — | — | — | — | — | — | — |
| I | 2 | C | | | | | |
| S | P | I | | | | | |
| Wires | 2 (SDA, SCL) + shared pull-ups | 4 + one CS per device | | | | | |
| Typical speed | 100–400 kHz | 1–20 MHz | | | | | |
| Device selection | 7-bit address | Dedicated CS line | | | | | |
| Address conflicts | Possible | None | | | | | |
| Best for | Sensors, RTC, small OLED | SD cards, TFT displays, flash | | | | | |

## SPI: four wires, selected devices

What this means at the bench: MOSI, MISO, SCK and one chip-select (SS) line per device. No addressing overhead pulling a device’s CS low simply selects it. SPI typically clocks at megahertz rates, which is why SD cards and TFT screens prefer it. More devices means more CS pins to budget.

## Choosing in practice

Prefer I2C for a handful of low-rate sensors where wiring economy matters. Prefer SPI when throughput matters or several identical devices would clash in address space. Level-shift between 5 V and 3. 3 V parts in either case these buses are not forgiving of over-voltage.

## How to apply this in your build

Work through the sequence below each step assumes the previous one passed. For numbers that need calculating, the linked tools at the end of this guide do the arithmetic instantly.
1. Check the module’s bus type and voltage before wiring
2. Wire the bus pins plus pull-ups for I2C or CS for SPI
3. Scan I2C addresses (scanner sketch) to detect conflicts
4. Test each device alone before combining on one bus

### Worked example

An OLED at address 0x3C and a BME280 also defaulting to 0x76 coexist fine on I2C. Two OLEDs at 0x3C force one to a jumper-selected alternate address or a move to SPI. Run the numbers yourself with the related calculator and the result should agree to within rounding.

> Practical note from the bench. On the Procirel bench, the I2C address scanner sketch lives permanently on a test Arduino it diagnoses half of all “dead sensor” reports in seconds.

## Field mistakes we see again and again

– Omitting pull-up resistors on bare I2C parts
– Mixing 5 V and 3.3 V devices without level shifting
– Running long I2C wires capacitance kills the clock

## Key takeaways

I2C: two wires, addressed devices the foundation of this guide; revisit it if any measurement here surprises you.
SPI: four wires, selected devices the foundation of this guide; revisit it if any measurement here surprises you.
Choosing in practice the foundation of this guide; revisit it if any measurement here surprises you.

## Who this guide is for

Beginners get a single focused topic instead of a whole textbook chapter. It assumes the track’s earlier pages in the complete Arduino guide path. Intermediate readers use it as a reference the table, the worked example and the mistake list answer the questions that come up mid-build. If you teach, the structure (theory, application, example, failure modes) maps cleanly onto a lab session.

## What you need before starting

Nothing exotic: the parts or tools named in the guide, a multimeter. A notebook for the numbers. Check the module’s bus type and voltage before wiring before you begin the guide assumes it and keep the quick-reference table above within sight while you work through the steps.

### Quick reference card

| Aspect | Where to find it in this guide |
| — | — |
| Core theory | I2C: two wires, addressed devices |
| Application steps | How to apply this in your build |
| Worked numbers | Worked example |
| Failure modes | Field mistakes we see again and again |

## How this fits the complete Arduino guide track

This guide is one stop in the structured learning path. Start from the [complete Arduino guide](/tutorial/arduino-complete-guide) pillar page for the full map, or continue with [serial debugging techniques](/tutorial/arduino-serial-communication) and [driving LCD and OLED displays](/tutorial/arduino-lcd-oled-displays).

## Frequently asked questions

Can I mix I2C and SPI devices on one Arduino?
Yes the buses are independent; each keeps its own pins and libraries.

Why does my I2C scanner find nothing?
Usually missing pull-ups, swapped SDA/SCL, or wrong voltage check wiring before suspecting the part.

Where do I go next?
Back to the [complete Arduino guide](/tutorial/arduino-complete-guide) pillar page it indexes every guide in this track and updates as new ones are published.

## Continue this track

– Building a foundation? The [arduino & microcontrollers complete guide](/tutorial/arduino-complete-guide) maps every step in order.
– Next: [Arduino GPIO: Pin Capabilities, Limits and Safe Usage](/tutorial/arduino-gpio-pinout-guide)
– Next: [How I Built an AI Robot with Arduino UNO Q](/tutorial/arduino-uno-q-robot)
– Next: [Powering Arduino Projects: USB, Battery and Supply Design](/tutorial/powering-arduino-projects)
– Work the numbers: [LED resistor finder](/tools/led-resistor) · [battery runtime estimator](/tools/battery-life) · [555 timer frequency tool](/tools/timer-555-astable)

## Measurement discipline

Keep a lab notebook entry for every build in this track. The measured values, the deviations from the guide and the reason for each. Six months from now, those notes are worth more than any tutorial. They describe your bench and your components rather than a general case.

When a result here disagrees with your expectation, write down both numbers before changing anything. The gap between predicted and measured is where the real engineering lives. It is usually a tolerance, a parasitic or an assumption that was never checked.
## Formulas and checks from this guide

Verification checklist for this track. Check pin assignments against the sketch header before wiring, confirm supply polarity twice. Serial-print one variable at a time when debugging. Keep each sketch’s pin map in a comment block so the next build inherits working documentation.

Bookmark this page against your next build in the track. The checklist above is the same one used across 15 guides in this series.

## Hard-won notes

Uninitialised variables and pins left floating. Set every pinMode and initial state in setup.

Anything with motors, servos or many LEDs needs external supply with common ground. USB is for logic only.