A project out of frustration. A hardware solution to bad software…
[Project complete……but check in a few months for performance reporting]
Also available at hackaday.io
AutoResetRRR is a kind electronic frustration reducing device: it cuts the power periodically to devices that can go nuts (routers, net cams, servers), but it does give a heads up. If all is well, they can shut down safely and start back up. If not, the power cycle can fix a thing or two.
I have a raspberry pi time-lapse rig that sometimes hangs. And a few simple IP cameras also used for time lapse, all a bit inaccessible. And my modem/router that comes from the ISP gets the “slow internet syndrome” every now and then.
They should have good software, but they don’t. I cannot change the software in most devices to tell it to restart periodically, unlike my openwrt stuff. So I have fix this in HW by cutting the power with the AutoResetRRR.
Oh, and it allows devices like the RasPi to have a soft shut-down button like you expect from any PC.
What it is
A small devices that you place between the power adapter and your device. I works with most supplies from 5V to 35V, and can switch over 3A, so practically any device you might find in your home. From time to time, say once a day, it cuts the power to that device for a few seconds, forcing it to reboot. For devices that can use this, such as a raspberry pi, a separate pin can warn a little ahead of the coming restart and allow for safe shutdown.
As or the bells and whistles, especially for the raspberry pi, there is a possibility to shut down the power permanently by pulling a pin low.
Why it is not? Or the things I thought about before
A 555: because it’s difficult and requires bulky components for such low duty cycle, plus it is hard to get long durations or a pre warning.
A programmable of the shelf timer: it’s not possible to get a pre shutdown warning with it. Plus, I need quite a few of them, which makes my solution more cost effective.
ESP8266 based: mostly, too much current. A lot of the devices I have don’t have the margins to support the peak 250mA from their power supplies. Plus, so far quite a few of my ESPs have died after just months of operation.
Just a way to press the reset switch: it’s too much effort to get inside most devices.
A super complicated device with touch screen, configurations and bells and whistles: I want something simple that can have a high reliability and needs little time to design.
This is the first device I made on a bread board, but the PCBs are already mostly designed. So far the software is incomplete, but the reset time-out is working. The blue LED is the one that will blink, while the green one simulates the device.
Schematic and PCB
I finished the board and sent it to the fab. Schematic and PCB rendering below. Files are available at GitHub along with the firmware and raspberry pi software. The usual 5V regulator with fool proof diode ensures a good 5V supply for the ATTiny13 micro, up to 35V input. There are no worries for powering the device from 5V directly, at the low current consumption it will get about 4V, enough for proper operation. But of course, you can totally skip the regulator in case of a 5V supply. A IRLL2705 logic level NMOS takes care of switching the load. And the brain is a small 1k of flash micro, the ATTiny13.
Your typical LED insures a nice blinky to tell you everything is working. The same output is going to intelligent loads like the Raspberry Pi: 2 minutes before the reset the LED will stay constantly on, to tell it to shut down. The same pin is used bidirectionally: if the load will pull it to ground, that is a sign that it should be powered off soon, so the AutoResetRRR will cut the power after a delay.
I made the PCBs at Elecrow, and due to the small size they sent quite a few extras. Time to get soldering
First one assembled
The first device skips the 5V regulator, as I am testing it with a raspberry pi. Everything is red, even the LED. I began to test it for the raspberrry pi as this needs the additional python software required to shut-down the pi safely. I am thinking to implement the functionality of a power button as well, will be a simple one, since the Pi does not have such functionality.
To contact the side ISP connector I use a home made PCB with a simple 90 degrees connector with pins slightly bent
And brief tests with the Pi, shutdown during the warning time works smoothly.
Parts are here and…
It appears I have accidentally ordered the wide version of the SO8 package for the tiny13. It has been
5 years 0 days since the last wrong part purchase. The pitch is the same, so I will probably get around this by bending them.
Mini assembly run
I have assembled 6 more devices, for a total of 8. Collecting the parts, assembling them and programming the 6 took slightly less than 1 hour, that is 10 minutes for each device. Not bad.
Notice the 2 ways to connect the power, supported by the PCB: using terminal blocks or DC jack. Of course, any combination of the 2 is possible. I prefer terminal blocks for all the devices that are out of warranty and I can cut the cord to as this allows for a more optimal placement, such as at the middle of the cable.
And finally, some tests with the most relevant type of device: the router. Disclaimer: this is not the router it will be used for, fortunately this can run OpenWrt.
Camera installation coming soon… and possibly a 3d printed case, although i have some project cases that fit the device nicely and that is a faster way to get things done.
Project is now complete: will report in a few months with the performance of the device!
Pingback: 1000.1000 Hardware « Electro Bob