I have a SATA HDD case (product details) with switches that toggle the power supply for each HDD.

My aim is to control each switch individually via software.

(My background: I'm a total novice to applied electronics, but I have a good grasp of the underlying physics.)


I've measured the resistance between all pairs of switch pins and found out that each switch is equivalent to the following circuit: enter image description here

Luckily, it suffices to connect pins A and B (or any equivalent pair) to enable the HDD power supply as if the button were pressed. The top pins are ignored.

When a HDD is attached and the switch is off, the voltage between A and B is 12V. The current, when connecting A and B, is < 1mA.

My idea is now to add a transistor to each A-B pair of pins and route a wire from each transistor base to a microcontroller that's attached to the same ground potential as the HDD case. Is this approach feasible and safe?

  • Can you recommend a simple, low-power microcontroller that can be attached to a consumer motherboard, preferably via USB? It should have at least 15 output pins which are only needed to toggle the transistors.

    The software interface that the MC should be able to implement is trivial: set_pin_voltage(PIN_INDEX, on|off). Maybe a simple IC is enough?

  • What type of transistor would be appropriate? The default switch state should be off, so the transistor should only conduct when a voltage is applied to its base.

  • What type of cable would you recommend?

Since posting my original question, I've read a good amount of The Art of Electronics, but I nonetheless feel very insecure about real-life component selection for my first electronics project. I'd love to hear your expert advice.

Detail view. These are 6-pin alternate action switches (push for on, push again for off). D5 is a status LED enter image description here

enter image description here

Overview. The case is partly disassembled. enter image description here

  • 1
    \$\begingroup\$ Are these switches latching or momentary? Are they a 'standard' double pole double throw type? If so you could consider replacing the switching contacts with an appropriate (small) relay driven by a bjt that could be operated from a simple manual switch and a remote control signal. \$\endgroup\$ – JIm Dearden May 25 '18 at 17:52
  • \$\begingroup\$ These are alternate action switches, so you push for on and push again for off. I'll try to find out the exact type with a multimeter. I've edited my post to include the extra info. \$\endgroup\$ – ens May 25 '18 at 19:18
  • \$\begingroup\$ I've added more information to my question which leads to a very concrete design approach. Could you have another look at it? \$\endgroup\$ – ens Jun 4 '18 at 21:41

You can buy a multimeter for less than 20 dollars these days. Then set it to either resistance mode or continuity (the one that beeps). It looks like the 3 pins on either side are connected, and then both sides are connected when the switch is pressed, but it will be safer to check yourself. If you look under the board you may be able to make out the traces and confirm this without buying a meter.

Anyway, once you find out which pins to connect, you would need an optocoupler for each switch. An opto is an LED and a light sensitive transistor in the same package. You will want to look through the datasheet for the opto and find the current rating for the internal LED and its forward voltage drop. You will also need a resistor to limit current into the LED. If using a microcontroller (I'm assuming 5V) the resistor value would be:

(5 - LED Forward Drop)/Current for LED = Resistor Value Doesn't have to be exact, just make sure you don't exceed the LEDs max current. You want to drive it fairly hard though.

Then just send a HIGH signal for a closed switch, or LOW for an open switch.


You have left the crucial close-up photo of the underside of the board out. This would help us determine if the switches are used in single, double or triple pole, and NO, NC or DT configuration. This determines your best line of attack.

If the switches are only switching a single line with 3 contact (at the full supply current) then replacing it with a suitably rated transistor or relay should do the job for you.

If you want to maintain the remote controlled state even if your micro-controller should have a glitch you would need to use latching relays. Your switch would have to be off to allow relay control and your switch would then over ride the relay.

If you are happy to control all the switches at the same time you might be able to get away with a single bigger relay on the power supply input to the device unless you want some communications circuitry to remain active to avoid USB device enumeration whenever you power drives up and down. You do not explain why you want to control them so we are having to guess what is important.

You should also supply information of the power supply rating of each drive or the whole unit to allow for component rating recommendations.

  • \$\begingroup\$ I've added more information to my question, esp. the switch is now fully specified. I'd like to control each switch individually. \$\endgroup\$ – ens Jun 4 '18 at 21:42

It depends a little bit what exactly this switch connects. You for sure can replace it with a transistor but to tell you how we would need to know the schematic of this thing. Otherwise just use an opto-coupler and you're good.

If the switch is used to "connect" a logical signal to an input, figure out how it's connected (could be normally opened or normally closed). Then create a transistor circuit that brings the same signal level to the power input pin when driven.

edit: According to your edit you can simply do something like


simulate this circuit – Schematic created using CircuitLab

As you mentioned, connect the controller to the same ground potential as the transistor circuit. What controller you use probably depends how you actually wanna control it, generally speaking, an ATiny could do the job. And one transistor per switch is enough.

  • 1
    \$\begingroup\$ To use an opto-coupler you still need to know which pins of the switch to connect and which one is positive... \$\endgroup\$ – nekomatic May 25 '18 at 15:49
  • \$\begingroup\$ Would it help if I measured the resistance between all pairs of pins for each switch state? (I'd gladly buy a multimeter for that.) \$\endgroup\$ – ens May 25 '18 at 16:12
  • \$\begingroup\$ I took the measurements and added more information to my question. I now have a very concrete design idea. Could you have another look at it? \$\endgroup\$ – ens Jun 4 '18 at 21:42

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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