Electronics

PLEN

IC tester, part 4: a PCB made from scripts

The first printed circuit board an AI agent took from a list of requirements to factory files. An autorouter that stalled for hours, the idea of two boards, and a 25 euro surprise at the checkout.

Render górnej płytki testera układów: gniazdo ZIF-40, procesor AVR128DB64, rejestry przesuwne i logo Colorbox Studio

Górna płytka: gniazdo ZIF, procesor i zasilanie gniazda.

Part 3 ended with a list of requirements and a sentence saying the board was neither designed nor ordered. Two days later the order went to the factory.

This is the first printed circuit board the agent took from requirements to production files. It designed in KiCad 9 using nothing but Python scripts, run on the computer in my workshop. I looked at the results, made the decisions about cost, and paid.

Six conflicts before the first line

I started with a brief: “You are the electronics designer. I solder and judge.” The work was to go in four steps with stops in between: checking the assumptions against the datasheet of the AVR128DB64 microcontroller, a block diagram with part options and prices, a full parts list, approval, and only then KiCad.

The check against the 730-page datasheet found 6 conflicts in the assumptions before a single line of the schematic existed. The lowest supply voltage for the chip under test, 1.8 V, sat right at the edge of the microcontroller’s brown-out protection, so we raised it to 1.95 V. The DAC turned out to be too weak to drive a TTL input without an external buffer. And all 55 of the microcontroller’s pins were taken, so about 76 control lines go through shift registers.

The agent handed part of the work to subagents, meaning cheaper models. They gave part parameters “from memory” rather than from datasheets. They flagged this in their reports, so the agent ordered a separate round of verification. One of the chips, described as coming in a convenient SOT-23 package, in reality comes in a 2 × 2 mm leadless package. I caught one mistake too: the agent called the USB-UART chip “optional”, and it is the board’s only connection to the computer.

Where to get parts when you live in Poland

I set a condition: I don’t want to haul parts across the ocean, because shipping would eat the whole saving. I order boards from JLCPCB, so maybe buy the parts there? The answers were less obvious than I expected. JLCPCB doesn’t sell loose parts, only parts for its assembly service. Having everything assembled at the factory was out, because the factory adds a fee for every type of part from outside its basic list, and I had about 45 such types. The fees alone would have come to about 660 zł, more than the parts.

That left LCSC, a Chinese shop from the same group as JLCPCB, and the Polish TME. The agent measured the shipping cost in the LCSC cart instead of guessing: 29–70 zł to Poland. Three options came out for one set of parts:
– everything possible from LCSC (about 335 zł),
– everything possible from TME (about 397 zł), or
– each part wherever it is cheaper (about 281 zł).

TME had no dual-channel USB-UART chip in stock at all, and 17 items were available only from LCSC.

A schematic from code and three checks

The agent did not draw the schematic with a mouse. It wrote a single file with all the parts and connections, from which a script generates the KiCad schematic, runs the rule check and compares the result with the source file. I asked directly: can this be verified or simulated?

Three independent checks came out of that: a block-by-block review, 46 calculations with tolerances, and simulations. Then a fourth element was added, a separate reviewer agent that did not know the designer’s conclusions. The automatic schematic check showed 0 errors and 0 warnings, but that only means the schematic is consistent. The agent’s own review found 8 errors. The reviewer found one more, a critical one: eight small transistors in the high-voltage path were taking up to 0.65 W in a package rated for about 0.3 W. The simulation had not shown it, because the designer had left out exactly that transistor.

After the fixes the schematic had 621 components, and the cost of parts rose from about 281 to about 391 zł.

An autorouter that stands still

A script placed the components on a four-layer 235 × 180 mm board and handed it to Freerouting, a program that routes the tracks by itself. Only when I asked the agent to work with the program’s window open did I notice that “the routing seems to be standing still”. A quarter of an hour later I pointed out to the agent that the components were oddly arranged: lots of empty space, and the sections squeezed tightly together.

I was right about the layout, but there were more causes and they surfaced one after another. Freerouting was hanging on a bug in its own code. Running with the preview window gave clearly worse results than running without it. And 300 ground vias, inserted by a script to help, were shorting neighbouring pins: KiCad showed 14 shorts. Changes that should have helped made the result worse. The agent wrote then that this contradicted its prediction and that it did not know the cause yet. It stopped guessing and started measuring which connections were left over.

Before noon I stopped the work: we had used up two five-hour token limits and had nothing to show for it. The measurement showed that the culprit was not the size of the board but the order of the bits in the shift registers. The register outputs had been assigned in the order the schematic was created, not by proximity. The register next to the relays drove a switch next to the socket and the other way round, which gave 185 long connections right across the board. After regrouping, the autorouter got down to 335 missing connections out of 1443 and stalled there. The best earlier result was 408.

The biggest loss only came to light later. Freerouting version 2.1.0 never finishes by itself, and it saves the result only at the end. So the earlier runs, hours long, could not have produced any file. The older version 1.9.0 finishes after a set number of passes and saves.

Two boards, like a Mega with a shield

In the afternoon I suggested: what about splitting the design into two boards joined with pin headers, like an Arduino Mega with a shield? Two have to be ordered, but they are smaller and might be routable. The agent split the design into a top board of 128 × 150 mm (ZIF socket, microcontroller, socket power supply) and a bottom board of 232 × 171 mm (power supply, high voltage, 10 relays, USB).

Single boardTopBottom
connections to route1443639581
missing after the autorouter335 (stalled)2925
after finishing rounds—136
after the agent’s own script—00

The split worked straight away. The last connections were routed by a script the agent wrote: when a pin is boxed in on all sides, it lifts the neighbouring tracks, routes that one and puts the lifted ones back. The judge is KiCad’s rule check. The final result is 0 missing connections and 0 shorts on both boards.

Remarks from a user, not a designer

The next day it was time for the labels on the board, and for three remarks of mine, each of which changed the design:

  1. The labels next to the connectors should be on the outside, because once the two boards are stacked one on the other they can’t be read. The connectors at the edge moved 10 mm inwards.
  2. The board was missing the Colorbox Studio logo.
  3. I asked whether the DIP-8 socket was needed at all, given that there is a ZIF socket. It wasn’t. It was wired in parallel to the same eight pins, and it stood exactly where the socket I had bought has its body with the lever.

Each of these remarks meant routing the tracks again. This is where the previous day’s effort paid off: the whole process had become a single script that runs without the agent. The bottom board routed itself from scratch in 40 minutes.

The labels of small components, such as R12 or C7, are deliberately not printed on the board. With about 500 parts they would be unreadable. Interactive assembly maps replace them: clicking a part in the list highlights its place, and soldered ones can be ticked off.

Carts and a 25 euro “Tariff”

The agent prepared the import files, I made the carts, and the agent compared the cart export with the list item by item. Payment and confirmation stay with me, as we had agreed earlier.

At the LCSC checkout a line appeared that had not been in the cart: “Tariff” 25.00 EUR. Since July 2026 the EU no longer has a duty exemption for parcels up to 150 EUR, and the shop adds an estimate of the duty and a handling fee.

Line at the LCSC checkoutAmount
goods (94 items)75.09 EUR
discount on goods−2.89 EUR
shipping after discount3.96 EUR
“Tariff”25.00 EUR
total101.16 EUR

The agent got it wrong twice here and admitted it twice. First it advised “order now” on the basis of shipping alone, then withdrew the advice until the full cost was visible. Later, for a moment, it painted a worst-case scenario in which duty is charged on each of the 94 items, which would have come to about 280 EUR. An analysis from another model, which I pasted in, rightly corrected that: what counts is tariff categories, not cart rows. Whether VAT will still be added when the parcel is collected, I don’t know to this day.

I bought the microcontroller and a few other parts from TME. LCSC did not have the AVR128DB64 in stock at all, and at TME it costs 10.79 zł. The tester’s parts list at TME came to 103.60 zł including VAT. One socket was out of stock there, but I had a suitable one in a box.

Ordered

The JLCPCB quote for 5 sets, 4 layers: top board 36.90 USD, bottom board 49.50 USD, 86.40 USD in total plus shipping and VAT, which by my estimate is about 520 zł. On the evening of 16 November I ordered the tester board.

Related posts

Comments

No comments yet

Leave a comment

Your email address will not be published. Comments appear after approval.