# Is it possible to constrain a circuit's voltage supply to a specific voltage range?

I have a circuit which requires exactly 12v to work properly, with a maximum tolerance of ±0.5V. The circuit is arbitrary and one can think of it as a theoretical question, but let's say that it usually takes between 0.1A and 1A (such as some Arduino + Servo Motor projects, for example).

In this sense, is it possible to make a circuit that only activates when the voltage is very close to 12v?

To be more specific, this circuit has some conditions:

• It should not produce significant current below 11v (or, if possible, no current at all). The circuit should be activated only close to 12v;
• It should not burn the entire device when the tension is above 13v. Above this voltage, the device must just turn off or somehow be prevented from being enabled until it goes back to 12v again. To be reasonable, it's not supposed to prevent voltages as high as 127v, but at least around up to 20v or so;
• Only one power supply must be provided, so the voltage limit/control/pass schematics must depend on that supply only. No cheating with external wall adapters or attached 9v batteries :)

In summary, it would be a simple circuit that prevents both under-voltage and over-voltage from the power supply by inhibiting the current to pass through the remaining circuit, keeping it active only when near 12v.

The chart below shows an example of how the circuit would be active (e.g., emitting some leds, driving some motors, etc) at that specific voltage range.

(Sorry if I put any strange terms, I'm from the biological sciences and just happened to grow an incessant curiosity for electronics)

Examples with integrated circuits are always welcome. But if possible, nothing too fancy, please. Unfortunately, there's no Texas Instruments in my country and the access to uncommon electronic parts is somewhat limited. That said, any reference would be acceptable as long as it helps to make this circuit possible.

• Most of the time you would use a voltage regulator, which is a device that takes in a range of voltages and returns exactly 12v (or some other set voltage). Then (for a range of voltages) your circuit always gets the desired 12v. Often these incorporate undervoltage detection as well, which cuts power if the voltage goes too low. Aug 5, 2021 at 0:35
• As a general thought to your general (science) question: Even if there were readily available ICs that produced 12 V given any input voltage source, it would only have an "initial accuracy" spec and that spec may or may not provide you with guarantees beyond the initial accuracy expectations. It will drift over time and temperature and load variations and input source variations and probably the phase of the moon. Accuracy is a very difficult thing to gain and then even harder to retain. Precision is easier. So the answer is between yes and no and depends on what level of tolerance you grant.
– jonk
Aug 5, 2021 at 0:42
• Your activeness parameter is a strange one to electronics geeks. It makes sense as supply voltage rises from a low voltage up to +12V, and can be achieved easily. But from +12V on up causes me some confusion. It suggests a requirement of negative resistance, where a rising input voltage causes less current to flow. I think negative resistance is not what you want! An overvoltage cutoff is possible once a trip point is exceeded (say +12.6V), requiring an intervention by a user to reset it. Aug 5, 2021 at 1:46
• "... exactly 12 V ... ±0.5 V" is a bit of a contradiction. Remove "exactly". Aug 5, 2021 at 9:29
• @user1850479 Voltage regulators don't turn off the circuit under a upper voltage threshold, only below minimum voltage thresholds. Well, at least not the ones that I know. Is there any IC with such "upper threshold"? Aug 6, 2021 at 14:55

@user4574's solution is wonderfully simple, but I was inspired by his suggestion of a window comparator using actual comparators. Here's my stab at it:

It uses the same technique of using a P-channel MOSFET (Q2) to switch the ouput on or off, but LM393 comparators are responsible for detecting an input voltage outside the acceptable thresholds.

Since each comparator has an open collector output, they need a pull-up resistor, but their outputs can be connected together, such that if either comparator pulls its output low, the combined output is also low, in a "wire-AND" type arrangement. Only when both are high, can the combined output rise, under the control of R10 and R21.

I want system to disable output if either comparator detects an "out-of-bounds" condition, and to be able to take advantage of the comparator's open-collector "wire-AND" action, I need to configure them such that their outputs are low when they detect such a condition.

In other words, only when they both have "high" outputs should Q2 be switched on. Unfortunately that's the exact opposite of the signal required for Q2's gate, so I include a single NPN transistor (Q1) to invert the comparators' output, and I drive Q2's gate with that instead.

Over on the left side, I get a nice steady 9.1V from the junction of R1 and D1 (at least when the input voltage is over 9.1V), and that's my reference for the two comparators.

R2 and R3 provide me with a voltage which is 78% of the input, and R4 and R5 provide 73%. They are chosen so that when the input is 12.5V, the voltage being compared by CMP1 is around 9V (close to the reference from D1), and when the input is 11.5V, CMP2's input is similarly about 9V.

So CMP1 pulls the output low to indicate an over-voltage condition (Vin > 12.5V), and CMP2 pulls the output low when there's an under-voltage condition (Vin < 11.5V). Actually, these aren't exact values, because I'm constrained by E12 values for the resistors, but they are within 0.1V or so.

Lastly, I've included a small amount of positive feedback for each comparator, (via R6, R7, R8 and R9) to implement some hysteresis. This will help prevent the circuit from oscillating if ever Vin "hovers" around either threshold. This also prevents the circuit from getting confused if the sudden load that appears when Q2 switches on causes Vin to drop slightly.

I'm going to add a disclaimer here, that I've simulated this, and it behaves as I described, but I have not tested it in real life, with real loads and real voltage sources.

• Another disclaimer: This is complicated, and overkill, and I'm certain it can be simplified. It's just fun to design, and mess about with. Aug 5, 2021 at 9:23
• Your responses (yours and @user4574) were both amazing! The @user4574's solution seems simpler and requires less circuits, while yours seems more robust and has given more effort. I'm still deciding which one is the best solution, so I'll test your circuits before to give you some feedback. Aug 6, 2021 at 15:05

What you are describing is called a window comparator. A precision window comparator can be made with a voltage reference and a couple of comparator ICs. But its also possible to make one with four resistors and two bipolar transistors.

simulate this circuit – Schematic created using CircuitLab

The circuit works as follows.

If the input voltage gets above VBE_ON * (1 + R1/R2) then Q1 turns on and the load is powered by M1. If we let VBE_ON = 0.6V, R1=110K, and R2=6K ohms, then the turn on threshold is about 11.6V. Below 11.6V Q1 will be off and the load will have no current.

If the input voltage gets above VBE_ON * (1 + R3/R4) then Q2 turns on, which will turn off Q1, and the load will turn off. If we let VBE_ON = 0.6V, R3=120K, R4=6K ohms, then the turn off threshold is about 12.6V.

To summarize, the load is on if the input voltage is between 11.6V and 12.6V. Otherwise its off.

The VBE_ON thresholds of the transistors are not necessarily exactly 0.6V and can change a little with temperature. So you may need to play with the resistor values until you get the exact thresholds you want.

Have you looked at voltage supervisor ICs. You can use a P-channel MOSFET to switch the power on only when in band and current is OK. The MC34161 comes to mind as the controller. There are many others that can do the job. The primary regulator etc will have to be sized to support your load which you did not state. There are commercial units that could do what you want.

• Do you have some circuit as an example? Anyway, the MC34161 seems to support a good range of power supply voltage (2V to 40V), so it'd be a good canditate if it was widely available outside US. Unfortunately, this IC is somewhat expensive here (about $11 converted from my country's currency). Aug 6, 2021 at 15:19 • I found them in several places for under$2.00 USD and under $1.00 for a dozen. Search online, they should be readily available. – Gil Aug 6, 2021 at 18:09 • Yes,$1.00 USD for the IC + \$10.00 shipping costs and importing taxes. Buying from overseas is infamously expensive here in my country, so I feel a bit jealous of you. :P Aug 6, 2021 at 21:56