Introduction:

About once a month either my cable modem or router stops functioning. There is no indication of this other than that the internet no longer works. There is a built in switch with the router, and that always works fine, and none of the status LED's would show any sign of a problem. But in order to get them to work again, one or the other will need to be power cycled, depending on which one isn't working.

I first noticed this problem when occasionally an error light would come up on the router, and the router would no longer function until it was power cycled. So I built a device which would cut power to the router during a brown out or black out, and then restore power a certain interval of time after the power was restored to a normal voltage. I was able to simulate weird power glitches and brown outs and get the router to lock up and have the error light come on. When I added in my device, and put the router under the same conditions, the power cycler would always catch it and reset the router.

But after using this setup for about 3 months, I noticed there were still problems with the internet going down, and the error LED did not ever come up. Sometimes the cable modem would need to be power cycled as well. So I went ahead and got a UPS for the cable modem and router (and nothing else attached), hoping this might catch some other power problems. But this still didn't help, so I made another power cycler, the one mentioned on this page.

This power cycler does not monitor power conditions or anything else, it only power cycles when a button is pressed on the unit, or a signal is sent through a device connected to a modular jack on the power cycler. But one of the external devices connects to a computer which monitors the internet connection. If the internet is down, a signal is sent to the power cycler, and the modem and router are reset automatically. Another device interfaces with the phone line, so I can call in from anywhere and reset them if there is a problem.

How it works:

The power cycler itself is fairly basic. A relay controls power to the attached peripherals. The one I used is rated at 20 amps, which I used merely for versatility if I decide to use this for some other application in the future which may require a decent amount of current. But for just a cable modem and small consumer router like I use, a 5 amp relay is more than adequate. When a push button on the side of the unit is pressed, or a device attached to the unit through a modular jack sends a signal, a microcontroller activates the relay for a period of time. That period is user selectable via a dip switch or rotary switch on the unit, and the cycle periods range from 0.5 seconds to 60 seconds.

The real advantage to this power cycler is that external devices can activate it. Currently I only have an external button which is near one of the computers in my house. But I plan on adding two more devices which will likely solve all my internet problems, or at least those that I am able to solve myself (if internet goes down because of my ISP, I'm SOL). Probably the most important one is a device which will connect to my server's serial port.

The server will run a program which pings a few IP addresses on the internet (such as google.com, ebay.com, etrade.com) every few minutes. Should all pings return no response, a signal is sent to the device on the serial port, telling it to power cycle the cable modem and router. But this program has not been written yet, so I can't post it for you!

Another device will monitor the telephone line. It will simply listen in on the line, and when a certain sequence of DTMF codes are sent, it will activate the power cycler. This way I can reset the device from any telephone in my house, but more importantly, I can call my house from anywhere, and when either a person or answering machine picks up, I can dial in the code from my phone, activating the power cycler. I have not made this yet, but it should be fairly simple.

Schematics:

Power cycler:

Remote:

Source Code:

Pictures:

Power Cycler:

Remote: