Remote WiFi Router Reboot Hardware Mod
by smotus in Circuits > Microcontrollers
36 Views, 2 Favorites, 0 Comments
Remote WiFi Router Reboot Hardware Mod
This simple and inexpensive hardware mod provides a way to remotely power cycle your router and restore your WiFi connection.
The challenge with all the smart plugs I researched is that if you signal them via WiFi to shut off your router, you lose the WiFi connection and then cannot turn it back on again.
So, as I looked all around for a way to do this, the only products I found were purpose built and were priced between $50 and $100 (which seemed way to much to pay for something so simple), this build cost me about $10.
The reason for choosing the Sonoff smart switch is that it was the only controller that I found that had an "inching" feature, basically a timer that when device turned on, would then turn it off automatically after a preset interval stored in the device. This gets us half way there but opposite of what I needed: be on all the time and then power cycle off, for say 10 seconds, and then power back on without intervention to reboot the router.
One could reflash the ESP controller with your own custom code or use Tasmota, Home Assistant or one of the other home automation packages but that would mean have the relay energized all the time. Or, you don't want to go through the ESP8255 reprogramming effort and just want to leverage the standard supported eWeLink integrations such as Alexa, Google or Apple Homelink.
So, the simple solution was to swap out the Normally Open (SPST or 1 Form A) 5V relay with a NO/NC SPDT/1 Form C relay that was as close to the original relay size and use the Normally Closed pins. So most of the time the relay coils would not be energized but on and would only shut off temporarily only after it was signaled remotely or by a schedule using the Sonoff "inching" function.
NOTE: 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 was not a problem for me as the power adapters for routers/modems are typically 2A or less.
Supplies
- Sonoff Basic Controller (typically $8.00, bought 3 pack from Amazon)
- Panasonic ALQ105 SPDT/1 Form C Relay (around $1.50 ea, bought from Mauser)
- Short extension cord
- Drill and fine drill bit (No 59 bit works well)
- Soldering Iron, Flux and Solder
- Desoldering pump
Open the Sonoff Basic and Desolder the Relay
Opening the Sonoff Basic is simple, it come in a plastic case and you just need to pry the two 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 current) and the other two at the end are the 5V pins that have much smaller traces. I won't go into desoldering techniques, but suffice to say the larger traces take a bit of time to heat and I had to use the pump several times to remove all the solder.
Drill a Small Hole in Correct Position for New Relay
The Panasonic ALQ105 relay was chosen because it 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. I just set my micrometer to 10.16 mm, placed one of the ends into that coil pin hole and scratched where the second hole was to go, then used the small drill.
After fitting the relay, bend the pin going through the new hole over to the trace and solder the 4 pins, That's it for the hardware!
Setting Up the "Inching" Timer
As mentioned earlier, this uses an "inching timer" that is set up in the eWeLink application. Ths 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. I set it to 10 seconds and save and save again. That's it, whenever you want to reset your modem, hit the power on (which now turns it off) and it will power cycle down and back up allowing you reboot your modem and reconnect after it reboots.