Continue to Site

Welcome to our site!

Electro Tech is an online community (with over 170,000 members) who enjoy talking about and building electronic circuits, projects and gadgets. To participate you need to register. Registration is free. Click here to register now.

  • Welcome to our site! Electro Tech is an online community (with over 170,000 members) who enjoy talking about and building electronic circuits, projects and gadgets. To participate you need to register. Registration is free. Click here to register now.

Square wave detector ideas needed please.

Status
Not open for further replies.

Imagewerx

Member
I need an as simple as possible circuit to detect the presence of a a square wave that could be anywhere between approx. 30 and 250 Hz.In the presence of the square wave it needs to switch a relay,and in the absence of the wave it needs to switch the relay off.

Chris.
 
It all depends on what voltage the square wave is, and what other signals are likely to be present.

Will there be DC present? Do you have to be able to discriminate between sine waves and square wave?
 
Sorry meant to say it's about 12 volts peak-to-peak and is only ever a nice clean almost perfect square wave.It's actually the rev counter in my car and I need an off/signal dependant on whetherv the engines's running or not.

Chris.
 
Then you may want to build a simple "Missing Pulse Detector" around a 555 timer chip. Something along these lines should work for you. Set the timing just below the 30 Hz. level. What you actually have is sort of a retriggerable one shot thet you keep triggered before the time constant can run out.

Ron
 
More than likely he just wants a single shot and capacitively couple the input signal. Set the timeout for however long he wants the circuit to stay active after the puses end.

Mmmmm... on second thought, a single shot won't work. He needs something that's retriggerable. Ok, now I see what you said Missing Pulse Detector...
 
Last edited:
Some interesting ideas here.What I actually need it to do is to energise the relay as soon as the engine's running,i.e. as soon as the rev counter start showing RPMs,which at idlle is about 30Hz,and then release the relay when the engine has stopped.

Chris.
 
Last edited:
Here is something much simpler.

ps, after posting it, I thought of a potential problem. What happens when the key is first turned on before the engine is running? Is the tach signal High or Low? If High, then it needs to be slightly more complicated.
 

Attachments

  • DF148.png
    DF148.png
    34.9 KB · Views: 571
Last edited:
Here is something much simpler.

ps, after posting it, I thought of a potential problem. What happens when the key is first turned on before the engine is running? Is the tach signal High or Low? If High, then it needs to be slightly more complicated.

The tacho needle doesn't move while the engine is cranking,only when it's actually fired up does it go high.

Chris.
 
Last edited:
A $2 microcontroller could do this and other things with very few external components.
 
A $2 microcontroller could do this and other things with very few external components.

Not by the time you make an automotive glitch tolerant power supply for the microcontroller, add a switching transistor (because the microcontroller can't drive a relay, etc, etc). Microcontrollers are neat, but don't solve every problem...
 
i have to say thats a nice elegant solution mike! far less likely to go wrong or glitch than a mcu. i realy like the simplicity of that!
 
You can capacitively couple Mike's circuit, like the old VOX relays that turned on when audio was present. Given the reliable 12v input waveform it should be very easy and it's a good way to do it.

Another option would be a voltage window detector. You can turn transistor 1 on when input volts > 3v and use a second transistor to turn it off when volts > 9v etc, then connect the relay to transistor 1. This will detect the average DC voltage of the squarewave signal.
 
Not by the time you make an automotive glitch tolerant power supply for the microcontroller, add a switching transistor (because the microcontroller can't drive a relay, etc, etc). Microcontrollers are neat, but don't solve every problem...

A glitch proof regulator is a good idea irregardless of what way you do this. The first 60 volt load dump will blow the brains out of that little 3904. Likewise for a polarity reversal.

Simple way: Tie onto the stator of the alternator (many if not all of them bring this connection out for use as a tach signal on diesel engines) and feed an AC relay, or rectify it and feed a DC relay.
 
Last edited:
Here is something much simpler.

ps, after posting it, I thought of a potential problem. What happens when the key is first turned on before the engine is running? Is the tach signal High or Low? If High, then it needs to be slightly more complicated.

So I take it this circuit isn't looking for a 30 Hs s/w as such,just any 12 volt s/w?
You can capacitively couple Mike's circuit, like the old VOX relays that turned on when audio was present. Given the reliable 12v input waveform it should be very easy and it's a good way to do it.

Another option would be a voltage window detector. You can turn transistor 1 on when input volts > 3v and use a second transistor to turn it off when volts > 9v etc, then connect the relay to transistor 1. This will detect the average DC voltage of the squarewave signal.

Maybe a bit more complicated than I need,would work well as some srt of warning thing though.
A glitch proof regulator is a good idea irregardless of what way you do this. The first 60 volt load dump will blow the brains out of that little 3904. Likewise for a polarity reversal.

Simple way: Tie onto the stator of the alternator (many if not all of them bring this connection out for use as a tach signal on diesel engines) and feed an AC relay, or rectify it and feed a DC relay.
An even better idea would be to use the battery warning light wire,works well enough for split charge relays,12 volts Dc when the engine's running and 0 volts when it isn't.Not too sure tis woulld work like this thinking about it now,but wil have a play later.

Chris.
 
Typically, the warning light has a ~100 ohm resistor across it to guarantee that the alternator receives it's 12 volts so it can start. One side of the light connects to a switched ignition feed. The other side, of course, is the alternator "I" terminal. Normally this is at 12 volts keeping the light out because you have the same voltage on either side of it. When a fault occurs, the "I" terminal goes to ground illuminating the light. There is no guarantee this wire will tell that the engine is alive or dead, it will tell that the ignition key is in the "on" position or not.
 
Typically, the warning light has a ~100 ohm resistor across it to guarantee that the alternator receives it's 12 volts so it can start. One side of the light connects to a switched ignition feed. The other side, of course, is the alternator "I" terminal. Normally this is at 12 volts keeping the light out because you have the same voltage on either side of it. When a fault occurs, the "I" terminal goes to ground illuminating the light. There is no guarantee this wire will tell that the engine is alive or dead, it will tell that the ignition key is in the "on" position or not.

Cars have not had the "Idiot Light" you describe since 1975. Of seven vehicles I own now, not one has an I terminal on the alternator, nor have the Idiot Lamp. They all have an "ALT" annunciator lamp or LED which is driven by a microcontroller.
 
My 1999 Golf has the warning light as described above by Joe,as do all Golfs up to 2004 and I'm pretty sure even the mk.5s had the same system as well.In fact the majority of "normal" UK cars still have this system.

Chris.
 
A vacuum switch on the intake manifold would tell you its running except at WOT.
If the engine has a MAF or a VAF you could monitor its signal, but this requires circuitry.
Battery voltage rises when the alternator is charging it, but still circuitry.
An oil pressure switch sounds pretty good.
 
I actually also just had the oil pressure switch idea,a full 12 volts already at the instrument cluster ready for me to do my thang with.

Chris.
 
One of these would work:

**broken link removed**

31 bux from Newark Electronics
 
Status
Not open for further replies.

Latest threads

New Articles From Microcontroller Tips

Back
Top