Same-day dispatch before 2 PM · Free delivery over ₹999 · GST invoices Get the appPrices incl. GST
Geekobot
Snap & SendNEWGeeko AIWhere's myOrder
Log in
Products
  • Projects
    • Component guidesHow parts work, with code you can run
    • Learning pathsFrom your first LED to your first robot
    • Workshops & eventsOnline sessions for makers and classes
    • ElectrolarkFree guided builds, simulator and certificates
    • Students & teachersStudent discount and classroom help
    • CommunityShare builds and ask other makers
    • CalculatorsOhm's law, LED resistor, 555 and 100+ more
    • Circuit builderWire parts and run the circuit, powered by Electrolark
    • Geeko AIAsk what to buy or how to wire it
    • Snap & SendPhotograph a part or list, we find it
    • Part finderAnswer a few questions, get the right part
    • Compatibility checkWill these two parts work together?
    • Compare partsSpecs side by side
    • Business & bulk ordersGST invoices, credit and volume prices
    • Request a quotationSend your list, get a quote
    • Classroom kitsPer-student kits and lab bundles
    • Gift cardsFor students, teams and events
  • Atal Tinkering Lab
BOM to cart
Geekobot

Components, kits and know-how for makers, students, engineers, labs and businesses across India.

Ask Geeko AIOrders, parts and projects, any timeEmail supportReply within 1 working dayGet the Geekobot appAdd it to your home screen, free

Follow us

Shop

  • Boards & SBCs
  • Sensors & Modules
  • IoT & Wireless
  • Drone & FPV
  • 3D Printing
  • Filaments & Resins
  • Motors & Drivers
  • Power & Batteries
  • Semiconductors
  • Passive
  • Displays & LEDs
  • Switches & Relays
  • Wires & Cables
  • Prototyping
  • Tools & Test
  • Robotics
  • STEM Kits
  • Atal Tinkering Lab
  • Mechanical Parts
  • Audio

Orders

  • Track your order
  • Help & support
  • Shipping and delivery
  • Refunds and cancellation
  • Contact us

Learn

  • Projects
  • Geeko AI project assistant
  • Learning paths
  • Guides
  • Calculators
  • Electrolark: free guided builds

Part tools

  • Part finder
  • Compare parts
  • Will it work with my board?

Institutions

  • Classroom kits
  • Atal Tinkering Lab
  • Students & teachers
  • Workshops & Events

Business

  • Business & education
  • Request a quotation
  • BOM bulk upload
  • Quick order by SKU

Company

  • About Geekobot
  • Community
  • Gift cards
  • Terms & conditions
  • Privacy policy
  • Product directory
  • Sitemap

© 2026 Geekobot, a trade name of OLatus Systems Private Limited. All rights reserved.

20, 1st Floor, Neeladri Complex, 10th Cross, Sampige Rd, 2nd Main, Malleshwaram, Bengaluru, Karnataka 560003 · GSTIN 29AACCO0462F1ZM

+91 91810 15607 · connect@geekobot.in · Monday to Saturday, 10 AM to 2 PM IST

UPI · CARDS · NETBANKING · GST INVOICES

ShopProjectsGeeko AIGuides
Compare 0 parts →
Log in

Shop by category

Shop all components
  • Boards & SBCs1,910 products
    • Alternative Single Board Computers
    • Arduino Ecosystem
    • FPGA & Logic Boards
    • Microcontroller & Wireless Boards
    View all
  • Sensors & Modules4,701 products
    • Biomedical & Heart Rate
    • Current, Voltage & Power
    • Force, Weight & Pressure
    • Gas, Weather & Environmental
    View all
  • IoT & Wireless2,314 products
    • RF Modules
    • RFID & NFC
    • Antennas & RF Accessories
    • Cameras & Smart Vision
    View all
  • Drone & FPV3,558 products
    • Flight Control & Navigation
    • FPV Video & Optics
    • Frames & Structural Parts
    • Motors & Propulsion
    View all
  • 3D Printing2,204 products
    • 3D Printers
    • 3D Scanners & Digitizers
    • Laser Engravers & Cutters
    • Material Management & Upgrades
    View all
  • Filaments & Resins1,472 products
    • Filaments
    • Photopolymer Resins
    View all
  • Motors & Drivers463 products
    • BLDC Motor Drivers
    • DC & Geared Motors
    • DC Motor Drivers
    • Linear Actuators & Solenoids
    View all
  • Power & Batteries557 products
    • Battery Holders & Connectors
    • Breadboard Power
    • Chargers & BMS
    • DC-DC Converters
    View all
  • Semiconductors295 products
    • Diodes & Rectifiers
    • Interface & RF Encoder ICs
    • Logic ICs (74xx)
    • Logic ICs (CD4000)
    View all
  • Passive67 products
    • Capacitors
    • Circuit Protection
    • Crystals & Oscillators
    • Inductors
    View all
  • Displays & LEDs572 products
    • 7-Segment & Dot Matrix
    • Addressable LEDs
    • Character LCDs
    • Graphic LCDs
    View all
  • Switches & Relays184 products
    • Keypads & Touch
    • Push Buttons & Tactile
    • Relay Modules
    • Relays
    View all
  • Wires & Cables233 products
    • Board-to-Wire Connectors
    • Crimp & Splice
    • Headers & Dupont
    • Heat Shrink & Sleeving
    View all
  • Prototyping101 products
    • Breadboards
    • Interface Modules
    • PCBs & Perfboards
    View all
  • Tools & Test717 products
    • Bench Power Supplies
    • Hand Tools
    • Measuring Tools
    • Meters & Testers
    View all
  • Robotics180 products
    • Humanoid & Legged Robots
    • Robot Chassis & Platforms
    • Robotic Arms & Grippers
    • Wheels & Casters
    View all
  • STEM Kits268 products
    • Arduino Learning Kits
    • Coding & IoT Kits
    • Early Coding (Ages 3-8)
    • Invention Kits
    View all
  • Atal Tinkering Lab196 products
    • Package 1: Electronics, Robotics, IoT and Sensors
    • Package 2: Rapid Prototyping Tools
    • Package 3: Mechanical, Electrical and Measurement Tools
    • Package 4: Power Supply, Accessories and Safety Equipment
    View all
  • Mechanical Parts212 products
    • Bearings
    • Brackets & Mounts
    • Couplers
    • Fasteners & Standoffs
    View all
  • Audio109 products
    • Amplifier Modules
    • Buzzers & Sirens
    • Speakers
    View all
  1. Home
  2. ›Guides
  3. ›Electronics Fundamentals
  4. ›SPI Explained
Step 12 of 16 in Arduino from zeroPart of a learning path.
Next

Concept explainer · Intermediate · 3 min read

SPI Explained

Pins, Modes and Wiring Several Devices

By Geekobot Learning Team · Updated 24 Oct 2026

On this page
Short answerHow SPI worksSPI pins on common boardsSPI modes and speedSPI vs I2C vs UARTWiring tips for multiple devicesTry itCommon mistakesFAQsParts and next steps
Short answer

SPI (Serial Peripheral Interface) is a fast four-wire bus: SCK carries the clock, MOSI carries data from the controller, MISO carries data back, and a separate chip-select (CS) line per device chooses who is listening. It runs at several to tens of megahertz, much faster than I2C, which is why displays, SD cards and radio modules use it. Share SCK, MOSI and MISO between devices and give each device its own CS pin.

Key specs at a glance

Wires
SCK, MOSI (COPI/SDO), MISO (CIPO/SDI), CS (SS), plus GND
Speed
Typically 1 to 80 MHz depending on chip and wiring
Duplex
Full duplex: sends and receives at the same time
Modes
0 to 3, set by clock polarity (CPOL) and phase (CPHA)
Devices
One CS line per device, active LOW
Distance
Short: on-board or under about 30 cm of wire
01

How SPI works

The controller pulls a device's CS pin LOW to select it, then toggles SCK. On each clock pulse one bit goes out on MOSI and one bit comes back on MISO, so sending a byte also receives a byte. When the transfer ends, CS goes HIGH and the device ignores the bus again. There are no addresses, acknowledgements or start bits: the protocol inside each transfer is defined by the device's datasheet. Newer documents call the pins COPI (controller out, peripheral in) and CIPO; on modules you will also see SDI/SDO, DIN/DOUT or SDA/SCL on displays (still SPI).

02

SPI pins on common boards

BoardSCKMOSIMISODefault CS
Arduino Uno / Nano13111210
Arduino Mega 256052515053
ESP32 (VSPI)1823195
ESP32-C3 (typical)4657
Raspberry Pi Pico (SPI0)GP18GP19GP16GP17
Raspberry Pi (SPI0)GPIO 11GPIO 10GPIO 9GPIO 8 (CE0)
Arduino Uno / Nano
SCK:
13
MOSI:
11
MISO:
12
Default CS:
10
Arduino Mega 2560
SCK:
52
MOSI:
51
MISO:
50
Default CS:
53
ESP32 (VSPI)
SCK:
18
MOSI:
23
MISO:
19
Default CS:
5
ESP32-C3 (typical)
SCK:
4
MOSI:
6
MISO:
5
Default CS:
7
Raspberry Pi Pico (SPI0)
SCK:
GP18
MOSI:
GP19
MISO:
GP16
Default CS:
GP17
Raspberry Pi (SPI0)
SCK:
GPIO 11
MOSI:
GPIO 10
MISO:
GPIO 9
Default CS:
GPIO 8 (CE0)
03

SPI modes and speed

Devices differ in whether the clock idles low or high (CPOL) and whether data is read on the first or second clock edge (CPHA). That gives modes 0 to 3; most sensors, SD cards and displays use mode 0. Set the mode, bit order and speed for each device with a transaction, which also lets devices with different settings share a bus.

Read a register over SPI on Arduino · Arduino C++Verify & upload in Electrolark
#include <SPI.h>
const int CS = 10;

void setup() {
  Serial.begin(115200);
  pinMode(CS, OUTPUT);
  digitalWrite(CS, HIGH);
  SPI.begin();
}

uint8_t readRegister(uint8_t reg) {
  SPI.beginTransaction(SPISettings(1000000, MSBFIRST, SPI_MODE0));
  digitalWrite(CS, LOW);
  SPI.transfer(reg | 0x80);         // many sensors: top bit set = read
  uint8_t value = SPI.transfer(0x00);
  digitalWrite(CS, HIGH);
  SPI.endTransaction();
  return value;
}

void loop() {
  Serial.println(readRegister(0x0F), HEX);   // e.g. a WHO_AM_I register
  delay(1000);
}
04

SPI vs I2C vs UART

SPII2CUART
Wires4 + one CS per device2 shared2 per link (TX, RX)
SpeedFast: MHz to tens of MHz100 kHz to 1 MHz9600 to about 1 Mbaud
DevicesMany, each with a CS pinUp to about 100 by addressOne to one
Typical usesDisplays, SD cards, radios (nRF24L01, LoRa), fast ADCsSensors, OLEDs, RTCs, port expandersGPS, Bluetooth, GSM, debug console
Wires
SPI:
4 + one CS per device
I2C:
2 shared
UART:
2 per link (TX, RX)
Speed
SPI:
Fast: MHz to tens of MHz
I2C:
100 kHz to 1 MHz
UART:
9600 to about 1 Mbaud
Devices
SPI:
Many, each with a CS pin
I2C:
Up to about 100 by address
UART:
One to one
Typical uses
SPI:
Displays, SD cards, radios (nRF24L01, LoRa), fast ADCs
I2C:
Sensors, OLEDs, RTCs, port expanders
UART:
GPS, Bluetooth, GSM, debug console
05

Wiring tips for multiple devices

  • ✓Give each device its own CS pin and keep every unused CS HIGH, ideally with a 10 kΩ pull-up so devices stay quiet during boot.
  • ✓Keep wires short. Above a few megahertz, long jumper wires cause errors; lower the speed when debugging.
  • ✓Some SD card modules never release MISO, which blocks other devices. Use a module with a proper buffer, or a separate SPI bus (ESP32 and Pico have two).
  • ✓Match logic levels: many SPI modules are 3.3 V only. See logic level shifting.
  • ✓Read about the other buses in the I2C and UART guides.
06

Try it: UART, I²C and SPI transfer time calculator

Change the values and the diagram and results update as you type.

07

Common mistakes to avoid

  • !Forgetting to set CS as an OUTPUT and HIGH at start-up.
  • !Using the wrong SPI mode for a device.
  • !Running long wires at high clock speeds.
  • !Sharing a bus with an SD module that holds MISO.
  • !Connecting 5 V SPI signals to a 3.3 V-only module.
08

Frequently asked questions

What does SPI stand for?

Serial Peripheral Interface, a synchronous serial bus that uses a clock line, two data lines and a chip-select line per device.

Is SPI faster than I2C?

Yes, typically ten to a hundred times faster, because it has separate data lines, push-pull outputs and no addressing overhead.

How many devices can be on an SPI bus?

As many as you have chip-select pins, since each device needs its own CS line. Some devices can also be daisy-chained.

What are MOSI and MISO?

MOSI (controller out, peripheral in) carries data from the microcontroller to the device; MISO carries data back. Newer names are COPI and CIPO.

Which SPI mode should I use?

Check the device datasheet. Most sensors, SD cards and displays use mode 0.

Parts for this guide

  • SPI TFT / IPS Colour Display Module
    ₹450View
  • MAX7219 LED Display Module
    ₹78View
  • 4-Channel Logic Level Converter (BSS138)
    ₹20View
  • Handheld Oscilloscope Multimeter
    ₹6,639View
Shop Interface Modules

Terms in this guide

SPISerial Peripheral Interface: a fast bus with clock, data in, data out and a chip-select line per device.I2CInter-Integrated Circuit: a two-wire bus (SDA and SCL) that connects many devices by address.UARTUniversal asynchronous receiver-transmitter: two-wire serial (TX and RX) used by GPS, Bluetooth modules and debug output.Logic levelThe voltage that represents a digital high: 5 V on classic Arduinos, 3.3 V on ESP32, Pico and Raspberry Pi.Pull-up resistorA resistor from a signal line to the supply that keeps the line high when nothing pulls it low.FrequencyHow many times per second a signal repeats, measured in hertz (Hz). 1 kHz is 1000 cycles per second.

Keep learning

Concept explainerIntermediateI2C ExplainedI2C is a two-wire bus that lets one microcontroller talk to many sensors and displays using a data line (SDA) and a clock line (SCL).4 min read · Electronics FundamentalsConcept explainerBeginnerUART and Serial CommunicationA UART sends data one bit at a time over one wire with no shared clock, so both ends must agree on the speed, called the baud rate (9600 and 115200 are common).4 min read · Electronics FundamentalsComparisonIntermediateTFT Displays for Arduino and ESP32Small colour TFT and IPS displays use a driver chip that sets the resolution and the library you need: ST7735 for 1.44 to 1.8 inch 128x160 screens, ST7789 for sharp 240x240 or 240x320 IPS screens, ILI9341 for 2.4 to 3.2 inch 240x320 screens, and GC9A01 for round screens.4 min read · Displays & LEDsHow-toIntermediatenRF24L01 2.4 GHz RadioThe nRF24L01 is a cheap 2.4 GHz radio that sends small packets (up to 32 bytes) between microcontrollers with automatic acknowledgements and retries.3 min read · IoT & WirelessHow-toIntermediate3.3 V vs 5 V LogicYou need level shifting when a 5 V device sends signals to a 3.3 V board such as an ESP32 or Raspberry Pi Pico, because 5 V on their pins can damage them.4 min read · Prototyping & Wiring

Sources

  • Arduino SPI library reference
  • Microcontroller datasheets: ATmega328P, ATmega2560, ESP32, RP2040 SPI peripherals
  • Motorola SPI block guide (original definition of SPI modes)

Written by the Geekobot team from manufacturer datasheets. Always check the datasheet for the exact part and variant you buy.

On this page
Short answerHow SPI worksSPI pins on common boardsSPI modes and speedSPI vs I2C vs UARTWiring tips for multiple devicesTry itCommon mistakesFAQsParts and next steps
Need a hand?Ask Geeko AI which part fits your project, or talk to the Geekobot team.Ask Geeko AIHelp & support

Parts for this guide4 items · ₹7,187

SPI TFT / IPS Colour Display Module · MAX7219 LED Display Module · 4-Channel Logic Level Converter (BSS138) · Handheld Oscilloscope Multimeter

Run itChange the inputs and watch the output
Serial monitor115200 baud
33

A simulation of the sketch above, so you know what to expect. Real readings vary with your parts and wiring.

Ask the Community

Ask a question