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.
Three words: “Uninterruptible Power Supply”
One Acronym: “UPS”
United Parcel Service?
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.
You’ll need a pretty beefy UPS for 4 days.
Yep, pretty much the whole truck.
Well yeah – I’ll probably get a generator and install a transfer switch for it.
Yeah, we’re really talking about two different solutions to two two non-trivially distinct problems.
I think this is a more elegant solution. He doesn’t need it to persist through power outtages, he just doesn’t want to manually boot it. Total cost on this hack had to be under $3 which I think trumps purchasing a UPS.
Three words – Diode, resistor, capacitor.
Will not work in many cases.
yea, while the solution technically works…
Repeated power outage are really not good for a NAS…
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.
he would be better off spending $30 on a laptop with cracked screen
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.
That could perhaps have been done with a 555 too…
Not for the DEWA (Do Everything With Arduino) generation
^^This
I immediately thought 555 in one shot. You could also do it with a cap and resistor like the linkstation/kurobox guys do it.
I thought it WAS a 555, until I read a bit more of the article.
Done properly, I’ll drain far less power with a tiny. And orders of magnitude less power with a TPL5000. So a 555 might be educational, but not necessarily as practical.
Easier to tweak this way if he thinks of anything to add to it later, too.
A traditional UPS is an obvious, but power hungry solution. A really cool solution would be a simple DC UPS circuit similar to the ones found on some cable modems. If the battery pack were big enough, the NAS could even be made portable!
Portable WIFI NAS interesting I have a spare router somewhere around here and some spare battery packs “sound of rummaging in parts bin”
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.
That is what I have done to run power to my network equipments. I used
pluggable modules for the odd balls requirements.
http://tekkieneet.wordpress.com/2013/08/10/ive-got-your-back/
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.
Where’s the cap across the VCC & GND pins of the micro?
There should be a 0.1UF or so soldered across the socket pins.
newer atmegas already have a 0.1 uF cap inside them.
Really? Which ones? This is news to me.
[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)…
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.
I wonder how brief the brown out periods are. I wonder if a super capacitor on the power rails would be enough to keep it up during the brown out.
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”
create.usc.edu/research/50772.pdf
Supercaps are good for up to seconds worth of backup.
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.
How can you do this without the ATtiny? i want to do something similar but for a laptop.
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:
http://codeidol.com/community/hardware/start-up-and-shut-down-your-car-pc/3790/#part-58
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.
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.
On 2nd thought that won’t work as the reset is asserted until the power comes up. Might be able to do something by using reset pins with R/C to press the switch.
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.
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.
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.
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. :)
The pure essence of ingenuity!
Might want a high-value pulldown resistor, and a lower one from the LED, but still, if it works!
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.
I have a laptop with no battery running my XBMC, I was wondering how to do just such a thing. Thanks! TO THE SOLDERING IRON!