You are on page 1of 10

Voltage Comparator Information And Circuits

This page provides basic information about voltage comparator integrated circuits and is to act as reference material for other circuits. The circuits shown are based on the LM339 Quad Voltage Comparator chip or the LM393 Dual Voltage Comparator chip. These devices are functionall identical for the purposes of the following circuits. The LM3!! Voltage Comparator can be used for these applications as well and also has a number of uni"ue features.

LM339 Data sheet - National Semiconductor ( pdf!

LM393 Data sheet - National Semiconductor ( pdf!

LM3"" Data sheet - National Semiconductor ( pdf!

#he Comparator $%ui&alent Circuit schematic

#n integrated circuit $Voltage Comparator$ is essentiall an %perational #mplifier& 'uch as the LM3() or LM3*+& with two ,-, transistors added to the output of each amplifier. ./efer to the above schematic.0 This arrangement produces an $%pen Collector$ output for each of the four comparators in an LM339 chip. 1ach oputput can sin2 up to *3Ma and can withstand voltages of up to (3 Volts. These comparators can operate from a single or dual power suppl of up to 3* volts ma4imum. The output is switched %, or %55 depending on the relative voltages at the -L6' and M7,6' inputs of the comparator& see the rules below. The inputs are "uite sensitive and a difference of onl a few millivolts between the two will cause the output to turn on or off. 'asic Comparator (peration The following drawing show the two simplest configurations for voltage comparators. The diagrams below the circuits give the output results in a graphical form. 5or these circuits the /151/1,C1 voltage is fi4ed at one8half of the suppl voltage while the 7,-6T voltage is variable from 9ero to the suppl voltage. 7n theor the /151/1,C1 and 7,-6T voltages can be an where between 9ero and the suppl voltage but there are limitations on the actual range depending on the particular device used.

'asic Comparator (peration Input Vs (utput )esults !. Current :7LL flow through the open collector when the voltage at the -L6' input is lower than the voltage at the M7,6' input. *. Current :7LL ,%T flow through the open collector when the voltage at the -L6' input is higher than the voltage at the M7,6' input.

Input Vs (utput )esults

Input (ffset Voltage Voltage comparators are not perfect devices and in some instances ma suffer from the effects of a parameter 2nown as the 7nput %ffset Voltage. This problem normall occurs when the 7nput voltage changes ver slowl . The 7nput %ffset Voltage for man comparators is onl a few millivolts and in most cases can be ignored. The net result of the 7nput %ffset Voltage is that the output transistor does not full turn on or off when the input voltage is close to the reference voltage. The following diagram attempts to illustrate the effect of the input offset voltage with a slowl changing input voltage. This effect increases as the output transistor current increases so 2eeping the value of /L high will help reduce the problem.

$ffect (f Input (ffset Voltage

Input *+ster+sis The effects of the input offset voltage can be countered b adding h ster sis to the circuit. This causes the reference voltage to change when the comparators output goes high or low. The effect is that as the input voltage slowl changes the reference voltage will "uic2l change in the opposite direction.

Input *+ster+sis

Voltage ,indo- Detector Circuit The Voltage :indow Detector Circuit can be used to determine if a voltage is within a certain range. Two comparators are needed with each measuring a particular voltage limit. Comparators with %pen Collector outputs such as the LM339 or LM393 must be configured so the both outouts are ;7<; when the voltage is within the desired limits. The LM3!! comparator can have other output arangements as it has both an open collector and open emitter on the output transistor.

,indo- Comparator

Simple Comparator Circuits The following diagrams are of some basic comparator circuits. Most have a Cadmium 'ulfide photocell input but could =ust as easil use a phototransistor or a voltage signal from another circuit as an input. The resistance values are not critical but should be used as a guide. 7n most comparator circuits the ratio of the resistances is more important than their actual values.

.hotocell Circuits Schematic 7f higher current loads are to be driven a -,- transistor can be added to the comparators output this will allow loads of up to 333Ma. to be controlled.

)ela+ Dri&er (utput Schematic 'hort timing functions such as a pulsed outputs or time dela s can also be created with one or two comparator sections.

Comparator #imer Dela+ Schematic " ,otice that the second comparator section in the time dela circuit shares the same reference voltage input as the first. 7n most cases an number of comparators can have the same voltage source at one input& this can ma2e circuits much less complicated. Two more Dela circuits.

Comparator #imer Dela+ Schematic / Comparators can be made to perform a basic memor function b wiring them as a >'1T ? /1'1T> t pe of 5L7-?5L%-. This t pe of circuit can be used in unplugable wal2 around throttles to remember the direction of the train when the controller is disconnected. 7n the ne4t diagram the comparator will remember which switch was pushed last. 7f the >'1T> button is pushed the L1D will be on& the >/1'1T> button will turn the L1D off. # higher current version is also shown.

Comparator 0LI.10L(. Schematic ;ow the 5lip 5lop wor2s. # ver basic description. !. :hen the output of the comparator is off the voltage at the -L6' input will be the same as the suppl voltage. :ith the -L6' input voltage higher than the M7,6' input voltage the output will remain off. *. :hen the '1T button is pushed the voltage at the -L6' input will go to 9ero and the output will turn on. 3. :hen the '1T button is release the voltage at the -L6' input will rise to !?* of the suppl voltage and the output will remain turned on because the voltage at the -L6' input is remains below the voltage at the M7,6' input. +. :hen the /1'1T button is pressed voltage at the M7,6' input will go to 9ero from its normal level of 3?+ of the suppl voltage. The output will turn off because the voltage at the M7,6' input is below the voltage at the -L6' input. :hen the output turns off the voltage at the -L6' input will rise to the suppl voltage level. (. :hen the /1'1T button is released the voltage at the M7,6' input will rise to 3?+ of the suppl voltage. The -L6' input voltage will sta above the voltage at the M7,6' input and the output will sta turned off.

(pen Collector (utput #ransistor @ecause the output transistor of the comparator has an open collector the suppl and load voltages do not have to be the same. This means that the comparator could use a !* Volt power suppl while the load could be a *+ Volt rela or ( Volt L1D circuit. The following three diagrams are some e4amples of Dual voltage circuits. 7n the first two the voltage at the output of the comparators could even be full wave direct current.

Dual Voltage (utput Schematic

Dual Voltage )ela+ Dri&er (utput Schematic

Dual Voltage 0LI.10L(. Schematic

Some $2tra Circuits

Light Acti&ated )ela+ ,ith 3 Second )elease Dela+