# Turning switch state at two different voltages

I have a requirement to change the transistor/MOSFET switch state at two different voltages.

Below is a small graphical representation, 3.3 V (red) to 4.5 V (green).

The switch should be open when the voltage is between red line and green.

Once the voltage reaches green the switch should be closed as long as it has not reached the red line level. Once the voltage had reached the red line the switch should immediately open and should not close unless it has gone back to the green level.

I was thinking of a Schmitt trigger with a transistor but could not get it. Voltage can vary between 3.3 V (red) and 4.5 V (green).

Edit:

I managed to get what is needed with the following circuit, it is powered 4 V power supply.

Following is the schematic:

I could not get the upper and lower threshold voltages. Currently I am getting 1.5 V to 1.8 V as threshold.

Any suggestion for change in resistor values to shift the threshold to desired value between 3.3v and 3.9v (upper)?

• What do you mean by "could not get it"? Commented Sep 13, 2017 at 5:56
• If you want to do a Schmitt trigger with transistors only, it's the same circuit as that of a 2-Transistor flip-flop. The magic is in a shared emitter resistor. Commented Sep 13, 2017 at 9:53
• With transistor I am not getting a sharp edges. Connected led to test but the led goes dim to bright not completely off. Commented Sep 13, 2017 at 12:25

The usual "jellybean" solution to these kinds of questions uses a comparator configured with positive feedback, to form a schmitt trigger with very clearly defined switching thresholds:

simulate this circuit – Schematic created using CircuitLab

That will produce a response something like:

Calculation of the resistances needed to achieve your specific thresholds is not difficult, but also not trivial. The values I show here are very close to your 3.3V and 4.5V thresholds.

Given loose tolerances and restricted selection of E12 (or even E24) resistor values, you'll probably require some way of fine tuning the thresholds. The gap between lower and upper threshold potentials (hysteresis) is controlled by the ratio of R3 and R5. The potential about which hysteresis is centered is controlled by the ratio of R2 and R1.

You may use potentiometers to vary these ratios:

simulate this circuit