Electronic – Level shifter to convert dc voltage

levellevel-shifting

Can anyone help me to design a circuit which outputs 0v dc when the input is 2.6v dc and 5v dc when the input is 5v dc?

Best Answer

After reviewing your earlier circuit and some of the discussion there (you should modify your question to refer directly to it and also extract the important details from the discussion there and re-post it in your question here), I'll propose this circuit:

schematic

simulate this circuit – Schematic created using CircuitLab

The above circuit uses two \$10\:\textrm{k}\Omega\$ pull-up resistors for \$V_{OUT}\$. This can be changed if you need a lower impedance output when high (with some implications for the other resistor values.) I didn't gather from you a specific output impedance so I just used those.

The circuit uses \$R_6\$ and \$R_7\$ to inject some current into \$Q_1\$'s base node. Because the circuit includes carefully designed hysteresis, the output will be held low until both inputs transition to \$+5\:\textrm{V}\$. Then it will transition high. Once high, though, the output will stay high until both inputs transition back to \$2.7\:\textrm{V}\$. (The hysteresis is substantial so it should be relatively immune to noise.)

The behavior looks like this:

enter image description here

Here it is with added noise on the two inputs:

enter image description here

As I understand you, there are four LEDs indicating five states for your tank of water. With all four LEDs off, the water in the tank is below the threshold where you then want a motor turned on to fill the tank. With all four LEDs on, the water in the tank is above the threshold where you then want the motor turned off (to stop filling the tank.)

When an LED is on, the voltage on one side of the LED (relative to ground, I'm assuming) is \$2.7\:\textrm{V}\$ (which makes sense, since the LED will drop a certain voltage not unusually in that range.) When the LED is off, the voltage across it is \$5\:\textrm{V}\$ (which also makes sense, if a low-side switching circuit isn't allowing much LED current.)

I think you are then suggesting using the voltage present one two nodes, one node from one side of the lowest-level indicating LED and one node from the highest-level indicating LED as a means to signal when to operate your motor.

I see the table like this:

$$ \begin{array}{r|lccc|l} \textrm{State} & \textrm{LED}_{low} & \textrm{LED}_{low-mid} & \textrm{LED}_{high-mid} & \textrm{LED}_{high} & \textrm{Action}\\ \hline \textrm{empty} & 5.0 & 5.0 & 5.0 & 5.0 & \textrm{turn motor ON}\\ \textrm{filling} & 2.7 & 5.0 & 5.0 & 5.0 \\ \textrm{filling} & 2.7 & 2.7 & 5.0 & 5.0 \\ \textrm{filling} & 2.7 & 2.7 & 2.7 & 5.0 \\ \textrm{full} & 2.7 & 2.7 & 2.7 & 2.7 &\textrm{turn motor OFF}\\ \textrm{draining} & 2.7 & 2.7 & 2.7 & 5.0 \\ \textrm{draining} & 2.7 & 2.7 & 5.0 & 5.0 \\ \textrm{draining} & 2.7 & 5.0 & 5.0 & 5.0 \\ \textrm{empty} & 5.0 & 5.0 & 5.0 & 5.0 & \textrm{turn motor ON}\\ \textrm{...} \end{array} $$

The very high input impedance of the given circuit should not cause any trouble for your LED displays or the circuits driving them. Use the first and last LED columns shown above as your two nodes for the circuit. It will produce a LOW output when the motor should be OFF and will produce a HIGH when the motor should be ON. Couldn't be simpler.

The output impedance might matter. But it is trivial to reduce the output impedance with a very simple added stage, if you need it.

The circuit is resistant to noise, uses parts that are available anywhere in the world where electronic parts are available, and the parts are widely supplied, too. And they cost next to nothing. Nothing boutique here. Not even close.