Wait, what? Why?

One day I came home with two thoughts scratching at the back of my mind. First: my whole career may be doomed by the rapid AI evolution, second: I do really like USB Type-C and the only thing in my house that I still use and still stuck with the old standard is an old Sony bluetooth speaker, and I really, really need to do something about it.

Along the way, the idea of pursuing the career in electrical engineering at least as the hobbyist, could open the opportunity of becoming the fixer in a near future, so why not.

After not a very long thinking process, I decided to try to DIY my way out of it and put a bunch of soldering equipment I have at home to some use, and just switch the damn thing to a new standard. As it often happens with my pet projects, I got carried away a bit. In the start-up world it’s called pivoting, but, essentially, I came up to a decision to create an AI-powered hardware reverse-engineering factory and autonomous (up to a point) process of CAD modelling, electric circuit verification and other funny things.

Now there’s a new goal - I’m trying to create a digital double of the item from the real world on the web, or at least in my computer, ideally - something that can emulate the behavior of every electrical component, including microchips in the browser and behave as a real bluetooth speaker.

So, this article and the playground are byproducts of a small crazy idea, that became possible to do given access to a smart enough AI model (Claude Opus 5.5), a bit of hardware equipment, some amount of perseverance, some engineering intuition and the world of CLI, agent-friendly tooling folks around the world have built.

Tools

The list is quite simple and contains basic items for any electronics-related project

Screwdriver

You need it to unscrew things.

Tweezers

They are very useful when you need to handle very small items.

Digital calipers

If you want the resulting models resemble reality - you’d need to do measurements. A LOT of measurements. Even though it is possible to derive sizes from photos - you still need to have a bunch of reference data-points coming from measuring things in the real world.

Good smartphone camera

I told claude the model of my phone for it to find camera settings, if they weren’t reliable from the EXIF metadata to do adjustments of photos for different things and did a bunch of macrophotography shots for the circuit board.

LCR meter tweezers

I’ve ordered them, as I still want to do the part of the PCB reverse-engineering and would need to make a hell lot of measurements of components, as there’s no datasheet for this speaker mainboard. I consider it a whim, but why not.

Software

Claude Code

I used Opus 5.5 model for almost every task. Fable 5 was used was some deep-researches and helping understand the overall directions we could go in with the circuitry, but I don’t really think it was more useful than Opus. I really, really like this bastard that would likely take away my job. It just makes bringing any of my ideas to life feel so natural. It makes mistakes, sometimes does illogical things, but it’s so easy to steer, so easy to build proper harness around so I can’t already imagine my life without him (or her? it?).

CAD and 3d modelling

Most of the project is built around the build123d project. I could have gone with some MCP over the KiCAD or some other CAD, but decided that having a native, code-based approach would speed up the whole process a lot, and, I estimate, it paid off greatly. The project also uses the trimesh library for making sure resulting models make sense and for the reality checking pipeline.

Multiple libs everybody knows were also used for both modelling and verification routines: OpenCV, NumPy, SciPy, Pillow, matplotlib.

Electronics

The part I’ve started working on recently is the mapping of the circuit board from the real world to something we could actually test, run and model, so the ngspice is used for all of that. It’s currently the most unclear area for me, as I don’t have a lot of background in circuit design, and will have to learn a lot along the way.

The process

As it always happens, the process was messy and was re-inventing itself as problems arose. I don’t want to go into full detail about what happened, changed and how it works in the details, but basically I (well, Claude) had to build a bunch of custom tools to verify the results in both automatic and human-in-the-loop ways.

What we have as the core of the project is several large JSON files (srs-xb10.json and pcb.json) which contain all of the parts of the physical device with their descriptions, measurements, links to photo areas and so on. They have jsonschema and the linter layer as well, not to make agent going rogues and inventing things. On top of that there are scripts that build and verify CAD files via build123d and trimesh.

The whole thing is rendered into an HTML page (similar to what I have here in the playground, but more advanced), where I can leave some remarks, comments and reference things in the agent’s conversation. There’s also a regression framework on top of 3d models and photos that sets up a camera and different parameters to match the Camera settings photos where taken with and does the math on how much the surfaces of the model match reference photos.

There are also several dedicated HTML pages that help the agent fill-in the data-model parameters from the real life (what sizes are derived from photos and require real-life measurements, how components of the circuit board connect and what are the measurements of those components).

What remains

There’s a whole lot of things I still need to do: tracing and emulating the whole circuit board, building a knowledge about which parts actually do what and how.

But I’m quite happy at what I was able to do with the real thing in the physical world so far, and it became quite easy if you’re brave enough to do so.

The speaker still uses the Micro-USB port and the soldering iron and freshly bought heat gun were never used :(