# Will there be major negative side effects to hot-switching between two mains AC sources that are not in sync?

I am currently thinking about creating a "box" with a wall outlet, solar input and mains source input. This device will use a solar panel to charge an internal lead-acid battery. It's basically: Off-grid-in-a-box-with-backup-power-from-mains. There's an inverter hooked up to this battery. For the sake of this question, said inverter could be a square-wave ("modified sine wave") output or an actual sine wave generator, depending on the budget. This inverter will be wired - trough a DPDT relay - to the box' wall outlet where it will power household appliances (laptop, tv, phone charger, etc). When a microcontroller recognises that the battery is about empty, it will switch mentioned DPDT relais, so that the outlet on the box will be disconnected from the inverter, be floating for a minimal while and then be connected directly to the mains voltage that is supplied to the house by grid power. When the battery is above a certain charge treshold, the switch will be reverted so that the inverter is connected to the outlet again.

Obviously, the inverter AC output and grid power will NOT be in sync at all - and the relay could be switching over at any point in the AC cycle off the currently supplying source and then connect the AC source at any point of its AC cycle.

Would this unsynchronised switching induce any major side effects like damaging equipment that is connected to this "box" or perhaps damage equipment in the box itself like the inverter, for example due to surges, other things or magnetic fields that were still remaining in transformers in connected devices?

simulate this circuit – Schematic created using CircuitLab

• If you use a mechanical switch to turn appliances on and off by hand, it can open and close at any point in the cycle. This will be no different. The issue is whether the switchover time is short enough to stop appliances losing power for so long that they drop out and reset. Oct 18 '21 at 9:52
• @rdtsc The additional question is whether the sudden phase jump will break anything (e.g. active PFC) Oct 18 '21 at 11:54
• You're more likely to damage electronic devices trying to run them off a square wave inverter. Nov 6 '21 at 19:12
• Life will be a lot easier if you get an inverter that can synchronize to mains on its own. Nov 6 '21 at 19:41

Switching on the mains voltage with mechanical switches is never synchronized. From this point of view, it shouldn't be a problem. I would be much more concerned about the security aspects. Are these taken into account. For example, I don't see any fuses. What happens if only one switch switches and the other does not, e.g. for contact sticking.

In addition, switching times of >1 ms must be expected for relays and other mechanical contacts in which the switch position is not defined.

Given that household switches, circuit-breakers, and the process of connecting a plug into a socket, all exhibit the same "bouncing" phenomenon as pressing a button connected to a microcontroller's GPIO: Generally no damage should occur, especially if the dis-/connects are many hundreds of milliseconds apart. But there are sensitive devices that occasionally get destroyed or reduced in lifespan if you accidentally mis-plug them such that the contact is made/broken in very quick succession several times. The phase that the device sees in all these cases won't be smooth/continuous. So there's a grey area as to whether damage results. As a precaution, make sure the relay waits atleast a full second between disconnecting one power source then connecting another (assuming the type of used relais or configuration of the circuit supports this).

What is far more important however, is that if you switch between power sources over a relay while all loads are still on, this can create a huge inrush current on the relay (especially when many devices with filter capacitors are simultaneously connected), which in most cases might be effectively infinite at the first instant. However, must relays datasheets specifically limit the max allowed inrush current to about 50% more than the nominal value. If you ignore this, the relays most likely will fail quickly, thus constitute a hazard.

If you have an electric motor running directly on the AC mains, you could damage the motor by imposing an out-of-phase voltage on the motor. Most likely the motor fuses would blow before it happens. Usually switching sensitive equipement must be done in-phase with a $$\ ± x^o \$$ tolerance