user4930: I'm just starting to discover Arduino. Currently, I've done 2 lessons from Arduino book and I have few questions about second circuit.


Why we need to add 10kOm resistors after wire to 2 pin?
Why we need to add resistors after LED?
And why 3, 5, 6, 9, 10, 11 pins with "wave" symbol?


user220: 
Why we need to add 10kOm resistors after wire to 2 pin?

Due to some weird electronic properties, the state of the input to the Arduino is "undefined" when there is nothing connected. When the button isn't pressed down, it is neither connected to 5V or GND; it is left floating. When floating, the input isn't reliable.
To make sure that the input always has some sort of signal, we connect it to ground. However, there is a problem with directly connecting the input to ground. When you would push the button, you would create a short circuit by allowing current to flow directly from 5V to GND without any current limiting.
The solution is to add a resistor to limit the current between 5V and GND. When the button isn't pushed, the input is grounded to allow it to read LOW. When the button is pushed, the 5V rushes in and, since the 5V doesn't use a resistor, "the 5V is stronger," making the input HIGH.

Why we need to add resistors after LED?

An overly simplified explanation: A LED will theoretically pull infinite power (as current) from your power source without a resistor. With too much power, the LED will be destroyed from heat.
Because the LED has some resistance, it will pull up to a finite amount of power, but that usually is much more than the LED can handle (and sometimes what the power supply can supply). We need a resistor there to ensure that the LED can only draw as much power as it can handle.

And why 3, 5, 6, 9, 10, 11 pins with "wave" symbol?

If you look at an Arduino board, it will say DIGITAL (PWM~). That (PWM~) means that any pins with the "~" symbol are PWM pins... pins that can turn on and off their output very fast, in this case to create an illusion that the LED is dimming because the state changes faster than the human eye can detect.


http://arduino.cc/en/uploads/Main/ArduinoUnoFront240.jpg

More explanation for PWM here: Arduino docs, an answer [of mine]

4930: <p>I'm just starting to discover Arduino. Currently, I've done 2 lessons from Arduino book and I have few questions about second circuit.
<img src="https://i.stack.imgur.com/QfxUh.jpg" alt="schema of second circuit"></p>

<ol>
<li>Why we need to add 10kOm resistors after wire to 2 pin?</li>
<li>Why we need to add resistors after LED?</li>
<li>And why 3, 5, 6, 9, 10, 11 pins with "wave" symbol?</li>
</ol>
 220: <blockquote>
  <p>Why we need to add 10kOm resistors after wire to 2 pin?</p>
</blockquote>

<p>Due to some weird electronic properties, the state of the input to the Arduino is "undefined" when there is nothing connected. When the button isn't pressed down, it is neither connected to 5V or GND; it is left <em>floating</em>. When floating, the input isn't reliable.</p>

<p>To make sure that the input always has some sort of signal, we connect it to ground. However, there is a problem with directly connecting the input to ground. When you would push the button, you would create a short circuit by allowing current to flow directly from 5V to GND without any current limiting.</p>

<p>The solution is to add a resistor to limit the current between 5V and GND. When the button isn't pushed, the input is grounded to allow it to read LOW. When the button is pushed, the 5V rushes in and, since the 5V doesn't use a resistor, "the 5V is stronger," making the input HIGH.</p>

<blockquote>
  <p>Why we need to add resistors after LED?</p>
</blockquote>

<p>An overly simplified explanation: A LED will theoretically pull infinite power (as current) from your power source without a resistor. With too much power, the LED will be destroyed from heat.</p>

<p>Because the LED has <em>some</em> resistance, it will pull up to a finite amount of power, but that usually is much more than the LED can handle (and sometimes what the power supply can supply). We need a resistor there to ensure that the LED can only draw as much power as it can handle.</p>

<blockquote>
  <p>And why 3, 5, 6, 9, 10, 11 pins with "wave" symbol?</p>
</blockquote>

<p>If you look at an Arduino board, it will say <code>DIGITAL (PWM~)</code>. That <code>(PWM~)</code> means that any pins with the "~" symbol are <em>PWM</em> pins... pins that can turn on and off their output very fast, in this case to create an illusion that the LED is dimming because the state changes faster than the human eye can detect.</p>

<blockquote>
  <p><img src="https://i.stack.imgur.com/8eLah.jpg" alt="Arduino Uno">
  <em><a href="http://arduino.cc/en/uploads/Main/ArduinoUnoFront240.jpg" rel="nofollow noreferrer">http://arduino.cc/en/uploads/Main/ArduinoUnoFront240.jpg</a></em></p>
</blockquote>

<p>More explanation for PWM here: <a href="http://arduino.cc/en/Tutorial/PWM" rel="nofollow noreferrer">Arduino docs</a>, <a href="https://electronics.stackexchange.com/questions/67116/why-do-some-pins-have-signs-next-to-their-numbers">an answer [of mine]</a></p>
