+-------------------------------------------------------------------+
| PBP 2.47/2.50 | MCS+ 3.0.0.5 | U2 Prog | Vista x64 | NO SLEEP!!!!!!! |
+-------------------------------------------------------------------+
Hi, I think a 7805 could be a solution for the output from the PLC to the PIC, but what about the output from the PIC to the PLC?
I still prefer the optocoupler solution for both sides.
Alfredo
Please don't go with the 7805. I tried this and was bad idea, i couldn't hunt down a counting problem i was having and it turned out to be the regulator. Regulators will only work if your inputs don't change very fast, the regulators are kinda slow. I used it to interface to a gear sensor and was losing a lot of pulses. Def stay with the optos. Good isolation and reliable.
Does your PLC have some kind of monitor function from a serial port? You could just hook up the PIC to the PLC serially then and just process the monitor codes the PLC sends out.
Or are you planning to use the PIC to watchdog the PLC?
Otherwise, using optos is the best way. All the signals to the PIC would be inputs, because you are monitoring the inputs and outputs of the PLC. So the optos would be all connected the same way, with the LED connected to the PLC signals on the anodes through a current limiting resistor, and gnd on the cathodes. Pick your resistor so you get minimum on current for the LED with about 5VDC and less than maximum with 24VDC. Remember that the LED has a forward voltage that needs to be subtracted before you calculate the current though the resistor. On the PIC side, connect the emitter to gnd and the collector to +5VDC though a 500-1k ohm resistor. Connect the PIC pin between the resistor and the opto collector. This will create an inverter, so remember to invert the signals in the PIC code.
Tim Barr
The cap is even worse. It can hold the input signal in a given state and cause false sensor readings. When it comes to PLCs, do it right and use optos for input and either optos or solid state relays for the outputs. The last thing you want is to go through the programming over and over trying to figure out why your timings are wrong.
If you're looking for an "off the shelf" solution (which most of us are not) look at opto22 modules or similar.
Wisdom is knowing what path to take next... Integrity is taking it.
Ryan Miller
I've used quite a few Opto22 modules. (Opto's plant is just across the street from me.) They work well, but check the spec sheet on timing, if you need high speed.
On my last project, I used Grayhill's Opto22 pin-compatible modules, and saved quite a bit of money. They worked just as well as Opto's.
Thank you so much for all your advise. I will try them. Maybe i can use zener diodes to replace LM7805. I appreciate your effort and time.
Bookmarks