optocoupler+uln2803 design

Thread Starter

Kardo22

Joined Mar 12, 2014
49

This is my design. The optocoupler is: VO619A-4 (http://www.vishay.com/docs/83430/vo617a.pdf) and ULN2803A (http://www.ti.com/lit/ds/symlink/uln2803a.pdf)
At the moment the parameters are: voltage from mc 3,3V, therefore the current should be 3,3/680= about 5mA. If I understood the optocoupler correctly then minimum CTR is 160%, normalizedCTR at 5mA is 0,7. therefore output current is 1,6*0,7*5=5,5mA. If I use a 10kohm resistor then I get current to ULN: 12:10000=1,2mA. ULN needs 0,93 to 1,63 mA to switch to high?(I think I got this rigth)

Q1: Is my understanding correct and would this work?
Q2: Could I also lower the input current to the optocoupler. What would be the min. current so that it still works?

Maybe some additional info: the ULN drives a relay.
 

ericgibbs

Joined Jan 29, 2010
18,849
hi K,
In your Emitter calculation you must allow for the forward voltage drop of the lED, which is typically 1.35V.

So [3.3-1.35]/690 = only #3mA.
 

Attachments

AnalogKid

Joined Aug 1, 2013
11,043
Correct about the pulldown resistor. Also, I've never had a problem driving the 2803 or 2003 directly with 3.3V. If you don't need ground isolation, you should be able to eliminate everything and go direct from the uC to the 2803.

ak
 

SgtWookie

Joined Jul 17, 2007
22,230
Be certain to connect the ULN2803A's GND pin to your relay power return (which must be connected with your uC's gnd), and the COM pin to the relay's positive supply voltage. Otherwise, when the output transistor turns OFF, the current still flowing through the relay's coil won't have a place to go, and as a result the voltage can become high enough to destroy the ULN2803.
 

AnalogKid

Joined Aug 1, 2013
11,043
True true. And, the clamping diodes in the 2003/2803 are not as good as the transistors. The only time I've seen these chips fail is in an application with continuous repeated relay coil activation. I think the diodes fail after a while, and the transistors go quickly after that. For relays, I always use external diodes, something fast and fat. If you have a little extra money, place 15V zener diodes from the 2803 outputs to ground.

ak
 

Thread Starter

Kardo22

Joined Mar 12, 2014
49
@SgtWookie, I don't quite get what you mean

I have modified my schematic. It now looks like this:

The microcontroller io ports give 3,3V. DC circuit is 12V and the circuit switched by relays (i use reed relays) is 2kV AC (low current).
Does that look ok?

So current draw from microcontroller (to optocoupler) would be (3,3-1,65)/680=2,4 mA. Will that be enough for the optocoupler?
That would give normalized CTR about 0,5 and CTR=1,6. So max output current is 2,4*1,6*0,5=1,92 mA. And the optocoupler output can go directly to ULN2803A?

The LED pins will connect to 3 LEDs with each its own resistor.


Also another question. If I'd like to add a 555 astable circuit to make 1 LED blink then what would be the best place for it?
 

Attachments

SgtWookie

Joined Jul 17, 2007
22,230
Attach your .sch file; and your .brd file as well (if you've created one yet).

The graphic you posted is too blurry to see the details.
 

AnalogKid

Joined Aug 1, 2013
11,043
Yes, that is enough current for the opto LED. Yes, the opto output goes directly to the 2803 input.

The simplest way to get one of the output LEDs to blink is to add blink code to the uC.

If you can't mess with the uC code at all, then the opto for the blinking LED drives the 555 reset pin. The reset pin is pulled low with a resistor and the opto pulls it high to disable the reset. The 555 output drives the 2803 input.

ak
 
Last edited:

ScottWang

Joined Aug 23, 2012
7,400
So current draw from microcontroller (to optocoupler) would be (3,3-1,65)/680=2,4 mA. Will that be enough for the optocoupler?
I will using over 5 mA, You can measure the E voltage of phototransistor.

That would give normalized CTR about 0,5 and CTR=1,6. So max output current is 2,4*1,6*0,5=1,92 mA. And the optocoupler output can go directly to ULN2803A?
They should be ok, but if you want to reduce the current draw, maybe you can in series with a 10K~47K resistor to each input of ULN2803.

Also another question. If I'd like to add a 555 astable circuit to make 1 LED blink then what would be the best place for it?
No need to use NE555, you just using the Pin 11 of ULN2803 to connecting to a LED and resistor to 12V, and write a blinking program to make the LED blinking.
 

ScottWang

Joined Aug 23, 2012
7,400
Another question about my design.
Am I correct that I should use a bypass capacitor near the DC jack? If so then is a normal 0,1uF ceramic ok or should I use : http://www.interfacebus.com/Compound_Capacitor_By-Passing.html
Using a 100uf/25V ~220uf/25V(Electrolytic capacitor) in parallel with a 0.1uf/50V Multilayer Ceramic Capacitors, if you using the ceramic still has the effective.

And your number expression is wrong, it should be like below:
0.1uf -- not 0,1uf, because that is a point '.' not a comma ',', zero point one
0.2uf -- not 0,2uf, because that is a point '.' not a comma ','
0.47uf -- not 0,47uf, because that is a point '.' not a comma ','
0.068uf -- not 0,068uf, because that is a point '.' not a comma ','
 
Last edited:

Thread Starter

Kardo22

Joined Mar 12, 2014
49
Most places seem to suggest the 0.1uF ceramic capacitor with 2.2 or 4.7 uF tantalum capacitor or 47 uF electrolytic capacitor. Why are both tantalum and electrolytic capacitors suggested as the 2nd capacitor and why are their suggested sizes different?

And would the placement of capacitors on the picture be ok?
 

Attachments

ScottWang

Joined Aug 23, 2012
7,400
Most places seem to suggest the 0.1uF ceramic capacitor with 2.2 or 4.7 uF tantalum capacitor or 47 uF electrolytic capacitor. Why are both tantalum and electrolytic capacitors suggested as the 2nd capacitor and why are their suggested sizes different?
Mostly we using two capacitors, one for low frequency and another one for high frequency(Noise), some places will need more maybe three or four, it depends on what kind of the operation environment, you can using the O'scope to measure the jack on +12V, when you adding the capacitor and not added.

And would the placement of capacitors on the picture be ok?
When we drawing the circuit diagram, the place of parts maybe not so important, but when you layout or solder them on the PCB then they are complete different, you should put the capacitors as close as you can to the input jack +12V and GND as below:

 

Attachments

Thread Starter

Kardo22

Joined Mar 12, 2014
49
Should I also add a resistor betwwen ULN2803 output and relay coil to limit current.
If I add nothing then it takes 12/150=80mA.
 

ScottWang

Joined Aug 23, 2012
7,400
Should I also add a resistor betwwen ULN2803 output and relay coil to limit current.
If I add nothing then it takes 12/150=80mA.
Of course, you can do that, it depends on the voltage and current of relay, and you can calculate the limiting resistor, you can measure the Vce or just using the voltage about 0.9V~1.1v.
 
Top