
Above is my circuit it used the LM2903 op amp
https://www.mouser.com/datasheet/2/389/cd00000534-1795799.pdf
One half of the chip is grounded and not used. The other is functioning as a comparator.
The circuit should function as a brake light switch. Such that when the BSE_IN voltage is greater than OUT7 the output of the comparator will turn off, and the P-Channel MOSFET will conduct, turning on the brake light.
OUT7 is a voltage coming from a linear regulator that I can adjust from a pot.
BSE is brake system encoder (not an actual encoder, it's a hall effect sensor with an analog output from 0-5V)
The trouble:
The problem I'm facing is when the comparator output goes low it only goes to 3V, it should go to 0V. When it goes high it goes to 5V, which is what I want.
I'm not sure why this is occurring, thank you for any help you can provide.