I have Raspberry Pi setup as NAS. The storage is external HDD powered through USB. I would like to encase this whole thing in some nice box and still be able to easily use the HDD, without disassembling the whole thing.
My idea is following:
USB A would be connected to the external HDD and
USB B would be just USB extension cord accessible from the outside. The box with question marks would be toggle switch controllable through GPIO header.
My idea how to wire the whole thing in the easiest way is sketched in following diagram (the switches represent USBs):
I'm not sure if it's ok, just to switch the power rail between the two outlets.
So far I have following ideas how to implement that:
- design transistor flip-flop toggle switch
- use analog switch, something like CMOS-4066
- use dedicated circuit like MAX1562 (this one is switch only, though)
Is my idea sensible? Do you know any ready made solution? Do you know how to solve this?