I have a TLP521 driving a set of relays. The circuit is shown below.

To switch on the relay, I will need to sink the current to complete the P521 circuit, which will trigger the relay.

I am thinking to use a ULN2803A to sink the current as shown in the below diagram. This would mean that when I pull the Qa pin of shift register as HIGH, the 1C point (on ULN2803A) should be zero (grounded) and the circuit should be complete. Is this the correct way to do it? Please note that the common and gnd of ULN2803A are grounded and there is no +Vcc on the IC. Is this OK, or should I connect the COM to +5? (I don't want to source current to 1c by mistake or during initialization)


Another question: Can I get rid of ULN2803 and directly sink the current from 595? I dont think it can sink this current.




TI SN74595N


The 74595 part as per the data sheet is meant to be run with a Vcc of +5V. In this mode the outputs are capable of sinking up to 6mA of current.

The ULN2803A on the other hand can sink a much larger amount of current. As much as 100mA to 300mA per output.

The recommended amount of current through the LED of the TLP521 opto-coupler is 16 to 25 mA. As such you cannot connect the opto-coupler directly to the 74595 shift register and expect it to work correctly. The ULN2803A is put there to buffer the 74595.

Another advantage of using the ULN2803A is that you could replace the 74595 shift register with a 74HC595 type part operating at 3.3V and still allow the opto couplers to operate off of 5V. This level conversion is a common requirement for many modern MCUs that operate with a Vdd of 3.3V.

  • 1
    \$\begingroup\$ What about com and gnd tied to ground? \$\endgroup\$ – Anuj Purohit Apr 21 '15 at 8:58

You cannot tie the COM pin on the ULN2803 to ground. It is the common connection for diodes intended to catch the back-emf when used to drive relays or the inductive loads. If you tie it to ground it will be as if the outputs are permanently on.

You should tie to to +5V in this application or it could be left open.

How much current do you need out of the TLP521? It has a minimum of 50% current transfer ratio so if you only needed 2-3mA at the output you could drive it directly from the 595 with an appropriate resistor. If you need that you should use the ULN2803.

You haven't mentioned the value of resistor you are going to use to drive the optocoupler. In the data sheet they spec the LED forward voltage at 10mA but the CTR at 5mA! To calculate the resistor you need don't forget to include the on voltage of the ULN2803, the LED and take into account that the 5V rail may be only 4.75V.

From the data sheet these are 0.7V and 1.3V leaving 2.7V across the resistor. If you decide to drive it with 10mA you will need a 270 ohm resistor. You should get at least 5mA drive from the output of the optocoupler.

enter image description here


Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.