Conditional Voltage output
If speed of response is no great concern and only moderate accuracy is required, something like this would work:







simulate this circuit &ndash; Schematic created using CircuitLab

For a practical circuit you may wish to sink current rather than just source it to RL, low pass filtering may be required, you may wish to restrict the setting range of R5 with a few resistors (say 0.4 to 0.6V nominal), and you may need or want to add some hysteresis. Also a bypass cap on the power supply and more if it's an automotive 12V.