This section shows how to connect a 2 relay board for power cycling a SATA disk drive. This method can also be used for a PATA disk drive using a 4 pin Molex cable, as the wiring would be the same.
You will need to get a 24 inch SATA power extension cable (substitute a 24 inch Molex power extension cable for PATA drives). They can be found easily on ebay. For the SATA one, search for "sata power extension 24", and for the Molex one, search for "molex power extension 24". I would advise against using adapters, because every extra connection is a possibility for a bit of power loss or even a bad connection. A bad or weak power connection can sometime cause the drive to "click" when powered on just like a head failure, and you don't want that.
The wiring is very simple. Cut the yellow (+12v) and red (+5v) wires half way between the connectors. Don't cut the black wires. Note that for this we also don't cut the orange (+3.3v) wire (if there is one, some SATA power extension cables don't have this wire). Most hard disk drives don't use the 3.3v power. If you are unsure if a disk drive uses the 3.3v, lookup the technical specifications for that model to be sure.
Strip about 5mm of the coating from the ends of the wires. You want the wire to go in the connector terminal all the way, but not leave any exposed wire hanging out. Make sure the connector screws are loosened up all the way before inserting the wires. The yellow wires will go to one relay, and the red wires will go to the other relay. Connect one wire to the NC (Normally Closed) terminal, and the other wire to the COM (Common) terminal. Make sure to get the screws good and tight so the wires don't come out. That is all there is to it, the only thing left is to connect the USB cable, and connect the power cable ends to the desired power source and disk drive. I would recommend using the computer power as the power source, that way there would not be any ground loop possibility. But you can also use an external power supply if you desire. Using the extension cable makes it easy to connect to whatever power source you want.
This setup will act just like a power extension cable until it is activated, meaning it normally passes the power through it to the device. When the relays are activated, it will disconnect the power to power cycle the device.