Detecting Voltage Threshold (~14V) using Comparator (LM393)

Thread Starter

muhammadanas25

Joined Jun 21, 2023
21
Hi everyone,

I want to design a simple circuit to detect voltage levels in a vehicle power line and generate a digital ON/OFF signal based on a threshold.

Requirement:
  • Input voltage range: ~12V to 14.5V
  • Condition:
    • Above ~14V → Output HIGH (Ignition ON)
    • Below ~14V → Output LOW (Ignition OFF)
What I Want to Do:
  • Use a comparator like LM393
  • Power the circuit directly from the same 12–14V line
  • Use a voltage divider to scale input
  • Generate a clean digital output
My Questions:
  1. What is the best way to set an accurate threshold around 14V using LM393?
  2. How should I design the voltage divider for both input and reference?
  3. Do I need hysteresis to avoid flickering due to voltage fluctuations?
  4. Is LM393 the best choice, or is there a better comparator for automotive use?
  5. Any protection components recommended for long-term reliability (noise, spikes, etc.)?
Goal:
  • Simple circuit
  • Reliable switching
  • Stable output (no flicker)
  • Works directly from vehicle supply
Would appreciate if someone can share a working circuit or recommended design approach
 

Ian0

Joined Aug 7, 2020
13,098
Hi everyone,

I want to design a simple circuit to detect voltage levels in a vehicle power line and generate a digital ON/OFF signal based on a threshold.

Requirement:
  • Input voltage range: ~12V to 14.5V
  • Condition:
    • Above ~14V → Output HIGH (Ignition ON)
    • Below ~14V → Output LOW (Ignition OFF)
What I Want to Do:
  • Use a comparator like LM393
  • Power the circuit directly from the same 12–14V line
  • Use a voltage divider to scale input
  • Generate a clean digital output
My Questions:
  1. What is the best way to set an accurate threshold around 14V using LM393?
  2. How should I design the voltage divider for both input and reference?
  3. Do I need hysteresis to avoid flickering due to voltage fluctuations?
  4. Is LM393 the best choice, or is there a better comparator for automotive use?
  5. Any protection components recommended for long-term reliability (noise, spikes, etc.)?
Goal:
  • Simple circuit
  • Reliable switching
  • Stable output (no flicker)
  • Works directly from vehicle supply
Would appreciate if someone can share a working circuit or recommended design approach
You need a reference such as LM4040-2.5, then select resistors to give 2.5V at 14V input.
This website is helpful:
http://sim.okawa-denshi.jp/en/teikokeisan.htm

Have you thought about using a TL431?

There is a huge choice of comparators, some with push-pull outputs, some with open-collector, some with built-in hysteresis, it depends a lot on what you want to do with the output. You might even find one with a built-in reference.
 

Thread Starter

muhammadanas25

Joined Jun 21, 2023
21
I want a circuit diagram that works as a voltage threshold switch.


The input voltage will be 12V to 14V (automotive supply). I want to set a threshold such that:


  • When the input voltage rises above 14V, the comparator output goes HIGH (around 12V/14V output level) to enable ignition.
  • When the input voltage falls below 13V, the comparator output goes LOW (0V) to disable ignition.

So the circuit should have hysteresis (13V OFF, 14V ON) to avoid unstable switching.


What components do I need to build this circuit (comparator IC, resistors, reference voltage, transistor driver, etc.), and what would be the correct circuit diagram for this application?
 

Ian0

Joined Aug 7, 2020
13,098
I want a circuit diagram that works as a voltage threshold switch.


The input voltage will be 12V to 14V (automotive supply). I want to set a threshold such that:


  • When the input voltage rises above 14V, the comparator output goes HIGH (around 12V/14V output level) to enable ignition.
  • When the input voltage falls below 13V, the comparator output goes LOW (0V) to disable ignition.

So the circuit should have hysteresis (13V OFF, 14V ON) to avoid unstable switching.


What components do I need to build this circuit (comparator IC, resistors, reference voltage, transistor driver, etc.), and what would be the correct circuit diagram for this application?
Look here:
http://sim.okawa-denshi.jp/en/compkeisan.htm
it will do most of it for you.
 

ericgibbs

Joined Jan 29, 2010
21,396
hi m25,
This is one option.
E

Added Note:
If you require a wider hysteresis, reduce the value of resistor R7.
Vsw is just to plot the desired 14V point/

EG 2067.jpg
 

Attachments

Last edited:

crutschow

Joined Mar 14, 2008
38,331
  • When the input voltage rises above 14V, the comparator output goes HIGH (around 12V/14V output level) to enable ignition.
  • When the input voltage falls below 13V, the comparator output goes LOW (0V) to disable ignition.
Below is a simple circuit to do that, using the common TL431 programmable voltage reference as a combined comparator/reference, controlling a PNP transistor for the output:
The TL431 turns on and the output goes high when the Ref voltage reaches 2.5V from the voltage divider R2 and R3.
R4 provides 1V of positive-feedback hysteresis for the trip-point.

1774626582751.png
 
Last edited:

Thread Starter

muhammadanas25

Joined Jun 21, 2023
21
hi m25,
This is one option.
E

Added Note:
If you require a wider hysteresis, reduce the value of resistor R7.
Vsw is just to plot the desired 14V point/

View attachment 365191


This one is really a good circuit but this need to be turn on output when above 14 volts and when below 14 volts it will off the output can you help me or guide me how can i tweek it for 13 volts if above 13 volts output will on and below 13 volts output will off just need little help i really appreciate your work
 

Thread Starter

muhammadanas25

Joined Jun 21, 2023
21
Hi i have a query related to this circuit i have a smart alternator which cutts off the voltages to below as i said i set the reference voltage to 13 volts like if voltage above 13 volts it turn on the output and if below 13 it turn off the output voltage now in smart alternator when the vehicle is running it turn off the alternator so i get fake ignition off on my tracker ignition input as i said i connect my tracker with my vehicle using obd2 port in which i just use two wires car main volts and ground so how can i modify this circuit for this smart alternator or can you suggest any circuit for this which is useful for this my main goal is i just want to give ignition to my tracker as obd2 port dont have this ignition pin please suggest
 

MisterBill2

Joined Jan 23, 2018
27,198
I was going to suggest looking at the National Semiconductor applications manual, but others have provided a great deal of more current information. An alternative scheme to achieve a similar goal, but that does not require any stable reference, is to use the noise content of the system voltage to sense that the engine is running.
I have seen that circuit in the "SCHEMATICS FOR FREE"site.
It uses twosections of an LM324 as noise amplifiers, followed by one section of a rectifier/buffer section , using the fourth amplifer as a comparator. Probably simpler and more stable than the voltage monitor scheme.
 

Thread Starter

muhammadanas25

Joined Jun 21, 2023
21
I was going to suggest looking at the National Semiconductor applications manual, but others have provided a great deal of more current information. An alternative scheme to achieve a similar goal, but that does not require any stable reference, is to use the noise content of the system voltage to sense that the engine is running.
I have seen that circuit in the "SCHEMATICS FOR FREE"site.
It uses twosections of an LM324 as noise amplifiers, followed by one section of a rectifier/buffer section , using the fourth amplifer as a comparator. Probably simpler and more stable than the voltage monitor scheme.


Can you provide any helpful URL link for this as a reference
 

B-JoJo-S

Joined Jan 3, 2026
212
I want to set a threshold such that:
  • When the input voltage rises above 14V, the comparator output goes HIGH (around 12V/14V output level) to enable ignition.
  • When the input voltage falls below 13V, the comparator output goes LOW (0V) to disable ignition.

So the circuit should have hysteresis (13V OFF, 14V ON) to avoid unstable switching.
The battery voltage when the car isn’t running ranges from 12.0 to 12.7 volts, depending on its health. If your alternator doesn’t activate until it detects 14 volts, your battery won’t be charged.
i have a smart alternator which cutts off the voltages to below as i said i set the reference voltage to 13 volts like if voltage above 13 volts it turn on the output and if below 13 it turn off the output voltage
If the voltage drops below - as you mentioned - 13V and the alternator shuts off, how do you restart it? Since all electronics run on the car’s electrical system, the battery voltage (Wet Cell Lead Acid) should be at or above 13.6V when running. In a proper system, the battery voltage may reach 15 volts (uncommon) when the engine starts. After sufficient battery recharge, the voltage should hover around 13.6 to 13.8V.

Also, when starting the car, the battery voltage can drop to the 10-volt range (old battery). So, your plan might be reversed. You might want the alternator to shut off at 14 volts. However, if the weak battery requires a higher voltage, cutting it off at 14 volts won’t charge the battery properly. Since all electronics drain the battery, cutting the alternator off at 13 volts will cause a quick drop in battery voltage, depending on how many devices are running. Headlights, AC, radio, and other auto electrics will significantly reduce the voltage.

If you propose cutting the alternator off at 13 volts, the battery voltage will drop quickly, causing the alternator to restart and charge and stop repeatedly.

Is this what you want? What kind of battery are we discussing? What are the conditions and reasons for shutting off the alternator? To save fuel? You can add a switch to the carburetor or throttle body. When the pedal is pressed, for instance, 65% or greater, the alternator shuts off to facilitate more acceleration. Then, when you release the gas, the alternator begins charging the battery again. In some cases, you can use a vacuum switch. When you step on the pedal, the manifold vacuum drops. Depending on how hard you press the gas, you set the switch to activate at a given vacuum. That way, you can momentarily turn off the alternator and free up extra horsepower.
 
Last edited:

MisterBill2

Joined Jan 23, 2018
27,198
Consider that the TS did not provide any hintabout the application until post #11 ! Battery charging is more complex than just voltage. The current at a voltage affects how much charging is needed, and how much charging is delivered.
 
Top