Need a simple circuit for detecting a TTL-level square wave

This is the place for any magazine-related discussions that don't fit in any of the column discussion boards below.
Post Reply
Michael Craft
Posts: 3
Joined: Mon Oct 08, 2007 7:51 pm
Contact:

Need a simple circuit for detecting a TTL-level square wave

Post by Michael Craft »

Longtime subscriber to Nuts and Volts here. :)

I would like to build a circuit to detect the presence of a TTL-level square wave produced by a microcontroller. (I know nothing about the micro-controller... I did not program it. I'm simply trying to interface to it.) However, I can control whether or not the square wave is "on" or "off" by pressing a button connected to the micro-controller.

I hooked an oscilloscope to the square wave and took some measurements. When I press the button to turn on the square wave, it has a frequency of 60 Hz, duty cycle of 50%, a low voltage of 0 V, and a high voltage of 5 V. In other words, a regular 'ol TTL square wave. When I press the button to turn off the square wave, it will either be at 0 VDC (continuous) or 5 VDC (continuous).

As mentioned above, I would like to build a circuit to detect the presence of this square wave. When the square wave is "on," my circuit should produce some kind of signal (like 5 VDC). When the square wave is "off," my circuit should produce around 0 V.

I've thought about different ways of doing this. All else being equal, I would like the solution to be very simple and have a low parts count. I would also rather not use a clock signal. (It means I would have to build a clock.)

One idea was to use a frequency-to-voltage converter. I also thought of sending the signal through a high-pass filter (with a cutoff frequency around 20 Hz or so), and then to a peak detector (diode + capacitor + bleed-off resistor). Yet another idea was to use an RMS-to-DC converter.

Ideally, I would love to use some kind of integrated circuit that is designed to detect square waves/clock signals and produces a "1" when it detects it. But I haven't been able find a chip that would do this.

Once I find a solution to this problem, I plan on publishing an article to N&V. It's a pretty neat application, and is something I think a lot of people will want to build. I will also include acknowledgements in the article.


Thanks,

Michael Craft
Saint Paris, OH
[email protected]
Franklin97355
Posts: 42
Joined: Sat Nov 03, 2007 10:00 pm
Contact:

Post by Franklin97355 »

A capacitor would conduct with ac and not with dc. That could be your filter.
sghioto
Posts: 326
Joined: Wed Dec 26, 2007 5:16 pm
Location: Colorado
Contact:

Post by sghioto »

"Missing Pulse" detector circuit will work. This circuit is out of the 555 timer handbook. Circuit has been breadboarded and works with component values as shown in the schematic.

Steve G


Image
jimandy
Posts: 572
Joined: Sat Dec 04, 2004 1:01 am
Location: Birmingham AL USA
Contact:

Post by jimandy »

I believe a 74123 retrigerable monostable would work.
"if it's not another it's one thing."
Robert Reed
Posts: 2277
Joined: Wed Nov 24, 2004 1:01 am
Location: ASHTABULA,OHIO
Contact:

Post by Robert Reed »

Hello Michael
Am I missing something here. If I read you right, you want to detect a 60 Hz square wave and nothing else - not 0 or +5VDC. Is there anything else occurring on the line besides this. Since you didn't mention any thing, I'll assume the line only has one of the three conditions above. If that is correct, the solution is incredibly simple - a coupling capacitor, a rectifier and filter driving an LED. If there is more going on with that output - please explain.
Michael Craft
Posts: 3
Joined: Mon Oct 08, 2007 7:51 pm
Contact:

Post by Michael Craft »

Thanks for all the responses!!

The missing pulse detector looks like it might work.

Robert Reed: Yep, it's that simple. And I've thought about doing exactly what you've said. (See in my OP about using a HP filter.) The only potential problem is that I'd be hanging quite a few passive components onto the square wave, and the square wave probably doesn't have real low impedance. I many have to buffer it.

But thanks for the advice, guys. I'll be looking at all these approaches.
k7elp60
Posts: 226
Joined: Wed Dec 05, 2001 1:01 am
Location: Ivins, UT
Contact:

Re: Need a simple circuit for detecting a TTL-level square w

Post by k7elp60 »

[quote="

Ideally, I would love to use some kind of integrated circuit that is designed to detect square waves/clock signals and produces a "1" when it detects it. But I haven't been able find a chip that would do this.

Once I find a solution to this problem, I plan on publishing an article to N&V. It's a pretty neat application, and is something I think a lot of people will want to build. I will also include acknowledgements in the article.


Thanks,

Michael Craft
Saint Paris, OH
[email protected][/quote]
You might try a tone decoder such as the LMC567(available from digikey)
If I read the data sheet correctly the output would be low when it detected the 60Hz but I am sure you could use the logic level to drive a buffer.
Robert Reed
Posts: 2277
Joined: Wed Nov 24, 2004 1:01 am
Location: ASHTABULA,OHIO
Contact:

Post by Robert Reed »

Michael
One emitter follower could be inserted after the filter to drive the led. With the LED drawing 10 ma , almost any GP transistor would only impose a 50K or higher load on the filter circuit. This would allow for a very small filter capacitor which inturn looks like a higher impedance to the incoming squarewave.
Remember that after the first few cycles, the capacitor is charged and looks like a high impedance to that square wave. At worst you would suffer a slight degrdation in rise time (don't know how important that is for your requirements). Or better yet use a C-Mos device, even a logic gate. Now the filter can be very small and have virtually no load on the square wave.
Post Reply

Who is online

Users browsing this forum: No registered users and 26 guests