# Converting varying frequency and duty cycle to varying frequency fixed duty cycle

I have an LM331 which is outputting variable freq. with an input of 0-10V. The output freq. of LM331 is is varying between 50Hz to 900Hz. But the pulse width creates some trouble for the next stage. Around 50Hz the ON time is too long; and around 900Hz the ON time is too short. I want more equal ON OFF time in any case(anything between 30 to 50 percent duty cycle would be fine).

I tried with a 555 one shot topology but that didn't help. It just fixes the pulse ON time. That means it only solves the problem if the incoming pulse width was fixed.

But in my case both the freq. and the pulse width changes.

So I basically want to keep the freq. same(or halved) for an input voltage with a more even ON OFF time(duty cycle around between 30% to 50%) at the output. Some suggested using 74HC74 for the purpose but I have no experience with that. I couldn't find a similar application. How can I solve this issue without using a microcontroller?

To be more clear I need the variable frequency output from the LM331 have 50% duty cycle at any freq. output. Frequency will vary as usual linearly to the 0..10V input; but the duty cycle(ON_time/Period ratio) should not vary much(fixed at 50% or 30% to 50% would be fine).

• So you want to convert the 0-10 signal to a fixed frequency PWM? Commented May 27, 2017 at 15:31
• No I just want the variable frequency output from the LM331 have 50% duty cycle. Commented May 27, 2017 at 15:32
• so you want a VCO? with finite tuning range, like any PLL chip or variable Astable. any one shot can be tuned by current and then converted to square wave Commented May 27, 2017 at 15:39
• What about pre and clr? Commented May 27, 2017 at 16:02
• Tie them to Vcc. If you have problems in simulation (and it is better for real life) you can place a small capacitor (about 10nF) from one of them to ground and a resistor (about 4.7k) to Vcc and the other should be tied to Vcc. On my previos comment I proposed putting both a reset RC circuit but it is wrong, because those pins are concurent. Commented May 27, 2017 at 16:13

You can use a T-flip flop. It will divide the frequncy by 2 but the duty cycle will be 50% (at steady state). You can double the frequency at the previous stage (LM331) to match your needs.

simulate this circuit – Schematic created using CircuitLab

(T) of this flip-flop mathes (D) on 74HC74. If using the first part on 74HC74 pins would be:

T = pin 1
CLK = pin 3
Q = pin 5
~Q = pin 6


Here is a better schematic:

• Many thanks please see my edit. I want to try your suggestion in LTspice. But the datasheet and LTspice have different pin names than in yours. How can I configure this in LTspice? Commented May 27, 2017 at 15:51
• Yes, but this is less than half of an answer, as you provide no details on the hard part, which is doubling frequency of a signal with a frequency range of greater than 10x. Commented May 27, 2017 at 15:58
• @ChrisStratton Sure, but how can I do this without knowing the OP's schematic of Lm331? You're right that my proposal might lead him to another problem while doubling the frequency, but he seems pretty confident with his LM331 stage. Let's see what will his simulations say :) Commented May 27, 2017 at 16:03
• doubling or halving frequency is not important I will still have 0..10V linearly proportional to freq. Commented May 27, 2017 at 16:04
• Woow mate it works great now! Commented May 27, 2017 at 16:07