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

0 Members and 1 Guest are viewing this topic.

Offline usaoTopic starter

  • Newbie
  • Posts: 7
  • Country: us
2n3904 astable multivibrator suggestions???
« on: April 16, 2018, 04:08:23 pm »
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 16, 2018, 04:12:21 pm by usao »
 

Offline james_s

  • Super Contributor
  • ***
  • Posts: 21611
  • Country: us
Re: 2n3904 astable multivibrator suggestions???
« Reply #1 on: April 16, 2018, 04:15:30 pm »
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.
 

Offline Benta

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

Offline SiliconWizard

  • Super Contributor
  • ***
  • Posts: 14445
  • Country: fr
Re: 2n3904 astable multivibrator suggestions???
« Reply #3 on: April 16, 2018, 04:54:02 pm »
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 16, 2018, 04:57:21 pm by SiliconWizard »
 
The following users thanked this post: usao

Offline usaoTopic starter

  • Newbie
  • Posts: 7
  • Country: us
Re: 2n3904 astable multivibrator suggestions???
« Reply #4 on: April 16, 2018, 05:22:57 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.

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

Offline usaoTopic starter

  • Newbie
  • Posts: 7
  • Country: us
Re: 2n3904 astable multivibrator suggestions???
« Reply #5 on: April 16, 2018, 05:24:04 pm »
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: 2850
  • Country: se
  • Country: Broken Britain
Re: 2n3904 astable multivibrator suggestions???
« Reply #6 on: April 16, 2018, 06:33:23 pm »
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!
.  That took much longer than I thought it would.
 
The following users thanked this post: usao

Offline SiliconWizard

  • Super Contributor
  • ***
  • Posts: 14445
  • Country: fr
Re: 2n3904 astable multivibrator suggestions???
« Reply #7 on: April 16, 2018, 06:44:36 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.

« Last Edit: April 16, 2018, 07:07:51 pm by SiliconWizard »
 
The following users thanked this post: usao

Offline james_s

  • Super Contributor
  • ***
  • Posts: 21611
  • Country: us
Re: 2n3904 astable multivibrator suggestions???
« Reply #8 on: April 16, 2018, 08:55:33 pm »
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.
 

Online rstofer

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

Offline Brumby

  • Supporter
  • ****
  • Posts: 12297
  • Country: au
Re: 2n3904 astable multivibrator suggestions???
« Reply #10 on: April 17, 2018, 01: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: 21658
  • Country: us
  • Expert, Analog Electronics, PCB Layout, EMC
    • Seven Transistor Labs
Re: 2n3904 astable multivibrator suggestions???
« Reply #11 on: April 17, 2018, 09:05:24 am »
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 prototype.
Bringing a project to life?  Send me a message!
 

Online Zero999

  • Super Contributor
  • ***
  • Posts: 19492
  • Country: gb
  • 0999
Re: 2n3904 astable multivibrator suggestions???
« Reply #12 on: April 17, 2018, 10:33:00 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.
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: 20
Re: 2n3904 astable multivibrator suggestions???
« Reply #13 on: April 17, 2018, 12: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: 20
Re: 2n3904 astable multivibrator suggestions???
« Reply #14 on: April 17, 2018, 12: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: 1507
  • Country: ca
Re: 2n3904 astable multivibrator suggestions???
« Reply #15 on: April 17, 2018, 03:45:03 pm »
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: 16607
  • Country: us
  • DavidH
Re: 2n3904 astable multivibrator suggestions???
« Reply #16 on: April 17, 2018, 07:14:37 pm »
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