Are this schematics OK?

Thread Starter

ecka

Joined Feb 19, 2021
4
Hello, i have created simple schematics whics has digital and analog parts. I am most interested on analog part, mostly on transistors Q1 and Q2.
So how everything should work:
1. Signal comes to connector J2 from the sensor. Sensors can be three different types. These types mainly are different by sensors output type. So there are three different output versions: npn (open collector), pnp (open collector) and push-pull output. I need to accomodate my circuit to all three types of the sensors.
2. Sensors are digital, they generate square wave at the output. Sensors have three wires: +, - and output.
3. To make my circuit work with all three types of sensors jumper JP1 will be used which will allow to the user to setup the schematics according to the type of sensor used. JP1 jumper will have two positions - for npn and pnp sensors. I suppose that sensor with push-pull output must work when JP1 is set to any of two positions.
4. Sensor voltage is 12V, but chips U1 and U2 inputs are designed for 3.3V input so zener D1 is used to change 12V voltage to 3.3V.
5. Despite of sensor type used chip U2 must get low level voltage (0V) in it's input when sensor produces 12V high level in it's output. Sensors have weak output so i am using transistors Q1 and Q2 to amplify signal.

I have tested this circuit with Proteus but i also want to hear your opinion about the schematics.
If JP1 will be set to pnp position, maybe i need to set protection diode to the Q2 collector?
Maybe the analog part of the schematics can be simplified?
schematics.jpg
 

AlbertHall

Joined Jun 4, 2014
11,309
Connect R1 to the 3.3V supply instead of 12V and then you do not need D1.
For the push-pull output, JP1 will select for active low input in the NPN position and active high input in the PNP position.
 

Thread Starter

ecka

Joined Feb 19, 2021
4
Connect R1 to the 3.3V supply instead of 12V and then you do not need D1.
For the push-pull output, JP1 will select for active low input in the NPN position and active high input in the PNP position.
OK, i agree with your statement #2. But for the first statement; if i will connect R1 to 3.3V rail then Q1 base can have 12V voltage and the collector - only 3.3V. Is this normal condition for Q1 working as a switch? Maybe Q1 will be damaged in this case?
 

Ylli

Joined Nov 13, 2015
1,051
Q1 base-emitter is a diode, and the base can not go any higher that about 0.7 volts. If you go to +3.3 instead of +12, you would also want to reduce the value of R1 to maintain the rise time, perhaps 680 ohm. Then of course, get rid of D1.
 
Top