Skip to content

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

17 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

VibeCoder Arduino

CI License: MIT

A command-line assistant that turns a plain-English hardware request into an Arduino sketch, validates it against board-specific pin rules, compiles it, and uploads it to a connected microcontroller.

The project combines LLM-assisted code generation with a deterministic hardware toolchain: board detection, Arduino CLI compilation, upload strategies, serial monitoring, and local project history remain under the user's control.

What it does

  • Detects supported boards through serial ports and USB VID/PID information.
  • Generates complete Arduino sketches using a selected AI provider.
  • Applies board-specific reserved-pin and boot-strap warnings.
  • Installs required Arduino libraries and retries compilation after an AI-assisted fix.
  • Supports multiple upload paths, including Arduino CLI, avrdude, esptool, UF2, DFU, and bossac.
  • Produces a local HTML wiring diagram from structured wiring information.
  • Saves successful sketches and metadata to a local project history.
  • Supports hosted providers or a local Ollama endpoint.

Workflow

flowchart LR
    A["Plain-English request"] --> B["Board detection and pin rules"]
    B --> C["LLM sketch generation"]
    C --> D["Arduino CLI compilation"]
    D -->|"Compile error"| E["Constrained repair attempt"]
    E --> D
    D -->|"Success"| F["Upload to board"]
    F --> G["Wiring diagram and local history"]
Loading

Supported hardware families

The bundled database includes common boards from these families:

  • Arduino AVR and ARM
  • ESP8266 and ESP32 variants
  • Raspberry Pi Pico
  • STM32
  • Teensy
  • Adafruit Feather
  • BBC micro:bit

The board database can also be refreshed from the repository, and unknown USB devices can be reviewed manually before compilation or upload.

AI providers

  • Groq
  • OpenRouter
  • Mistral AI
  • OpenAI
  • Anthropic
  • DeepSeek or another OpenAI-compatible endpoint
  • Ollama for local/offline inference

API keys are requested during setup and stored in the user's local VibeCoder configuration; no API credentials are included in this repository.

Requirements

  • Python 3.10 or newer
  • arduino-cli
  • Python packages listed in requirements.txt
  • An API key for the selected hosted provider, or a local Ollama installation

Quick start

git clone https://github.com/orfeastops/VibeCoderArduino-ai.git
cd VibeCoderArduino-ai
python -m venv .venv

Activate the environment and install dependencies:

pip install -r requirements.txt
python vibecoder.py

On first launch, VibeCoder asks you to select an AI provider and configure access. It then detects connected serial devices and guides you through board selection when automatic identification is uncertain.

Example session

[VibeCoder] > Blink the onboard LED every 500 ms and print "hello" to serial.

Generating sketch...
Compiling with the detected board profile...
Compilation successful.
Upload successful.
Wiring diagram saved locally.
Project saved to history.

Commands

Command Purpose
history Show saved projects
load 3 Reload a project by number
load dht22 Search project history
redeploy Upload the last successful sketch again
update Refresh the board database
setup Change provider or model
exit Exit the application

Safety model

VibeCoder warns about known reserved or boot-sensitive pins and asks before replacing them. Generated code and wiring information must still be reviewed by the user before power is applied.

This is a developer/maker tool, not a substitute for electrical design review. It does not validate voltage levels, current limits, isolation, component ratings, or the physical wiring of a circuit.

Project structure

  • vibecoder.py — command-line application and hardware workflow.
  • boards.json — USB fingerprints and board pin rules.
  • requirements.txt — Python runtime dependencies.
  • .github/workflows/ci.yml — syntax and data-validation checks.

Current validation status

  • Python syntax and the bundled board database are checked in CI.
  • The original prototype was tested on Linux hardware.
  • Windows-specific Arduino CLI installation and serial-port paths are implemented, but broader board/OS hardware testing is ongoing.
  • macOS serial detection is implemented but requires additional hardware validation.

Contributing

Useful contributions include new board fingerprints, corrected pin constraints, upload-strategy fixes, and hardware test reports.

License

Released under the MIT License.

About

CLI assistant for generating, validating, compiling, and uploading Arduino sketches from plain-English hardware requests.

Topics

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages