In my project I use 240 W switching power supply. Due to energy saving and some safety reasons, I don't want this PSU to be on permanently. I'd like to use relay to switch it on and off. However, this PSU has a significant inrush current – 40A/230VAC. Do I have to take some special precautions regarding the inrush current? I mean, do I have to choose a relay able to withstand 40A peak current (which would be quite expensive), or is there some other way how to handle this?
Using relay to switch power supply
power supplyrelay
Related Solutions
If you want to simply replace the switches with something connected to an RPI or other micrcontroller then the most straight forward way is to use a relay driven by a transistor, with the gate/base driven by a microcontroller.
What you are looking at is "remote" for the building intercom (housed elsewhere in your building), the speaker doubles as a microphone and the amplification is most likely done at the base station.
The idea is that a Relay almost ideally matches the contact characteristics of a switch, and provides simple isolation (avoid damaging building intercomm or shocking yourself). and doesn't require you to couple grounds or deal with the building electrics. There are of course other solutions, but you should take care to understand the signals going through your intercom first.
The basic schematic is shown below, but there are countless variations. Certain additional components may be necessary depending on the relay chosen. You would need to provide a voltage to control the relay (depending on relay may be from RPI supply), but this is isolated from the intercom circuit. Connect wires from relay to the same screw terminals in your photo, you can leave the buttons in place and connected.
simulate this circuit – Schematic created using CircuitLab
EDIT
To expand on the above schematic based on your questions. There are a few things going on simultaneously in this schematic.
The hot side of the relay (right side in the diagram) functions exactly like a regular switch, and is completely isolated from the control side of the circuit and is connected in place (or parallel to) the switch in the existing circuit
Instead of a push button, the relay is activated by passing current through the electromagnetic control side of the relay. When current flows through this section it magnetically pulls the switch closed or open (many different types of relays are available, including ones that toggle state instead of hold it).
The electromagnetic coil is effectively an inductor (hence why it is shown as such in the diagram). One caveat with inductive loads is that they tend to resist changes in current flow. Using the characteristic equation \$V_i = \frac{dI_i}{dt}\$ it is easy to see how a decreasing current (turning off current to relay control) will cause a voltage to appear on the terminals of the relay (in the opposite direction of current flow). This negative spike can damage solid state devices. So it is a common solution to use a "flyback" diode (D1) to short this induced emf.
Relays are electromechanical devices, and the coil used to control the switch requires a moderate amount of current to "pull-in" the switch and to "hold" the switch once it is turned on (the former is larger than the latter). Depending on the relay these values will typically be either near the limit or above the maximum current that a GPIO pin on a microcontroller or RPI can provide, it also will likely require a higher control voltage than the GPIO pin supply. The transistor is used as a switch to turn the relay on and off. It can handle the higher current used to control the relay, and in the configuration shown above you can use 3.3V or 5V logic to easily switch the transistor on and off.
The operating mode of a transistor depends on the ratio of the base current to the collector current. The resistor is chosen so that the current flowing through the base puts the transistor into saturation (fully on). 1k is a representative value, typically values from 300-1k are used depending on the load current.
You are more or less close to the answer, but you should rather use the capacitor energy equation: \$E = \frac{1}{2} C * V^2\$
The Energy that you need to store can be calculated as
\$E_{needed} = Power * time = ( 12 V * 10 A ) * 10 ms\$
Then you have two instants of time, before and after the switching:
\$E_{before} = \frac{1}{2} C * V_{before}^2\$
\$E_{after} = \frac{1}{2} C * V_{after}^2\$
then \$E_{needed} = E_{before} - E_{after}\$
Also you want \$V_{after}\$ and \$V_{before}\$ close to each other, perhaps 1 V is ok (you must check the load specifications), so there is enough voltage to feed the load, \$V_{before}=12 V\$, \$V_{after}=11 V\$.
The voltage will always go down a "little", that is the rule when discharging capacitors, how "little" depends on how big the capacitor.
Related Topic
- Electronic – filament led bulb inrush current
- Electronic – Safe 0–300 VDC variable supply
- Electrical – Relay sticking when switching mains for LED power supply
- Electronic – Cheap alternative to limit inrush current (eg. relay bypassing a fixed resistor or MOSFET)
- Electrical – Switch mode power supply inrush current protection
- Electronic – Inrush current of high voltage power supply
Best Answer
Conservative engineering practices, and my own "school of hard knocks" experience say that you have to size the relay for the inrush current, because even a brief surge can weld the contacts, in which case the relay is stuck on and could lead to a bad safety problem. But don't decide by looking at the brief ratings in a catalog. Look at the data sheet and see if there is an inrush rating that is higher than the continuous duty rating. Motor starting contactors are an extreme example of this. They have contact materials that resist welding, and their ratings reflect this. Another approach that you see in large power supplies is a separate set of contacts, in series with a power resistor, that are closed for a second or so before the main relay closes, to more gradually charge the filter capacitors. Sometimes referred to as a "soft start" circuit.