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
Arduino Stack Exchange is a question and answer site for developers of open-source hardware and software that is compatible with Arduino. It only takes a minute to sign up.
Sign up to join this communityI 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
You will definitely need resistors for each LED connected to MCP23017 circuits.
This is necessary because without resistor the following is likely to happen:
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.