USB Hub to connect multiple Arduinos + Full Project Advice - Page 1
Forum section: electronics / projects

author: Kieran
author_rank: Newbie
timestamp: November 13, 2018, 07:18:22 am
content: Hi all,I'm working on a project (more details below) that at a basic level consists of 4x ATmega32U4 programmed using the Arduino IDE, that connect to a computer using the USB built in to the micro. I've seen several projects that use theFE1.1s USB hub controller, and most seem to have very simple PCBs. In an ideal world I would have at least one more, if not 3 more USB ports available for peripherals such as a keyboard, mouse and USB license key. My question is for this application I assume I won't be pushing the transfer speeds of USB 2.0, and as such how important is trace length matching and controlling impedance? I would like to avoid them if possible as I'm fairly new to PCB design and I want to keep the cost reasonable. Secondly are there any other ICs similar to the FE1.1s that offer similar ease of use?EDIT: Also I'm assuming connecting a hub to the ATmega32U4 is just as simple as connecting its D+/- pins to those on the hub with PCB traces?More DetailsThe project is a keyboard/controller for lighting software. The software can interface with other devices usingOSC, and there's a demo project that uses an Arduino Uno to interface with the software via OSC over USB. I'm expanding the demo to include the full keyboard layout, ~10 motorised faders and ~5 encoders, along with OLED screens to label each fader, encoder and the 6 softkeys which change function in different parts of the software. The layout of the project at the moment is:One ATmega32U4 is for the keyboard side of the project. There are a total of roughly 170-180 Cherry MX keys (I haven't finalised the exact layout), and I'm using aCD74HC406716 channel mux to multiplex the keys into 16 columns. It's currently set up that the mux chip pulls each column to ground and then the micro checks each row for a connection to ground, thus determining if each switch is open or closed.A second ATmega32U4 is used to control the OLED screens. The screens (standard 0.96" white OLED) interface via SPI, and I'm debating whether to breakup the control of them to several ATmega328P that interface to the master ATmega32U4 over I2C. The screens only display text, but I'm not sure if driving ~21 OLED from a single ATmega32U4 would be too slow, as I'd have to multiplex the CS pin somehow. At the moment I have one lot of 6 screens being driven by a ATmega328P, which is sent the strings over I2C from the main ATmega32U4. This seems to work well and should be easy to expand to have probably 3 groups of screens with their own ATmega328P.A third ATmega32U4 will be used to read the rotary encoders. It only needs to read when the encoder moves and send an increment command to the software. The demo project includes 2 encoders, so I should be okay to interface 4 or 5 of them through a ATmega32U4. The demo project connects them to the analogue pins of the arduino, however it's only reading a high or low signal so I should be okay to connect them to digital pins?Finally a fourth ATmega32U4 will be used to control the motorised faders. Followingthis projectI'll need one analogue pin to read the position, 2 digital pins for capacitative touch (so the fader doesn't try and move when it's being held) and 2 or 3 pins for the H-bridge motor controller (I'm looking at using theL293DNE). With a total of up to 6 pins per fader and aiming for 10 faders, I'm thinking of using anATtiny84micro for each fader that would recieve a position to move to and control the motor to move the fader to that position, and also report back position changes to the master ATmega32U4. I'd probably use the I2C protocol again to save pins on the slave devices, although SPI is a possibility.I've attached a diagram of the project, any any other feedback on how I'm going about it would be much appreciated. I'm pretty new to this and I'm working mostly from examples and hacking them together to get what I want. I've prototyped the first and second ATmega32U4s on breadboard and made a small keyboard section on PCB to try it out. Next I'm looking to tie some screens and buttons together through a USB hub and build that on a prototype PCB. Is there any difference between surface mount and through hole components, namely for resistors, capacitors, crystals and ICs?Cheers,Kieran