V/F converter: Lm331

Hi, I'm trying to work out a very simple linear voltage-controller oscillator, ranging from a few Hz to circa a thousand Hz (audio range) and working with 0-5V input tensions, and after some advice I set my aim on the LM331, which is said to be a good voltage-to-frequency converter. Anyway, I can't get much out of it. The big problem is that the datasheet provides lots of nice application notes, ranging from coffee machines to DIY Space Shuttles, but does not explain me how to actually embed the 331 in my circuit. Especially, I can't understand well enough how the external components have to be sized and placed and how to calculate the output frequency in relation to the input voltage. Has anybody got some experience with this toy?

Thank you in advance and sorry for my poor english.

--
Me :-)
Reply to
Supreme Lord of All Assholes,
Loading thread data ...

Yeah, I know audio range goes up to twenty thousand Hertzs, but I'll never ever need frequencies higher than 2000 Hz. And anyway when I'll complete the project my ears will hardly hear something higher than 440Hz :-P

--
Io.
Reply to
Supreme Lord of All Assholes,

I don't know which datasheet you're looking at, but the one I downloaded from national.com has some great examples of a voltage-frequency converter, and includes the design equations. Specifically what are you having trouble with? You might post a copy of your schematic here (ASCII art) or on alt.binaries.schematics.electronic (PDF/GIF/JPG images). You'll have a much better chance of getting good advice if we know what your circuit is.

--
Dave M
MasonDG44 at comcast dot net  (Just substitute the appropriate characters in the 
address)

Some days you\'re the dog, some days the hydrant.
Reply to
DaveM

No. But have a look at the Burr-Brown - now Texas Instruments - VFC121

formatting link

I haven't used that either, but between the two data sheets you might get a better idea of what is going on.

--
Bill Sloman, Nijmegen
Reply to
bill.sloman

Hi. First of all, thank you for your interest, I'm in real trouble and knowing that out there someone has some knowledge of what I'm dealing with makes me feel really better :-) I downloaded this datasheet:

formatting link
And this AN:
formatting link
applic_notes/an_LM331-6.pdf

I chose to try the schematic on page 2 of the AN ("Precision Relaxation Oscillator") because it seemed quite clear, simple and made up of few components.

Now, I wanted something which could go from about 0 to a thousand Hz, so I chose

1V = 220Hz (good old A2 :-) 5V = 1100 Hz Then, I could determine the scale factor K in F = KVi as 220.

The AN say fout = Vi/Vr * Rs/Rl * 1/1,1*Rt*Ct So, fout = Vi * K, then K = 1/Vr*Rs/Rl*1/1,1*Rt*Ct The AN advices to use 1,9V as Vref, so K = 220 = 1/1,9*Rs/Rl*1/1,1*Rt*Ct

K = 220 = Rs/(2,09*Rl*Rt*Ct)

I chose 10*10^-9=10nF as Ct and 10*10^3=10K as Rl and Rt, thus having

K = 220 = Rs/(2,09*10*10^3*10*10^3*10*10^-9)

K = 220 = Rs/(2,09* 10^3 * 10^3 * 10^3 * 10^-9)

Simplified as

K = 220 = Rs/(2,09)

So, Rs = 220 * 2,09 = 459 ohm.

Now, I don't have a 459 ohm resistor, but I do have a shiny 470 one, plus a cookie tin box full of trimmers which can be put in parallel with the 470R :-)

The AN doesn't say anything about Cl, so I decided to use another 10n.

So:

K = 220 Rs = circa 459 = 470//Trimmer Rl = 10K Rt = 10K Ct = 10n Cl = 10n Vref = 1,9

I grabbed the components and started to breadboard it. I omitted the trimmer in parallel to the 470 ohms, because at this stage accuracy is the last of my problems. Picture of the circuit:

formatting link

I plugged in my rusty Meterman pocket meter and started to measure frequencies.

Here's what i got:

0,5V => 2,22 Khz 1V => 2,86 Khz 2V => 3,92 Khz

I double-checked everything, but It didn't help.

Then, *that* hateful little voice started to whisper *you're wrong! you're wrong! you can't even get a cookbook-like application note to work! hahaha! loser!*

So, I would be happy if someone helped me to make the voice shut up. With violence, if necessary.

A giant thank you in advance, any advice useful to get out of this s**t is welcome!

:-)

--
Me.
Reply to
Supreme Lord of All Assholes,

There's something up with you and these '121 p/n's.

Reply to
Fred Bloggs

First thing, I doubt that you're going to get a V-F to work down to 0Hz for 0V input without using a split power supply. Check the reference voltage at pin 2. I'll bet that your value for Rs is killing it. According to the datasheet, "The voltage at pin 2 is regulated at

1.90 VDC for all values of i between 10 ?A to 500 ?A", where i = 1.9V/Rs. Using your values, measure Vref and use that value in your calculations. The datasheet suggests using Rs = 15k. You might start there and rework your calculations. Also, I'm not going to try to debug your breadboard picture, but assuming that you've wired the circuit exactly like the AN example, have you included any bypassing for the power supply? I'd recommend 50uF to 100uF across the Vs and Gnd nodes.
--
Dave M
MasonDG44 at comcast dot net  (Just substitute the appropriate characters in the 
address)

They call it PMS because Mad Cow Disease was already taken.
Reply to
DaveM

Well, I don't actually need 0Hz/0V. When I get to have about 100Hz It's absolutely ok. Anyway, the datasheet says that the 331 'operates on single 5V supply'.

Thanks to you I just realized I'm a complete moron. I was *inputting* 1,9V in pin 2. The tiny arrow in the schematic in the AN fooled me.

That's what I did. I put Rs = 15k Rl = 100K Rt = 3260 (obtained via trimmer, of course) Ct, Cl = 100nF

Thus satisfying the equation

220 = 15000/(2,09*100000*3260*100*10^-9)

And, well... IT WORKED. Or, at least, I had values making more sense. About 110 Hz @ 0,5V,

220@ 1V 440@2V 660@3V.

Not the exact values, of course, also because of components' tolerance, but they get really close.

Then, I started jiggling and jumping through the room, with my Jedi robe, screaming 'DaveM is my master now! DaveM is my master now!'.

Yeah, *really*. Just with no Jedi robe and speaking my mother tongue.

Tomorrow, when I'll wake up, my first thought will surely go to you.

Now the bad news: sadly enough, after, let's say, 3,5V, the device completely loses linearity, going up and up and reaching 10Khz and over.

It's not a *big* problem, I can survive even this way, but... nobody has an idea on how to avoid this?

Big thanks and a hug to everyone.

P.s.: I'm just noticing how the momentary happiness and satisfaction are making my English even more crappy.

--
Me.
Reply to
Supreme Lord of All Assholes,

Sounds interesting, but no one is going to waste time on someone who would choose such a screen name. Go away.

Reply to
Fred Bloggs

But it's so good-sounding, can't you see?

--
Me.
Reply to
Supreme Lord of All Assholes,

Are you an adult?

Reply to
Fred Bloggs

They pretend me to be one, let's put it this way.

--
Me.
Reply to
Supreme Lord of All Assholes,

Sniffed glue in your adolescence?

Reply to
Fred Bloggs

Fred Bloggs ha scritto:

I hate all kinds of drugs. I just enjoy so much being stupid.

--
Me.
Reply to
Supreme Lord of All Assholes,

It is stupid to invest time and effort in a query that will go ignored because of a relatively minor aspect of its presentation.

Reply to
Fred Bloggs

Whatsa matter Fred, upset that someone picked the screen name you wanted to use ?:-)

You're turning into a real pill.

...Jim Thompson

-- | James E.Thompson, P.E. | mens | | Analog Innovations, Inc. | et | | Analog/Mixed-Signal ASIC's and Discrete Systems | manus | | Phoenix, Arizona Voice:(480)460-2350 | | | E-mail Address at Website Fax:(480)460-2142 | Brass Rat | |

formatting link
| 1962 | I love to cook with wine. Sometimes I even put it in the food.

Reply to
Jim Thompson

Odd how Jim can see the mote in someone else's eye, while remaining unaware of the beam in his own.

--
Bill Sloman, Nijmegen
Reply to
bill.sloman

With Vcc = 5V, the input voltage (pin 7) can't exceed 3V without going outside the input comparator's common mode voltage range. The upper limit on the common mode range is defined as Vcc - 2V. Sound familiar?? Tailor your values to use input voltage ranging from 0V to 3V. Things should start making more sense then. I suggest that you read the datasheet again, but more carefully this time. Pay attention to the details and think about what they mean.

--
Dave M
MasonDG44 at comcast dot net  (Just substitute the appropriate characters in the 
address)

Some days you\'re the dog, some days the hydrant.
Reply to
DaveM

I do not understand your problem. Surely you can build the figure 3 circuit from the National Semiconductor datasheet.

formatting link

--
JosephKK
Gegen dummheit kampfen die Gotter Selbst, vergebens.  
--Schiller
Reply to
joseph2k

common

Obviously yes. Having little or no experience with this kind of device I forgot completely about it and started thinking of some other annoying mess-up with the external components.

A giant thank you, I hope to have the possibility to help you as much as you helped me in the future.

--
Me.
Reply to
Supreme Lord of All Assholes,

ElectronDepot website is not affiliated with any of the manufacturers or service providers discussed here. All logos and trade names are the property of their respective owners.