Opus 5 can design any circuit and validate it via SPICE simulations #19680
jgpeiro
started this conversation in
Show and tell
Replies: 3 comments 3 replies
|
Interesting. Unfortunately I get a 404 when I click on any of the images: this makes it hard to follow the detail of schematics, tables etc. |
1 reply
|
I'm just curious: how much you have to pay to use Opus for this project? Yes, AI is more powerful than before, but it costs more, too. There will come a time when only those with a large budget will be able to afford to use 'good' AI. |
1 reply
|
Interesting - I'm impressed that AI can design linear circuits. A couple of observations.
However I'm well out of date here: my professional analog design experience tailed off before the advent of usable simulation. Perhaps simulation can save you from the hours we spent with a calculator (or slide rule when I first started out)... |
1 reply
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment


Uh oh!
There was an error while loading. Please reload this page.
Introduction
4 years ago I tested LLMs for software design, creating a small project that generates “infinite” playable pong games in micropython ( https://spectrum.ieee.org/infinite-pong-with-ai ). During these years, LLMs evolve and get more and more powerful step by step. They can always produce any text, ASM, C, Python, Verilog etc, but code and working code aren't the same. Initially they just produced “slop”, code that looks working, but contains bugs, conceptual mistakes or directly non-existing functions. In the best case just a few bugs that you only discover when running it. This was a big problem, because it forces you to test everything, always without any proof that you cover all the code, and you don't want to use code from someone else, even if it makes amazing things, if it contains just a few bugs. You also don't want to be forced to read all of that 2000 lines of generated code.
Every release the LLMs produce better and better code and finally nowadays they can produce code with acceptable quality, they can write assembly code for your matrix multiplication routines, they can manage your terminal, they can write verilog code or draw SVG images with plenty of details.
Opus 5 example: 30 min South Park chapter in html, with multiple scenes and coherent and fun dialogs.
Generated code verification

One issue with verification is that you don't know what to expect. How can you verify a code that you didn't write, that you don't know how it works or all its features? This makes the verification hard and you never know if there is just another hidden bug when you combine two actions or if some behavior is correct or not. It's hard to verify code that you didn't write if you dont have specs or you dont know how it should work.
To help with that, you can gain trust in your LLM asking for something that you know, like a pong game? yes, but you also don't want to get a copy from the dataset, this will be useless, so you must find something that you know how it works and its not common in the dataset.
Multimeter simulator example. You know what to expect and should be not common in the training data
The multimeter application has these features, you can verify it as a user and should not be common in the dataset. It worked fine, so we can have some confidence in the LLM generated code for any other application.
Hardware design
So, the next step was to design hardware. Is it possible or just more useless “AI slop”? The first toy example was to ask for a circuit, but we dont want just beautiful words that dosnt work in the real world, we want something with some warranty, that is why I thought that SPICE simulations can be a good starting point.
I drew a random signal with paint and asked for a circuit that generates it.

Design a circuit that generates this signal with SPICE.
The result is a python file using pySpice, the simulation is stored in a plot and matches the request. The spice circuit design contains resistors, capacitors and other elements to produce it. I didn't analyze it in detail, but it's done with spice, so it's not possible any error or any “cheat”. It's a real circuit that produces the requested signal.

Circuit output simulation
Circuit code

Circuit schematic “approximation”
Even with the spice circuit, you can generate the netlist and you can enter manually into any schematic editor, but I got mistakes, unconnected wires etc, so the best attempt to obtain a decent schematic was to use OpenAI image generation to obtain an approximation. The circuit its defined in spice and this is the source of truth, but the image gives a good idea of how it looks.
Ok, lets verify a small part:

The OpenAI generated image, with some errors, but good enough to understand the circuit.
Opus was able to build a decent schematics, but not always so I preferred to enter manually. This example is from a multisheet project power supply drawn by Opus.

Power supply drawn by Opus, pretty looking and correct, but it wasn't always the case.
So, if we can create a circuit that produces that signal, what else can we produce? Let's try with something harder, lets try with PONG game:

Requested pong design: two pots for user inputs and XY scope to draw the outputs.

Pong with BJT transistors

Pong with BJTs 10s simulation gif

Pong with opamps
Pong with opamps block diagram
How it works? The LLM already generated a document with detailed explanations, simulations and BOM, but in few words, there are few oscillators for paddles and balls that produce XY coordinates at high speed (KHz) and an analog switch (4066) selects one source at a time to display it.

Two plots of the opamp pong signals
Good, looks like complex circuits work fine as well. Could we generate even bigger and more complex circuits? Why not?

Hey Opus, could you design an IV tracer like this one with a Raspberry Pi Pico?
Left: reference image, right: output design architecture
And Opus did its task without hesitation and generated a 35 page document full of diagrams, charts and block by block explanations.

The 21 ICs BOM of the design
It should work? To answer this you should build it, but it will take some time that I don't want to invest in just to discover that the LLM hallucinated something or made a wrong connection etc. So the first task will be to read the whole document to see any mistake. It's a “hobby” project, so if there is a mistake an experienced engineer should find it in the document.

I spent a few hours reading it and I can't find it, everything looked correct to me, so the next step will be to build it. But I don't want to, it's too complex. Even more, it can be just a copy from any open source project. So I decided to try a simpler project, one made with just the parts I have at home. If it can design a circuit with the components I have, it cant be just a copy from the training data, it must be a new design.
The inventory.md


First I collected the different component kits I have, I pasted an image of each one and asked to build an inventory file with all components. Then I used that inventory file for next designs.
Ultrasonic range meter
The project started with: “Hey Opus, build this X with these components. Include spice simulations” and Opus generated a 12 page document with the full project details, a python file with the simulations, tolerances etc
Example of architecture, simulations and tolerance analysis included in the design.
After a detailed review I couldn't find any error so I manually entered the project on Kicad and designed the PCB.

The schematic and PCB in Kicad
The builded PCB with the pico and extra LCD
During the build I found a few small errors, some spotted by the LLM in a simple document review and some not.
The first error was a ICL7660 pin connected to VCC, that I made it fail to generate the -5V. After one hour with the oscilloscope I found it and fixed it.
The second error was the H bridge was always ON and this consumed too much power and made everything hot. This issue was spotted by the LLM in the document review and the fix proposed to make it work as expected.
Explanation of the H-bridge issue and fix made by the LLM during the initial document review.
And the third error was with the RX amplifier stage, the design had a gain of 50, but this was too much and made the circuit oscillate. This can be an issue if the LLM expected less sensibility from the ultrasonic receiver or it can be an issue of my PCB routing on that stage. Anyway, I changed the gain from x50 to x10 and everything started to work.
The project worked, with really good precision and range, up to 2 meters and with 0,1mm precision (0.1mm in lower distances and 1mm in full range), and everything with PIO as I requested initially.

Detail of the PIO code to generate the TX burst

Detail of the good looking generated UI
Conclusion
I can use LLMs to generate any program, that is not new in 2026, is just vibe-coding, but use it to design any hardware system and to simulate it using spice its new for me. This is really interesting because I can test my design before building it. I can ask to build an html simulator of my design (not with SPICE, but with second-order and non-linear simulations), have different blocks alternatives to test my design, with different performance vs BOM costs, try different fail scenarios (noise on the power rails, disconnected rx sensor, ambien noise etc) and just jump to SPICE when I'm sure I have what I need and to the schematic and the PCB design when the SPICE simulations verified it. With the full detailed design documents based on real SPICE simulations, just because the LLM generations aren't just slop anymore, they are really valuable information that works in simulation and works in the real world.
All reactions