Author Topic: 2n3904 astable multivibrator suggestions???  (Read 447 times)

0 Members and 1 Guest are viewing this topic.

Offline usao

  • Contributor
  • Posts: 5
  • Country: us
2n3904 astable multivibrator suggestions???
« on: April 17, 2018, 02:08:23 am »
Trying to setup a astable multivibrator using (https://www.electronics-tutorials.ws/waveforms/astable.html) as a reference.
According to the site, they have a chart which shows frequency for various RC pairs. The 1M/470n pair should generate a 1.5HZ square wave, but as you can see from the graph below the waveform is pretty crappy. Ive tried to adjust RC but most of the time im not getting any waveform at all (not even crappy ones). Just a straight line.
My goal is to get something around 10kHZ to 100kHZ. None of the RC pairs which get near this frequency generate any curve at all, just a straight line.
.
« Last Edit: April 17, 2018, 02:12:21 am by usao »
 

Offline james_s

  • Super Contributor
  • ***
  • Posts: 4245
  • Country: us
Re: 2n3904 astable multivibrator suggestions???
« Reply #1 on: April 17, 2018, 02:15:30 am »
You have some very large resistors there, 1M? I would expect that to have some issues, try something more reasonable like 10k-100k and size the capacitors accordingly. If you want the output to be cleaner feed it through a Schmitt trigger.
 

Online Benta

  • Super Contributor
  • ***
  • Posts: 1171
  • Country: de
Re: 2n3904 astable multivibrator suggestions???
« Reply #2 on: April 17, 2018, 02:51:45 am »
Yeah, expecting an hFE > 1000 for a 2N3904 ain't gonne fly...
 

Online SiliconWizard

  • Frequent Contributor
  • **
  • Posts: 283
  • Country: fr
Re: 2n3904 astable multivibrator suggestions???
« Reply #3 on: April 17, 2018, 02:54:02 am »
You have some very large resistors there, 1M? I would expect that to have some issues, try something more reasonable like 10k-100k and size the capacitors accordingly.

Quite right. Attached is the LTSpice simulation with 100k / 4ยต7. Works fine.

Basically with base resistors that are too high in value, the transistors can't be driven into saturation, so you don't get a clean square output. You would get into trouble with high resistors values for the collector resistors as well.

Note that this kind of oscillators (called astable multivibrators) are nice for learning electronics, but are bulky (when realized with discrete components) and rather power-hungry. There's a lot of integrated solutions out there that will have much lower power draw, better stability and take much less real estate.
« Last Edit: April 17, 2018, 02:57:21 am by SiliconWizard »
 
The following users thanked this post: usao

Offline usao

  • Contributor
  • Posts: 5
  • Country: us
Re: 2n3904 astable multivibrator suggestions???
« Reply #4 on: April 17, 2018, 03:22:57 am »
Thanks, that simulation produces a nice square wave.
I would like to see if I can get it up to around 10kHZ to 100kHZ though, when I reuce to 1u/50k I still get a square wave but it doesnt start for like 6 seconds. Not sure what that is all about.

BTW, im really new to all this, so sorry if im not making sense.
 

Offline usao

  • Contributor
  • Posts: 5
  • Country: us
Re: 2n3904 astable multivibrator suggestions???
« Reply #5 on: April 17, 2018, 03:24:04 am »
You have some very large resistors there, 1M? I would expect that to have some issues, try something more reasonable like 10k-100k and size the capacitors accordingly. If you want the output to be cleaner feed it through a Schmitt trigger.
These RC sizes were based on the URL table which showed this should produce 1.5HZ.
 

Offline StillTrying

  • Super Contributor
  • ***
  • Posts: 1131
  • Country: gb
  • 100% Brand New and High Quality, in theory.
Re: 2n3904 astable multivibrator suggestions???
« Reply #6 on: April 17, 2018, 04:33:23 am »
it doesnt start for like 6 seconds. Not sure what that is all about.

It's very common for simulated oscillators not to start because there's not enough noise. You can add a small start up pulse somewhere. Adding a 1V 1ms pulse into the 12V source works.
Swap/copy/paste your 12V supply for this one!
 
The following users thanked this post: usao

Online SiliconWizard

  • Frequent Contributor
  • **
  • Posts: 283
  • Country: fr
Re: 2n3904 astable multivibrator suggestions???
« Reply #7 on: April 17, 2018, 04:44:36 am »
Thanks, that simulation produces a nice square wave.
I would like to see if I can get it up to around 10kHZ to 100kHZ though, when I reuce to 1u/50k I still get a square wave but it doesnt start for like 6 seconds. Not sure what that is all about.

With some other values, you will even get it to reach equilibrium and never start oscillating.

Welcome to the  world of simulation and perfect models, which don't always (or rarely) model reality in a sensible way. In order for this oscillator to oscillate, there must be some kind of initial asymmetry to it - otherwise it may reach equilibrium and never get out of it. Look at the circuit: with ideal components, it's perfectly symmetric, so there's not reason it should oscillate in the first place.

But reality is different: components are not ideal and their values are never perfectly the same, and initial conditions aren't either. This is why such theoretically symmetric designs can start oscillating.

If you modify one of the resistors by a small amount, the simulation will suddenly make you see what you're expecting.

In your example, change one of the resistors to 50.1k instead of 50k. The simulation works as you'd expect.

To get higher frequencies, just reduce R*C, and don't forget to make one of the resistors or capacitors slightly different from the other.
You will also have to lower the collector resistors, to get faster rise times.

To make sure the oscillation starts, you may additionally check the "Start external DC supply voltages at 0V" option in the transient simulation command. This combined to a slight component asymmetry will make your simulations work every time.

« Last Edit: April 17, 2018, 05:07:51 am by SiliconWizard »
 
The following users thanked this post: usao

Offline james_s

  • Super Contributor
  • ***
  • Posts: 4245
  • Country: us
Re: 2n3904 astable multivibrator suggestions???
« Reply #8 on: April 17, 2018, 06:55:33 am »
it doesnt start for like 6 seconds. Not sure what that is all about.

It's very common for simulated oscillators not to start because there's not enough noise. You can add a small start up pulse somewhere. Adding a 1V 1ms pulse into the 12V source works.
Swap/copy/paste your 12V supply for this one!


A bigger issue is that the simulated transistors are too perfect and both identical. In order for a multivibrator like this to start, one of the transistors has to turn on slightly faster than the other. You might be able to adjust the hFE of one of them slightly, or make one of the resistors just a tad different than the other.
 

Offline rstofer

  • Super Contributor
  • ***
  • Posts: 3893
  • Country: us
Re: 2n3904 astable multivibrator suggestions???
« Reply #9 on: April 17, 2018, 07:39:13 am »
Welcome to Electronics where amplifiers oscillate and oscillators don't.  Or so sayeth my instructor way back when.
 

Offline Brumby

  • Supporter
  • ****
  • Posts: 6605
  • Country: au
Re: 2n3904 astable multivibrator suggestions???
« Reply #10 on: April 17, 2018, 11:30:46 am »
Welcome to Electronics where amplifiers oscillate and oscillators don't.  Or so sayeth my instructor way back when.
LOL ... but so true.

It may sometimes feel like you've entered the Twilight Zone where theory and practice seem like they are worlds apart ... until you understand what is happening in practice and work out that the theory describes it perfectly.  That can take years and involve a lot of hair pulling.
 

Offline T3sl4co1l

  • Super Contributor
  • ***
  • Posts: 10174
  • Country: us
  • Expert, Analog Electronics, PCB Layout, EMC
    • Seven Transistor Labs
Re: 2n3904 astable multivibrator suggestions???
« Reply #11 on: April 17, 2018, 07:05:24 pm »
Besides e.g. adding a VPULSE of fractional mV in series with one capacitor, you might set initial condition on one of the capacitors to a non-default value, so that it starts up unbalanced, rather than having the simulation engine calculate the DC operating point all too perfectly. :)

The hFE used in the 2N3904 is surprisingly high (over 300), but don't let that fool you, real ones are more like 200 or 100, and even less if you want saturated behavior (which you do for this circuit).  A ratio of Rb / Rc <= 50 is quite reasonable here.

One final catch: SPICE doesn't model BJT breakdown (IIRC, LTSpice doesn't either).  Note that, when a transistor switches on, it pulls down the capacitor on its collector, pulling down the base voltage of the opposite transistor by the same amount (nearly).  For a 12V supply as shown, you're asking for pulses of about -11.3V on the base of those transistors -- but they're only good for about 7V!

To model B-E breakdown, connect two 6V zener diodes in series (use the nearest SPICE model in the library, it'll be fine), anode to anode, and connect them from base to emitter.  Do this for each transistor.  You will see a higher-than-expected operating frequency, a slower collector falling edge (because the capacitor has to be charged up by about 5V), and a flat-bottomed base voltage.

Best solution is to run this circuit at or below 5V, and if you need a 12V output, add an inverter as level shifter. :)

Tim
Seven Transistor Labs, LLC
Electronic Design, from Concept to Layout.
Need engineering assistance? Drop me a message!
 

Online Hero999

  • Super Contributor
  • ***
  • Posts: 9904
  • Country: gb
Re: 2n3904 astable multivibrator suggestions???
« Reply #12 on: April 17, 2018, 08:33:00 pm »
Thanks, that simulation produces a nice square wave.
I would like to see if I can get it up to around 10kHZ to 100kHZ though, when I reuce to 1u/50k I still get a square wave but it doesnt start for like 6 seconds. Not sure what that is all about.

With some other values, you will even get it to reach equilibrium and never start oscillating.

Welcome to the  world of simulation and perfect models, which don't always (or rarely) model reality in a sensible way. In order for this oscillator to oscillate, there must be some kind of initial asymmetry to it - otherwise it may reach equilibrium and never get out of it. Look at the circuit: with ideal components, it's perfectly symmetric, so there's not reason it should oscillate in the first place.

But reality is different: components are not ideal and their values are never perfectly the same, and initial conditions aren't either. This is why such theoretically symmetric designs can start oscillating.

If you modify one of the resistors by a small amount, the simulation will suddenly make you see what you're expecting.

In your example, change one of the resistors to 50.1k instead of 50k. The simulation works as you'd expect.

To get higher frequencies, just reduce R*C, and don't forget to make one of the resistors or capacitors slightly different from the other.
You will also have to lower the collector resistors, to get faster rise times.

To make sure the oscillation starts, you may additionally check the "Start external DC supply voltages at 0V" option in the transient simulation command. This combined to a slight component asymmetry will make your simulations work every time.
Another way is to add some series resistance to one of the capacitors. That way the schematic doesn't look odd by having the different values for the two RC circuits.
 

Offline Colin55

  • Contributor
  • Posts: 19
Re: 2n3904 astable multivibrator suggestions???
« Reply #13 on: April 17, 2018, 10:06:01 pm »
Turning it on generally gives it the "kick start" to get it oscillating.   Many of these oscillators will not start from a slow supply rise. 
 

Offline Colin55

  • Contributor
  • Posts: 19
Re: 2n3904 astable multivibrator suggestions???
« Reply #14 on: April 17, 2018, 10:07:55 pm »
And don't forget, the capacitor actually saturates the transistor. The resistor is just there to start the "turn-on" process. 
 

Offline Audioguru

  • Super Contributor
  • ***
  • Posts: 1126
  • Country: ca
Re: 2n3904 astable multivibrator suggestions???
« Reply #15 on: April 18, 2018, 01:45:03 am »
The 2N3904 transistor has a maximum allowed emitter-base reverse voltage of only 6V so it has avalanche breakdown in this simple circuit with a 12V supply. The repeating avalanche breakdown affects the output and damages the transistors. Diodes can be added to eliminate the avalanche breakdown or a lower supply voltage cam be used. I do not know if the SIM program learned about the avalanche breakdown.

Since the load resistor value is 1k and the transistor needs a base current of about 1/20th its collector current to remain in good saturation after the capacitor starts the "turn on" then the maximum base resistor value is 20k, far from the 1M shown. I don't know if the SIM program learned about the high base current needed for a transistor to saturate.
 

Offline David Hess

  • Super Contributor
  • ***
  • Posts: 6316
  • Country: us
  • DavidH
Re: 2n3904 astable multivibrator suggestions???
« Reply #16 on: April 18, 2018, 05:14:37 am »
One final catch: SPICE doesn't model BJT breakdown (IIRC, LTSpice doesn't either).  Note that, when a transistor switches on, it pulls down the capacitor on its collector, pulling down the base voltage of the opposite transistor by the same amount (nearly).  For a 12V supply as shown, you're asking for pulses of about -11.3V on the base of those transistors -- but they're only good for about 7V!

To model B-E breakdown, connect two 6V zener diodes in series (use the nearest SPICE model in the library, it'll be fine), anode to anode, and connect them from base to emitter.  Do this for each transistor.  You will see a higher-than-expected operating frequency, a slower collector falling edge (because the capacitor has to be charged up by about 5V), and a flat-bottomed base voltage.

Best solution is to run this circuit at or below 5V, and if you need a 12V output, add an inverter as level shifter. :)

Or add diodes in series with the bases so base-emitter breakdown does not clamp the capacitor voltages.

Another way is to add some series resistance to one of the capacitors. That way the schematic doesn't look odd by having the different values for the two RC circuits.

The lessor known emitter coupled version of this circuit only takes one timing capacitor.
 


Share me

Digg  Facebook  SlashDot  Delicious  Technorati  Twitter  Google  Yahoo
Smf