I am very much a beginner, still, but have been watching hours of Arudino videos and am starting to get a bit of an understanding of general electronics principles.
The one thing that is still confusing me is the use of resistors.
From what I have gathered, the use of resistors seems to be done in three stages (please do let me know if this is wrong):
Work out whether there is a component in the circuit that needs a resistor.
If so, look up the specs for the component (forward voltage and maximum current) and calculate the appropriate resistor for the circuit.
Once you have the resistor, calculate whether it has the appropriate power rating.
What I am currently stuck on, at the moment, is the first part.
I understand that all LEDs need a resistor.
However, what about other sensors - humidity sensors, temperature sensors etc.
How do I find out whether I need to use a resistor to begin with?
The reason I ask is that I have seen a few circuits (that involved a temperature sensor) and some involved a resistor and some did not.
This would be like, when to use a lever, for a mechanical system. It's really a generic question and has no legitimate answer, except that a resistor is used whenever you need to translate voltage to current, or current to voltage.
All the 1,000,000,000 uses of it follow from that.
I suggest a study of basic electronics. It will reveal areas of general application and more.
In digital electronics (with HIGH/LOW logic signals) resistors are usually only used as a pulldown or pullup, in order to define a default state of LOW or HIGH respectively.
In analog electronics resistors are all over the place with many uses, for instance current-limiting for an LED is a case of this.
Another analog use is when two resistors form a voltage-divider, allowing the ADC to read a voltage higher than the Arduino's supply voltage safely.
With any new sensor or chip the thing to do is read the datasheet, perhaps jumping to the "typical application" circuit to get an example of its use - this will often answer the question "do I need some resistors/capacitors with this".
When a sensor or chip comes on a module often this has already been done for you (though not always), making life a bit simpler.
Perhaps you should share the spec sheet with us if you want help? We can't guess which particular module it is from a photo, there are loads out there.
I think you have to understand the particular circuit in-which the resistor is used.
And before that you should understand Ohm's Law which describes the relationship between voltage, resistance, and current, and Kirchhoff's Laws which describe how voltages & currents sum-up or divide in series and parallel circuits.
Kirchhoff's Laws get a little complicated but as long as you understand that current "flows" you can see that an LED & resistor in series both have the same current flowing through them. Then if you apply Ohm's Law to the resistor you can figure-out that voltage is being divided between the LED & resistor. (If you have 5V total with 2V across the LED, that leaves 3V across the resistor.).
That's a Voltage Divider with the LED replacing one resistor.
Some analog "sensors" are wired as a voltage divider where the sensor replaces one resistor. When the resistance of the sensor changes, the voltage changes and you can measure the voltage.
Or SOME KIND kind of current limiting or current control. High-power LEDs (1 Watt or more) normally use a switch-mode constant-current supply.
LEDs are an odd special case because LEDs (like all diodes) are non-linear. The resistance of the LED changes when the voltage across it changes.... As you go above the forward operating voltage the resistance drops drastically and if you don't have a way of limiting current it will burn-up (and possibly burn-up something else).
IDEALLY, if you were studying electronics you'd have a good understanding of Ohm's Law and Kirchhoff's Laws before studying LEDs... But if you start with the Arduino you're probably going to use an LED right-away.
The most common use of resistors in digital circuits is as a pull-up or pull-down resistor. For example, unconnected Arduino inputs are "floating" and undefined - They can read high or low. If you connect a switch/button and the switch is off the input is still floating, which is pretty useless! So we add a pull-up or pull-down resistor. When the switch is turned-on the resistor is "overpowered", current flows through the resistor and the input is forced to the opposite state. In this application, the resistor value isn't important and resistors between 1K and 10K are common. (A lower resistance "draws" more current and "wastes" more energy, and a higher resistance is more-prone to noise pick-up so you don't want to go too extreme.)
No. (EDIT: this may not be true since it is open drain - read the next post.)
Usually you don't need resistors between digital circuits using the same supply voltage.
Every rule has exceptions. A resistor may be useful to reduce noise caused by an output switching (slew rate limiting) or as a protection against errors (i.e. drive contention - when more then one device tries to drive the line to different voltage).
The DHT 11 sensor when used alone needs a pull-up resistor. DHT 11 modules (like this one in the pic) use to have a built-in resistor already, so that you won´t need to worry about it.
I suggest you to follow @MarkT tip and look for the specs of your module, just to be sure about it.
To give you my view when to use resistors. Usually an engineer knows the technical function of a part before they attempt to use one.
However until you get to that point, you should rely on the example circuits that are included on most devices. And if none google the part type and see if you can find suggested circuits.