Planning to switch between 2 PCs' USB port to 1 USB drive via 4 channel 5V relay which controls by Arduino,
But the it shows device not recognized from PC side while connected via relays. (It did connect well without relays)
Did it cause by signal loss? Shall we able to use any control IC for this?
Yes. Particularly USB 2 and above operating at VHF radio frequencies requires detailed consideration of wiring/ PCB layout. Wander wires in random directions are not appropriate.
guanzhi:
Shall we able to use any control IC for this?
A USB hub IC on a properly laid out PCB such as in a ready-made USB hub would do the job just fine.
Well that is of course, why simply using a hub makes more sense.
If you are going to select drives by software, then using the OS to do so is the way to go. And the implication of wanting to use a relay is that the drives are permanently plugged in, so removal is not the intention.
USB hub was designed for multiple USB drives to single PC input,
But I want single USB drive to 2 PCs input.
Paul__B:
Yes. Particularly USB 2 and above operating at VHF radio frequencies requires detailed consideration of wiring/ PCB layout. Wander wires in random directions are not appropriate.
A USB hub IC on a properly laid out PCB such as in a ready-made USB hub would do the job just fine.
Wondering if there's USB hub IC board for one socket to two plugs.
DrDiettrich:
Also consider that USB media should be ejected by the OS before another device is plugged in.
Yes, I found some tools like RemoveDrive or USB DISK EJECTOR should be able to safe remove USB media.
JohnLincoln:
Are you switching all your connections simultaneously?
When you plug a USB device in the power and ground connections are made before the data connections, and the reverse when unplugging.
Yes, actually it still shows device not recognized even if plug the USB wire with four pins connected via relay already.
I think it should be related to data loss that mentioned in previous thread.
Only one PC can control an USB drive at any time. Consider what would happen if one PC is writing to a file and the other one deletes that file?
That's why the network approach is the best safe method for a device shareable by multiple clients. The drive is attached to a network server that manages (allows/denies) access by the network clients.
hammy:
You did say one PC in the original
Post , then two PC’s later on - that affects the advice !!!!!
.. anyhow 2PC’s sharing one USB drive:
Link the two PC’s with a cross over network cable , plug the drive in one PC and share it over the network
Sorry the for the wrong statement in first post, just corrected to switch between 2 PCs' USB port to 1 USB drive.
I want the bootable USB drive to switch between two PCs (for booting up from USB), so file sharing on network might not be my solution in this case.
Have you used a keyboard-video-mouse switch for this? There are KVM 2-port switches for $10-20. If you want arduino to control the behavior of which PC gets the connection, you should use a 2-port USB switch IC. It does exactly what you want it to do: have one arduino pin control which PC gets the USB drive connection. High for one PC, low for the other.
Here is a part number. I've used it before.
If you search hard you may find a breakout board for it because the little bugger is impossible to hand solder.