Comments on How to change the polarity of an input using a single switch?
Post
How to change the polarity of an input using a single switch?
I have an mcu pin and I want to sense a voltage up to 24V to 36V.
I want to connect some outputs on the board I'm designing and I don't know whether those outputs will provide a voltage or will be open collector outputs.
Also, some outputs will be just relays and the other terminal will be at GND or just at the main voltage (supply rail). For this reason, I want to provide some selections like switches or jumpers to give the ability in the circuit to be modified.
Example below:
To be able to connect an mcu to a high voltage I'm using a simple level translator.
This can be done with a simple NPN.
This circuit gives me the following output:
LOW: For any voltage above 8.2V
HIGH: When the line is floating or when the line is grounded.
I want to add a switch or a jumper to modify this circuit on the fly and change its behaviour as following:
LOW: When the line is grounded.
HIGH: For any voltage above 8.2V or when the line is floating.
Note: voltage below 8.2V is considered as "input is floating".
This is the truth table.
For simplicity we will asume that voltage means +24V DC
Selection | Voltage | Floating | Ground |
---|---|---|---|
Option 1 | LOW | HIGH | HIGH |
Option 2 | HIGH | HIGH | LOW |
1 comment thread