How to connect modular (stacked) PCBs

Hi,

I want to modularize a photodiode circuit. There is one PCB for power management, one PCB with the detector and another one for analog / digital preprocessing.
These PCBs should be stacked on top of each other like an Arduino shield.
The (pin header) connector would give power to each PCB and allow to share analog signals between the PCBs.

For every PCB I have an own (hierarchical) schematic sheet in KiCad. However, I am not clear on how to connect these sheets together.

For example, if Board 1 supplies a voltage to the connector, how do I tell KiCad that Board 2 will get power through the connector from Board 1 even there should no trace that connects them?

Any further suggestions on how to organize such a setup?

On the right side you will see some ‘labels’. My designs are simple and I just use plain labels. Global should do the trick for you but I’m not sure about the hierarchical since I’ve never needed that. Should be enough info to get you going until the real answer shows up from the knowledgeable people. :wink:

@hermit I think you misunderstood. The two boards are not intended to have a physical connection between them.

@bodokaiser KiCad is not really a system desing tool but a pcb design tool. in this case you will need one project per pcb.

There is also not really much need for kicad to know specifics of your other board. So you can simply use a normal connector symbol and add text labels for your own convinience. (plus power flags to tell ERC where power is supplied as you would with any other supply connector.)

Another option would be to design a specialized symbol for your second board. If you have multiple connectors that must be aligned perfectly you could even make a footprint that already takes care of this. (Be aware that you in this case loose the option to have a entry for every connector in the pos file needed for automatic assembly.)

1 Like

I have done this, it’s like an Arduino or RPi “shield”. Holes for pin header connectors, and also castellated edges.

It’s extremely handy to import one board to FreeCAD StepUp, export STEP/wrl models and attach them to the footprint. That way it’s possible to check the connections visually and have the whole system in one view.

1 Like

At the current State of KiCad, each project is one PCB., as Rene already mentioned, which means 3 separate projects for you.

I would add a 4th project though.
A project which just has the board outline, mounting holes, connector layout and other stuff that is common to all PCB’s.

Then, for the other projects, you can first make an empty PCB file by starting Pcbnew from the project manager. Then EXIT KiCad (Whole KiCad, including the project manager). Then start Pcbnew directly. (For example by right clicking the PCB in your OS’s file manager. Pcbnew is now in “Standalone” mode. which enables some extra options, but also looses some.

In standalone mode you can:

Pcbnew / File / Append board

and then select the template board with the connectors etc.
After importing, save the PCB, exit Pcbnew, and start it again via KiCad’s project manager. This is needed for synchronisizing Eeschema with the PCB.

If your board uses the “arduino” PCB format, you may want to look at KiCad’s demo projects (may be a separate insall) and at the “Module” Footprint library, which has board and connector layout for several arduino’s the Maple_Mini and some other boards.

For the schematic…
(I’m brainstorming here, I have not tried it myself).

If you have 3 separate projects for your assembly, you can start a 4th project for a schematic, and make the schematic hierarchical, and for that project you can then point to the location of the other projects for their schematics.
With this, you can then pull hierarchical labels from those 3 sub projects into the overview, and you can switch fast between the schematics of those 3 projects without leaving Eeschema.

Maybe you can combine this to do ERC checks over the whole project. In you “overview” project you would then draw some busses to connect the other 3 projects together. Maybe even put the “PWR_Flag” symbols on your overview project.

----- 8< --------- 8< --------- 8< --------- 8< ----
Unrelated:
Recently there was a post about changing the sheet numbering for printing (on paper) order, and that got me thinking. What if a hierarchical sheet was treated in Eeschema just the same as any other schematic symbol. Then it would get assigned numbers with the normal annotation method. You can manually change those numbers if you want, and you can also add a # before a sheet name to surpress everything in that sheet when making netlists.

1 Like

You could design one pcb with 3 x snap off sections.
The pcb interconnections between the sections could be on a third layer, unused in the pcb manufacture.
This way, the design rule check will be ok.

1 Like

Thanks for the great amount of input!

Do I understand you correctly, that the 4th project would be used to combine the different PCBs so one can manufacture them together?

So in this case, we workaround the KiCad limitation of one PCB per project?

Doesn’t this overwrite the schematics of the other projects?

I guess I’m still not 100% sure what you want to end up with. It sounds like you have one schematic with different boards? Having everything in one schematic is needed for project legibility. Kicad has the limitation of one physical board per project because I think that’s what the board outline will enforce.

I’m not sure where the cut and paste is but I think I’ve read that using standalone mode you can cut and paste between projects. This might be what you need to do depending on how you plan to have the boards manufactured. If this is more of a small scale project and you want to use the cheaper places with a 100mm x 100mm limitation this is the route I’d go if you can’t fit more than one board into that space. That way you have your ‘master’ and then sub projects for the actual board manufacture.

This is called a panel, and KiCad does not have real built-in support for panels yet.
I assumed that you wanted to make a stack of PCB’s such as with PC104.
This would dictate same locations for mountingholes, connectors (aso board outline, sort of).

Part of my intention for you was to use the 4th project only as a template for the board outline, connector locations and mounting holes, but it can also easily hold some extra documentation / info.

Ah yes, it does overwrite when you create hierarchical sheets, so at least make backups while experimenting. I was juggling a bit with hierarchical sheets and multi-PCB design. I let KiCad create an empty hierarchical sheet, then exited KiCad, deleted that empty sheet and replaced it with a sheet with stuff on it.
Then started KiCad again, went down the hierarchy, and found the sheet with components. With this manual copying you can share schematic files between different projects.

No it does not seem to enforce this. Part of my experiments today was to de-couple a hierarchical design into 2 separate PCB’s in one project. There is a netlist limitation. If you have 2 PCB’s which share global labels (Such as GND!) then you will always have DRC violations.

In the end I have a single project with 2 PCB’s, and no DRC violations in Pcbnew.
First I made sure that there are no physical connections between the 2 PCB’s.
I did that by disconnecting the wires from the Hierarchical sheet, and placing a connector in front of it.
image
The blue text in the middle is just a simple text block for documentation.

For the Connector I used a simple RJ45 footprint. The matching connector is on the hierarchical sheet:
image

In Pcbnew it looks like this:


As board outlines I simply made 2 rectangles made up from separate lines.
Just ignore the zone outlines. I alsways make them bigger than the board and with weird angles. This way, if the outlines are not properly clipped when generating gerbers, the error is easy to spot.

In the 3D viewer it looks like:


(I did not bother to add 3D models for everything, but both RJ-45’s are easy to spot.

KiCad has no knowledge of the cable and can therefore not do any error checking over it. But in my design it’s only 4 wires, and by putting the connector next to the Hierarchical sheet this eases error checking. This is no guarantee. The hierarchical labels in the other sheet may be connected in the wrong order to the connector for example, and KiCad won’t know it.

There is quite a lot of flexibility buit into KiCad, and that is why I like it a lot. It is without doubt the only PCB package I really liked in about 20 years or so. What sort of mix and match works best for your design I can not tell.

Last time I tried to put an edge line to separate two boards I know the 3D viewer didn’t seem to like it. (Same design that I simply doubled because I had the space so it was ‘free’) Might have worked if I had to separate rectangles? Who knows. :wink: This is different than the results I got but I don’t know if I was still on 4 when I did that or not. You’d have to check with your board house as to whether they can accept a PCB design like this.

The 3D viewer is pretty finicky when it comes to closed outlines.
If I open the board outline by moving one of the end points of the lines, my current KiCad V5.1.0 complains with:
image

They very likely would not like it and probably would even reject it.
It was just a quick demo. For a real board you have to make the spacing between the boards right, put “conveyor guides” on the sides, add mousebites to connect the PCB’s and other things…
This quick demo gives a bit of confidence though that KiCad has matured enough now to attempt real boards in the way I described.

Understood. Just wanted that to be clear.

This topic was automatically closed 90 days after the last reply. New replies are no longer allowed.