DC square wave to AC signal

Thread Starter

shanemm

Joined Feb 24, 2017
24
I have a DC square wave signal (0-360Hz at 5Vp-p) from a voltage to frequency converter that I want to feed into an LM2907. In order for the LM2907 to recognize the frequency there needs to be a zero crossing.

What would be the easiest way to do this?
 

wayneh

Joined Sep 9, 2010
17,498
You could try just a capacitor coupling. That is, pass the signal to the LM2907 through a small capacitor, maybe a 0.1µF or even a 0.01µF. Just experiment. Place a high-ohms resistor from the input pin to ground so that it gets pulled low if there is no signal. Every time the square wave goes low, the LM2907 will see a brief negative going spike. You want the RC timing such that it has time to "reset" (go thru at least 3 time constants) during an "on" half cycle at the even the highest anticipated frequency.
 

Thread Starter

shanemm

Joined Feb 24, 2017
24
There's a 100nF decoupling capacitor at the input of the LM2907 currently. Here is the circuit:

upload_2017-3-29_10-43-48.png

I tried unhooking A8 & A9 and then attaching the LM331 output directly to LM2907 pin 1. That didn't work so I took out the D29 diode. The output of the LM331 turned from a square wave to a sawtooth when I attached it to the LM2907:
upload_2017-3-29_10-53-49.png

Instead, what if I used an NPN and PNP transistor in series like this (voltages are DC from regulators):
upload_2017-3-29_10-55-57.png

I might have to divide or multiply my frequency from the LM331 to get the proper 0-360 range but that is relatively straightforward.

Thoughts?
 

crutschow

Joined Mar 14, 2008
34,467
Add a 10μF capacitor is series with the A8 input (minus towards TP9).
Leave the rest of the input circuit as shown.
 
Last edited:

dl324

Joined Mar 30, 2015
16,943
That didn't work so I took out the D29 diode.
Why did you do that? The diodes seem to be there to protect the LM2907 from over voltage.
Instead, what if I used an NPN and PNP transistor in series like this (voltages are DC from regulators):
Aside from being wired wrong, what is that supposed to accomplish?
 

Thread Starter

shanemm

Joined Feb 24, 2017
24
Why did you do that? The diodes seem to be there to protect the LM2907 from over voltage.
Aside from being wired wrong, what is that supposed to accomplish?
I thought that since I only had positive voltage (0-5Vdc) square waves that this diode might be shorting some of the voltage to ground. Idk really I was just trying things.

My thinking with the transistor circuit is that it would deliver +12Vdc when the LM331 output is high and -12Vdc when the LM331 output is low.
 

Thread Starter

shanemm

Joined Feb 24, 2017
24
10uF coupling capacitor worked beautifully. Thank you everyone. I'm surprised none of my searching turned up that very simple concept.
 

crutschow

Joined Mar 14, 2008
34,467
10uF coupling capacitor worked beautifully. Thank you everyone. I'm surprised none of my searching turned up that very simple concept.
It's a common way to shift the average DC level of an AC waveform, so perhaps you just didn't use the right search words.
 
Top