2
\$\begingroup\$

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?

\$\endgroup\$
5
  • \$\begingroup\$ 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) \$\endgroup\$
    – ammar.cma
    Feb 26, 2017 at 15:45
  • \$\begingroup\$ Can u guide me to design one. Mine is digital signal. So low current demand.. \$\endgroup\$ Feb 26, 2017 at 15:51
  • \$\begingroup\$ Just look at the datasheet for any comparator and follow their recommended application circuit. \$\endgroup\$
    – The Photon
    Feb 26, 2017 at 15:59
  • \$\begingroup\$ 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. \$\endgroup\$ Feb 26, 2017 at 16:38
  • \$\begingroup\$ @KrishnenduK you have already got an answer. Search for a comparator with a threshold of around 3.7V \$\endgroup\$ Feb 26, 2017 at 17:01

2 Answers 2

3
\$\begingroup\$

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.

\$\endgroup\$
8
  • \$\begingroup\$ 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. \$\endgroup\$ Feb 26, 2017 at 19:10
  • \$\begingroup\$ @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??? \$\endgroup\$
    – jonk
    Feb 26, 2017 at 20:50
  • \$\begingroup\$ @jonk you seem to have much time for that stuff.. \$\endgroup\$
    – user76844
    Feb 27, 2017 at 6:13
  • \$\begingroup\$ 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.. \$\endgroup\$ Feb 27, 2017 at 8:47
  • \$\begingroup\$ Sir.. Can you please help me with the design of this circuit? By the way it simulates perfectly.. Thanks,, \$\endgroup\$ Feb 27, 2017 at 17:21
2
\$\begingroup\$

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: Schematic

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.

\$\endgroup\$
7
  • \$\begingroup\$ 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 \$\endgroup\$ Feb 26, 2017 at 17:49
  • \$\begingroup\$ @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. \$\endgroup\$
    – jonk
    Feb 26, 2017 at 17:51
  • \$\begingroup\$ Please have a look at this thread.. electronics.stackexchange.com/questions/288907/… \$\endgroup\$ Feb 26, 2017 at 17:52
  • \$\begingroup\$ @KrishnenduK That's clearer, now. I'm surprised you didn't reference it earlier. \$\endgroup\$
    – jonk
    Feb 26, 2017 at 17:53
  • \$\begingroup\$ 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.. \$\endgroup\$ Feb 26, 2017 at 17:56

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.