EEVblog Electronics Community Forum

Electronics => Projects, Designs, and Technical Stuff => Topic started by: samfisher92 on December 27, 2014, 04:51:10 pm

Title: frequency meter in a digital function generator
Post by: samfisher92 on December 27, 2014, 04:51:10 pm
im working out on a digital function generator.

I got the waveform generation stage worked out.

Now i need to work out the digital display which i pretty much i know going to have an ADC which is most slightly the max183 ic from maxim, to convert the analog ac voltage of the waveform to binary form and have a display driver to decode the binary and display it on some 7 segment led.

now i need to design another set of circuits to pick out the frequency of the waveform and display it on a LED display.

Any ideas?

On a side note, because the function generator is generating AC waveforms which have AC voltages, can an ADC really convert that AC voltage into digital form? does the ADC even care if its DC or AC in the first place?
Title: Re: frequency meter in a digital function generator
Post by: HalfSpace on December 27, 2014, 08:11:48 pm
Hi samfisher92,

What do you want to display, just the frequency of the function generator?

HalfSpace  :)
Title: Re: frequency meter in a digital function generator
Post by: dannyf on December 27, 2014, 10:51:32 pm
Quote
have an ADC

My experience with people who utilize adc to measure frequency is that they are either

1) extremely new to the field; or
2) extremely experienced and know exactly what they are doing.

Title: Re: frequency meter in a digital function generator
Post by: samfisher92 on December 28, 2014, 11:06:10 am
Quote
have an ADC

My experience with people who utilize adc to measure frequency is that they are either

1) extremely new to the field; or
2) extremely experienced and know exactly what they are doing.

I am 1). I am new to ADC. I just recently started learning about the types of ADC like the sar type, dual slope and I learned the flash type in high school.
Title: Re: frequency meter in a digital function generator
Post by: samfisher92 on December 28, 2014, 11:07:50 am
Hi samfisher92,

What do you want to display, just the frequency of the function generator?

HalfSpace  :)

Yup I just want to display the frequency of the  function generator :)
Title: Re: frequency meter in a digital function generator
Post by: PA0PBZ on December 28, 2014, 11:59:52 am
Hi samfisher92,

What do you want to display, just the frequency of the function generator?

HalfSpace  :)

Yup I just want to display the frequency of the  function generator :)

I'm not pretending to better know what you want than yourself, but from what I could decypher from your first post I got the impression that you want to display the output voltage using an ADC and some other circuit to display the frequency?
Title: Re: frequency meter in a digital function generator
Post by: samfisher92 on December 28, 2014, 12:36:30 pm
I'm not pretending to better know what you want than yourself, but from what I could decypher from your first post I got the impression that you want to display the output voltage using an ADC and some other circuit to display the frequency?

thats right. i wish to isolate the hardware needed to measure these 2 parameters.
Title: Re: frequency meter in a digital function generator
Post by: oldway on December 28, 2014, 04:20:06 pm
Hameg is using an ADC to display the frequency in the function generator HM8030-2.
http://www.hameg.com/manuals.0.html?&no_cache=1&L=0 (http://www.hameg.com/manuals.0.html?&no_cache=1&L=0)
Title: Re: frequency meter in a digital function generator
Post by: Kalvin on December 28, 2014, 04:43:33 pm
There are quite a few frequency counter designs in old hobby electronics magazines like Elektor, Everyday Practical Electronics etc. over the years. The older designs used quite many 74LS-series logic ICs and 7-segment displays. The newer designs are using microprocessors like Arduino etc. with LCD display.

The amplitude measurement can be done using either an analog meter or a digital display. Typically the output voltage of a function generator is given as peak voltage (instead of an average or RMS voltage) so you may want to construct a peak voltage detector which will then feed the voltage/amplitude meter/display.

There are also some complete kits and/or just plain PCB available if you are inexperienced and want to take a bit easier route than starting the design and building from scratch.

Br,
Kalvin
Title: Re: frequency meter in a digital function generator
Post by: samfisher92 on December 28, 2014, 04:53:04 pm
Hameg is using an ADC to display the frequency in the function generator HM8030-2.
http://www.hameg.com/manuals.0.html?&no_cache=1&L=0 (http://www.hameg.com/manuals.0.html?&no_cache=1&L=0)
I am really glad for your help. this is a really big clue and a big step into completing the hardware.

thanks a lot.  ;)
Title: Re: frequency meter in a digital function generator
Post by: fcb on December 28, 2014, 05:01:22 pm
LM2917 is still available.
Title: Re: frequency meter in a digital function generator
Post by: samfisher92 on December 28, 2014, 05:02:46 pm
There are quite a few frequency counter designs in old hobby electronics magazines like Elektor, Everyday Practical Electronics etc. over the years. The older designs used quite many 74LS-series logic ICs and 7-segment displays. The newer designs are using microprocessors like Arduino etc. with LCD display.

The amplitude measurement can be done using either an analog meter or a digital display. Typically the output voltage of a function generator is given as peak voltage (instead of an average or RMS voltage) so you may want to construct a peak voltage detector which will then feed the voltage/amplitude meter/display.

There are also some complete kits and/or just plain PCB available if you are inexperienced and want to take a bit easier route than starting the design and building from scratch.

Br,
Kalvin

I thought of a peak voltage detector to measure the Vpeak of the waveform but I didnt give it much thought about integrating it into the whole project. And now since you made sense of it, well i think there's a real need to include it. well i didn't go into much research about the frequency counters using the 74LS chips because back in school I did learn about counter circuits specifically like the 74192 for the BCD type and 74193 for the binary type and some display drivers like the 7447 as the output IC. I used the CD4026 before too but im pretty out of touch with these ICs. haha all these knowledge have rusted anyway. trying to find my way back into doing such fun stuffs.
Title: Re: frequency meter in a digital function generator
Post by: samfisher92 on December 28, 2014, 05:05:04 pm
LM2917 is still available.

I guess that IC is not applicable to my project..
Title: Re: frequency meter in a digital function generator
Post by: fcb on December 28, 2014, 07:51:30 pm
LM2917 is still available.

I guess that IC is not applicable to my project..
Huh?  What are you actually trying to do???  You talk about using an ADC to measure frequency - it's not the way I would do it, but hey, you know what you want??

The LM2917 converts a frequency into an analog voltage, which you would then read with your voltmeter>LED block (or whatever).

Perhaps you should describe exactly what you want or have built, along with specifications. It is less frustrating.

Title: Re: frequency meter in a digital function generator
Post by: oldway on December 28, 2014, 10:09:19 pm
Have a look on the schematic of the Hameg HM8030 and you will understand how it works.
Frequency is proportional to voltage (VCO of the function generator), then, if you displays this voltage (with adequate voltage divisor), you are displaying the frequency.
It's not necessary to convert output of the VCO (frequency) to an analog voltage, you already have this analog signal.

I agree, that's not a high precision reading, as you are not really measuring the frequency, but that's enough....those 8000 series plug-in's are not intended for profissional use and linearity of the VCO is quite nice.
You could also use the same ADC circuit to display the output voltage. (with a switch frequency/RMS output voltage and an AD8436)
NB: AD8436 is limited at 800Khz.
Title: Re: frequency meter in a digital function generator
Post by: samfisher92 on December 29, 2014, 08:02:47 am
LM2917 is still available.

I guess that IC is not applicable to my project..
Huh?  What are you actually trying to do???  You talk about using an ADC to measure frequency - it's not the way I would do it, but hey, you know what you want??

The LM2917 converts a frequency into an analog voltage, which you would then read with your voltmeter>LED block (or whatever).

Perhaps you should describe exactly what you want or have built, along with specifications. It is less frustrating.

well im trying to use an ADC to convert the frequency into a digital code. not sure if its a right thing to do but your idea of a F/V converter do sound like a way to work around that. I should read up on its theory of operation. Im pretty new to that type of converters.

Thanks thanks :D
Title: Re: frequency meter in a digital function generator
Post by: samfisher92 on December 29, 2014, 08:18:11 am
Have a look on the schematic of the Hameg HM8030 and you will understand how it works.
Frequency is proportional to voltage (VCO of the function generator), then, if you displays this voltage (with adequate voltage divisor), you are displaying the frequency.
It's not necessary to convert output of the VCO (frequency) to an analog voltage, you already have this analog signal.

I agree, that's not a high precision reading, as you are not really measuring the frequency, but that's enough....those 8000 series plug-in's are not intended for profissional use and linearity of the VCO is quite nice.
You could also use the same ADC circuit to display the output voltage. (with a switch frequency/RMS output voltage and an AD8436)
NB: AD8436 is limited at 800Khz.


Yeah I went to look up on its schematics. I do agree that using the output of the VCO to measure the frequency is not really nice because its not really a direct kind of measurement. Also I went to look around Digikey and Mouser they sell only SMT-type VCOs. Im trying to do a fully through-hole kind of project right here.

fcb said something about F/V converter. I think its another approach to achieve that spec of displaying the frequency on a 7-Seg LED or a LCD even.
Title: Re: frequency meter in a digital function generator
Post by: oldway on December 29, 2014, 10:26:43 am
vco DIL8 : LM566C (has a triangular wave output)
vco DIL16 : 4046B or 74hc4046
Title: Re: frequency meter in a digital function generator
Post by: tggzzz on December 29, 2014, 10:39:57 am
LM2917 is still available.

I guess that IC is not applicable to my project..
Huh?  What are you actually trying to do???  You talk about using an ADC to measure frequency - it's not the way I would do it, but hey, you know what you want??

The LM2917 converts a frequency into an analog voltage, which you would then read with your voltmeter>LED block (or whatever).

Perhaps you should describe exactly what you want or have built, along with specifications. It is less frustrating.

well im trying to use an ADC to convert the frequency into a digital code. not sure if its a right thing to do but your idea of a F/V converter do sound like a way to work around that. I should read up on its theory of operation. Im pretty new to that type of converters.

Thanks thanks :D
Yes, but what do you want to achieve? Don't tell us your solution, tell us your problem!

 What range, resolution and accuracy do you need?

If you want to know the actual frequency, why not use a frequency meter that counts the cycles in one second, or similar?

If your signal generator is based on a crystal, your meter will not be any more accurate.

If you want to convert frequency to voltage and measure the voltage, how are you going to calibrate that conversion?
Title: Re: frequency meter in a digital function generator
Post by: oldway on December 29, 2014, 10:45:36 am
Quote
I got the waveform generation stage worked out.
Post the schematic of what you have done, it will be easier.

Quote
If you want to know the actual frequency, why not use a frequency meter that counts the cycles in one second, or similar?
A non reciprocal counter is too slow reacting in low frequency range to ajust the frequency. That's the reason why Hameg choosed the solution of ADC circuit.
Title: Re: frequency meter in a digital function generator
Post by: samfisher92 on December 29, 2014, 11:44:17 am
LM2917 is still available.

I guess that IC is not applicable to my project..
Huh?  What are you actually trying to do???  You talk about using an ADC to measure frequency - it's not the way I would do it, but hey, you know what you want??

The LM2917 converts a frequency into an analog voltage, which you would then read with your voltmeter>LED block (or whatever).

Perhaps you should describe exactly what you want or have built, along with specifications. It is less frustrating.

well im trying to use an ADC to convert the frequency into a digital code. not sure if its a right thing to do but your idea of a F/V converter do sound like a way to work around that. I should read up on its theory of operation. Im pretty new to that type of converters.

Thanks thanks :D
Yes, but what do you want to achieve? Don't tell us your solution, tell us your problem!

 What range, resolution and accuracy do you need?

If you want to know the actual frequency, why not use a frequency meter that counts the cycles in one second, or similar?

If your signal generator is based on a crystal, your meter will not be any more accurate.

If you want to convert frequency to voltage and measure the voltage, how are you going to calibrate that conversion?

To answer your questions, I intend to make a function generator that works from 1 Hz to 1 MHz using one of the newer 555 chips (take a look at ICM7555 model from Intersil). I didn't think of using crystals because of its drift over time and those good ones are hard to come by and are very expensive. I want to keep the project as affordable for myself as possible.

You did make a good point about calibration. I have no idea of working out that calibration of the converter. This discussion is getting more and more interesting...
Title: Re: frequency meter in a digital function generator
Post by: samfisher92 on December 29, 2014, 11:49:22 am
Quote
I got the waveform generation stage worked out.
Post the schematic of what you have done, it will be easier.

Quote
If you want to know the actual frequency, why not use a frequency meter that counts the cycles in one second, or similar?
A non reciprocal counter is too slow reacting in low frequency range to ajust the frequency. That's the reason why Hameg choosed the solution of ADC circuit.

I haven't really got time to draw the schematic out on my project book. But I know is that my function generator is based on the 555 timer with the necessary hardware to convert its sine wave output into triangle waveform, sawtooth, square wave like the integrator, differentiator.

And what do you mean by a non-reciprocal counter? Havent come across such a term before, mind explaining that?
Title: Re: frequency meter in a digital function generator
Post by: dannyf on December 29, 2014, 12:10:50 pm
It is not difficult to make a frequency-to-voltage converter out of a 555.
Title: Re: frequency meter in a digital function generator
Post by: samfisher92 on December 29, 2014, 01:21:53 pm
It is not difficult to make a frequency-to-voltage converter out of a 555.

Yeah I heard its monostable operation can be made into such a converter and its pretty simple.
Title: Re: frequency meter in a digital function generator
Post by: oldway on December 29, 2014, 03:07:36 pm
It seems you are looking for a very simple old school cheap function generator like this:

Title: Re: frequency meter in a digital function generator
Post by: dannyf on December 29, 2014, 03:41:33 pm
Basically, you dump given amount of charges into a capacitor. The frequency at which you dump the charges is the input frequency.
Title: Re: frequency meter in a digital function generator
Post by: tggzzz on December 29, 2014, 06:15:20 pm
Quote
I got the waveform generation stage worked out.
Post the schematic of what you have done, it will be easier.

Quote
If you want to know the actual frequency, why not use a frequency meter that counts the cycles in one second, or similar?
A non reciprocal counter is too slow reacting in low frequency range to ajust the frequency. That's the reason why Hameg choosed the solution of ADC circuit.

Just so. That's what I had in mind when i wrote "or similar"
Title: Re: frequency meter in a digital function generator
Post by: tggzzz on December 30, 2014, 01:07:40 am
To answer your questions, I intend to make a function generator that works from 1 Hz to 1 MHz using one of the newer 555 chips (take a look at ICM7555 model from Intersil). I didn't think of using crystals because of its drift over time and those good ones are hard to come by and are very expensive. I want to keep the project as affordable for myself as possible.

You will find that crystals are very cheap and very accurate compared to other standards. Expect to pay ~£2, e.g. http://uk.rs-online.com/web/p/crystal-oscillators/7675279/ (http://uk.rs-online.com/web/p/crystal-oscillators/7675279/)  I'm sure you can easily find ics that will act as frequency counters, with the additon of some seven segment displays.

Note the 555 circuit will drift with time/temperature/humidity/age/voltage far more than any crystal oscillator.
Title: Re: frequency meter in a digital function generator
Post by: Alex30 on December 30, 2014, 03:02:02 am
It seems you are looking for a very simple old school cheap function generator like this:

I like the look of that design, is it yours? Is there a write up somewhere explaining it's operation? Cheers.
Title: Re: frequency meter in a digital function generator
Post by: Christopher on December 30, 2014, 09:06:19 am
If you are outputting a signal from an MCU, why not display the frequency set point as it is on the lcd?

If the idea is to learn about frequency counters, then disregard this message :)
Title: Re: frequency meter in a digital function generator
Post by: oldway on December 30, 2014, 09:18:08 am
yes, it's mine. It has been developed to teach basic (analog) electronics to beginners.

To teach about:
Basic components: resistors, capacitors, diodes, zener diodes, bipolar transistors, ...
also 555, op amp.
Some important circuits: linear power supply (shunt regulator, serie regulator), op amp configurations, 555 as a window comparator and as oscillator, charge and discharge of a capacitor, amplifier classe B (and other classes too), ...
There are also improvements : better classe AB output amplifier, ajustable pulse width output, ...

This is basically an application of the Cmos version of the 555.
Works up to 800Khz, but should be used to 500Khz.
Sine output has aproximatively 4% distortion.
Square wave is right 50% duty cycle.
Triangular wave is not linear as capacitor is not charged with constant current.
Frequency stability depends on quality of the timing capacitors.
Output voltage is symetrical so it's not necessary to use an output capacitor.
Offset of output voltage is ajustable.
50R output impedance.

Frequency meter: With low frequency ranges (for example, 1Hz to 20Hz), a frequency meter is unusable because the frequency reading update is too slow. You must have a period meter. (time of one cycle) or a reciprocal frequency meter. (measuring the period T and displaying de frequency 1/T)
Frequency to voltage conversion is also unusable for the same reason. (too slow).
Try to ajust the frequency when the actual frequency is only displayed 2 of 3s later after ajusted, and you will understand what I mean.
Title: Re: frequency meter in a digital function generator
Post by: Alex30 on December 30, 2014, 09:48:20 am
Good stuff oldway, those specs sound quite nice. I might build this one at some stage after I have finished one or two other projects.

I know I could figure it out if I spent enough time looking at it and going through my textbook, but as you made it as a teaching exercise perhaps there is more explanation available regarding the function of the various components? If not that's okay, I'll bookmark this one for later. Cheers.
Title: Re: frequency meter in a digital function generator
Post by: oldway on December 30, 2014, 10:38:05 am
As this teaching exercise relates to the main basic electronic knowledge, it would take many hours and many pages of explanations.

Only thing I would like to add on is the reason of choosing the Cmos version of 555 and not the bipolar one.
As the 555 works as a window comparator (switching voltages = 1/3 and 2/3 Vdd), timing capacitor must be charged with a voltage = Vdd and discharged with a voltage of 0V to reach a 50% duty cycle.
Output voltage of Cmos version is nearby Vdd, output voltage of the bipolar version is only Vdd - 2V, and therefore, output wave is not 50% duty cycle with bipolar version of 555.
Cmos version is also faster.
Title: Re: frequency meter in a digital function generator
Post by: dannyf on December 30, 2014, 01:10:20 pm
Not sure what "digital" function generator you have but if it is controlled by a mcu, you should have a good sense as to its frequency.

Alternatively, you can measure the frequency with a mcu: beats out any of the analog solutions.
Title: Re: frequency meter in a digital function generator
Post by: samfisher92 on December 30, 2014, 02:49:05 pm
If you are outputting a signal from an MCU, why not display the frequency set point as it is on the lcd?

If the idea is to learn about frequency counters, then disregard this message :)

As a matter of fact i am learning about frequency counters but i appreciate your input :)

thanks
Title: Re: frequency meter in a digital function generator
Post by: Rerouter on January 01, 2015, 10:44:13 am
If the amplitude does not dramatically change, (function generator vs arbitary waveform), you can get away with a ac coupled transistor at the most basic, next step up would be 1 op amp for adjustable sensitivity, or 2 op amps for that and a sh-mitt trigger output with clean edges,

This leaves you with something you could feed into a micro with edge triggering, my solution was aimed at automotive signals up to 25KHz, but in practice works up to ~280Khz, and could be made to work higher.

U5B is the sensitivity adjustment and biases the transistor to being on just enough to sit in the schmitt triggers dead band, U5A is the schmitt trigger, this was intended to be flexible out in the field working between 15mv signals to 400V spikes off the low side of the ignition coil so forgive the complexity but a lot of though went in to it. and it is very hard to damage.
Title: Re: frequency meter in a digital function generator
Post by: samfisher92 on January 03, 2015, 02:33:25 pm
If the amplitude does not dramatically change, (function generator vs arbitary waveform), you can get away with a ac coupled transistor at the most basic, next step up would be 1 op amp for adjustable sensitivity, or 2 op amps for that and a sh-mitt trigger output with clean edges,

This leaves you with something you could feed into a micro with edge triggering, my solution was aimed at automotive signals up to 25KHz, but in practice works up to ~280Khz, and could be made to work higher.

U5B is the sensitivity adjustment and biases the transistor to being on just enough to sit in the schmitt triggers dead band, U5A is the schmitt trigger, this was intended to be flexible out in the field working between 15mv signals to 400V spikes off the low side of the ignition coil so forgive the complexity but a lot of though went in to it. and it is very hard to damage.

i think that is a really good design. its not really that complex to me. It is just using U5B to set the amount of voltage needed to turn on Q9 to generate a pulse. it also makes use of the advantage that schmitt triggers are much lesser prone to noise compared to pure op amp-based comparator circuits. nice one