Connect with us

Optocoupler with PLC

Discussion in 'General Electronics Discussion' started by BHEKI, Oct 27, 2014.

Scroll to continue with content
  1. BHEKI

    BHEKI

    24
    1
    Aug 28, 2014
    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
     
  2. Harald Kapp

    Harald Kapp Moderator Moderator

    10,224
    2,204
    Nov 17, 2011
    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.
     
  3. BHEKI

    BHEKI

    24
    1
    Aug 28, 2014
    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: Oct 28, 2014
  4. Harald Kapp

    Harald Kapp Moderator Moderator

    10,224
    2,204
    Nov 17, 2011
    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:
    [​IMG]
    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.
     

    Attached Files:

  5. BHEKI

    BHEKI

    24
    1
    Aug 28, 2014
    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.
     
  6. Harald Kapp

    Harald Kapp Moderator Moderator

    10,224
    2,204
    Nov 17, 2011
    You can build a 24V supply from a 12V trnasformer using this scheme:
    [​IMG]
    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.
     

    Attached Files:

Ask a Question
Want to reply to this thread or ask your own question?
You'll need to choose a username for the site, which only take a couple of moments (here). After that, you can post your question and our members will help you out.
Electronics Point Logo
Continue to site
Quote of the day

-