Apologies if this is a stupid question asked by a noob, but I've looked around to try and find the answer and just can't work it out.

Basically, I'm making a project on thingiverse (Glitch's MK2 Stargate), and I've tried all sorts of different transistors with my circuit, I just can't get it to work properly. Could you please advise which Transistor would work for the following circuit:

enter image description here

It's a basic thing, but the plan I was originally working from on thingiverse called for BC548BU transistors, however, the LEDs they were using were surface mount, and I am trying the same thing with 3mm standard LEDs. The BC548BU didn't work right on the normal LEDs.

I'm a total noob with this, but I've been trying to match the Base pin on the Transistor voltage output of my Arduino, but not sure if I'm doing the right thing. Can anybody help?

Thanks -Dave

p.s. I have a load of transistors already (listed below), if any of these work, that would be great, if not, I will order the correct ones. The only one that seemed to match Data with the BC548 is the S9014, but it didn't seem to work at all, unless my understanding of the wiring of Transistors needs adjustment.

enter image description here

  • 3
    do you have ground of the arduino connected to anywhere in the circuit? Jan 31 '18 at 15:54
  • Not to the LED circuit no, just through its own PSU's ground. Should I be grounding it like that? Jan 31 '18 at 16:03
  • I thought the issue might be that my Mega 2560 is 3.3V on the digital, but the 584 is 5V base. The original circuit was for the Uno. Jan 31 '18 at 16:04
  • 2
    You cannot create the required voltage difference between base and emitter for switching when there is only a single electrical connection on the entire circuit. Jan 31 '18 at 16:12
  • 1
    Don't forget to add a resistor between the digital pin, and the transistor.
    – Gerben
    Jan 31 '18 at 20:24

A transistor amplifies current, not voltage.

The first thing to check is the current of your LEDs. In your current configuration, it is between 25 and 30 mA. This is too high for most LEDs. Check the datasheet of your LEDs for the actual forward voltage, and current rating.
To calculate the value for the resistor in your circuit, use Kirchhoff's and Ohm's laws. According to Kirchhoff: VResistor + 3 VLED = 12 V. Let's assume that the LED's forward voltage drop VLED = 1.8 V. This means that VResistor = 12 V - 3 VLED = 6.6 V. Ohm's law will then tell you the relationship between the voltage across the resistor and the current through it: R = VResistor / I. The current through the resistor is the same as the current through the LEDs. Let's assume that this is 20 mA. Therefore: R = VResistor / I = 6.6 V / 0.020 A = 330 Ω.

The next thing to calculate is the resistor between the Arduino and the base of the transistor. As mentioned before: the voltage on the base does not matter, the current does. You want to use the transistor as a switch, so you have to drive it into saturation. As a general rule of thumb, you want the base current to be a tenth of the collector current in that case: IBase = ICollector / 10. The current through the collector is the same as the current through the LEDs, so IBase = 20 mA / 10 = 2 mA.

In a similar way as before, we can calculate the base resistor: VResistor + VBase-Emitter = VArduino. The voltage of the Arduino pin is most likely 5 V, and the Base-Emitter voltage of a silicon transistor is around 700 mV (look it up in the datasheet): VResistor = 5 V - 0.7 V = 4.3 V. Then use Ohm's law again to calculate the resistor value: RBase = VResistor / IBase = 4.3 V / 0.002 A = 2150 Ω ≈ 2.2 kΩ.

The current has to flow through the base to the emitter. For current to flow, you need at least two connections: current flows from the Arduino pin, through the transistor, to ground. You have to connect the emitter of the transistor to the Arduino's ground.

You can use pretty much any normal transistor that has a maximum collector current that is larger than the LED current, and a maximum collector-emitter voltage greater than your power supply.

  • I used kitronik.co.uk/blog/led-resistor-value-calculator to get the resistor value, and I've just double checked and it tells me that 3 in series, powered by a 12V power supply would need a 220Ohm resistor in line. I will look into the calculations that you've sent to try and work it all out. Thankyou for your response. Jan 31 '18 at 16:46
  • @DavidRobilliard: the calculator you used is for LEDs in parallel, you have your LEDs in series. Running LEDs in parallel on a single resistor is not recommended.
    – tttapa
    Jan 31 '18 at 16:57
  • 1
    Hi, I have tried it on led.linear1.org/led.wiz and it agrees with you about a 330Ohm, my mistake, sorry. Jan 31 '18 at 17:06

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.