# How do you convert a changing input (square wave) into a single high signal?

I am designing a circuit which will output a square waveform for a specific duration of time (t) but I need to be able to read the square waveform using a processor so would like to turn the changing square waveform into a single high pulse for time (t). The frequency of the waveform could be too high for the processor to read directly so I am looking for a method to convert it to a single high pulse (with duration t). I first thought about using a small capacitor which would be charged up during the rise of the square waveform and then be discharged through the low part of the waveform but I am unsure if this would work and what value the capacitor would need to be. Ideally I need way which does not use ICs (simple discrete components only would be best). Any ideas? Dan

• Have you tried a LPF? – Ignacio Vazquez-Abrams Jun 19 '15 at 15:29
• An LPF, followed by a comparator if you need a logic level output, should work fine. – Nick Johnson Jun 19 '15 at 15:37
• Would a comparator work though during the low parts of the square waveform (my output is basically a chain of square pulses)? – dan15 Jun 19 '15 at 15:47

You need a retriggerable one-shot, like the 74HC423 The first rising edge will make the output high, and each subsequent rising edge will keep it high. The output will not go low until there is a time period between rising edges that exceed the output pulse width.

In the world of logic chips, one-shots aren't the greatest of ideas, and are considered to be cheats in many cases, but here it seems to make OK sense.

What is required is an RC & a circuit with a schmitt input. This couple be constructed from a comparator or...a couple of 74HC14 - schmitt input inverter (two just to re-invert the original inversion)

simulate this circuit – Schematic created using CircuitLab

simulate this circuit

• That would delay the rising edge of the output to be later than the beginning of the square wave, while a retriggerable one shot won't. This might be fine behavior for the asker. – Scott Seidman Jun 19 '15 at 16:35
• True, he might not want that. but it is easily fixed - diode. Its just another way of doing something similar – JonRB Jun 19 '15 at 16:37
• The cap will charge (almost instantly) but will take longer to discharge on a low. As long as a 74HC14 is used it will be fine – JonRB Jun 20 '15 at 21:02