I am looking for a footprint for this DIN 4-pole connector (female):
The male version is used with some powerful Mean Well PSUs, so I am unsure if I’m just not searching correct or if a footprint of it simply does not exist.
I am looking for a footprint for this DIN 4-pole connector (female):
The male version is used with some powerful Mean Well PSUs, so I am unsure if I’m just not searching correct or if a footprint of it simply does not exist.
I would modify the existing CUI_PD-30S footprint from Connector category.
It is pretty close.
Great! Based on that I can for sure create a custom footprint.
By the way, from whom are all the footprints which are included in KiCad? In case I make a footprint, can I share it with KiCad?
They are contributed by devs and users. Some are generated by scripts.
Ah okay. I am about to create my first footprint now
If I may ask, is the “Draw Orthogonal Dimensions” tool the only tool which can help me to create correct measurements?
Finished
I would be thankful if you had suggestions for improvements, but I think this is not so bad for the first footprint
Looks nice but also looks to me like you may get solder shorts between 1 and 3, and 2 and 4. I would make the slots the absolute minimum length (allowing a bit of mfg tolerance) and increase pad clearance a bit.
I also like to plop a new footprint on a test pcb, and print it at 100% – so I can stick it on (or even poke it through) the paper, for a quick sanity check. Be sure to double-check the pin numbers (so you don’t use the bottom-up drawing instead of the top-down view)
But for first footprint, nicely done!
If you would like to share the footprint with the KiCad library team, make sure to take a look at this
there are some rules to follow for symbols and footprints.
@teletypeguy Thank you!
BKL_Mini-DIN-4_0211004.kicad_mod (6.5 KB)
I fixed that and I also fixed the pin at the very bottom which was a second pin 3. This is the shield and when I measure on my PSU it seems it is not necessarily connected to GND, so I changed this to pin 5.
Yeah, looks good. Note that as you found you can have more than one pad (thruhole and/or smt) labeled the same – this is handy when you have multiple shield pins and such.
I usually label a shield can SH to distinguish from a numbered pin for main connections – you can have more than one pad and you only need one symbol pin. You can also use SH1, SH2… but then you need more than one pin on the symbol, and then you want to hide the extra pins…
Also note below that the yellow silk ends at the edge of the board (silk extending off the board is bad form even though the fab house will just clip it). On User-1 layer (which I reserve for footprints) I add gray lines that extend off of the board. This way I know where to plop the part at the edge of the board (end of the silk), and I can see the extent of the connector for enclosure stuff. Also in this case I show the sd-card in the pushed-in position, and little corners that show it when it is pushed-out, again for enclosure use. I usually put little silk tick lines on the center of connectors (here it is the center of the sd-card) so I can place connector centers on some reasonable grid.
Some parts don’t have a shield, but have mounting pads just for mechanical stability, like FFC connectors. I usually label these MP – still need a pin on symbol but that’s ok as I usually ground them anyway (they can float as they don’t go anywhere in the connector, but then they open holes in the upper ground plane).
Isn’t it good practice to connect the shield to Earth (not GND) to continue the Faraday cage effect if you have a shielded cable ?
You seem to be right, I measured it. The shield is connected to earth of the mains supply. So I think the best is to leave it unconnected (and not to be connected to GND), as the case won’t be made of metal.
Indeed, in a mains-powered system you usually have an earth (chassis) ground to which cable shields get tied.
To my delight, in four decades of design I have never had a need to get involved a mains-powered system, as I am not a fan of high voltage
However, even for systems powered by dc wall warts, usb cables, or batteries, there is still a need to address emi/emc concerns. If you need to get FCC part 15 approval (yes, I am embarrassed and mortified to say I am in the US), CE approval, or EMC approval for any country, you need to address rf radiation limits, and for CE and others also susceptibility to esd spark events, among other concerns. If you are in this camp you know the routine well.
Now many kicad users will never need to go down this path, but you can easily make your designs more robust with a little planning. When you tighten up rf radiation with good ground plane designs, embedding high-freq signals in internal layers with planes on both sides, and all that, it is just good design. When you do that you also improve rf susceptibility, which means other systems that radiate crapola (cell phones, motors, whatever) will not affect your system as much since less noise will couple into your traces.
ESD is a different animal. When I first went to get CE testing done for a product, and they brought out the big sparky-sparky gun, I found out that my esd suppression was not robust enough. My product was hanging and watchdog resetting. ESD sparks happen all the time – I live in a dry desert and walking across a carpet can generate visible blue sparks when I touch something. I went back to a new layout and revamped from the outside in.
Now I design every board with an ESD ring around the perimeter. Cable shields all connect to this ring and the TVS protection on i/o signals connect to this ring. I call it Chassis-Ground, even though I usually use plastic enclosures and not a metal chassis, but it works for both. If you have the luxury of a metal chassis it stops most esd events around the board perimeter, and it is connector openings that are of concern. With a plastic box the entire enclosure seam allows spark entry, so a perimeter ring will catch most of the action.
This chassis-ground perimeter ring connects to the power supply negative (whether battery, usb power, or wall-wart) through a single net-tie. All esd currents (from either direct sparks, or transients clamped by TVS protection) are shunted around the board and dumped to this one point.
Anyway, that is a long rant, but the point is that it is quite easy to add an esd ring when you start a board design (after the fact, not so much). I also connect this ring to (only) one mounting hole for connection to a metal chassis (if used).
Thank you teletypeguy for your very interesting post!
You say your perimeter ring connects to the power supply negative. But what if in my case the 20 VDC output plug (Mini-DIN) has a shield which is connected to earth of the mains power? Shall the perimeter ring still be connected to the DC negative of the power supply?
I indeed have a project with a way more complex PCB. It actuates the door opener of my intercom system and notifies me if someone rings the bell.
This PCB works almost perfectly fine since a few months. There is only one magic thing: In all these months it happened one or two times (not more) that the door opener was actuated though noone has clicked the actuation button in the software (HomeKit). I could verify this in the logs.
Do you think that a transistor can be accidentally turned on by ESD or is this likely a different problem?
That’s a good question. I have only used isolated dc power from wall warts and never had the earth connection available (I guess the exception would be usb power, where the shield would be earth ground if connected to a desktop computer).
In your case I would likely tie the earth shield, dc negative, and connection to the perimeter ring all at one location at the mini-din input power connector. I see no reason to float the earth/ring connection from dc ground, although someone else may have more insight. You could at least provide a jumper to allow a floating or grounded earth – that is, dc ground to circuit, of course, earth-gnd/esd-ring connected, and a jumper to connect the two (or not). Anyone have this use-case?
I am not sure what may cause your inadvertent actuations. What does your pushbutton circuit look like? I would likely use a pretty-low pullup, a cap to filter it also, and feed it into a schmitt gate (never on the micro directly), kinda like this:
BTW, on your pcb, Q1 pin 2 is not connected?
Pin 2 of Q1 is ground, here a larger photo:
The transistor is not driven by a push button, but by 3.3V @ 330 Ohm (GPIO8) from an ESP32-S3. So I was a bit perplexed, since this event happened one or two times in a few months.
Regarding your chassis-ground perimeter ring approach, would you mind apploading a KiCad project so I can learn from it? While I was able to realise a not so simple project (I can even read MicroSD cards now and write logs to it) I am still learning how to design PCBs and find it really fascinating
Well, you have a npn bjt, driven via a very low-valued resistor. The npn will start to turn on with a base-emitter voltage of around 0.7V or so. Some glitchy noise on the esp pin may be enough, or some noise pickup in the trace. I have not used a bjt switch in quite some time but the preferred way to connect is to also add a base-to-emitter resistor and you have a voltage divider that improves noise immunity.
So some simple math: Find out the required collector current – you are driving a relay coil of some sort – let’s just call it 100 mA. Find out the minimum beta (dc gain, or hFE) of the transistor at that current. From the datasheet it says the device has at least a gain of 250 at a collector current of 100mA:
Sooo, this means the base current needs to be at least 100mA / 250 = 0.4 mA.
Let’s say I put a 1k resistor base-to-emitter. At a minimum 0.7V Vbe turn-on, you will have 0.4 mA going into the base, and 0.7mA going into the 1k, which means the series resistor will have about 1.1 mA going through it. Let’s make that series resistor a 1.8k just for grins, so it will have (1.8k * 1.1mA) about 2 volts across it. Add in the 0.7V on the base – this means the esp pin needs to drive up to about 2.7 volts before the transistor turns on, instead of less than a volt as you have it now. These numbers are just approximations, but gives you a starting point.
I would replace your 330 ohm series resistor with 1.8k and tack on a 1k base-to-emitter. That will improve your turn-on sensitivity a fair bit, and is an easy tweak.
Since relay turn-on (and off) time is likely not a concern, you can add a little cap base-to-emitter as well to filter glitchy stuff.
Did your esp reboot when the events happened? That could also do it (and may be the root cause), as the pin may have sourced enough voltage as it went to a sort-of-open-ish-internally-pulled-up state during reboot.
Thank you! I will try that. No, the ESP32 didn’t reboot, it stayed normal.
Regarding your chassis-ground perimeter ring approach, would you mind apploading a KiCad project so I can learn from it?
Here ya go:
test-1.zip (126.0 KB)
Edit: I would also put an identical ring on the bottom (and, optionally, inner) layer(s). The lower ring may need a cut-out (and that’s ok) to get to pads near edge of board that some parts have, like the phone jack at the right. Ground plane is any-old polygon shape around the edge-cuts. Press B to fill plane. Keep the net-tie close to system-ground/power-supply-negative.
Cool, thanks!
[Additional characters due to additional characters being required]