4
\$\begingroup\$

I created the following ring oscillator: enter image description here

In the LTspice simulator, it is supposed to oscillate at ~3Hz (LTspice source) given the 47nF caps and 680kΩ resistors: enter image description here

I then built this design on a PCB using 2N7002LT1G from ON Semiconductor, but it doesn't oscillate. All LEDs stay off unless I touch some part of the circuit (e.g. touching R2 will slightly brighten D2).

Is there something wrong with this design? Should I use another MOSFET part?

Edit: when ramping the voltage up, all LEDs start to turn on without oscillating. At around 5-6V, all LEDs are mostly on (brightness is inconsistent). Even at 15V the design does not oscillate.

\$\endgroup\$
13
  • 1
    \$\begingroup\$ I don't know anything about ring oscillators, but it seems to me that the 2N7002 gate threshold voltage is 3V and you are driving it with only 3.3V. The gate threshold voltage is not when the MOSFET turns on. It's when the MOSFET just barely starts to turn on and I assume you want to turn it on more completely than barely. What if you use 5V instead of 3.3V in your physical circuit? \$\endgroup\$
    – DKNguyen
    Jan 26, 2020 at 0:46
  • 1
    \$\begingroup\$ My guess is that the threshold voltage of the fete is not quite enough to turn them on with the 3.3v power supply. Try increasing the supply a few volts. \$\endgroup\$
    – user69795
    Jan 26, 2020 at 0:53
  • \$\begingroup\$ Even with increased voltage the design does not oscillate (see edit). \$\endgroup\$
    – DurandA
    Jan 26, 2020 at 13:51
  • 1
    \$\begingroup\$ Which LEDs are you using? \$\endgroup\$ Jan 26, 2020 at 14:35
  • 1
    \$\begingroup\$ For that type of circuit there is a stable state with all devices conducting (ie LEDs on). Momentarily shorting one of the FET gates to ground may start oscillation. \$\endgroup\$ Jan 26, 2020 at 17:34

3 Answers 3

1
\$\begingroup\$

The last comment said you managed to make it work with CMOS inverters, but are still investigating why it didn't work. I'll try to answer form a simulation point of view, as a possible cause for the real case scenario.

As mentioned in the comments, if you intend to build a circuit that you first simulate, you have to ensure that your models are proper. For example, compare the coloured curves belonging to the default model for the 2N7002 that you've chosen, with the black-white ones from the datasheet (ignore the awful image manipulation skills):

dc

These are not the best match, and the curves can vary from die to die. In addition, what you're using as an LED is just the symbol for the diode and, unspecified (D as value), it defaults to the ideal diode settings: zero resistance, no capacitance, sharp knee, etc.

But what makes a simulator a simulator is the ability to run a circuit a thousand times and give the same results: determinism. This is crucial for analysis, but it goes against any real world case, because all the repeated elements have the exact same values, there is no noise, the supply is so stiff it can generate GA while not flinching, all the nodes are superconducting, etc.

With these in mind, the circuit needs to be modified.

Starting with the transistors. Let's consider the curves close enough. But even if you have "matched" transistors in real life, they will still vary in terms of characteristics for each, in particular. So, for the simulation, each transistor needs to have different parameters. A Monte Carlo analysis comes in handy here: rename each transistor with a unique name, add a .model card with ako for each of the transistors, then add to each parameters that you want to change. The default parameters for the 2N7002 are these:

.model 2N7002 VDMOS(Rg=3 Vto=1.6 Rd=0 Rs=.75 Rb=.14 Kp=.17 mtriode=1.25 Cgdmax=80p Cgdmin=12p Cgs=50p Cjo=50p Is=.04p ksubthres=.1 Ron=2 Qg=1.5n)

so here only some more important parameters are changed: Vto, Is, Cgs, Kp. If you look in the datasheet, the values for the threshold voltage are listed as varying from 1 V to 2.5 V, typical 2.1 V, but the .model has Vto=1.6. I've chosen the middle point, 1.75 V, and added a variation of 20% to it: mc(1.75, 0.2). For Ciss, it has a typical value of 20 pF, but can vary up to 50 pF, so I've chosen 25 pF ±100%: mc(50p, 1). And so on.

For the LED, LTspice has two models at 30 mA, but both are white LEDs. Since the forward drop on these can get up to 4 V or so, I just made up a bare-bones model for a red LED, partly because I didn't know what kind of LEDs you were using, and because I didn't want the variations to be too large. I also adjusted the drain resistor to be 47 Ω, to let some 30 mA flow. Variations were added, as well: 100% for Is, 10% for N, and 100% for Rs (this last one doesn't influence that much).

In rest, 5% for resistors and 10% for capacitors, while the supply now has a 0.1 Ω internal resistance and a 1 mF capacitor. I've left the nodes unchanged, because adding nH and pF as parasitics didn't really make much sense for oscillations in the range of Hz. Plus, whatever parasitic oscillations would occur would be MHz or so, and they would just slow down the simulation. The Rpar that was added to the capacitors is purely a measure of providing a DC path to ground, not to add bleeders -- their value and the capacitors make a time constant of 0.47 s.

With these changes, the schematic now looks as you see below. The only other thing that needed changing was the random number generator's seed. By default, LTspice has a fixed seed, because the purpose of a simulator is repeatability, but that can be changed in the Control Panel > Hacks! tab: Use the clock to seed the MC generator. I've also added a dummy parameter to be .stepped 4 times, so that I can see 4 results at a time (.option nomarch and .save help here).

Running the simulation will show similar traces most of the time, even if they are all varying, but every once in a while, you might get something like this (I had to click a few times to get to this):

oops

The top plot shows a DC current through each LED. One of them manages to make it close to 30 mA, so it might emit light, but the rest are 10 mA or below. For a 30 mA LED, that may be a bit too low, but since this LED is just made up, add a grain of salt. Also interesting is the bottom plot, which shows that the difference between the LED currets can be quite large: the currents may all be oscillating, but there may be no light.

Just for the sake of comparison, I've increased the value of the emission coefficient (N) for the LED, to mimic a white LED (or close), and within three clicks, this is what came up:

oops part 2

As a minor conclusion, setting up the simulation to be more reflecting of some real world conditions can mean a lot. Granted, many of the values I used were guess work -- more or less informed -- but the results can provide a clue as to why your circuit didn't work. So, to avoid a too large grain of salt, the cure for a more "realistic" simulation is to actually measure your devices and try to use their values. If it's worth it, or not, it's up to you.


In case you want to fiddle with this, here's the source for the schematic (save as <filename>.asc):

Version 4
SHEET 1 1920 1128
WIRE 208 -160 16 -160
WIRE 448 -160 208 -160
WIRE 688 -160 448 -160
WIRE 928 -160 688 -160
WIRE 1168 -160 928 -160
WIRE 1408 -160 1168 -160
WIRE 1648 -160 1408 -160
WIRE 16 -112 16 -160
WIRE 208 -48 208 -96
WIRE 448 -48 448 -96
WIRE 688 -48 688 -96
WIRE 928 -48 928 -96
WIRE 1168 -48 1168 -96
WIRE 1408 -48 1408 -96
WIRE 1648 -48 1648 -96
WIRE 16 16 16 -32
WIRE 112 80 80 80
WIRE 208 80 208 32
WIRE 272 80 208 80
WIRE 448 80 448 32
WIRE 512 80 448 80
WIRE 688 80 688 32
WIRE 752 80 688 80
WIRE 928 80 928 32
WIRE 992 80 928 80
WIRE 1168 80 1168 32
WIRE 1232 80 1168 80
WIRE 1408 80 1408 32
WIRE 1472 80 1408 80
WIRE 1648 80 1648 32
WIRE 1728 80 1648 80
WIRE 1728 112 1728 80
WIRE 112 160 112 80
WIRE 160 160 112 160
WIRE 352 160 352 80
WIRE 400 160 352 160
WIRE 592 160 592 80
WIRE 640 160 592 160
WIRE 832 160 832 80
WIRE 880 160 832 160
WIRE 1072 160 1072 80
WIRE 1120 160 1072 160
WIRE 1312 160 1312 80
WIRE 1360 160 1312 160
WIRE 1552 160 1552 80
WIRE 1600 160 1552 160
WIRE 1728 240 1728 192
WIRE 112 304 112 224
WIRE 160 304 112 304
WIRE 208 304 208 176
WIRE 208 304 160 304
WIRE 352 304 352 224
WIRE 400 304 352 304
WIRE 448 304 448 176
WIRE 448 304 400 304
WIRE 592 304 592 224
WIRE 640 304 592 304
WIRE 688 304 688 176
WIRE 688 304 640 304
WIRE 832 304 832 224
WIRE 880 304 832 304
WIRE 928 304 928 176
WIRE 928 304 880 304
WIRE 1072 304 1072 224
WIRE 1120 304 1072 304
WIRE 1168 304 1168 176
WIRE 1168 304 1120 304
WIRE 1312 304 1312 224
WIRE 1360 304 1312 304
WIRE 1408 304 1408 176
WIRE 1408 304 1360 304
WIRE 1552 304 1552 224
WIRE 1600 304 1552 304
WIRE 1648 304 1648 176
WIRE 1648 304 1600 304
WIRE 160 336 160 304
WIRE 400 336 400 304
WIRE 640 336 640 304
WIRE 880 336 880 304
WIRE 1120 336 1120 304
WIRE 1360 336 1360 304
WIRE 1600 336 1600 304
WIRE 1520 512 1264 512
WIRE 1264 560 1264 512
WIRE 1520 560 1520 512
WIRE 1264 688 1264 640
WIRE 1520 688 1520 624
FLAG 160 336 0
FLAG 400 336 0
FLAG 640 336 0
FLAG 80 80 CHAIN
FLAG 16 16 0
FLAG 880 336 0
FLAG 1120 336 0
FLAG 1360 336 0
FLAG 1600 336 0
FLAG 1728 240 CHAIN
FLAG 1264 688 0
FLAG 1520 688 0
SYMBOL voltage 16 -128 R0
WINDOW 123 24 119 Left 2
WINDOW 39 28 141 Left 2
SYMATTR Value2 Rser=0.1
SYMATTR SpiceLine Cpar=1m
SYMATTR InstName V1
SYMATTR Value pwl 0 0 1m 3.3
SYMBOL nmos 160 80 R0
SYMATTR InstName M1
SYMATTR Value m1
SYMBOL nmos 400 80 R0
SYMATTR InstName M3
SYMATTR Value m2
SYMBOL nmos 640 80 R0
SYMATTR InstName M4
SYMATTR Value m3
SYMBOL LED 192 -160 R0
SYMATTR InstName D1
SYMATTR Value D1
SYMBOL LED 432 -160 R0
SYMATTR InstName D2
SYMATTR Value D2
SYMBOL LED 672 -160 R0
SYMATTR InstName D3
SYMATTR Value D3
SYMBOL nmos 880 80 R0
SYMATTR InstName M2
SYMATTR Value m4
SYMBOL nmos 1120 80 R0
SYMATTR InstName M5
SYMATTR Value m5
SYMBOL LED 912 -160 R0
SYMATTR InstName D4
SYMATTR Value D4
SYMBOL LED 1152 -160 R0
SYMATTR InstName D5
SYMATTR Value D5
SYMBOL nmos 1360 80 R0
SYMATTR InstName M7
SYMATTR Value m6
SYMBOL nmos 1600 80 R0
SYMATTR InstName M8
SYMATTR Value m7
SYMBOL LED 1392 -160 R0
SYMATTR InstName D6
SYMATTR Value D6
SYMBOL LED 1632 -160 R0
SYMATTR InstName D7
SYMATTR Value D7
SYMBOL cap 1536 160 R0
WINDOW 123 24 78 Left 2
SYMATTR InstName C7
SYMATTR Value {C7}
SYMATTR Value2 Rpar={Rpar}
SYMBOL res 1632 -64 R0
SYMATTR InstName R13
SYMATTR Value {Rd7}
SYMBOL res 1712 208 M180
WINDOW 0 36 76 Left 2
WINDOW 3 36 40 Left 2
SYMATTR InstName R14
SYMATTR Value {Rg7}
SYMBOL res 1392 -64 R0
SYMATTR InstName R5
SYMATTR Value {Rd6}
SYMBOL res 1152 -64 R0
SYMATTR InstName R7
SYMATTR Value {Rd5}
SYMBOL res 912 -64 R0
SYMATTR InstName R9
SYMATTR Value {Rd4}
SYMBOL res 672 -64 R0
SYMATTR InstName R11
SYMATTR Value {Rd3}
SYMBOL res 432 -64 R0
SYMATTR InstName R1
SYMATTR Value {Rd2}
SYMBOL res 192 -64 R0
SYMATTR InstName R3
SYMATTR Value {Rd1}
SYMBOL res 1568 64 R90
WINDOW 0 0 56 VBottom 2
WINDOW 3 32 56 VTop 2
SYMATTR InstName R2
SYMATTR Value {Rg6}
SYMBOL res 1328 64 R90
WINDOW 0 0 56 VBottom 2
WINDOW 3 32 56 VTop 2
SYMATTR InstName R4
SYMATTR Value {Rg5}
SYMBOL res 1088 64 R90
WINDOW 0 0 56 VBottom 2
WINDOW 3 32 56 VTop 2
SYMATTR InstName R6
SYMATTR Value {Rg4}
SYMBOL res 848 64 R90
WINDOW 0 0 56 VBottom 2
WINDOW 3 32 56 VTop 2
SYMATTR InstName R8
SYMATTR Value {Rg3}
SYMBOL cap 1296 160 R0
WINDOW 123 24 78 Left 2
SYMATTR InstName C3
SYMATTR Value {C6}
SYMATTR Value2 Rpar={Rpar}
SYMBOL cap 1056 160 R0
WINDOW 123 24 78 Left 2
SYMATTR InstName C4
SYMATTR Value {C5}
SYMATTR Value2 Rpar={Rpar}
SYMBOL cap 816 160 R0
WINDOW 123 24 78 Left 2
SYMATTR InstName C5
SYMATTR Value {C4}
SYMATTR Value2 Rpar={Rpar}
SYMBOL res 608 64 R90
WINDOW 0 0 56 VBottom 2
WINDOW 3 32 56 VTop 2
SYMATTR InstName R10
SYMATTR Value {Rg2}
SYMBOL res 368 64 R90
WINDOW 0 0 56 VBottom 2
WINDOW 3 32 56 VTop 2
SYMATTR InstName R12
SYMATTR Value {Rg1}
SYMBOL cap 576 160 R0
WINDOW 123 24 78 Left 2
SYMATTR InstName C1
SYMATTR Value {C3}
SYMATTR Value2 Rpar={Rpar}
SYMBOL cap 336 160 R0
WINDOW 123 24 78 Left 2
SYMATTR InstName C2
SYMATTR Value {C2}
SYMATTR Value2 Rpar={Rpar}
SYMBOL cap 96 160 R0
WINDOW 123 24 78 Left 2
SYMATTR InstName C6
SYMATTR Value {C1}
SYMATTR Value2 Rpar={Rpar}
SYMBOL voltage 1264 544 R0
WINDOW 123 24 119 Left 2
WINDOW 39 28 141 Left 2
SYMATTR InstName V2
SYMATTR Value pwl 0 0 5 2
SYMBOL LED 1504 560 R0
SYMATTR InstName D8
SYMATTR Value led
TEXT 1232 1072 Left 2 !.tran 5
TEXT 56 376 Left 2 !.parma Rd=47 Rg=680k C=47n Rpar=10meg rt=0.05 ct=0.1\n+ Rd1=mc(Rd,rt) Rd2=mc(Rd,rt) Rd3=mc(Rd,rt)\n+ Rd4=mc(Rd,rt) Rd5=mc(Rd,rt) Rd6=mc(Rd,rt) Rd7=mc(Rd,rt)\n+ Rg1=mc(Rg,rt) Rg2=mc(Rg,rt) Rg3=mc(Rg,rt)\n+ Rg4=mc(Rg,rt) Rg5=mc(Rg,rt) Rg6=mc(Rg,rt) Rg7=mc(Rg,rt)\n+ C1=mc(C,ct) C2=mc(C,ct) C3=mc(C,ct)\n+ C4=mc(C,ct) C5=mc(C,ct) C6=mc(C,ct) C7=mc(C,ct)
TEXT 56 584 Left 2 !.parma Isd=1n Isdt=1 Nd=3.5 Nt=0.1 Rsd=1 Rst=1 \n.model d1 ako:led Is={mc(Isd, Isdt)} N={mc(Nd, Nt)} Rs={mc(Rsd, Rst)}\n.model d2 ako:led Is={mc(Isd, Isdt)} N={mc(Nd, Nt)} Rs={mc(Rsd, Rst)}\n.model d3 ako:led Is={mc(Isd, Isdt)} N={mc(Nd, Nt)} Rs={mc(Rsd, Rst)}\n.model d4 ako:led Is={mc(Isd, Isdt)} N={mc(Nd, Nt)} Rs={mc(Rsd, Rst)}\n.model d5 ako:led Is={mc(Isd, Isdt)} N={mc(Nd, Nt)} Rs={mc(Rsd, Rst)}\n.model d6 ako:led Is={mc(Isd, Isdt)} N={mc(Nd, Nt)} Rs={mc(Rsd, Rst)}\n.model d7 ako:led Is={mc(Isd, Isdt)} N={mc(Nd, Nt)} Rs={mc(Rsd, Rst)}
TEXT 56 544 Left 2 ;.model NSCW100 D(Is=16.88n Rs=8.163 N=9.626 Cjo=42p Xti=200)
TEXT 56 1072 Left 2 !.step param dummy 1 4 1
TEXT 56 808 Left 2 ;.model 2N7002 VDMOS(Rg=3 Vto=1.6 Rd=0 Rs=.75 Rb=.14 Kp=.17 mtriode=1.25 Cgdmax=80p Cgdmin=12p Cgs=50p Cjo=50p Is=.04p ksubthres=.1 Ron=2 Qg=1.5n)
TEXT 56 840 Left 2 !.parma Vto=1.75 Vtot=0.2 Kp=0.17 Kpt=0.1 Cgs=25p Cgst=1\n.model m1 ako:2n7002 Vto={mc(Vto, Vtot)} Kp={mc(Kp, Kpt)} Kp={mc(Kp, Kpt)} Cgs={mc(Cgs, Cgst)}\n.model m2 ako:2n7002 Vto={mc(Vto, Vtot)} Kp={mc(Kp, Kpt)} Kp={mc(Kp, Kpt)} Cgs={mc(Cgs, Cgst)}\n.model m3 ako:2n7002 Vto={mc(Vto, Vtot)} Kp={mc(Kp, Kpt)} Kp={mc(Kp, Kpt)} Cgs={mc(Cgs, Cgst)}\n.model m4 ako:2n7002 Vto={mc(Vto, Vtot)} Kp={mc(Kp, Kpt)} Kp={mc(Kp, Kpt)} Cgs={mc(Cgs, Cgst)}\n.model m5 ako:2n7002 Vto={mc(Vto, Vtot)} Kp={mc(Kp, Kpt)} Kp={mc(Kp, Kpt)} Cgs={mc(Cgs, Cgst)}\n.model m6 ako:2n7002 Vto={mc(Vto, Vtot)} Kp={mc(Kp, Kpt)} Kp={mc(Kp, Kpt)} Cgs={mc(Cgs, Cgst)}\n.model m7 ako:2n7002 Vto={mc(Vto, Vtot)} Kp={mc(Kp, Kpt)} Kp={mc(Kp, Kpt)} Cgs={mc(Cgs, Cgst)}
TEXT 1168 464 Left 2 !.model led d is={Isd} n={Nd} rs={Rsd}
TEXT 440 1072 Left 2 !.opt plotwinsize=0, nomarch
TEXT 912 1072 Left 2 !.save I(D*)

...and the plot settings (save as <filename>.plt with UTF-16LE encoding, and place it together with the schematic, or, if you keep your .raw files separately, with them):

[Transient Analysis]
{
   Npanes: 4
   Active Pane: 3
   {
      traces: 7 {589826,0,"I(D1)@1"} {589827,0,"I(D2)@1"} {589828,0,"I(D3)@1"} {589829,0,"I(D4)@1"} {589830,0,"I(D5)@1"} {589831,0,"I(D6)@1"} {589832,0,"I(D7)@1"}
      X: (' ',1,0,0.5,5)
      Y[0]: ('m',0,0,0.003,0.036)
      Y[1]: ('m',1,1e+308,0.0002,-1e+308)
      Amps: ('m',0,0,0,0,0.003,0.036)
      Log: 0 0 0
      GridStyle: 1
   },
   {
      traces: 7 {589826,0,"I(D1)@2"} {589827,0,"I(D2)@2"} {589828,0,"I(D3)@2"} {589829,0,"I(D4)@2"} {589830,0,"I(D5)@2"} {589831,0,"I(D6)@2"} {589832,0,"I(D7)@2"}
      X: (' ',1,0,0.5,5)
      Y[0]: ('m',0,0,0.004,0.04)
      Y[1]: ('m',1,1e+308,0.0002,-1e+308)
      Amps: ('m',0,0,0,0,0.004,0.04)
      Log: 0 0 0
      GridStyle: 1
   },
   {
      traces: 7 {589826,0,"I(D1)@3"} {589827,0,"I(D2)@3"} {589828,0,"I(D3)@3"} {589829,0,"I(D4)@3"} {589830,0,"I(D5)@3"} {589831,0,"I(D6)@3"} {589832,0,"I(D7)@3"}
      X: (' ',1,0,0.5,5)
      Y[0]: ('m',0,0,0.003,0.036)
      Y[1]: ('m',1,1e+308,0.0002,-1e+308)
      Amps: ('m',0,0,0,0,0.003,0.036)
      Log: 0 0 0
      GridStyle: 1
   },
   {
      traces: 7 {589826,0,"I(D1)@4"} {589827,0,"I(D2)@4"} {589828,0,"I(D3)@4"} {589829,0,"I(D4)@4"} {589830,0,"I(D5)@4"} {589831,0,"I(D6)@4"} {589832,0,"I(D7)@4"}
      X: (' ',1,0,0.5,5)
      Y[0]: ('m',0,0,0.003,0.036)
      Y[1]: ('m',1,1e+308,0.0002,-1e+308)
      Amps: ('m',0,0,0,0,0.003,0.036)
      Log: 0 0 0
      GridStyle: 1
   }
}
\$\endgroup\$
1
  • 1
    \$\begingroup\$ I should have added that to properly debug a circuit that deals with changing signals (i.e. not static), a multimeter won't suffice; an oscilloscope is needed. \$\endgroup\$ Nov 30, 2020 at 14:29
0
\$\begingroup\$

You need at least 2x Vgs(th) + Vf(LED) for Vcc. 6V maybe. Probably 9V. The Vgs tolerance is too high

  • try a CMOS 74HC inverter instead
\$\endgroup\$
4
  • \$\begingroup\$ Even with increased voltage the design does not oscillate (see edit). \$\endgroup\$
    – DurandA
    Jan 26, 2020 at 13:51
  • \$\begingroup\$ NO LEDs on ? give up bad design \$\endgroup\$ Jan 26, 2020 at 14:29
  • \$\begingroup\$ All LEDs on. \$\endgroup\$
    – DurandA
    Jan 26, 2020 at 14:30
  • \$\begingroup\$ Did U scope it? \$\endgroup\$ Jan 26, 2020 at 14:31
0
\$\begingroup\$

You need pull down resistors on the gates, say 1 Meg.

\$\endgroup\$
2
  • 5
    \$\begingroup\$ Welcome to EE.SE. Your attempt to add something useful to this question is appreciated. However, please try to keep some minimum quality when posting an answer. When you post some statement or suggestion to solve the OP's question, always supply some reasoning and explanation. This will increase the use for all readers of this site greatly and will more likely will yield positve feedback. \$\endgroup\$
    – Ariser
    Nov 30, 2020 at 8:47
  • 1
    \$\begingroup\$ A 1Meg resistor to ground will form a resistive divider with the series 680k, lowering the gate voltage to 0.68/1.68*Vdd~1.34 V. That is too low for a 2N7002, whose typical threshold voltage is 2.1 V. Its minimum specified threshold is 0.8 V, however, that is not something to rely on. \$\endgroup\$ Dec 1, 2020 at 7:48

Your Answer

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

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