SparkForge
Inspiration
SparkForge started with a frustration we kept running into with AI-generated electronics. Almost every AI circuit generator follows the same workflow: you describe a project in plain English, it generates a schematic and some Arduino code, and then it expects you to trust that everything is correct.
The problem is that AI-generated circuits frequently contain subtle mistakes including incorrect pin assignments, incompatible components, missing resistors, or firmware that doesn't even compile. Beginners usually have no way to identify these issues, making the generated output far less useful than it appears.
Before building SparkForge, we researched existing work in this area. There are already impressive natural-language-to-circuit tools, including open-source PCB generation projects, Flux.ai's conversational hardware platform, and the 2026 CircuitLM research paper. These systems focus primarily on generating circuits, but they generally stop once the design has been produced. Even CircuitLM explicitly identifies simulator-in-the-loop verification as a limitation.
That became the core idea behind SparkForge:
Instead of building another AI that generates circuits, build one that refuses to show a circuit until it has proven that the design actually works.
Our focus shifted from generation to verification.
What it does
SparkForge is an AI-powered circuit generation platform that automatically validates every generated design before presenting it to the user.
A user simply describes a project in natural language, such as:
"An LED that turns on when the room gets dark."
SparkForge then executes a complete verification pipeline:
- Uses Gemini (with Groq fallback) to generate a structured JSON containing the circuit diagram, Arduino firmware, and expected runtime behavior.
- Compiles the firmware using arduino-cli, ensuring the code builds with the real AVR toolchain.
- Validates wiring using wokwi-cli to catch invalid components, incorrect pin names, and malformed diagrams.
- Launches a headless Wokwi simulation to verify that the firmware actually behaves as expected.
- Executes behavioral verification scripts (such as dimming a light sensor or pressing a button) to confirm the circuit reacts correctly, rather than merely compiling successfully.
If any verification stage fails, SparkForge automatically feeds the real compiler or simulator error back into the LLM and attempts to repair the design. This process is repeated for up to three iterations while maintaining a visible repair timeline so users can observe exactly what changed.
Once verification succeeds, SparkForge automatically generates:
- a schematic
- a bill of materials
- component pricing
- a build guide
- beginner-friendly explanations
- shareable permalinks
- community gallery publishing
- project forking
Any future refinement request (for example, "make it blink twice as fast") reruns the entire verification pipeline to ensure modifications never silently introduce regressions.
How we built it
SparkForge is built as a multi-stage AI verification pipeline rather than a single LLM prompt.
How I built it
- Built the backend using FastAPI and a lightweight vanilla JavaScript frontend without any frontend framework.
- Used Gemini as the primary LLM with Groq as an automatic fallback, generating the circuit diagram, Arduino firmware, and expected behavior together as a single structured JSON object to keep them consistent.
- Compiled every generated sketch with arduino-cli using the official AVR toolchain to catch real compilation errors.
- Verified wiring and executed headless simulations using Wokwi CLI, including scripted behavioral tests for interactive components like buttons and sensors.
- Grounded circuit generation with Tavily, retrieving real component datasheets and pinout information before generation to reduce hardware hallucinations.
- Used SQLite for authentication, sessions, and forge ownership, while storing verified projects as flat JSON files to create lightweight, dependency-free permanent links. Added optional authentication through GitHub OAuth.
- Containerized the entire application using Docker for consistent, reproducible deployment across environments.
Instead of asking the model to generate independent outputs, SparkForge produces a single structured JSON containing:
- circuit components
- wiring
- Arduino firmware
- expected runtime output
Keeping everything inside one structured representation minimizes inconsistencies between the diagram and firmware.
Verification is then performed using industry-standard tools:
- arduino-cli compiles firmware using the actual Arduino toolchain.
- wokwi-cli validates circuit wiring.
- Headless Wokwi simulation executes the circuit automatically.
- Custom behavioral scripts verify interactive components like sensors and buttons.
For hardware grounding, SparkForge retrieves component information from external datasheet sources before generation, reducing hallucinated pin mappings.
The backend also implements automatic repair by feeding compiler or simulation errors back into the model, allowing targeted fixes rather than regenerating entire projects from scratch.
Challenges we ran into
The biggest challenge wasn't generating circuits. It was proving they actually worked.
Initially, we discovered that successful compilation did not necessarily imply correct behavior. A circuit could compile perfectly while still failing to perform the intended task.
This led us to implement behavioral verification, where SparkForge actively interacts with simulated hardware and validates real responses instead of simply checking whether the program starts.
Another challenge involved automatic repair. Early versions continuously retried generation until every badge passed, but this occasionally "fixed" circuits that already worked, introducing new bugs in the process.
We redesigned the repair system so that successful verification stages can never regress during later repair attempts, ensuring stability across retries.
Handling unreliable LLM outputs was another obstacle. Structured JSON generation significantly reduced inconsistencies between schematics and firmware compared to independently generated artifacts.
Finally, grounding component information against real datasheet sources greatly improved pin assignment accuracy for sensors and modules that models frequently confused.
Accomplishments that we're proud of
We're most proud that SparkForge moves beyond AI generation and into AI verification.
Instead of asking users to trust AI-generated electronics, SparkForge validates every project using a real compilation toolchain and an executable simulation before presenting any results.
Some accomplishments include:
- End-to-end automated verification pipeline.
- Automatic self-repair using real compiler and simulator feedback.
- Behavioral verification through interactive Wokwi simulation.
- Structured generation that keeps firmware and schematics synchronized.
- Beginner-friendly documentation generated directly from verified designs.
- Safe refinement workflow that prevents regressions after edits.
- Community sharing, gallery publishing, and project forking features.
- Explainations of the code generated
- They can choose what parts to use in design.
- Multiple-Language Support
- 10/10 verified on our fixed 10-prompt eval set, 8/10 on the first try
- Datasheet grounding measurably improved quality: 7/10 → 10/10 verified, fixing exactly the three designs that depend on real pinouts (LDR night light, SG90 servo, buzzer doorbell)
- A refine ("make it blink twice as fast") correctly edited the firmware and re-passed the entire simulator pipeline, not just a code diff
- Estimate Price of each component
Perhaps most importantly, we demonstrated that adding verification significantly improves reliability compared to generation alone.
What we learned
Verification has to be the product, not a feature bolted onto generation — every later feature (refine, forking, parts constraints) had to be designed to never bypass the pipeline
What's next for SparkForge
Our immediate goal is to expand SparkForge beyond basic Arduino projects.
Future work includes:
- Support for additional microcontroller platforms such as ESP32, Raspberry Pi Pico, and STM32.
- Automatic test generation tailored to each circuit's intended functionality.
- Larger community features, including searchable galleries, remixing, collaborative improvements, and reusable verified templates. -Render Workflows for parallel candidate generation (first verified design wins)
Long term, we envision SparkForge becoming an AI hardware assistant that not only generates electronics but also proves their correctness before anyone ever bu ilds them.
Built With
- arduino-cli
- docker
- fastapi
- gemini-api
- github-oauth
- groq
- javascript
- python
- sqlite
- tavily-api
- wokwi
Log in or sign up for Devpost to join the conversation.