Choosing capacitors to avoid spikes/ripples  - Page 1
Forum section: electronics / beginners

author: sairfan1
author_rank: Frequent Contributor
timestamp: November 21, 2023, 06:30:02 pm
content: I'm setting up arduino where I will be driving some motors, relays and LEDsI will be using transistor (BD139) to turn on Relay to use 12v motor, some transistors to turn on LEDsI have few aluminium electrolytic capacitors in 16v and 10v about 1000uf and more, I want to know if i can use these capacitors on the power supploy for ArduinoDo i need to use some capacitors near Transistors or Relays?

author: Thunderer
author_rank: Regular Contributor
timestamp: November 22, 2023, 12:16:54 am
content: You have to consider ground interference too, not only positive supply one.For the relays use freewheeling diodes in parallel on the coil (1N400X will do in most cases).For the motor, if not changing rotation, you can also put the same diode + 100n in parallel to the motor. Also 1n-10n from each motor terminal (but directly soldered on the motor terminals) to the motor case, which you ground it. If it changes direction, you skip the diode.All connections to ground should be star-type. One wire from the motor (power circuit), one wire from the Arduino, one wire from the LEDs (even more needed if you PWM the LEDs for brightness dim), all meeting in a single common point. If Arduino gets reset when starting motor or switching relays, put another 1-10uF from its Vdd to ground.Use a big capacitor of minimum 1-2mF on the main power supply (12V maybe you have), but do not be shy to add even more. If you use a 12V battery as a power source, or as back-up to a mains powered supply, no need to add capacitance more than needed by the voltage regulators.Make all connections clean and short. Do not daisy chain to transfer the noise from one circuit to another (mainly to the Arduino). If you have a common power supply (so common ground), it is useless to use opto-couplers to drive the BD139. It will do no isolation, the noise will travel freely via the ground.

author: coppercone2
author_rank: Super Contributor
timestamp: November 22, 2023, 03:37:03 am
content: and then use the scope to look at the signal after you do whatever you didconnect it with a relay or switch with the circuit you made on a similar power supply or battery while it is on a scope before you put it on a PCB connected to your board. I like alkaline batteries for this part, no worries about breaking anything important so long the voltage level is low, or for 12 volts a lead acid, if you have one in your lab

author: sairfan1
author_rank: Frequent Contributor
timestamp: November 22, 2023, 04:41:15 pm
content: QuoteFirst of all thanks a lot for detailed answer, I'm always confused regarding plarity of diode connecting to Relay or Motor, should polarity of diode match with Motor/Relay? like positive side of diode to positive side of Motor/Relay or it goes opposite? there must be a rule of thumb.I was also thinking tha capacitors are 10v/16v rated, they do not hurt 5v arduino?

author: Thunderer
author_rank: Regular Contributor
timestamp: November 24, 2023, 03:39:18 am
content: Quote from: sairfan1 on November 22, 2023, 04:41:15 pmFor the diode across the relay coil or a motor (not changing direction) is with the cathode (K) to the positive of the power supply, and the anode (A = the positive side as you name it) to the switching device (the transistor). The point is that once the transistor is in conduction, you do not short the power supply via the diode. In case you mount it with the anode to the positive of the power supply, you may burn the transistor.See the image below:Capacitors should be rated above the voltage you have. 10V or 16V is very good for 5V.

author: Solder_Junkie
author_rank: Frequent Contributor
timestamp: November 24, 2023, 08:29:11 am
content: When you de-energise an inductor, such as a relay coil or motor, there will be a back EMF generated. This Voltage can be several times the applied Voltage and can blow transistors if not suppressed. The back EMF is in the opposite polarity to the supply across the inductor, so you fit a diode in the way shown by Thunderer.Pulse induction metal detectors work by detecting the difference in the back EMF decay when a metal object is close to the coil, an interesting project in itself... See:https://pe2bz.philpem.me.uk/Comm01/-%20-%20Ion-Photon-RF/-%20Metal-Detectors/-%20BuildPlans/-%20Pulse/P-007-Sandbanks-PI/sandbanks300.pdfThe "downside" to the back EMF diode, is that it will delay a relay closing by a few mS. It generally doesn't matter much, but something to be aware of.SJ

author: coppercone2
author_rank: Super Contributor
timestamp: November 24, 2023, 09:49:51 am
content: there is a interesting post on this forum that the author showed he had excellent noise removal from X2Y capacitors being mounted on the motor with oscilloscope graphs. if it was any better then the cheap parts IDK. I find having to put a circuit board there instead of a through hole part obnoxious regardless. But if it has a circuit board for some reason, it might be a higher end option.