LM 339 comparator questions
Baard Toerdal
Posts: 8
Hi!
I need to trigger an event when a voltage passes a certain limit between 6 and 9 volts. I would like to measure this voltage without connecting the Stamp ground to the circuit I want to monitor. Can I use the LM 339 comparator to do this job? And if its not a good choice; is there any other comparators or solutions you could recommend? Any help would help! Help!
Baard
I need to trigger an event when a voltage passes a certain limit between 6 and 9 volts. I would like to measure this voltage without connecting the Stamp ground to the circuit I want to monitor. Can I use the LM 339 comparator to do this job? And if its not a good choice; is there any other comparators or solutions you could recommend? Any help would help! Help!
Baard
Comments
if the voltage at V+ > V- then ouput = Vdd
if the voltage at V- > V+ then ouput = Vss
m'kay
you can bias V- with a pot like this
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
League Bowling.... it's not a sport, it's a way of life
Thanks for the answer and the schematics Nick!
Ok, so just to see if I have got things right... Pin 5 on the LM339 is connected to the positive side of the voltage I need to measure. Pin four is connected through a potentiometer which has both ends connected to the voltage I need to measure. Pin three is 0 and +5V powering the LM339 and pin 2 is output to the Basic Stamp?
If I have understood this right, then my next questions are:
Pin 4 sets the reference value, right? I have a 5V power supply for the Basic Stamp and different chips on my board. The 6-9 volt signal I need to measure is just that; a six to nine volt signal which bounces up and down. The reference voltage pin : would I need to incorporate a steady 9V power supply for this pin? The signal I need to measure is everything but steady and I guess it would not be a good source for providing a reference voltage for the LM339?
And what about hysteresis? I´m not sure I understand the concept of hysteresis, but I believe it has something to do with smoothing out the signal so the comparator doesn´t trigger at every little peak? I have seen circuits which add an 1 meg resistor between pin 2 and 5; has that got something to do with hysteresis? My signal is an audio signal which could need such a filter I guess...
And finaly the question which proves I have very little knowledge about these things: Is an LM339 the same thing as an LM339N? There is a difference between NPN and PNP transistors and I´m just just wondering if this "N" means something...
Thanks again, from a cold and muddy Oslo
Baard T.
In my latest circuit I'm using one for a CHEAP voltage to digital converter if you will call it that. Need the Stamp to know if my feedback is above a certain level below a certain level, or within a certain level to adjust what it's controlling. Cheap interface for that kind of stuff and just feed the outputs into a few pins to give the logic to the stamp.
What a sorry quality pic that took, but the bottom IC is a LM339
I just got done installing the components a few monutes before i logged into here.
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
http://www.paysonarizona.net/
Thanks for the help! I´ll try it out tonight and see if I can get my circuitry working. This shoud be pretty basic stuff I guess, I only hope that what my brain thinks it understands will work in real life.
Baard
·· The one part of your question that wasn't addressed was the common ground.· If you use the LM339, you will need a common·ground with the stamp, as well as what your input voltage is coming from.· Also, if your reference voltage is 5V from the stamp, and your input voltage is 0-9V, you're always going to be reading a high output from the LM339 to the stamp whenever it's above 5V.
·· The LM339 has an operating voltage of +36V, or +/-18 Volts so you can handle negative and positive voltages.· However, I don't recall, but I don't think you can compare an input voltage higher than the supply voltage properly.
·· Back to the ground issue, if you build the LM339 circuitry around a fixed 9V supply, you will be able to accurately compare for your range, and then if you run the output of the LM339 into an opto-coupler you will not need a common ground.
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
--==<{Chris}>==--