Help with PLC to Micro controller interface circuit

Thread Starter

cstrutton

Joined Sep 25, 2010
1
I am working on a data logging device that will record production data from various CNC machines and robots on our production floor. The PLC's and robot controllers will pulse a 24V output when an event happens. My device needs to recognize that event and post it to a database log on the network.

I have created a circuit with a resistor divider connected to an optocoupler. The optocoupler is connected to the micro with a pull-up resistor. (see attached schematic)

This schematic is the result of about 10 hours of searching the on the web. I have breadboarded this circuit and it seems to work. My question is 3 fold:

  • have I missed anything here
  • how do I protect this from noise as the plc will also be driving relays and valves
  • how do I add a led on the micro side to provide visual indication of a signal
Any help would be greatly appreciated
thanks
Chris
 

Attachments

bertus

Joined Apr 5, 2008
22,277
Hello,

Remove R2, a lot of current will go through that resistor.
To have a indication reduce R3 from 1K to 560 and put a led in series.
When the output is low the led will be lit.

Bertus
 
Top