Hi, I need to detect a presence of square wave. If square wave is there I need to generate a logic 0 and this square wave is not present I need to generate logic 1 or vise versa. Can you suggest me a circuit for this functionality.
First, you have to do a lot better than that at defining "square wave". You might be surprised at the variety of signals that have been called square waves.
And, for what period can the square wave be present (absent) before the output must correctly signal its status?
If you've got enough time, you could use a technician, an oscilloscope and a toggle switch. Technician examines the 'scope periodically and, if the wave status changes, flips the switch to the correct position.
;-)
--
Paul Hovnanian paul@hovnanian.com
-----------------------------------------------------------------------
Procrastinators: The leaders for tomorrow.
the question i would have is: detect the presence of the square wave against what other alternative? silence or noise?
we probably won't know that; no common timebase...
that's an issue of setting a threshold.
but we should know that. if we do, i would say to cross-correlate with, say, two different square waves of the known (or trial) frequency that have fundamental 90 degrees apart.
if we *did* have a common timebase and could do synchronous detection, it would be just a single square wave to cross-correlate with. hmmm... maybe a matched filter implemented as an FIR with a stretch of square wave as its impulse response. that might work for either synchronous or async.
FWIW, many, many years ago I built an intrusion alarm with a superregen receiver that listened for a homemade keyfob's signal; the rcvr quieted in the presence of the carrier, noise power dropped and the superregeneration frequency spectrum narrowed; filtering as per your suggestion above worked well and the system was quite robust.
--
Paul Hovnanian mailto:Paul@Hovnanian.com
------------------------------------------------------------------
Opinions stated herein are the sole property of the author. Standard
disclaimers apply. All rights reserved. For external use only. If
irritation, rash or swelling occurs, discontinue use immediately
and consult a physician. Void where prohibited.
Close. The local multiversity, UCSC, has a "History of Consciousness" major, which should provide an endless supply of graduates capeable of detecting a square wave:
I hate to admit it, but there was a time in the early 1960's when I worked on a job that resembled a "square wave detector". In this case, I was sentenced to stare at a Tek 520A vector display, for what seemed like endless hours, and yell of help if anything changed. Unfortunately, things did change so I really did need to pay attention. After about 10 consecutive days of this nonsense, I simulated a mental breakdown, and was assigned a more creative task. That was sweeping the floor from all the crud that was falling from the ceiling during construction.
B.F. Skinner trained pigeons to peck at a CRT to run a guided missile.
I guess a graduate student can be trained to do the same.
--
Jeff Liebermann jeffl@cruzio.com
150 Felker St #D http://www.LearnByDestroying.com
Santa Cruz CA 95060 http://802.11junk.com
Skype: JeffLiebermann AE6KS 831-336-2558
--- Assuming you mean a square wave looks like this:
__________ _____ ___| |__________|
||| | | ||
You could use a couple of counters, a clock, a magnitude comparator and some glue logic to do it in hardware and determine whether clocks accumulated during time t1 were equal to the number accumulated during t2. If they are, then a square wave is present.
Use one counter to accumulate clocks during t1, the other to accumulate clocks during t2, the edges to do the comparisons and then to clear the counters on the fly. That way your worst latency will be 1/2 cycle. You'll also need to do a zero detect so you won't detect 0 counts = 0 counts as a square wave.
Or just reset a counter every input edge, and clock it from something else. When it reaches some terminal count, it hangs, and that's the timeout. We do that in FPGAs as signal-loss detectors.
Thanks in tones ..for all the idea. The signal is not 50% duty cycle. This signal is coming from other card. I need to glow a LED if square wave is present. Voltage level is digital i.e 0V and +5V. Basically if there is toggle in the line I need to drive low and if no toggling drive high. If this detection can be done using simply digital circuit along with capacitor and Diode will be great.
--
I took: "I need to detect a presence of square wave." to mean that
he wanted to determine whether the signal was 50% duty cycle (a
square wave) or not; not something one can easily detect with a
123.
As it turns out all he wants to know is, "Is the signal there?" so
sure, a 123 would work, but why waste 1/2 a chip?
Is the not-so-very-square wave the only possible signal present?
How soon after the signal is applied must the response occur? How soon after the signal is removed must the response occur? Couch these times with reference to a period of the waveform.
Is the 5V really 5, or could it be 4.5 sometimes? Could 0V in be .8"
Jerry
--
Engineering is the art of making what you want from things you can get.
¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯
ElectronDepot website is not affiliated with any of the manufacturers or service providers discussed here.
All logos and trade names are the property of their respective owners.