Using Protoboards with Teensy 4.1 and multiple analog and digital inputs.

StrahinjaM99

New member
Dear all,

I have a question regarding layout design and would really appreciate your advice and guidance.

I am an Audio Production student at the SAE Institute in Belgrade. For my Major Project, I decided to challenge myself and build a custom MIDI mixing controller. I have a fascination with hardware but zero background knowledge in electronics or coding, so I am a complete beginner and learning as I go!

I have successfully finished the breadboard testing phase (code and components are working great), and I am now moving into the physical assembly phase.

My project includes the following hardware:

  • 1x Teensy 4.1
  • 1x Multiplexer (CD74HC4067) for the analog signals
  • 8x 100mm studio faders
  • 8x rotary knobs (potentiometers)
  • 8x arcade buttons (12x12mm)
  • 7x tactile buttons
  • 1x Joystick (2 analog axes)
  • 1x OLED screen
All faders, knobs, and buttons will be securely mounted directly to a rigid front faceplate panel, so they won't put any physical mechanical pressure on the prototyping boards inside.

I planned on breaking the chassis interior into 3 separate green FR-4 prototyping boards to keep things modular:
  1. The 8 faders, 8 knobs, and 8 arcade buttons.
  2. The 7 tactile buttons, OLED screen, and Joystick.
  3. The Teensy 4.1 and the MUX breakout.
I purchased standard double sided green FR-4 protoboards, but I initially didn't realize that every single copper pad is standalone and isolated (unlike a plastic solderless breadboard with built-in internal rails).

I have been researching electrical grounding and reading up on the differences between a Bus Layout and a Stra Ground Layout to cleanly distribute Ground and 3.3V power to all 30+ components.

Given that I have 3 separate GND pins available on the Teensy 4.1 and am using 3 separate modular FR-4 boards, what would be the best, cleanest, and most reliable way to route my power and ground paths?

Thank you so much for your time and help!
 
For low-speed signals, like analog faders and knobs, even rotary encoders, a hand-soldered ratsnest works just fine. That's how I got started, before Arduino ever existed, and still do on occasion for a fast-turnaround one-off. One microcontroller chip and its external 20MHz clock right next to each other, absolutely minimizing that one length at the expense of all else, and then everything else is practically DC by comparison. Sounds like you're that way too, with the possible exception of a screen that I'm not familiar with.

Use through-hole parts, bend the leads over and use them for wires too, in addition to some clipped-off leads and unzipped ribbon to complete the wiring. Use needle-nose pliers to pre-bend leads as needed so they sit nicely for soldering, and the tip of a knife to bend 24AWG stranded ribbon wire around a pin that it needs to solder to. (pretty much any multi-tool includes both) Watch for whiskers! If you're using an unzipped ribbon for its insulation, be careful to not melt the insulation so far back that it's no longer effective, 'cause it'll do that!

For high-speed signals, like USB and possibly the screen (depending on how fast you update it and what signals it requires), you need to manage things a bit better than that. A PCB is a great way to do that, as are pre-made cables that already meet the required specs. The wiring immediately behind the connectors isn't as critical as the cable itself, as long as you keep that length short. I've gotten away with a lot by just that rule alone! (the aforementioned uC and clock, for one example) Cram it right up next to the thing that it goes to, and you're probably fine. (but don't forget the required parts, if any, between the connector and its destination)

Route all the high-speed stuff first, so you can make it absolutely as short as possible. Then all of your grounds around that to connect them all together. Then treat power and slow signals the same, and don't forget a bypass capacitor on EVERY power pin to its corresponding ground! 0.1uF ceramic should be fine for all of them, unless specified otherwise, with maybe a 10uF electro for bulk capacitance at the supply input to each board.

For grounding, your main concern will be either excessive EMI or excessive "ground bounce". For a one-off proof-of-concept, I wouldn't worry too much about EMI, and ground bounce can be (mostly) filtered out. Dedicated analog lowpass for each signal, right next to the ADC, so it's effectively dead at half your sample frequency and above, but doesn't slow down the user too much. Then digital lowpass and possible hysteresis after sampling.

(You might need to increase your sample frequency to make room for the filters. And don't be afraid to make it ridiculous. For example, I have a fuel gauge linearizer sampling at 78kHz, which is WAY overkill, but the numbers worked out nicely so I kept it: 8-bit PWM from a 20MHz clock, with auto-triggered ADC reading for each PWM cycle. Sure makes the filters easy! Even a gradual 1st order analog (R-C with buffer opamp) is plenty far down by the time it matters.)

The computationally easy digital lowpass that I often use on dirt-cheap uC's, will naturally take a 10-bit ADC and produce a 16-bit full-scale answer, with more than 10 bits of real resolution so long as the bottom bits of the ADC are constantly wiggling faster than what the digital lowpass is going to cut out.
C:
//1st order digital lowpass, identical to analog R-C lowpass: cascade multiple stages for higher orders with steeper rolloff
#define SHIFT 3             //adjust for cutoff frequency: coarse, but fast and cheap
out -= (out >> SHIFT);
out += (ADC >> SHIFT);      //assumes left-justified ADC reading; right-justifying instead, creates a specific shift for free, which might be worth using

You *might* get away with only the digital lowpass, but you'll never get rid of *all* the noise because what's left is actually aliased, or "accordion folded" down from higher frequencies to fit into half your sample rate and below. *That* is what the analog lowpass cuts out, and *only* an analog filter can do that. Once it's digital, it's there for good, indistinguishable from someone intentionally moving the control.
 
Back
Top