11
\$\begingroup\$

I'm doing some PCB wiring and I am connecting many buttons to an Arduino Mega's digital inputs. The idea is that the digital pins will be normally high and when I push one of the buttons, the digital pins will be connected to ground.

I'm not really good at cable management, and I thought maybe I can do something like this to tidy up the connections, will there be any problem that I not seeing?

Also I'm planning to do something similar with some switches connected to the analog inputs and some LEDs.

These wires have a 0.156 mm distance between them, which the PCB manufacturer accepts.

enter image description here

\$\endgroup\$
2
  • 4
    \$\begingroup\$ That seems awfully tight, for no good reason. Our standard trace to trace spacing is 17 mils, which (if I did the math right) is 0.43 mm, almost 3X the spacing you have, \$\endgroup\$
    – SteveSh
    Jul 20, 2023 at 11:57
  • 1
    \$\begingroup\$ Are you intending to add more tracks than are shown in the question? There's a lot of free space in the middle, and it isn't obvious to me why the tracks start off going left instead of right or straight down. \$\endgroup\$ Jul 20, 2023 at 18:55

5 Answers 5

15
\$\begingroup\$

You should not necessarily use the minimum spacing that your PCB fabricator offers (except as needed). Add some extra clearance as long as you have space to do so. This improves manufacturability, but also can reduce crosstalk or coupling between each signal. The required clearance depends on the speed (ΔV/Δt) of the signals the traces (they are traces or tracks, not 'wires') carry; I would recommend ≥0.2 mm spacing, for example.

But the answer to your question "are these too close?" is "not unless the circuit is malfunctioning due to interference/crosstalk." Rather than wait for finished PCBs to arrive and then find out there is a difficult-to-find interference problem, try to use available space and only route traces close together when necessary and for short lengths.

Here's an example from one of Sierra Circuits' PCB design guides:

Trace spacing example from Sierra Circuits PCB design guide

\$\endgroup\$
8
\$\begingroup\$

The fifth switch from the left is missing one wire. Other than that, assuming the signal currents are very low, it looks fine.

Since you have lots of room, consider increasing both the track width and spacing. At 6 mils you are pushing the limits of traditional production methods for no apparent reason. I don't go below 10 mil (0.254 mm) lines and spaces without a good reason.

You don't say what the analog signals are. Depending on their amplitude and bandwidth, tight spacing might allow crosstalk. A possible solution for that is a ground trace between each signal pair. But generally speaking, analog signal routing can be a more complex task.

\$\endgroup\$
8
\$\begingroup\$

A few thoughts:

  1. For push-button switches the edge speeds won't matter. If you are doing de-bouncing in software, you can sample the I/O ports relatively slowly and still be much faster than any human can push or release the buttons. That will filter out any crosstalk or rising/falling edge problems.

  2. Allowing larger spacing and wider traces than your PCB house's bare minimums gives them more tolerance to work within, which will decrease the possibility of defects.

  3. I would be more concerned about running traces close to the edge and the mounting hole in the lower-right corner. Traces close to the edge can be more easily damaged when the individual PCBs are cut out or handled. Traces close to mounting holes are damaged by screw heads or rubbing against whatever the PCB is being mounted to.

  4. There is room inside the switch footprints and between the individual switches to run most of these traces, as you have done on the lower-rightmost switch in your picture. Could you rotate each switches 90 degrees?

  5. Will this be a single-sided PCB? You could move half or all of the traces to the opposite side and solve all of these problems.

  6. Are you adding any pull-up or series resistors? Reasoning behind those is out of scope for the question at hand but if you are, place them before routing your traces.

\$\endgroup\$
5
\$\begingroup\$

It may be hard to guess if that poses a problem or not, but it will be easy to make the likelyhood of problems smaller by using wider gaps between tracks.

For reference, two conductors separated by a gap is a capacitor so there is capacitance between wires. The longer the tracks, and the narrower the gaps, the more there will be capacitance between the wires.

And the capacitance couples fast signals between wires. When you push a button to short the wire to ground, it will cause extremely fast edges so the edge couples to neighbouring wire well. What helps the coupling even more is weak internal pull-ups, as strong external pull-ups require more coupling current to cause larger voltage steps.

Also wires have inductance. So fast current spikes also cause high voltage spikes in the inductance. These may in long term damage the MCU IO pin structures.

So it might be fine but you can always add a series resistor to limit current when pushinh a button, and you can always add small capacitor to limit voltage edges. The capacitor to ground will also reduce the effect of coupling between two button wires.

\$\endgroup\$
4
\$\begingroup\$

You are probably OK, but you're not thinking well about this. Depending on the current drawn when a switch is activated, you might get noticeable crosstalk. However, since I assume you'll be using a software polling loop to detect switch operation, along with debouncing (you will be doing a debouncing routine, right? Right?) you'll propbably be OK.

However, why not run the traces from the upper row of switches between the rows? If you're doing it to keep your switch assignments nice and ordered, don't bother. Figure out the assignments to the Arduino pins once and be done with it. This way you can at least double the spacing between traces, and if you're feeling paranoid you can run ground traces between the signal traces and pretty much guarantee no crosstalk.

\$\endgroup\$

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.