Learn

Export a Mokxi circuit to a KiCad schematic

Intermediate

Or see every lesson.

  • 500parts on the bench
  • 43boards running now
  • 1.00xreal time, on every board
Arduino Uno traffic light with a 74HC04: the circuit to exportlive0.000 s 0.00x
Hold the button
Open it in the editor, then More and Schematic to see the sheet the KiCad file is written from.

You built a circuit on the breadboard, ran the sketch, and it works. KiCad is where many people go next, because it is the free, open-source tool most hobby boards are laid out in. Mokxi writes the circuit as a KiCad schematic file (.kicad_sch) and a KiCad netlist (.net), so you do not draw the schematic a second time by hand.

The export comes from the Schematic view, which draws the breadboard as a schematic beside it. What counts as connected in the file is exactly what the simulator uses: a part in a breadboard row is joined to everything else in that row, so the nets in KiCad are the nets that just ran.

The circuit above is the built-in Traffic light: an Uno, three lamps, a crossing button and a 74HC04 inverter chip. It is a good first export, because it has standard parts (resistors, LEDs, a switch) and a chip that has no symbol in KiCad’s library, and the two are handled differently.

The steps, from the breadboard to KiCad

1. Open your project in the editor (or the Traffic light above, with Open in the editor). Press the round More button on the canvas toolbar, then Schematic. On a computer the sheet opens beside the breadboard; on a phone it takes the canvas, with tabs along the top.

2. Press the Export button on the schematic (an arrow pointing down into a tray). The menu lists PNG image, SVG file, Print or PDF on Letter or A4, KiCad schematic and KiCad netlist. Choose KiCad schematic. The file downloads as your project’s name followed by -schematic.kicad_sch. Choose KiCad netlist as well if you want the .net file.

3. In KiCad, make a new project, close it, and put the downloaded file into the project’s folder in place of the empty sheet KiCad made, under the same name as the project (traffic-light.kicad_sch for a project called traffic-light). The project’s root sheet is always the file named after it. Open the project again and the Schematic Editor shows your circuit.

4. Assign footprints: Tools, then Assign Footprints. Mokxi leaves every Footprint field empty on purpose, because only you know whether that resistor is a 0207 through-hole part or an 0805 chip. Pick a footprint for each symbol, including a pin header or socket for a module or a board.

5. Open the PCB Editor and use Tools, then Update PCB from Schematic (F8 does the same). The parts arrive with their ratsnest lines, ready to place and route.

What is in the file

Parts that have a symbol in KiCad’s standard library are written as that symbol, with the library’s own pin numbers: Device:R for a resistor, Device:LED, Device:C and Device:C_Polarized, Device:R_Potentiometer, Device:Q_NPN_BCE for an NPN transistor, Device:Q_NMOS_GDS for an N-channel MOSFET, Switch:SW_Push for a push button, Motor:Motor_DC and others. Every part keeps the value you gave it in Mokxi, so a 220 ohm resistor is 220 in KiCad too.

A board, a module or a chip (the Uno, an HC-SR04, the 74HC04) becomes a box of its own, named mokxi: and the part’s type, with its pins numbered 1 to n and named as on the part. A schematic file has to carry every symbol it uses, so these boxes are written into the file itself. You do not need a mokxi library installed for KiCad to show them.

There are no wires on the sheet. Each pin of a signal net carries a local net label, and each pin of a power or ground net carries a power symbol (GND, +5V, +3V3, or VCC with the rail’s name). Pins with the same label are connected, which is how KiCad reads it too, so a long run across the sheet can never be redrawn wrong. The title block has the project’s name, the date and mokxi.com.

Which KiCad version opens it

The schematic is written in the KiCad 8 file format (the header says version 20231120). KiCad 8 opens it, and so do later versions, which read older files. KiCad 7 cannot open a KiCad 8 file and says the file was made by a newer version; install a current KiCad from kicad.org, it is free.

The netlist is KiCad’s S-expression format, the one the PCB Editor imports with File, then Import, then Netlist. Its footprint fields are empty for the same reason as the schematic’s, so the netlist is mainly for checking the connections or feeding another tool. For a board, go through the schematic and Update PCB from Schematic, which is the route KiCad’s own manual recommends.

Common errors, and the fix for each

KiCad says the file is from a newer version: you are on KiCad 7 or older. Update KiCad; the format cannot be read backward.

Update PCB from Schematic reports parts with no footprint: step 4 was skipped. Every symbol needs a footprint before it can become copper. The modules and the board box need one too, usually a 2.54 mm pin header with the same number of pins.

The Electrical Rules Check says a power input pin is not driven: KiCad wants to see where power comes from, and a sheet of power symbols does not say. Place a PWR_FLAG symbol on the +5V net and the GND net, the standard fix in any KiCad project.

The rules check warns that the mokxi library is not found: the board and module boxes live in the file, not in a library on your computer. The warning is harmless. Leave those symbols alone when you use Update Symbols from Library, or lower that check’s severity in Schematic Setup.

A connection you expected is missing: check the breadboard. A wire that ends one row away, or a part that straddles the center channel on the wrong side, is a missing connection in the simulator too, and the export writes what the simulator saw. Run the circuit first; if it works, the nets are right.

Or stay in Mokxi for the board

KiCad is the right tool for a board with surface mount parts, four layers or a careful layout. For a simple through-hole board or an Uno shield, Mokxi has a PCB view of its own that lays the same circuit out, routes it, checks it and writes Gerber files a fab house takes, without leaving the browser. The PCB view help article, linked below, covers its footprints, routing, design rules and the fab files.

Questions

Is the KiCad export free?

It is part of Pro, with the other exports of the Schematic view. Every account can try Pro free for 14 days with no card, and students in a class and teachers during the class trial have it too. On Free the Schematic view still opens and shows your circuit, and the KiCad items in its Export menu open the Pro offer.

Which KiCad versions can open the file?

KiCad 8 and later. The file is written in the KiCad 8 format, which KiCad 7 cannot read.

Does the export include footprints or a PCB layout?

No. Every Footprint field is left empty for you to choose in KiCad, and the layout is done in KiCad’s PCB Editor after Update PCB from Schematic. If you would rather lay the board out without KiCad, Mokxi’s own PCB view does that for through-hole parts.

Why are there labels instead of wires?

Every connection is a net label or a power symbol on its pin, so the connections in KiCad are exactly Mokxi’s nets and no wire can be routed to the wrong pin. You can draw wires over them in KiCad if you prefer the look; the labels keep the meaning either way.

Can I bring a KiCad schematic back into Mokxi?

No. The export goes one way, from the circuit you simulated to KiCad. Keep the Mokxi project for running the sketch and the KiCad project for the board.

Build this for real

Open the editor, change a value and watch the number move with it. Nothing to install, and no account needed.