The DC sweep is not what I expect when lighting up LEDs SOLVED

I made a simple circuit with some LEDs and a transistor that is turned on by an MSP430 microcontroller which worked well. After modifying it to include 8 channels (each channel to be controlled by the MSP430), and after running a DC sweep at NODE 1, I noticed that the current peaks at about 2.4uA (at around 2V). This is a far cry from the 18-20mA (at 9V) that I was expecting. My understanding is that the 9V voltage is applied across the top wire to each of the channels which should allow 60mA of current through (each LED drawing around 20mA). Am I missing something?

I am completely new at this, so I am not able to troubleshoot very effectively. And have probably completely botched it...

My circuit is here: https://www.circuitlab.com/circuit/b8b26ednt5dq/led-circuit-with-switch/

Thanks so much for your help!

by thomaspaulwhalan
January 15, 2022

1 Answer

Answer by OakBloodThree

To simulate that action of the MCU, you should be doing a DC sweep of the input source, not the battery.

You don't need to simulate all channels separately if they're identical. You can just do one.

With the transistors configured in common collector (emitter followers) like you show, you will have to drive the bases a lot higher than 2.5V to get the transistors to turn on at all. Depending on the forward voltage of the LEDs, it needs probably 7 or 8 volts. Your MCU probably can't drive it high enough, so you are better off with a common emitter (low-side switch) where the LED and dropping resistor is connected between battery and collector.

Your base resistors are way too small for common emitter. They need to drop the difference between the MCU output (2.5V) and the saturated base voltage (about 0.7V). The base current will be tiny- that's the point of the transistor.

There's no need to put so many grounds there when they're all tied together with wire anyway.

https://www.circuitlab.com/circuit/hs3jpxab8p48/led-circuit-with-switch/

ACCEPTED +1 vote
by OakBloodThree
January 17, 2022

Thanks so much for your answer! I moved the transistors to the ground side like you said and that fixed the problem! Upon reflection, my original design(which worked, but was just a single channel) was constructed with the transistor next to ground, but I had no idea that changing its location would have such a dramatic impact on it. Thanks again! You have taught me an important lesson!

by thomaspaulwhalan
January 17, 2022

The reason it makes such a difference is because you need to drive the base voltage sufficiently above the emitter voltage to flow current into the base and turn on the transformer. If your original design worked, did it only have one LED, rather than 3 in series?

by OakBloodThree
January 18, 2022

It had three LEDs in series, but the transistor was in the position that you recommended, which is why it worked the first time. I don't know why I re-positioned it when adding the extra channels, but I at least got to learn something new by messing it up and having to ask for help. Thanks again!

by thomaspaulwhalan
January 18, 2022

Your Answer

You must log in or create an account (free!) to answer a question.

Log in Create an account


Go Ad-Free. Activate your CircuitLab membership. No more ads. Save unlimited circuits. Run unlimited simulations.

Search Questions & Answers


Ask a Question

Anyone can ask a question.

Did you already search (see above) to see if a similar question has already been answered? If you can't find the answer, you may ask a question.


About This Site

CircuitLab's Q&A site is a FREE questions and answers forum for electronics and electrical engineering students, hobbyists, and professionals.

We encourage you to use our built-in schematic & simulation software to add more detail to your questions and answers.

Acceptable Questions:

  • Concept or theory questions
  • Practical engineering questions
  • “Homework” questions
  • Software/hardware intersection
  • Best practices
  • Design choices & component selection
  • Troubleshooting

Unacceptable Questions:

  • Non-English language content
  • Non-question discussion
  • Non-electronics questions
  • Vendor-specific topics
  • Pure software questions
  • CircuitLab software support

Please respect that there are both seasoned experts and total newbies here: please be nice, be constructive, and be specific!

About CircuitLab

CircuitLab is an in-browser schematic capture and circuit simulation software tool to help you rapidly design and analyze analog and digital electronics systems.