Part with different # connectors between views?

Hi all!

So I have a part, a relay, that I am making, and it turns out that I will need a different # of connectors between the different views in fritzing. On the switching side of the relay, there are 3 connectors on each side of the switch, 6 connectors total needed in breadboard view. Schematic diagram would only need 2 connectors, and PCB would only need 4 connectors. Confused? Here’s the data sheet:

https://www.te.com/commerce/DocumentDelivery/DDEController?Action=srchrtrv&DocNm=RF&DocType=DS&DocLang=English

Each side of the switch has 2 pcb pins, so four pins for the pcb view. Schematic would only be 2 connectors. The real life relay (breadboard view) has 2 pins per side of switch, plus a 1/4" spade connector, so six pins total for breadboard view.

Now I just dealt with the same sort of thing, different number of pins per view, and it worked, but I’m not sure if I’m doing it the right way, or if there is a right way…

I found 2 ACS712 current sensors on the forum. One had 3 connectors in all views, but you couldn’t connect anything to the screw terminals in breadboard view, and the schematic only showed 3 pins. The other one had 5 connectors in all views, 3 pcb connectors and 2 screw terminals. Problem was, in the pcb view it also have 5 connectors, 2 connectors for the screw terminals that aren’t part of the pcb.

So I toyed with the files, and my part has 3 pcb connectors and 5 connectors in the other views. The other 2 connectors for the pcb view that don’t show in that view are 0 sized rectangles with id names identifying them as connectors.

Is this the correct way to handle a case like this? My ACS712 part is attached…

Randy
ACS712 Current Sensor.fzpz (58.7 KB)

No your part isn’t correct as we see from pcb view:

the red bar over the connectors indicates a problem with connectors. In this case because connectors11 and 12 are present but 0 height and width in the svg. The correct way to do this is detailed in this howto:

The way I would do this is by editing the .fzp file (AFAIK this can’t be done in parts editor, you need to edit the files):

edit part.ACS712_work_8623c1fd6cd1466e860cdcc20a7ca8dd_4.fzp with a text editor and change:

<connector type="male" name="A/C" id="connector11">
 <description>A/C</description>
 <views>
  <breadboardView>
   <p svgId="connector11pin" layer="breadboard"/>
  </breadboardView>
  <schematicView>
   <p svgId="connector11pin" terminalId="connector11terminal" layer="schematic"/>
  </schematicView>
  <pcbView>
   <p svgId="connector11pin" layer="copper0"/>
   <p svgId="connector11pin" layer="copper1"/>
  </pcbView>
 </views>
</connector>

to

<connector type="male" name="A/C" id="connector11">
 <description>A/C</description>
 <views>
  <breadboardView>
   <p svgId="connector11pin" layer="breadboard"/>
  </breadboardView>
  <schematicView>
   <p svgId="connector11pin" terminalId="connector11terminal" layer="schematic"/>
  </schematicView>
  <pcbView>
  </pcbView>
 </views>
</connector>

and repeat this for pin12. This suppresses the connectors in pcb view as desired. The same thing will work in the other views as well.

Peter

Hey, thanks Peter for pointing me in the right direction!

I think I have everything sorted and correct now. I’m attaching my ACS712 and the power relay I was working on.

if anyone notices a problem with the parts, let me know and I will fix them.
Randy

ACS712 Current Sensor.fzpz (58.7 KB)
TE Connectivity Power Relay.fzpz (8.3 KB)

TE Connectivity Power Relay

no serious problems, the part works as is but a few issues that trip warnings from FritzingCheckPart.py:

Warning 28: File
‘part.relay_te_aa10240f003b068f007356777d31d9fd_2.fzp.bak’
At line 80

name COIL present more than once (and should be unique)

Warning 13: File
‘part.relay_te_aa10240f003b068f007356777d31d9fd_2.fzp.bak’
At line 132

Value connector2terminal doesn’t match Id connector4. (Typo?)

Warning 25: File
‘svg.pcb.relay_te_c2d285c860c1b7d15b05625643bab736_1_pcb.svg.bak’
At line 26

Silkscreen layer should be above the copper layers for easier selection
in pcb view

Error 18: File
‘part.relay_te_aa10240f003b068f007356777d31d9fd_2.fzp.bak’

Connector connector0terminal is in the fzp file but not the svg file. (typo?)

svg svg.breadboard.relay_te_c2d285c860c1b7d15b05625643bab736_1_breadboard.svg.bak

pcb svg change

to

If silkscreen is on the bottom, select in pcb view will select silkscreen which is rarely what you want to do.

Value connector2terminal doesn’t match Id connector4. (Typo?)

indicates the pin in schematic doesn’t match the connector definition. While this works as is, it is confusing. A better solution is to duplicate pin2 and define it as connector4pin like this:

and then connector2terminal

and change the Ids to connector4pin and connector4terminal

do the same for connectors 5, 6 and 7 (using pin3 as the base for pins 6 and 7) then in the .fzp file

    <connector type="male" name="COIL" id="connector1">
  <description>A2</description>

needs to change to

    <connector type="male" name="COIL-A1" id="connector1">
  <description>A2</description>

so the name is unique (in some circumstances Fritzing uses the name field as an index and thus the names need to be unique!) Do the same for all the other names (append their pin number to the end.)

 <connector type="male" name="NC" id="connector4">
  <description>Normally Closed</description>
  <views>
    <breadboardView>
      <p layer="breadboard" svgId="connector4pin"/>
    </breadboardView>
    <schematicView>
      <p layer="schematic" terminalId="connector2terminal" svgId="connector2pin"/>
    </schematicView>

needs to change to

<connector type="male" name="NC" id="connector4">
  <description>Normally Closed</description>
  <views>
    <breadboardView>
      <p layer="breadboard" svgId="connector4pin"/>
    </breadboardView>
    <schematicView>
      <p layer="schematic" terminalId="connector4terminal" svgId="connector4pin"/>
    </schematicView>

to match the changes to the schematic svg. Same for connectors 5 to 7.

connector0 doesn’t need the terminalId in breadboard (as it is not in the svg)

<connector type="male" name="COIL" id="connector0">
  <description>A1</description>
  <views>
    <breadboardView>
      <p layer="breadboard" terminalId="connector0terminal" svgId="connector0pin"/>
    </breadboardView>

to

<connector type="male" name="COIL" id="connector0">
  <description>A1</description>
  <views>
    <breadboardView>
      <p layer="breadboard" svgId="connector0pin"/>
    </breadboardView>

Fritzing defaults to using the pin if the terminalId isn’t in the svg, but this cleans up the complaint in FritzingCheckPart.py (and is more correct!)

TE Connectivity Power Relay-improved.fzpz (8.8 KB)

ACS712 Current Sensor has a number of problems:

schematic is misaligned

ungroup to adjust the alignment causes this:

for some reason ungrouping the tspans has caused font-size to change from 4px to medium (which is obviously wrong.)

correct the font sizes, add a .1 in grid and we see the alignent problem, the horizontal lines are not aligned to the .1 in grid

as well the drawing origin is not 0 0, so at least in Inkscape (I don’t know how to do this or if it is even possible in Illustrator) resize the page to selection to 0 0

First correct the rectangle to be on .1in boundaries

Now we switch to the top ac pin and see it is misaligned.

Its current y position is 0.478in instead of the 0.5in it needs to be to be in the .1in grid. So correct that.

Then select connector11terminal, set it to be 10thou by 10thou and move it to also be at 0.5in to match the pin. Now correct the position of connector10pin (only 0.05in out in X):

to be exactly on the .1in boundary and do the same to connector10terminal.

Now the top connector connector8 pin and terminal. The top and right pins are somewhat odd, in that they need an additional 0.05in added to their position to account for the 10thou width of the rectangle (the terminal does not get this correction!) So connector8pin goes from

to

while connector8terminal goes to 0.4 by 0.8in so as to be exactly centered on the grid lines at 0.1in.

Now for connector9pin. As with connector8pin connector9’s x start wants to be 0.05in greater to account for the stroke-width of the rectangle, and it wants to move down a bit to be in the center of the rectangle like this

which changes to

we then edit select all, resize page to selection and group, then change the groupid to schematic and save the result as plain svg to have the corrected schematic svg.

Complaints from FritzingCheckPart.py

Error 69: File
‘svg.breadboard.ACS712_work_d060f6ff406dbc2bce8866190e18b588_2_breadboard.svg.bak’
At line 803

Found a drawing element before a layerId (or no layerId)

the breadboard svg has no group named breadboard. The effect of this is the part won’t export as an image (pdf, svg, jpeg etc.)

the fix is to do an edit select all, then group and name the group breadboard like this:

Warning 27: File
‘svg.pcb.ACS712_work_d060f6ff406dbc2bce8866190e18b588_2_pcb.svg.bak’
At line 709

Fritzing layerId silkscreen isn’t a group which it usually should be

silkscreen isn’t a group which it should be (this works, but is incorrect)

fix it by grouping the rectangle and naming the group silkscreen

Modified 2: File
‘svg.pcb.ACS712_work_d060f6ff406dbc2bce8866190e18b588_2_pcb.svg.bak’
At line 716

Connector connector11terminal had a zero width, set to 10
Check the alignment of this pin in the svg!

this is caused by the unused screw terminal connectors exisiting in the pcb svg. The solution is to just delete the unused connectors:

all these changes are in this part:

ACS712 Current Sensor-improved.fzpz (31.7 KB)

which looks better in schematic:

Peter

Whew, lots of problems there, thanks Peter!

The relay was 100% my part from scratch, all errors in it were my fault.

The ACS712 was a part I modified from a part I found on the forum. I editted the breadboard .svg only by renaming the screw terminal graphics to be connector pins 11 & 12. Nothing else in the .svg was touched. The schematic .svg was only modified by by duplicating the ‘out’ pin, moving and renaming the pin to ~A/C, then I duplicated that pin again for the other ~A/C pin. In the pcb .svg, yes the zero sized connector pins I added in, thinking that was how you handled extra connectors not visible in certain views. After you descibed how to do the connectors in different views, I guess I forgot to delete those connectors.

My changes to the .svg files was minimal, so I think the bulk of the errors are in the source ACS712 I used. So thanks to your work, this should be the ‘go-to’ ACS712 sensor.

Thanks again!
Randy