Maker Pro
Maker Pro

Square wave signal with ADC converter

tnnelectro

Apr 5, 2012
54
Joined
Apr 5, 2012
Messages
54
Hi,
I have a 7Hz 5Vpp square wave signal, you give me an advice on an easy way, to turn that signal into the corresponding DC voltage, so I can read it through the microprocessor's ADC converter?

Thank you.
 

kellys_eye

Jun 25, 2010
6,514
Joined
Jun 25, 2010
Messages
6,514
If the squarewave has a 50% duty ratio then simple smoothing should result in HALF the signal amplitude i.e. your 5V signal will give a 2.5V output therefore a x2 buffer will give the 'real' voltage.

If the duty cycle is variable you have a few more issue to resolve. There are some dedicated frequency-to-voltage converter ICs out there - check out the LM2907 as an example.
 

WHONOES

May 20, 2017
1,217
Joined
May 20, 2017
Messages
1,217
If all that you are interested in is the DC level of the signal then, a peak detector is all that you need otherwise, do as Kellys_eye suggests.
 

BobK

Jan 5, 2010
7,682
Joined
Jan 5, 2010
Messages
7,682
If you are trying to measure something, something ought to be varying. You have not told us what. It might be the frequency, the peak voltage, the duty cycle, or something else. So, what are you trying to measure?

Bob
 

tnnelectro

Apr 5, 2012
54
Joined
Apr 5, 2012
Messages
54
the request is:
take a square wave signal with a fixed width of 0-5V and a variable frequency (3Hz to 10Hz, approximately) and convert it into a continuous signal ...
I hope I was clear...
 

duke37

Jan 9, 2011
5,364
Joined
Jan 9, 2011
Messages
5,364
I have never used a modern microprocessor to measure voltages but surely the ADC can be actuated fast enough to enable the average, however you define this, to be calculated.
 

Alec_t

Jul 7, 2015
3,591
Joined
Jul 7, 2015
Messages
3,591
Why can't you use the micro's ADC directly to sample the voltage and deduce the peak value (if that is what you want) from the measured samples?
 

BobK

Jan 5, 2010
7,682
Joined
Jan 5, 2010
Messages
7,682
the request is:
take a square wave signal with a fixed width of 0-5V and a variable frequency (3Hz to 10Hz, approximately) and convert it into a continuous signal ...
I hope I was clear...
You are far from clear.

I have no Idea what “a fixed width of 0 to 5V” means. Volts is not a measure of width, and 0 to 5 is not fixed.

“Variable frequency” I can understand.

“Convert it to a continuous signal” again has no clear meaning. If I output a steady 5V I would meet that requirement, but I doubt that is what you want.

So how is the output signal related to the input signal? You still have not answered that crucial question.

Bob
 

hevans1944

Hop - AC8NS
Jun 21, 2012
4,886
Joined
Jun 21, 2012
Messages
4,886
Why is it so hard for people who come here asking for help to tell us up front wtf they are trying to DO? I agree 110% with @BobK, the OP is far from clear. I think @Ian should consider a permanent ban on those who require an extended exchange of questions by EP responders and "answers" by the OP, that do not clarify, just to simply get a coherent and specific message across of what exactly the OP is trying to DO. Makes me think this sort of person is just a troll wasting our time.

We are now up to three responses from the OP and still nothing that defines the problem.

Hop
 
Top