I have designed the following circuit to interface a 12-20V signal to a microcontroller running on 3.3 volts. The signal is either 20V or open circuit.
I want the circuit to be as resilient as possible. It should be able to handle EMI and ESD.
- R1 is to limit the current and bias the transistor.
- C1 is to implement a low pass filter.
- R2 is used to pull down the transistor base and discharge the capacitor C1, the 20V input is either 20V or open circuit.
- D1 is used to protect the transistor from negative voltage at the base.
- R3 is to pull up microcontroller pin.
Any comments and improvements upon this circuit are welcomed.
Side question: Whats the maximum positive voltage this transistor can tolerate. The datasheet states peak base current to be 100mA. If base is maintained at 0.7 volts, then input can be as much as 1000 volts (10k ohm * 100mA). But if input is 1000 Volts the potential divider makes voltage the base at 500 volts. And the maximum Vcb according to datasheet is 60volts.