I want to know why and when do i need the resistors?
Every component has limitations as to what voltage/current it can handle at most. a LED for example can usually handle 20mA current at most at a voltage of say 2.0V. An Arduino output is about 5V. so in some way the voltage needs to drop from 5V to 2V. That is where we use a resistor.
Ohm's law says U(voltage) = I(current) * R (resistance).
Rewriting that formula you would get R = U / I in our case 3/0.020 = 150 ohm. In practice you don't want to fry the LED to its maximum specs so use a higher value to limit the current. 270 ohm is a common value.
As for the rest there is enough info about resistors on the internet.
Lots on the web, here are three examples:
http://www.ladyada.net/learn/arduino/lesson3.html
https://learn.sparkfun.com/tutorials/pull-up-resistors
mike007:
I want to know why and when do i need the resistors?
Need the resistors on what?
Is it possible for there to be a more broad and vague question than this about EE stuff?
I personally think this one is a winner.
Something along the lines of "How does electricity work?" might be up there as well.
bigred1212:
Something along the lines of "How does electricity work?" might be up there as well.
That is actually less vague than the original question. Its like asking "What voltage should I use?"
So my answer to the question is: You should use them when it is appropriate to use resistors.
What voltage should I use is a good one.
Just enough, but not too much or too little.
Hi mike007, and welcome.
Lots of comments to your question here.
But don't think you asked a dumb question, there's only 1 dumb question and that is the one that was never asked.
Resistors and some other 'basic' components have multiple uses.
Therefore your question can't be answered like that.
Fellow countryman nicoverduin tried to explain a bit, and LarryD showed some links that in turn show a bit of the diversity of usefulness of resistors (and that's not all there is by far).
Besides resistance, voltage and current, there is more to keep in mind like maximum power (some call this "wattage") and voltage a resistor can withstand.
Sometimes even inductance.
But still resistance, voltage and current are the first things you need to understand.
So you should always put these questions in a context.
If you have a question about some resistor in a specific setup, ask and tell about that setup.
That will make it easier to explain to some and the replies easier to understand for the others.
Among the many uses of resistors:
turning a current signal into a voltage signal (such as in a current shunt for multimeter)
turning a voltage signal into a current signal
limiting the current to something to prevent damage
forming a voltage divider with another resistor
setting the current for a current mirror
being a matched load to a transmission line
being part of a passive RC or RL filter network
setting the Q in an LC or crystal filter network
being a pull-up or pull-down for a logic signal
to turn electricity into heat
...