Jump to content
Sign in to follow this  
Blurred Talon

Connecting 12V to MSP430 I/O Pin

Recommended Posts

Trying to make more progress on the MSP430/TLC59116F LED controller project I've post about in the past (http://forum.43oh.com/topic/5348-msp430tlc5940-based-led-sequencer/#entry46784)

 

I need to have 12V (~14.5V when running) DC to trigger the inputs for the various LED sequences. I know that the MSP430s I/O pins will not except 12V and I have to step it down.

Of the various choices I think an opto coupler would be best due to the electrical isolation but connecting it to the MSP has be a bit confused. Everything I've read has the uC controlling/switching something higher voltage and not the higher voltage coming in.

Do I need a transistor before the optocoupler? What about resistors, etc.

Sorry if this is all newbie stuff but I'm fairly new to digital circuits.

I think the 4N25 optocoupler should fit the bill but connecting it is where I'm confused.

 

Here's a shot of my lay out so far.

Sequencer2_zpshic2aqpk.jpg

Share this post


Link to post
Share on other sites

Put a 1K2 or 1K5 resistor in series with the diode and enable pullup for the input pin. Connect collector to input pin and emitter to ground. Be aware that the input pin will then go low when voltage is applied to the diode. You may also connect collector to VCC and emitter to input pin and use pulldown if you want the input pin to go high.

Share this post


Link to post
Share on other sites
Of the various choices I think an opto coupler would be best due to the electrical isolation but connecting it to the MSP has be a bit confused.

 

Opto coupler is not best solution for level shifting. Don't know about your interface requirement, but MOSFET can be used for simple and low cost, bidirectional interface.

post-26480-0-97866600-1447140597_thumb.jpg

Share this post


Link to post
Share on other sites

An optocoupler is a combination of an LED and a phototransistor in one housing. So you'll need to drive the optocoupler as if you were driving an LED (use a resistor to limit the input current as stated). The other end will act as a transistor, so depending on the type you'll have to hook it up between your 3v3 and your input or between your input and your ground, then use the opposite pull-up/down resistor to create a defined level on the pin when the optocoupler is not conducting.

The big advantage of an optocoupler over a FET solution is ESD and surge protection; instead of blowing the entire circuit, you'll just blow the optocoupler.

Share this post


Link to post
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Sign in to follow this  

×
×
  • Create New...