user31239: I'm currently working on a project where I am making a wheeled robot using the Hack-e-bot library on the arduino. The circuit board which I have planned to put together through soldering will eventually look similar to this:

Here is a schematic:
I understand my circuit quite well but my mentor recommended using a capacitor for this and although I have got it on my schematic, I've never actually worked with capacitors before. Why should they be used in this project?

user42418: Based on the schematic shown, the capacitor acts as a decoupling or smoothing capacitor. When the circuit components such as a motor require a sudden source or produce a sudden spike of energy, this would help filter out the noise and balance the power line.
More info regarding decoupling capacitor may be found on wikipedia here.

user19409: A capacitor is a device that can store (and release) charge. It is made up of 2 metallic electrodes (or plates) that are separated by a thin dielectric material.

When you apply a voltage over the two plates, an electric field is created. Positive charge will collect on one plate and negative charge on the other. - build-electronic-circuits.com

In short, a capacitor lets the AC component through and blocks the DC component.

Capacitors can be used in the following ways:
Decoupling Capacitors
(Also called Bypass capacitors) 

A decoupling capacitor’s job is to supress high-frequency noise in power supply signals. They take tiny voltage ripples, which could otherwise be harmful to delicate ICs, out of the voltage supply.  


Image reference http://www.seattlerobotics.org/encoder/jun97/basics.html

In a way, decoupling capacitors act as a very small, local power supply for ICs (almost like an uninterupptable power supply is to computers). If the power supply very temporarily drops its voltage (which is actually pretty common, especially when the circuit it’s powering is constantly switching its load requirements), a decoupling capacitor can briefly supply power at the correct voltage. This is why these capacitors are also called bypass caps; they can temporarily act as a power source, bypassing the power supply.  
Decoupling capacitors connect between the power source (5V, 3.3V, etc.) and ground. It’s not uncommon to use two or more different-valued, even different types of capacitors to bypass the power supply, because some capacitor values will be better than others at filtering out certain frequencies of noise.
  - sparkfun.com

Power Supply Filtering
DC power supplies can be quite noisy on their own. Take the output of a bridge rectifier for example, there is a lot of ripple on the output. Capacitors are a perfect solution for reducing the ripple/noise of power supplies.

Image Reference: http://www.electronics-tutorials.ws/diode/diode_6.html

Capacitors are stubborn components, they’ll always try to resist sudden changes in voltage. The filter capacitor will charge up as the rectified voltage increases. When the rectified voltage coming into the cap starts its rapid decline, the capacitor will access its bank of stored energy, and it’ll discharge very slowly, supplying energy to the load. The capacitor shouldn’t fully discharge before the input rectified signal starts to increase again, recharging the cap. This dance plays out many times a second, over-and-over as long as the power supply is in use.

Also see Keelan's answer over at electronics stack exchange.
Signal Filtering

You can also combine capacitors and resistors to form filters that target specific frequencies. - build-electronic-circuits.com
They can block out low-frequency or DC signal-components while allowing higher frequencies to pass right through. They’re like a bouncer at a very exclusive club for high frequencies only. - sparkfun.com
For example in an audio system you can target the high frequencies to remove them (e.g. in a sub-woofer). This is called a low-pass filter.  - build-electronic-circuits.com  


Image Reference: Wikipedia

Back to your application. 
Motors are notoriously noisy. Your mentor has recommended a capacitor to decouple the noise of the motors and protect the IC from voltage drops/spikes.
Side note: D1 in your schematic is a power indication LED. It needs a current limiting resistor in series with the LED to limit the current and prevent the LED from burning out.

Resources:  

https://learn.sparkfun.com/tutorials/capacitors
https://www.build-electronic-circuits.com/how-does-a-capacitor-work/
Basic Circuits - Bypass Capacitors
wikipedia.org/wiki/Capacitor
wikipedia.org/wiki/Decoupling_capacitor
Youtube - How a Capacitor Works - by Dr. Oliver Winn
explainthatstuff.com/capacitors


31239: <p>I'm currently working on a project where I am making a wheeled robot using the Hack-e-bot library on the arduino. The circuit board which I have planned to put together through soldering will eventually look similar to this:
<a href="https://i.stack.imgur.com/JVYEz.jpg" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/JVYEz.jpg" alt="enter image description here"></a></p>

<p>Here is a schematic:<a href="https://i.stack.imgur.com/0Fi2Y.jpg" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/0Fi2Y.jpg" alt="enter image description here"></a></p>

<p>I understand my circuit quite well but my mentor recommended using a capacitor for this and although I have got it on my schematic, I've never actually worked with capacitors before. Why should they be used in this project?</p>
 42418: <p>Based on the schematic shown, the capacitor acts as a decoupling or smoothing capacitor. When the circuit components such as a motor require a sudden source or produce a sudden spike of energy, this would help filter out the noise and balance the power line.</p>

<p>More info regarding decoupling capacitor may be found on wikipedia <a href="https://en.wikipedia.org/wiki/Decoupling_capacitor" rel="nofollow noreferrer">here</a>.</p>
 19409: <p>A <a href="https://en.wikipedia.org/wiki/Capacitor" rel="nofollow noreferrer">capacitor</a> is a device that can store (and release) charge. It is made up of 2 metallic electrodes (or plates) that are separated by a thin dielectric material.</p>

<blockquote>
  <p>When you apply a voltage over the two plates, an electric field is created. Positive charge will collect on one plate and negative charge on the other. - build-electronic-circuits.com</p>
</blockquote>

<p>In short, a capacitor lets the AC component through and blocks the DC component.</p>

<hr>

<p>Capacitors can be used in the following ways:</p>

<h1>Decoupling Capacitors</h1>

<p><strong>(Also called Bypass capacitors)</strong>  </p>

<blockquote>
  <p>A decoupling capacitor’s job is to supress high-frequency noise in power supply signals. They take tiny voltage ripples, which could otherwise be harmful to delicate ICs, out of the voltage supply.  </p>
</blockquote>

<p><a href="https://i.stack.imgur.com/hGhUL.gif" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/hGhUL.gif" alt="Noisy motor"></a></p>

<p>Image reference <a href="http://www.seattlerobotics.org/encoder/jun97/basics.html" rel="nofollow noreferrer">http://www.seattlerobotics.org/encoder/jun97/basics.html</a></p>

<blockquote>
  <p>In a way, decoupling capacitors act as a very small, local power supply for ICs (almost like an uninterupptable power supply is to computers). If the power supply very temporarily drops its voltage (which is actually pretty common, especially when the circuit it’s powering is constantly switching its load requirements), a decoupling capacitor can briefly supply power at the correct voltage. This is why these capacitors are also called bypass caps; they can temporarily act as a power source, bypassing the power supply.  </p>
  
  <p>Decoupling capacitors connect between the power source (5V, 3.3V, etc.) and ground. It’s not uncommon to use two or more different-valued, even different types of capacitors to bypass the power supply, because some capacitor values will be better than others at filtering out certain frequencies of noise.<br>
  - sparkfun.com</p>
</blockquote>

<h1>Power Supply Filtering</h1>

<p>DC power supplies can be quite noisy on their own. Take the output of a <a href="https://en.wikipedia.org/wiki/Diode_bridge" rel="nofollow noreferrer">bridge rectifier</a> for example, there is a lot of ripple on the output. Capacitors are a perfect solution for reducing the ripple/noise of power supplies.</p>

<p><img src="https://i.stack.imgur.com/BLGnf.gif" alt="bridge rectifier smoothing capacitor"></p>

<p>Image Reference: <a href="http://www.electronics-tutorials.ws/diode/diode_6.html" rel="nofollow noreferrer">http://www.electronics-tutorials.ws/diode/diode_6.html</a></p>

<blockquote>
  <p>Capacitors are stubborn components, they’ll always try to resist sudden changes in voltage. The filter capacitor will charge up as the rectified voltage increases. When the rectified voltage coming into the cap starts its rapid decline, the capacitor will access its bank of stored energy, and it’ll discharge very slowly, supplying energy to the load. The capacitor shouldn’t fully discharge before the input rectified signal starts to increase again, recharging the cap. This dance plays out many times a second, over-and-over as long as the power supply is in use.</p>
</blockquote>

<p>Also see <a href="https://electronics.stackexchange.com/a/73870/104097">Keelan's answer over at electronics stack exchange</a>.</p>

<h1>Signal Filtering</h1>

<blockquote>
  <p>You can also combine capacitors and resistors to form filters that target specific frequencies. - build-electronic-circuits.com</p>
  
  <p>They can block out low-frequency or DC signal-components while allowing higher frequencies to pass right through. They’re like a bouncer at a very exclusive club for high frequencies only. - sparkfun.com</p>
  
  <p>For example in an audio system you can target the high frequencies to remove them (e.g. in a sub-woofer). This is called a low-pass filter.  - build-electronic-circuits.com  </p>
</blockquote>

<p><a href="https://i.stack.imgur.com/agNqX.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/agNqX.png" alt="Low pass filter"></a></p>

<p>Image Reference: <a href="https://commons.wikimedia.org/wiki/File:1st_Order_Lowpass_Filter_RC.svg" rel="nofollow noreferrer">Wikipedia</a></p>

<hr>

<p>Back to your application. </p>

<p>Motors are notoriously noisy. Your mentor has recommended a capacitor to decouple the noise of the motors and protect the IC from voltage drops/spikes.</p>

<p>Side note: D1 in your schematic is a power indication LED. It needs a current limiting resistor in series with the LED to limit the current and prevent the LED from burning out.</p>

<hr>

<p>Resources:  </p>

<ul>
<li><a href="https://learn.sparkfun.com/tutorials/capacitors" rel="nofollow noreferrer">https://learn.sparkfun.com/tutorials/capacitors</a></li>
<li><a href="https://www.build-electronic-circuits.com/how-does-a-capacitor-work/" rel="nofollow noreferrer">https://www.build-electronic-circuits.com/how-does-a-capacitor-work/</a></li>
<li><a href="http://www.seattlerobotics.org/encoder/jun97/basics.html" rel="nofollow noreferrer">Basic Circuits - Bypass Capacitors</a></li>
<li><a href="https://en.wikipedia.org/wiki/Capacitor" rel="nofollow noreferrer">wikipedia.org/wiki/Capacitor</a></li>
<li><a href="https://en.wikipedia.org/wiki/Decoupling_capacitor" rel="nofollow noreferrer">wikipedia.org/wiki/Decoupling_capacitor</a></li>
<li><a href="https://www.youtube.com/watch?v=t9Qwx75eg8w" rel="nofollow noreferrer">Youtube - How a Capacitor Works - by Dr. Oliver Winn</a></li>
<li><a href="http://www.explainthatstuff.com/capacitors.html" rel="nofollow noreferrer">explainthatstuff.com/capacitors</a></li>
</ul>
