Controlling many switches with a minimalistic microcontroller

The goal is to control the power supply of the indidual bays of a hard drive backplane.


(Larger image)

The MCU should control 15 identical switches.
Communication between the MCU and the host PC should happen via USB.
USB should also be be used for the power supply.
The whole design should be optimized for minimum power consumption.
Min. 2 extra output pins of the MCU should kept unused to allow for future extensions.

What's a suitable MCU/development board to use?
Maybe a Digispark (ATtiny85) with two cascaded 74HC595 shift registers to achieve the required number of output pins?
Or is there a suitable minimalistic, Digispark-like ATtiny development board with more
native output pins and USB support? That would be my preferred solution.
(The ATtiny4313 would be a fitting MCU)

Thanks for your help!

Show us your 5 volt current budget, since the PC USB can supply only a limited amount of current.

Paul

Let's say 0.5A (USB 2.0).
But how is this relevant? A tiny MCU will draw < 10mA, and the current through the transistor bases and the shift registers will be negligible.

somex:
Let's say 0.5A (USB 2.0).
But how is this relevant? A tiny MCU will draw < 10mA, and the current through the transistor bases and the shift registers will be negligible.

Then there is nothing holding you back from completing the project and testing it.

Paul

As stated above, I'm still wondering what's the best approach to the MCU / dev board selection.
A small Digispark + 2 shift registers?
Or would you recommend a dev board with more native pins? This would save some extra construction and programming work.

(This is my very first electronics project, please bear with me. ;))

So you're switching this HDD bay high-side.
Then you can't use an NPN transistor like that.

When Arduino ground and HDD bay ground are shared you need a 2-transistor setup to switch high-side.
An NPN with emitter to ground as voltage amplifier (5 to 12volt), and a PNP with emitter to 12volt to switch.

Maybe easier, use opto couplers.
The opto LED needs <1mA to switch that load.

A Nano has >15 digital outputs. Then you don't need shift registers.
Leo..

Leo, thanks so much for pointing out the high-side switching issue!
I've re-measured the resistances and it turned out that I'm actually low-side switching; I've updated my sketch accordingly.
What switching component would you recommend in this case? NPN? MOSFET?

If HDD bay ground is shared with Arduino ground (USB?), then use NPN transistors (as in your new diagram).
Any small-signal transistor will do.
Must use base resistors between Arduino pin and transistor base.
100k (or even higher) would work for a tiny 100k load.

Note that you can use the analogue pins of a Nano as digital pins (except pin A6 and A7).
Don't use pin D0 or D1 (RX,TX), and avoid pin13.
Leo..