Continue to Site

Welcome to our site!

Electro Tech is an online community (with over 170,000 members) who enjoy talking about and building electronic circuits, projects and gadgets. To participate you need to register. Registration is free. Click here to register now.

  • Welcome to our site! Electro Tech is an online community (with over 170,000 members) who enjoy talking about and building electronic circuits, projects and gadgets. To participate you need to register. Registration is free. Click here to register now.

Comparator usage..

Status
Not open for further replies.

saiello

New Member
Hi All,
I've got a small project on the go and need some advice. It concerns the use of voltage comparators, in particular the LM311 and LM393. I've got a breadboarded ( plywood and cup screws!! ) test setup and I've managed to get both comparators to work including some hysteresis, but I am still having a problem in understanding why they won't switch around the reference voltage. The comparators are set up with single supply, +5V from a 7805 regulator and 0V ground as they are designed for. The reference voltage is to +ve input at 2.5V with about 0.1V hysteresis. I vary the input voltage to the -ve input using a cermet potentiometer. I expected the comparators to switch around 2.5V (allowing for hysteresis), but I am finding that they will only switch a full 0.5V below this value at around 2V. I've scoured the internet, tried all the example comparator circuits I can find but no joy. The datasheets are no help either. What am I doing wrong? My project involves use of more complicated IC's for which I can get working no problem, it's just that these pesky comparators won't play ball! Any help much appreciated, before I go completely nuts!

Thanks,
Salvatore
 
saiello said:
Hi All,
I've got a small project on the go and need some advice. It concerns the use of voltage comparators, in particular the LM311 and LM393. I've got a breadboarded ( plywood and cup screws!! ) test setup and I've managed to get both comparators to work including some hysteresis, but I am still having a problem in understanding why they won't switch around the reference voltage. The comparators are set up with single supply, +5V from a 7805 regulator and 0V ground as they are designed for. The reference voltage is to +ve input at 2.5V with about 0.1V hysteresis. I vary the input voltage to the -ve input using a cermet potentiometer. I expected the comparators to switch around 2.5V (allowing for hysteresis), but I am finding that they will only switch a full 0.5V below this value at around 2V. I've scoured the internet, tried all the example comparator circuits I can find but no joy. The datasheets are no help either. What am I doing wrong? My project involves use of more complicated IC's for which I can get working no problem, it's just that these pesky comparators won't play ball! Any help much appreciated, before I go completely nuts!

Thanks,
Salvatore
Common mode range. Check the datasheet for this parameter and note that the comparator will not function if the inputs are not within the common mode range. Unlike logic they do not work from Ground to Vcc, but Ground to (Vcc - 2.5) which is right about your threshold.
 
The input common mode range for the LM393 is 0V to +3.5V minimum with a 5V supply.
I think the output resistor value might be too high for the value of the hysteresis resistor, or the load forms a voltage divider with the output resistor.

The datasheet shows a circuit that works if the load is a high resistance:
 

Attachments

  • comparator.PNG
    comparator.PNG
    7.5 KB · Views: 243
Hi,
To keep things simple, I've reduced the circuit to not include hysteresis. I can't seem to find how to attach a schematic (sorry!), but the circuit is literally the LM393, +5V supply to the comparator and two pots, one 1Mohm for the -ve reference input and a 10K for the +ve input, all connected to ground. The output of the comparator has a 2K pull-up resistor. I've tabulated the results with varying reference voltages and corresponding input voltages that start to switch the comparator output to 'high' ( more or less +5V):

Ref -------> Input
0.5V-------> 0.55V
1.0V-------> 1.20V
1.5V-------> 1.85V
2.0V-------> 2.5V
2.5V-------> 3.10V

The point at which the input starts to switch the output seems to be proportional to the reference voltage, increasing as the reference voltage increases. The circuit is practically the same as the many examples on the internet but it just doesn't seem to behave in the way that they say, i.e. to switch around the reference voltage! The LM393 datasheet makes reference to common mode voltage but the LM311 datasheet does not. Even so I don't see how this explains the results in the lower end ( <=+2V reference ) of the tabulated results.
Any help on this one much appreciated!

Thanks,
Salvatore.
 
Why post exactly the same things in two sites' forums?

Use a pot with a much lower value instead of 1M that is loaded down (actually it is loaded up) by the input bias current, and loaded down by your voltmeter.
 
Try to post the schematic. Click on "Manage Attachments" and upload the file.
Is there a feed-back resistor? and a load resistor?
 
Hi Eng1, I've attached a schematic. The 1M pot has been replaced with a 1K pot as suggested by others, but I still get the same results. I've replaced the 393 with another in case it's faulty in some way, but again no joy.. :confused:

Cheers,
Salvatore.
 

Attachments

  • Comparator.GIF
    Comparator.GIF
    3.8 KB · Views: 233
Now you are on 3 sites!
Add a 100uF supply bypass capacitor across the supply.
 
Status
Not open for further replies.

Latest threads

New Articles From Microcontroller Tips

Back
Top