A PWM signal has a minimum duty cycle of 5% and a max d.c. of 95%. I need to switch on a LED when the d.c. is above or equal to 10%. And switch when d.c. il less then 10%.
Thank You for any suggestion.
Thank You for any suggestion.
Thank You MikeML,Low pass filter it to average it.
Assuming that it is a fixed maximum amplitude PWM signal, voltage compare to 10% of peak amplitude.
To design a circuit I would need the frequency and amplitude of the PWM signal.
Unfortunately no, the controller is out of my control. I can only manage the PWM signal.This sounds like the PWM is already coming out of a microcontroller. Can you just use a new port pin and do the comparison in code?
Please could tou better explain "The trip point is twice the pulse widh " ?The trip point is exactly twice the pulse width, so you don't need a reference. One-half of an LM393 is pretty simple. (OK, I frequently say that.)
ak
Come again?The trip point is exactly twice the pulse width, so you don't need a reference. One-half of an LM393 is pretty simple. (OK, I frequently say that.)
Please could tou better explain "The trip point is twice the pulse widh " ?The trip point is exactly twice the pulse width, so you don't need a reference. One-half of an LM393 is pretty simple. (OK, I frequently say that.)
ak

Nice, any chance of helping him with the 90% duty cycle also?Green is 9% duty cycle, Red is 10% duty cycle, and Blue is 11% duty cycle. Note how the LED goes from full off to full on as the voltage from the LPF decays below the trip-point voltage of 528mV. Note that with R2 and R3 as shown, the trip point is ratiometric with the 5V supply, so if it is not exactly 5.00V, you will have to tweak R2/R3...View attachment 85016
Where does 90% come from?Nice, any chance of helping him with the 90% duty cycle also?
You're right, I misread his first post. I thought he wanted within 10% of each limit.Where does 90% come from?
I haven't a programmer background experience, so i use only analog or digital solution, but without micro and software.Do you want an analog solution or do you prefer a digital (microcontroller) solution?
For an analog solution, you could use a low-pass filter which will give a voltage proportional to the duty cycle. Then a comparator could assess that voltage for your LED's.
John
Very good solution.Green is 9% duty cycle, Red is 10% duty cycle, and Blue is 11% duty cycle. Note how the LED goes from full off to full on as the voltage from the LPF decays below the trip-point voltage of 528mV. Note that with R2 and R3 as shown, the trip point is ratiometric with the 5V supply, so if it is not exactly 5.00V, you will have to tweak R2/R3...View attachment 85016
Do you suggest a single or double pole active filter for this application ?You can use any comparitor. I used the LT1018 because I knew it works on a single , low voltage supply....
The only advantage an active filter over the single pole RC filter I used is that the LED would turn on more abruptly, and follow changes in duty cycle a bit faster.