• Terminal
    Terminal
    An electrical connector acting as reusable interface to a conductor and creating a point where external circuits can be connected.
  • Ground
    A common return path for electric current. Commonly known as ground.
  • Net Portal
    A net identifier used to create connectivity to other Net Portal with the same designator. #portal
  • Power Net Portal
    Power net portal is a special schematic object used to define a power or ground net. Power ports allow you to conveniently indicate a power net at any location in the design. Power nets of the same designator automatically connect throughout your design #portal #power
  • Generic Resistor
    A generic fixed resistor for rapid developing circuit topology. Save precious design time by seamlessly add more information to this part (value, footprint, etc.) as it becomes available. Standard resistor values: 1.0Ω 10Ω 100Ω 1.0kΩ 10kΩ 100kΩ 1.0MΩ 1.1Ω 11Ω 110Ω 1.1kΩ 11kΩ 110kΩ 1.1MΩ 1.2Ω 12Ω 120Ω 1.2kΩ 12kΩ 120kΩ 1.2MΩ 1.3Ω 13Ω 130Ω 1.3kΩ 13kΩ 130kΩ 1.3MΩ 1.5Ω 15Ω 150Ω 1.5kΩ 15kΩ 150kΩ 1.5MΩ 1.6Ω 16Ω 160Ω 1.6kΩ 16kΩ 160kΩ 1.6MΩ 1.8Ω 18Ω 180Ω 1.8KΩ 18kΩ 180kΩ 1.8MΩ 2.0Ω 20Ω 200Ω 2.0kΩ 20kΩ 200kΩ 2.0MΩ 2.2Ω 22Ω 220Ω 2.2kΩ 22kΩ 220kΩ 2.2MΩ 2.4Ω 24Ω 240Ω 2.4kΩ 24kΩ 240kΩ 2.4MΩ 2.7Ω 27Ω 270Ω 2.7kΩ 27kΩ 270kΩ 2.7MΩ 3.0Ω 30Ω 300Ω 3.0KΩ 30KΩ 300KΩ 3.0MΩ 3.3Ω 33Ω 330Ω 3.3kΩ 33kΩ 330kΩ 3.3MΩ 3.6Ω 36Ω 360Ω 3.6kΩ 36kΩ 360kΩ 3.6MΩ 3.9Ω 39Ω 390Ω 3.9kΩ 39kΩ 390kΩ 3.9MΩ 4.3Ω 43Ω 430Ω 4.3kΩ 43KΩ 430KΩ 4.3MΩ 4.7Ω 47Ω 470Ω 4.7kΩ 47kΩ 470kΩ 4.7MΩ 5.1Ω 51Ω 510Ω 5.1kΩ 51kΩ 510kΩ 5.1MΩ 5.6Ω 56Ω 560Ω 5.6kΩ 56kΩ 560kΩ 5.6MΩ 6.2Ω 62Ω 620Ω 6.2kΩ 62KΩ 620KΩ 6.2MΩ 6.8Ω 68Ω 680Ω 6.8kΩ 68kΩ 680kΩ 6.8MΩ 7.5Ω 75Ω 750Ω 7.5kΩ 75kΩ 750kΩ 7.5MΩ 8.2Ω 82Ω 820Ω 8.2kΩ 82kΩ 820kΩ 8.2MΩ 9.1Ω 91Ω 910Ω 9.1kΩ 91kΩ 910kΩ 9.1MΩ #generics #CommonPartsLibrary
  • Generic Capacitor
    A generic fixed capacitor for rapid developing circuit topology. Save precious design time by seamlessly add more information to this part (value, footprint, etc.) as it becomes available. Standard capacitor values: 1.0pF 10pF 100pF 1000pF 0.01uF 0.1uF 1.0uF 10uF 100uF 1000uF 10,000uF 1.1pF 11pF 110pF 1100pF 1.2pF 12pF 120pF 1200pF 1.3pF 13pF 130pF 1300pF 1.5pF 15pF 150pF 1500pF 0.015uF 0.15uF 1.5uF 15uF 150uF 1500uF 1.6pF 16pF 160pF 1600pF 1.8pF 18pF 180pF 1800pF 2.0pF 20pF 200pF 2000pF 2.2pF 22pF 20pF 2200pF 0.022uF 0.22uF 2.2uF 22uF 220uF 2200uF 2.4pF 24pF 240pF 2400pF 2.7pF 27pF 270pF 2700pF 3.0pF 30pF 300pF 3000pF 3.3pF 33pF 330pF 3300pF 0.033uF 0.33uF 3.3uF 33uF 330uF 3300uF 3.6pF 36pF 360pF 3600pF 3.9pF 39pF 390pF 3900pF 4.3pF 43pF 430pF 4300pF 4.7pF 47pF 470pF 4700pF 0.047uF 0.47uF 4.7uF 47uF 470uF 4700uF 5.1pF 51pF 510pF 5100pF 5.6pF 56pF 560pF 5600pF 6.2pF 62pF 620pF 6200pF 6.8pF 68pF 680pF 6800pF 0.068uF 0.68uF 6.8uF 68uF 680uF 6800uF 7.5pF 75pF 750pF 7500pF 8.2pF 82pF 820pF 8200pF 9.1pF 91pF 910pF 9100pF #generics #CommonPartsLibrary
  • Generic Inductor
    A generic fixed inductor for rapid developing circuit topology. *You can now change the footprint and 3D model at the top level anytime you want. This is the power of #generics
  • 875105359001
    10uF Capacitor Aluminum Polymer 20% 16V SMD 5x5.3mm #forLedBlink #commonpartslibrary #capacitor #aluminumpolymer #radialcan
  • CTL1206FYW1T
    Yellow 595nm LED Indication - Discrete 1.7V 1206 (3216 Metric) #forLedBlink
  • 1070TR
    Battery Holder (Open) Coin, 20.0mm 1 Cell SMD (SMT) Tab bate or batt #forLedBlink

MCP23017-E-SP

MCP23017-E-SP
Description

Created
December 7th 2021
Last updated by jecstronic
2 years ago
1 Contributor(s)
jecstronic

Controls

Properties

Part Type
Integrated Circuit
Manufacturer Name
Manufacturer Part Number
MCP23017-E/SP
Designator Prefix
U

Availability & Pricing

DPNStockQty 1
712–3.5K$1.396–$2.00
15.1K$1.69
21–230$1.396–$1.684
10$2.7294
12.4K$1.69

Assets

Simulation

µs

Simulation Speed

@copilot what elements i need to use mcp23017 with +24V signals
@copilot what elements i need to use mcp23017 with +24V signals
11mo
The MCP23017 is a 16-Bit I/O expander, which works off a lower logic level typically ranging between 1.8V and 5.5V, depending on the specific version used. The device will not natively handle signals at +24V. To interface it with a system using +24V signals, you'll need to include some additional components:

  1. Level-Shifting Devices: These components can safely lower the voltage from +24V to a level the MCP23017 can handle without damaging it. There are many ICs available that can accomplish this, but you could also design a simple level-shifter using resistors and MOSFETs.
  2. Overvoltage Protection: Even with level shifters, it's worthwhile to protect your I/O pins from overvoltage conditions. Schottky diodes are often used for this purpose.
  3. Pull-Up Resistors: While not strictly necessary for voltage shifting, most I2C applications (including the MCP23017) benefit from the addition of pull-up resistors on the SDA and SCL lines.
While I can provide general information about how to connect these components, without knowing the specific parts you're using, the exact connections might vary. Feel free to provide any additional parts so I can give a better guidance. I should also note that it's crucial to verify the suitability of any components used with the requirements of your project before implementing them.
11mo
what about optoisolators?
11mo
Yes, using optoisolators (also known as optocouplers) is a good approach when dealing with signal levels that are higher than those a component can natively handle, like in your case of a 24V signal and the MCP23017 I/O expander. Optoisolators provide effective voltage isolation and level shifting, and also provide the benefit of electrical isolation between your input and output, protecting your components from electrical noise, voltage spikes, and other harmful conditions.
For your use case, you would need an optoisolator that can handle 24V on its input side and 5V or 3.3V (whatever level the MCP23017 operates at in your circuit) on its output side. One such example is the PC817 optoisolator.
However, continue bearing in mind that specific application requirements might call for different components or specific ways to integrate them into your design. Ensuring that you select components that can handle the expected voltage levels, currents, and frequencies of your application is crucial for the stability and reliability of your design.
Note also that every optoisolator has two sides: an input (LED) side and an output (phototransistor) side.
On the input side, you would typically connect:

  1. The terminal from the 24V signal to the anode of the optoisolator's internal LED.
  2. The cathode of the LED to a current limiting resistor, then to the ground (or negative) of the 24V signal.
On the output side, considering that MCP23017 works with active-high signals:

  1. Connect optoisolator's collector terminal to the VDD (typically +3.3V or +5V, depending on the version of MCP23017 you are using).
  2. Connect optoisolator's emitter terminal to the respective I/O pin on MCP23017.
These are general guidelines. The specific connections might vary based on the exact wiring and components used in your project. Make sure to verify the specifications of your optoisolator (forward voltage, current, etc.) and ensure it's compatible with the MCP23017 and your project specification.
11mo
i will use PC817 optoisolator and +5V VDD, what resistor should i use
11mo
The value of the resistor to use with the PC817 optoisolator in your circuit can be calculated using Ohm's Law. You'll need to know the forward current and the forward voltage of the optoisolator's input side (the internal LED). According to the PC817 datasheet, I typically suggest these values:

  • Forward Current (If) = 20mA (Common operating current for many LEDs)
  • Forward Voltage (Vf) = 1.2V (Typical forward voltage drop across the PC817's LED at If=20mA)
Next, consider that your input voltage is 24V. Applying Ohm's Law:
Resistor value (R) = (Input voltage - Forward Voltage)/ Forward Current
R=24V1.2V20mA=1140ΩR = \frac{{24V - 1.2V}}{{20mA}} = 1140 \Omega
So, you would ideally use an 1140 Ohm resistor. However, standard resistor values don't include a resistor of exactly 1140 Ohms. The closest standard value resistor would be 1.2k Ohms, providing a slightly less forward current, increasing your component's lifespan without noticeably affecting its operation.
Here's the connection description with the chosen resistor:
Connect <24V signal> to PC817:anode Connect PC817:cathode to R1:1 Connect R1:2 to <Ground of 24V signal>
Connect PC817:collector to MCP23017:VDD Connect PC817:emitter to MCP23017:<specific I/O pin>
Where <24V signal> is your 24V input, <Ground of 24V signal> is its corresponding ground connection, and <specific I/O pin> is the respective I/O pin on MCP23017 you want to interface with the 24V signal.
Please replace <24V signal>, <Ground of 24V signal> and <specific IO pin> per your project's requirements. Remember to replace "R1" with your chosen resistor's designator as it appears in your schematic.
The above connections and resistor's value are recommended based on assumed typical values. Any changes in these suggested values should match the requirements in your specific application.
11mo
do i need resistor on i/o pin on mcp23017
11mo
Using a pull-up or pull-down resistor depends on the specific needs of your circuit and the mode in which your I/O expander - the MCP23017 - is configured.
In most cases, it's recommended to use pull-up resistors on the I2C lines (SDA and SCL), because I2C is an open-drain/ open-collector bus. This means, devices can pull lines low, but must rely on external resistors to pull them back high.
For the rest of the I/O pins on the MCP23017, whether you need resistors on the I/O pins depends on your specific application:

  • If the I/O pin is configured as an input, it might be necessary to use a pull-up or pull-down resistor, depending on the state you want the input to default to when nothing is connected. Keep in mind that MCP23017 has configurable internal pull-up resistors for its I/O pins, which are disabled by default, but can be enabled via I2C commands.
  • If the I/O pin is configured as an output, typically, you won't need a pull-up or pull-down resistor. A resistor might be used in series with the output pin as a current-limiting resistor if you're directly driving an LED or a similar device.
Remember to carefully consider your system's needs based on the specific behavior you want to achieve. Refer to the MCP23017 datasheet for detailed guidance on how to interface with and configure this device.
11mo
i will use i/o pins as inputs do i need resistor to limit current that will go to i/o pin of mcp23017
11mo
When you're using the I/O pins of the MCP23017 as inputs and you're interfacing with an optoisolator like the PC817, there's typically no need for an additional current-limiting resistor on the MCP23017 I/O pin. This is because the optoisolator itself provides current-limiting on its output (the transistor side).
The phototransistor side of the optoisolator, which connects to the MCP23017's input pin, effectively converts the input current (which is limited by the resistor on the optoisolator LED side) to a voltage signal that's safe for the MCP23017.
However, depending on the state you want the input to default to when the optoisolator is inactive (no light emitted by the LED), you might still want to use a pull-up or pull-down resistor. For example, to default to a logic low when the optoisolator is inactive, you could connect a pull-down resistor between the MCP23017 input pin and ground.
Please note that you can enable the use of the MCP23017's internal pull-up resistors via I2C commands if your application calls for it. Consult the MCP23017 datasheet for specific details on how to accomplish this.
As always, while this general advice should apply to a broad array of typical circuits, the specifics of your project could necessitate a different approach. Consider your circuit's unique requirements carefully when making these design choices.
11mo
can you draw a circuit with specified components?
11mo
Apologies for any confusion, but currently, the capability to draw or create visual content directly is not available. However, guidance can be provided on how to create the circuit with the specified components. Consider this a series of individual points to connect.

  1. Connect the +24V signal to one terminal of a current limiting resistor (1.2k Ohms for example). Connect the other terminal of the resistor to the anode of the optoisolator (PC817).
  2. Connect the cathode of the optoisolator to the ground of the +24V signal.
  3. Connect the emitter of the optoisolator to the ground of the MCP23017 and the collector to one of the MCP23017's I/O pin which you will use as an input. Remember, every I/O pin you are going to use should have its own optoisolator.
  4. Connect the VDD pin of the MCP23017 to the +5V power supply and the VSS pin to the ground of the power supply.
Reminder: It is highly recommended to refer to the datasheets of the PC817 and MCP23017 to understand the exact pin configurations and characteristics of these components. Apologies for not being able to draw the circuit. At this stage, direct visual representation is currently not available.
11mo
how to convert mcp23017 output to +24v
11mo
Converting the MCP23017 output up to +24V also requires signal conditioning, similar to handling +24V inputs. Both a level shifter and a power amplifier will be required.
To do this, an optoisolator can still be used, but this time in a different mode: the transistor within the optoisolator will not just be used as a switch, but also as a current amplifier.
Here's how:

  1. Connect a pull-up resistor between the collector of the optoisolator and the +24V line. This pull-up resistor should be chosen based on how much current you expect the output to sink when the optoisolator is turning on. A value like 2.2KΩ might be a good starting point.
  2. Connect the emitter of the optoisolator to ground.
  3. Connect the MCP23017 output to the anode of the optoisolator's LED (input side) through a current-limiting resistor, similarly to how we drove the input side of the optoisolator before.
  4. Connect the cathode of the optoisolator's LED to the ground of the MCU.
When MCP23017 provides a signal, the optoisolator takes that signal and pulls up the connected line (through the pull-up resistor) to +24V. The output signal will be inverted because of this setup (a LOW from MCP23017 will result in +24V output, and HIGH will result in 0V), so you'll need to account for this inversion in your software or change the pull-up to a pull-down if the inversion is a problem.
Remember to supply the correct VDD to the MCP23017 (either +3.3V or +5V depending on your chosen version), and also couple the grounds of your different voltage supplies to tie the voltage references together. Always consult the datasheet of your components to check for electrical rating compatibility and please test this setup carefully, ensuring that your components are not subjected to voltages exceeding their absolute maximum ratings.
11mo
what elements i need to use mcp23017 with +24V signals
what elements i need to use mcp23017 with +24V signals
11mo
mcp23017
mcp23017
1y
draw relay circuit
draw relay circuit
1y
relay circuit
relay circuit
1y
Hey, I'm copilot! I can help you with all kinds of stuff in your project. Reac...
Hey, I'm copilot! I can help you with all kinds of stuff in your project. Reach me at any time by tagging me on comments or in the chat with my handle, @copilot.
1y
add 4 mcp23017 and make pcb
3mo
Let's start by adding four MCP23017 I/O expanders to your project. The MCP23017 is a 16-bit I/O expander with an I²C interface. Each expander can be configured with different I²C addresses, allowing multiple devices on the same bus.
Here’s how we can proceed:

  1. Assign I²C Addresses:

    • The MCP23017 has 3 address pins (A0A0, A1A1, A2A2), allowing for 8 different addresses.
    • For four MCP23017 devices, we can use different combinations of A0A0, A1A1, and A2A2.
  2. Electrical Connections:

    • Connect each MCP23017's SDA and SCL pins to the I²C bus.
    • Connect the VDD pins to your power supply voltage (typically 3.3V or 5V).
    • Connect the VSS pins to your ground.
    • Use pull-up resistors on the SDA and SCL lines if necessary.
  3. Pin Configuration:

    • Decide the purpose of each pin on the MCP23017 (input/output).
  4. PCB Layout Considerations:

    • Minimize trace lengths for I²C signals.
    • Ensure proper decoupling capacitors are placed near the VDD pins.
    • Consider the physical size and placement of components to ensure clean routing.
Let's connect the first MCP23017, and then you can replicate these connections for the other three. Here's a suggestion on the connections for the first MCP23017:

  • Power Connections:

    • Connect U1:VDD to the power supply.
    • Connect U1:VSS to ground.
  • I²C Connections:

    • Connect U1:SDA to the SDA line of your I²C bus.
    • Connect U1:SCK to the SCL line of your I²C bus.
  • Address Pins:

    • Connect U1:A0, U1:A1, and U1:A2 to either VDD or VSS to set the I²C address.
Once the connections for one MCP23017 are made, replicate this for the additional three MCP23017 components, ensuring each has a unique address.
After that, we can move to the PCB layout. Would you like me to assist you with anything specific on this step?
3mo
Someone is typing...
Checks that the power traveling across a given resistor is under its rating with 50% headroom.
Learn more
Checks that IC pins that require pull up or pull down resistors have them.
Learn more
Checks that capacitors have appropriate voltage ratings to prevent overheating and ensure reliable circuit operation.
Checks that all parts have a part number and are available from distributors.
Reports copper elements that are shorting.
Reports parts that have no footprint.
Reports nodes that are assigned to a layer that doesn't exist in the layout stackup.
Reports components that have been modified using the "!important" flag.
Reports terminals that are not connected properly. NOTE: Only connections to the center of pads are considered valid.
Reports nodes that are using rules that are not supported anymore.
Reports layers that have multiple copper fills of different nets. Make sure the Connected Layers rule value of nets with fills is valid.
Detect any via, trace or copper fill island that is not connected to any net.