This looks like a classic
XY problem.
For those not familiar with the expression
XY Problem here is a synopsis:
The XY problem is a communication problem encountered in help desk, technical support, software engineering, or customer service situations where the question is about an end user's attempted solution (Y) rather than the root problem itself (X).
So @Jbouss, what is the original problem that you're trying to solve?
To me it seems that you have 10 switches (you haven't said what function those switches are supposed to perform), and you want a light to light up if one or more of those switches are in one position ('open') you want the light to be on. If all the switches are in the other position ('closed') you want the light to be off. Also these switches seem to also be somehow each associated with a signal from a PIC32.
It would seem that these 10 switches are in 10 completely different devices and you're just trying to produce some overall warning/monitoring solution to what state these 10 devices have been set into. Perhaps the switches represent an override or an interlock or position sensing switch. I suspect that there's no guarantee about the relation between ground and supply voltages of these 10 different devices. I further suspect that they represent a method of disabling a relay, for which L1 is the relay coil, by lifting the relay's ground. I also suspect that there's a possible logical flaw here, in that the signal you're sensing may not truly sense
just the state of the switch but is also dependent on whether the PIC32 output is turned on. (Of course that PIC32 signal may be an input, but then I don't see the sense of the coil and diode, but the pullup to 3V3 doesn't make much sense in terms of it being an output so I'm a little nonplussed by which it really is.)
I'm guessing that you have little or no control over the content of the "
10 electronic control boxes" and you have either added the switches as some sort of override, or the switches are already part of the "
10 electronic control boxes" and you're trying to pick off the signal generated by the existing switches for your own monitoring.
The logical function being sought here appears to be a simple logical OR of the state of the 10 switches, which is then used to turn on a light. There are a number of ways to do this, all simpler and more reliable than the solution that you're trying to use. The simplest solution is probably 10 pairs of wires from the "
10 electronic control boxes" driving 10 optoisolators with the optoisolator outputs wire ORed, with the resultant signal used to indirectly drive the indicator LED.
@Jbouss - Please tell us exactly
what problem you are trying to solve,
not how you've tried to solve it. It's probably obvious by now that the attempted solution has problems, and if all is as I suspect, any attempts to make that solution work are going to be flawed.
Please tell us:
- What are the "10 electronic control boxes"?
- If you know, are the "10 electronic control boxes" electrically isolated from one another, or do they share a common DC supply or a common DC ground?
- What is the function of the switch on each of them that you're interested in the state of?
- What is your final output LED/light intended to indicate?
- Have you added the switches yourself, and if so, what are you intending to achieve with them?