I'm trying to alternate two LEDs with a shared PWM signal. When the signal is low D1 should conduct. When the signal is high D2 should conduct. I've created an LT Spice simulation of the circuit I came up with.

Why does D2 conduct less current than D1?

LT Spice Simulation

  • \$\begingroup\$ Are D1 and D2 identical diodes? What transistors are you using? \$\endgroup\$ – hbaderts Jul 16 '16 at 8:39
  • \$\begingroup\$ Both D1 and D2 are identical. The NMOS and PMOS are the default ones provided by LT Spice. I wasn't really interested in the exact current but more that the idea would work. When I noticed the difference, I started wondering... \$\endgroup\$ – bitshift Jul 16 '16 at 8:52

If all the components are identical, or 'symmetrical', this is because for the PMOS the load is connected on the source.

The drain current of a MOS transistor is a function of its gate to source voltage, while drain voltage has little effect to it.

In the case of the NMOS you are driving the transistor with 3.3V to turn it on, since the source is always grounded.

The PMOS instead has its load on the source, so when you pull its gate to ground the source to gate voltage is not 3.3V, but it is something less. Since you have a diode up there you are probably missing at least 0.5V, which can explain the difference in currents that you see.

To fix this, try to swap the series for the PMOS driver. From Vdd to ground:

  • PMOS
  • diode
  • resistor

With this new arrangement you will be driving the PMOS with the full 3.3V available, and you will probably see a perfect match in the currents if the mosfets are identical.

disclaimer: P transistors usually conduct less than their N counterparts because holes have a reduced (about 1/3) mobility wrt electrons. Try my "fix" but keep also in mind this fact.

  • \$\begingroup\$ Swapping the order worked a charm, thank you! Now to go and brush up on my MOSFET knowledge so I can avoid these things in the future. \$\endgroup\$ – bitshift Jul 16 '16 at 8:54
  • \$\begingroup\$ You are welcome, and thanks to you I got my 10k rep! yay! \$\endgroup\$ – Vladimir Cravero Jul 16 '16 at 8:56
  • \$\begingroup\$ Congratulations :) \$\endgroup\$ – bitshift Jul 16 '16 at 8:59
  • \$\begingroup\$ Correction: the gate-body voltage matters, not the gate-source voltage, and in ICs the transistors have bodies fused together and to a rail, not with their sources. \$\endgroup\$ – John Dvorak Jul 16 '16 at 18:25
  • \$\begingroup\$ You are right, but in this case body and source are shorted. And actually quite some processes allow the body to be connected to any node \$\endgroup\$ – Vladimir Cravero Jul 16 '16 at 18:28

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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