Adding Automatic Power-On To A Linksys NAS


We feel [Jim’s] pain in having to physically press the power button to boot his Network Attached Storage device after a power outage. If you live in an area with frequent brief but annoying power blinks it wouldn’t take long to brew up your own solution. Here you can see the ATtiny45 that he added for the auto-boot.

Aside from having to go upstairs in order to reboot the machine there is also a compulsory disk check that his Linksys NAS200 performs before files are available on the network. You can see that he used an 8-pin socket which lets him remove the chip for programming. The socket gets a ground connection from the shielding of the USB port, it pulls 5V off of the linear regulator right next to it, and the green wire connects to the power button’s conductor.

The sketch compiled for the chip starts a ten second timer are power up. When the timer goes off it pulls the pin low and then high, simulating a button press. In hobby electronics it’s a common problem that we have to invent issues to use as the next project. So it’s nice to see a real life application like this one.

47 thoughts on “Adding Automatic Power-On To A Linksys NAS

      1. I was thinking precisely the same thing. Luckily where I live we have for the most part rock solid power. However we do get things like pole pigs being blown off poles by lightning, fusible links going pop etc. which cut power dead in no time.

        And with the storms of the past winter – we lost power for four days. That wasn’t cute.

    1. My modem, router and low power (<15 watts) atom server have a dedicated UPS. I think he'd have been better off spending the $30 on a UPS himself.

      Still, I do like the fact that it can auto-turn on after a power failure.

        1. That really is a good idea.

          Under my desk is sitting my UPS. They are very overrated for personal use. If you don’t check the battery and replace it for nearly the price of a new unit every so often (lenght dependent on how dirty your lines are) then it is no better than a surge protector.

    1. True, but why stop at the NAS? How about providing power to the router and cable modem at the same time? If they all can take the same DC voltage than your solution but maybe a little larger would be fine. Otherwise I’d just go with the traditional UPS.

      The auto-restart hack might still be useful, if there is a power outage long enough to drain the UPS. Then again, those should be rare and if the power isn’t stable right away when it does come back up maybe leaving the NAS off is a better idea.

    2. I’ve thought about doing something like this as well. A battery-backed DC supply with efficient switch-mode converters for the myriad of low-power things attached to my cable modem. I suspect that a lot of these devices can even take an unregulated DC input supply since they are probably internally regulating to 3.3 and 1.8 volts.

      1. [citation needed]

        I haven’t heard of any ICs out there that would use up precious silicon space to implement power decoupling capacitance on-chip. I’ve only seen them used where absolutely needed (and more for energy storage like EEPROM/flash memory charge pumps, and certain contactless smart card ICs)…

    1. LOL. I wondered this too. But it’s pretty close to the output of the regulator and its output stability capacitor. There’s not a lot of inductance in that connecting wire so the micro must (obviously?) never see voltage fluctuations large enough to cause problems.

    1. google “isbn:0080559174 power transients and durations”
      You’ll find a table 1.2 in the book “Power Quality in Power Systems and
      Electrical Machines” that outlines the different types of power
      transients & their durations.

      If you are curious about much loner durations (outages), here is a paper
      that talks about the stats:

      Note: units they used for durations is in hours. Wish they labeled
      their axis with units!

      “Electricity Case: Statistical Analysis of Electric Power Outages”

      Supercaps are good for up to seconds worth of backup.

    2. I was wondering that, but then assuming it’s a hard-disk based NAS it’s gonna take a fair bit of power to keep it going. I suppose you could rig it to power the unit’s electronics but not the HDD, but there’d be little point in it. Maybe it’d be enough power to flush the last bytes out of the caches.

      For something like a router or some other low-power solid-state stuff it might help.

    1. There is a cheaper and easier option than using a microcontroller.

      By placing a capacitor in parallel with the power switch you can simulate a button press when power is returned.

      This worked exceedingly well for automatically powering up a server after a power outage longer than the UPS could handle.

      This may be difficult to apply to a laptop due to the battery and lack of pin headers.

      An example of this setup can be found here:

      1. Would there be an easy way to do a delay without a micro? Say during a storm the power flickers on and of for brief periods, and you want to delay 10 secs to make sure power is actually back on before trying to boot.

        1. I would use a TL or TLC 7705 power supply supervisor. Tie the SENSE pin
          to a R/C to set a rise time delay of 10 seconds. Add a diode so that the
          C gets discharged when the power runs out. The timeing cap (CT) would be
          set to a couple of hundred milliseconds for pressing the switch.

          There are the open drains reset lines that would beused to press the
          switch. If your on/off switch is active low, use the active low reset.

          TLC77xx series uses 9 microamps while the TL77XX series uses 1.8mA but
          can run at much higher voltages.

    2. I have hacked a laptop to power on automatically. I have an old laptop that I use at work. I can power it on/off via an IP controlled power strip when I log in from home [I have removed the battery]. But the laptop wants to have its power switch pressed.

      Solution: A 5V relay [salvaged from an old modem], with the n.o. contacts wired across the laptop power switch. The relay coil is wired in series with a 2500uf capacitor across the PSU input. When power is applied, the relay closes until the cap is charged, & the laptop starts up. No 555 or microcontroller required.

    3. I don’t know if this option is common in laptops or not but many of the desktops I have worked with had options to automatically come back on when power is restored. You just had to go into the BIOS and enable it. You might want to check for that before making an unecesary hardware modification!

      But… the more I think about this the more I think it might be a bad idea anyway. What if they are still working on the power? How many times is it going to go up and down before it is stable? All that improper power cycling could corrupt the data on your hard disc or maybe even cause physical damage to the drive. I think it might be better to just go the UPS route and if the power is down long enough to drain the UPS turn it back on manually.

  1. Since the Tiny only pulses once to simply switch on the NAS, why not have the Tiny go to sleep after that one pulse. Now it may not be as important as it gets its power from the Router which is powered by an AC adapter. Just a thought.

  2. I’ve solved this problem in the past using a single wire. The power LED was active high, and the power button was active low, so connecting the two together made it “press” the button while it was off, and “release” the button as soon as it had turned on. Worked perfectly. :)

    1. Nice idea!

      I have solved similar products by placing a capacitor over the switch. During power up the capacitor will short the switch and the product will turn on. You can add a pullup/pulldown resistor if the capacitor charges to slowly and it turns itself off again.

Leave a Reply

Please be kind and respectful to help make the comments section excellent. (Comment Policy)

This site uses Akismet to reduce spam. Learn how your comment data is processed.