#Circuit# Consider the following U-Shaped Micro Photoelectric Sensor *Panasonic PM-T54P* with two PNP Open-Collector Transistor outputs: [![Photoelectric Sensor Input/Output Circuit Diagram][1]][1] [![Photoelectric Sensor Wiring Diagram][2]][2] [![Photoelectric Sensor Output][3]][3] I chose the supply voltage to be 12V DC. In the place of the two loads I want to place two voltage meters (to be more precise the [NI 9401][4]), which can endure a maximum voltage of 5V DC. After some calculations, I came up with the following first schematic for Output 1 (the one for output 2 is identical, so I leave it out): <!-- Begin schematic: In order to preserve an editable schematic, please don't edit this section directly. Click the "edit" link below the image in the preview instead. --> ![Schematic 1](https://i.sstatic.net/gnA8l.png) <!-- End schematic --> Some explanations: - The connection to ground at the pull-down resistor R_GND is supposed to prevent a floating input into the NI 9401. *It should be possible to get a switch into the schematic between V_A and V_In, which physically opens or closes the connection, but I did not know how to do this.* - The resistance R_NI is supposed to limit the current into the NI 9401 to less than 250uA in case the circuit is compromised and the resistors R_A and R_GND are bridged, so that R_NI alone has to deal with the full 12V of V_A. #Questions# 1. Do I really need the connection to ground at R_GND? Can one tell from the internal circuit on the I/O circuit diagram if e.g. Output 1 will float or will have 0V if the transistor Tr1 is non-conducting? 2. Let's assume that V_A rises due to a control error of the user up to 30V, but I still want **exactly** my 12V at V_In. Could I accomplish this task with a 12V Zener-Diode between V_A and V_In as shown in the circuit below? 3. Finally I want an additional protection for V_Out, which should be capped at **exactly** 5V (or 4.7V) independently of what happens before it. Again, I tried to insert a 4.7V Zener-Diode between R_NI and V_Out but could not get it to work. This is one of my drafts for both question 2 and 3: <!-- Begin schematic: In order to preserve an editable schematic, please don't edit this section directly. Click the "edit" link below the image in the preview instead. --> ![schematic](https://i.sstatic.net/0pP26.png) <!-- End schematic --> And here is the result for a DC Sweep of V_In between V_In = 0V and V_In = 30V. It seems to be OK: [![Voltage Protection Result][5]][5] [1]: https://i.sstatic.net/IKNXQ.png [2]: https://i.sstatic.net/SJ7vr.png [3]: https://i.sstatic.net/RE4Yf.png [4]: http://sine.ni.com/nips/cds/view/p/lang/en/nid/208809 [5]: https://i.sstatic.net/pdQFi.png