Search This Blog

Radio Guy Tees

Radio Guy Tees
Radio Guy T-Shirts

Saturday, 28 November 2026

Agentic AI Meets KiCad: Designing a Real PCB with Codex and Konnect-EDA

Agentic AI Meets KiCad: Designing a Real PCB with Codex and Konnect-EDA

How I used an AI coding agent to turn a conventional electronic schematic into a professionally manufactured PCB, without becoming an expert in PCB layout.

Beyond asking AI for advice

I’ve been experimenting with artificial intelligence in my electronics workshop for some time, but a recent project introduced me to something quite different: agentic AI.

Most of us are familiar with asking an AI chatbot a question. We might ask it to explain a circuit, calculate a resistor value, interpret a datasheet or help diagnose a problem. But what if, instead of telling us how to operate a piece of software, AI could actually operate that software on our behalf?

That was the idea behind my latest experiment.

I had developed a linear power supply based on the familiar LM723 regulator IC, with a TIP3055 external pass transistor producing a regulated 5 V output. The circuit also incorporated 9 V and 3.3 V auxiliary regulators.

I already had the schematic drawn in KiCad, but my experience of PCB layout was limited. I understood the circuit, but selecting footprints, positioning components, routing copper tracks and preparing manufacturing files were less familiar territory. I decided to find out whether agentic AI could bridge that gap.

The result was a fully routed, two-layer, 120 × 100 mm PCB, manufactured in China and delivered to the UK just five calendar days after ordering. The interesting part, however, was how we got there.


The software involved

Three applications formed the core of the system.

KiCad 10 was the electronic design environment. It contained the schematic and PCB files, provided component libraries and performed electrical and physical design checks.

OpenAI Codex was the AI agent. It can access tools, inspect files, execute supported operations and make changes to projects.

Konnect-EDA, developed by Orchis.ai, provided the connection between Codex and KiCad, exposing PCB design and verification operations that an agent can invoke.

The Model Context Protocol (MCP) lets Codex discover and invoke tools provided by Konnect. KiCad’s Inter-Process Communication (IPC) interface lets Konnect interact with the running PCB Editor.

The practical arrangement was:

ChatGPT → Codex → Konnect-EDA → KiCad

I used ChatGPT as the engineering and planning assistant, discussing the circuit, identifying risks and developing prompts. I copied those prompts into Codex, which used Konnect’s tools to inspect and modify the actual project. KiCad remained the authoritative design environment.

This distinction is important. ChatGPT was not remotely controlling my desktop, and Codex was not generating pictures of PCBs. It was interacting with an editable KiCad design.

Getting everything connected

My desktop runs Linux Mint. I initially had KiCad 7, so I upgraded to KiCad 10, as required by the Konnect version used. I installed Konnect through KiCad’s Plugin and Content Manager, and installed Codex separately as a command-line application.

Versions used in this experiment:

  • KiCad 10.0.8
  • Codex CLI 0.170.0
  • Konnect-EDA 0.14.1

After authenticating Codex with my ChatGPT account, I registered Konnect as an MCP server. The registration command has the form:

codex mcp add konnect -- /path/to/konnect --client codex

To inspect registrations:

codex mcp list

I enabled the KiCad IPC API in its main Plugins preferences. The running PCB Editor then created the Unix domain socket:

/tmp/kicad/api.sock

It wasn’t all seamless. Initially Codex could communicate with Konnect but could not expose some dynamically loaded tools. We configured Konnect to load its toolsets at startup using eager_toolsets = true. We also found that KiCad needed to be open for live operations, that starting a fresh Codex session sometimes restored the connection, and that file-locking required care when distinguishing saved-file edits from live IPC edits.

These were real integration difficulties, not an entirely effortless installation. Once communication was established, though, the design work became remarkably straightforward.

The key to success: controlled prompting

I deliberately avoided asking Codex to simply take the schematic and produce Gerber files. That would surrender too many engineering decisions in one step.

Instead, ChatGPT helped me write a series of prompts. Each specified an objective, constraints, changes that were forbidden, and verification steps. After each operation, I examined Codex’s report and inspected the result in KiCad.

The following extracts are shortened examples from the actual prompts. Our complete instructions included further checks and safeguards.

Prompt example 1: Audit the schematic

Using the Konnect MCP tools, inspect the KiCad project currently open in the PCB Editor, including its associated schematic.

This is an inspection and planning exercise only. Do not modify the schematic, PCB or project files.

Our objective is to manufacture a professional, entirely through-hole PCB for an LM723-based linear power supply.

Component requirements:

  • All components must be through-hole. No SMD.
  • Standard 0.25 W axial resistors, except the current-sense resistor.
  • Radial electrolytic capacitors rated at least 25 V.
  • Two-lead through-hole ceramic capacitors.
  • DIP package for the LM723.
  • TIP3055 transistor may be chassis-mounted.

Enumerate every component, identify missing footprints, recommend suitable KiCad footprints and run an electrical rules check. Return a structured report and clearly identify any assumptions.

Codex identified missing footprints, package questions and ERC warnings. This wasn’t generic advice about LM723 circuits: the agent had interrogated the actual KiCad schematic.

Creating a custom footprint

One useful example concerned the 0.47 Ω, 3 W current-sense resistor. I had a physical resistor but did not know which footprint to select. I measured it:

  • Body length: 15.75 mm
  • Body diameter: 5.0 mm
  • Lead diameter: 0.62 mm

We selected horizontal mounting with 22.86 mm pad spacing and 0.9 mm finished holes.

Prompt example 2: Custom footprint

Using Konnect and the KiCad footprint tools, prepare a custom through-hole footprint for R6 in the Discrete PSU working project.

Component: 0.47 ohm, 3 W axial metal oxide resistor.

Measured dimensions: body length 15.75 mm, maximum body diameter 5.00 mm, lead diameter 0.62 mm.

Use horizontal mounting, 22.86 mm pad spacing, 0.9 mm plated holes and 1.8 mm copper pads. Create fabrication, silkscreen and courtyard outlines.

Save the footprint in a project-local library named Discrete_PSU.pretty. Verify pad numbering, drill sizes and library loading. Do not modify the PCB layout.

Codex created the footprint, registered the local library and assigned R6. When the PCB arrived, the physical resistor fitted its custom footprint correctly.

Component placement

Once the schematic and footprints were ready, I used KiCad’s native Update PCB from Schematic command to transfer the components to the PCB Editor.

Codex then arranged 26 electrical footprints, leaving space for accessible connectors, heatsinks and four mounting holes. The main power connectors were grouped together; LM723 control parts were clustered centrally; and the auxiliary regulators were placed near an edge with room for heatsinking.

We deliberately chose a generous 120 × 100 mm board, favouring ease of assembly over minimum area.

Routing in controlled passes

Routing was perhaps the most impressive part of the exercise. We split it into stages: high-current paths, LM723 current sensing, remaining supply rails, feedback and control circuitry, and finally the back-copper ground plane.

Prompt example 3: Power routing

Using Konnect’s live KiCad IPC tools, perform the first controlled power-routing pass.

Route only these connections:

  1. J1 pad 2 to J5 pad 2: 13V8_PROTECTED.
  2. J5 pad 3 to R6 pad 2: Q1_EMITTER.
  3. R6 pad 1 to J2 pad 2: 5V_MAIN.
  4. J1 pad 1 to J2 pad 1: GND.

Use 1.5 mm tracks for the designated high-current connections where DRC permits.

Preserve access for separate LM723 current-sense traces directly to both R6 pads.

Do not route other connections, modify components, add copper zones or generate Gerbers.

If a connection cannot be routed safely, leave it unrouted and explain why. After routing, save the PCB, run DRC and report widths, vias, unrouted connections and violations.

Codex routed the three positive-supply connections and deliberately deferred the ground return, recognising that it could be better served by a copper plane.

Prompt example 4: Current-sense routing

Read the live pad-to-net assignments for U1 pins 2 and 3 and R6 pads 1 and 2.

Verify the connections against the schematic and LM723 pin functions. Route the verified sensing connections directly to the appropriate R6 pads.

Use 0.30 mm tracks, preferably on F.Cu, with no vias where practical.

Join the sensing traces at R6’s pads rather than at arbitrary points on the 1.5 mm current-carrying tracks. Preserve the existing power routes.

If the schematic topology prevents two direct connections, stop and explain why rather than inventing connections.

This mattered because the regulator measures voltage across R6 to limit current. A trace picking up voltage along a high-current copper track could include an unwanted resistive drop. The agent completed both pad-end sensing paths.

We subsequently reviewed the feedback pickup too and routed a dedicated voltage-sensing trace from the 5 V output connector.

Ground plane and checking

Codex added a GND copper zone on the reverse side of the PCB and reported one connected copper region, with no isolated islands. The final design had no unrouted connections and no electrical design-rule errors.

A later read-only interrogation of the live board confirmed 30 footprints, including four mounting holes, 102 copper track segments and one via.

DRC is invaluable, but it doesn’t establish that every engineering choice is sound. We still had to check packages, current-carrying conductors, feedback topology, physical clearances and thermal performance.

When the agent decided not to change something

I noticed a tight-looking trace between two LM723 pads and proposed a route through a more open area beneath a nearby resistor.

Codex measured 0.32 mm clearance on either side of the existing 0.30 mm trace and a total route length of 24.72 mm. Its proposed alternative was around 45 mm and risked introducing a different constriction in the ground plane.

It recommended leaving the track alone. I agreed.

A useful agent isn’t necessarily one that makes every change suggested to it. Sometimes the best result is a measured explanation for retaining the original design.

What still needed human intervention?

Konnect couldn’t perform every operation. I used KiCad manually to transfer the schematic to the PCB and to finish some silkscreen adjustments. We also dealt with file locks, connection failures and missing model references.

The 3D Viewer originally showed a bare board because several footprints still referenced older KiCad 6 model paths. After verifying the correct KiCad 10 STEP model, Codex updated 24 obsolete references without disturbing the routing.

This was a productive partnership rather than a hands-off automation exercise.

Manufacturing

KiCad generated Gerbers for the copper, solder masks, silkscreen and board outline, along with Excellon plated and non-plated drill files. I zipped them and submitted the job to PCBWay.

The order was placed 18 November 2026. The boards arrived from China on 23 November, five calendar days later, including manufacture and international delivery. That was the result of this order, not a guaranteed turnaround.

The real board provided the ultimate check: components fitted the selected footprints, and the completed supply operated correctly.


Did AI make a better power supply?

I built the same circuit using traditional dead-bug construction on copper-clad board. That version took less than 40 minutes to build and worked at first power-up.

Both supplies later produced the same voltage readings to the displayed resolution during a 0–1 A load test: a fall of just 5 mV across the range.

Noise was also very close. With the same oscilloscope settings at 1 A, the dead-bug version measured approximately 87 µV AC RMS, compared with 81 µV AC RMS for the manufactured board. The difference was too small to establish a meaningful electrical advantage.


The PCB did not magically improve a circuit that already worked well. Its benefits lay in predictable construction, robustness, repeatability and the ability to produce multiple identical boards.

What made the prompting effective?

The most useful prompts shared four characteristics:

  1. An objective: exactly what the agent should accomplish.
  2. Constraints: component packages, track widths, spacing, electrical requirements and limits.
  3. Restrictions: which files, nets and geometries it must not change.
  4. Verification: what to check and report before the operation was accepted.

Incremental changes and verified backups were particularly useful. At several stages Codex stopped rather than risk changing a locked file or making an unsupported modification.

The final responsibility for judging the design remained with the experimenter. Even a fully routed board with zero DRC errors can contain poor engineering choices.

Final thoughts

Dead-bug construction and stripboard remain excellent ways to experiment, make quick changes and assemble one-off projects. Agentic AI doesn’t make them obsolete.

What has changed is how approachable professional PCB design can be.

KiCad, Codex and Konnect-EDA let me move from an existing schematic to editable manufacturing-ready PCB files without manually mastering every aspect of component placement and routing.

For me, that is the compelling part of agentic AI: it doesn’t replace the experimenter, but makes sophisticated tools more accessible through natural-language instructions.

And having the finished boards arrive five days after ordering was a satisfying conclusion.

Software and further reading

Software versions and behaviour described here relate to the November 2026 experiment. Installation procedures and supported capabilities may change.

This was an independent technical experiment. The work was not sponsored by PCBWay.

Wednesday, 25 November 2026

Is Your LM2596 Really an LM2596?

A Simple Test for Suspect Buck Converters

During the development of a power supply for my 144 MHz and 432 MHz masthead preamplifiers, I spent some time experimenting with the inexpensive DC-DC buck converter modules that are widely available online. These particular modules were fitted with what appeared to be LM2596 adjustable voltage regulators.

Whilst investigating the noise generated by one of these modules, I discovered something rather interesting. The switching frequency was approximately 55 kHz. According to the manufacturer's datasheet, the LM2596 has a nominal switching frequency of 150 kHz.

Something clearly wasn't quite right!

Replacing the IC

Rather than consigning the module to the bin, I obtained some onsemi LM2596-ADJ devices from a reputable component supplier and replaced the IC on the existing PCB. All the other components remained unchanged.


Figure 1: The DC-DC converter module following replacement of the LM2596-ADJ.

With the modified module powered up, I connected an oscilloscope to pin 2 of the LM2596, which is the switching node connected to the inductor and Schottky diode.

The measured switching frequency was now 150 kHz, exactly as expected.

Interestingly, the older LM2576 regulator operates at a nominal switching frequency of 52 kHz. Whilst the original device may have contained silicon based on this or a similar design, there is no way of establishing that from the switching frequency alone.

Some basic performance measurements

Having established that the replacement device was operating at the correct frequency, I set about making some basic measurements with a nominal 12 V input and an output adjusted to approximately 5 V.

The results were as follows:

Load current (mA) Output voltage (V) Input current (mA) Efficiency
0 5.065 9.02 N/A
50 5.031 37.5 55.9%
100 5.011 64.2 65.0%
250 4.977 141.8 73.1%
500 4.972 273 75.9%
1000 4.960 578 71.5%

The output voltage fell by just 105 mV between no load and a load current of 1 A. Between 250 mA and 1 A, the variation was only 17 mV.

The efficiency figures are calculated assuming a constant 12 V at the module input. Whilst the efficiency is not particularly impressive by modern switching regulator standards, the module is clearly functional following replacement of the IC.


Figure 2: Calculated conversion efficiency against output load current.

Testing your own modules

If you have some of these LM2596 modules in your component collection, it might be worth spending a few minutes checking them.

Connect a suitable DC supply, adjust the output to 5 V and apply a modest load. Using an oscilloscope with a ×10 probe, measure the switching waveform at pin 2 of the regulator, with the probe ground connected to the module's ground.

Under normal operating conditions, you should see a switching frequency close to 150 kHz, corresponding to a period of approximately 6.67 µs. The onsemi datasheet specifies a frequency range of 135 to 165 kHz at a junction temperature of 25°C.

Conclusions

Whilst a switching frequency measurement cannot conclusively establish the authenticity of a semiconductor device, the difference between 55 kHz and 150 kHz is far too large to be explained by normal manufacturing tolerances.

The fact that replacing just the IC corrected the switching frequency provides fairly compelling evidence that the original component was not operating to the LM2596 specification.

Of course, none of this establishes how electrically quiet the modified module is, particularly when used in proximity to sensitive amateur radio receiving equipment. That is perhaps an experiment for another day.

It does, however, serve as a useful reminder that the markings on a semiconductor package are not necessarily a guarantee of what is inside!

References

73, G0MGX

Monday, 9 February 2026

Experimenters' Corner

 Well,

Since November '25, a lot of my musings are heading into a new monthly column I am authoring in the RSGB magazine RadCom.

Experimenters' Corner is intended to be an outlet where I hope to inspire others to have a bash at coding, 3D printing, general bodging or just having a go.

So far there have been a few interesting topics covered, but there is much, much more to come.

I hope you like it.

Wednesday, 3 December 2025

It's CQWW CW

 Well,

Last weekend was the CQ WW CW contest - always a good opportunity to make some rare and distant contacts.

I've never seen the bands so busy, propagation was amazing and there were simply signals everywhere:




As is tradition, here is my log as a map:

I didnt spend a great deal of time in the contest, but it was certainly fun!

Friday, 15 August 2025

Can you still beat the Cube?

Well,

In a feable attempt to prove that I can still write some code, I've been writing software to program the ADF4351 from last time using the STM32CubeIDE and a Nucleo board. The Nucleo boards are really neat because they are from the manufacturer so there is no risk of counterfeit devices, and they are also really low cost for the component count - they even include an on-board STLink programmer (which containst an MCU itself). Amazing really.

The first part of the development is to define the additional GPIO pins needed, in this case we need a CS line (for chip select - only really needed if we have more than one device), and the LE pin which is toggled after each registers data is sent.


Once thats done, I've defined a few variable to help me on my way:


Then we have the main routines:


And finally the output of the SPI pins viewed through a logic analyser:


This is exactly as required.

STM32 provide the HAL (Hardware Abstraction Layer) library to give access to the MCU periferals and also the CMSIS library to access the internal CPU (which is an ARM Cortex from a 3rd party).

Using the Nucleo boards is very easy with STMCubeIDE, but can also now be programmed with the Arduino board manager addon for STM32.

I will now try and generate the same output using the Arduino IDE and see how I fare.

Interesting, don't you think?






Wednesday, 13 August 2025

It's Pill Time again

 You may recall that I used the SDM32 MCU range quite a lot and also the "Blue Pill" board for a lot of my projects.

Recently the board support package that I was using in Arduino has become depreciated and I wanted to document how I now use the boards with the Arduino IDE.

Firstly, in board manager I have added this to the "additional URL's" section:

https://github.com/stm32duino/BoardManagerFiles/raw/main/package_stmicroelectronics_index.json

This is the official board support file from the manufacturer.

Once that is complete, then you also need to install the STMCubeProgrammer, also from the manufacturer.

Once done, there are a number of options to upload from the IDE to the board, most require messing about with the boot jumpers, but there is a HID bootloader we can instal on the board for permanent conenctivity between the IDE and the board. Note the boot jumper settings below:


We then use the STMCubeProgrammer application to connect to the board using the FTDI COM port.


We can then download the appropriate binary from the selection here.

It's critical that you get the correct binary bootloader uploaded, I used the medium density PC13 for my board (PC13 is the pin the onboard LED connection).


Once loading is complete, move the boot jumper back BEFORE removing power, then bob is indeed your uncle.

Inside the IDE, I then used the following settings:


One of my boards didn't work using this method and I strongly suspect a counterfiet device - beware!



The Black ADF4351 Boards

 Well,

Some time ago, I did some expermimentation with black ADF4351 evaluation boards that are available at all good sites selling wares from the land where copyright means "lets copy it right".

I've bought some more recently and found that I couldn't get them to work.


Thanks to this post, I was able to deduce that the newer boards seem to be missing some bits - most importantly the CS line isn't tied high by a SMD resistor. Once I had pulled that pin high via 10K to the 3V3 line, the board worked as expected.

I've been using mine with a Pi Pico2:


You can see the additional 10K on the fritzing diagram above.

I have written some very simple code here to upload the register values to the device, and also have a spreadsheet here that will do the necessary maths from a target output frequency, channel spacing and clock frequency and generate the 6 register values needed to program the device.

Good stuff!