Pre-spun hard drives

This device is lovingly called the SPINmaster. [Linux-works] built it to spin up multiple hard drives before the motherboard starts up. It detects the power-up from the PSU and uses a relay to hold the motherboard in reset, indicated by the red LED. Each of four relays then spins up a hard drive and illuminates the green LED when ready. Once all green lights come on the reset relay shuts off and the bios starts up. This type of staggered startup takes a lot of the load off of an under-powered PSU. He’s posted firmware and there’s a schematic available too. We took a look at his video but there’s not much to see as it’s just the inside of the machine while it boots up.

Comments

  1. mef says:

    Why not just hold the reset to MB down for few seconds, would be quite simpler with cap and resistors.

  2. nave.notnilc says:

    this could be useful for turning an old box w/ crappy PSU into a server with a bunch of disks, but of course, a new PSU wouldn’t be that terribly expensive, compared to the prices of large disks :P

  3. Karl Schlosser says:

    This is a perfect example for how the industry is is making the PC a crappy platform on purpose:

    Staggered Spin-Up has been a standard feature on all multi-channel SCSI-controllers for more than 15 years.

    One would expect that such features are later implemented into more recent technologies – but here we are, with S-ATA II, and all we’ve got is crappy NCQ (which also is a standard feature on SCSI drives).

  4. gripen40k says:

    Hey, I like this idea. Although it has pretty limited applications, it would be good to do this in reverse for external HDDs. Mine just has the disk spinning regardless of whether the computer is on or not, but if you were to use some sort of relay like thing you could possibly turn the disk off when not in use.

    @Karl Schlosser:
    Agreed, stuff like this really *should* be standard with SATA interfaces, but when most systems only have two HDDs it’s not a large concern. Still, would be nice to have…

  5. Maj says:

    Or you could just turn on the “hard drive spin up delay” option in the BIOS settings.

  6. Paul Potter says:

    A great idea. SCSI already being able to do that is even better though.

  7. kirov says:

    why not just spend an extra $10 and buy a better power supply instead of spending all this time making this device

  8. osgeld says:

    some motherboards allow this to be set in bios, but it seems extreme when you can get really nice power supplies for next to nothing (ie my 650 watt ultra is like 59 bucks)

    cool idea tho

  9. osgeld says:

    oh and it defiantly saves on start up wear n tear (altho how much restarting of a server are you going to do)

  10. Digital says:

    a great idea to add onto an old system that doesn’t have this feature in bios already and why add another psu to the pile when the old one works fine. this simply makes the old one work with a more distributed load… think more tires on a truck to haul more weight even though the gross weight of the vehicle itself is realitively the same as a similar one with fewer tires.

  11. Skitchin says:

    I’m curious how much smaller of a PSU this would allow for overall? Just sort of wondering about the savings in the long run.

  12. ejonesss says:

    is this really needed since most computers have a delay that waits until the drive is spun up before trying to boot..

    also will retry several times.

  13. fdsa says:

    nice work…

    blinking the leds has the nice effect of staggering the startup of each individual drive, further reducing the startup inrush…

    void
    spin_up_drive(byte drive_num)
    {
    blink_led13(drive_num); // as a diag, blink the led13 light ‘x’ number of times for drive # ‘x’

    admin_state[drive_num] = oper_state[drive_num] = DRIVE_SPINNING_UP;
    tty_print_drive_status(drive_num, ‘\n’); // show user our current state

    // this is done this way to allow any mapping of drive #’s to arduino pins
    switch (drive_num) {
    case 1:
    digitalWrite(RLY_HARD_DRIVE_1, HIGH);
    break;
    case 2:
    digitalWrite(RLY_HARD_DRIVE_2, HIGH);
    break;
    case 3:
    digitalWrite(RLY_HARD_DRIVE_3, HIGH);
    break;
    case 4:
    digitalWrite(RLY_HARD_DRIVE_4, HIGH);
    break;
    default:
    break;
    }

    delay(DELAY_HARD_DRIVE_SPINUP*1000); // funct wants millisec’s

    admin_state[drive_num] = oper_state[drive_num] = DRIVE_UP;

    tty_print_all_drive_status(); // always respond with full status on ‘change’ requests
    //tty_print_drive_status(drive_num, ‘\n’); // show user we just changed states
    }

    its nice how the darlington array has built in protection diodes so that external flyback diodes are not necessary on the relay coils…

  14. linux-works says:

    hi, linux-works, here.

    one of the controlling ideas for this was that you often do not have the choice in what PSU comes on your NAS box. home NAS systems often are very low end hardware devices and by low-end I mean cheaply made ;(

    I read story after story about this or that PSu blowing. I have a popcorn hour media streamer and even that thing, with NO drives on it, blows its own PSU. adding a drive would only make things worse, I think.

    there’s an intel NAS ‘suitcase’ box that also has had some power supply issues reported by users. its a custom PSU and so replacing it is not an easy option.

    what IS an easy option is to be more gentle to the PSu at startup. that’s what this board does.

    as a side benefit, I threw in a CLI for a management interface. an out-of-band interface or ‘service processor’ (LOL) if you will. after boot you can connect to this simple CLI and turn on/off drives by number or even get their current power status. maybe more things later on. idea here is that you could spin up whole arrays to use them and then spin them down when not needed; or even JBOD singletons.

    /bryan

  15. Brad says:

    It would be really cool to implement a program and some hardware that shows real time HDD power usage as compared to the full possible output on the PSU so you could monitor it.

  16. fdsa says:

    @Skitchin, it really wont save any power at all… it will just reduce the total amount of inrush demanded by the the hard drives at power up by staggering the power up sequence.

    basically, when u attach a “cold” hard drive to a powersupply, the hard drive demands a hellacious amount of power while every capacitor on the board gets charged from an empty state, after all the caps are full, it levels out, then starts the motors which draw a decent amount of power also.

    this just staggers the inrush demands so that they dont all pile up at once. its like me asking u for a dollar monday – friday, instead of 5 bux on monday, if that makes any sense… your still giving me the same amount of cash (power), just dolled out so it doesnt seem to hurt as bad (crater the PS).

  17. linux-works says:

    yes, that ULN2003 series of chips are great! very simple to use. all the diodes are ‘there’ for the using ;)

    I need to upload the latest firmware, it has some new tricks and protections in it (timers for each drive to ensure that no drive starts up right after its shutdown by the mgmt interface, etc). even protection against stopping your boot drive (assuming its drive1).

    I’ll upload the new firmware shortly. still many more things to do (passwords are next, so that regular users won’t easily be able to spin down drives just by connecting to the usb/serial port!)

    /bryan

  18. linux-works says:

    one reason I picked the arduino is that I already have a good library of APIs for it, for measuring analog voltages, talking to port expander chips and so on.

    so its very possible that another iteration of this circuit could measure current drawn by the drives and even use that to intelligently stagger spinup (not just time based but current draw based).

    also, temperature monitoring can be done. I’ve used cheap lm75a chips on my arduinos to read digital temperatures. I could run a few of those in the case and ‘do things’ if the temp gets too hot.

    /bryan

  19. Gilberti says:

    I am pleasantly surprised to see that this is not being bashed for being powered by an Arduino. Then again, I don’t think anyone knows it is an Arduino.

  20. fdsa says:

    @ /bryan

    yea, you could probably just put a low valued series resistor inline with the coil and measure the drop across it to get current. I dont know how well sampling the power busses for sags would work with the arduino, i think the ADC API calls take a long time and you would miss the droops. ur sampling frequency would be too low to catch the power transients. it might be better to use the timer on uC to measure the switching power supply IC’s PWM duty cycles to get an idea of the load :) the timers gonna be HW driven…

  21. ReKlipz says:

    Karl Schlosser, gripen40k:
    Umm, what? The optional staggered spin-up feature has been defined since SATA Revision 2.0. If you chose not to purchase supporting hardware, well, you’ve got no one to blame but yourself…

    Excellent hack btw.

  22. ReKlipz says:

    Also, props for the first proper use of the Arduino platform I’ve ever seen. For the next iteration, try scaling back to a couple of resistors, caps and transistors, might save some money as well.

  23. Aaron says:

    Seems easier to just buy a good PSU…they’re really not that expensive
    Or set it in the BIOS

  24. iapx8088 says:

    I usually hate this all-arduino-mania but I think this is a well suited task for Arduinois.
    Good job.

  25. linux-works says:

    @ReKlipz: did you not see that I have a MANAGEMENT INTERFACE? a CLI. just how on earth do you plan to do that with ‘resistors’ and things like that? ;)

    the first version of my firmware was just timers, really. some 555′s would do that just fine. but having it be programmable and actually a smart ‘service processor’ appealed to me.

  26. linux-works says:

    “Seems easier to just buy a good PSU…they’re really not that expensive
    Or set it in the BIOS”

    again, you totally miss the point. the point is that you often do not get any choice when it comes to pre-built embedded hardware.

    stop thinking in terms of BYO PC’s. this is a case where the problem set forces you to live inside the system and make the best of what you have.

    if you don’t have this kind of PSU problem, that’s fine; but to invalidate the problem, itself, is just wrong.

  27. Jas Strong says:

    All SATA drives support staggered spinup. In order to allow this to happen, you need a BIOS that does not send START UNIT commands immediately and SATA power cables that do not ground pin 11.

  28. CH says:

    @linux-works
    What kind of system has the PSU built in?

    Anyhow, two things should be mentioned here:

    1) larger wattage PSUs use no more energy than lower wattage ones, this is a myth; PSUs that are switching power supplies will only use as much power as is required (if within capabilities).

    2) older PSUs, however, tend to be less efficient; So it might still be worthwhile to upgrade.

  29. BikeHelmet says:

    “One would expect that such features are later implemented into more recent technologies – but here we are, with S-ATA II, and all we’ve got is crappy NCQ (which also is a standard feature on SCSI drives).”

    My Asus board – M3N78 Pro – does staggered spinup.

    I was quite surprised. My old DFI board spun up all my drives at once, but this one waits until it gets to the POST page for the SATA controller, then spins them up one by one. Takes me about 60 seconds to boot. :P I have a pretty decent PSU, so I’d actually prefer the option to spin them all up at once.

  30. Haku says:

    @CH, the kind of system I’ve seen that have a PSU built-in as standard are basic HTPC & rackmount cases, although neither of those are usually designed/suited to run more than a couple of harddrives.

    This kind of project would be ideal for those who want to build their own massive raid arrays with software such as unRAID http://www.lime-technology.com/ that can handle up to 21 drives.

  31. linux-works says:

    I have heard about pin11 but its not across all sata (consumer) drives, I don’t think; and some older ones do have jumpers to set the mode for power-on with no spin-up; THEN you let the host adapter do the actual pin11 spinups. that’s great and that’s how life is on big storage systems.

    for low end consumer stuff, though, vendors take shortcuts.

    interestingly, my NAS box uses the ich7r sata controller and it does support the spin-up option but I think the bios still has to ‘agree’ to this and most non-headless systems don’t have bios options for this. I DO hear the 4 drives spin down in sequence (how odd!) and when I do a shutdown-h_now kind of thing, the drives turn off one by one. it may be linux and not the bios shutting them down this way, though.

    also, you may want special configs such as 2 disks in mirror (software mirror) as the boot ‘drive’. in this case, you do NOT want your controller to be lazy about spinning up the 2 system disk mirror pairs. otoh, you don’t want the controller spinning up ‘data disks’ either, until you say so.

    the more I think about it, the more I like this out-of-band kind of solution. its way more flexible and the CLI lets you offline drives at-will. I plan to use that to have a larger jukebox of external usb drives and I’ll spin them up on demand on my media server.

  32. Jas Strong says:

    It’s not a pin 11 spinup. Pin 11 is used to signal to the drive that the BIOS will not send a START UNIT command. That happens over the SATA data cable and has nothing to do with pin 11. This behaviour was added because early SATA implementations did not send START UNIT commands and thus boot would stall.

    With pin 11 grounded, the standard behaviour is to spin up when a PHY link is established.

    Some drives do have jumpers to select staggered spinup, in addition to pin 11.

    And yes, any drive that supports power saving should also support staggered spinup. Certainly it is required for many applications.

  33. therian says:

    Now I CAN NOT say that all Arduino projects are crap

  34. Osgeld says:

    yay

  35. TheNthDegree says:

    @CH

    “larger wattage PSUs use no more energy than lower wattage ones, this is a myth”

    Why exactly is this a myth?

    The efficiency of a switching power supply is generally proportional to its loading. Meaning that a lightly-loaded SMPS will actually run *less* efficiently than a moderate or heavily loaded one.

    Of course, the load-efficiency curve of a power supply depends a lot on the actual power levels and switching topology involved…

  36. linux-works says:

    here’s one design issue I didn’t quite get closure on. I’m curious what you guys think.

    right now, the current flows on the normally-open set of contacts. ie, when the relays energize, those are the contacts that gets used and so for the drives to get (and continue getting) power, the relays have to continue getting power and continue to function (work).

    this could be a failure mode; but I’m not sure if its worth designing around. relays have anotehr set of contacts and I could switch over to those, along with making the appropriate source code change. while the server is up and running, the relays would be in the ‘relaxed’ state and the connections would be held by the spring tension in the relays, not the coil electro ‘tension’.

    one problem with going with that approach is that during the initial power-on, for some short period of time all drives are connected to the 5v and 12v power lines. the system has to QUICKLY act after a power-on (or even during the climb of a power-on) and push down on all relays to stop the loads from appearing to the PSU at startup. this can be done – but… is it worth it?

    comments are welcome on the pros/cons of both styles.

  37. Tachikoma says:

    Pretty cool project! Nice work.

    Once I was actually thinking of going a different way, more like a UPS. Instead of performing staggered power-ups, I was planning to use a bike battery as an extra current source. It could also serve as an UPS to some extent during power loss. Of course, this will def add complexity, as you’d need build extra switch mode regulators for other ATX voltages.

  38. Haku says:

    @linux-works, could you use power MOSFETs or solid state relays instead?

    I think it would be absolutely fine to stick with relays, they’ll probably out-live the drives they give power to.

  39. jproach says:

    @linux-works:
    Your coil current is 40mA at 5V, or 1W for 5 relays. This is fairly small, and is only being used when the PC is running. IMO I wouldn’t worry about it for the current design (unless you want to experiment, which is cool).

    If however, you decide to redesign, you could look at:
    - Latching relays. Upside: no static power use, downside: some reserve power or use of standby voltage would be required to switch them off after the PC is powered down.
    - FET switch: a simple N mosfet could be used (low side), but there are various IC options with short circuit protection, high side switching etc. Upside: smallest size, very little static power usage. Low side switching would be dirt cheap, but be very aware of the caveats.

  40. M4CGYV3R says:

    I can’t see a good use for this for me, but I’m sure someone out there appreciates it.

  41. ak77 says:

    “..but I’m sure someone out there appreciates it.”

    What.. like all the people on this thread who have expressed an interest?

  42. cgmark says:

    @linuxworks

    Nice project
    You can use latching relays and power the whole thing off of the +5V standby supply. It has more than enough capacity to do its normal functions and power the relays.

    One thing I have done is use the gray wire on the ATX connector (PWR_OK)to control when the motherboard starts for things like this. The PWR_OK wire stays low until the power supply voltages are where they should be at power on then it goes high. The motherboard will not start until that wire goes TTL high.

    When you turn on a pc the voltages automatically go to the drives before the motherboard. I was a tiny bit concerned about this because that means the drives don’t get the opportunity that the motherboard has to wait till the power stabilizes before starting.

    By placing a relay in the patch of the PWR_OK wire you can control when the motherboard starts. You can also monitor that signal coming from the power supply to power transistor controlled relays that then switch the power to the +5V and +12V drive connectors. That means the drives stay off till the power has stabilized then turn on. You could even stagger them (I didn’t ) , to spin up one by one.

  43. cgmark says:

    By placing a relay in the patch of the PWR_OK wire

    Should be relay in the path

  44. linux-works says:

    funny that you mentioned latching relays; I’m working on a project right now (for audio) that uses them and the same basic relay driver chip.

    I’m not sure if I can easily find latching relays that carry decent current, are 5v controlled and available at the usual places (mouser, etc) for affordable prices. the ones I used are cheap and easy to find. for my audio project, I’m carrying preamp-level current thru them (its a relay/resistor attenuator) but I can’t use the same relays on this project.

    plus, how do you reset the latching relays on an unplanned power-fail? something would have to set them back, quickly, so that when the power comes up next time they are in the ‘open’ state and drives are not power-connected.

    the latching relays I used in my audio project were polarity reversing ones (single coil) and they ‘burn’ thru 2 of the ULN driver ports (you basically make a poor man’s h-bridge from using 2 of the ports and feeding each one into the relay end, with some biasing R’s as pullups).

    but for this disk drive project, I did want to use somewhat common parts and avoid anything exotic. latchers are sort of in the exotic catagory.

    I suppose I could be more convinced if there was a simple, cheap and elegant way to ensure that they are in the open state at power-up time. after that, the cpu and ULN can take care of the rest.

  45. linux-works says:

    @cgmark; did you notice that I DID use the grey wire! I just learned this trick recently and it works up a treat ;)

    I have not used the 5v standby wire for this circuit and I will consider that idea, thanks.

  46. linux-works says:

    @jproach: “and is only being used when the PC is running”;

    my intention is to use this on servers and those can stay up for weeks, months and if your power company is good, years.

    I am concerned with how long these relays can reliably stay in the closed/powered state. I just don’t know or have that data. when I run this on my own personal system, I suppose I’ll have some data, then ;)

    you also mentioned mosfets. I did think about that. should I seriously go that route? I do like the fact that they will probably be more reliable than mech relays and certainly eat up less power (no coils). their on resistance is nice and low but is there ANY chance they could affect the actual circuit/load? that was my worry. who knows how a mosfet in series will affect some vendor’s drive on the 12 or 5v rails. these aren’t simple light bulbs as loads ;) so I took the very safe route (for now) and went with relays.

    I knew of dc solid state relays (SSRs) but they are very very expensive and also more of a specialty part. I can find ac SSRs but finding DC ones is not as easy or cheap. and I’m not sure they would fit in the same kind of form factor that the cheap mech relays took up.

    if this was your data, would YOU use mosfets or relays?

  47. Neil says:

    Nice post, I could see that coming in handy.

    Regarding latching relays, you can make them if you have an extra pol on the output side of your relay, you let the IO pin drive the relay coil, and also let the NO (normally open) pin of one of the relay switches output drive the coil as well, with the common pin of that switch to the power supply that drives the coils. The NC (normally closed) pin on that relay switch is left unconnected.

    When the realay turns on form the IO pin, it will keep itself on due to the second switch in the relay. The coil drive has 2 low-side current sinks, one from the control IC and one from the relay itself. A pulse on the control pin will latch the relay on. Pulling power (perhaps through another relay) is the only way to shut it off.

    With this “relay logic” as it is called you can make more complex arrangements too, such as pushbuttons to select 1 of N outputs to route an analog signal too. Were pushing one button (or GPIO line on a microC) unlatches the other ones, and selectes the desired one.

  48. cgmark says:

    @Neil
    Latching relays have the benefit of needing no power after they are switched on . So using one like you describe would require power always.

    @linux-works
    To turn off the relays in a power failure you can use a diode from the pc +5vdc and a supercap or two to the arduino board. The diode will keep the supercap from trying to power the normal +5vdc standby circuits. I have seen 10F@5VDC caps for $1.49 that would have more than enough power to run the arduino and turn off several relays in a power failure. Let the arduino monitor the +5vdc standby wire to determine if a power failure has occurred.

  49. NN says:

    Excellent. I looked for such a solution for the same problem as recently as this week.

    Currently it has 4 channels, how much work would be required to have more, say 8 or 12 channels? Would it be easier just to duplicate the circuit two or three times, or can it (with ease) be done more elegantly?

  50. ReKlipz says:

    linux-works:
    You are correct, I only read the summary, I was unaware there was some management software associated with the project as well. I take back what I had said, and give even more props for an even better use of the Arduino platform, ;).

    As for your question regarding Relays vs MOSFETs, I would definitely go with a MOSFET if this was my data. No mechanical wear, cleaner switching, less power, quieter (could be a drawback, however), and not to mention the fact that it is cheaper and will take up much less space.

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s