I’ve been prototyping some USB selectable switches/power splitters so I can run my tt keyboard and grids into one unit, and select what modules they go. So 2 usb in, and up to 4 usb out. Kinda like a mega switch.
I was able to get things running pretty easily with a bulky analog solution. I have a DP4T rotary switch that sends the D+ and D- signals out to their selected usb out, and an 2PDT toggle to select between the grid or keyboard usb in and the power being supplied externally via USB.
But the aesthetic definitely doesn’t fit in with the rest of my equipment and a slimmer, digital alternative would be a fun project for me, and likely look better (to my eye). I started to tinker around with some leftover Arduino Nano’s and hobbled together enough to read the analog input from a 10k pot, but there is a ton of jitter. Nothing a little extra code couldn’t help smooth out. But now I’m wondering whats the best way to proceed with this?? I’m definitely out of my element here, but this is what I’m considering moving forward and a few questions I have about design choices.
Goal: two channel selectable input, 4 channel selectable output for usb D- and D+ lines.
- Should I be using a potentiometer, or is an encoder better suited for controlling an Arduino/Teensy?
- My plan was to use a 4052 dual 4-channel multiplexer to route the D- and D+ signals. The logic table being controlled by either a potentiometer or an encoder.
- After tinkering a little tonight with the Arduino, I was able to get the analog pin values fairly smoothed out, but do worry about the possibility of unwanted changes driving the logic table output. The analog pin would read values mapped between 0 and 3, and I could sometimes find the spots where a jump from one value to another would happen unintentionally.
All advice welcome!