I read the topic Switching SATA cables - Project Guidance - Arduino Forum (Switching SATA cables) but I can't post in it nor I can find a moderator, so here I am;
this is my idea, I have 4 3Terabyte HDD with movies and series and I don't need them always conected to the PC, for the moment I hot-swap them by connecting the SATA cable first and then the power, and it works;
when I need to disconnect I just eject it as if it were a USB.
works fine but i had thought about using arduino to do the hot-swap with relays NEC EA2-5TNJ 10 Pins 5VDC (like the TQ2-L2-5V) that is Latching, Dual Coil, as it only needs 1 signal for ON and another for OFF.
Someone has tried? I am new to the arduino and electronics, I have been reading and made this layout but would need help creating the PCB and tips for the arduino code.
If you notice you will see that there are 2 SATA lines, my code idea is that it first select's which line the HDD should go on and then activate the power (3 relays per HDD are enough)
Obviously 2 HDDs cannot coincide on the same line and the limit is 2 switched on at the same time.
Switching the data lines is problematic. It's unlikely that any relay you can find will have sufficient bandwidth to do that without corrupting the data. They aren't designed to do that.
This can be a fun project. When you build and install the switch, all you have to do is select a switch position before starting your PC and your computer will automatically boot to the selected drive. It works by switching only the power between the drives. In order for this to work, you need to enable booting to your SATA drives in the BIOS (CMOS Setup). This switching can be done with P-Channel MOSFETs. Keep the grounds connected. When you test be sure you do not care if you lose your data.
Also, you should not have any IDE hard drives connected. When you boot your PC, the drive that is selected by the switch is the only drive that will have power. Because all SATA drives are set to masters, the BIOS will see this as the only available drive and will automatically boot to it. Caution! If you wire up the switch incorrectly it is possible that you will damage your power supply and/or your hard drive, and possibly lose any data on your hard drive!
I did one test with one of these relays, just using the NC conectors, on a breadboard with an old sata cable I cut in half and for the moment it worked, detected the hard drive and I've been copying files to see, just 10 minutes but no error messages.
In another post I saw that they suggest using the 74HC4051 multiplexer for the data line instead of a relay, but I would not know how these work, any ideas on how to use it to switch between several devices? (I imagine that I will need several, maybe 4 for the 4 data lines)
In that case I would keep the relay for 12 and 5v.
As gilshultz said it can be a fun project, and about the BIOS I have set it up so I can do hot-swap, it works like a usb-pendrive but with all the speed of an HDD, time to time when I expell one HDD to plug in onother it does not detect it automatically but I can find it with the systems disk manager.
Time to cut another sata cable and try switching between 2, for the moment on the breadboard without the arduino, thanks for the feedback.