This all started when the router I have at a remote site with cameras, WiFi locks and other smart devices is three hours away and would, on rare and inconvenient occasions, need to be rebooted to troubleshoot WiFi issues. This mod allows you to be anywhere and power cycle your router (or modem) conveniently.
The challenge with using typical smart plugs for this is that when you signal them via WiFi to shut off your router or modem, you then lose the WiFi connection needed to turn them back on again.
There are purpose built switches out there to do this but they are priced between $50 and $100; this build only costs about $10 for the switch and the relay needed:)
The reason for using the Sonoff switch is that it's the only brand I found that has an "inching" feature, basically a timer that when device is turned on, it then turns it off automatically after a chosen interval. This gets us half way there.
We need the exact opposite to happen, be on all the time and then power off, for say 10 seconds, and then power back on automatically to reboot the router.
You could re-flash the ESP controller with your own custom code, Tasmota etc. to do this but the downside is the relay is energized all the time (only off briefly during power cycle) which might impact longevity. I did not want to break the standard Sonoff eWeLink app integrations (such as Alexa, Google or Apple Homelink) with reprogramming. (You could certainly do both, reprogram the Sonoff Basic and do this mod also).
The quick fix is to swap out the Normally Open SPST 5V relay with a NO/NC SPDT relay and use the Normally Closed pins instead.
So with the mod done, the relay coil is not energized but powering the router/modem. They energize only when signaled remotely (or by schedule) which turns the router off. The Sonoff "inching" function then takes over and automatically de-energizes the relay after 10 seconds turning the router back on again. Router reboot problem solved!
NOTE: Do not connect the power cord to the Sonoff Basic until completely done with the mod and the PCB is put back into the case.
The Panasonic relay NC connection is rated for 3A, not 10A like the NO connection so this mod should only be used with devices drawing less than 3A.
This is not a problem for me as the power adapters for routers/modems are typically 2A or less.
Opening the Sonoff Basic is simple, you just need to pry the two plastic case parts apart to remove the circuit board. The existing relay (black cube) has 4 pins, two of them are heavily soldered (to be able to carry the line current) and the other two at the end are the 5V pins that have much smaller traces. I won't go into desoldering techniques, the larger traces take a bit of time to heat and I had to use the pump several times to remove all the solder.
Step 2: Drill a Small Hole in Correct Position for New RelayThe Panasonic ALQ105 relay is very close to the form factor and pin layout of the original relay. We only need to use 4 of the 5 pins on it, the NO pin (the top right pin in the bottom view cad diagram) is not used and needs to be bent flush with the relay or cut off.
Of the 4 pins needed (5V coil pins, common and NC) three are in the right position; only the common pin is in the wrong place but very close to the trace needed to complete the connection. This pin needs to have a hole drilled 10.16 mm from one of the coil pins. Just set a micrometer to 10.16 mm, place one of the ends into that coil pin hole and scratch where the second hole is to be drilled.
After fitting the relay in the holes, bend the Common pin going through the new hole over to the trace and solder the 4 pins, That's it for the hardware!
Step 3: Setting Up the "Inching" TimerAs mentioned earlier, this uses an "inching timer" that is set up in the eWeLink application. This assumes you have already added the device and connected to WiFi, (For the Basic switch, use "Compatible Pairing" bottom left of the "+ Add Device" screen).
Click the 3 dots in the top right of the screen to open Device setting, then scroll down to "Inching Settings" select that, and in the "Inching Settings" screen, toggle it on and set the "inching" time to whatever you like (I set mine to 10 seconds) and save and save again.
That's it, whenever you want to reset your modem, hit the power on button in the app and your modem will reboot.
Comments
Please log in or sign up to comment.