MCP23017 input via Opto-isolator

General project help for Adafruit customers

Moderators: adafruit_support_bill, adafruit

Please be positive and constructive with your questions and comments.
Locked
Netwaves
 
Posts: 2
Joined: Wed Apr 09, 2014 6:04 pm

MCP23017 input via Opto-isolator

Post by Netwaves »

I want to use Opto-isolators as logic level inputs to an MCP23017. I've built a home security system using a Raspberry Pi, I2C, and an MCP23017 to directly sense magnetic switches on doors and windows. I don't like the thought of the magnetic switches being directly connected to my electronics and would like to use opto-isolators between the switches and the MCP23017. I've been searching but can't seem to come up with a good example of how to do this. Do I need to use a pull-up/down resistor with the opto-isolator to get the correct input logic level on the MCP23017? A link to an example schematic would be great. Thanks.

User avatar
zener
 
Posts: 4567
Joined: Sat Feb 21, 2009 2:38 am

Re: MCP23017 input via Opto-isolator

Post by zener »

http://www.vishay.com/docs/83741/83741.pdf

Examples 1 and 2 are the most basic circuits. You just need to have a current limiting resistor on the LED side, and a pull up or pull down on the transistor side. The basic concept is that for every milli-amp you put through the LED, you will get some ratiometric current through the transistor on the other side. This ratio is called the CTR: Current Transfer Ratio. It can be less than 100%, or could be more. It depends on the optocoupler, and is often specified as a minimum, and sometimes as a range.

Netwaves
 
Posts: 2
Joined: Wed Apr 09, 2014 6:04 pm

Re: MCP23017 input via Opto-isolator

Post by Netwaves »

I understand. The .PDF is very helpful. Thank you!

Locked
Please be positive and constructive with your questions and comments.

Return to “General Project help”