# 12v bipolar square wave oscillator

Discussion in 'General Electronics Discussion' started by Compressor5, Dec 20, 2017.

1. ### Compressor5

8
0
Dec 20, 2017
I need to produce a square wave of 25kHz and 12v with an offset -6v (+6v to -6v) at a 50 percent duty cycle. I can do this with a standalone oscillator (only need one frequency). Or I can use an Arduino to generate the 0 to 5v frequency and then scale and offset it. I then need to read the ouput of that signal with another arduino. So It needs to be scaled back on the other side from a bipolar signal back to a 0-5v 25kHz square wave.

I have a bipolar +/-15v supply.

OP AMPS:
Now, I have tried 741 and TL072 op amps to run an astable oscillator, but the closer I get to 25kHz, the more they look like a sawtooth waveform. I would expect this on the 741 (.5v/us slew rate)... but was puzzled the 072 did the same thing. It seems the frequency is too high to run astable? I am going to try to input a 25kHz waveform from an Arduino and scale with the op amps today. Any tips?

555:
Can a 555 output a bipolar waveform?

ARDUINO:
How can I scale a 0 to 5v 25kHz square wave into a bipolar +6 to -6v square wave?

I just need one reliable solution to generating this bipolar 25kHz square wave. I have been searching for a few days for a solution. Any help would be greatly appreciated.

2. ### Alec_t

2,940
799
Jul 7, 2015
Welcome to EP!
What are the tolerances on the frequency, amplitude and duty-cycle?

3. ### Harald KappModeratorModerator

11,298
2,586
Nov 17, 2011
Theoretically yes. You need to use a dual power supply (+6 V | 0 V | -6 V). The output of the 555 will swing within 350 mV between -5.65 V and +5.65 V at small loads (5 mA or less). At higher loads (max. 200 mA) the voltage drop will rise up to 2.5 V, reducing the swing to the range -3.5 V ... + 3.5 V.
You can either use a buffer amplifier to compensate this drop and provide higher load current or use a higher supply voltage (e.g. +- 8.5 V). To get the 555 to produce a 50 % duty cycle is a bit tricky.

Use an adder to subtract 2.5 V from the Arduino'Äs output, giving you +- 2.5 V output signal. Add gain 2.4 to raise the signal to +-6 V. A simple circuit using one or two operational amplifiers can do this.

Compressor5 likes this.
4. ### Compressor5

8
0
Dec 20, 2017
Frequency +/- 100Hz
Amplitude +/- 10mV
Duty Cycle +/- 1%

5. ### Compressor5

8
0
Dec 20, 2017
I have a dual power supply capable of +/-15V. I don't see how to input a negative voltage to a 555 in the datasheet. Do you know of a circuit diagram or link where this is accomplished?

As for the op amps, I'll look it up, but if you have a link to a circuit... it would be much appreciated!

6. ### BobK

7,682
1,688
Jan 5, 2010
The TL072 has a slew rate of 13V / uSec which should be plenty, i.e. the rise and fall times should be about 1 uSec. Show us the circuit you are using.

I doubt that a 555 would be faster than that.

Bob

7. ### AnalogKid

2,482
715
Jun 10, 2015
Schematic? ? ?

A 0-12 V square wave through a suitable coupling capacitor will center up nicely around GND.

+/-10 mV out of 6 V is 0.16%. No way will you get that kind of accuracy relying on the saturated output voltage of either opamps of 555s. What kind of circuit does the output drive and/or what is the max output impedance you can tolerate?

ak

8. ### Compressor5

8
0
Dec 20, 2017
I ordered the TL072's because I thought the same thing. But I get a worse response from the TL072's than the 741's. They look alright at >1kHz, but beyond that it starts to turn sawtooth on me. I am open to ideas, or anyone who has seen 25kHz+ out of this circuit.

File size:
121.6 KB
Views:
104
File size:
185.5 KB
Views:
101
9. ### Compressor5

8
0
Dec 20, 2017
I may have misinterpreted what you meant by tolerances... those specs are the amount of wiggle room I have in the spec. So. needs to be within +/-1% of spec... 0.06V.. But right now, I would be happy to see anything remotely looking like a 11ishV bipolar square wave at +20kHz with a 50ish duty cycle.

10. ### Compressor5

8
0
Dec 20, 2017
I messed up on the diagram... on the 741, pin 7 has 7.5V and pin 6 is the output square wave... and tie in for the 1.2k R resistor. My circuit is reflects the proper pins.

11. ### AnalogKid

2,482
715
Jun 10, 2015
figures 15 and 18, the output performance into 2K is significantly worse than the specs at 10K. Your load is 1.2K at the beginning of each cycle, even worse.

Can you post a scope shot of the TL072 output?

Then, increase R 10x and decrease C1 10x, and repost.

Also, add decoupling caps to both power rails as close as possible to the IC pins.

ak

12. ### Harald KappModeratorModerator

11,298
2,586
Nov 17, 2011
GND to -6 V, Vcc to +6 V.
Or use the standard configuration with single supply and AC coupling as suggested by AnalogKid.

13. ### Alec_t

2,940
799
Jul 7, 2015
I think the only way you will achieve the stated frequency and duty-cycle tolerances in a stable way will be to use a crystal oscillator followed by some binary divider stages. At the moment I don't see how you will achieve a 10mV amplitude tolerance without resorting to temperature-control of some amplifier.

Compressor5 likes this.
14. ### Compressor5

8
0
Dec 20, 2017
I think you are right on this. I have revised my tolerances to be within .3V in amplitude.. so 11.3V to 10.7V.

ALSO! I want to thank you guys for your feedback, I found the issue and solution to my design!!

It turns out that the 20 TL072 chips I ordered on Amazon were conterfeit! I happened to order 1 extra from another vendor that came in yesterday... and when I compared them, it wasn't even close. They both had Texas Instruments stamped on the top, but the pins were corroded on all 20 of the knockoffs and the label and dip markers were all different. The absolute telltale proof was in the frequency responses... with the fakes, they underperformed in frequency response wrt a plain jane 15year old 741. As soon as I plugged in the single authentic TL072, and wired it up, the circuit performed better than my design specs... hitting 11Vpp [email protected]/50duty cycle, square. I have a little dip in my +5.5v top shelf, but otherwise its stable and went up to 50kHz without much tuning effort (tried it just to check my bandwidth response) (oh btw, my design parameters changed to 11Vpp centered at 0V).

Anyway, have to clean up the issue at +5.5, going to try buffering my input voltages, if that doesn't work, I will probably be asking for some tips later tonight.

Anyway, you guys are great, and I hope to contribute to the group in the future! Here is the circuit I ended up using, since I had two op amps on the TL072.

File size:
15.6 KB
Views:
79
15. ### Compressor5

8
0
Dec 20, 2017
I like this idea, but so far, the New TL072 I am using is really stable in frequency T=40us +/-.2us. This works for me. And I plan on adding some buffering and better resistor matching. Might try a bigger more stable power supply as well. Thank you for your feedback <=== little electronics humor there ;-)

16. ### Audioguru

3,141
698
Sep 24, 2016
Have you tried a CD4047 oscillator with a digital frequency divider? Its frequency divider produces a perfectly symmetrical 50%-50% squarewave. Its datasheet shows parts values for up to 1MHz. Its frequency accuracy depends on the R and C and a little on the temperature. Its output level depends on the power supply voltage (12V is fine if regulated) and its load resistance. Its output current is low so it will need a high speed buffer.

A 741 opamp was introduced to the world 49 years ago (not 15) in 1968.
Amazon, ebay, Ali and a few others are Chinese. There are huge cities in China that do nothing but make cheap fake electronics for people here to buy from them.

17. ### BobK

7,682
1,688
Jan 5, 2010
Interesting solution. Looks like you got a bunch of 741s relabeled as TL072.

Bob