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.

TTL Comparator Low Output

Status
Not open for further replies.
I have designed and prototyped a circuit to compare two pressures and send a TTL output when one pressure is bigger than half the other. But rather than the TTL output of 5V, I'm getting just 0.04V

Any ideas?
 

Attachments

  • Circuit_202.jpg
    Circuit_202.jpg
    43.2 KB · Views: 2,434
Looks like you need a pull-up resistor on the output of the last comparator, try a 2.2 K.

Also try swapping the inverting and non-inverting inputs to the last comparator, this should give you the opposite effect.

It also appears to me that your supply voltage of 24V is too high.

BTW what is the purpose of the 3 pole switch ?
 
3 pole switch

Basically I'm testing a pneumatic valve. I want to measure the response time for a valve exhausting from one port, to exhausting from another. Its said to switch when the exit pressure is half the inlet pressure, hence the voltage divider circuit.

The 3 pole switch is used to swap the inputs to the comparator. Once the valve is switched the port that had no pressure now has full pressure. Rather than swapping the air hoses (difficult to remove a hose than has 8 bar on it!) so your are going from zero pressure to full pressure as before, you just swap the contacts so that comparatpr will ouput when the pressure falls from full pressure to zero pressure.

Instead of several switches I'm using just one so that the boys in the lab don't have to think too much when they use it.

I know that an open collector comparator needs a pull up resistor but I didn't realise TTL ones needed one too
 
Supply voltage

The supply voltage is what the pressure-to-voltage converters require and the comparator is designed to operate at voltages up to 32V. I've tried changing the input voltage but it just lowers the voltage I measure (e.g. 18V supply = 0.03V output)
 
Ok, i understand the switching, but you will not get a TTL 5 volt output using a 24 or 18 volt power supply.

Im not sure if you already know but the output from a comparator is digital, The output is either the full positive supply rail or at ground potential. This is why you need a pull-up resistor, appart from the fact like you already said , the output is open collector.

Also the resistance of the lower resistor used in your voltage divider must be atleast 10X the resistance of the pull-up resistor to prevent it from loading the output.
 
What supply voltage would you suggest in order to get a 5V TTL? I'm new to this electronics malarky and presumed that as long as you supplied more than 5V to the comparator, when it when from 0 to 1 then the voltgae you would get would be equal to teh voltage you supplied.
 
What supply voltage would you suggest in order to get a 5V TTL?

Use a 5 volt power supply for the comparators and the 24 volt supply for the input .They must be separate of course but they must share a common ground connction.

Heres a link that explains how to use comparators and gives some application circuits.

**broken link removed**
 
You shouldn't need the second comparator. The first one has lots of gain. You do need a pullup on all LM393s, as they are open collector, as nettron1k said. You can (and probably should) use the 24v supply for the comparator supply voltage. If you use 5v for the LM393 supply, your sensor output will exceed the comparator's common mode range if it goes above about 3 volts.
You can get the TTL output level by returning your pullup resistor to +5v. If you don't have a 5v supply available, use a 78L05 or an LM317L programmed for 5 volts. If your load is high impedance, such as CMOS logic, you can use a simple voltage divider. From the LM393 output, connect 18k to +24v and 4.7k to GND. You can vary these values so long as you keep them in the ratio of 3.8:1.

What is the top section of the switch for?
 
Good points Ron, i'd just like to add that the circuit would work better if a bit of hysteresis were added. This can be done by connecting a resistor between the output and the non-inverting input (+). This will give the circuit a snap action to slowly rising inputs and will behave more like a digital output.
The link i provided goes into explaining that.
 
nettron1000 said:
Good points Ron, i'd just like to add that the circuit would work better if a bit of hysteresis were added. This can be done by connecting a resistor between the output and the non-inverting input (+). This will give the circuit a snap action to slowly rising inputs and will behave more like a digital output.
The link i provided goes into explaining that.
Agreed. We need to know the output resistance of the sensors and their sensitivity to be able to come up with a reasonable value of feedback resistance. And what's with those 74k resistors? 74k is not a standard 5% or even 1% value.
 
Many thanks

Thank you every one for your help, it is greatly appreciated and I'll certainly be taking it on board.

In answer to some questions:
1) The top part of the switch is to switch between two sets of LEDs. Each LED will be labelled and it will tell the user whuch of the pressure sensors has been selected for measuring inlet pressure and which one for outlet pressure. As it actually switches the contacts into the comparator at the same time it removes any confusion that could occur if there were two switches
2) I've used the second comparator because i thought, misguidedly probably, that the output voltage of the comparator would be negative and by passing it through the inverting input I would get a poisitive voltage output.
3) I used the 74k resistors because there were a load in the workshop and as I wasn't worried about current I used them so they would stay cool in the plastic enclosue this thing will eventually go in.

C
 
Re: Many thanks

cbesenzi@norgren.com said:
Thank you every one for your help, it is greatly appreciated and I'll certainly be taking it on board.

In answer to some questions:
1) The top part of the switch is to switch between two sets of LEDs. Each LED will be labelled and it will tell the user whuch of the pressure sensors has been selected for measuring inlet pressure and which one for outlet pressure. As it actually switches the contacts into the comparator at the same time it removes any confusion that could occur if there were two switches
2) I've used the second comparator because i thought, misguidedly probably, that the output voltage of the comparator would be negative and by passing it through the inverting input I would get a poisitive voltage output.
3) I used the 74k resistors because there were a load in the workshop and as I wasn't worried about current I used them so they would stay cool in the plastic enclosue this thing will eventually go in.

C

1. You can save power (and heat) by getting rid of the 130 ohm resistor, and changing the value of the 910 ohm resistor. LEDs are basically current-operated devices, i.e., the voltage across them is doesn't change much as you change the current through them. From the datasheet, determine how much current you want to pass through them and how much voltage will be across them at that current. Subtract that voltage from 24 volts and divide the result by the current. The result is your new resistor value.
2. The output of a comparator will be high when the (+) input is more positive than the (-) input, and low otherwise. This assumes that you have connected a pullup resistor to the output if it is open collector. So, to change the output polarity, simply swap the inputs. If you do want to use a comparator to invert a logic level, connect the signal you want to invert to the (-) input (as in your schematic), but you also need to connect a reference voltage, equal to approximately halfway between the logic "1" and logic "0" levels, to the (+) input. Typically, this will come from a resistor voltage divider made from 2 equal-value resistors (assuming you have the logic supply voltage available).

Does anyone know why the word ohm shows up as hypertext?
 
Status
Not open for further replies.

Latest threads

New Articles From Microcontroller Tips

Back
Top