# Level shifter to convert dc voltage

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?

• How much current do you need at the output? If it is digital signal/low current demand; Look at op-amp as a comparator(with Vref>=2.7 V) Commented Feb 26, 2017 at 15:45
• Can u guide me to design one. Mine is digital signal. So low current demand.. Commented Feb 26, 2017 at 15:51
• Just look at the datasheet for any comparator and follow their recommended application circuit. Commented Feb 26, 2017 at 15:59
• My question is vague. Actually my circuit has 2 nodes where the voltages can be either 2.7v dc or 5v dc. I need a single circuit to convert 2.7v to 0v and 5V to 5V to use with digital ic. Commented Feb 26, 2017 at 16:38
• @KrishnenduK you have already got an answer. Search for a comparator with a threshold of around 3.7V Commented Feb 26, 2017 at 17:01

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:

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:

Here it is with added noise on the two inputs:

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.

• Very very thanks for the reply.. My circuit is a water level controller. It has 4 sensors. One at the bottom of the tank, one at quarter position, one at middle and one at the top. Correspondingly there are 4 LEDs to indicate the level of water. My aim is to swich on a motor when all LEDs are off (tank is empty) and switch motor off when all LEDS are on (tank is full). The cathode pin of LED shows 2.7v when on and 5v when off in simulation. Commented Feb 26, 2017 at 19:10
• @KrishnenduK I don't understand the problem, then. The circuit I provided switches to $5\:\textrm{V}$ output (the motor should be activated) when both nodes (LED$_1$ and LED$_4$) have turned OFF (tank empty.) It switches to $0\:\textrm{V}$ (the motor should be deactivated) when both nodes (LED$_1$ and LED$_4$) have turned ON (tank full.) What more do you want???
– jonk
Commented Feb 26, 2017 at 20:50
• @jonk you seem to have much time for that stuff..
– user76844
Commented Feb 27, 2017 at 6:13
• Thanks sir.. Thanks for your valuable time. I havent got enough time to simulate the circuit today.. I will simulate the circuit and let you know soon.. Commented Feb 27, 2017 at 8:47
• Sir.. Can you please help me with the design of this circuit? By the way it simulates perfectly.. Thanks,, Commented Feb 27, 2017 at 17:21

You can use operational amplifier like LM358 to make simple comparator. And voltage divider to get reference voltage.

Here's a schematic based on LM358 documentation:

You can get those parts anywhere. Connect your tested voltage to Vin. The two resistors on left side make voltage divider that converts 5V to 3V. And those 3V make voltage reference for LM358. When Vin > 3V then Vo will be equal to 5V (provided to powered LM358 with 5V) and when Vin < 3V then V0 will be 0V. So it should do the job.

• Actually my circuit has 2 nodes where the voltages can be either 2.7v dc or 5v dc. I need a single circuit to convert 2.7v to 0v and 5V to 5V to use with digital ic to perform some logic Commented Feb 26, 2017 at 17:49
• @KrishnenduK I recall seeing you write that before, but... do you mean that you need TWO circuits that do the same thing? Or do you mean that this isn't single-ended, but a differential of some kind? Your situation is not very clear. Please add more information.
– jonk
Commented Feb 26, 2017 at 17:51
• Please have a look at this thread.. electronics.stackexchange.com/questions/288907/… Commented Feb 26, 2017 at 17:52
• @KrishnenduK That's clearer, now. I'm surprised you didn't reference it earlier.
– jonk
Commented Feb 26, 2017 at 17:53
• Sorry.. I have researched on it several days now.. But havent got a good solution.. May be i am a noob in this. I just want to control the motor to fill the tank with the inputs from led terminals.. But its complex.. Commented Feb 26, 2017 at 17:56