# Comparator Circuits

### Overview

A comparator circuit has two (analogue) inputs and one (digital) output. The voltages at the two inputs are compared and the output depends on which of the inputs is greater. The two inputs can have any value and are therefore analogue. The output is either on or off and is therefore digital. The comparator circuit is a very simple analogue to digital converter. Comparator circuits are usually based on Operational Amplifiers (Op-Amps). This lesson looks at Op-Amps and then considers comparator circuits. It is important to know about potential dividers and potentiometers before working through this lesson.

### Learning Objectives

• Understand the function of an Operational Amplifier
• Design and test sensing circuits using voltage dividers
• Describe and analyse the operation and use of voltage comparator ICs
• Use data sheets to design switching circuits comparators

### Lesson Content

Reading: Read about operational amplifiers. Learn the names of the two inputs and be able to recognise these on a circuit diagram. Understand what an Op-Amp actually does and appreciate that if the inputs are different by even a very small voltage, the output is saturated either fully positive or fully negative. Learn the circuit symbol for the Op-Amp.

Reading: Read the first three sections of the webpage about comparators covering the introduction, basic functionality and four examples. Make sure you fully understand the four examples before going any further. Read the summary at the end of the examples and update your notes as necessary.

Video (9 min): Watch the video about the basic operation of a comparator, using an LDR as an input device and using a potentiometer to set a threshold voltage. (Apologies for the poor sound quality).

Reading: Read about using LDRs and Thermistors with a comparator and understand the two examples. Consider how an Op-Amp can act as a current source or as a current sink and understand the examples given. Finally, read about and understand the range detector circuit which makes use of a pair of Op-Amps. Update your notes. Pay particular attention to the ideas of current sources and current sinks.

Video (6 min): Watch the video demonstrating current source and current sink for an Op-Amp circuit.

Reading: Finish by consider the eight examples of how a comparator circuit can be designed. Note that four of the circuits come ON when the temperature goes up and four of the circuits go OFF when the temperature goes up. In this example there are four different ways to design a comparator circuit to do the same task.

Video (5 min): Watch the white board example of how to design a comparator circuit to do a particular task, in this case light up an LED when it gets dark.

Exercise: Complete the exercises about comparator circuit design and then use the answers to check your understanding.

### Lesson Review

Review your learning by working through the presentations or notes which summarise the website content.

Presentation: Powerpoint download. A detailed explanation with each example explained and then a series of questions to check your understanding.

### Self Assessment

Complete either the questions (pdf download) OR the on-line quiz. They are the same questions.

### Self Evaluation

I can:

• Understand the basic operation of an operational amplifier
• Use the terms "Non-Inverting input" and "Inverting input" to describe the inputs to an Op-Amp used in a comparator circuit
• Understand the the output of a comparator circuit is either ON or OFF (i.e. it is digital)
• Appreciate that the voltage at the output when it is ON or OFF depends on the power supply voltage
• Recall that the output is ON when the Non-Inverting input voltage is greater than the inverting input voltage and vice versa
• Understand that a potential divider or potentiometer can provide a reference voltage and an input transducer as part of a potential divider can provide an input voltage
• Explain how comparator circuits are used to make input subsystems
• Understand that an Op-Amp can either source or sink current
• Appreciate that input devices, the comparator circuit and the output transducer can be arranged in different ways to achieve the same result
• Design a comparator circuit to meet a specification using the appropriate datasheets