Off is not always off - saving power with the four-channel remote switching system

Saving power with the four-channel remote switching system

Electronic devices run on electricity. Even when they are switched off, energy flows through the cables and out of the power grid. For example, a normal workstation may be consuming up to 100 watts of power without a device actually running. Common 433MHz remote switching systems achieve only limited success. This project shows you how you can save electricity at your electrical workstation to your own ARDUINO based four-channel remote switching system.

Effort

Suitable for: Advanced students with programming experience with HTML as well as Arduino

Costs: approx. 50,- €

Time expenditure:

  • Time expenditure board assembly 1 hour
  • Time expenditure board production 1 hour
  • Software installation ¼ hour
  • Enclosure construction (depending on installation situation) 4 hours

What is needed:

Safety note

Basically, only the commissioning requires knowledge in dealing with dangerous voltages. The board itself can be operated with two different power supplies: with the common mains voltage of 230V or with a 5V USB charger. For safety reasons we recommend to use the USB power supply. It is galvanically isolated from the mains and short-circuit proof. For the connection to the mains, an electrician should be consulted in any case, unless you have the appropriate qualification yourself.

The layout of the board allows a direct mains operation with 230V: the distances between the conductors are designed according to the regulations for electronic devices of protection class 1 with protective earth. This also means that all metal parts of the housing must be connected to this protective earth.

Specifications for hardware and software

Hardware

As the name suggests, your remote switching system should provide four channels that can be switched separately from each other. Each channel shall have a power of 3A/230V AC and according to the Ecodesign Directive, shall indicate the standby consumption and the switching states of the devices at 1W with an LED display. The four-channel remote switching system is designed to be mounted in either a desktop or DIN rail enclosure – even in a metal enclosure or metal cabinets with a 2.4GHz antenna extension. The switching contacts are connected to the system via screw terminals.

Software

To keep the barriers to using the four-channel remote switching system as low as possible, the software is designed to meet a variety of requirements: for example, the system not only has a browser-independent user interface – it is also designed to be operating system-independent and supports smartphones, tablets and PCs. In order to be able to set up the corresponding WLAN parameters, the software is configured in a WiFi-assisted manner. In addition, the ESP8266-based WEMOS D1 mini as CPU device ensures cloud-free operation of your remote switching system.

Hardware structure

Your four-channel remote switching system consists of two separate boards: the display and control board and the processor and relay board. Both boards must be connected to each other by both a seven-pole and a three-pole cable – either directly or via connectors. The relay switching contacts are connected to screw terminals.

Overall circuit diagram incl. the wiring of possible sockets
Overall circuit diagram incl. the wiring of possible sockets

Board assembly

Since the supply situation of the individual components changed constantly during the circuit development. Two separate PCB layouts had to be created. This mainly affected the relays and voltage transformers.

Four-channel remote switching system-V1c.lay6 with HLK PM01 and MT relay
Four-channel remote switching system-V1c.lay6 with HLK PM01 and MT relay
Four-channel remote switching system-V1d.lay6 with Meanwell IRM15-5 and Axicom relay
Four-channel remote switching system-V1d.lay6 with Meanwell IRM15-5 and Axicom relay

The two boards “control logic” and “operator panel” are combined in one layout and can be cut apart after drilling. The assembly of the finished boards is easy, because there are no SMD components used. If you want to mount the circuit on a breadboard, there should be at least 3mm space between the traces of the control logic and the switching contacts. Any copper areas in between must be removed.

Finished board version 1c
Finished board version 1c

The board can be installed in a normal desktop case with sockets or in a top-hat rail case. If you install a top-hat rail housing in an electrical distribution system, you should consult a qualified electrician.

Antenna extension with the WEMOS D1 Mini

If you install the WEMOS D1 Mini in a metal enclosure such as a control cabinet or desktop case, the radio traffic will be effectively shielded. To bypass this shielding, you must connect an external antenna, but a WEMOS D1 mini is not designed for this. The following images are describing how you can elegantly solve the problem.

Antenna of the Wemos D1 mini
Antenna of the Wemos D1 mini
At the marked position you have to cut the conductor path
At the marked position you have to cut the conductor path
The new antenna: a coaxial cable, 60mm, stripped, Lambda ¼
The new antenna: a coaxial cable, 60mm, stripped, Lambda ¼
The new antenna soldered on. Caution: there is a risk of short circuit.
The new antenna soldered on. Caution: there is a risk of short circuit.
Fix the soldered joint with epoxy glue.
Fix the soldered joint with epoxy glue.

To ensure good reception, only the stripped part of the antenna must be outside the metal housing. The shielded part can also be inside the housing and may also be longer than shown in the photos.

Power supply

The power supply of the controller can be done in two ways: if available with an AC/DC converter on the board or via the micro USB connector of the WEMOS D1 mini. For this you can use a 5V USB charger – or you supply your remote switching system via the USB port of your PC. However, the second variant is only recommended if you are working on the software anyway. Otherwise, the USB charger is the better choice. The current consumption is about 200mA. The exact value depends on whether all LEDs are lit and which relay type you use.

Software description

To make full use of the ESP8266 chipset of the WEMOS D1 mini, the software has been completely developed in the ARDUINO IDE 1.8.19 environment. Thus, with WiFiManager 2.09 and an ESP8266 WebServer higher than 2.0, only two libraries are required.

The clearly arranged source code consists of 80 percent HTML code. If you want to make adjustments within the code, you should have HTM knowledge accordingly. To keep the code readable, subroutines have not been used. In addition, Java has not been used for security reasons.

Logging into the local WiFi network

To be able to use your four-channel remote switching system, you must link it to the local WLAN in the first step. After switching on, the system independently checks whether it can establish a WLAN connection. If this does not work, an access point (AP) is started, which allows you to enter the required login data and save it permanently. As soon as you have registered it via the WLAN configuration, this AP can be reached under the IP address 192.168.4.1. The following data is required for the login:

  • SSID AP:                                 4Kanalschalter
  • Default password:               4Schalter

After the configuration, the new SSID appears in the WLAN settings of your terminal device, which you can use to log in normally. All other WLAN connections are stopped during the configuration process and restarted after completion. For security reasons, you should individualize the default password before installing the software.

If the default browser does not start on its own, you can start the configuration portal on its own under the IP address mentioned above.

Once these steps are completed, the system automatically logs into the local WLAN.

Functions

After successful login, you can access the user interface via the IP address assigned by the router. How you find this out depends on your router. Fritzboxes, for example, assign device names with the combination “ESP-” at the beginning of the name. Once you have found out your IP address, simply enter it in the browser and the user interface will appear after a short time.

The basic settings of the individual buttons have been chosen in such a way that they can easily be operated via a touch display. The last column shows the status of the respective output.

The individual functions have been assigned colors that can be clearly separated from each other:

  • Yellow:            push button function, output becomes active for 500ms
  • Green:            On switch – the selected output is switched on permanently
  • Red:               Off switch – the selected connection is switched off permanently

The lowest button group switches all outputs either on or off. As the browser cannot register the operation of the buttons, you have to update the user interface manually.

User interface
User interface

Testing with the browser

The user interface was tested on five different devices: Windows PC, Raspberry Pi, Apple iPad, Apple iPhone, Samsung smartphone. The six most popular browsers were used (Chrome, Firefox, Edge, Internet Explorer, Safari & Opera). The interface could be used without any problems with all systems. Only the response times diverged from 0.5s (Firefox) to 6s (Chrome).

Customization options of the software

Those who enjoy programming can individualize the interface. However, the partly hardware-specific areas “main setup” and “void setup” should remain untouched, otherwise problems with the electronics could arise.

In the area “void loop” the user interface is created. For this, after a system login, all buttons are queried and the corresponding switching actions are performed. Afterwards the website is built according to HTML standard. Here especially the colors of the status buttons are controlled depending on the switching states. So with some HTML knowledge you can customize colors, positions and backgrounds in this area.

Final performance measurement

A final performance measurement of the prototype showed that the four-channel remote switching system saved about 99.3 percent of the standby power. Whereas 100W was measured at the workstation at the beginning of the project, with the remote switching system it was only 0.7W or a current consumption of 3mA. With the ARDUINO-based four-channel remote switching system, you too can make your workplace more energy-efficient.

Images: reichelt

Leave a Reply

Your email address will not be published. Required fields are marked *