Build an Antenna Matching Network with Zener
Module()
or load()
function, coupled with the default package aliases, if the module is already available in the standard library.
However, for both our SMA connector and the antenna, the standard library does not provide a module, so we will need to create a module for each component ourselves.
Each.zen
file is a python module. It can be used in two ways:
- Its exported symbols can be
load()
ed into other modules. For example,load("./MyFile.zen", "MyFunction", "MyType")
will load theMyFunction
andMyType
symbols from theMyFile.zen
module.- It can be loaded as a schematic module using the
Module()
helper. For example,MyFile = Module("./MyFile.zen")
will importMyFile.zen
as a schematic module, which you can instantiate like so:
.zen
file that declares its inputs and creates components. So, with this knowledge, let’s define a component for our SMA connector and antenna.
.zen
file in which we write our component is technically a module. However, since a component must be defined within a .zen
file, we will consider any file that specifies a component using the Component()
syntax to be a component itself.components
directory in the root directory, where we can put both of our custom components.
.zen
file inside of another directory with the same component’s nameio()
declaration! Before we define our io()
s, let’s first import a ground signal, which is require for the SMA connector to work. Then, let’s define our two io
s for the connector, which by convention will be called In
and Ext
with a type of net:
Library link: Connector:Conn_Coaxial_Small
in the bottom left. Then, we can import the symbol with Zener (notice how we append .kicad_sym
). We can do something very similarly for the footprint by looking around in ~/Library/Caches/pcb/gitlab/kicad/libraries/kicad-footprints/...
. Last but not least, the standard library provides some layout functionality, so we can see a preview of the layout.
pcb: View Schematic
button in VSCode:
SMAConnector.zen
file by adding a prefix field to the Component()
function and using a config
.
io()
s:
Net()
s for internal wires/signals:
io()
s are for signals/wires that need to be accessed by other components or modules, while Net()
s should be used for internal signals/wires that should not be exposed to external components or modulesio()
s and Net()
s we just defined:
Layout()
function, so the user can view the layout of the module in KiCad:
EX0001.zen
:
Net()
s: