Getting started with KiCAD for sim panels - MobiFlight/MobiFlight-Connector GitHub Wiki
So lets make a new project with KiCAD. You will have two files in the project: The _PCB_and the schema.
Lets create the schema
Even though we are looking for a PCB design in the end, we should start with a schema first, to make routing the connections easier later.
So our example is an classic analog audio panel as found on many older GA aircraft:
We can identify the following switches:
- rotary switch with 3 positions for MIC selector
- 9 toggle switches with 3 positions each
And the following leds:
- 3 marker leds
There is also a round thing on the bottom edge of the panel, that could possibly be a photocell to adjust a backlight to turn on when it is dark but lets not go there since it's maybe a bit out of the scope for this tutorial anyway.
So we can identify the following connections:
- GND (of course)
- MIC COM1
- MIC COM2
- MIC EXT
Most 3-position toggle switches are ON-OFF-ON type, so they use 2 pins each. We can also just choose to ignore the SPEAKER and use two position toggles, which would work fine as an audio panel, most people use a headset anyway. But we can wire them both here just to cover the case of three position switces.
- AUTO (SPEAKER and PHONE)
- COM1
- COM2
- NAV1
- NAV2
- ADF
- DME
- MKR audio
- Marker lights brightness
And the leds:
- Inner marker
- Middle marker
- Outer marker
So GND, 21 switch pins and 3 leds would be 1 + 21 + 3 = 25 pins for the IDC connector if I calculated right.
Adding symbols to the schema
Lets edit the schema and lay this out. When you doubleclick the schema in KiCAD main window, you get the schema editor with an empty page. Lets click the "Add symbol" tool.
We are laying out symbols at this point, so we need to think of functionality. We have the following types of components:
- Leds
- A rotary switch
- Three position toggle switches
Lets look. You get the "Choose symbol" window that has a ton of components that KiCAD comes with. Lets look up the led first. Typing "LED" in the search field, we see "LED" under "Device" category, this is what we want, and on the right side we have options to select footprints. These are two things: The symbol is in your schematic, and the footprint is what gets placed on the PCB.
You can pick a footprint from the selector that says "No default footprint" by default. But if you are unsure, just don't pick any at this point, the footprints can be changed later. Sometimes we also need to create our own, which is not impossibly hard either.
Leds
But now we want the regular 5mm leds in this case, since the panel has clearly space for them. There are two main categories for footprints: SMD (surface mount) and THT (through-hole). Look up "LED THT 5mm" that is the most common basic LED. That'll do great here.
Make sure the "Place repeated copies" is checked, and lets place those three leds. Click three times on the schematic page.
IDC Connector
Lets look up the connector next. Searching for "IDC" does not really work, because the schematic symbols are logical components, and the IDC connector is a footprint type, so we cannot find it with symbol search. On the schematic a pin header and a IDC connection, or a parallel port connector are the same: just pins grouped into a connector of whatever type defined by the footprint.
But since the IDC connector is two rows of pins, lets search for "conn_02x25" instead. And under there we see "Connector_Generic" and specifically _Conn_02x25_Odd. Great. Except not, we get twice as many pins as we wanted, and a huge connector.
The naming convention for connectors is based on the number of rows instead of total number of pins! So lets try again with 02x13 (26 pins) and we will find what we want. Two things to consider here:
- There are different pin layouts for 2x13, what I usually like to use is the "odd / even", so the pin numbering is based on the pins on the flat cable, there are also symbols where the pins just walk around the connector like you would walk around a building. Either work, but for now lets choose the "odd even" version.
- The footprint selector now has IDC connectors since it is a two row connector! Lets pick "IDC header 2x13 P2.54mm vertical"
We now found our connector, how cool is that? Lets add it!
Switches
The switches are also logically named. What we are after is "SPDT" "single pole, dual throw" which is a naming convention. What matters is the logical symbol here - a connection on the left is routed to two possible connectios on the right side. Our three position switch will usually have 3 pins, so one of them is GND in the center (3 in this symbol) and two additional pins for the extreme states. Something like this:
There are also 6-pin switches where you can detect the center position as well, but the wiring becomes more complicated. In MobiFlight we can also just assume "no position" means "center", so the 3 pin variant will work for us.
There will be no useful footprints to be found at this point in the selector like with the connector and leds, because there are just so many different kinds of switches, it would not make sense to list them all here. So lets just click OK and place 9 of them on the schema.