DC Voltage Range Controller

voltage

I need to make a circuit that has a variant input between 0 and 9V.
It starts with 0V then once it reaches 9V a switch closes and if voltage drops back and reaches 5V the switch opens up and stays open until the voltage reaches 9V again.
So basically what's needed is to turn off a switch at a specific voltage (5V) and turn it On if and only if it reaches another voltage (9V)

Any idea how can this be done?
Maybe using Mosfets and Relays Since both have voltage controlled switches. But I can't seem to find a solution for this.

Regards,

Best Answer

Something like this:

schematic

simulate this circuit – Schematic created using CircuitLab

For a real circuit you'd want a bypass capacitor across the supply and probably an RC low pass filter on the input.

The comparison voltage is 9.0V when the relay is off and 5.0V when the relay is on, so there is 4V of hysteresis. That is achieved by the R1/R1 divider and D1/R6 sets the hysteresis when the relay is on.

Q1 will drive a relay up to about 100mA coil current. D2 is a flyback diode to deal with the relay coil inductance.

R4 is to prevent output leakage from being amplified by Q1, R5 sets the base drive current when the 12V relay is on.