Forum Rule: Always post complete source code & details to reproduce any issue!
Results 1 to 9 of 9

Thread: Basic optoisolator advice

  1. #1

    Basic optoisolator advice

    Sorry for asking such a basic question, but i just want to be 1000% sure before i design it into my pcb and find out its not right.

    I basically have a 5V source, that i want to be isolated, but i want to be able to trigger a pin on the teensy (3.5).
    Normally ive seen images on the net where the optoisolators output is taken from the collector side of the transistor, but this inverts the logic.
    So im considering wiring it like this. Taking my output from the emitter side. Im not sure if i needed the 1k resistor on the collector side, but is it good practice to do so?
    The 10k works as my week pull down when the optoisolator is off, but also allows me to get a voltage on the output at the emitter.
    Click image for larger version. 

Name:	Opto.png 
Views:	343 
Size:	16.4 KB 
ID:	12071

    ive wired it up on a breadbord and i get 0.0003v when the isolator is off and 2.95v when the isolator is triggered. Would this be enough to trigger the teensy? Or does anyone recommend a better way to do this?
    The optoisolator is a LTV-356T.

    Sorry again for such a basic question


  2. #2
    Senior Member
    Join Date
    Mar 2013
    Change your 100R to something between 200 - 500R. Your over-driving the opto pretty bad with 100R(~37mA). To save on sizes you can make the 1K and 100R the same value between 200-500R. I cant give better values without knowing what bin part your using they have A-D ratings or no ratings.

  3. #3
    Thanks for the reply.
    Yes your very right, when i was reading the data sheet i saw the forward current was 50mA although i neglected to acknowledge thats the absolute minimum ratings.
    The version is C.


  4. #4
    Senior Member
    Join Date
    Mar 2013
    That's a 200-400% rating. So if you put 5mA into the diode and you correctly power the collector you can get 10-20mA output.
    For your circuit you can easily use 1K's for the Led and Collector. Which will give 3.8mA to the LED. Keep in mind that using low values will make the rise/fall slower then driving the signal harder but most opto's are not known for speed to begin with.

  5. #5
    Thank you Donziboy, and thank you for making it clear how the CTR value works in a simple way. Just setup on a breadboard and i get 3v when triggered and 0.001 when not which should be perfect for the teensy.

    Last thing, do i need a current limiting resistor between the the output and the teensy input. The reason i ask is ive seen a mix where people have been putting current limiting resistors on the input pins into a teensy and not putting one. Especially when interfacing other logic ic's at the same voltage.

    Thanks again


  6. #6
    Senior Member
    Join Date
    Mar 2013
    The circuit as you have it pictured has limiting.
    Limiting current when the source is higher voltage is the main reason. But since its a programmable micro and we are human there is always a chance of making a mistake and trying to drive a pin that is already being driven externally. Considering the cost of resistors I don't consider limiting resistors something that should ever be left out.

  7. #7
    Here's the opto circuit I have used in designs for years with no problems. Yes it will invert the signal, but it's trivial to invert again in software. The 10K works fine as the current needed by an input pin is incredibly small. I usually prototype this to figure out the value of the resistor driving the LED side. You can sometimes even use 2.2K or 4.7K if you have a darlington optocoupler with high gain.

    In the dagram at the top of this thread, i'm not sure why you would want to have the output going into a voltage divider... only a pull up resistor is needed on the output side. The single 10K in the picture does the job of current limiting as well as pulling up the voltage when the transistor is off. the idea of current limitng for a Teensy input pin is a bit unneeded though, since it's never goign to take more than about a microampere as long as you give it less than 3.3V at the input pin.

    Another possibility is to use a digital output optocoupler that connects directly to the Teensy. These have been engineered to give a nice clean logic-level output, and can be had in inverting and non-inverting types.

    Click image for larger version. 

Name:	OPTO.jpeg 
Views:	77 
Size:	30.4 KB 
ID:	12078
    Last edited by Daniel-J; 11-21-2017 at 07:36 AM.

  8. #8
    Thanks for the advice guys. Im intending to use a number of optoisolators to allow me to ultimately interface 24v logic (ill increase the resistor on the led accordingly). Im making my own DRO, and so far ive got my LCD touch display wired up, rotery encoders for additional ui, and ls7366 ics reading the scales. Im just proving each part before i add it to the PCB im doing at the moment.

    Thanks again for your help


  9. #9
    Senior Member Epyon's Avatar
    Join Date
    Apr 2013
    For this I can advice the MOCD208. I use it in all my designs that interface with 24V logic.

    Click image for larger version. 

Name:	DyLaJf.png 
Views:	264 
Size:	88.9 KB 
ID:	12083

    The main advantage of the MOCD208 is its high CTR. With the resistor value in the schematic above, I can interface with TTL (5V) logic up to industrial 24V systems, while still keeping current draw at reasonable levels. Any signal of 5V and up will register as high.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts