From a paper sketch to a running circuit: building Sketch2Sim with Gemma 4 in one hack day
Описание и применение
В рамках хакатона команда создала приложение, которое преобразует рукописный схематический рисунок в работающий проект Arduino в Wokwi, используя модель Gemma 4 и проверяющий валидатор.
Задача
Turning a hand‑drawn circuit sketch into a working simulation is slow and error‑prone, requiring manual pin selection, resistor placement, firmware writing and debugging.
Результат
Within a hackathon, the team produced a functional prototype that converts handwritten circuit sketches into runnable Wokwi simulations, demonstrating the feasibility of AI‑assisted circuit design.
Рабочий процесс
- Take photo of sketch
- Upload image to app
- Gemma 4 parses image and returns JSON with parts, wires, and firmware
- Validator corrects pin names, adds missing components, and repairs wiring
- Output files are copied into Wokwi and run
- Result is displayed to user
Доказательства
Gemma 4 reads the image. I used gemma-4-26b-a4b-it through the Gemini API. The prompt contains a catalog of nine Wokwi parts with their exact pin names, a few wiring rules ... and one worked example. The model answers with JSON: parts, wires with a one-line reason per pin, and the firmware.
A validator checks everything. This is plain TypeScript, with no AI involved. It maps invented part types onto real ones, fixes pin names, adds missing resistors, moves servos to PWM pins, wires forgotten GND and 5V pins, and swaps parts wired with reversed polarity.
Before I even had an API key, I fed the validator a deliberately broken answer. It made 20 repairs and produced a valid circuit.
- Дата записи: 2026-11-01T16:13:56.552Z