Pin Definition
Overview
Understanding the GPIO pin definitions is essential for hardware projects with LeMaker boards. The Banana Pi and Banana Pro feature a 26-pin GPIO header layout inspired by the original Raspberry Pi, while the LeMaker Guitar provides a 40-pin header. Each pin can serve multiple functions depending on the SoC's pin multiplexing configuration. This reference guide documents the physical pin numbers, GPIO numbers, SoC port designations, and alternative functions for each header pin across all LeMaker boards.
Pin Numbering Conventions
There are three different numbering schemes used when referring to GPIO pins on LeMaker boards. The physical pin number refers to the pin's position on the header counted sequentially from pin 1 (marked on the PCB). The GPIO number is the Linux kernel's internal identifier used when accessing pins through the sysfs interface at /sys/class/gpio/. The SoC port designation uses the Allwinner naming convention of port letter and pin number (for example, PI0 means Port I pin 0). Always verify which numbering scheme a particular tutorial or library expects to avoid connecting to the wrong pin.
Banana Pi and Banana Pro 26-Pin Header
The 26-pin header on the Banana Pi and Banana Pro provides two 3.3V power pins (pins 1 and 17), two 5V power pins (pins 2 and 4), and several ground pins (pins 6, 9, 14, 20, 25). The remaining pins are configurable GPIO with alternate functions. Pin 3 (SoC PB21) and pin 5 (PB20) serve as I2C-2 SDA and SCL respectively. Pins 8 (PH0) and 10 (PH1) provide UART3 TX and RX for serial communication. Pin 12 (PI3) supports PWM output for motor control or LED dimming. The SPI bus is available on pins 19 (PI12, MOSI), 21 (PI13, MISO), 23 (PI11, SCLK), and 24 (PI10, CE0).
LeMaker Guitar 40-Pin Header
The Guitar expands the GPIO header to 40 pins, providing additional I/O capabilities. The extended header adds a second I2C bus, additional UART interfaces, and more general-purpose GPIO lines. Pin assignments follow the Actions Semi S500 SoC port naming convention. The extra pins make the Guitar more suitable for complex hardware projects that require multiple communication buses simultaneously. Refer to the Guitar-specific documentation for the complete 40-pin mapping, as the pin assignments differ significantly from the A20-based Banana Pi and Banana Pro boards.
Common Interfaces on Headers
The GPIO headers on LeMaker boards expose several standard communication interfaces. I2C (Inter-Integrated Circuit) is a two-wire bus for connecting sensors, displays, and other low-speed peripherals. SPI (Serial Peripheral Interface) provides a faster four-wire bus suitable for SD cards, displays, and ADC modules. UART (Universal Asynchronous Receiver-Transmitter) enables serial communication for debugging, GPS modules, and other serial devices. PWM (Pulse Width Modulation) output is available on select pins for controlling servo motors, LED brightness, and generating analogue-like signals from digital output.
Voltage Levels and Safety
All GPIO pins on the Banana Pi and Banana Pro operate at 3.3V logic levels. Connecting a 5V signal directly to a GPIO pin can permanently damage the SoC. Use a level shifter or voltage divider when interfacing with 5V devices. The maximum current per GPIO pin is approximately 10 mA on A20-based boards. For higher-current loads such as relays or motors, use a transistor or MOSFET driver circuit. The 5V and 3.3V power pins on the header can supply limited current; do not draw more than 300 mA total from the 3.3V rail to avoid instability. Always double-check pin connections with a multimeter before powering on your circuit.
WiringPi and WiringLMK Pin Mappings
The WiringPi library, adapted for LeMaker boards as WiringLMK, introduces a fourth pin numbering scheme for programming convenience. WiringPi numbers are sequential integers starting from 0 that map to specific physical and GPIO pins. Use gpio readall to display a table showing all four numbering schemes side by side for the current board. When writing programs with the WiringPi C library or the Python wrapper, specify the numbering mode with wiringPiSetup() for WiringPi numbers, wiringPiSetupGpio() for BCM-style GPIO numbers, or wiringPiSetupPhys() for physical pin numbers.
Related Pages
For board-specific pin definitions, see the Banana Pro Pin Definition documentation. For the WiringPi GPIO library, visit WiringPi. For WiringLMK Chinese documentation, see WiringLMK (中文). For fex-based pin configuration, see Banana Pi Fex Configuration.
Author: LeMaker Documentation Team
Last updated: 2026-02-10