Using the LM331N voltage to frequency converter

djmikeys

New Member
Hi,

I am trying to use the LM331N voltage frequency converter as a frequency to voltage converter. In the data sheet it does show a schematic of how to do this. I have built it up and it does not seem to work. I am trying to read the frequencies coming from a headphone socket on an mp3 player and convert this to a meaningful voltage the picaxe can understand in its adc pin.

Has anyone managed to do this with the LM331N?
I shall keep on trying and keep you posted.

Cheers,
Mike
 

Bchip

New Member
Hi,

I am trying to use the LM331N voltage frequency converter as a frequency to voltage converter. In the data sheet it does show a schematic of how to do this. I have built it up and it does not seem to work. I am trying to read the frequencies coming from a headphone socket on an mp3 player and convert this to a meaningful voltage the picaxe can understand in its adc pin.

Has anyone managed to do this with the LM331N?
I shall keep on trying and keep you posted.

Cheers,
Mike
Mike

If it's speech or music on the '331 i/p. I guess it doesn't know what the frequency really is. I've used that ic. on projects a few times on sine and square wave successfully, but not with any signal with harmonics etc.

Dave
 

MartinM57

Moderator
I am trying to use the LM331N voltage frequency converter as a frequency to voltage converter. In the data sheet it does show a schematic of how to do this. I have built it up and it does not seem to work. I am trying to read the frequencies coming from a headphone socket on an mp3 player and convert this to a meaningful voltage
This doesn't sound right to me - LM331 (never used one myself) converts voltage to frequency - but you say you want to read the frequencies from an MP3 player...which sounds like some sort of spectrum analyser?

If you connect a LM331 to a mp3 player, it won't tell you anything about the frequencies coming out the mp3 player...only about the voltage coming out of the mp3 player (and expressing that voltage as a certain frequency pulse train - and that frequency will change all the time, as the voltage from the mp3 player will be changing all the time).

Bottom line is that LM331 doesn't appear to be the thing you want to plug into an audio stream...
 

hippy

Ex-Staff (retired)
Figure 2 of http://www.datasheetcatalog.org/datasheets/50/49494_DS.pdf shows a frequency to voltage configuration so it may be possible. I suspect that it is primarily intended to detect what a single frequency signal may be which will not likely work with an audio stream which has a wide range of simultaneous frequencies within it.

There are PC applications which can use PC Sound Cards as signal generators which may be worth trying to see if it does work with single frequenies.
 

djmikeys

New Member
Hi Martin,

In the LM331N data sheet it shows a circuit of how to create a frequency to voltage converter using the chip. Do you know of any other chips that would do this, you mentioned a spectrum analyser? Does this look at the frequency spectrum?

Cheers,
Mike
 

Dippy

Moderator
Mike, tell us what you are trying to achieve, then people may be able to suggest a possible answer.
Those types of chip are aimed at single frequencies really, I don't know how it would behave with a mix.
When used as a V-F they tend to be a pulse train o/p though I confess I have no experience of that chip.

Are you trying to make a spectrum analyser?
If so, what sort of band resolution?
What frequency range?
How are you going to display the 'results'?
 

Bchip

New Member
Mike

There is another chip LM2917 IIRC. Does much the same thing. I have used the LM331 for F-V conversion, it works very well. Linear and stable. I think you are on to a loser using it on Audio for the reasons said before. The ic. outputs a voltage proportional to the input frequency. If there are more than one present it would try to output more than one voltage at the same time, which is clearly impossible.

What are your objectives.. a VU meter ? Or what ?

A spectrum analyser would be preceeded by filters, one for each channel, I think. Then the filter outputs would go each to it's own LM331. at a guess.

Not easy or quick

EDIT apologies, got tangled with prev. post

Dave
 
Last edited:

hippy

Ex-Staff (retired)
A spectrum analyser is effectively a number of filters each tuned for a particular frequency band giving a voltage out which shows how much of that frequency is present.

These can be implemented in a number of ways, including simple op-amp filters, and there may even be specialist IC's which put a whole load of them inside one chip and produce a number of outputs from a single input signal.
 

Dippy

Moderator
Well, I just hope he doesn't want 50 bands :)

Maybe before we start expanding on op-amps, switched-capacitor filters and FFT (et cetera) we should wait for Mike's specification.
Then we can also discuss shoving true AC into the thing...
 

MartinM57

Moderator
...or it's a real time FFT processing chip that uses mathematical principles to determine the frequency components from the input voltages sampled over a period of time.

HAve a play with http://www.dsptutor.freeuk.com/analyser/SA102.html - plot the simple waveforms (sine, sawtooth etc) and show their spectrum(s) - then add some random noise so it looks like an audio waveform and "re-spectrum"

But we're in danger of digressing (and seriously complicating) from what Mike actually might be wanting to do...

EDIT:X-post with Dippy ;) and the guidance notes on the above page are quite interesting (if you're interested by that sort of thing :D)
 
Last edited:

fernando_g

Senior Member
I can't resist jumping into a good melee; se here are my two yen:

Besides all the good information that has been provided, F/V conversion require time to acquire a signal and settle to the proper voltage.
This settling time has an inverse relationship with the output ripple (you did'nt think that the output was PURE DC, didn't you?). The faster it settles, the higher the ripple.
Aditionally.....Other than the aftermentioned LM331, the lowly CD4046 PLL makes an excelent F/V converter.

Now, that I've thrown some random punches myself, let's wait until the O/P comes back with his real requirements.......
 

djmikeys

New Member
Thanks for all the help/replies!

I think I am barking up the wrong tree with the lm331, I just thought I would ask if anyone had managed to make it work.

Basically what I want to do is record an mp3 of my voice trying to keep within 4 band ranges (making long beeping noises), I then want the picaxe to know what frequency band I have made. I have been trying to find a five band graphic equaliser ic today called the ba3812, but know one seems to stock it anymore. Does anyone know equililent ic's to this? I am also considering building up my own band-pass filters, the only problem with this as it might be a bit bulkier than a single ic as it will need 4 filters and one op amp (I think).

Cheers,
Mike
 

Dippy

Moderator
Weird.
Can't help with that chip. Sorry, haven't time to Google.

While you are waiting for Eclectic to search for you, have a look at the many resources on the subject of active filters.
Here's one to get the ball rolling.
http://www.swarthmore.edu/NatSci/echeeve1/Ref/FilterBkgrnd/Filters.html

There are probabaly a zillion websites on the subject.
It's a big subject so you will have to filter out (haha) the info you need or let others do it.
Do you know the difference between single and dual rail supplies for op-amps?
You may need to know so you can adapt circuits.
 

MartinM57

Moderator
Basically what I want to do is record an mp3 of my voice trying to keep within 4 band ranges (making long beeping noises), I then want the picaxe to know what frequency band I have made.
I'm pretty sure I don't understand that :( Care to have another go...?
 

Jeremy Leach

Senior Member
I'm just wondering if the underlying requirement is to activate the picaxe by voice, then maybe the duration would be easier to modify than the pitch? i.e detect sound for durationX means 'do Y' ? I think this would be a lot simpler to achieve. Just a thought.
 
Top