Go Down

Topic: i want to read frequency realtime (Read 17077 times) previous topic - next topic

retrolefty


yes, i know lm339 need input voltage to pin 4 and 8 i think, anyway its in the datasheet, i will try with the internal pull of but, id rahter use the external one......

Either should work, and the value is not critical, so anything 3k or higher ohms.
only as a doubt, the output of the pull-off resistor goes again to v+ right

No, because It's possible to run the LM339 chip at a higher voltage then the arduino runs at, and in that case you wouldn't want to wire the output pull-resistor to that higher voltage. It needs to be wired to the arduino +5vdc pin, if your LM339 is not being powered already from +5vdc. By not using the pull-up resistor and just using the arduino pull-up option you don't have to worry about this at all.

That make sense?

, that what it call hysteresis??

Hysteresis feedback is just a method to make the comparator a little less likely to switch high and low sporadically if there is no input signal present, or if it's a very weak input signal. As long as you have a suitable voltage input signal wired to the chip you probably don't need to use that feedback 'feature'.

Lefty



nickgammon

I just tested with an LM339 I happened to have lying around.

That works fine:

Please post technical questions on the forum, not by personal message. Thanks!

More info: http://www.gammon.com.au/electronics

copachino

i tried it right now and works fine, monday will look test ir with an osciloscope to see it better, but i tried with a 4.7k and 470R resistors i had lying there, and for external pull-off used a 10k resistor......

this work really well with both of my sensor inductive one and also for the optical sensor....

copachino


I just tested with an LM339 I happened to have lying around.

That works fine:





ummm somethig its wrong with this i just try it and see that there its a problem, when output of the sensor becomes zero, i always get 5v cos noises get in input and it generates signals that becomes pulses.....

Techone

@retrolefty

Thank for the link about the LM339 datasheet. I did have one, but not that one you link. The circuits will give me some ideas. And the pull-up resistor, <-- I did know about this little info  :smiley-roll:

In my experience with the LM339, it work fine for a signal going from 0 V to positive and back. But I try with an AC signal in, Flat line... just be aware of that fact.

retrolefty


@retrolefty

Thank for the link about the LM339 datasheet. I did have one, but not that one you link. The circuits will give me some ideas. And the pull-up resistor, <-- I did know about this little info  :smiley-roll:

In my experience with the LM339, it work fine for a signal going from 0 V to positive and back. But I try with an AC signal in, Flat line... just be aware of that fact.


An LM339 can work very well with AC input signals. Usually such an application works better if you power the chip with a bipolar voltage supply such as +5vdc and -5vdc rather then a single positive polarity supply and ground. The application section of that linked datasheet shows several examples of using the chip with an AC input signal.

Lefty


Techone

@retrolefty

I discover that. Thank for the link by the way.

nickgammon


i tried it right now and works fine, monday will look test ir with an osciloscope to see it better, but i tried with a 4.7k and 470R resistors i had lying there ... this work really well with both of my sensor inductive one and also for the optical sensor....


...

Quote
ummm somethig its wrong with this i just try it and see that there its a problem,


Does it work really well or not?

According to those resistor values the comparator should be comparing to 455 mV (which sounds a bit high). This certainly should not be triggering on the noise you showed. I'm not convinced you have it wired up according to that circuit, if you are having problems.
Please post technical questions on the forum, not by personal message. Thanks!

More info: http://www.gammon.com.au/electronics

copachino

the first one doesnt have problems with noises.... but using the one with 1ok and 220R it gives me always 5v cos the noises, probe it changing resistor values

nickgammon

Well you have to get the cut-off voltage right. On the figures you quoted my resistors should have been right, but only you can tweak them so it works exactly right for you.
Please post technical questions on the forum, not by personal message. Thanks!

More info: http://www.gammon.com.au/electronics

Go Up