1
\$\begingroup\$

I'm working on a very simple project, where I want to control a 24V LED with my arduino. Since the arduino can't output that voltage, I have a separate power source, and use a transistor. This allows me to use the 5V signal from the arduino to toggle the 24V.

However, after wiring this all up, nothing worked, and after trying a few too many permutations, I also must've burnt my poor arduino. I later found an online circuit simulator, and eventually figured out how to get it working. But I have no clue why one of these ways works, and one doesn't. Here's the one that doesn't work.

non-working circuit

I placed the transistor before the the component (replaced here with a multimeter) and it only gets 5V. But this seems to be logical to me - 25V goes into the collector - 5V goes into the base. Base toggles emitter - and should be emitting 25V into the multimeter.

Here's one that does work:

working circuit

Now, the transistor is placed after our component. We feed 25V directly into our multimeter, and it reads it as such. Then we use the 5V from our arduino to determine whether the circuits get completed or not. This works - and it makes sense that it does. But I can't understand why this works, and the last one doesn't. All it should be doing is opening or closing the circuit - yet that one gets 5V, this gets 25V.

Can anyone explain what I'm missing?

\$\endgroup\$
6
  • 2
    \$\begingroup\$ You need to think about the voltages the transistor sees, focusing on the relative voltage between its different terminals. Start with thinking about what the base to emitter voltage is and should be to conduct properly. \$\endgroup\$ Commented Dec 24, 2019 at 16:13
  • 4
    \$\begingroup\$ You should post schematic diagrams instead of wiring diagrams. Schematic diagrams also help to understand the circuit. \$\endgroup\$
    – JRE
    Commented Dec 24, 2019 at 16:15
  • 1
    \$\begingroup\$ You also need to use a schematic which shows the operation of a circuit much better than cartoon pictures. For example, there are no identifiers on the pin of you r 'N' transistor. A schematic has a symbol which identifies the base, collector and emitter and makes it much easier to understand operation of the circuit. [Snap! @JRE] \$\endgroup\$
    – Transistor
    Commented Dec 24, 2019 at 16:17
  • \$\begingroup\$ @Transistor The NPN does have its pins labeled, they are just hard to see. I do agree, however, that a real schematic would help everybody, OP included. \$\endgroup\$ Commented Dec 24, 2019 at 16:33
  • 1
    \$\begingroup\$ Assuming that the transistor is an NPN and not a misdrawn MOSFET, your second circuit is still abusing both the transistor and the Arduino. A bipolar (NPN or PNP) transistor will limit the base-emitter voltage to about 0.7V, fairly independently of the base current. The Arduino will be trying as hard as it can to drive the base to 5V. The result will be excess current and unhappy components. You want to use the base resistor that JRE showed you, and you want to size it so that with a 4.3V drop across it, the base is getting about 1/10 the current that the LED needs. \$\endgroup\$
    – TimWescott
    Commented Dec 24, 2019 at 17:02

1 Answer 1

6
\$\begingroup\$

I suppose you used an NPN transistor.

To make an NPN transistor conduct from its collector to its emitter, you must apply a voltage to the base about 0.7V higher than the emitter.

Look at this:

schematic

simulate this circuit – Schematic created using CircuitLab

The base must be 0.7V higher than the voltage applied to the LED. If the LED were to light up, it would have about 24V across it. You must therefore apply about 24.7V to the base of the transistor. But, the Arduino can only put out 5V, so the base never gets enough voltage to let the transistor conduct.

Compare with this:

schematic

simulate this circuit

Now the base only has to reach 0.7V as the emitter is at 0V. That's easy to do with the 5V output from the Arduino.

I left out a series resistor for the LED because if it is intended to operate on 24V it will already have some kind of current limiting built it.


I don't know what happened to your Arduino. It is easy to destroy an IO pin with too high a voltage.

\$\endgroup\$
1
  • \$\begingroup\$ Thank you very much! This helps a lot! I guess my mistake was assuming that 25V is still hitting the collector, after the LED. Which indicates I really don't know what I'm doing here. But this helps! \$\endgroup\$
    – yathern
    Commented Dec 24, 2019 at 16:43

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.