Skip to main content
EMBEDDED · I/O

What Is GPIO?

GPIO (general-purpose input/output) pins are digital signal lines that software can set as inputs or outputs. As inputs they read on/off signals such as buttons, switches or sensors; as outputs they can drive LEDs, trigger cameras or switch relays through a driver. Embedded boards use them to connect simple signals without a dedicated interface.

01

What GPIO is

GPIO (general-purpose input/output) is a pin on a processor, microcontroller or board that has no fixed job. Software decides whether it is an input or an output and what it means. As an input it reads whether a voltage is high or low, such as a button being pressed or a door switch closing. As an output it sets a voltage high or low, to light an LED, trigger a camera or tell another circuit to act.

Almost every chip has some GPIO, and boards bring a selection of them out to a header. The 40-pin header on a Raspberry Pi or a Jetson developer kit is the best-known example. Because GPIO is so simple, it is the quickest way to connect a one-bit signal: there is no protocol, only a high or low level. The trade-off is that GPIO carries no error checking and no addressing, so it suits short, local connections rather than long cable runs.

02

How a GPIO pin works

Each GPIO pin is controlled through registers in the chip, which the operating system exposes to software. On Linux, the usual interface is the GPIO character device and the libgpiod library; older code uses the deprecated sysfs interface. A program requests a line, sets its direction and then reads or writes it.

  • //
    Direction. Each pin is set as an input or an output. Many chips default to input at power-up so nothing is driven by accident.
  • //
    Pull-up and pull-down. An internal resistor holds an input at a known level when nothing is connected, so a switch only has to pull it the other way.
  • //
    Interrupts. An input can raise an interrupt on a rising or falling edge, so software reacts to an event without polling the pin.
  • //
    Alternate functions. Most pins can be switched by pin multiplexing to serve I2C, SPI, UART or PWM instead of plain GPIO. The board’s device tree sets which function each pin has.
03

GPIO voltages compared with industrial DIO

GPIO runs at the chip’s logic voltage, and that is the detail that catches people out. A pin cannot safely take a higher voltage than its own supply, and it can only source or sink a few milliamps. Industrial signals work at very different levels, which is why industrial computers offer isolated digital I/O instead.

Where the pin is Typical logic level Typical drive Isolation Connects directly to
Microcontroller (e.g. Arduino Uno) 5 V or 3.3 V Around 20 mA None LEDs, buttons, logic chips
Single-board computer header (e.g. Raspberry Pi) 3.3 V A few mA, around 16 mA maximum None 3.3 V sensors and modules
Jetson module pins 1.8 V, often shifted to 3.3 V on the carrier header A few mA None On-board logic and camera triggers
Industrial isolated DIO Inputs accept around 5 to 30 V; 24 V is common Hundreds of mA per output Optocoupler, typically 1.5 kV or more PLC signals, relays, proximity sensors

Our white paper on the key differences between DIO and GPIO goes further into when each fits an IIoT gateway or edge computer.

04

What GPIO is used for

On embedded and edge systems, GPIO handles the simple signals that do not justify a bus of their own:

  • //
    Power control. Signals to put a system to sleep, wake it or shut it down safely.
  • //
    Camera triggering. Synchronizing image capture with an external event, such as a part passing a sensor.
  • //
    Status outputs. Driving indicator LEDs, buzzers or an alarm line to another controller.
  • //
    Simple sensors. Reading door switches, buttons, limit switches and the open-collector outputs of other devices.
FAQ · 01
Who decides which GPIO pins do what on a custom board?
The board support package. Its device tree and pin configuration set each pin’s function, direction and default state at boot, so a custom carrier board needs a BSP that matches its wiring.
Read the full FAQ —
05

Connecting GPIO to industrial signals safely

A 3.3 V or 1.8 V GPIO pin wired straight to a 24 V sensor will be destroyed, and a long cable can carry noise and surges back into the processor. The usual fixes are a level shifter for different logic voltages, an optocoupler or digital isolator to separate the grounds, and a transistor or relay driver for anything that needs more than a few milliamps. Inductive loads such as relay coils also need a flyback diode.

Industrial computers and I/O modules build those stages in. Our digital I/O modules add optoisolated inputs and relay outputs to embedded systems, and the wider difference between on/off and continuous signals is covered in our explainer on analog vs digital signals.

06

GPIO on Jetson carrier boards

On NVIDIA Jetson systems, the module’s GPIO comes out through the carrier board, which decides how many pins reach a header and at what voltage. Our Jetson Orin carrier boards expose GPIO alongside CAN, serial and camera interfaces. In the fanless GPU computer case study, GPIO lines handle soft sleep and shutdown on a custom carrier.

07

Quick answers on GPIO

GPIO: common questions

What is a GPIO pin?

A pin software can use as a digital input or output. It has no fixed function, so it can read a switch, drive an LED or trigger another device.

What does GPIO stand for?

General-purpose input/output. “General-purpose” means the pin is not tied to one interface such as USB or Ethernet.

What voltage are GPIO pins?

The chip’s logic voltage. That is usually 3.3 V on single-board computers, 1.8 V on many modules and 5 V on some microcontrollers. Check the datasheet before connecting anything.

What is GPIO in a microcontroller?

The same idea at chip level. A microcontroller groups its GPIO into ports, and firmware sets each pin’s direction and level through registers.

Can a GPIO pin drive a relay?

Not directly. A relay coil needs more current than a GPIO pin can supply. Use a transistor or driver stage with a flyback diode, or an isolated relay output.

We fit isolated digital I/O and carrier boards with the right GPIO breakout to embedded and edge computers as standard, and test each interface before the system ships. Tell us the signals, voltages and cable runs, and we will specify the I/O to match.