Opto coupler circuit??

Thread Starter

expresso

Joined Jun 22, 2012
5
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.
 

wayneh

Joined Sep 9, 2010
17,498
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?
 

Thread Starter

expresso

Joined Jun 22, 2012
5
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).
 

wayneh

Joined Sep 9, 2010
17,498
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.
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.
 

BillB3857

Joined Feb 28, 2009
2,571
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.
 

Thread Starter

expresso

Joined Jun 22, 2012
5
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.
 

#12

Joined Nov 30, 2010
18,224
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.
 

Thread Starter

expresso

Joined Jun 22, 2012
5
@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.
 

BillB3857

Joined Feb 28, 2009
2,571
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.
 

Thread Starter

expresso

Joined Jun 22, 2012
5
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! :)
 
Top