user609: I have a project with leds and sensors, this is my first project in Arduino and I want to know if it need resistors and how and where?
I use 16-Bit I/O Expander MCP23017 for leds and multiplexer CD4051 for sensors LM35 


user84: You will definitely need resistors for each LED connected to MCP23017 circuits.
This is necessary because without resistor the following is likely to happen:

burn each LED that is lit on as it would be fed too much current
burn the MCP23017 because it is rated for 125mA maximum (20mA per output pin)

The resistor to use normally depends on the color of each LED as those LEDs have different electrical charasteristics.
Typically one LED (3 or 5mm) needs no more than 20mA to be lit (lower current such as 10mA is generally provides enough light).
One other important LED characteristic is its forward voltage, which depends on the color.
This link will help you calculate the "ideal" resistor for each LED.
For the sensors part, I see no reason to use any resistor to connect them to 4051 circuits.
One last important point is related to the use of I2C bus by the MCP23017 circuits. I2C bus is "open drain" and thus requires pullup resistors for both SCL and SDA lines.

609: <p>I have a project with leds and sensors, this is my first project in Arduino and I want to know if it need resistors and how and where?</p>

<p>I use 16-Bit I/O Expander <a href="http://ww1.microchip.com/downloads/en/DeviceDoc/21952b.pdf" rel="nofollow noreferrer">MCP23017</a> for leds and multiplexer <a href="http://pdf.datasheetcatalog.net/datasheets/120/109150_DS.pdf" rel="nofollow noreferrer">CD4051</a> for sensors <a href="http://www.ti.com/lit/ds/symlink/lm35.pdf" rel="nofollow noreferrer">LM35</a> </p>

<p><img src="https://i.stack.imgur.com/jUCjl.jpg" alt="My design"></p>
 84: <p>You will definitely need resistors for each LED connected to MCP23017 circuits.</p>

<p>This is necessary because without resistor the following is likely to happen:</p>

<ul>
<li>burn each LED that is lit on as it would be fed too much current</li>
<li>burn the MCP23017 because it is rated for 125mA maximum (20mA per output pin)</li>
</ul>

<p>The resistor to use normally depends on the color of each LED as those LEDs have different electrical charasteristics.</p>

<p>Typically one LED (3 or 5mm) needs no more than 20mA to be lit (lower current such as 10mA is generally provides enough light).</p>

<p>One other important LED characteristic is its <strong>forward voltage</strong>, which depends on the color.</p>

<p><a href="http://led.linear1.org/1led.wiz" rel="nofollow">This link</a> will help you calculate the "ideal" resistor for each LED.</p>

<p>For the sensors part, I see no reason to use any resistor to connect them to 4051 circuits.</p>

<p>One last important point is related to the use of <strong>I2C</strong> bus by the MCP23017 circuits. <a href="http://en.wikipedia.org/wiki/I%C2%B2C" rel="nofollow">I2C bus</a> is "open drain" and thus requires pullup resistors for both <strong>SCL</strong> and <strong>SDA</strong> lines.</p>
