0
\$\begingroup\$

I'm working on a I/O module to control AC, DC motor and lamps by using relays. But I don't know how to control the relays. Some says I should use optocoupler, some says transistor array.

I found an optocoupler TLP280, in the figure there is the schematic. Can I use it by supplying 3.3V to control 24V dc motor and some lambs.

enter image description here

\$\endgroup\$
  • \$\begingroup\$ This might work for DC motor and lamps (I assume you DO mean lamps), but how will you use it for AC motors? BTW relays are quite easy to use - and they will work for everything - just ask! \$\endgroup\$ – Kripacharya Jul 24 at 9:17
  • \$\begingroup\$ Relevant: Why are relays so frequently driven by optocouplers? \$\endgroup\$ – dim Jul 24 at 10:08
  • \$\begingroup\$ @Kripacharya actually I have AC and DC motor drivers, so I just need to control them. So using opto could solve my problem I think. \$\endgroup\$ – Teoman Açıkgöz Jul 24 at 11:53
1
\$\begingroup\$

Relay contacts create quite a bit of noise when they switch, particularly if the load has a lot of inductance (such as a motor, or even because of long wires that are not close to each other), so the opto-isolator can be a good idea, because it prevents the noise from being coupled back to the ground of the power supply used for your logic. If you use a transistor array (and a catch diode across the relay coil) you will probably have no trouble at all driving the relay coil, but you may have issues when the loads are connected.

For this to be valuable, the relay supply should be isolated from the logic supply, say another 12V supply.

You will need a series resistor to control the LED current (your optocoupler has AC input capability, so one of the LEDs will be unused). The CTR is as low as 50% depending on rank, so if you drive it with 5mA the output current might only be 2.5mA (allow perhaps 1mA to allow for temperature and aging effects) so you would need some kind of additional driver for most relays. Suppose you follow the optocoupler with a ULN2003 darlington array, then you can switch substantial relays, and the catch diodes are included.

\$\endgroup\$
  • \$\begingroup\$ Thank you for your answer, that is quite clear. \$\endgroup\$ – Teoman Açıkgöz Jul 24 at 11:14
1
\$\begingroup\$

You can simply use a transistor array to control the relays. The relay itself isolates the control signal terminal(operating voltage) and switch terminals(NO/NC) electrically.

Or you can avoid a transistor array by using solid state relays(SSR). They have a wide operating voltage, longer life, no mechanical noise and they are optocoupled too. You can directly drive SSR from microcontrollers. When choosing SSRs, make sure to use the correct type for the load you are going to use (both AC and DC solid state relays are available).

\$\endgroup\$
0
\$\begingroup\$

If you're not sure about the output side of the relays, especially with motors connected to them, rather be safe and use the optocouplers. The datasheet says the LED has a forward voltage of 1.15V when passing a forward current of 10mA so a simple LED calculation should tell you the resistor value you need R = (3.3-1.15)/0.01 = 215Ω so 220Ω should work. Depending on how much current your relay coils draw you may want to add another transistor or in between the opto and the relay because I see the opto's transistor side can only handle 50mA collector current.

schematic

simulate this circuit – Schematic created using CircuitLab

If your relay coil current is less than 50mA ignore the second transistor and connect the bottom of the coil to the collector of the Opto.

\$\endgroup\$
0
\$\begingroup\$

The usual, simple approach is to use one or more FETs. Your micro-controller can source enough current to switch on a FET, which can handle the higher power needed to switch your relay.

The most simple configuration could look like this:

schematic

simulate this circuit – Schematic created using CircuitLab

\$\endgroup\$
0
\$\begingroup\$

Using an optocoupler will give you better protection for your I/O pins, because they are electrically completly isolated from the power rail. This might make sense for harsh environments or outputs where you do not know what the user will connect to them. But typically when you design the whole system this won't be necessary and you can just use FETs to switch the relays.

\$\endgroup\$
  • \$\begingroup\$ Thank you for the answer. I will probably use opto. :) \$\endgroup\$ – Teoman Açıkgöz Jul 24 at 11:13

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.