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?
What does the 5Vpp look like? Is it oV to 5V or is it -2.5 to +2.5 ? Is it AC coupled through a capacitor?
I assume the 5Vpp signal must change in value. Why measure some that you know to be 5Vpp? So when the signal changes what happens? Will it change to 0 to 4.8V? or does it change like this (0.1 to 4.9V)?
It is safe to assume it is 50% on 50% off. (0/5V)
I think it is 0 to 5V and DC coupled. I think you ADC reads form 0 to 5V but don't know.
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...
In the schematic:
Signal source; 0V 5V 10hz
The diode catches the peak signal. The capacitor stores the energy.
There will be some voltage loss because the diode. Vout is 4.7 volts. This is how a volt meter measures AC voltage.
Green trace is the 5Vpp signal. Blue trace is output.
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...
I believe what you want to do is convert a PWM signal to a DC voltage. This article will show you want you need to know. Digital to Analogue Conversion.....
This method will read 2.5 volts because it takes the average. And any change in duty cycle will effect the readings. But because we don't really know what you want to do we are just giving ideas.
This method will read 2.5 volts because it takes the average. And any change in duty cycle will effect the readings. But because we don't really know what you want to do we are just giving ideas.
tonytnnelectrotech: How long are you willing to wait for the dc level to accurately represent the average value of (pulse width/pulse period) before sampling it with the ADC? (This has to do with how aggressive the filtering has to be.)
How accurate is the 5V peak value of the pulse train? (Does it need to be normalized to the the ADC's Vdd supply in order to make the reading accurate.)
As long as every one had a different idea as what is wanted:
"square wave" usually = 50% low, 50% high
"fixed width" = on for 0.05 seconds and off for a variable amount of time so the frequency can be from 3hz to 10hz. Example: fixed on time, variable off time. (not 50%, 50%)
"continuous signal" A square wave is continuous if it is never turned off. A triangle wave is also continuous if it goes forever. I am certain that who ever made up this assignment wants a output that never changes voltage; that is not stated.
What is almost clear is that Tony has given up on us and gone away.
As the saying goes :
Describe the problem correctly, and you have the problem halfway solved.
Unfortunately on this and most of the technical forums I lurk, stating or describing a problem incorrectly is commonplace.
And I am not talking about members whose mother tongue is not English. Those I can understand if they have a poorly translated sentence.
No, I am talking about individuals which do not understand what they want to accomplish or why they want to do it a particular way.