I built a comparator (LM393) with a voltage reference to 3.8V at the inverting input and the voltage of the battery on the noninverting input. The circuit has its own power supply (9V battery). Grounds are connected.
The comparator works fine, but when I connect it to the gate of the mosfet, its output voltage drops from around 9V to just 1V or so.
Also when I disconected the power from the Drain, the voltage appeared again.
I am using a pullup resistor on the output of the comparator (10k, tried 1k and it was the same). I also tried to put the load (5V 5W resistor) on the Drain or on the source, both worked the same. The mosfet can be opened, but the voltage on the non inverting input must be around 6V instead of the 3.8 and higher. And when I apply the higher voltage, at some point the mosfet opens and the voltage on the non inverting input drops to that 3.9V. The mosfet is IRLZ44N.