I'm designing an I/O module by using optocouplers for the inputs and outputs which I want to control by a microcontroller.

Here are my questions:

  1. In the datasheet of optocoupler's output current (per channel) is 50mA, and for the output port(figure 1) Relay nominal operating current is 16.7 mA. By knowing these can I calculate how much current will I need for the system. Which parameters do I know?

There are 12 relays, 20 optocouplers (5 module) in total. 3 Opto module for output, 2 for input ports

enter image description here

  1. By directly connecting the GPIO pin and output of the optocoupler to the switches (as input), Can I control the inputs shown in the figures. For the input ports, I don't know how to make the connections. What should I connect to the collector pin?

enter image description here

  • 1
    \$\begingroup\$ When the optos can handle 50mA and the relays only need 16.7mA - why did you put transistors there? \$\endgroup\$ – jusaca Jul 29 '19 at 14:47
  • \$\begingroup\$ @jusaca Just to make sure if it can handle or not. \$\endgroup\$ – Teoman Açıkgöz Jul 29 '19 at 14:51

The current through the relay coil is determined by the voltage across it, and the resistance of the coil. To turn the coil on, you'll need at least 33.3mA to actuate the coil.

The voltage drop across the transistor is ~0.7V, the resistance of the coil is 360Ω Assuming the transistor is fully on, there will be 64mA of current through the coil and 1.5W of power. To really know what the circuit is doing, the transistor part number is needed.

1.5W of power is probably too much (there isn't any rating's on max power, but they recommend 400mW, so it would be best to limit the current to 33mA with a resistor in series or to use the appropriate relay. You should be using the ALQ124 with a 24V input.

enter image description here

  • \$\begingroup\$ I will use ALQ124, I just used the same footprint. In this case it has 16.7mA, would this still be a problem? Do I need a heatsink? \$\endgroup\$ – Teoman Açıkgöz Jul 30 '19 at 6:09
  • \$\begingroup\$ You wouldn't need a resistor if you used the ALQ124. \$\endgroup\$ – Voltage Spike Jul 30 '19 at 15:01
  • \$\begingroup\$ Why is that? The resistor limits the current right? \$\endgroup\$ – Teoman Açıkgöz Jul 31 '19 at 6:20
  • \$\begingroup\$ Yes the coil in the relay is a resistor \$\endgroup\$ – Voltage Spike Jul 31 '19 at 13:45

You need to rethink your circuit. The current one is likley to fail very rapidly.

The ALQ112 appears to be a 12V relay, did you get the part number wrong?

The TLP280-4 is obsolete, an AC input (do you really need that), and a min CTR of only 50%.
Given the circuit you show you would need to drive the opto inputs with 24V to get 50mA output current. At 5V input, you would get about 24mA on the ouptut side.

With transistors driving the relays, you only need to allow for the required base current supplied by the opto. Even using a x10 Ib/Ic ratio that means you only need 2mA of opto ouptut current.
That would seem to indicate that all you need in the opto input is about 3-5mA, so a resistor value closer to 560 Ohms may be better.

You also need to consider the power dissipated in the opto-transistors.
If you force 50mA on the opto output from a 24V power supply you are forcing EACH opto to about 1W dissipation.

  • \$\begingroup\$ The relay I use is 24V. It has several types. I dont need AC input but, for the output (I will change), I will need to use AC control with some relays. What can I do with the power dissipated? Like heatsink? \$\endgroup\$ – Teoman Açıkgöz Jul 30 '19 at 6:02

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.