I just finished a new project, which is called Always-On. This project is a simple bidirectional bridge between the mains-voltage installation and an Adafruit Feather board as a controller.
The idea is to have a device integrated into the electric installation. It works as a smart light switch, monitors power lines or works as a timer for a device.
In this post, I describe a minimal version of the project I used as a prototype, which has one power sensor and one solid-state relay. It may be a good starting point if you plan to create a similar device.
In contrast to other projects, I will do only a superficial overview in this post. It is no project to be copied as shown. This post is meant as inspiration providing a working base to start.
Let’s have a look at the different sections and components of the device.
The left side of the board is connected to mains power and the right side is the low power side with the controller. There is a large air gap between the two sides as extra protection.
There are three fuses (A) and two over-voltage protections (B) as an extra safety measure. A power module (C) IRM-03-5 from Mean Well converts mains-voltage to the required 5V DC for the controller part. The traces on the top and bottom side are covered with insulating silicone.
On the upper side is the solid-state relay (D) IXYS CPC1966YX6, which can switch a load up to 3A. On the lower side is the optocoupler (Lite-On LTV-8141) for sensing line power. I use two 100kΩ 3/4W resistors to reduce the voltage for the optocoupler to the required value.
The right side of the board is built around a socket for any Adafruit Feather board. The shown minimal version has 5V as main power supply, the Adafruit Feather provides the 3.3V power from this source.
I use an Adafruit Feather M0 Adalogger (A) in this example, any other Feather will work too. You can add boards with WiFi, Bluetooth or LoRa and use Feather Wings on top.
On the lower side is a small debounce circuit (B) for the optocoupler signal and on the upper side, two LEDs (C) for displaying the current state of the power sensing circuit and solid-state relay.
There is a footprint for a DS3132M RTC chip (E) and a super capacitor (D) as backup power. The footprint (F) is for an optional FRAM chip to store settings or logs.
Extension / Sensor Connector
The connector on the very right side of the board is for connecting sensors and extensions. It provides 5V and 3.3V power, connection to three microcontroller pins and a separate I2C bus.
The following schema is for the shown version of the device.
Specific part numbers are only noted if they are important and the result of calculations, otherwise, common components for resistors, capacitors and LEDs will do.
I designed the device to do tests without connection to mains-voltage. The mains-voltage part is disconnected and the controller side is powered using the USB connector on the Feather board.
Now just the controller side is powered and you can use the test button to simulate the power sensing via optocoupler and monitor the state of the solid-state relay using the LEDs.
This is a very safe way to develop a firmware for the controller, without all the risks of mains electricity connected.
For deployed devices, you simply remove the Feather board and work on the firmware with the test board, not connected to mains-voltage. After finalising the new firmware version, you put the feather back into the device.
Housing is very important. I designed the board to fit into an IP65 sealed case using two cable glands on both sides. There has to be enough space in the housing for free air circulation.
If you are unsure about the heat dissipation, just add a temperature sensor to your device and use it to monitor the temperature rise in some extreme situations. E.g. use a hairdryer to simulate a hot summer day. 😁
A controller as shown provides a permanent solution for home automation. With your custom firmware, you control lighting or other devices in complex ways, without WiFi, Bluetooth and smartphone required (aka. IoT).
If you have any questions, missed any information, or simply want to provide feedback, feel free to comment below. 😄