1
\$\begingroup\$

just to verify my idea. I'd like to switch on and off a series of led supplied with 2 AA batteries with an Arduino uno. I'd like to use an 2N3904 transistor.
The collector of the transistor will be connected to the series of leds and to the 3V led voltage supply, the base will be connected to an arduino GPIO trough a resistor. The emitter will be connected to ground. Is this a good schema?

schematic

simulate this circuit – Schematic created using CircuitLab

Thanks, Giuseppe

\$\endgroup\$
4
  • \$\begingroup\$ How are you going to limit the current on the LEDs? Why not switch the LED directly with the Arduino output? \$\endgroup\$
    – Wesley Lee
    Dec 1 '16 at 13:39
  • \$\begingroup\$ A data sheet for your LED would prove useful. \$\endgroup\$
    – Andy aka
    Dec 1 '16 at 13:46
  • \$\begingroup\$ When you say "a series of LEDs" do you mean you have several LEDs connected in series (anode of one connected to cathode of the next...)? If so, a 3 volt supply won't do. You will need [number of LEDs] times [LED forward voltage] plus a couple of volts for a current limiting resistor. \$\endgroup\$ Dec 1 '16 at 17:15
  • \$\begingroup\$ You will lose intensity with Vce drop of 0.1, so use a logic level FET if using White, otherwise ok with Rs drop to Red, Yellow, never direct \$\endgroup\$ Dec 1 '16 at 21:24
1
\$\begingroup\$

This is almost a reasonable circuit. You need to add a resistor in series with the LED. This is necessary to limit the LED current.

Let's say this is a green LED that can handle up to 20 mA. The LED drops 2.1 V, and let's say the transistor will have 200 mV across it when on. That leaves 700 mV for the resistor to drop. (700 mV)/(20 mA) = 35 Ω. You could use the standard value of 36 Ω, and theoretically be right on the edge. However, the "3 V" battery is probably a little more, and you want some margin to make sure the LED is operated within spec. The next higher up common value of 39 Ω or even 43 Ω would be better, unless you absolutely need every last bit of light for some reason.

You also haven't specified R1. Again, let's say the aim is to support up to 20 mA LED current. We want the transistor to be saturated, so let's say we decide the base voltage using a C/B current ratio of 20, knowing this transistor can be counted on to have more gain than that. That means we want a minimum base current of 1 mA when on. If the B-E junction drops 700 mV, then 4.3 V will be across the resistor.

(4.3 V)/(1 mA) = 4.3 kΩ. That's the maximum allowed value from our calculations. 4.3 kΩ is a standard value. You could use that, since we've built in some slop into the calculations. Or, use whatever next convenient value you have below that. The limiting factor is how much current the microcontroller output can source, which is likely a few mA. You therefore have a rather wide latitude with R1.

\$\endgroup\$
1
  • \$\begingroup\$ thank you sir! The led series is a "Stand alone" device powered with batteries. So It has its hown resistor for sure. \$\endgroup\$
    – JosephITA
    Dec 22 '16 at 15:01
1
\$\begingroup\$

All you need would be a GPIO pin on your Arduino to toggle an LED on and off. If we take the equation of an LED:

$$R = \frac{V_i - V_f}{I_f}$$

We can say that Vi is the 5V from your Arduino GPIO pin. Vf would be the forward voltage of the LED and If would be the forward current of the LED to light up properly. So use the specifications of your LED and you can then calculate the resistor required to properly light up your LED. The schematic will be as simple as this:

schematic

simulate this circuit – Schematic created using CircuitLab

\$\endgroup\$
2
  • \$\begingroup\$ It's no a single led, it's a series of led. The GPIO has not enough current. \$\endgroup\$
    – JosephITA
    Dec 22 '16 at 15:02
  • \$\begingroup\$ Okay. Then with your BJT, you will need to limit the current as well to not blow up the series of LEDs \$\endgroup\$
    – 12Lappie
    Dec 22 '16 at 15: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.