Welcome to ETO.
Unless the duty cycle is changing rapidly you could guestimate the lowest possible PWM frequency and use a filter with an RC time constant of, say, at least 20 times the period of the PWM, depending on the accuracy you need.
You could use the PWM source to clock a multi-stage counter such as a CD4020, and monitor the final stage (Q14) output.How can I guestimate a frequency?
Thanks for the replys, seems like I going to have to borrow my mates scope...
Let me explain the application, I have a kit car with a CBR1000 engine installed. Over the last few months I have been changing the dash, the old dash had a 12v LED installed to indicate neutral gear from the signal discussed above from the engine ECU (14v rms PWM duty Cycle)
I want to be able to identify all gears and display on a LCD.
Thanks MikeMI for your comments and it does seem like I need the frequency to build a valid RC filter, but I won't need a comparator because the DC voltage will go direct to my Microcontroller and I can read the voltage to know my gear selection. Don't need an amazing resolution as long as I can differentiate from the 6 gears it doesn't matter, I can also have a fair bit of ripple on the signal as long as the signals are separate and in a large enough window to see a change.
Tony, if I don't get the scope over the next few days I will be tapping you to discuss more about your idea. Thank you.
And Dr Doggy, thanks for your comments and I have been thinking in writing a quick capture program on my microcontroller to see frequency but didn't want to waste my time... if I cannot get the scope I will have to do something. I'm hoping to get the scope over the next few days so will be coming back here to discuss my filter cct.
Thanks all.
Jason.
If the signal is going to a microcontroller why not just measure the length of the positive or negative part of the PWM signal ?
Les.
Hi Hutto,
Just put a 10K resistor in series with the PWM signal and connect a 100nF (0.1uF) ceramic capacitor from the free end of the 10K resistor to 0V.
A DC signal, proportional to the PWM mark-to-space ratio, will be across the capacitor.
If that does not get the result that you want, just place more capacitors across the 100nF capacitor (but keep the ceramic capacitor connected): 220uF (0.22uF), 470nF (0.47uF), 1uF, 2.2uF, 4.7uF, 10uF, 22uF, 47uF, 100uF, 220uF, 470uF.
When the DC voltage is sorted, post what the DC voltage readings are and we can work out a suitable attenuator, if necessary, to get the voltages you need for your processor.
spec
I'll decide depending on what you determine with frequency...
But an AUX audio PC input should be able to hear it and see it on PC with free AUDACITY ( like a scope and spectrum analyzer) . not sure why Pico would not.
YOU MUST you use twisted pair signal/gnd when wire is more than a couple feet. and sometimes more than 3 inches depending on slew rate.
There are several methods to logically detect PWM, Integrate and hold, trailing edge Sample & Hold on a sawtooth sync'd to PWM frequency to get a stable voltage on 1st pulse and every pulse.,, LPF then 6 cascaded window comparator detectors ( like a 3 bit flash ADC )
RMS of 14v, 10v, 8v, 6v, 4v and 2v
You Pico scope isn't it able to show 20 KHz?
Hi Jason,
The waveform does not look like a PWM signal. Both edges should be a fairly fast transition. Your waveform looks like it is being loaded with a capacitor. the fact that the loading effect is only seen the falling edge looks like it is driven with active pull up but only a resistor to ground. It would be interesting to see af adding a resistor to ground improves the falling edge. I would suggest starting with a 10 K resistor. When you say "You can see me selecting first from neutral and then back to neutral." I do not know which two traces we are comparing.
Les.
Hi Jason,
I had miss read the timebase scale as 2 mS instead of 2 seconds so I assumed that we were looking at the same waveform but with a different timbase scale. (2 mS per div and 20 mS per div.) Are we looking at the raw PWM waveform or the output of the low pass filter ?
Les.
We use cookies and similar technologies for the following purposes:
Do you accept cookies and these technologies?
We use cookies and similar technologies for the following purposes:
Do you accept cookies and these technologies?