Maker Pro
Maker Pro

Optocoupler with PLC

BHEKI

Aug 28, 2014
24
Joined
Aug 28, 2014
Messages
24
Im working on a school project but im also new to electronics, on my project im using PLC S7-200(SIEMENS) to drive the DC motor which controls the opening and closing of boom gate. The PLC is outputting a 24VDC and my motor driver IC(L293D) takes 5V as "high" on its input. Nw I want to use an opto-coupler as to get a +5V DC frm my PLC to my motor driver but im not sure hw I will do tht. Can some1 help me with da schematic on hw I should do my connection . PLZZZ
 

Harald Kapp

Moderator
Moderator
Nov 17, 2011
13,725
Joined
Nov 17, 2011
Messages
13,725
A simple voltage divider 475Ω + 1.82kΩ will divide 24V to ~5V.

If you want to go for an optocoupler (e.g. for electrical isolation), read this tutorial.
 

BHEKI

Aug 28, 2014
24
Joined
Aug 28, 2014
Messages
24
A simple voltage divider 475Ω + 1.82kΩ will divide 24V to ~5V.

If you want to go for an optocoupler (e.g. for electrical isolation), read this tutorial.

Thanks for the information. So one more question, the one I will be using is a photo-transistor type, but im not sure if they all can take 24V on the input side.

Also on the tutorial u just gave me, I've seen a circuit diagram of an Optotransistor DC Switch, on the output side of an optotransistor I was thinking of connecting a relay which wil switch on 5V DC to the input of my motor driver circuit(L293D), will the relay be necessary or I must just put 5VDC to that Vcc terminal and connect the output straight to my motor diver
 
Last edited:

Harald Kapp

Moderator
Moderator
Nov 17, 2011
13,725
Joined
Nov 17, 2011
Messages
13,725
but im not sure if they all can take 24V on the input side.
None can. The input of a photocoupler is an LED and you need to limit the current through the LEd to the vale specified in the photocoupler's datasheet. See our ressources section "got a question about driving LEDs?"
A photocoupler will rarely be able to directly control a relay. You typically add a driver transistor in between. See our ressources section "using a bipolar transistor to turn a load on or off". I'd expect that a relay is unnecessary in this application. Without knowing the technical data of your motor driver I cannot say more for sure. However, I'd expect the control input of the driver to be a voltage controlled signal, meaning that you apply either 0V or 5V to it and current into the input is negligible.
That's why I suggested you use the simple resistve divider. Or use the techniques described in the section about bipolar transistor drivers (link above) to convert the 24V signal from the PLC to a 5V signal for the motor controller.

If you insist on using the photocoupler, this is how your circuit could look like:
unbenannt-png.16371

Note that the part number for the photocoupler is a random choice, so is the value for R1. Once you get hold of a real life photocoupler, look up the required LED current in the datasheet and calculate the resistor accordingly.
 

Attachments

  • Unbenannt.png
    Unbenannt.png
    266.4 KB · Views: 2,509

BHEKI

Aug 28, 2014
24
Joined
Aug 28, 2014
Messages
24
Thanks for the info. again Harald. Im grateful. The PLC that im using also takes 24VDC on its input but the step down transformers that we have at school are rating at 230/12V AC.So I was thinking of buying my own transformer but I've not seen any transformer which I can use to build a power supply as to give me 24VDC on the output. Any suggestion on how I can build this kind of power supply.
 

Harald Kapp

Moderator
Moderator
Nov 17, 2011
13,725
Joined
Nov 17, 2011
Messages
13,725
You can build a 24V supply from a 12V trnasformer using this scheme:
unbenannt-png.16385

From +12V to -12V you'll see 24V.

Note that this scheme lacks the required +12V and -12V voltage regulators. The output as shown here will be very unstable and vary with load. So you'll have to add voltage regulators (e.g. 7812 for +12V and 7912 for -12V). This is not an ideal solution but workable.
You could also use 2*12V transformers in series to get at 24V.
 

Attachments

  • Unbenannt.png
    Unbenannt.png
    247 KB · Views: 1,447
Top