Author Topic: Choosing capacitors to avoid spikes/ripples  (Read 1424 times)

0 Members and 1 Guest are viewing this topic.

Offline sairfan1Topic starter

  • Frequent Contributor
  • **
  • Posts: 404
  • Country: ca
Choosing capacitors to avoid spikes/ripples
« on: November 21, 2023, 06:30:02 pm »
I'm setting up arduino where I will be driving some motors, relays and LEDs
I will be using transistor (BD139) to turn on Relay to use 12v motor, some transistors to turn on LEDs

I 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 Arduino
Do i need to use some capacitors near Transistors or Relays?
 

Offline Thunderer

  • Regular Contributor
  • *
  • Posts: 72
  • Country: ca
Re: Choosing capacitors to avoid spikes/ripples
« Reply #1 on: November 22, 2023, 12:16:54 am »
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.
 
The following users thanked this post: sairfan1

Online coppercone2

  • Super Contributor
  • ***
  • Posts: 13420
  • Country: us
  • √Y√... 📎
Re: Choosing capacitors to avoid spikes/ripples
« Reply #2 on: November 22, 2023, 03:37:03 am »
and then use the scope to look at the signal after you do whatever you did

connect 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
« Last Edit: November 22, 2023, 03:40:18 am by coppercone2 »
 

Offline sairfan1Topic starter

  • Frequent Contributor
  • **
  • Posts: 404
  • Country: ca
Re: Choosing capacitors to avoid spikes/ripples
« Reply #3 on: November 22, 2023, 04:41:15 pm »
Quote
For the relays use freewheeling diodes in parallel on the coil (1N400X will do in most cases).

First 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?
« Last Edit: November 22, 2023, 04:44:34 pm by sairfan1 »
 

Offline Thunderer

  • Regular Contributor
  • *
  • Posts: 72
  • Country: ca
Re: Choosing capacitors to avoid spikes/ripples
« Reply #4 on: November 24, 2023, 03:39:18 am »
... polarity 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?

For 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.
 
The following users thanked this post: sairfan1

Offline Solder_Junkie

  • Frequent Contributor
  • **
  • Posts: 558
  • Country: gb
Re: Choosing capacitors to avoid spikes/ripples
« Reply #5 on: November 24, 2023, 08:29:11 am »
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.pdf

The "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
 

Online coppercone2

  • Super Contributor
  • ***
  • Posts: 13420
  • Country: us
  • √Y√... 📎
Re: Choosing capacitors to avoid spikes/ripples
« Reply #6 on: November 24, 2023, 09:49:51 am »
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.
 


Share me

Digg  Facebook  SlashDot  Delicious  Technorati  Twitter  Google  Yahoo
Smf