Connector position and alignment


I’m new to KiCad and I’m trying to do a PCB design that will have few connectors and some track to connect everything together. Important to mention that I don’t have an electronic background, I’m new to electronic too (software engineer background).

I’m trying to create a small pcb design to put the following components:

  • esp32-devkitc
  • plantower pmsa003
  • sht45 breakout board
  • tsl2591 breakout board
  • tmp117 breakout board
  • mh-z19b

I would like to have all those components connectable with headers like this:

But I have some difficulties to place connectors on the pcb so I would like to ask you what is the right way of doing it (from your point of view of course).

The ESP32 devkitC has 2 lines of 19 pins headers, so I suppose I must place 2 lines of 01x19 connectors and align them together but it seems really difficult.

Should I mesure manually (error prawn) the space between the 2 lines of pins and then place them randomly until I can measure the right space between both (also approximative) ? This method does not seems good to me.

I have footprint for the ESP32 devkitC but the one I have is using pin hole through the board which is not what I need (don’t need through hole, just smt connector seems more logic to me).

The problem is even worst for the MH-Z19B that has 2 lines of connector (5pins and 4 pins), therefore not aligned. I don’t know what is the right way to do such a thing.

Also I’m not sure to how to know where to place what. All my components are using 2.54mm space between each pins (except the PMSA003). but the smt connector are not aligned on the grid as they are pads on each side.

I’m really lost to position correctly my connectors, any idea ? recommentation ? resource that could help ?

I’m trying to learn but I thing kicad allows us to do so many things that it become difficult to find an information that I apply to my use case.

Wish you all a good day :slight_smile:

A pitch of 2.54mm is indeed quite common among breakout boards. An easy way to fit and measure them is to either put it on a piece of matrix board or a breadboard and count the holes / distances.

Thank you for your reply. If I understand well, I can measure the space between header lines by counting the number hole in the breadboard * 2.54mm? That part is now clear. Then, any idea about how to place 2 connector lines with the right space in between ? I’m now placing it randomly, then taking the meter, and try to find some approximative point (because connection center is not possible to target in kicad) to check the distance between them.

So now I know how to measure the space between pins but not how to place them with the same space in kicad. Is it the correct way place them randomly then measure approximatively ? (can’t target the center line where the header will be soldered)

Yes, that usually works.

Oops, I wanted to add that, but it got lost halfway though typing.
The easiest way is to set the grid to 2.54mm.

But there are lots of other ways too…
If you design your own footprint, the you can simply place a pad, then hover over it and press e to edit it’s properties, and then you can directly enter X and Y coordinates (relative to the center of the footprint).

But there are many more ways. Give yourself some time, read parts of the manual and experiment a bit with features.

1 Like

A grid of 2.54 (initially) will make this a lot easier. Then to place the 2nd one you can use “move relative” to place the other connect exactly the correct distance from the other

1 Like

The right way is to look into datasheets of all elements you are planning to use and based on mechanical information from there to define footprints for each of them. Then at PCB you don’t move each connector separately but the whole footprints (for example two rows of pads together). If you have lot connections between them it is the only way to make searching a good position for all elements easy (seeing connection lines you can rotate and move all elements to find the relative orientation giving you as simple looking set of connection lines as possible.
If datasheet contains no such information then I’d seriously consider using a product from someone so stupid he can’t foresee that the pin placement is the basic information necessary to use his product.

The connector you showed at the beginning is certainly not SMT.
Have in mind that when you take element off from sockets you have to use some power and THT element holds PCB much stronger (the tin on the pins is in the shape of rivets).

When you press E hotkey you will be able to write position you want.
When moving element you see the current position at bottom of the screen.

Thank you all for your advices :slight_smile:

I have downloaded a footprint sensors with multiple connectors (MH-Z19B and ESP32 DevKitC), but both has holes which is not what I need. I will use a connector (like the one in photo in my previous post).

This is one of the footprint I have:

How can I place connectors in which I could put this component? It seems I’m back to the starting point ^^ Any idea ?

The goal is to place 2 connectors like the photo from my previous post, so I probably need connectors like “PinHeader_1x05_P2.54mm_Vertical_SMD_Pin1Left” (photo in next post as I can only put one picture/post)

Am I wrong ? I’m not getting how from a footprint with holes/pins I can place connectors that will allow me to just plug them in.

Thank you again for all your help, as a beginner, it’s really nice to have such a community :slight_smile:

Or maybe my idea of a connector is wrong, I’m not sure what I’m doing wrong. Do you think it’s correct to use the connector from the previous post to put a female header receptable 2.54mm ?

It depends on if you want to use an SMD connector like these or a THT one like these.

They will both work the same (as long as your daughter board has pins at the bottom), but might have different robustness, part cost and manufacturing cost. THT parts might need handsoldering, which can be more expensive than SMD, but it’s probably a cheaper part and more robust against mechanical damage.

I don’t understand your doubt.
What the THT connector (like in your first post) needs to be placed at PCB are 2.54mm raster series of holes. So if you have holes than you have just what you need to place these connectors.

This is a development board?

Making this board as THT is far more robust for plugging stuff in and out. Having pads with holes (as long as the holes are not too large) will automatically set those connectors the correct distance apart.
Set your grid to 100 mil. and just place the pads on the mother board. The distance between the rows is probably also in inches (for breadboard use), so a ruler in 1/10s of inches is all that is needed.
To use the sensor footprint you mention above, solder male pins into the holes


and your female connectors (mentioned in the OP) to correctly distanced rows of pads on the mother board. Use the same idea with your ESP32 kit.

The male connectors are usually supplied in 40 pin lengths that will break to your required number. The female connectors are harder to change to your required number of pins. You may have to use, say, 20 pin lengths for the ESP32, in which case fill the 20th hole with a piece of wire or something so you don’t inadvertently use the wrong holes.

Use pads and tracks as large as possible to improve robustness of the mother board and don’t forget some holes in the corners, and possibly in the middle (for extra support), to fit some plastic stand-offs so the motherboard is not lying on your desk and subject to shorting pads from nails, wire and other sundry stuff on your desk. :slightly_smiling_face:

EDIT: Kicad has a nice measuring method to confirm distances. Use dx &dy at the very bottom & middle of the PCB editor screen. To use, place cursor on point A, press the space bar which zeros that cursor position, move cursor to B and read x & y distances in whatever units the grid is set to.


Thank you for pointing that out.

I have the PMSA003 sensor that is in a metal box connected to the ground and this sensor will be placed on the bottom side of the PCB right below the headers for the ESP32. Therefore I thought it would be a better solution to use SMD connector instead (like this one). Does it makes sense to you ? I was in favor of the SMD to avoid having a solder touching the metal case of the sensor connected to ground.

The photo posted in my first post is indeed incorrect as it’s not for SMD.

I forgot to explain some constraint that I have, I’ve mention them in the previous post. I hope it’s more clear now.

Thank you for all those info :slight_smile: It will help me a lot :smiley:

I added a post to explain why I’m in favor or SMD instead of THT (maybe for wrong reason) but I would like to be sure that it won’t cause issue with the grounded metal box of the sensor on the bottom side of the PCB.

It’s now clear to me that THT is better for robustness, therefore I will use those one for all the other connectors.

Good advice for holes in corner, I would have seen that problem too late ^^

1 Like

Sounds reasonable, but I have no experience with such SMD connectors, I’ve only heard that they’re less robust.

Ohhh, the memories that comment returns. :grin:

Much less robust. Only the glue of small copper pads is what is keeping the connector.
THT connector pins are soldered to the metalization in the hole and are fixed at both sides of PCB with tin (even cooper pads were not glued such pin can’t move to any direction).
This is a colossal difference.

Just exclude its area from using for other elements on the other side?

If you would like to have SMD then look in KiCad library how pads for such SMD connector are defined and define footprint for your devices.
For me it would be obvious to make footprint for the whole elements instead of placing separate holes or even separate two connectors (containing row of holes).
Having the footprints you easily manipulate with them on PCB with no risk that you accidentally change relative position of several footprints used to connect one your element.


Thank you :slight_smile:

If I choose THT connector, there will be pins soldered at the bottom of the PCB, is there a way to be sure it’s not going to touch anything else ?

I’m not sure to understand what you mean when you say

Just exclude its area from using for other elements on the other side?

Is there such a feature in kicad to mark a zone as ‘not available’ for surface component (only for bottom side of the pcb)?

Thank you !