Why is my LED dimmer when using a Transistor?

Hi,

I have the following circuit - Circuit design LED Brightness with Transistor | Tinkercad and I'm trying to work out why the LED is dimmer when using a transistor compared without.

My arduino code simply sets pin 13 to be constantly High which goes to the base of the transistor. When the current flows via the transistor, the current measures 5.75mA and the voltage across the Anode and Cathode measures 1.93V. However when I press the push button, the current flows straight from one terminal of the button to the other (bypassing the transistor) and the current measures 19.2mA and voltage across Anode and Cathode is 2.07V which I would like to have using the transistor as well.

I have tried to change the values of the base resistor with no luck. I'm still very new to electronics and I'm sure there is an easy fix here.

Please post a schematic of your circuit as you have built it (no, a response like "it's exactly like the one in this link" does not count) and a photo of that circuit.

There should be a base resistor, but also a current limiting resistor for the led itself. So 2 resistors in total. Again, please show a schematic of your circuit and make explicit which values you have tried in which places. Make all component choices explicit, so please also indicate which transistor you're using.

A transistor (BJT type) such as the one illustrated will introduce a voltage drop op 0.7 volts.

I have not built this circuit yet in real life but here is the Tinkercad image

Can Tinkercad simulate the brightness of a LED or how have you come to the above conclusion if you have not built the circuit ?

Yes, it can simulate the circuit. I have uploaded a video here - Tinkercad Simulation - Album on Imgur

Looks like you're trying to use the NPN as a high side switch and when a signal is applied to it, you basically only get the base current flowing through the LED. It's hard to tell with a pretty Tinkercad picture that looks nice as opposed an actual schematic that is clear and easy to read.

Ergo..schematics, please. Pictures like Fritzing & Tinkercad just don't cut it.

Does this help?Screen Shot 2021-09-09 at 6.15.13 pm

That circuit is simply wrong, in several ways. This is how to drive an LED with a transistor: http://lednique.com/driving-leds-on-higher-voltage/

Choose R2 to set the current - say the supply is 9V and you want 10mA, with the LED forward voltage being about 2V.

That means 7V is dropped across R2, so it needs to be 7/0.01 = 700 ohms (nearest available value 680 ohms.

You then need 5% of this current through the base, ie 0.5mA, so R1 = 10k will do.

So note the important points:

  • NPN transistor
  • emitter to ground
  • load between supply and collector
  • Calculate resistor values for correct LED current, and base current being about 5% of collector current.

Not really, as it's not clear if the collector and emitter are in fact shorted with the 0-terminal of the battery, but let's assume not.

If this is what you built/simulated, then what I said is correct and you're driving the led through the base current of the NPN only.

Try the NPN as a low-side switch instead.

In his schematic, it's R1 that sets the LED current. Small detail, but may be confusing to OP.

I think @MarkT referred to the schematic linked in his post. But it is indeed confusing.

Apologies if this is confusing. What I am trying to do is to control a button press using a transistor, so I could use my Arduino to press a NO Button without actually pressing the button.

Ok, gotcha.

What kind of circuit is the button in?

An easy/fool proof way of doing this is to replace the button with a relay and drive that relay from an Arduino with a transistor to handle the relay coil current (and a freewheel diode to protect the transistor from the back-EMF).

This is not correct. Most of the current will come from the battery, but LED voltage will be limited to Arduino Vcc - V_BE.

Ok, my apologies, you're right.

Sorry if its confusing, I was talking about the correct circuit that I linked to, since the incorrect circuit is not useful for anything/anyone.

Yeah, figures. You mean this one:

R2 sets led current indeed.

Vss???

Vss is not fixed. You need to set the value of R2 and R1 according to Vss you apply. There are some formulas which you need to use, hope so you know them. :slight_smile: