# How To Detect Start and End of Signal?

Joined Oct 26, 2012
254
How to detect only first rising edge in a train of pulses? Input will vary over a wide frequency range, but the lowest possible frequency is known.

I think it might require a latch. Wondering what's the dead-simplest way to do this. Possible with rudimentary CMOS logic?

• The source has no signal at first. Output should be low.
• Suddenly, a train of square wave begins. The first pulse should drive the output to high.
• Subsequent falling edges won't drive the output low.
• When the train of pulses stops, output should return to low.

Input:

Output:

#### Attachments

• 3.1 KB Views: 1
• 1.7 KB Views: 2
Last edited:

#### AlbertHall

Joined Jun 4, 2014
9,642
Look for 'missing pulse detector'.

Joined Oct 26, 2012
254
Look for 'missing pulse detector'.
At first glance, i'm seeing circuits involving 555 timers. I'm guessing, therefor, that such circuits only work with a specific input frequency, correct?
thx

#### MrChips

Joined Oct 2, 2009
20,884
Look up retriggerable monostable multivibrator, CD4528 or MC14528 or MC14538.

Joined Oct 26, 2012
254
Look up retriggerable monstable multivibrator, CD4528 or MC14528 or MC14538.
Is it correct to say that repeated input pulses will keep the the output high until input pulses stop coming?

"Monostable Multivibrators can produce a pulse whose leading edge rises in time with the externally applied trigger pulse and whose trailing edge is dependent upon the RC time constant"
https://www.electronics-tutorials.ws/waveforms/monostable.html

That sounds right, as i want no delay between my input rising edge and output rising edge.

"This RC time constant may be varied with time to produce a series of pulses which have a controlled fixed time delay in relation to the original trigger pulse as shown below."

Ok that part confuses me:
- Series of pulses? I thought we only get one pulse per trigger.
- Delay? I thought the output leading edge is in-sync with input leading edge.

#### WBahn

Joined Mar 31, 2012
25,556
You signal diagram shows three levels. It has an intermediate level when there is not signal and the the squarewave goes between two levels that are noticeably different that the idle level. Is that what your signal actually looks like?

#### MrChips

Joined Oct 2, 2009
20,884
The output pulse-width is determine by the RC time-constant.
For a non-retriggerable monostable multivibrator, the pulse width is fixed.
For a retriggerable monostable multivibrator, the output pulse will remain active if a new trigger occurs before the output pulse is ended. In such a case the output pulse will last for another time-constant after the last trigger input.

Joined Oct 26, 2012
254
You signal diagram shows three levels. It has an intermediate level when there is not signal and the the squarewave goes between two levels that are noticeably different that the idle level. Is that what your signal actually looks like?
I'm not sure what you mean, but those are just rough drawings. Assume clean squares coming in.

For input, I can provide either a bipolar square-wave, positive-going only, or negative-going only. Whichever is easiest to work with.

#### crutschow

Joined Mar 14, 2008
24,723
The important question is: how long after the pulses stop do you want the signal need to go low?
That time must be longer than the longest period of the lowest frequency square wave.

#### atferrari

Joined Jan 6, 2004
3,920
The important question is: how long after the pulses stop do you want the signal need to go low?
That time must be longer than the longest period of the lowest frequency square wave.
If you intend to detect just one burst, that would be enough but if the bursts repeat, make sure you are ready to detect the actual respective new starting edge.

#### Janis59

Joined Aug 21, 2017
1,148
By differentiating RC circuit will produce positive if raising edge and negative when falling edge. Opamp may proceed this signal for later servo.

Joined Mar 10, 2018
4,057
Something like this should work. Single chip design. One line of code needed
to start PWM only code needed.

Code:
TCPWM_Start( );
Note PWM period sets the inactive time no pulses present to determine when
end of pulse train has occurred. In other words this controls latency to resetting
D indicating end of pulse train. Thats a user config setting.

Lots of other resources for additional design needs available in chip, see right hand window
for resources used/left.

IDE (PSOC Creator) and compiler free. https://www.cypress.com/products/psoc-creator-integrated-design-environment-ide

Board for dev work or final solution (\$10) https://www.cypress.com/documentation/development-kitsboards/cy8ckit-043-psoc-4-m-series-prototyping-kit

Regards, Dana.

Last edited:

Joined Oct 26, 2012
254
By differentiating RC circuit will produce positive if raising edge and negative when falling edge. Opamp may proceed this signal for later servo.
Can you explain or show circuit? thx

#### crutschow

Joined Mar 14, 2008
24,723
Here's the LTspice simulation of a circuit using a CD4093 Schmitt-trigger NAND gate that should do what you want.
The R1C1 time-constant determines how long after the input signal stops that the output goes low.
Obviously that time needs to be longer than one cycle period.

#### crutschow

Joined Mar 14, 2008
24,723
The circuit I posted has an off delay as determined by the lowest frequency of the square-wave.
If that delay is too long for the higher frequency square-waves, then you will need some intelligence in the circuit, such as from a microprocessor.
The microprocessor can start the output detect pulse at the start of the input pulse train, measure the first square-wave period, and then stop the output pulse when there is a subsequent square-wave period longer than that.
That way the delay for the output pulse to stop is never significantly longer than the square-wave period, independent of the square-wave frequency.