I deleted the old question and posted another one because I felt the question is now substantially different.

I have a potentiometer connected to a current source and I want the logic chip to cut off the current altogether when the voltage across the potentiometer reaches a certain value.

I am looking at CD74HC4052E as my chip of choice.

I have learned how the logic chip works by applying 0V to the inputs and confirmed that the output was 5V. Also, when either of the inputs went up, the output voltage was 0V.

I thought as I increase the potentiometer value from zero, the input voltage will go up and once it registers the high voltage threshold, the output would go from 5V to zero.

I think I see why the circuit would not work the way I want it to, the input voltage of the NAND is not really defined the way I would like it to.

I want to know if there's a way I can simply place the logic switch in my circuit in series, or if there's a simple circuit I can implement.

I want to come up with a circuit with a constant currents source where as you increase the potentiometer value, the voltage goes up and once it reaches the cutoff, the output would go to zero.

Any help would be appreciated.


simulate this circuit – Schematic created using CircuitLab

  • \$\begingroup\$ I think you want something involving an analog comparator, rather than a logic gate (or perhaps as well as a logic gate), but your requirements aren't very clear to me. The 74HC4052 is a dual four input analog switch - it is not clear how it relates to your problem. \$\endgroup\$ Sep 13, 2018 at 3:01
  • \$\begingroup\$ @Peter Bennett. I naively thought i could just use one of the four NAND gates built in the package. \$\endgroup\$
    – Blackwidow
    Sep 13, 2018 at 3:15
  • \$\begingroup\$ The logic gates shown on the '4052's fuctional diagram are not directly accessible from outside fof independent use. \$\endgroup\$ Sep 13, 2018 at 3:33
  • \$\begingroup\$ @Peter Bennett thank you. I swear when i pulled up the datasheet, it looked more like the schematic of DM7400. I must have looked at something else. Also, totally unaware of the ill defined nature of intermediate values between low and high \$\endgroup\$
    – Blackwidow
    Sep 13, 2018 at 3:59

1 Answer 1


What you are doing is analog state, and you shouldn't use logic gates for this type of problem.

The reason is that, logic chip are not designed to get an analog input, while it will switch at some point, it will be fairly random.

Better suited is an op-amp, which would be used as a comparator opamp comparator

If you want to make things better, you can also use a Schmitt Trigger that will avoid transiant states and oscillations.

  • \$\begingroup\$ I have zero experience with this so i apologize in advance. I looked at the datasheet and it says "it's a digitally controlled analog switch.". Does it mean the inputs shouldn't be the anlalog voltage input like what im doing for reliable operation? \$\endgroup\$
    – Blackwidow
    Sep 13, 2018 at 3:09
  • \$\begingroup\$ Also, you said the input values where the switch happens is fairly random. Does it mean that the digital inputs suited to this are the exact voltage values for turn on and off? \$\endgroup\$
    – Blackwidow
    Sep 13, 2018 at 3:30
  • 1
    \$\begingroup\$ The S0 and S1 inputs on pins 9, 10 and 6 are digital logic inputs that control the two analog switch sections. With a Vcc of 5 volts, a voltage above about 3 volts will be considered an logic High, and below about 2 volts will be a logic Low. An input between these voltages may be considered either High or Low - it is undefined. The Y and Z pins can carry analog signals. \$\endgroup\$ Sep 13, 2018 at 3:42

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

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