I put the following circuit together and it's working fine, but I still want to be completely sure I'm not missing anything. I think I read somewhere that when a relay is used to switch between power supplies, a capacitor on the pencil circled area is needed to avoid damage to the relay or other parts of the circuit because of the sudden change of power supply, but I can't find where I read it. I also read that that same capacitor (or is it a second one of other type?) would be useful to supply the load with the voltage that would cut off the time it takes for the relay to change from one power supply to the other. Can someone guide me on what value or type of capacitor to use for both purposes? And if anything else needs correction please let me know and I would greatly appreciated!
-
You need to know the current into the load to properly calculate an appropriate capacitor size. Also, if this relay will be switched to an absent power source (to turn off), you may look into a [flyback diode](https://electronics.stackexchange.com/questions/110574/how-to-choose-a-flyback-diode-for-a-relay) to prevent the damage you're talking about. – Samuel Feb 01 '18 at 22:30
-
Hi Samuel!! The current into the load will me 2A tops. There won't be absent power sources because the switching will be done "manually" through a user interface whenever the DC supply is available. – Fabian S Feb 01 '18 at 22:44
-
1Ah, so you don't want it to switch automatically when the 12V is plugged in and back when it's absent? 2A is a lot, how much voltage droop is ok? That is, during the 10ms your relay is switching, what's the lowest the voltage that the load will be ok with? – Samuel Feb 01 '18 at 23:04
-
We need to know more about the load. What is it? Is it an electronic circuit and if so does it already have capacitors in the supply? Is it an inductive load (motor) that requires something else (Snubber or another fly-back diode). You definitely need a fly-back diode over your relay (Cathode at 5V Anode at In1) – Oldfart Feb 02 '18 at 06:27
-
@Samuel , the switching will always be done through the user interface. The complete system is a generator that will use several renewable resources to generate electricity. All of that energy will be stored to batteries, and we'll be having 12V and 5V outputs to power mainly electronic devices (cellphones, tablets, etc). The first element of the "load circuit" is a step-up or boost converter, so that would prevent a voltage drop in theory – Fabian S Feb 02 '18 at 19:40
-
@oldfart I've written a quick description of the load on my previous comment. I'm not sure where on the supply are you asking if there are any capacitors, could you please explain me in a little bit more detail? There won't be any inductive loads, and the diode (I think that's the one you suggested) is on the relay because I'm using a relay module such as this: https://www.sainsmart.com/products/arduino-pro-mini Thanks a lot for your comments by the way! – Fabian S Feb 02 '18 at 19:47
1 Answers
When the relay switches there will be a short moment where the load does not get power. If it is .e.g. a battery or something which does not have to keep running you can use the circuit as-is. If it has it's own voltage regulator your load is also likely to survive the switch over.
If the load needs a continuous power supply you have to get energy from somewhere else. A capacitor is the simplest solution but there are issues with using capacitors:
- The voltage will drop when they are discharging.
- They can not store a lot of energy unless the are very big.
- If you have big capacitors they can cause your supply to trip/fail at startup.
The is the principle circuit with the formula:
We can calculate R from your 12V supply and max 2A: 12V/2A = 6 Ohms.
Lets assume some figures:
- We can accept a voltage drop of 0.5V.
- The relay takes 10 milliseconds to switch.
Vo = 12V, Vt=11.5V, T=0.01 R=6 Gives C = ~39e-3 F (39 milli Farad) If your supply can deliver 2A I don't think that capacitor will cause problems when you switch your system on.
For other values, different voltage drop or faster/slower relay, you can calculate the capacitor yourself . (I hope..)

- 14,212
- 2
- 15
- 41
-
yeah, a short period without power won't affect the rest of the circuit. My main concern is having a safe circuit. But I guess it would be better if I could avoid it. I'll do some testing with the help of your circuit. Thanks a lot my friend!! – Fabian S Feb 02 '18 at 21:42