In this video we show you how to create a “watchdog” for your Internet connection using a Raspberry Pi. If the Raspberry Pi can’t reach Google, it will reboot your cable modem and router. I also show you how to start the script on boot, and a few things you’ll want to watch out for.

Video Link:

0:25 – What do we need?
1:32 – How does it work?
4:24 – Using Raspberry Pi GPIO Pins (a primer)
6:05 – Why this specific relay board?
8:30 – Test code walk through – testing the relay board
11:56 – See the test code in action
12:27 – Full code walk through with Internet test
17:55 – Making the script run every time the RPi boots
20:40 – Wiring it up using two extension cords for parts
43:50 – Live test with two lamps
46:39 – Outtake with Maddox the Airedale!

Parts used:
(Note – As of October 2021 Amazon prices are quite high. You may want to search elsewhere)
Raspberry Pi 4 –
Relay Board –
Dupont Wires –
Brown Extension Cord:
White Extension Cord: h


Relay Demo Code:

Relay Production Code:

Raspberry Pi Router Relay

Post navigation