bw.Let’s talk
Back home
SOFTWARE / OPEN SOURCE

PinCheck.

An open-source Python CLI that checks microcontroller pin assignments before they become wiring problems.

pincheck — python
➜ python3 -m pincheck.cli --board esp32_devkit_v1 -a hc_sr04:TRIG=34,ECHO=35
=== PinCheck Report for ESP32 DevKit V1 ===
Warnings: ['[VOLTAGE] HC-SR04 Ultrasonic expects 4.5V-5.5V, but ESP32 DevKit V1 uses 3.3V logic.']
Errors: ["[DIRECTION] GPIO 34 is INPUT-ONLY and cannot drive 'hc_sr04:TRIG'."]
Actual CLI output · run against repository commit 17c3986 · exit code 1
THE PROBLEM

A pin can fit and still be wrong.

A microcontroller’s pins aren’t interchangeable. An input-only GPIO cannot drive a trigger signal; an ADC channel may become unavailable with Wi-Fi. Catching those constraints before wiring saves a frustrating debugging session.

THE SOLUTION

Check the plan before the build.

PinCheck is a static Python CLI validator. It compares a board definition with peripheral signal mappings and reports errors and warnings. It checks assignments, rather than measuring a physical circuit.

Architecture

CLI / argparsevalidator.pyBoard + peripheral JSONWarnings / errors / exit status

The CLI parses repeatable -a assignments and an optional --wifi flag. The validator loads modular JSON definitions, checks each mapped signal, and collects a report. Validation errors return exit code 1; warnings alone do not fail validation.

Implemented checks

  • Warnings for boot-strapping pins and logic-voltage ranges.
  • Errors for input-only restrictions, reserved or invalid pins, unknown signals, and missing required pin capabilities.
  • ESP32 ADC2 conflicts when an ADC signal is used with --wifi.
  • Duplicate-pin collisions, with a shared I2C/SPI exception for matching bus and signal names.

These checks are limited to the supplied definitions and implemented rules. PinCheck is a planning aid; its output does not establish electrical safety or a complete working circuit.

Try it locally

git clone https://github.com/BasselWael/pincheck.git
cd pincheck
pip install -e .
python3 -m pincheck.cli --list
python3 -m pincheck.cli --board esp32_devkit_v1 \
  -a hc_sr04:TRIG=34,ECHO=35

The final command produces the real error report shown above. --list lists Arduino Uno R3, ESP32 DevKit V1, and Wemos D1 Mini board definitions, plus HC-SR04, MPU6050, and analog soil-moisture peripheral definitions.

Contribute a definition

Add a board JSON file under pincheck/data/boards/ or a peripheral under pincheck/data/peripherals/. Match the existing schema, run python3 -m pytest, and open a pull request. The repository includes schema tests and an ESP32 conflict test.

Read the contribution guide
PROJECT NOTES
Type
Open-source software
Stack
Python · argparse · JSON
License
MIT
Source reviewed
17c3986 · 13 Nov 2026
Scope
Static assignment validation
View source
LET’S MAKE SOMETHING GOOD

Have an idea?
Let’s build it.

A website, a project, or a conversation. I’d love to hear about it.

Start a conversation