It looks like the PLC has no opto inputs. The LED is a need for optical control of the ardiuno output control. Transistor BC847.I am assuming the PLC has a typical Opto isolator input?
What is the purpose of the LED? Most PLC's show the status of the input via its own LED.
You could have probably done it simpler with 2n7000.
Max.
The input data is a momentary / monostable signal with ardiuno, and "PLC" basically represents the alarm panel input which implements the bistable mode and switches on / off specific outputs after violation of the input. The problem is that occasionally the PLC controls the output despite the absence of a violation with ardiuno (the LED is off and the PLC informs about violation of the IN input).Why not substitute the diode on the collector for a LED and get rid of the other one.
So what is the nature of the input? What PLC?
Max.
Sounds like a design issue there, not really sure of the (vague) details at this point however.
I still can't see why the LED cannot be placed in the output to the PLC?
Max.
I know only that the inputs are OC type and have a pull-up resistor built in. The PLC inputs are probably the AVR inputs.Do you have details of the actual nature of the PLC input?
Or is it a 'Black Box"?
Max.
So going back to the original problem, it sounds as though you are getting random triggering of the PLC input?
You don't have details of exactly what the alarm panel is? Make? Manuf. info etc?
Max.
I understand, but why 2n7000 will be better than this npn? I am trying to find an error in this scheme because it is quite simple and yet it does pose a problem.So its in the program!?
I would have used a 2n7000 there.
Max.
When the transistor is off the LED will be reverse biased as the anode is at +5 volts and the cathode is being fed with +12 Volts via the PLC, the diode and the 200 ohm resistor. I don't know how much leakage there would be through the reverse biased LED. Increasing the value of the 200 ohm resistor and connecting the LED anode to +12 volts instead of + 5 volts would eliminate this potential problem.
Les.
The diode is working correctly all the time did not damage but I am trying to determine if exceeding the blocking voltage may cause unintentional triggering of the PLC input.I have never studied the mechanism of reverse breakdown in LEDs. I just know that they fail if the reverse breakdown is exceeded. You will just have to hope there are some semiconductor design specialists on the forum to answer that question. I think I remember a method of generating very short pulses using the reverse breakdown of the base emitter junction of transistors. You could also try Googeling "semiconductor reverse breakdown mechanism." I just take the simple approach of not exceeding device ratings. You could also try connecting a diode in series with the LED if it has to be connected to the 5 volt rail rather than the 12 volt rail. If my understanding of your post #7 that the LED stopped working then this would support my theory.
Les.