1
\$\begingroup\$

I want to control a backlight LED whose recommended current draw is \$22.7\;\textrm{mA}\$.

Looking up the DC Current Gain on the BC637 datasheet and using the formula:

$$I_b = I_c/\beta$$

I calculated:

$$I_b = 22.7/25$$ $$I_b = 0.908\;\textrm {mA}$$

Arduino logic levels are 5V = High and 0V = Low so I think I should add a current limiting resistor in series on the BC637 base pin.

So using the formula:

$$R_b = (V_{cc} - V_{be})/I_b$$

I calculated:

$$R_b = (5V - 1V)/0.908\;\textrm {mA}$$

$$R_b \approx 4405\;\Omega$$

I'm planning to use a \$4.7\;\textrm k\Omega\$ resistor for \$R_b\$ so the backlight should always be dimmer than the maximum (since less current will flow).

Is my calculation correct? Will it work the way I planned?

Here is the simplified schematic:

Schematic

I don't have much experience with electronic components, and I would like to ask someone with more experience than me to check if my calculation is correct.

\$\endgroup\$
9
  • \$\begingroup\$ Any specific reason to choose a BJT with a low hFE? \$\endgroup\$ Commented Sep 25, 2016 at 5:04
  • \$\begingroup\$ @ChetanBhargava He's reading the minimum hFE, it goes up to 300. \$\endgroup\$
    – pipe
    Commented Sep 25, 2016 at 6:35
  • \$\begingroup\$ 22.7 mA is extremely precise for a LED current. I'd sure like to see the documentation that claims this is the recommended value. \$\endgroup\$
    – pipe
    Commented Sep 25, 2016 at 6:36
  • 1
    \$\begingroup\$ @ChetanBhargava Aah, well. I assumed that's what he had in the junkbin. That's how I select transistors. :) \$\endgroup\$
    – pipe
    Commented Sep 25, 2016 at 7:20
  • 2
    \$\begingroup\$ @ChetanBhargava i salvaged this from one circuit and its laying in my bin. \$\endgroup\$ Commented Sep 26, 2016 at 0:38

2 Answers 2

8
\$\begingroup\$

I'm glad you've done the calculations, that's a good start. However...

Looking up the DC Current Gain on the BC637

Essentially I stopped reading there. This is a classic mistake. The current gain varies a lot depending on all sorts of things: when the transistor was made, age, voltage, current, temperature. Look at this spread from the datasheet:

enter image description here

A circuit that relies on a specific current gain will simply not work well.

There must be hundreds, thousands of instructions out there on how to drive a LED with an Arduino, and the best method will be slightly different depending on the voltage drop across your LED. Essentially you'll use one of these circuits:

schematic

simulate this circuit – Schematic created using CircuitLab

1. Emitter follower

This can be seen as a current booster. The voltage at the emitter will closely track the voltage at the base, only 0.6 volts lower. You calculate the resistor value by looking up the voltage drop across the LED for the current you want, then observing that the voltage drop across the resistor will be the voltage from the Arduino pin minus 0.6 volts, and you can calculate the resistance from that. 0.6 is the VBE, and varies a little depending on the base current. The base current will small, in the µA range, so it will remain stable in this application.

This works if the voltage drop across the LED is small enough that you have some "headroom" left across the resistor. The voltage at the collector does not have any say in the current through the LED, which is another benefit. If your board has an unregulated input with a lot of ripple, you can use it directly.

As you can see, there is no base resistor. This is no omission from my part, and it is one of the benefits of this configuration: The transistor will draw the absolute minimum amount of base current necessary to keep the right amount of current flowing through the collector. A little warning however: If the 5V rail drops before the power to the Arduino, perhaps if they are powered from separate rails, all the current to the LED will come from the base, and thus from the Arduino.

2. Common emitter switch

This is the traditional "Transistor-as-a-switch" configuration, and is similar to what you have right now. The idea is however that the Arduino should drive the transistor fully on so it's saturated, passing as much current as it can, or at least enough so that the transistor is not the limiting factor.

The goal is to drive enough current through the base to make this happen. A conservative number is one tenth of the current through the collector. Since the output from the Arduino will be close to 5 volt, and VBE can be treated roughly as a diode, you will have about 4.3 or 4.4 volts across the base resistor. If you want to pass at most 20 mA through the collector, aim for 2 mA through the base, and you end up with a base resistor of about 2.2 kΩ.

The voltage VCE, between the collector and emitter, is called the saturation voltage and is usually small enough to be neglected. The datasheet for the BC637 shows it as less than 100 mV up to a collector current of 100 mA.

3. MOSFET switch

This is perhaps the easiest to understand, because it's as intuitive as the common emitter switch, but you only have to calculate the load resistor. The Arduino simply drives the MOSFET fully on or off, but because the MOSFET does not draw any current at the gate, the gate resistors are not critical.

he current limiting resistor is calculated as you would without the MOSFET, assuming that its RON is much lower than the resistor.

The series resistor at the gate is there to limit the switching current, and the resistor from gate to ground is there to make sure that the gate is not floating while the pin is in a high-impedance state (that is, an input or turned off).

\$\endgroup\$
4
  • \$\begingroup\$ Why not add (3) common emitter switch? As the MOSFET switch but with an appropriate base resistor to saturate the BJT. \$\endgroup\$
    – user16324
    Commented Sep 25, 2016 at 9:25
  • \$\begingroup\$ @BrianDrummond Good idea! It seemed superfluous at the time, but it makes a better answer. \$\endgroup\$
    – pipe
    Commented Sep 25, 2016 at 10:22
  • \$\begingroup\$ Thank you for the explanation, well i'm student in the area so i lack the expertise. Thank you a lot \$\endgroup\$ Commented Sep 26, 2016 at 0:39
  • \$\begingroup\$ @RodrigoPeetz Yes, no one will blame you or think less of you for assuming that you can use the transistor in the way you wanted. It would be awesome if we could, it would make many circuits simpler, but it's simply too unreliable to be of any practical use. \$\endgroup\$
    – pipe
    Commented Sep 26, 2016 at 3:16
6
\$\begingroup\$

This is not the way to do it. The gain of the transistor is not well defined (probably between 80 and 200). It is better to add a series resistor on the LED - the forward voltage of a blue LED is probably around 3V, so the resistor drops 2V and at 22mA it would have to be about 91 ohms.

Then you pick a base resistor to make sure the transistor is saturated. A forced beta of 20 is usually good. So, 3.9K or so.

Just to be clear, your suggested circuit will put way too much current through the LED, and it will be poorly controlled.

\$\endgroup\$

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.