How to create a symbol array on the schematic with multiple copies of the same symbol?

I want to make a clock face for a GPS clock. I need 60 LEDs for the seconds.

  1. How do I add all sixty to the schematic, at once?
  2. I know that it would not necessarily meet professional schematic drawing practices, but I would also like to lay them out in a circle on the schematic. I know this can be done on the PCB board, but can be done on the schematic? If so, how?

I know that some KiCad tricks can be done with coding, but I know nothing about that. So, if that is what is necessary, please give me step by step instructions.

I know how to duplicate and multiple the duplication. But, I thought there must be a straightforward means to do this.

I thought it odd that my searches produced nothing about multiple symbols. I would have imagined that to be a rather common need.

Thank you, for your help and support.

For me ‘multiple the duplication’ is (and always was) enough.
There are much more important things to work on in KiCad than tools to autoplace symbols at schematic.

The insert key inserts a copy 100mil below the last added one for every time you press it.

However you might consider thinking about using hierarchical design here. I would assume that you will for example have multiple LEDS for every 5th entry. Or that you have your LEDs somehow grouped to reduce the number of GPIOs needed. Every such group could be represented as a duplicate instance of the same schematic.

The schematic represents the function or your system. If you think you need to care where something is on the pcb then you have completely misunderstood what a schematic is.

And no this is not possible as kicad does not support free rotation of symbols as there are file format constrains (so not only because it is simply not needed in professional design).

These kind of things have been discussed before. I know I can’t convert anyone, but I know there are good reasons to make the schematic reflect the physical design. Creating a circular design is of course overdoing it, but at least having the physical pin order in and MCU is completely reasonable for practical reasons.

And creating a circular design because someone just likes it doesn’t mean they don’t understand what a schematic is.

1 Like

Some time ago I did an experiment with using copy & paste as much as possible for drawing a schematic and pcb layout. Aproaching it from the direction of a “drawing program” instead of Schematics / PCB layout was a fun experiment and gave me some insights into shortcuts.

60 LED’s really is not much. How much time does it take to draw this with Copy & Paste? maybe 10 minutes, inclusive the connections?

Alternatively there is the “SKiDL” project that can generate netlists from a python script, so you can use a few nested loops to generate rows and columns of a dot matrix display (keyboard, whatever).

It would be nice if SKiDL can be combined with a schematic. For example you only draw the LED matrix with skidl, and the microcontroller with power supply, connectors etc in a regular schematic. But this is probably not supported.

Te settings for the repeat function with the [Ins] key Rene mentioned is very handy and I made a lot of use of it in my experiment above. The repeat distance and orientation can be adjusted somewhere in the preferences, but it’s just to easy to just repeat a row of auto incrementing labels, and then move and rotate it as a block.

An intermediate approach with hierarchical sheets may be useful. For example you make a hierarchical sheet of a column of 6 LED’s and insert that sheet 10 times. With hierarchical sheets you can also make use of the “Replicate Layout” script. This is a quite nifty script that can save a substantial amount of time during layout if used wisely.

My personal approach would probably be to first make a custom schematic symbol for the LED which is optimized for drawing in a matrix, and then just copy & paste.

Less than figuring out a script to do it. Not to say surfing the net seeking for that script.

That’s exactly the point I tried to make (a mong the onther remarks).

In the tread below RadioBeamer makes test jigs for 500+ pin parts, and apparently it’s his job to make multiple of these rigs. That is where scripts and further automation becomes usefull.

On the other hand, being aware of the Replicate Layout script and knowing when and how to use it seems useful for a much bigger part of KiCad users.

Yes, you could use the insert key shortcut to quickly drop a bunch of LEDs, but that would just drop multiple instances of the generic LED symbol. Then you would need to add other attributes (for example, color, footprint, any ordering information you may want for your BOM, etc) to all the individual copies. The Edit Symbol Fields can take out much of the pain with copy and paste between fields, but another thought might be to place one LED, populate the important fields, and then duplicate. Duplicating in stages you can quickly duplicate with the “C” shortcut 4 times to get 5, then region select and duplicate the region to get 10 and place them in line. Then region select the line and press Ctrl-C to copy the region to the clipboard. Use Ctrl-V and place twice to get 3 rows. Then region select the block and region duplicate and get 3 more rows for a total grid of 10x6 LEDs. Use the auto annotate to number all of these, and then you can move them around your schematic as you like. Note, 60 LEDs in just a simple block still takes up a large area of the schematic page, moving them into a circle will make an even larger schematic page. My sample (which may not have enough room between the LEDs for wiring in a clear fashion) is 4.75x2.75, which is a sizeable fraction in a 10.7x7.25 page (A4 minus border).

You won’t be able to rotate the schematic symbols to any angle other than the 4 cardinal angles. Until there is wire and pin snapping in EESchema you don’t want your symbol pin ends to fall off the grid. (It is safest to keep EESchema on a minimum 0.05" grid for now in EESchema.)

On my sample that I used to double check the process above (you don’t have to follow my exact steps, mix and match the duplicating, regioning, and region cut and paste as makes sense for you) I changed the first reference designator from D? to D-S? to help indicate that these are the LEDs for the seconds, not any other type of diode. If there were minute LEDs and hour LEDs, I would follow suit and call them D-M? and D-H?, respectively. You could also use “Ds?” or something similar for your seconds LEDs. Some others may complain about violating the “rules” of reference designators, but unless you are under corporate rules you have the flexibility to bend the rules for good reasons. Here is what my result looks like (note that is my own custom symbol, based on the standard library but with pin numbers visible).

IMHO, the schematic is primarily for understanding the logic of how the circuit works. Without trying to wire a round layout, my gut feeling is the schematic wires will be more difficult to understand than a matrixed grid. Feel free to prove me wrong, it’s only your time.

As far as a script to automatically lay out the schematic, it would need to be an external script that would read and write to the schematic file directly because there isn’t yet an API in EESchema like PCBNew has for Python scripting. (That is a new feature in PCBNew, implemented there while the limited resources of the coding team worked on lots of significant upgrades to PCBNew, including the new pcb file format. EESchema is next to get a similar update, but it isn’t ready yet.) The external script would need to understand the schematic file format. This in itself isn’t really a show stopper since the file format is freely published, but it will soon be changing making the external script obsolete quickly or in need of major overhaul to read/write the new schematic file format.

You might find this thread helpful - it has an example of a led clock schematic laid out as a grid, much as @SembazuruCDE suggests. I think you will end up with a schematic that is hard to follow if you try and lay it out as a circle. It also goes on to show a scripted way to lay out the actual pcb which might be of help to you. Using the polar coordinate tool is also likely to be useful in the pcb side.

I very much appreciate everyone’s replies and suggestions! You folks are great! Thanks!

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