“How to control several blinds with inexpensive relay boards (not ruining them) with physical buttons and remotely simultaneously.
Just bought a new house and wanted to automate everything, starting with the blinds. What seemed to be an easy project turned out to be a bit of a nightmare: the relative high power motors (150 W) were destroying my relays and triacs, what wireless communication and controller to use and how to make it work was not obvious, noise in the lines were causing random activation of the blinds (pretty scary in the middle of the night)… Finally I managed to solve all those issues with very cheap components and hopefully I can help someone else to spare these headaches and a lot of time.
Don’t like to program, but love to solder? Read anyways the tutorial and at the end you find a discrete circuit, which does the same, but with no intelligence.
When controlling motors, an important issue is their inductance, which causes that when trying to open the circuit, the current insists on keeping flowing through your breaking device, causing a very high voltage. If you try to break the circuit with no precautions with a small relay, their contacts will stick together, and if you use a triac (solid state relay) the over-voltage (in my case I measured peaks of more than 1600 V) will destroy the semiconductor.
I realized by googling, that other people had issues with this, but they took the easy, expensive and voluminous way, they just get bigger relays, still needing the cheap relays just to activate the bigger ones, while the contacts will still suffer and may fail eventually. As an engineer I could not allow myself not to get the most efficient solution. :) In the schematic below you have the solution to spare this big relays just by adding one resistor, one capacitor and one varistor.
The varistor protects the triac from an over-voltage. The resistor plus capacitor forms a RC Snubber circuit that absorbs the energy during the breaking commutation.
Instead of using one pin for the up command and another for down for each blind, the switches share a common line that indicates whether the blind has to go up or down. So we use 5 inputs instead of 8. No filter is needed, inputs are software debounce.
First the Arduino activates the relays module to select the motor direction, after a small delay, so the relay contact is already in place, it activates the triac, feeding the motor with the 230 VAC through the cheap relays and triacs modules with no issue. To break the circuit the process is the opposite, first triacs and then relays, so relays never suffer a live commutation.
You may use from one to four motors, with no need to modify the code, it won’t harm to have the logic for the other motors if you don’t use them, unless you need the pins for something else, obviously.
At home we have two stories and hence, two circuits. Since remote commands must be unique, I have made the code to be valid for any of those by commenting one line at uploading time. If you are mounting only one circuit, you don’t need to change anything, but if you will build two, there you have already the solution for free. In fact I just lied to you, we have three circuits, but in total 8 blinds, in one circuit we occupy all four motors, but the other four blinds are split in two by using the first three inputs in one Arduino and only input number four in the second. The duplicated circuits react to the remote commands exactly the same, but where there is nothing connected, there is nothing to activate. :)”