Guide · Agent skill
How to use the Hardware I2C and SPI Control agent skill
Updated · written with AI from the project's own documentation and checked against our catalogue data
The hardware skill teaches an AI agent how to talk to small electronic parts such as sensors, OLED screens, clocks and power monitors wired to Sipeed single-board computers (LicheeRV Nano, MaixCAM and NanoKVM) over the I2C and SPI buses. This guide explains what the skill does, how to install it, how to ask for things in plain language, and what to check before you let an agent touch your hardware. By the end you will be able to ask an agent to scan a bus, read a sensor and troubleshoot a device that does not respond.
Quick start
- 1Download the ZIP. Download the hardware skill ZIP from this page.
- 2Install the skill folder. Unzip it into ~/.claude/skills/ for personal use or into .claude/skills/ in your project, or upload the ZIP under Settings → Capabilities → Skills in the Claude apps.
- 3Prepare the board. Stop WiFi if you use shared pins, load the i2c-dev module with modprobe, and configure pinmux using the board notes.
- 4Detect buses. Ask the agent to run i2c detect to list the available buses.
- 5Scan for devices. Ask the agent to scan your bus, for example bus 1, to find connected devices.
- 6Read a sensor. Name your part, such as an AHT20, and ask for a reading. The agent uses the chip notes to build the correct read.
- 7Confirm any write. When the agent proposes a write, check the address, register and bytes, then approve it so the agent sends it with confirm set to true.
What the hardware skill lets the agent do
A skill is a folder of instructions and reference notes that an AI agent loads when a task matches it. This one covers the I2C and SPI buses on Sipeed boards. Once it is installed, the agent can list the available buses, scan a bus for connected devices, and read or write registers using the i2c and spi tools.
The skill also includes reference notes on pin setup and on common chips, including the AHT20 temperature and humidity sensor and the BME280 and BMP280 sensors, so the agent can look up addresses and register details instead of guessing.
- List buses with i2c detect and SPI devices with spi list
- Scan a bus for devices with i2c scan
- Read from a device register with i2c read, or read from an SPI device with spi read
- Look up register maps for AHT20, BME280/BMP280, SSD1306 OLED, MPU6050, DS3231, INA219 and PCA9685
Install the hardware skill
Download the ZIP from this page. Then choose one of the following options.
For a personal setup, unzip the folder into ~/.claude/skills/. For a single project, unzip it into the project's .claude/skills/ folder. You can also upload the ZIP in the Claude apps under Settings → Capabilities → Skills.
The skill's source folder contains SKILL.md, references/board-pinout.md and references/common-devices.md. Keep that structure intact so the agent can find the reference files.
- Personal: ~/.claude/skills/
- Project: .claude/skills/ inside your project
- Claude apps: Settings → Capabilities → Skills, then upload the ZIP
Get the board ready before you ask for readings
On Sipeed boards most I2C and SPI pins are shared with WiFi, so you usually have to configure pinmux first. The skill's common steps are: stop WiFi if you are using shared pins, load the i2c-dev module, configure pinmux with devmem for your board, then verify with i2c detect and i2c scan.
The exact pinmux addresses are board-specific, so the agent should read references/board-pinout.md rather than invent them. For LicheeRV Nano the notes list I2C-1 on P18 (SCL) and P21 (SDA), with I2C-5 as a software bus that avoids pin conflicts.
- Stop WiFi if using shared pins: /etc/init.d/S30wifi stop
- Load the module: modprobe i2c-dev
- Configure pinmux with devmem (board-specific)
- Verify: i2c detect and i2c scan
/etc/init.d/S30wifi stop
modprobe i2c-dev
ls /dev/i2c-*Ask for what you need in plain language
You do not need to type tool names. Describe the goal and the agent will pick the right commands. Name the board and the part if you know them, because addresses and register details depend on the chip.
For example, you might say: "Scan bus 1 on my LicheeRV Nano and tell me what is connected." Or: "Read the temperature from my AHT20 on bus 1." The agent should use the AHT20 notes, which say the sensor has no register addressing and needs command bytes written directly.
- "What I2C buses does this board have?"
- "Scan bus 1 for devices."
- "Read temperature and humidity from my AHT20."
- "My I2C sensor does not show up on scan. What should I check?"
i2c detect
i2c scan (bus: "1")
i2c read (bus: "1", address: 0x38, register: 0xAC, length: 6)
spi list
spi read (device: "2.0", length: 4)Safety rules the skill enforces
Write operations require confirm: true, and the agent should confirm with you before writing. The skill validates I2C addresses to the 7-bit range (0x03 to 0x77) and SPI modes to 0 through 3. Transfers are capped at 256 bytes for I2C and 4096 bytes for SPI per transaction.
The skill runs scripts and does not use the network. Pinmux changes made with devmem can break WiFi or other pins, because I2C-1 and SPI-2 share pins with WiFi SDIO and cannot be used at the same time as WiFi.
- Writes need confirm: true and your approval
- I2C addresses are checked against 0x03 to 0x77
- SPI modes are limited to 0 to 3
- Limits: 256 bytes per I2C transaction, 4096 bytes per SPI transaction
Troubleshoot common problems
Most failures come down to wiring, pull-up resistors, pinmux or permissions. The skill's troubleshooting table covers the usual cases.
- No I2C buses found: run modprobe i2c-dev and check the device tree
- Permission denied: run as root or add your user to the i2c group
- No devices on scan: check wiring, pull-up resistors (4.7k is typical) and pinmux
- Bus number changed: I2C adapter numbers can shift between boots, so run i2c detect again
- WiFi stopped working: I2C-1 and SPI-2 share pins with WiFi SDIO
- devmem not found: download it separately or use busybox devmem
- SPI returns all zeros: check MISO wiring and device power
- SPI returns all 0xFF: check the CS pin and clock polarity (mode)
What people use it for
- Reading temperature and humidity from an AHT20 on a LicheeRV Nano sensor project
- Checking which devices respond on I2C bus 1 before wiring up a new OLED screen
- Looking up the BME280 chip ID and calibration reads for a pressure logging project
- Debugging an SPI device that returns all zeros or all 0xFF
- Finding the right pinmux steps for a Sipeed board before enabling I2C
Frequently asked questions
How do I install the hardware agent skill?
Download the ZIP from this page and unzip it into ~/.claude/skills/ for personal use, or into .claude/skills/ inside a project. You can also upload the ZIP in the Claude apps under Settings → Capabilities → Skills.
What do I need to use the hardware skill?
You need a Sipeed board running Linux with the i2c and spi tools exposed to the agent, the i2c-dev kernel module (loaded with modprobe), and a devmem utility or busybox devmem. You also need root access or membership of the i2c group.
Is the hardware skill free to use?
The skill is listed under the MIT licence in its source repository. Check the licence file in the source for the exact terms before you redistribute it.
Does this skill work with boards that are not from Sipeed?
No. The pinout and bus notes cover Sipeed boards only, including LicheeRV Nano, MaixCAM and NanoKVM, so other boards need their own reference material.
Why does my I2C device not show up on scan?
Check the wiring, the pull-up resistors (4.7k is typical) and the pinmux setup. Also confirm that WiFi is stopped if you are using shared pins, then run i2c detect and i2c scan again.
Will using I2C or SPI break my WiFi?
It can. On LicheeRV Nano, I2C-1 and SPI-2 share pins with WiFi SDIO, so you cannot use them at the same time as WiFi. Pinmux edits with devmem can also affect other pins, so test on a board you can afford to reset.
New agent skills, repos and AI tools — every week
The best new skills and open-source projects, the fastest-growing repos, and one free prompt. Five minutes to read. Unsubscribe anytime.
Our verdict
This skill suits makers and developers who want an agent to scan buses, read sensors and look up register details on Sipeed boards such as LicheeRV Nano, MaixCAM or NanoKVM. It is not suited to production or safety-critical systems, or to boards that are not Sipeed devices, because pinmux and devmem changes can break shared pins like WiFi.
Download the skill