Quad Comparator Help

Discussion in 'General Electronics Discussion' started by randyrogers04, Apr 21, 2013.

1. randyrogers04

12
0
Apr 21, 2013
I am currently working on a circuit using a quad comparator. My circuit works but my problem is that output is only putting out 1.3 volts instead of the full 9 volts that is being supplied. My question to you all is what may be causing this and how do i correct it? Thanks in advance for any and all responses.

2. duke37

5,364
772
Jan 9, 2011
What is the comparator that you are using and what is the circuit?

Comparators often do not have the facility to pull up the output. They need to have a resistor from output to Vcc.

3. randyrogers04

12
0
Apr 21, 2013
I am using a LM339N quad comparator and my circuit is a basic laser trip wire. Using a photo resistor on the Negative side i am able to turn the power off for the output when it is being hit by the laser beam. When i use my multi-meter to test the voltage, i am getting roughly 8.3 volts to both inputs, but the output is only 1.3 volts. I am really new to the world of electronics and managed to build this circuit with no training or guidance really, so i apologize if i ask stupid questions.

4. duke37

5,364
772
Jan 9, 2011
The LM339N contains four comparators with open collector outputs. To determine the output, one input has to be higher than the other. You say there is 8.3V on both inputs but one will be higher than the other.

What is the power supply to the comparator?
What are the actual accurate voltages on the inputs?
What is the output circuit?
Do you have a pull up resistor?

5. randyrogers04

12
0
Apr 21, 2013
The Power is a 9v battery, The Positive input has 8.71 volts, Negative has 8.70, output is 1.33, the output circuit leads to a 12v siren alarm from Radio Shack, and i do not know what you mean by pull-up resistor. Is that the resistor that goes from the output back to the positive input?

6. (*steve*)¡sǝpodᴉʇuɐ ǝɥʇ ɹɐǝɥdModerator

25,497
2,839
Jan 21, 2010
No, a pull-up resistor is a resistor which goes from the output to the +ve supply.

Look at the datasheet for this device. It will recommend a value or range of values.

Unless you have a specific requirement for an open collector output (i.e. one that can only pull to ground) you WILL need that resistor on every output.

7. randyrogers04

12
0
Apr 21, 2013
ok, so in order to calculate the resistor needed, i would use Ohms Law, correct? And the +ve would be the positive side of the power source? Again i apologize i am learning all of this on my own, so i may seem a bit slow haha.

8. (*steve*)¡sǝpodᴉʇuɐ ǝɥʇ ɹɐǝɥdModerator

25,497
2,839
Jan 21, 2010
No, typically you would look at the datasheet and see what they recommend

Look at the datasheet. At the end are a series of example circuits. Find one similar to the use of each of your comparators and see what value they've chosen. The values range from 2k to 100k.

If you need to source current from the output, you can use ohms lay to determine the voltage drop.

Or, show us the circuit and we can try to advise you of suitable values.

9. randyrogers04

12
0
Apr 21, 2013

Here is my attempt at a block diagram for my circuit... i hope i have everything covered... But i know im doing something wrong, otherwise i would have 9v or close to there on my output side. This circuit is mainly a test circuit for another project i am working on... I hope to use this and add it to a solenoid instead of a siren... but that is neither here nor there right now.

10. (*steve*)¡sǝpodᴉʇuɐ ǝɥʇ ɹɐǝɥdModerator

25,497
2,839
Jan 21, 2010
Firstly, the comparator is unlikely to work in this case.

1) you need to source current in this configuration and the comparator can only sink it.

2) the comparator is unlikely to be able to sink enough current to power the siren

3) your circuit is going to have the siren on all the time no matter what the light level is.

4) the 12V siren may not work from 9V.

So, what do you actually want?

Do you want the siren to go off when the light level exceeds a certain level, or when it gets below some level?

Also, can you describe the siren in more detail?

11. duke37

5,364
772
Jan 9, 2011
The comparator can work with inputs down to the negative line but I see no information as to how high they can go. I suspect that you are trying to run the inputs outside their range.

The inputs should be a bridge so that one input is at half the battery voltage (use two equal resistors) and the other input with a resistor in series with the LDR. The output will change at the point where the resistor and LDR are equal.

The pull up resistor must be low enough to provide a current for the load and high enough to be within the capability of the comparator.

File size:
3.3 KB
Views:
95
12. BobK

7,682
1,688
Jan 5, 2010
And, you will need a transistor switch to turn the siren on and off. The comparator cannot do this alone.

Bob

13. randyrogers04

12
0
Apr 21, 2013
As of right now, the siren makes very low but audible noise, and when i shine the light on the photoresistor it turns off... The purpose of thise circuit is to cause the siren to go off, even if it is only a chirp, when someone walks through the beam. The siren is a 12vdc Piezo Buzzer, 7-14vdc, 150ma, 108db.
If this circuit will not work, can you suggest a different one that may? Also will this circuit work for activating a solenoid, for a brief second or two? The solenoid in the second circuit im working on is being used as a latching device. Break the beam the solenoid activates and pulls the pin releasing the spring mechanism.

14. (*steve*)¡sǝpodᴉʇuɐ ǝɥʇ ɹɐǝɥdModerator

25,497
2,839
Jan 21, 2010
No, the maximum output current from the comparator is in the order of a couple of mA, totally insufficient for the "siren" or a solenoid. (It's actually 16mA -- see here)

As Bob suggested, a simple transistor will allow this to work.

With appropriate googling, you can find circuits that use an LM339 to switch relays etc. They will show the correct wiring.

If you find the siren is on when it should be off and vice versa, simply swap the inputs to the comparator

If you don't want to use a relay (for your siren perhaps) then place it here the relay coil is shown.

15. randyrogers04

12
0
Apr 21, 2013
Wow, awesome. Thanks for all your help, im going to have to purchase a new Comparator, i may have dropped and crushed mine while looking for it... oops. I am going to set my circuit up based on the switch relay you posted. I again apologize for the inconvenience of all my horrible electronics skills. I would have googled the information, actually i did, but did not know how to word my search due to my lack of experience and knowledge.

16. (*steve*)¡sǝpodᴉʇuɐ ǝɥʇ ɹɐǝɥdModerator

25,497
2,839
Jan 21, 2010
No problems (but sorry about the comparator (oops)).

It always helps to tell us what you're actually trying to do.

I thought you were wanting to have a siren go on (or off) when ambient light reached (or fell below) some level.

Similar, but different to what you wanted.

It does mean that I won't have to talk to you about hysteresis though

17. BobK

7,682
1,688
Jan 5, 2010
That's always a relief. No one wants to talk about hysterectomies, oh, hysteresis, never mind.

Bo

18. duke37

5,364
772
Jan 9, 2011
To drive a 150mA load, a simple fet amplifier can be used. Any medium power fet will do, I would use IRF530 because I have some.

File size:
4.5 KB
Views:
159
19. randyrogers04

12
0
Apr 21, 2013
DISREGARD

Solved my initial problem please disregard this post and forgive the double post.

Last edited: Apr 24, 2013
20. randyrogers04

12
0
Apr 21, 2013
Ok so i re-wired my circuit... I am now able to get the circuit to operate, however am i still getting sound from the Piezo Buzzer (siren) at all times. When the laser is on the LDR the "siren" is quiet but still audible, almost like static. When the beam is broken the alarm goes off. My new question is how to silence the "siren" when the Laser beam is on the LDR?

Ask a Question
Want to reply to this thread or ask your own question?
You'll need to choose a username for the site, which only take a couple of moments (here). After that, you can post your question and our members will help you out.
Continue to site