Is there a way to turn on or off the power supply of up to seven hard drives with the help of an Arduino? Or maybe there is another way to ultimately - but restorable - prevent read/write access to the disks.

  • Internal or external? External or internal power supply? Where you want to cut power? At mains or near to the disk?
    – user31481
    Sep 1, 2017 at 16:27
  • To turn off a harddisk, you can give it a command to do so. Turning a harddisk off might not lengthen its lifetime, but it will reduce power.
    – Jot
    Sep 1, 2017 at 16:56
  • 1
    Can't vote to close on the first day, so here is some advice for this question. Do some quick research on how Arduino can be used to control 5V relays, then write some Arduino code. Come back and edit this question to show that code and describe how you would put it together, then ask a specific question about Arduino wiring or code. If you have some relays on hand, then actually put it together. If there is a problem with the Arduino code then put that in the question very specifically.
    – SDsolar
    Sep 2, 2017 at 0:12
  • Why ? Please explain why do you want to this. What is your goal ? Your question has a typical xy-problem aura hanging around it: xyproblem.info
    – Jot
    Sep 3, 2017 at 6:37

3 Answers 3


Switching power on and off to hard drives is not as simple as you may think.

First you have three voltages to control - 3.3V, 5V and 12V, and on top of that you have (ideally) pre-charging for the 5V and 12V pins. The power-on sequence would ideally be:

  1. Power up 5V and 12V pre-charge
  2. Power up 3.3V, 5V and 12V main power

That's 5 poles for one drive (although you can get away without the pre-charge).

So you would be switching at minimum 3 power signals per drive. For 7 drives that would be 21 power signals that need to be switched.


Switching off power to a hard drive using mechanisms that aren't directly under the control of the operating system can cause file-system corruption and data loss.

The operating system caches data internally and writes it to the hard drive when able to. If the hard drive is turned off while there is still data cached that data will never get written to the hard drive. Worse still, if you turn it off whilst it is writing the file-system could become irrevocably corrupted (depending on the file-system in use and the resilience of it).

Most hard drives have the ability to power themselves down at a command from the operating system. I suggest you use this mechanism instead, since it is more reliable that blindly shutting off the power. Chances are your hard drives are already doing this, since most operating systems enable it by default.

  • Unmounting the drive will help to prevent data-loss. But I agree with you on the power-on sequence - will it be the same with SSD drives? Sep 3, 2017 at 6:28
  • Sure, if you're on an OS that supports that. SSD AFAIK only has 5v and 3.3v, however powering those down would be completely pointless since they use next to no power when idle and produce no noise.
    – Majenko
    Sep 3, 2017 at 9:03
  • drives don't get 3.3v power, only the mobo does. drives use only red+yellow atx leads. the BIOS menu often allows for "power on HD delay", which is what i think you're hinting at in the "power up" notes...
    – dandavis
    Sep 4, 2017 at 20:30
  • @dandavis You should look at the specs of the SATA power connector. They have an orange wire (3.3V) as well as the red and yellow. True, 5V is (usually) optional, since most drives will regulate their own 3.3V (if needed) from one of the other rails, but the standard is to provide 3.3v.
    – Majenko
    Sep 4, 2017 at 20:32
  • 1
    @dandavis Check pins 1, 2 and 3: en.wikipedia.org/wiki/Serial_ATA#Standard_connector Those are power. 3.3 V is supplied along with the traditional 5 V and 12 V supplies. However, very few drives actually use it, so they may be powered from a four-pin Molex connector with an adapter. Few drives use it, but there are some. Not all drives work with an old Molex -> SATA adaptor since that doesn't provide 3.3V.
    – Majenko
    Sep 4, 2017 at 20:36

An Arduino have 13 digital I/O pins so theoretically you can control 13 devices without any additional additional circuits.

You will probably need some circuits for the devices you want to control.


If you want to control them externally, I suggest buying e.g. an 8 channel relay. This way you can easily control them with the Arduino, and using external power for the devices to switch on/off.

If you want extra protection (especially with motors or expecting spikes on signals), use relays with opto-couplers.

  • 1
    Like that: arduino-info.wikispaces.com/ArduinoPower Sep 1, 2017 at 18:54
  • 1
    Note that a typical 3.5" SATA hard drive has 3 power feeds - 12V, 5V and 3.3V, and all three need to be switched together. For 7 hard drives you'd need 21 single-pole relays, or 14 double-pole relays. Ideally you should also pre-charge the drive using the 5V and 12V pre-charge pins which you would provide power to before applying main power. That would raise it to 5 poles per drive, or 35 single-pole relays.
    – Majenko
    Sep 2, 2017 at 10:00

Not the answer you're looking for? Browse other questions tagged or ask your own question.