4
\$\begingroup\$

I am trying to make a square wave generator but don't have an op-amp nor the PNP transistor to do it. Is there any way that works? I have tried using this one:

schematic

simulate this circuit – Schematic created using CircuitLab

but it is always on.

\$\endgroup\$
6
  • 3
    \$\begingroup\$ Q1 is upside down. Reverse the emitter and collector. \$\endgroup\$
    – GodJihyo
    Apr 25 at 18:35
  • 3
    \$\begingroup\$ In addition to Q1 C-D swap, the resistor values are too low, V1 is too low, D1 needs a series resistor. You also need to make the time constants long enough to visibly flash D1 if you don't have an oscilloscope to observe oscillation. Maybe start with component values that someone has gotten to work (Google is your friend in this case). \$\endgroup\$ Apr 25 at 18:44
  • \$\begingroup\$ You could also build a simple comparator using nothing but NPN transistors :) Or even an op-amp, but such oscillators work much better with comparators as the latter switch faster and are optimized for two-state operation. \$\endgroup\$ Apr 25 at 23:10
  • \$\begingroup\$ @SpehroPefhany why are you saying V1 is too low? I have built a multivibrator of this kind and it works fine down to 0.7 volts (with a certain shift in frequency and duty cycle that can be reduced by adding diodes that will speed up the transitions). Is it because of the not ideal duty cycle? \$\endgroup\$ Apr 26 at 0:31
  • 1
    \$\begingroup\$ @SpehroPefhany oh, yes the stage after that! I was thinking about the oscillator alone. \$\endgroup\$ Apr 26 at 2:27

3 Answers 3

5
\$\begingroup\$

It is already working and you can play with it.

schematic

simulate this circuit – Schematic created using CircuitLab

Multivibrator - Q1_B

Multivibrator - Q1_C

Multivibrator - Q2_B

Multivibrator - Q2_C

\$\endgroup\$
1
  • 1
    \$\begingroup\$ Ah, Q3 was sucking too much base current. I had a 100 ohm for R5, and tried that with your circuit -- no oscillation. You're welcome about the "skip initial" \$\endgroup\$ Apr 25 at 21:58
3
\$\begingroup\$

A number of problems have been pointed out in your circuit. However, even when these are corrected, I was unable to get your circuit to oscillate in CircuitLab. Getting oscillating circuits to oscillate in a simulator is a known problem. It is sometimes especially difficult to get a symmetric circuit to oscillate in simulation, since, to the simulator calculates the exact same voltages and currents on both sides. In such cases, one can add asymmetry to the circuit, or add some sort of stimulus to get the oscillations started.

CircuitLab has a particular flag that if set incorrectly may cause failure to simulate oscillations. This is the "Skip initial" flag. You want that to be set to "yes". If it does not "Skip initial", it searches for an equilibrium (or quasi-equilibrium) state of the circuit as it's initial state. Such a state might be quite unstable in reality, like balancing a pencil on its point. But CircuitLab doesn't care, and might leave the pencil balancing forever, or the circuit not oscillating.

Below I provide another circuit that does oscillate in CircuitLab. It is a Schmitt Trigger Oscillator. It is not necessarily better than the astable multivibrator circuit you used, but it does oscillate CircuitLab. Q3 is present to drive the output -- an LED that I added, which is also not essential. If whatever the oscillator is driving has sufficiently high impedance, Q3 can be omitted.

schematic

simulate this circuit – Schematic created using CircuitLab

There is something a bit odd about the simulation that I haven't quite figured out. You will notice voltage spikes. That is very weird, because there is no inductance in the circuit. Perhaps CircuitLab has added inductance to the resistors? or the capacitor? In any event, voltage spikes are possible with fast edges if there is inductance present. In real life, long leads or long traces between components are the source of such inductance. However, I personally would be quite surprised to see voltage spikes of such amplitude in reality, and think they may just be artifacts of the computations done by CircuitLab.

enter image description here

\$\endgroup\$
4
  • 1
    \$\begingroup\$ Thanks for the info about "Skip initial" flag. \$\endgroup\$ Apr 25 at 21:52
  • 2
    \$\begingroup\$ It is an interesting thought to present Otto Schmitt's creation in such a symmetrical form (as a differential pair). So it is clear that this is a positive feedback amplifier. \$\endgroup\$ Apr 25 at 22:16
  • 1
    \$\begingroup\$ CircuitLab has many problems, these ridiculous spikes are typical, I find. The worst bug, though, seems to occur in DC operating point analysis, where it's right maybe only 90% of the time. It's a great tool, but I think there are optimisations or shortcuts to make it work fast enough in Javascript, that just break it from time to time. Still, I'm very thankful for CircuitLab. \$\endgroup\$ Apr 26 at 4:54
  • 1
    \$\begingroup\$ @SimonFitch: it's only straightforward but it's more like a toy. You can't do anything near serious with it. And it's got time limits, which is absurd. I mean there're free tools available that compared to Circuitlab are just better, since they work. \$\endgroup\$
    – edmz
    Apr 26 at 10:32
2
\$\begingroup\$

There are a couple of things it could be.

First, simply swapping the emitter and collector connections will make things worse, not better. A possible problem is that the Q3 base-emitter junction plus the LED are forming a clamp on the Q2 collector voltage. Because the circuit supply is only 5 V, this actually might not be preventing oscillation. However, it is a very bad practice. The solution is to add a resistor in series with the Q3 base and the C2-Q2-R4 node. Something in the 1K to 10K range will work.

Another option is to leave the base connection alone, connect the emitter directly to GND, and move the LED to the collector (adding a current-limiting resistor. Now Q3 is acting as a saturated switch rather than as an emitter-follower.

The main problem with the circuit is that resistors R1 through R4 are too small. The R2-C1 time constant is only 100 us (microseconds). It is entirely possible that the circuit is oscillating, but too fast for the eye to perceive the off times. To test this, increase R2 and R3 to something in the 220K to 470K range. Or you can increase the resistors to something like 10K and increase C1 and C2 to 47 uF. To slow down the oscillator so you can see the LED blink, each R x C product (the R-C time constant) should be greater than 0.1.

You also can increase R1 and R4 to 1K to take some load off of the power source.

\$\endgroup\$

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

Not the answer you're looking for? Browse other questions tagged or ask your own question.