Opto coupler circuit??

Discussion in 'The Projects Forum' started by expresso, Jun 23, 2012.

  1. expresso

    Thread Starter New Member

    Jun 22, 2012
    5
    0
    Greetings all,

    Some project guidance and assistance please if you would be so kind. I am building a computer controlled router and I'd like to monitor which of the various electrical circuits are active via an LCD. The circuits are 9, 12, 24 and 68 volts DC there are about 6 feeds in each voltage I'd like to monitor. I've looked at voltage dividers, opto couplers, relays and various other methods for the past couple of days and although much better informed, I happily admit I am none the wiser! The opto coupler seems like the best way to proceed and hooking it to an Arduino almost within my capabilities! But although there are many examples of using optocouplers on the output side of an Arduino, there are very few and mostly conflicting diagrams regarding using them on the input configuration.

    My question relates to what is needed and how to organise it. From what I've read, the input side of an opto coupler is treated as a normal LED with a resistor in front of it and the output side of the opto (the input to the Arduino) uses a 5v feed through another resistor to pin 5 and the "reading" taken from pin5 too. Pin 4 going to Arduino ground.

    I've tried simulating this with Circuitmaker and got some very strange results (mainly being unable to "trigger" the output of the opto - but I think that might be due in part to my lack of familiarity with the package and the resistor values I'm using found on the net! So before I go and let the smoke out on the breadboard, I thought I'd seek advice!

    Any suggestions about what values to use with a 4N25 or similar would be most welcome, as would suggestions of easier or more elegant way of doing this.

    Thanks for your time to read this and for sharing lots of information I've found useful in previous projects.
     
  2. wayneh

    Expert

    Sep 9, 2010
    12,123
    3,047
    Are you sure you really need the isolation provided by the opto device? I mean, why not just put a resistor voltage divider on your signals to bring them into safe range?

    You'll have to share a ground, and I wouldn't do that until I was darn sure no current will flow when grounds are connected. (I use a low ohms resistor with my LabJack when connecting grounds to another power source.) But if you can connect grounds, maybe you don't need the isolation?
     
    expresso likes this.
  3. expresso

    Thread Starter New Member

    Jun 22, 2012
    5
    0
    Thanks for the response Wayneh,
    Yes, I think I do need the isolation. Avoiding ground loops is something I'm told needs careful attention among other design considerations.

    (All the voltages mentioned are coming from individual mains transformers rather than from one modified supply).
     
  4. wayneh

    Expert

    Sep 9, 2010
    12,123
    3,047
    Sounds right to me. Of course I'd experiment cautiously until you're happy with the way it's working. "Cautious" means larger value resistances to limit current. Reduce resistance and increase current only as needed. In particular, I'd aim for the lowest LED current that still gives the coupling you need. Blowing out the LED is probably the main failure mode.
     
  5. BillB3857

    Senior Member

    Feb 28, 2009
    2,400
    348
    You could put appropriate value zener diodes in series with the LED section of the opto to cause it to trigger at the proper voltage or use a resistive voltage divider.
     
  6. expresso

    Thread Starter New Member

    Jun 22, 2012
    5
    0
    Thanks again Don,

    @Bill, The zener was a thought that crossed my mind. I was thinking that I could use one set of components for all of the voltages, but as I took a stupid pill at some point in the last couple of days that will be an enhancement I'll look at when it's worn off and I get my head around this!
    :)
    The voltage divider was dismissed on the basis of having to use a common ground and the potential for ground loops.
     
  7. #12

    Expert

    Nov 30, 2010
    16,284
    6,797
    I don't think you will have a problem with ground loops on this one. It's too simple. The cautions you have heard are prevalent because ground loop problems can be amazingly difficult to fix.
     
  8. expresso

    Thread Starter New Member

    Jun 22, 2012
    5
    0
    @12
    I'm sure you are correct, but I know of others who have had issues with noise - or rather noise has been blamed for the problems! However, I must admit that part of my paranoia is due to the thought of sticking a large loop antenna over the noise of a lot of noise making things (exaggerated only for the purpose of clarity! )
    :)


    I've just had a play with some components and happily got it working and kept all the smoke in too! So MANY thanks for your time and your help guys, much appreciated.
     
  9. BillB3857

    Senior Member

    Feb 28, 2009
    2,400
    348
    I don't understand the ground loop problem with the voltage divider plan. One voltage divider (2 resistors) per opto with the "ground" end of each voltage divider tied to its own isolated supply voltage.
     
  10. expresso

    Thread Starter New Member

    Jun 22, 2012
    5
    0
    Ah, sorry Bill my mistake. I misunderstood your suggestion. I thought you were meaning just a voltage divider to the arduino, missed the bit about "per opto" in your first post!
    I'll have a read up on them again.

    That stupid pill was stronger than I thought! :)
     
Loading...