Go Down

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

copachino

i see if i can get one og those to try it out

Techone

@copachino

Any regular op-amp will do. A dual type or a quad type or a single is just fine. Just check the datasheet. The dual power can be made like :

positive wire 9 V  negative - com/gnd wire - positive 9 V negative wire. Just connect two battery pack in series. The mid part  is the gnd or commun.

As for power up. 1. Power up the Arduino. 2 Power up the dual power circuit 3. power up the input signal.

Why ?  If the Ardiuno board is off, and you got a signal into the pins, it may damage the Arduino. 

copachino

i got some lm386 so id see if those have a good behavior... thanks fo reply

retrolefty


i got some lm386 so id see if those have a good behavior... thanks fo reply


An LM386 is not a op-amp, it's a low power audio amplifier chip, and as such not a good candidate for comparator type duty.

Lefty

copachino

thanks for that jejeje ahhh well i have to get some op-amp and try them for a good response

nickgammon

I agree with Techone about the op-amp. I did a bit of experimenting with them:

http://www.gammon.com.au/forum/?id=11011

That was for an LDR, but if you used a voltage divider to get the comparison point as half-way through the voltage range you expect, then that should clean up a non-square signal into a square one.
Please post technical questions on the forum, not by personal message. Thanks!

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

copachino

#36
Feb 11, 2012, 09:29 pm Last Edit: Feb 11, 2012, 09:41 pm by copachino Reason: 1
i used a LM339 but it never work am trying to make an analog sensor output tobe square but still getting negative results...... so nick with the lm358 what do i need to change in the circuit to get a high input when my sensor gives 200mv o maybe 100mv...... its an inductive sensor so when the magnetic field its low the output voltage its 100mv or something near.....

this is a sample on my sensor took from the analog A0 and plotted with kst


Uploaded with ImageShack.us

for this i am holding a magnet with my hand and passing it to the sensor the fastar as i can, but if you see there when is low speed the output get too low voltage, anl also there is a lot of noise coming from the sensor

nickgammon

Right. Well what you want to do is set up the op-amp as a comparator. You need a voltage divider on the - input to the op-amp (eg. pin 2) and your signal into the + (eg. pin 3) input.

Looking at this page:

http://www.raltron.com/cust/tools/voltage_divider.asp

I type in that I have 5V input voltage, and a 10K as R1 (from 5V to pin 2). I want 100 mV comparison voltage for the op-amp so I type 0.1 as the output voltage and hit "calculate". It tells me to use a 204 ohm resistor, so say use a 220 ohm between pin 2 and ground. Now you should be able to measure around 0.1V on pin 2 of the op-amp. That means it will turn on when the input on pin 3 is above 100 mV and turn off if it is less, thus "squaring up" your input.

Something like this:

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

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

copachino

#38
Feb 12, 2012, 12:11 am Last Edit: Feb 12, 2012, 12:19 am by copachino Reason: 1
thank you so much jejje ummm but i cant get an op-amp right now stores are close so i need to wait till monday.
but maybe a could try this with the lm339 if not i will have to wait till then....


thanks again all of you techone, nick gammon and retrolefty..... you guys have help me a lot


one doubt 220R its going to ground?

retrolefty


thank you so much jejje ummm but i cant get an op-amp right now stores are close so i need to wait till monday.
but maybe a could try this with the lm339 if not i will have to wait till then....


thanks again all of you techone, nick gammon and retrolefty..... you guys have help me a lot


one doubt 220R its going to ground?


Here is a link to the datasheet for a LM339. There is a typical application section that should show you how to use the chip. Most people that have trouble with this chip forget that it has an open collector output that requires an external resistor wired between the output pin and +5vdc. The programmable internal pin pull-up option for an arduino input pin can satisfy that requirement.

http://www.ti.com/lit/ds/symlink/lm339-n.pdf

nickgammon


one doubt 220R its going to ground?


Yes. Effectively the 10K and the 220 ohm added together give 10.2K between 5V and ground. We are sampling that at 220/10220 along that, being 0.0215 of the total "distance". Multiply that by 5 and we get 0.1076V, which is 107 mV.

So the comparator compares the input to the comparison voltage of 107 mV.

Your LM339 looks like it should do a similar job.
Please post technical questions on the forum, not by personal message. Thanks!

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

copachino

#41
Feb 12, 2012, 01:16 am Last Edit: Feb 12, 2012, 01:24 am by copachino Reason: 1
look this is an lm339 but i dont undestand it.... for example why the are using a 3k resistor and where does that voltage goes???


Uploaded with ImageShack.us
also resistor need tobe that high, or they have tobe changes in oder to input 100mv

retrolefty


look this is an lm339 but i dont undestand it.... for example why the are using a 3k resistor and where does that voltage goes???


Uploaded with ImageShack.us
also resistor need tobe that high, or they have tobe changes in oder to input 100mv


The 3k resistor is the external pull-up resistor I mentioned in my prior posting. It should wire to either +5vdc or +3.3vdc depending on what voltage your arduino board runs at, +5vdc for a standard Uno type board. The VO point is the signal you wire to your arduino digital input pin of choice. Also note that the drawing you posted doesn't show the power and ground connections used for the chip it'self.

Lefty


nickgammon

Forget about the hysteresis. Forget about the 3K resistor. Lefty said if you configure that pin with a pull-up that will have the same effect.

Just wire up the + and - as I showed above.
Please post technical questions on the forum, not by personal message. Thanks!

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

copachino

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......

only as a doubt, the output of the pull-off resistor goes again to v+ right, that what it call hysteresis??

Go Up