Buy this book The Art of Electronics by Horowitz and Hill (2nd edition).
It cost $US20 (which is a bargain). It's in New Delhi and they have a number of them. If you cannot afford the 1050 Rupee get several friends to buy it together, This is the best book on the subject that you will find.
- The Art of Electronics (Second Edition)
(ISBN: 0521689171 )
Paul Horowitz,Winfield Hill
Bookseller: BookVistas (New Delhi, DEL, India)
Bookseller Rating:
Quantity Available: > 20
WARNING" There are a lot of these also advertised in India. They cost typically the same or more as what I recommended and are not the same. Take due care. This the associated student manual by Horowitz and Hayes. If you can afford to buy one of these AS WELL do so but get the proper textbook first. Copy of workbook here for Rs484 including postage in India.
For a 3.7 Volt supply to RGB LEDs, the blue channels have a fairly high forward voltage (3.0 to 3.6 Volts per the datasheet), so using BJTs will leave very little or no voltage headroom for the current limiting resistor to regulate current.
The 2n3904 BJT shown, has a Vce(sat) of 0.2 Volts as per the datasheet, and will have a threshold pretty close to this figure, below which it will not conduct.
In other words, the design is likely to be marginal at best, or not work at all for the blue channel at least, depending on the actual Vf of each individual blue channel of the LEDs.
Instead, consider using inexpensive 3.3 Volt friendly, logic level MOSFETs such as the IRLML2502, available for as little as 24 cents each.
At a gate voltage of 2.5 Volts, the Rdson for the MOSFET above is 0.080 Ohms. With 100 mA (20 mA * 5
) passing through this, the resultant voltage drop at the MOSFET calculates to just 0.08 * 0.1 = 0.008 Volts = 8 milliVolts
. More realistically, you might see a drop of as much as 0.01 Volts between Drain and Source.
Thus, there is nearly 0.1 Volts of headroom assured, say 0.5 Volts typical, for the blue channel LEDs. This is far better than what you would get from the BJT design.
In practice, since a MOSFET drain-to-source junction behaves essentially as an Ohmic path for current at a specified Vgs, there will be a linear reduction of voltage drop as the available voltage headroom reduces, so the blue part of the LEDs would continue to glow, if a little dimly, even at worst case. This is unlike the collector-emitter junction behavior of a BJT, which will essentially stop conducting entirely as you approach the marginal case.
Added advantages of the MOSFET approach:
- No careful calculation needed for the MCU output resistors: Just plug in a 100 Ohm resistor in series with the Gate, and a 10 kOhm resistor for pull-down from Gate to Source. Since the MOSFET gate is a voltage driven device not a current driven one, so no minimum base current required, nor any careful calculations.
- Less concern about heat at the transistors: The MOSFET with its 0.08 Ohm maximum on resistance, will generate negligible heat even at much higher than the 100 mA current currently being considered. A BJT will not have that advantage.
- No thermal runaway: MOSFETs have a negative temerature coefficient, current gets throttled as temperature rises.
- Only the LED current limiting resistors need to be recalculated if you choose to increase the supply voltage later, since 3.7 Volts makes things a bit iffy anyway.
The MOSFET switch circuit would look like this:
simulate this circuit – Schematic created using CircuitLab
Best Answer
The way they are connected they'll act as a bipolar 8~9V "zener". They would be for over-voltage protection, is my guess.
Edit: This is because of the reverse breakdown of the emitter-base junction, more at this Wiki reference (thanks to @Leo). The ~7V breakdown of the E-B junction is in series with the forward voltage of the other transistors E-B junction, adding up to around 8V, depending on the current.
The transistors they are using are very inexpensive in China, and probably used elsewhere in their products, so they may be more attractive than conventional MELF zener diodes connected back-to-back.