# optocoupler+uln2803 design

Discussion in 'The Projects Forum' started by Kardo22, Apr 11, 2014.

1. ### Kardo22 Thread Starter New Member

Mar 12, 2014
27
0

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.

2. ### ericgibbs AAC Fanatic!

Jan 29, 2010
3,325
591
hi K.
You must consider the Vfwd drop of the Emitter diode , which is 1.35V typical.

So [3.3v-1.35]/680 = ~ 3mA

Kardo22 likes this.
3. ### ericgibbs AAC Fanatic!

Jan 29, 2010
3,325
591
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.

File size:
23.8 KB
Views:
47
4. ### ScottWang Moderator

Aug 23, 2012
5,478
864
Emitter diode?
LED?

5. ### ericgibbs AAC Fanatic!

Jan 29, 2010
3,325
591
Yes, Light Emitting Diode.. aka Emitter diode

6. ### THE_RB AAC Fanatic!

Feb 11, 2008
5,435
1,309
From memory, the ULN2803 input pin has an internal resistor to ground, so you don't need R8 in your schematic.

Kardo22 likes this.
7. ### AnalogKid AAC Fanatic!

Aug 1, 2013
5,649
1,595
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

8. ### SgtWookie Expert

Jul 17, 2007
22,194
1,763
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.

9. ### AnalogKid AAC Fanatic!

Aug 1, 2013
5,649
1,595
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

10. ### Kardo22 Thread Starter New Member

Mar 12, 2014
27
0
@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?

File size:
41.9 KB
Views:
54
11. ### SgtWookie Expert

Jul 17, 2007
22,194
1,763
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.

12. ### AnalogKid AAC Fanatic!

Aug 1, 2013
5,649
1,595
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: Apr 14, 2014
13. ### ScottWang Moderator

Aug 23, 2012
5,478
864
I will using over 5 mA, You can measure the E voltage of phototransistor.

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.

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.

14. ### Kardo22 Thread Starter New Member

Mar 12, 2014
27
0
schematic as attachment

File size:
190.9 KB
Views:
36

Mar 12, 2014
27
0
16. ### ScottWang Moderator

Aug 23, 2012
5,478
864
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: Apr 15, 2014
17. ### Kardo22 Thread Starter New Member

Mar 12, 2014
27
0
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?

File size:
36.7 KB
Views:
52
18. ### ScottWang Moderator

Aug 23, 2012
5,478
864
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.

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:

• ###### bypassCap_Kardo22.gif
File size:
16.4 KB
Views:
234
Kardo22 likes this.
19. ### Kardo22 Thread Starter New Member

Mar 12, 2014
27
0
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.

20. ### ScottWang Moderator

Aug 23, 2012
5,478
864
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.