Convert schematic to symbol?

I want to create a symbol for a component that is a subassembly, and to make the schematic as communicative as possible, I want that symbol to contain a schematic (possibly simplified) of that subassembly. So when the the subassembly symbol is placed on a schematic, it is easier for readers to see how the schematic’s circuit interacts with the subassembly’s circuit.

So the question is: How best to accomplish this? I am using a recent production version of Kicad, 5.1.9.

Clearly if the subassembly data originates with a schematic, it’s only composed of graphic items that can appear in a symbol, plus some lines (wires) and labels, all of which should be distillable into items that can appear in a new symbol. So is there some way to accomplish this?

Not finding one, I did discover Kicad’s Bitmap-to-component Converter. So I thought I might take an image of the EESchema subassembly schematic and use Bitmap-to-component Converter to convert to a .lib file, then add real pins in Symbol Editor.

However, the result of the conversion is a blobby, unusable mess. Evidently, the conversion converts pixels into “P” polygons at low resolution, and is unreadable. A subsidiary problem is that even if the image was acceptable, there seems no way to scale the image in the Symbol Editor or move it relative to the grid. So it would be a great chore to try to scale and pad the image external to Kicad to get it just right to align added pins to the graphic features of the image

So, back to hoping there’s some way to covert schematic to symbol, or schematic to vector graphics and then to symbol. Ideas? Thanks!

[Edit] The linked image is an example similar to what I want to achieve, though I am focusing on simply having schematic-like graphics inside the component symbol, not necessarily on arranging the pin positions to match the physical part pins (and also not the specific square pin graphics).

KiCad currently has no support for submodules.

I am also wondering how much graphics you are trying to cram into a schematic symbol. You can zoom in pretty far to make detailed graphics in a schematic symbol readable, but it would be unreadable on a printout, and if you zoom out enough to get an overview, the graphics in the symbol is reduced to little scribbles.

I have an suggestion for another approach:

  1. Make a simplified block diagram for the module and use that as a schematic symbol.
  2. Plot the schematics of your sub module to a .pdf file.
  3. Use that pdf of the sub module as a “Datasheet” link in the schematic symbol.

Thanks for adding to my suspicions that I was barking up an unrewarding tree :-).

I concur that you can zoom into a symbol to see details. That’s not the problem. Indeed it would be fine for the symbol to contain details at 1:1 scale. The problem is how to get the details into the symbol. Ideally copied unmolested from a schematic of the subassembly.

Looks like I’ll have to come up with a workaround.

What you specifically asked may not be possible.

You kind of have 2 topics.

  1. You can create a hierarchical schematic with layers of abstraction at the top couple of layers. These need NOT involve true schematic symbols unless you want. Just use graphics boxes and lines. You could show actual connections if desired.

Use another Hierarchical Sheet to add the real schematic. Add text as desired.

  1. If you need to reuse a schematic page, you can just copy the sheet (file) to another project or copy and rename for multiple instances in a single project.

Have a look at: FAQ
Search for “hierarchical”

@ iabarry Thanks for taking the time to comment. However I don’t think either of your 2 topics pertain to what I’m trying to do. The point is for the reader of the schematic to not have to refer to a separate sheet to see how the subassembly interacts with this schematic. I have updated my original post with a picture to clarify.

Ok. Yes you could do that type of drawing. Place the schematic symbols as desired. Use Labels on the ends of the wires. Use graphics lines for the rectangle. Text for pin numbers.

Consider placing a .png graphic into schematic (use the ‘Add Bitmap Image’ tool/icon). Then, add lines and labels…

Below shows a Blobby graphic via the Bitmap Tool and a PNG added to the schematic via the Add Bitmap Image icon with added wire and label…

@iabarry

Place the schematic symbols as desired.

If I understand you correctly, you are describing how to achieve the visual effect by placing the components onto the schematic that are inside the subassembly. But I don’t want to do this because:

  1. I want the subassembly to be a symbol on the schematic, so I can reuse that symbol on mulitple schematics.

  2. I don’t want the subassembly’s components in the BOM or on the PCB, I want the subassembly itself on the BOM and in the PCB.

I don’t think what you want is supported yet. I too have wanted compound symbols that have their own graphical symbol, footprint and internal connections, and can be added to libraries like a normal symbol.

@BlackCoffee Thanks for going to the effort of demonstrating this method, which I had not thought of.

If I understand you correctly, this simply places an image onto the schematic. That image does not function as a component, does not have pins, will not appear in the BOM nor on the schematic.

However, I see that it would be possible to create a normal component symbol for my subassembly, consisting of just a suitably large outer rectangle and pins with their pin numbers, labels and properties. After placing that symbol onto a schematic, insert the image into the schematic and position it inside the symbol. I see that in EESchema (unlike in the symbol editor) there’s a feature to adjust the scale of the image, and this makes it feasible to align the image graphics to the pins.

Inspecting the resulting schematic file, I see that the image is stored as a $Bitmap object containing hex data for the image. That explains the much better visual result compared to converting the image to a .lib file, which attempts to convert the pixels to polygons.

So that’s not too bad. The main hazards appear to be:

  1. If you want to move the component in the schematic, you have to move both the symbol and also the image.

  2. When inserted into the schematic, the image data takes a disproportionately huge amount of file space, which may or may not be an issue.

  3. Regarding the library and symbol in the library, over the long term, the image file is something you
    have to store and maintain separately from the library component, and remember which image is associated with which subassembly “outline” symbol (perhaps through filename convention).

Nonetheless, definitely a step forward!

Yesterday I had a peek at import possibilities of graphics in the footprint editor, but saw none, so did not respond further.
Later I realized that if you have your graphics as .SVG in the right resolution, you can probably copy the lines with a text editor to a footprint with minimal changes. But it will be finicky to do so. For example increasing Y-axis is downward in KiCad, which may need mirroring before import.

But I would probably take another approach.
If I understand that IC correctly, I would cut it into three sections:

  1. RS485 to “digital logic” converter.
  2. “Digital logic” to RS232 level converter.
  3. Power & Charge pump.

@paulvdh Thanks for your comments. The SVG (or some other vector format) approach was something I briefly considered. As far as I know though, I don’t think that Kicad can output a schematic in vector format. As for the “Y-axis downward”… well actually in a lib file, the Y axis is upward, so that would have been less of a chore!

Regarding splitting the example IC into separate units, yes for that particular example, on closer inspection, that would be a good idea. However, that was just an example to illustrate desired “schematic inside symbol” effect. I don’t have any particular interest in that IC. I’m dealing with subassemblies. The same reasoning could, of course, apply. However, the subassemblies tend not to divide into units so conveniently.

Eeschema / File / Plot / Output Format: SVG

@gwideman your comments are valid.

One option would be to Draw a Circuit in the Symbol Editor - sure, it’s not ideal for drawing but, you can (perhaps) get something useful enough. That would eliminate needing an Image (and it’s large amount of data). Example shown, below… (I quickly doodled some shapes, Lines and Pins to give the Idea…) And, could use high-DPI of image to get nice quality PNG image (exported PNG from Mac after setting DPI…)

Thanks @paulvdh and @BlackCoffee for your responses and suggestions. I took a “quick” detour to create a Python program that converts a schematic into a library symbol. An example is in the image below. Component U901 is the schematic-in-symbol.

2 Likes

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