In this guide, you’ll find the Orange Pi Zero 2W pinout diagram, its datasheet and schematic diagram, and every pin group explained with its default pins, the overlay that enables it. Without further ado, let’s get right into it!
The Orange Pi Zero 2W is a tiny Linux board built around the Allwinner H618 (4x Cortex-A53 at 1.5GHz), with 1GB, 1.5GB, 2GB, or 4GB of LPDDR4 RAM and Wi-Fi 5 + Bluetooth 5.0. It has the same 65 x 30mm shape and the same Pi-style 40-pin header as a Raspberry Pi Zero 2 W, but the pins behind it are Allwinner pins, so the Raspberry Pi pin numbers don’t apply.
Orange Pi Zero 2W Pinout Diagram
Here is a detailed Orange Pi Zero 2W Pinout Diagram with colored labels and legends to help you easily identify the functionalities that each pin can perform. Each pin of the 40-pin header shows its physical pin number, the Allwinner GPIO name (PI8 style), the Linux GPIO number, the wiringOP (wPi) number, and every function you can enable with Orange Pi’s overlays.
Read it from the grey strip in the middle: odd pins (1, 3, 5…) are the left column, which is the inner row on the board, and even pins (2, 4, 6…) are the right column, along the board edge. Pin 1 is the square pad next to the microSD slot. The small square next to a GPIO means it’s 3.3v only, the “ON BOARD” boxes show the resistors fitted on the board, and the numbered badges point to the notes at the bottom. The header ships unsoldered, so you’ll need to solder a 2×20 pin header first.
Orange Pi Zero 2W 40-Pin Header Pin Table
Click to expand the full pin table (40 pins)
| Pin | Name | Linux # | wPi | Functions |
|---|---|---|---|---|
| 1 | 3.3V | – | – | 3.3v power |
| 2 | 5V | – | – | 5v power |
| 3 | PI8 | 264 | 0 | TWI1_SDA (I2C1) |
| 4 | 5V | – | – | 5v power |
| 5 | PI7 | 263 | 1 | TWI1_SCL (I2C1) |
| 6 | GND | – | – | Ground |
| 7 | PI13 | 269 | 2 | PWM3, UART4_TX |
| 8 | PH0 | 224 | 3 | UART0_TX (debug console) |
| 9 | GND | – | – | Ground |
| 10 | PH1 | 225 | 4 | UART0_RX (debug console) |
| 11 | PH2 | 226 | 5 | UART5_TX |
| 12 | PI1 | 257 | 6 | GPIO |
| 13 | PH3 | 227 | 7 | UART5_RX |
| 14 | GND | – | – | Ground |
| 15 | PI5 | 261 | 8 | TWI0_SCL (I2C0), UART2_TX |
| 16 | PI14 | 270 | 9 | PWM4, UART4_RX |
| 17 | 3.3V | – | – | 3.3v power |
| 18 | PH4 | 228 | 10 | GPIO |
| 19 | PH7 | 231 | 11 | SPI1_MOSI |
| 20 | GND | – | – | Ground |
| 21 | PH8 | 232 | 12 | SPI1_MISO |
| 22 | PI6 | 262 | 13 | TWI0_SDA (I2C0), UART2_RX |
| 23 | PH6 | 230 | 14 | SPI1_CLK |
| 24 | PH5 | 229 | 15 | SPI1_CS0 |
| 25 | GND | – | – | Ground |
| 26 | PH9 | 233 | 16 | SPI1_CS1 |
| 27 | PI10 | 266 | 17 | TWI2_SDA (I2C2), UART3_RX |
| 28 | PI9 | 265 | 18 | TWI2_SCL (I2C2), UART3_TX |
| 29 | PI0 | 256 | 19 | GPIO |
| 30 | GND | – | – | Ground |
| 31 | PI15 | 271 | 20 | GPIO |
| 32 | PI11 | 267 | 21 | PWM1 |
| 33 | PI12 | 268 | 22 | PWM2 |
| 34 | GND | – | – | Ground |
| 35 | PI2 | 258 | 23 | GPIO |
| 36 | PC12 | 76 | 24 | GPIO |
| 37 | PI16 | 272 | 25 | GPIO |
| 38 | PI4 | 260 | 26 | GPIO |
| 39 | GND | – | – | Ground |
| 40 | PI3 | 259 | 27 | GPIO |
The Orange Pi Zero 2W has a second connector too: the 24-pin FPC next to the 40-pin header carries two extra USB 2.0 ports, 100M Ethernet, audio, TV-out, an IR receiver input, and the power key, for Orange Pi’s expansion board. It has its own pinout diagram and section below.
Buy an Orange Pi Zero 2W: If you don’t have one yet, you can get the board from Amazon. The 1GB version is plenty for GPIO and sensor work; take 2GB or 4GB for a desktop or containers, and add the 24-pin expansion board if you want Ethernet and USB-A ports.
Download Orange Pi Zero 2W Pinout Diagrams (Full Resolution)
Both Orange Pi Zero 2W pinout diagrams (40-pin GPIO header and 24-pin FPC expansion connector) in full resolution (5120 px), in one ZIP file.
Orange Pi Zero 2W Datasheet
The Orange Pi Zero 2W is built around the Allwinner H618 system-on-chip. Orange Pi doesn’t publish a separate board datasheet: the user manual is the datasheet, with the specs, the 40-pin table, and the overlay list. Here are the official documents (Orange Pi hosts them on Google Drive, linked from its Orange Pi Zero 2W service and support page):
| Document | Version / Date | What You’ll Use It For | Link |
|---|---|---|---|
| Orange Pi Zero 2W User Manual (OrangePi_Zero2w_H618_User Manual) | v1.3, 10 Oct 2024 (370 pages) | Specs, the 40-pin table and gpio readall (3.17–3.18), every overlay and /dev node (3.19), the 24-pin board (1.7, 3.7), powering from the 5v pins (2.9), debug UART (2.8) | |
| Orange Pi Zero 2W Schematic (OPi_ZERO 2W_SCH) | Rev 1.0, 26 Sep 2023 (7 sheets) | The 40-pin and 24-pin connectors, the USB-C power path, LEDs, the SoC pin mux | |
| Orange Pi Zero 2W 24-Pin Expansion Board Schematic (ZERO_2W_24PIN_EXTEND_SCH) | V1.0, 13 Jan 2025 | RJ45, USB-A ports, audio/TV jack, IR receiver and keys on the expansion board | |
| Orange Pi Zero 2W Mechanical Drawing (DXF) | 26 Oct 2023 | Board outline (65 x 30mm), mounting holes and connector positions for cases | RAR |
| Orange Pi Zero 2W Product Page | Live | Current hardware specifications | Web |
| Orange Pi Zero 2W Wiki (Orange Pi) | Live | The user manual as web pages | Web |
| wiringOP / wiringOP-Python | GitHub (live) | Orange Pi’s GPIO libraries and the gpio readall command | GitHub |
Which document do I need? The user manual for the pin functions, the overlay names and the Linux device nodes; the schematic for the power path, the on-board resistors and the LEDs; and the expansion-board schematic if you use the 24-pin FPC. Allwinner doesn’t publish an H618 datasheet, and Orange Pi doesn’t host one either, so there’s no official chip datasheet to link. The alternate functions in this guide come from the SoC symbol in Orange Pi’s own schematic (it’s named “H616-BGA-284”; the H618 is pin compatible with the H616), checked against the manual’s tables.
Note: Board revision: the boards being sold (and the photos in this guide) are V1.1, printed as “ZERO 2W V1.1” on the silkscreen, while the only public schematic is Rev 1.0. The latest manual (v1.3) shows the same 40-pin signals as the Rev 1.0 schematic, pin for pin, so the pinout in this guide applies to both.
Orange Pi Zero 2W Schematic
Orange Pi publishes the full Orange Pi Zero 2W schematic (Rev 1.0, 7 sheets) and a one-sheet schematic for its 24-pin expansion board. The carousel below shows the parts that matter when you wire the board: the 40-pin and 24-pin connectors, the USB-C power input with the LEDs, and the expansion board. Click a page to view it full screen.
Official sources: the Orange Pi Zero 2W schematic (PDF), Rev 1.0, 26 September 2023, and the 24-pin expansion board schematic (PDF), V1.0, 13 January 2025. The watermark across the sheets is on Orange Pi’s own files. Here’s what to look at:
- One 5v rail (sheet 6): the VBUS pins of both USB-C connectors (TYPEC1 = USB0 and TYPEC2 = USB1) go straight to the VCC-5V net, and so do header pins 2 and 4 and pin 9 of the 24-pin FPC (sheet 5). There’s no fuse, no series diode, and no switch between them; the only part on the line is an AZ5825 ESD/TVS diode at USB0. So whatever feeds one of them feeds all of them.
- USB-C roles (sheet 6): USB0 has two 5.1kΩ pull-downs on CC1/CC2, which tells a charger “I’m a device, give me 5v”. USB1 has 36kΩ pull-ups to 3.3v, which is how a USB-C host port announces itself. That’s why USB0 is the power + device port and USB1 is a host port.
- Debug resistors (sheet 5): pins 8 and 10 (UART0 TX/RX) go through two 470Ω resistors, R8 and R9, inside a box marked DEBUG. They protect the console lines; they’re no problem at 115200 baud.
- I2C pull-ups (sheet 5): pins 3 and 5 (PI8/PI7, TWI1) have 10kΩ pull-ups, RC5 and RC4, to VDD33. No other header pin has a pull-up.
- Power pins (sheet 5): pins 1 and 17 come from VDD33, the board’s 3.3v rail (an ETA3409/SY8089A buck converter), and pins 2/4 from VCC-5V. Every GPIO connects straight to the SoC: no level shifters, no series resistors except the two debug ones.
- LEDs (sheet 6): the red power LED D1 is fed from VDD33 through 5.1kΩ, so it’s on whenever the 3.3v rail is up. The green status LED D2 is driven by PC13 (STATUS-LED) through 1.8kΩ, active high. Neither is on a header pin.
- 24-pin FPC (sheet 5) and the expansion board: J1 carries the USB2/USB3 data pairs, the Ethernet pairs of the H618’s built-in 100M PHY, LRADC, PC15/PC16, PH10 (IR), PWRON, TV-OUT and line out. On the expansion board, the Ethernet pairs go to an RJ45 jack with built-in magnetics, PC15/PC16 drive its green and yellow LEDs through 510Ω, the USB pairs go to a double USB-A socket powered from 5v, KEY1 and KEY2 sit on a 10kΩ resistor ladder on LRADC, PWR_ON pulls the PMIC’s PWRON line, PH10 reads an IRM-3638 IR receiver, and TV-out and line out share a 4-pole 3.5mm jack.
Orange Pi Zero 2W Specs
Here are the Orange Pi Zero 2W specifications, with the board-level details that matter when you wire it:

Get an Orange Pi Zero 2W: it’s the one I recommend for a small, cheap Linux board with a Pi-style header. Grab it from Amazon.
| Feature | Orange Pi Zero 2W |
|---|---|
| SoC | Allwinner H618, 4x Arm Cortex-A53 @ 1.5GHz (64-bit) |
| GPU | Arm Mali-G31 MP2 (OpenGL ES 1.0/2.0/3.2, OpenCL 2.0) |
| RAM | 1GB, 1.5GB, 2GB or 4GB LPDDR4 (shared with the GPU) |
| Storage | microSD slot, 16MB SPI NOR flash (factory mini-Linux) |
| Wireless | Wi-Fi 5 (802.11a/b/g/n/ac) + Bluetooth 5.0, 20U5622 module, external antenna socket |
| Video | Mini HDMI 2.0 (with audio); CVBS TV-out on the 24-pin FPC |
| USB | 2x USB-C (USB 2.0): USB0 = power + OTG (device by default), USB1 = host; 2x USB 2.0 host on the 24-pin FPC |
| Ethernet | None on the board; 100M through the 24-pin FPC and the expansion board |
| GPIO header | 40-pin (2×20, 2.54mm), 28 GPIOs, 3.3v logic, not 5v tolerant, unsoldered |
| Other connector | 24-pin 0.5mm FPC (USB, Ethernet, audio, TV-out, IR, LRADC keys, power key) |
| Power management IC | X-Powers AXP313A (+ a buck converter for 3.3v) |
| LEDs / buttons | Red power LED, green status LED (PC13); no buttons on the board |
| Power input | 5v through either USB-C port (Orange Pi asks for 5v / 2A or more), or 5v into header pins 2/4 |
| Size / weight | 65 x 30 x 1.2mm, 12.5g |
| OS | Orange Pi OS (Arch), Ubuntu, Debian, Android 12 TV, OpenWRT; Armbian and DietPi also support it |
Orange Pi Zero 2W Specifications Summary
- The Orange Pi Zero 2W has the same 40-pin header layout and the same 65 x 30mm size as a Raspberry Pi Zero 2 W, but different GPIOs: BCM pin numbers don’t apply.
- It has 28 GPIOs on the header, all 3.3v and not 5v tolerant, wired straight to the H618.
- Power pins: 5v on pins 2 and 4, 3.3v on pins 1 and 17, and 8 GND pins (6, 9, 14, 20, 25, 30, 34, 39).
- The header pins 2/4 are the same 5v rail as both USB-C ports, with no fuse or diode in between.
- Pins 8 and 10 are the Linux debug console (UART0, 115200 baud) by default.
- UART: 4 extra UARTs (UART2, 3, 4, 5); UART5 on pins 11 (TX) and 13 (RX) is the easy one.
- I2C: 3 buses, I2C1 on pins 3/5 (with 10kΩ pull-ups), I2C0 on pins 15/22, and I2C2 on pins 27/28.
- SPI: SPI1 on pins 19, 21, 23 with two chip selects (CS0 pin 24, CS1 pin 26).
- PWM: 4 channels, PWM1–PWM4 on pins 32, 33, 7, and 16.
- There are no analog inputs on the header.
- The 24-pin FPC adds 2x USB 2.0, 100M Ethernet, line out, TV-out, IR, and keys through the expansion board.
- The green status LED is on PC13, and the board has no buttons.
Orange Pi Zero 2W H618 Peripherals vs the 40-Pin Header
| Peripheral | On the Header | Overlay (Orange Pi OS) | Linux Device / Notes |
|---|---|---|---|
| GPIO | 28 pins | Always available | /dev/gpiochip0 (libgpiod), wiringOP |
| UART | UART0 (console), UART2, UART3, UART4, UART5 | pi-uart2, pi-uart3, pi-uart4, ph-uart5 | /dev/ttyS2–ttyS5; UART1 drives the Bluetooth module |
| I2C (TWI) | 3: I2C0, I2C1, I2C2 | pi-i2c0, pi-i2c1, pi-i2c2 | /dev/i2c-N, but N doesn’t match the bus number (see the I2C section) |
| SPI | 1: SPI1 (CS0 + CS1) | spi1-cs0-spidev, spi1-cs1-spidev, spi1-cs0-cs1-spidev | /dev/spidev1.0, /dev/spidev1.1; SPI0 runs the on-board flash |
| PWM | 4: PWM1–PWM4 | pi-pwm1 … pi-pwm4 | /sys/class/pwm/pwmchip0, channels 1–4 |
| I2S / DMIC / SPDIF | In the SoC mux (I2S0, I2S3) | None from Orange Pi | Needs your own device-tree overlay |
| ADC | None | – | Only the LRADC key input on the 24-pin FPC |
| USB / Ethernet | None on the header | – | USB-C ports and the 24-pin FPC |
Orange Pi Zero 2W Quick Pin Selection Guide
| Use Case | Recommended Pins | Why |
|---|---|---|
| Serial port / UART | Pin 11 (UART5 TX), pin 13 (UART5 RX) | Pins 8/10 are the Linux console; UART5 is free, /dev/ttyS5 |
| Linux console login | Pins 6 (GND), 8 (TX), 10 (RX) | UART0 at 115200 8N1 with a 3.3v USB-UART adapter |
| I2C sensors and displays | Pins 3 (SDA) / 5 (SCL), I2C1 | 10kΩ pull-ups already on the board, Pi-style position |
| A second I2C bus | Pins 22/15 (I2C0) or 27/28 (I2C2) | Add 2.2kΩ–10kΩ pull-ups if the module has none |
| SPI device | Pins 19, 21, 23 + CS0 pin 24 (or CS1 pin 26) | The only SPI bus on the header |
| Hardware PWM | Pin 32 (PWM1) or pin 33 (PWM2) | They don’t share pins with a UART |
| Plain GPIO (LED, button) | Pins 12, 18, 29, 31, 35, 36, 37, 38, 40 | No overlay and no on-board part ever claims them |
| Relays, motors, LED strips | Any GPIO through a transistor or driver board | GPIOs only switch logic levels |
| Analog input | None on the board | Add an I2C ADC (ADS1115) on pins 3/5 |
| Ethernet, more USB, audio | The 24-pin FPC | Use Orange Pi’s expansion board |
Orange Pi Zero 2W Pins to Use With Caution
| Pin | Reason | What to Do |
|---|---|---|
| Pins 8, 10 (PH0, PH1) | Linux debug console (UART0) by default, 470Ω series resistors | Use them for the console, or free them with the disable-uart0 overlay |
| Pins 3, 5 (PI8, PI7) | 10kΩ pull-ups to 3.3v on the board | Great for I2C; as GPIO inputs they idle high |
| Pins 15/22, 27/28, 7/16 | Shared pairs: I2C0 or UART2, I2C2 or UART3, PWM3/PWM4 or UART4 | Enable only one overlay per pair |
| Pins 2, 4 (5v) | Same rail as both USB-C VBUS pins, no fuse or diode | Never feed them while a USB-C supply is plugged in |
| Pins 1, 17 (3.3v) | No current rating published | Light loads only |
| Any GPIO | Not 5v tolerant, wired straight to the SoC | Level-shift 5v signals |
Orange Pi Zero 2W Pins Functions
Only 28 of the 40 pins of the Orange Pi Zero 2W header are GPIO pins; the rest are power and ground. The 40 pins are divided into the following groups based on the hardware functionality they’re used for.
- Power Pins (2x 5v, 2x 3.3v, 8x GND)
- 28x GPIO Pins (with 4 numbering systems)
- Analog Input Pins (none on the header)
- 5x UART (UART0 = debug console)
- 3x I2C Buses
- 1x SPI Bus (SPI1, CS0 + CS1)
- 4x PWM Channels
- I2S, SPDIF and Other Mux Functions (no overlay)
- 2x USB-C Ports (power, OTG, host)
- 24-Pin FPC Expansion Connector
Most bus pins can do two jobs, and each job is turned on with its own overlay. Pick the overlays first, so no two of them claim the same pin. We’ll discuss each pin group in the following sections one by one in more detail.
Orange Pi Zero 2W Power Pins
The Orange Pi Zero 2W header has two 5v pins (2 and 4), two 3.3v pins (1 and 17) and eight GND pins (6, 9, 14, 20, 25, 30, 34 and 39). They’re highlighted in red and black in the pinout diagram.

| Pin | Name | Function | Notes |
|---|---|---|---|
| 1, 17 | 3.3V | 3.3v output | VDD33 rail; no current rating published |
| 2, 4 | 5V | 5v output or input | The board’s 5v rail (VCC-5V), the same net as both USB-C VBUS pins |
| 6, 9, 14, 20, 25, 30, 34, 39 | GND | Ground | Common ground for everything you connect |
5V pins: when you power the Orange Pi Zero 2W over USB-C, these pins give you that same 5v, so you can power modules from them. They work the other way too: the user manual (section 2.9) shows how to power the board through pins 2/4 and GND with a 5v / 2A or 3A supply, and warns not to connect it the wrong way round. Orange Pi still recommends the USB-C input, because the schematic shows nothing between the header and the USB-C VBUS pins: no fuse, no series diode, no reverse-polarity protection.
3.3V pins: a 3.3v output from the board’s buck converter, for sensors and logic chips. Orange Pi doesn’t publish a current limit for them, so give motors, LED strips, and other heavy loads their own supply.
Power supply: the Orange Pi Zero 2W runs from 5v through either USB-C port. Orange Pi asks for 5v / 2A, but give it some headroom: users report that a weak 5v / 2A adapter made USB networking crawl below 1Mbps, while a better supply gave the full 95Mbps, and many “flaky Wi-Fi” complaints on this board come down to the power supply. A 5v / 3A supply with a short cable is a safe choice, and a small heatsink helps under sustained load.
Note: Never connect a supply to the 5v pins while a USB-C power cable is plugged in, and never power the board from both USB-C ports at once. All of them are the same 5v net, so two supplies fight each other with nothing in between. Use one input only.
Never forget to connect the ground of every circuit to the Orange Pi Zero 2W’s GND (common ground). External sensors and modules need the same ground line as the board to communicate with it properly.
Orange Pi Zero 2W GPIO Pins
The Orange Pi Zero 2W has 28 GPIO pins on its 40-pin header, and every one of them is a 3.3v pin that is not 5v tolerant. Each one can be an input or an output, or be switched to an alternate function (UART, I2C, SPI, or PWM) with an overlay. 27 of them are on banks PH and PI of the H618, and pin 36 is PC12.

| Parameter | Orange Pi Zero 2W GPIO |
|---|---|
| Logic level | 3.3v (the H618’s PH, PI and PC banks run at 3.3v on this board) |
| 5v tolerant | No, on every pin |
| Wiring to the SoC | Direct, except pins 8/10 (470Ω) and pull-ups on pins 3/5 (10kΩ) |
| Pull-up / pull-down | Internal pulls on every GPIO (e.g. gpio mode <wPi> up, or libgpiod bias) |
| Current per pin | Not published (no public H618 datasheet): keep it to a few mA |
| Interrupts | Every header GPIO is an EINT pin: edge events through libgpiod, or wiringOP’s wiringPiISR() |
| Free out of the box | Every GPIO except pins 8/10 (debug console) |
Orange Pi Zero 2W GPIO Numbering: Physical vs H618 vs Linux vs wiringOP
Every GPIO on the Orange Pi Zero 2W has four names, and each tool wants a different one. Take physical pin 7 as an example:
| Numbering | Pin 7 Is | Used By |
|---|---|---|
| Physical | 7 | Counting pins on the header (1–40) |
| Allwinner (H618) name | PI13 | The schematic, the manual, the device tree (port I, pin 13) |
| Linux GPIO number | 269 | sysfs (/sys/class/gpio), and the line offset on gpiochip0 in libgpiod |
| wiringOP (wPi) | 2 | wiringOP C/Python functions and gpio readall |
The Linux number is built from the port name: bank × 32 + pin, where port A = 0, B = 1, C = 2 … H = 7 and I = 8. PI13 is 8 × 32 + 13 = 269, PH2 (pin 11) is 7 × 32 + 2 = 226, and PC12 (pin 36) is 2 × 32 + 12 = 76. The H618’s main pin controller is a single chip in libgpiod ( gpiochip0, labelled 300b000.pinctrl), so the Linux number is also the line offset: pin 7 is gpiochip0 line 269. Run gpiodetect once to confirm the chip on your image.
Raspberry Pi BCM numbers don’t work here. The header has the same shape and the same power and ground pins as a Pi, and I2C, SPI and UART sit in roughly the same places, but the GPIOs are Allwinner pins. “GPIO17” on a Pi tutorial is physical pin 11, which on the Orange Pi Zero 2W is PH2, Linux 226, wPi 5. Translate every Pi tutorial by physical pin, and libraries like RPi.GPIO or gpiozero’s Pi pin factory won’t work. wiringOP’s gpio readall prints the physical, wPi and port names side by side.
|
1 2 3 |
gpio readall # wiringOP: physical, wPi, GPIO name and mode of every pin gpiodetect # libgpiod: list the GPIO chips (gpiochip0 = 300b000.pinctrl) gpioinfo gpiochip0 # all the lines of the main pin controller |
Orange Pi Zero 2W GPIO Code Example (C/C++ and Python)
Here’s the same job in both languages: blink an LED on pin 7 (PI13). Wire the LED’s anode to pin 7 through a 330Ω resistor, and its cathode to GND on pin 9. Both use the libgpiod v2 API (gpiochip0, line 269): install libgpiod-dev on a release that packages v2 (Debian 13, Ubuntu 24.04) or build it from source, and pip install gpiod for the Python bindings. Images that ship libgpiod v1.6 need the older API.
C/C++ (libgpiod v2)
|
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 |
// Blink an LED on pin 7 (PI13) with libgpiod v2 // Build: gcc blink.c -o blink -lgpiod #include <gpiod.h> #include <unistd.h> int main(void) { unsigned int line = 269; /* PI13 = 8 x 32 + 13 */ struct gpiod_chip *chip = gpiod_chip_open("/dev/gpiochip0"); struct gpiod_line_settings *st = gpiod_line_settings_new(); gpiod_line_settings_set_direction(st, GPIOD_LINE_DIRECTION_OUTPUT); struct gpiod_line_config *cfg = gpiod_line_config_new(); gpiod_line_config_add_line_settings(cfg, &line, 1, st); struct gpiod_line_request *led = gpiod_chip_request_lines(chip, NULL, cfg); for (int i = 0; i < 10; i++) { gpiod_line_request_set_value(led, line, (i % 2) ? GPIOD_LINE_VALUE_INACTIVE : GPIOD_LINE_VALUE_ACTIVE); usleep(500000); } gpiod_line_request_release(led); gpiod_chip_close(chip); return 0; } |
Python (gpiod v2)
|
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 |
# Blink an LED on pin 7 (PI13) with the gpiod v2 bindings # Run: sudo python3 blink.py import time import gpiod from gpiod.line import Direction, Value LINE = 269 # PI13 = 8 x 32 + 13, on gpiochip0 with gpiod.request_lines( "/dev/gpiochip0", consumer="blink", config={LINE: gpiod.LineSettings(direction=Direction.OUTPUT)}) as req: for _ in range(5): req.set_value(LINE, Value.ACTIVE) time.sleep(0.5) req.set_value(LINE, Value.INACTIVE) time.sleep(0.5) |
With wiringOP (preinstalled on Orange Pi OS) the same LED is gpio mode 2 out and gpio write 2 1 in the terminal, because pin 7 is wPi 2. In C, that’s pinMode(2, OUTPUT) and digitalWrite(2, HIGH) after wiringPiSetup(). The source is in Orange Pi’s wiringOP and wiringOP-Python repositories.
Note: The Orange Pi Zero 2W’s GPIOs are not 5v tolerant, and there’s no level shifter or series resistor between the header and the H618 (except on pins 8/10). 5v on a GPIO can damage the SoC. To connect 5v logic (an Arduino’s TX pin, a 5v sensor output), use a level shifter or a resistor divider.
Orange Pi Zero 2W Analog Input Pins (ADC)
The Orange Pi Zero 2W has no analog input pins on its 40-pin header. The H618’s only ADC-like input on the board is the LRADC on pin 13 of the 24-pin FPC, and it’s meant for reading keys on a resistor ladder (KEY1/KEY2 on the expansion board), not sensors. To read a potentiometer or an analog sensor, add an external ADC such as an ADS1115 (16-bit, I2C) on pins 3/5, or an MCP3008 (10-bit, SPI) on SPI1. Power it from 3.3v, so its digital lines stay at the board’s logic level.
Orange Pi Zero 2W UART Pins
The Orange Pi Zero 2W has 5 UARTs on its header: UART0 on pins 8/10 is the Linux debug console, and UART2, UART3, UART4 and UART5 are free for your devices once you enable their overlay. UART5 on pin 11 (TX) and pin 13 (RX) is the one to pick first, because it shares its pins with nothing else that Orange Pi enables.
Orange Pi Zero 2W Default UART Pins: PH0 (UART0 TX, pin 8) and PH1 (UART0 RX, pin 10), used by the Linux console.

| UART | TX | RX | Overlay (Orange Pi OS) | Linux Device | Shares Pins With |
|---|---|---|---|---|---|
| UART0 | Pin 8 (PH0) | Pin 10 (PH1) | On by default (console) | /dev/ttyS0 | – |
| UART2 | Pin 15 (PI5) | Pin 22 (PI6) | pi-uart2 | /dev/ttyS2 | I2C0 |
| UART3 | Pin 28 (PI9) | Pin 27 (PI10) | pi-uart3 | /dev/ttyS3 | I2C2 |
| UART4 | Pin 7 (PI13) | Pin 16 (PI14) | pi-uart4 | /dev/ttyS4 | PWM3, PWM4 |
| UART5 | Pin 11 (PH2) | Pin 13 (PH3) | ph-uart5 | /dev/ttyS5 | – |
UART3 also has RTS/CTS on pins 32/33 and UART4 on pins 31/37 in the SoC mux, but Orange Pi’s overlays only set up TX and RX. UART1 isn’t on the header: it drives the Bluetooth part of the Wi-Fi module. After a reboot, check which /dev/ttyS* nodes appeared.
|
1 2 3 4 5 |
# /boot/orangepiEnv.txt (Orange Pi OS): one overlays= line, space-separated overlays=ph-uart5 # after a reboot: ls /dev/ttyS* |
Orange Pi Zero 2W Debug Console on Pins 8 and 10
Pins 8 (TX) and 10 (RX) carry the Orange Pi Zero 2W’s serial console: U-Boot and the Linux kernel print to it, and you get a login prompt on it ( ttyS0, 115200 8N1). Connect a 3.3v USB-UART adapter: adapter GND to pin 6, adapter RX to pin 8, and adapter TX to pin 10 (manual section 2.8). It’s the fastest way to see why a board won’t boot or why an overlay failed. To use pins 8/10 for your own device instead, add the disable-uart0 overlay.
Note: Klipper and other projects that wire a controller board to pins 8/10 run into the console: Linux prints boot messages to it and runs a login on it. Use UART5 (pins 11/13) for your device, or free pins 8/10 with disable-uart0. Cross the lines (board TX to device RX), connect GND, and keep the device at 3.3v levels.
There are so many modules that we can interface with the Orange Pi Zero 2W using the UART, which include: GPS receivers, USB-to-serial adapters, 3D printer controller boards, RS-485 transceivers (Modbus), LoRa and cellular modems, fingerprint sensors, microcontroller boards, and much more.
Orange Pi Zero 2W I2C Pins
The Orange Pi Zero 2W has 3 I2C buses on its header (Allwinner calls them TWI): I2C1 on pin 3 (SDA) and pin 5 (SCL), I2C0 on pins 22/15, and I2C2 on pins 27/28. I2C0 is not on pins 3/5, and only I2C1 has pull-up resistors on the board.
Orange Pi Zero 2W Default I2C Pins: PI8 (I2C1 SDA, pin 3) and PI7 (I2C1 SCL, pin 5), the same position as the main I2C bus on a Raspberry Pi, with 10kΩ pull-ups to 3.3v.

| I2C Bus | SDA | SCL | Orange Pi OS Overlay | Armbian Overlay | Pull-Ups on Board |
|---|---|---|---|---|---|
| I2C1 (TWI1) | Pin 3 (PI8) | Pin 5 (PI7) | pi-i2c1 | i2c1-pi | 10kΩ |
| I2C0 (TWI0) | Pin 22 (PI6) | Pin 15 (PI5) | pi-i2c0 | i2c0-pi | None |
| I2C2 (TWI2) | Pin 27 (PI10) | Pin 28 (PI9) | pi-i2c2 | i2c2-pi | None |
The /dev/i2c-N number isn’t the bus number. Linux numbers the I2C adapters in the order they probe, and the kernel also registers buses you never see (HDMI DDC, the power management IC, and on Orange Pi’s kernel the internal Ethernet PHY’s I2C3). Orange Pi’s own manual shows I2C1 as /dev/i2c-3 and I2C2 as /dev/i2c-4, and users report the same /dev/i2c-3 for pins 3/5 on Armbian. So list the buses first, and match them by register address: 5002000 is I2C0, 5002400 is I2C1, and 5002800 is I2C2.
|
1 2 3 4 5 6 7 |
# /boot/orangepiEnv.txt (Orange Pi OS) overlays=pi-i2c1 # after a reboot: which /dev/i2c-N is which bus? i2cdetect -l ls /sys/devices/platform/soc*/*/i2c-* | grep "i2c-[0-9]" # 5002400.i2c = I2C1 sudo i2cdetect -y 3 # scan it (use your number) |
Note: Many I2C modules sold for Arduino pull SDA and SCL up to 5v. That puts 5v straight on the H618’s pins. Power such a module from 3.3v if it supports it, remove its 5v pull-ups, or put a bidirectional I2C level shifter between them. On I2C0 and I2C2, make sure some module on the bus has pull-ups (2.2kΩ–10kΩ to 3.3v), because the board has none there.
There are so many modules and sensors that we can interface with the Orange Pi Zero 2W using the I2C bus, which include: RTC clocks (DS3231), OLED displays (SSD1306), temperature and humidity sensors (BME280, SHT31), IMUs (MPU6050), ADCs (ADS1115) for analog inputs, GPIO expanders (MCP23017), PWM drivers (PCA9685), and much more.
Orange Pi Zero 2W SPI Pins
The Orange Pi Zero 2W has 1 SPI bus on its header: SPI1 on pins 19 (MOSI), 21 (MISO) and 23 (CLK), with two chip selects, CS0 on pin 24 and CS1 on pin 26. Turn it on with an spi1-…-spidev overlay and it appears as /dev/spidev1.0 and/or /dev/spidev1.1. SPI0 isn’t on the header: it drives the on-board 16MB SPI flash.
Orange Pi Zero 2W Default SPI1 Pins: PH7 (MOSI, pin 19), PH8 (MISO, pin 21), PH6 (CLK, pin 23), PH5 (CS0, pin 24) and PH9 (CS1, pin 26).

| Signal | Pin | GPIO | Linux # | wPi |
|---|---|---|---|---|
| SPI1_MOSI | 19 | PH7 | 231 | 11 |
| SPI1_MISO | 21 | PH8 | 232 | 12 |
| SPI1_CLK | 23 | PH6 | 230 | 14 |
| SPI1_CS0 | 24 | PH5 | 229 | 15 |
| SPI1_CS1 | 26 | PH9 | 233 | 16 |
| Overlay (Orange Pi OS) | Chip Selects | Linux Devices |
|---|---|---|
| spi1-cs0-spidev | CS0 (pin 24) | /dev/spidev1.0 |
| spi1-cs1-spidev | CS1 (pin 26) | /dev/spidev1.1 |
| spi1-cs0-cs1-spidev | CS0 + CS1 | /dev/spidev1.0, /dev/spidev1.1 |
Test the bus with a jumper from pin 19 to pin 21, and the manual’s loopback test sudo spidev_test -v -D /dev/spidev1.0: whatever it sends comes back. One display to avoid: Orange Pi says the common 3.5-inch “RPi display” SPI LCD isn’t supported on this board, even though it plugs onto the header.
There are so many modules that we can interface with the Orange Pi Zero 2W using the SPI bus, which include: TFT and e-paper displays, MCP3008 ADCs, MCP2515 CAN controllers, LoRa radios (SX127x), RFID readers (RC522), W5500 Ethernet modules, and much more.
Orange Pi Zero 2W PWM Pins
The Orange Pi Zero 2W has 4 hardware PWM channels on its header: PWM1 on pin 32, PWM2 on pin 33, PWM3 on pin 7, and PWM4 on pin 16. PWM3 and PWM4 share their pins with UART4, so if you need all four PWM channels, leave UART4 off.

| Channel | Pin | GPIO | Overlay (Orange Pi OS) | sysfs (Orange Pi OS) |
|---|---|---|---|---|
| PWM1 | 32 | PI11 | pi-pwm1 | pwmchip0/pwm1 |
| PWM2 | 33 | PI12 | pi-pwm2 | pwmchip0/pwm2 |
| PWM3 | 7 | PI13 | pi-pwm3 | pwmchip0/pwm3 |
| PWM4 | 16 | PI14 | pi-pwm4 | pwmchip0/pwm4 |
On Orange Pi OS, all four channels sit on one pwmchip0, and the channel number is the PWM number (the manual’s own example). A 50Hz signal with a 1ms pulse on PWM1 is:
|
1 2 3 4 5 6 7 8 |
# /boot/orangepiEnv.txt overlays=pi-pwm1 # after a reboot: echo 1 > /sys/class/pwm/pwmchip0/export echo 20000000 > /sys/class/pwm/pwmchip0/pwm1/period # 20ms = 50Hz echo 1000000 > /sys/class/pwm/pwmchip0/pwm1/duty_cycle # 1ms echo 1 > /sys/class/pwm/pwmchip0/pwm1/enable |
On Armbian and DietPi, PWM on the H618 only arrived with the sunxi PWM driver in newer kernels (6.10 and later), so older images have no working PWM on these pins. The SoC mux also lists PWM1–PWM4 on PH0–PH3 (pins 8, 10, 11, 13), but Orange Pi only provides overlays for the PI pins.
Note: Never power a fan, a motor, or a buzzer straight from a PWM pin. A GPIO can only switch a logic signal. Drive the load through a MOSFET or a motor driver, and power it from the 5v pins or its own supply.
There are so many things that we can control with the Orange Pi Zero 2W PWM pins, which include: LED dimming (through a transistor), DC motor speed (through a driver), servo motors, fan speed on a 4-pin PWM fan, buzzers and tone generation, and much more.
Orange Pi Zero 2W I2S, SPDIF and Other Pin Functions
The Orange Pi Zero 2W has I2S audio pins in the H618 pin mux, but no ready-made overlay from Orange Pi for them, so they’re plain GPIOs until you write your own device-tree overlay. They’re shown in the “OTHER” column of the pinout diagram.
| Function | Pins | Notes |
|---|---|---|
| I2S0 (+ DMIC) | Pins 29 (MCLK), 12 (BCLK), 35 (LRCK), 40 (DOUT0), 38 (DIN0) | PI0–PI4; the same pins can be DMIC (digital microphone) inputs |
| I2S3 | Pins 24 (MCLK), 23 (BCLK), 19 (LRCK), 21 (DOUT0), 26 (DIN0) | PH5–PH9, the same pins as SPI1 |
| SPDIF | Pins 11 (CLK), 13 (IN), 18 (OUT) | PH2–PH4 |
| Clock output | Pins 31 (CLK_FANOUT0), 37 (CLK_FANOUT1) | PI15, PI16 |
The H618 symbol also lists CAN on pins 8/10 and extra TWI3/TWI4 and UART2 options on bank PH, but Orange Pi documents no driver or overlay for them on this board, so this guide doesn’t count them. For audio without any of this, use HDMI or the line out on the 24-pin expansion board.
Orange Pi Zero 2W USB-C Ports (USB0 and USB1)
The Orange Pi Zero 2W has two USB-C ports, both USB 2.0, and either one can power the board with 5v. USB0 (the one next to the antenna socket) is the power + OTG port and runs in device mode by default; USB1 is a host-only port for your USB devices.
| Port (Silkscreen) | Position | Role | Power In | Notes |
|---|---|---|---|---|
| USB0 | Next to the ANT socket | USB 2.0 OTG, device mode by default | Yes | Host mode needs the usb0-host overlay (see below) |
| USB1 | Next to USB0 | USB 2.0 host only | Yes | Plug keyboards, USB drives, or a USB hub here |
Orange Pi recommends powering the board through USB0, which leaves USB1 free for a device (manual section 3.13). You can switch USB0 to host mode with the usb0-host overlay (orangepi-config → System → Hardware), but its CC pins are wired as a power sink, and both device trees fix it as a device port for that reason. Orange Pi’s own kernel source says USB0 can only work as a host when the board is powered from the 40-pin 5v pins, with a cable or adapter that ignores the CC pins.
Note: On the official Ubuntu image, users report a “phantom” USB device that floods the kernel log with device descriptor read/64, error -62 even with nothing plugged in, until the small /var/log fills up and the board hangs. The workaround reported is to unbind the idle controller ( 5200400.usb) at boot, or use a newer image.
Orange Pi Zero 2W 24-Pin FPC Pinout (Expansion Connector)
The Orange Pi Zero 2W’s 24-pin FPC connector (J1, 0.5mm pitch) carries everything that doesn’t fit on the tiny board: 2x USB 2.0 host ports (USB2, USB3), 100M Ethernet from the H618’s built-in PHY, line out L/R, TV-out (CVBS), an IR receiver input, the LRADC key input, and the power key. Pin 1 is the end next to the antenna socket.
Click to expand the full pin table (24 pins)
| Pin | Signal | H618 Function | On the Expansion Board | Expansion-Board Pin |
|---|---|---|---|---|
| 1 | GND | – | – | 24 |
| 2 | USB3-DM | USB3 D− | USB-A port (USB3 host) | 23 |
| 3 | USB3-DP | USB3 D+ | USB-A port (USB3 host) | 22 |
| 4 | USB2-DM | USB2 D− | USB-A port (USB2 host) | 21 |
| 5 | USB2-DP | USB2 D+ | USB-A port (USB2 host) | 20 |
| 6 | GND | – | – | 19 |
| 7 | EPHY-RXN | Ethernet RX− | RJ45 | 18 |
| 8 | EPHY-RXP | Ethernet RX+ | RJ45 | 17 |
| 9 | 5V | 5v rail (same as the USB-C VBUS) | USB-A VBUS, power LED | 16 |
| 10 | EPHY-TXN | Ethernet TX− | RJ45 | 15 |
| 11 | EPHY-TXP | Ethernet TX+ | RJ45 | 14 |
| 12 | GND | – | – | 13 |
| 13 | LRADC | Key ADC input | KEY1 / KEY2 (resistor ladder) | 12 |
| 14 | 3.3V | 3.3v rail | IR receiver supply | 11 |
| 15 | PC15 | GPIO (Linux 79) | RJ45 green LED (510Ω) | 10 |
| 16 | PC16 | GPIO (Linux 80) | RJ45 yellow LED (510Ω) | 9 |
| 17 | PH10 | IR_RX (Linux 234) | IR receiver (IRM-3638) | 8 |
| 18 | PWRON | AXP313A power key | PWR_ON key | 7 |
| 19 | GND | – | – | 6 |
| 20 | TV-OUT | CVBS video out | 3.5mm jack (video) | 5 |
| 21 | GND | – | – | 4 |
| 22 | LINEOUTL | Line out left | 3.5mm jack (left) | 3 |
| 23 | LINEOUTR | Line out right | 3.5mm jack (right) | 2 |
| 24 | GND | – | – | 1 |
The official expansion board (Orange Pi Zero 2W 24PIN EXTEND V1.0) plugs in with a short flat cable and turns these signals into real connectors: an RJ45 jack with magnetics and link LEDs, a double USB-A socket, a 4-pole 3.5mm audio/video jack, an IR receiver, and three keys (PWR_ON, KEY1, KEY2). The flat cable flips the numbering, so pin n on the Orange Pi Zero 2W is pin 25 − n on the expansion board, which is why the last column runs backwards.
- Cable orientation: the manual warns not to plug the cable in backwards. Check the blue stiffener side and pin 1 before you close the latches.
- USB2/USB3 are host-only data pairs; their 5v comes from FPC pin 9, the same rail as the USB-C ports.
- Ethernet pairs need magnetics (an RJ45 with a transformer), as on the expansion board. The internal PHY also needs board-specific kernel support: Orange Pi’s images have it, Armbian added it in 2024, and an Armbian/DietPi 6.18 kernel (2026) lost Ethernet, the USB-A ports and the audio jack until the fixed build 6.18.41.
- KEY1/KEY2 are read through LRADC (enable the lradc-keys overlay, manual section 3.8), and PWR_ON powers the board on or off through the PMIC.
- Line out is an unbuffered codec output: use it with headphones or a line-in, not a speaker.
Orange Pi Zero 2W On-Board Features
Besides the two connectors, the Orange Pi Zero 2W has a few on-board features you’ll meet when you wire and debug it. None of them is on a 40-pin header pin.
| Feature | Where | What It Does |
|---|---|---|
| Red power LED (D1) | On the board | On whenever the 3.3v rail is up; not software controlled. |
| Green status LED (D2) | Driven by PC13 (Linux 77), active high | Off in U-Boot, then a heartbeat in Linux; control it from /sys/class/leds/green_led (trigger: none, default-on, heartbeat). |
| 16MB SPI NOR flash | Bottom side, on SPI0 | Ships with a small factory Linux, which is why the green LED blinks even with no microSD card. |
| microSD slot | Next to pin 1 | The normal boot device; the board boots from it first, then from the SPI flash. |
| Antenna socket (ANT) | Next to USB0 | External antenna for the Wi-Fi 5 / Bluetooth 5.0 module (20U5622). |
| Mini HDMI | Board edge | HDMI 2.0 video with audio. |
| Buttons | None on the board | PWR_ON, KEY1 and KEY2 are on the 24-pin expansion board. |
To turn the status LED into an “I’m alive” light for your own program, set its trigger to none and write 1 or 0 to /sys/class/leds/green_led/brightness. If the green LED blinks but nothing appears on HDMI, the board is running the factory Linux from the SPI flash: re-check your microSD card.
Getting Started With Orange Pi Zero 2W GPIO
Getting the Orange Pi Zero 2W’s pins working takes three steps: install an OS, enable the overlays you need, and pick a GPIO library.
- Install an OS: flash Orange Pi OS (Debian or Ubuntu based), Armbian, or DietPi to a microSD card. Orange Pi’s own images ship wiringOP and gpio readall, so they’re the easiest start for GPIO work.
- Enable the interfaces: add the overlay names to the single overlays= line of the boot environment file (the file name and the names differ per OS, see the table), then reboot.
- Pick a library: libgpiod for C/C++ and Python (gpiochip0 + Linux number), wiringOP for Arduino-style C code and gpio readall, or wiringOP-Python. Use the Linux device nodes ( /dev/ttyS*, /dev/i2c-*, /dev/spidev1.*, /sys/class/pwm) for the buses.
| Orange Pi OS (Orange Pi’s images) | Armbian and DietPi | |
|---|---|---|
| Boot file | /boot/orangepiEnv.txt | /boot/armbianEnv.txt (DietPi: /boot/dietpiEnv.txt) |
| Overlay line | overlays=pi-i2c1 ph-uart5 | overlay_prefix=sun50i-h616 + overlays=i2c1-pi uart5-ph |
| Name pattern | port first: pi-i2c0/1/2, pi-uart2/3/4, ph-uart5, pi-pwm1…4, spi1-cs0-spidev | bus first: i2c1-pi, uart5-ph… (list the folder below to see yours) |
| Overlay files | sun50i-h616-*.dtbo in /boot/dtb/allwinner/overlay/ | sun50i-h616-*.dtbo in /boot/dtb/allwinner/overlay/ |
| wiringOP / gpio readall | Preinstalled | Not included (build it from GitHub, or use libgpiod) |
| Menu tool | orangepi-config | armbian-config / dietpi-config |
Two things trip people up here. First, the overlay files are named sun50i-h616, even though the board is an H618: overlay_prefix=sun50i-h618 finds nothing. Second, users report that armbian-config can write the prefix into the overlay name as well ( overlays=sun50i-h616-i2c1-pi), and the overlay then silently doesn’t load: fix the line by hand to overlays=i2c1-pi. Run ls /boot/dtb/allwinner/overlay/ to see the exact names on your image.
|
1 2 3 4 5 6 |
# Armbian / DietPi: /boot/armbianEnv.txt overlay_prefix=sun50i-h616 overlays=i2c1-pi uart5-ph # list the overlays your image really has ls /boot/dtb/allwinner/overlay/ | grep h616 |
Orange Pi Zero 2W Common Problems & Fixes
My I2C or UART overlay doesn’t load. Why? Check that you used the right names for your OS (pi-i2c1 on Orange Pi OS, i2c1-pi with overlay_prefix=sun50i-h616 on Armbian and DietPi), that the prefix isn’t repeated inside the name, that two overlays don’t claim the same pin pair, and reboot. The debug console on pins 8/10 shows overlay errors during boot.
i2cdetect shows nothing on bus 1. Where is my I2C1? The /dev/i2c-N number doesn’t match the bus number: I2C1 on pins 3/5 is often /dev/i2c-3. Run i2cdetect -l and match the 5002400 address to I2C1.
I enabled I2C0 but nothing answers on pins 3/5. Why? I2C0 is on pins 15/22. Pins 3/5 are I2C1. Use pi-i2c1 (i2c1-pi on Armbian) for pins 3/5.
My Raspberry Pi code or pin chart doesn’t work. Why? The header is shaped like a Pi’s, but the GPIOs aren’t BCM pins, and some third-party charts for this board are simply wrong (users have shared charts that put PI5 on pin 24 or PI16 on pin 36; they’re PH5 and PC12). Trust Orange Pi’s manual table, this guide, or gpio readall.
My blinky doesn’t work out of the box on Armbian. Why? Armbian doesn’t ship wiringOP, and the old sysfs GPIO interface is deprecated. Use libgpiod on gpiochip0 with the Linux number (pin 7 = line 269), as in the code example above.
My serial device on pins 8/10 gets garbage or a login prompt. Why? Pins 8/10 are the Linux console. Move the device to UART5 (pins 11/13, ph-uart5), or add the disable-uart0 overlay.
wiringOP’s pwmWrite() or gpio pwm kills my network. Why? Users report that older wiringOP wrote a PWM register that also affects the clock the internal Ethernet PHY uses on Orange Pi’s kernel. Use the kernel PWM interface ( /sys/class/pwm) instead, or a fixed wiringOP build.
wiringPiISR() doesn’t fire, or wiringOP-Python won’t import. Why? Older wiringOP limited interrupts to GPIO numbers 0–63, while the Zero 2W’s pins are 224–272; that’s fixed upstream since March 2025, so rebuild wiringOP from Orange Pi’s GitHub. For the Python import error undefined symbol: sunxi_pwm_set_clk, users rename the function to sunxi_pwm_set_clk_v2 in bindings.i and rebuild. libgpiod edge events are a simpler route for interrupts.
Ethernet or the USB-A ports on the expansion board don’t work. Why? They need the board’s kernel support. On DietPi/Armbian kernel 6.18 they disappeared, and the 6.18.41 build fixed them. Update the kernel, and check that the flat cable isn’t reversed.
The board is slow on the network or reboots under load. Why? Users trace many of these to a weak supply. Use a good 5v / 3A supply on one USB-C port only.
Orange Pi Zero 2W vs Raspberry Pi Zero 2 W, Orange Pi Zero 3 and Orange Pi Zero
The Orange Pi Zero 2W is Orange Pi’s answer to the Raspberry Pi Zero 2 W: the same size and header layout, with a faster H618, much more RAM, and Wi-Fi 5. The Orange Pi Zero 3 uses the same H618 on a square board with Gigabit Ethernet but a 26-pin header, and the original Orange Pi Zero is the older, slower H2+ board.
| Feature | Orange Pi Zero 2W | Raspberry Pi Zero 2 W | Orange Pi Zero 3 | Orange Pi Zero |
|---|---|---|---|---|
| SoC / CPU | Allwinner H618, 4x A53 @ 1.5GHz | RP3A0 (BCM2710A1), 4x A53 @ 1GHz | Allwinner H618, 4x A53 @ 1.5GHz | Allwinner H2+ (or H3), 4x A7 @ up to 1.2GHz |
| RAM | 1/1.5/2/4GB LPDDR4 | 512MB LPDDR2 | 1/1.5/2/4GB LPDDR4 | 256/512MB DDR3 |
| GPIO header | 40-pin (Pi layout), 28 GPIOs | 40-pin, 28 GPIOs | 26-pin + 13-pin | 26-pin + 13-pin |
| GPIO numbering | H618 port names, Linux = bank × 32 + pin | BCM numbers | H618 port names | H2+ port names |
| Ethernet | 100M through the 24-pin FPC | None | Gigabit on board | 100M on board |
| Wireless | Wi-Fi 5 + Bluetooth 5.0 | Wi-Fi 4 (2.4GHz) + Bluetooth 4.2 | Wi-Fi 5 + Bluetooth 5.0 | Wi-Fi 4 (XR819) |
| Video | Mini HDMI | Mini HDMI | Micro HDMI | None (TV-out on the 13-pin) |
| USB | 2x USB-C + 2x USB 2.0 on the FPC | 1x micro-USB OTG + micro-USB power | 1x USB-A + USB-C power + 2x on the 13-pin | 1x USB-A + micro-USB power/OTG |
| Camera connector | None | CSI camera connector | None | None |
| Size | 65 x 30mm | 65 x 30mm | 50 x 55mm | 48 x 46mm |
Pick the Orange Pi Zero 2W when you want a Pi Zero-sized board with more RAM and speed, and you’re happy to wire by physical pin. Pick the Raspberry Pi Zero 2 W for the camera connector, BCM-numbered tutorials, and the best software support. Pick the Orange Pi Zero 3 when you need wired Gigabit Ethernet on the board, and the original Orange Pi Zero only for an existing project built around it.
Orange Pi Zero 2W Pin Details
Here is every pin of the Orange Pi Zero 2W 40-pin header in physical order, with its H618 name, Linux GPIO number, wiringOP number, the functions Orange Pi’s overlays enable, the full H618 pin mux, and the circuit on the board. Pin 1 is the square pad next to the microSD slot; odd pins are on the inner row, and even pins are on the board edge.
Click to expand the full pin table (40 pins)
| Pin | Name | Linux # | wPi | Functions | Overlay (Orange Pi OS) | All H618 Mux Functions | On-Board Circuit | Description |
|---|---|---|---|---|---|---|---|---|
| 1 | 3.3V | – | – | 3.3v power | – | – | VDD33 rail | 3.3v output from the board’s 3.3v regulator; light loads only (sensors, logic chips). |
| 2 | 5V | – | – | 5v power | – | – | 5v rail (both USB-C VBUS) | The board’s 5v rail: the same net as both USB-C VBUS pins, with no fuse or series diode. |
| 3 | PI8 | 264 | 0 | TWI1_SDA (I2C1) | pi-i2c1 | RGMII_TXD2, UART2_CTS, TS0_DVLD, TWI1_SDA, PI_EINT8 | 10kΩ pull-up to 3.3v | I2C1 data, with a 10kΩ pull-up on the board; reads high when nothing drives it. |
| 4 | 5V | – | – | 5v power | – | – | 5v rail (both USB-C VBUS) | Second 5v pin, the same net as pin 2. |
| 5 | PI7 | 263 | 1 | TWI1_SCL (I2C1) | pi-i2c1 | RGMII_TXD3, UART2_RTS, TS0_SYNC, TWI1_SCK, PI_EINT7 | 10kΩ pull-up to 3.3v | I2C1 clock, with a 10kΩ pull-up on the board. |
| 6 | GND | – | – | Ground | – | – | GND | Ground. |
| 7 | PI13 | 269 | 2 | PWM3, UART4_TX | pi-pwm3, pi-uart4 | RGMII_CLKIN, UART4_TX, TS0_D4, PWM3, PI_EINT13 | – | A free GPIO by default; hardware PWM3 or UART4 transmit with an overlay. |
| 8 | PH0 | 224 | 3 | UART0_TX (debug console) | disable-uart0 frees it | UART0_TX, CAN_TX, PWM3, TWI1_SCK, PH_EINT0 | 470Ω series resistor (debug) | The Linux debug console transmit pin (ttyS0, 115200 baud) by default. |
| 9 | GND | – | – | Ground | – | – | GND | Ground. |
| 10 | PH1 | 225 | 4 | UART0_RX (debug console) | disable-uart0 frees it | UART0_RX, CAN_RX, PWM4, TWI1_SDA, PH_EINT1 | 470Ω series resistor (debug) | The Linux debug console receive pin by default. |
| 11 | PH2 | 226 | 5 | UART5_TX | ph-uart5 | UART5_TX, SPDIF_CLK, PWM2, TWI2_SCK, PH_EINT2 | – | A free GPIO; UART5 transmit with the ph-uart5 overlay, the usual second serial port. |
| 12 | PI1 | 257 | 6 | GPIO | – | RGMII_RXD2, DMIC_DATA0, I2S0_BCLK, HDMI_SDA, PI_EINT1 | – | A plain GPIO (I2S0 bit clock in the SoC mux, with no Orange Pi overlay). |
| 13 | PH3 | 227 | 7 | UART5_RX | ph-uart5 | UART5_RX, SPDIF_IN, PWM1, TWI2_SDA, PH_EINT3 | – | A free GPIO; UART5 receive with the ph-uart5 overlay. |
| 14 | GND | – | – | Ground | – | – | GND | Ground. |
| 15 | PI5 | 261 | 8 | TWI0_SCL (I2C0), UART2_TX | pi-i2c0 or pi-uart2 | RGMII_RXCTL, RMII_CRS_DV, UART2_TX, TS0_CLK, TWI0_SCK, PI_EINT5 | – | I2C0 clock or UART2 transmit (one overlay for the pair 15/22). |
| 16 | PI14 | 270 | 9 | PWM4, UART4_RX | pi-pwm4, pi-uart4 | MDC, UART4_RX, TS0_D5, PWM4, PI_EINT14 | – | A free GPIO; hardware PWM4 or UART4 receive with an overlay. |
| 17 | 3.3V | – | – | 3.3v power | – | – | VDD33 rail | Second 3.3v output, the same rail as pin 1. |
| 18 | PH4 | 228 | 10 | GPIO | – | SPDIF_OUT, TWI3_SCK, PH_EINT4 | – | A plain GPIO, free in every Orange Pi image. |
| 19 | PH7 | 231 | 11 | SPI1_MOSI | spi1-cs0-spidev | UART2_RTS, I2S3_LRCK, SPI1_MOSI, TWI4_SDA, PH_EINT7 | – | SPI1 MOSI (data out of the board). |
| 20 | GND | – | – | Ground | – | – | GND | Ground. |
| 21 | PH8 | 232 | 12 | SPI1_MISO | spi1-cs0-spidev | UART2_CTS, I2S3_DOUT0, SPI1_MISO, I2S3_DIN1, PH_EINT8 | – | SPI1 MISO (data into the board). |
| 22 | PI6 | 262 | 13 | TWI0_SDA (I2C0), UART2_RX | pi-i2c0 or pi-uart2 | RMII_RXER, UART2_RX, TS0_ERR, TWI0_SDA, PI_EINT6 | – | I2C0 data or UART2 receive (one overlay for the pair 15/22). |
| 23 | PH6 | 230 | 14 | SPI1_CLK | spi1-cs0-spidev | UART2_RX, I2S3_BCLK, SPI1_CLK, TWI4_SCK, PH_EINT6 | – | SPI1 clock. |
| 24 | PH5 | 229 | 15 | SPI1_CS0 | spi1-cs0-spidev | UART2_TX, I2S3_MCLK, SPI1_CS0, TWI3_SDA, PH_EINT5 | – | SPI1 chip select 0 (/dev/spidev1.0). |
| 25 | GND | – | – | Ground | – | – | GND | Ground. |
| 26 | PH9 | 233 | 16 | SPI1_CS1 | spi1-cs1-spidev | I2S3_DIN0, SPI1_CS1, I2S3_DOUT1, PH_EINT9 | – | SPI1 chip select 1 (/dev/spidev1.1). |
| 27 | PI10 | 266 | 17 | TWI2_SDA (I2C2), UART3_RX | pi-i2c2 or pi-uart3 | RGMII_TXD0, RMII_TXD0, UART3_RX, TS0_D1, TWI2_SDA, PI_EINT10 | – | I2C2 data or UART3 receive (one overlay for the pair 27/28). |
| 28 | PI9 | 265 | 18 | TWI2_SCL (I2C2), UART3_TX | pi-i2c2 or pi-uart3 | RGMII_TXD1, RMII_TXD1, UART3_TX, TS0_D0, TWI2_SCK, PI_EINT9 | – | I2C2 clock or UART3 transmit (one overlay for the pair 27/28). |
| 29 | PI0 | 256 | 19 | GPIO | – | RGMII_RXD3, DMIC_CLK, I2S0_MCLK, HDMI_SCL, PI_EINT0 | – | A plain GPIO. |
| 30 | GND | – | – | Ground | – | – | GND | Ground. |
| 31 | PI15 | 271 | 20 | GPIO | – | MDIO, UART4_RTS, TS0_D6, CLK_FANOUT0, PI_EINT15 | – | A plain GPIO. |
| 32 | PI11 | 267 | 21 | PWM1 | pi-pwm1 | RGMII_TXCK, RMII_TXCK, UART3_RTS, TS0_D2, PWM1, PI_EINT11 | – | Hardware PWM1, free of the bus pins. |
| 33 | PI12 | 268 | 22 | PWM2 | pi-pwm2 | RGMII_TXCTL, RMII_TXEN, UART3_CTS, TS0_D3, PWM2, PI_EINT12 | – | Hardware PWM2, free of the bus pins. |
| 34 | GND | – | – | Ground | – | – | GND | Ground. |
| 35 | PI2 | 258 | 23 | GPIO | – | RGMII_RXD1, RMII_RXD1, DMIC_DATA1, I2S0_LRCK, HDMI_CEC, PI_EINT2 | – | A plain GPIO. |
| 36 | PC12 | 76 | 24 | GPIO | – | NAND_DQS, PC_EINT12 | – | A plain GPIO on bank C (the manual’s readall example shows it as an output, but no device tree claims it). |
| 37 | PI16 | 272 | 25 | GPIO | – | EPHY_25M, UART4_CTS, TS0_D7, CLK_FANOUT1, PI_EINT16 | – | A plain GPIO. |
| 38 | PI4 | 260 | 26 | GPIO | – | RGMII_RXCK, DMIC_DATA3, I2S0_DIN0, I2S0_DOUT1, PI_EINT4 | – | A plain GPIO. |
| 39 | GND | – | – | Ground | – | – | GND | Ground. |
| 40 | PI3 | 259 | 27 | GPIO | – | RGMII_RXD0, RMII_RXD0, DMIC_DATA2, I2S0_DOUT0, I2S0_DIN1, PI_EINT3 | – | A plain GPIO. |
Wrap Up
To conclude this guide article, the Orange Pi Zero 2W is a very solid little Linux board when you want a Raspberry Pi Zero 2 W footprint with a faster H618, up to 4GB of RAM, and Wi-Fi 5. Its 40-pin header gives you 28 GPIOs, four extra UARTs, three I2C buses, SPI1 with two chip selects, and four PWM channels, and the 24-pin FPC adds Ethernet, USB, and audio. Just remember the gotchas: wire by physical pin (not BCM), every pin is 3.3v only, pins 8/10 are the debug console, the /dev/i2c number isn’t the bus number, and the 5v pins are the same rail as both USB-C ports.
I hope you’ve found this guide helpful for your Orange Pi Zero 2W project. For more boards, check out the Pinouts, Datasheets & Schematic Diagrams Library.