🛠 Configuring GPIO I/O on PICO-PTH4
Objectives
This tutorial aims to familiarize you with using General Purpose Input/Output (GPIO) pins on the AAEON PICO-PTH4. While this card is optimized for AI and industrial workloads with its Panther Lake SoC, it retains essential physical interfaces for automation and IoT. We will configure GPIO pins for reading a simple logic state, utilizing the internal connectors available on the PCB.
Required Equipment
- AAEON PICO-PTH4 board (Ultra 5, 7, or X7 variants)
- Compatible 12V DC power supply
- A push-button switch or simple digital sensor
- Connecting wires (Dupont) and resistors if necessary
- Linux OS installed (Ubuntu/Debian recommended)
- Terminal access via SSH or HDMI display
Steps
- Connector Identification: Locate the dedicated GPIO connector on the PICO-PTH4 board. Technical documentation indicates internal connectors for GPIO, SMBus/I2C, and serial ports. Ensure the board is powered off before connecting external components.
- Circuit Wiring: Connect a GPIO pin to a push-button, then to ground (GND). Use a pull-up or pull-down resistor if your software configuration does not handle it natively. This tutorial assumes an internal pull-up configuration enabled via the Linux kernel.
- Tool Installation: Open a terminal and install libraries for GPIO control via sysfs or libgpiod.
sudo apt update
sudo apt install libgpiod2 gpiod-tools
- GPIO Line Identification: Use the
gpiodetecttool to list available GPIO chips.
sudo gpiodetect
Note the chip name (e.g., gpiochip0) and identify lines corresponding to physical connector pins. Exact mapping depends on the PICO-PTH4 electrical schematic.
- State Reading: To read a specific line (e.g., line 18), use:
sudo gpioget gpiochip0 18
The system returns 0 (low) or 1 (high) depending on button state.
- Monitoring Script: Create a simple bash script to monitor state changes.
#!/bin/bash
while true; do
STATE=$(sudo gpioget gpiochip0 18)
if [ "$STATE" -eq 0 ]; then
echo "Button pressed"
fi
sleep 0.1
done
Verification
Run the script and press the button. "Button pressed" messages should appear. If no response is detected, check wiring, 12V power, and ensure GPIO device permissions are correctly configured.
Going Further
Explore I2C/SMBus bus usage mentioned in PICO-PTH4 specs for complex sensors. Combine GPIO data with Core Ultra X7 358H AI capabilities to process sensor streams in real-time, leveraging 180 TOPS for anomaly detection.
Other tutorials for this board
Code examples for this board
gpio-led-blink-python.pyPythoni2c-sensor-temp.pyPythonnetwork-monitor-eth.pyPythonnvme-storage-bench.shBashai-inference-openvino.pyPythongpio-led-control-python.pyPython