Smart power strip week timer

Based on the adaptive smart plug project, I just wanted a simple no cloud, no server Рstand alone smart power strip, that simply turns the mains outlets on and off during the day . Furthermore , the smart power strip should continue the schedule even though the wifi drops off.  The smart power strip is once again based on the Denver SHP-310U and it provides a simple web page to set the start times and the end times for the outlets to turn on and off.

Below is the settings web page shown in a Windows Brave browser. The USB outlets are active when the rightmost mains outlet is ON. For each outlet 4 time plans are available for each week day to define the start- and end-time for an output to become ON. Overlapping the ON periods is allowed !.

The time settings for turning the outlets ON and OFF are saved in the emulated EEprom area of the ESP8285 flash memory. The smart plug green LED is on when connected to the wifi network, and the output red LEDs is on when the actual mains outlet is ON. It works with the Arduino OTA and the wifi captive portal as well.

The Arduino source code for the no cloud smart plug is found here: Power strip week timer

Details on flashing the ESP8285 microcontroller is found in the adaptive smart plug description.

The power strip does not include a Real Time Clock and thus need to access a NTP server at start up to set the current time. To get around that I made a dual output version, because I want to control our 5G modem and the Raspberry PI home server:

A sketch of the schematic looks like this:

Basically, the circuit can switch voltages in the range 5..30 V DC at max. 50A, but taking cooling, connectors and wiring into account..!! The main components used are the IRF3708 MOS-Fets and these boards, that can be purchased from Aliexpress:

The PCBs along with LEDs , resistors, capacitor and the IRF3708 MOS-FETs built into a plastic box:

At power up, this version of the weekly timer dont need to wait for an internet connection to acquire the time via NTP, it just reads the current time from the PCF8563 Real Time Clock RTC), backed up by a CR1220 battery.! In case an internet connection becomes available, the RTC is updated with the NTP time on a hourly basis.

To use the captive portal to set-up the wifi ssid and password , the tiny push-button marked ‘0’ on the ESP32-S2 board must pressed while applying power. The wifi setup use the scheme as for the adaptive smart plug.

An example of the web page to set the weekly timeplans for the 2 outputs with 4 timeplans each:

It is possible to use up to 16 outputs, but the total number of timeplans must not exceed the product of: ( number of week time sets ) * (timeplans for each week time set), that is , using 16 outputs , each output has only one time plan. Using 8 outputs, each output has max 2 timeplans. In the example above with 2 outputs, each output could have max. 8 time plans allocated. The number of outputs and time plans are defined at compile time.

The Arduino OTA is included as well in the source code here: ESP32_RTC_week-timer