# DC from clock

Discussion in 'Electronic Design' started by Ankur Kashyap, Nov 12, 2003.

1. ### Ankur KashyapGuest

I have a variable 0-5V square wave of variable freq .5 - 10 MHz. I
need to extract the DC voltage level from the sqr wave. Suggest me ckt
design.
This DC level would fed to A/D & value would be read from micro
controller. I've developed A/D & controller ckt already.

2. ### Frank BemelmanGuest

average the others...

3. ### John LarkinGuest

in-------r--------+--------out
|
c
|
gnd

John

4. ### BanGuest

John Larkin wrote:
|| On 12 Nov 2003 10:15:59 -0800, (Ankur
|| Kashyap) wrote:
||
||| I have a variable 0-5V square wave of variable freq .5 - 10 MHz. I
||| need to extract the DC voltage level from the sqr wave. Suggest me
||| ckt design.
||| This DC level would fed to A/D & value would be read from micro
||| controller. I've developed A/D & controller ckt already.
||
||
|| in-------r--------+--------out
|| |
|| c
|| |
|| gnd
||
||
|| John

The question is a bit unclear, I understand he has a squarewave of 50% duty
cycle and wants to measure the frequency.
Here is an equally simple circuit, that should have a moreless linear
relationship:

27p
|| |\ | .25V/MHz
o---||----+-----| >|-----+------+-----o
|| | |/ | | |
--- .-. |
/^\ | | ---
--- 1k| | --- 1n
| '-' |
| | |
=== === ===
GND GND GND

the diodes are low capacity Schottky, the values of C can be varied. It is
called a charge pump? or f->V converter. You can then digitally linearize
with LUT.

ciao Ban

5. ### John LarkinGuest

Oh; I thought he wanted the average DC level. Agree on 'unclear'.

John

6. ### mikeGuest

You need to better define what you're trying to measure.
Is the square wave EXACTLY square?
The square wave has a peak value, an average value, an RMS value,
a (pick whatever statistical unit you like) value. If one of the levels
is not ground, you have a bunch of other numbers you could calculate.
Unless the top is PERFECTLY flat, you have all sorts of similar
issues about what particular metric you want to use on the non-flat top.

If you want to measure all the way to zero.zero, you have noise and
dynamic range issues. Unless your method of changing the amplitude is
perfect, the statistics of your square wave will change with amplitude.

How precise and accurate do the numbers have to be? Think before you
answer. It makes a BIG difference. As good as possible is NOT an answer.

At these frequencies, the physical topology (stuff that doesn't show up

So, what is it you're trying to accomplish?
mike

--
Bunch of stuff For Sale and Wanted at the link below.
laptops and parts Test Equipment
Honda CB-125S
Tek 2465 \$800, ham radio, 30pS pulser
Tektronix Concept Books, spot welding head...
http://www.geocities.com/SiliconValley/Monitor/4710/

7. ### Luhan MonatGuest

Exactly why are you wanting to do this? Your question, on the surface,
makes little sense.

8. ### BanGuest

Ban wrote:
|| John Larkin wrote:
|||| On 12 Nov 2003 10:15:59 -0800, (Ankur
|||| Kashyap) wrote:
||||
||||| I have a variable 0-5V square wave of variable freq .5 - 10 MHz. I
||||| need to extract the DC voltage level from the sqr wave. Suggest me
||||| ckt design.
||||| This DC level would fed to A/D & value would be read from micro
||||| controller. I've developed A/D & controller ckt already.
||||
||||
|||| in-------r--------+--------out
|||| |
|||| c
|||| |
|||| gnd
||||
||||
|||| John
||
|| The question is a bit unclear, I understand he has a squarewave of
|| 50% duty cycle and wants to measure the frequency.
|| Here is an equally simple circuit, that should have a moreless linear
|| relationship:
||
|| 27p
|| || |\ | .25V/MHz
|| o---||----+-----| >|-----+------+-----o
|| || | |/ | | |
|| --- .-. |
|| /^\ | | ---
|| --- 1k| | --- 1n
|| | '-' |
|| | | |
|| === === ===
|| GND GND GND
||
|| the diodes are low capacity Schottky, the values of C can be varied.
|| It is called a charge pump? or f->V converter. You can then
|| digitally linearize with LUT.
||
|| ciao Ban

Only now I've done a simulation and found out it is better to increase the
resistor to 10k, if your A/D already has that input resistance, you can drop
the resistor alltogether. The relationship is nearly logarithmic, but always
monotonous. The quality of the diodes is important.
If you buffer with an opamp and filter a bit more, you get a nice clean DC.
It's a cute circuit, there are also integrated solutions, but a bit more
complicated.

ciao Ban