Do i need capacitors

Hi all, my system consists of an arduino Uno, a motor driver, a Bluetooth module, a distance sensor an LCD and a servo motor..
Arduino is powered through a 9V battery and the motor driver with 12V battery... Bluetooth, LCD , distance sensor are powered from arduino's 5V, while DC motors and servo motor through the motor driver.. My question is: Do i need capacitors to protect the system from noise, surges ,spikes and generally make power more smooth ? Or it's ok if i don't use???.. If i have to use, in what components shall they be used? Or can i use one capacitor as "main" in the 5V line ? If you need more details please let me know .. Thanks a lot !!!! :smiley: :smiley: :smiley:

Arduino is powered through a 9V battery and the motor driver with 12V battery... Bluetooth, LCD , distance sensor are powered from arduino's 5V,

Your main problem is that a small 9 volt battery will never be able to supply enough current for those devices, not enough current capacity. Even with a proper battery with enough current you will still be limited by the arduino 5V current capacity to power that much external stuff. You will need to use an external +5vdc power source with enough current capacity for all that stuff. How much current? Can't say without looking at the datasheets for each of the external devices to see what they require.

retrolefty:

Arduino is powered through a 9V battery and the motor driver with 12V battery... Bluetooth, LCD , distance sensor are powered from arduino's 5V,

Your main problem is that a small 9 volt battery will never be able to supply enough current for those devices, not enough current capacity. Even with a proper battery with enough current you will still be limited by the arduino 5V current capacity to power that much external stuff. You will need to use an external +5vdc power source with enough current capacity for all that stuff. How much current? Can't say without looking at the datasheets for each of the external devices to see what they require.

Thanks for replying.. Let me tell you again, only distance sensor , Bluetooth and LCD are powered through arduino, nothing else..It's certainly not "too much staff".. Arduino's current consumption,with everything on and working, is a total maximum of 100mA(measured with a multimeter). So my problem is not the battery, it's if i do need capacitors to protect my system..

A small 9V battery isn't up to putting out 100mA for very long. And they just aren't meant to supply that much current for any length of time. So the voltage is going to drop off much more quickly than the mAh ratings might indicate.

So, yes, the problem may very well be your battery.

Yes, you should have bypass capacitors around the circuit.

http://www.vagrearg.org/content/decoupling

To answer your question:-

Do i need capacitors to protect the system from noise, surges ,spikes and generally make power more smooth ?

Yes you always need capacitors.

polymorph:
A small 9V battery isn't up to putting out 100mA for very long. And they just aren't meant to supply that much current for any length of time. So the voltage is going to drop off much more quickly than the mAh ratings might indicate.

Discharge tests and capacity measurement of 9 volt transistor radio batteries at high current, 100mA to 500mA engineering data

So, yes, the problem may very well be your battery.

Yes, you should have bypass capacitors around the circuit.

Vagrearg - Decoupling by Example

Thanks for replying,
once again i don't have problem with my battery and i don't need my system to run for a long time..so i a m ok with that :smiley: :smiley:
Nice article about the capacitors!!! Can i have more details about the wiring of the capacitor?
Also, should i add a capacitor to each component or just to the power supply?

Grumpy_Mike thanks for replying :smiley:

For example ,this is how we should wire the capacitor ? If the Servo Misbehaves | Arduino Lesson 14. Servo Motors | Adafruit Learning System

As the article says, the capacitors act a bit like mini-UPSs to maintain voltage to things that draw current in spikes.

So anything that is electrically noisy. Motors, of course. CMOS ICs draw current in spikes at each change of state of a gate, so they need bypass capacitors. As close to the offending component as possible.

Someone here has a page on the proper application of bypass capacitors, and I don't recall who.

In general, larger value capacitors (10uF and up) work better at lower frequencies while not working well at high frequencies due to increased internal parasitic inductance and series resistance. Where lower value capacitors (0.1uF and below) don't work as well at lower frequencies, but get better at higher frequencies due to less internal parasitic inductance and series resistance.

Edit - sorry that is so big, I've downloaded and resized, see it attached below in a more reasonable size.

This one goes into a bit more detail, note that sometimes you get unwanted interaction between bypass capacitors:

http://www.intersil.com/content/dam/Intersil/documents/an13/an1325.pdf

It is important to pay attention to where the ground lines run, too, not just Vcc.

As to your 9V battery, are you monitoring the voltage? It can sag under load to the point that Vcc can no longer be maintained at 5V.

Yes i ve monitored the voltage, never less than 4.95V.. So you suggest me add capacitors to the servo motor and the DC motors?
I power arduino through the barrel jack, does it need a capacitor before that ? Is it a good idea to add a capacitor to the Bluetooth module ? Thanks again !!

Also, because the DC motors are mounted, and i don't really want to take everything apart, can i do something like the photo attached ? place the capacitors right to the motor driver's output A and B..

polymorph:
It is important to pay attention to where the ground lines run, too, not just Vcc.

All of those 6 images are poor as the traces between IC pins and decoupling
capacitor are narrow signal traces, not low-inductance wide traces. This is
more important than where you route the wires to the regulator, there must be
as low-inductance a path from chip to the fast decoupling cap as possible. At least
they are short traces, but it shows a lack of understanding of Maxwell and Heaviside's
equations...

Also its perfectly fine to use planes in place of traces for GND and/or Vcc. Planes
are as low-inductance as you can get!

MarkT:

polymorph:
It is important to pay attention to where the ground lines run, too, not just Vcc.

All of those 6 images are poor as the traces between IC pins and decoupling
capacitor are narrow signal traces, not low-inductance wide traces. This is
more important than where you route the wires to the regulator, there must be
as low-inductance a path from chip to the fast decoupling cap as possible. At least
they are short traces, but it shows a lack of understanding of Maxwell and Heaviside's
equations...

Also its perfectly fine to use planes in place of traces for GND and/or Vcc. Planes
are as low-inductance as you can get!

Can you please take a look at the image i posted on my previous post and tell me if i can wire the caps that way ? thanks a lot !!!

You can place them like that but they won't do as much good as if you soldered them on the motor.

Those capacitors you show are polerised, that is no good if the motor can change direction.

Hi, I hate to repeat what everybody has asked, but , what SIZE is your 9V battery?

A picture of your project would help us to see what you have and provide accurate information.

Tom..... :slight_smile:

TomGeorge:
Hi, I hate to repeat what everybody has asked, but , what SIZE is your 9V battery?

A picture of your project would help us to see what you have and provide accurate information.

Tom..... :slight_smile:

6*AA ALKALINE batterries.. I rarely run the project on batterrties, most tests happen on usb..
I wikl post a picture later on the day..

Grumpy Mike, so its better to solder them on the motor, what capacitors should i use then??

Thanks a lot

Ahh, a battery-holder with 6 AA-cells. That is much, much better than a 9-volt block battery that we thought you were using.
Like this: Nine-volt battery - Wikipedia

Actually, you could do yourself a favor. Only put 5 batteries in the holder, then you will not waste as much power in the voltage regulator on the Arduino, and your batteries will actually last longer! - Solder a wire across one position in the battery holder, or make a "dummy" battery out of a dowel wrapped in tinfoil, or whatever you can come up with.

// Per.

so its better to solder them on the motor,

Yes, as a rule it is best to get it as close to the source of interference as possible.
You need both a 0.1uF ceramic capacitor for high frequencies and a large one for the low frequencies. If the motor runs in both directions you need a non polarised capacitor, otherwise an electrolitic will do. The larger the better.

So we got the battery sorted out, people were concerned you just might be using a "PP4" battery. :smiley:

OK, so you are not that silly!

If you are not using PWM, a 0.1µF ceramic capacitor soldered directly across the motor terminals. YOu will notice this as standard in radio controlled toys. (Serious models use ESC.)

If you are using PWM, you can still do this, but will need to provide an inductor in series with one or each of the motor terminals - I will "bow out" at this point, of explaining how you should calculate the value.

Regarding capacitors on motors for noise-dampening, all you need to know is here:
http://www.beam-wiki.org/wiki/Reducing_Motor_Noise

// Per.

Sure i wouldn't use a solid 9V battery !!! :smiley: :smiley: :smiley:

Thanks everyone for the useful replies !!!

Only put 5 batteries in the holder, then you will not waste as much power in the voltage regulator on the Arduino, and your batteries will actually last longer!
// Per.

That can be easily done...

Grumpy_Mike:

so its better to solder them on the motor,

You need both a 0.1uF ceramic capacitor for high frequencies and a large one for the low frequencies. If the motor runs in both directions you need a non polarised capacitor, otherwise an electrolitic will do. The larger the better.

Thanks Mike...

Paul__B:
If you are using PWM, you can still do this, but will need to provide an inductor in series with one or each of the motor terminals - I will "bow out" at this point, of explaining how you should calculate the value.

i do use PWM, so can you tell me more about the inductor ? :astonished:
it wont work if i use a polarized or electrolytic capacitor as Mike said ?

Up to now i hear about capacitor on motors, no need to add bypass capacitors anywhere else?
LCD,Bluetooth and distance sensor are powered through arduinos 5V, maybe i should add a bypass capacitor on the 5V output ?
Also should i add a bypass capacitor to the power supply of arduino?

Thanks again !!! :smiley: :smiley: :smiley:

maybe i should add a bypass capacitor on the 5V output ?

You should have a capacitor on each of your three modules, as close to the module as possible.

Grumpy_Mike:

maybe i should add a bypass capacitor on the 5V output ?

You should have a capacitor on each of your three modules, as close to the module as possible.

Mike really thanks for replying again.. So one capacitor in each module, electrolytic or ceramic and what capacity?
Also Paul said that PWM won't work if i use a capacitor ..why?

Here is a really quick diagram of the wiring, please let me know if i did something wrong to the bypass capacitors..