LM317 symbol creation

Are you talking about the schematic symbol? Are you talking about a SPICE model? I think the developers version has some limited support for SPICE. If that’s the case, I can’t help. I use the stable version.

In reality, there are only 3 separate connections:
a) Input
b) Adjust
c) Output

The 4th physical pin is electrically the same as the output pin.

In your schematic symbol, create one with only 3 pins, and assign the correct name to the correct pin number. It would be good practice to organize the symbol pins by function from left to right, and not numerically from lowest to highest.

Later when you assign a footprint to the symbol, that footprint will have 4 physical pins. However, one of the pins will have one of the pin names the same as the first instance of “output” (as this is the pin that is duplicated on this particular part).

The symbol will have these pins and names:
Pin 1) Adjust
Pin 2) Output
Pin 3) Input

The footprint will have 4 physical pins, one with the same name:
Pad 1 will be pin 1 of the symbol.
Pad 2 will be pin 2 of the symbol.
Pad 3 will be pin 3 of the symbol.
Pad 4 (or the tab) will also be assigned to pin 2 of the symbol.

You can open the footprint browser and check out TO_SOT_Packages_SMD:SOT-223-3Lead_TabPin2 for an example.

Hope this helps.

1 Like

I didn’t realize till now that I should have added Schematic. Yes it’s a simple schematic symbol from a .LIB text file. Sorry about the confusion.

Sprig:
Yes this sure helps. I forgot to mention that the confusion is in making the schematic symbol, not the footprint (yet!). Assigning pad no. 4 (The tab in SOT package (and the heatsink in the TO packages?) ) to pin 2 was very helpful.

Okay, so one more last thing. For the .SUBCKT body here:

.SUBCKT LM317_TRANS IN ADJ OUT_0 OUT_1
R_R1 VXX IN {RINP}
R_R6 N242982 VYY 10 TC=0,0
R_R5 VZZ VYY {ROUT}
E_ABM1 N242982 0 VALUE { MIN(V(VXX), (V(Vzz)+(ILIMROUT))) }
R_R2 N222524 VXX {PSRR
RINP}

If I made a schematic symbol out of that with 3 pins only out of it and ignored OUT_1, would it be OK ?

Have a look at the footprint you want to assign to your symbol.
I would suggest you use TO_SOT_Packages_SMD:SOT-223-3Lead_TabPin2
You will see that for this footprint TAP (pin 4) has pin number 2 (as implied by the name)
So you only need one output pin in your symbol.

You could also use the sot223 4 pin footprint but you will not get more functionality. (The symbol might look a bit strange.)

And if you want, the regul lib has recently been updated and as far as i remember the lm317 should now exist for the sot223 package. (Yes i know you want to learn, i just leave this info here if somebody in the future needs it, or if you want to have a look at these new shiny symbols.)

To get the newest symbol libs you would need to download the kicad-library repo from github and either copy the symbol libs into the correct path. (look at the searchpath in eeshema-> component libraries) Or setup kicad such that it looks wherever you put the lib.


Just a reminder:
In kicad symbols need unique names over all libs. So if there is a symbol in the official lib with the same name this might be a problem. (If it does not yet exist, it could be added in later versions of kicad. Symbol libs are updated with the kicad version.)

To ensure that your symbol is taken make sure you add your libs to the top in the properties->component library dialog:

1 Like

In your schematic symbol, create one with only 3 pins, and assign the correct name to the correct pin number.

I have to say, I would fundamentally disagree with this. I would create four pins on the symbol otherwise it’s just too confusing when you come to debug the hardware and probe around with a scope or DMM.

LM317

The way I suggested is the way the industry does it.

Any Technician doing testing, troubleshooting, or repair, should be knowledgeable about the different device packages.

Like with a lot of things, there are at least two ways to look at things. Having a symbol with all 4 pins might be nicer in the mind of some guys. (It makes it obvious what is going on.)

While others know that two of the pins of that particular package are normally connected and don’t want to see it separated in the schematic.


I personally would go for the 3 pin symbol if the datasheet defines the pins as numbers 1…3 with pin 2 double. If the datsheet contains numbers 1…4 i would go with a 4 pin symbol.


So my suggestion is find what works for you personally and go with that.

1 Like

Actually, it does not. It would make me wonder what the “function” of the extra pin was for.

The device package is going to label 4 different pin numbers, if there are in fact 4 physical pins.

SOT-223

As shown, pins 2 and 4 share the same function.

Out of curiosity, does the KLC have a preference?

Yes. The KLC would use pins 1…4 in this case as the package has all 4 numbers assigned.

If the second output pin would also have a small number 4 then it would only need 3 pins.

However, one can stack the output pins. (visible one with type power out, invisible one passive)

National_317
Fairchild
ON

Presented are 5 schematic symbols used from 5 major manufactures (including the Ti one above).

I know this comes across as being a bit ranty. It’s not supposed to be, so apologies in advance.

The issue with that is that it is a generic symbol for all packages, some of which only have three pins, so I just don’t see that as an acceptable argument.

If you come to debug this hardware, there are four pins on the PCB and only three pins on the schematic, you’re going to be scratching your head thinking hang on, what is this pin that is not shown on the schematic. It’s the same as these bonkers symbols where they hide Vcc and GND in the schematic. Yeah, if it’s a 74HC you know top right and bottom left are power and ground and you might - even with thirty years’ experience - might - know what all the pins are in what order on an LM317, but there could still be uncertainty. There certainly will be for people who aren’t familiar with it. All for the sake of not putting one extra pin on the symbol which in no way whatsoever makes it less readable, in fact the polar opposite.

If you have a processor with four ground pins and four power pins on it, do you only put one of each on?

I have imported some symbols from SnapEDA and routinely have to unstack the stacked GND pins. It would be safe and recommended to always solder all the GND pins but often it’s more practical to to leave some of them unused because it makes room for other things on the board. For example, I can make a board which is smaller than the module which is soldered on top of it. So, I don’t like even stacked pins, let alone leaving them out.

I don’t know what you mean by stacked pins. I’m really not sure of the point you’re making. Sorry if that sounds rude, it’s not meant to. :slight_smile:

No offence taken! It was just a long “no, I don’t” answer to your question :slight_smile: By stacked I meant put on top of each other so that they look like one. I don’t like even that, let alone pins which are left out. If there would be only one GND pin in the symbol I would have to add there all those which are in the physical part.

But this is going offtopic…

Unless you are talking about a double sided board, I don’t even see how that would be possible. It is simply bad practice to not connect all ground and power pins of complex ICs such as SoCs and FPGAs. Your board might work without all grounds connected but you might have other issues that aren’t immediately obvious.

No.

There are 3 pins and 1 TAB; exactly opposite of pin 2.

These are pins, and not TABS.

I agree that it is bad practice to not connect all power pins to their requirement.

.

Thanks Jim for that clarification. My most post was a direct response to the post I quoted which was a response to the question:

Maybe I should have quoted them both, but thanks anyway. :wink:

However, you might want to be careful. Your distinction between pins and tabs is becoming a bit blurred. When it comes to components in TO-220 packages I’m sure we can all agree as to what a “tab” is, and for the most part they can be ignored. They are seldom included on the schematic and don’t need a corresponding pad on the PCB. But the TO-263 (aka. DDPAK/D2PAK), the SMT cousin of the TO-220, is a 4 pin device. Pin 4 which you seem to refer to as a “tab”, requires a corresponding pad on the PCB for mechanical strength as well as thermal considerations and often pin 2 is omitted making pin 4 the only electrical connection to that terminal. The same is true for the SOT223 package.

I do agree however, many devices that use these packages can usually be represented on the schematic with 3 pin symbols.

Edit: This started out as a reply to @Sprig but once I quoted @DiBosco it became a reply to him/her.

Edit2: The above mentioned packages have multiple variants some of which have more than 4 terminations (pins), given the context of the current topic, the above refers to the 4 pin variants.

Bah, saying they’re tabs not pins is sheer pedantry! :yum:

In the end it’s up to the individual/company and how they want their libraries, but I’ll always put the tab on my symbol (and indeed call it tab).

@1.21Gigawatts SOT223 is a very good example, four pins, one of which is a tab all which could have different functions.

For a TO252 where the tab connects to board and the stubbby pin doesn’t, personally, I don;t have the stubby pin on the schematic and I do have the tab.

I’m a him BTW :grin:

Real world, and I’m working with/training someone, what do you think the reply would be if I asked them to, “Check the voltage on pin 4 of U1?” and it is this device?

DPAK_TI

Because I’d never ask a new tech to probe the voltage on “pin-2”. There is to great a chance of getting pins 1 or 3 involved in the connection and letting the smoke out.

ON EDIT: @1.21Gigawatts I’m not trying to be snarky here. This is what I know from what I have done at where I have worked; and it’s probably not that many that have the experiences that I have had.