I am used to relays some, and they are useful, especially for large loads like a incandescent light bulb or other 120V AC device. However, it seems like overkill to use a relay for a bunch of LEDs linked together (parallel) that use 60 mA (too much for the Arduino). Also, it wouldn't work if you wanted to turn it on/off frequently or do PWM. I've heard some about transistors and MOSFETS and know a little about them. When should I use each one and how do I know what type to get? Also, it seems like relays can be more expensive than transistors/MOSFETS.

Edit: How can I use these with my Arduino?

  • 10
    This question appears to be off-topic because it is about electrical engineering in general, not arduino specific. It belongs here electronics.stackexchange.com Feb 17, 2014 at 15:36
  • 4
    @jamolnng I disagree. If a new user posts something like this, they generally don't know how to use any of these. EE generally requires a fair amount of knowledge about the subject before posting. This does bring up an issue though of "should we migrate and close it just because there is overlap?" Feb 17, 2014 at 15:48
  • True. We really need a defined set rules on what is acceptable, which is what this beta should help us decide. Also you are right about EE because a post like this would most likely get buried there. I keep my opinion that it should be migrated and closed because it doesn't really deal with arduino specifically, but you have a valid argument for keeping it open. Feb 17, 2014 at 16:01
  • @jamolnng I respect your argument too and I see both sides: I just posted this question to bring up this argument because it hasn't really been answered in meta and I thought it would be a good example to actually post a question so we can see how it plays out. Feb 17, 2014 at 16:06
  • 4
    Simplest design requirement I can think of at the moment is: If you want to control mains power, you never use a transistor-only based solution.
    – jippie
    Feb 17, 2014 at 18:31

2 Answers 2


Transistors (such as Bipolar Junction Transistors (BJT)) are solid state switchers, that is, they don't have any moving parts. Metal-Oxide-Semiconductor Field-Effect Transistors (MOSFET) are also transistors, but are voltage controlled, whereas classical BJTs are current-controlled. Relays are more expensive, but they have moving parts.

BJTs and MOSFETs produce a lot of heat (with high currents). They both have three pins (usually) called the base, collector and emitter (in the case of BJT) or gate, source, drain (in the case of MOSFET). More info here

Relays use a magnet to control the position of a metal switch. They generally take more power than an Arduino pin can deliver, and therefore they are often controlled by a transistor. Relays can usually switch more current than either a transistor or a MOSFET.

There are also Solid State Relays (SSR), which have a triac (a device similar to a transistor) in them. These can't switch as much as a normal relay, but they generally have better ratings than MOSFETs and BJT. example

from Sparkfun

  • One comment: MOSFETs have very low internal resistance, and so when fully switched on do not generate a lot of heat. They can handle quite a bit of current without needing a heat-sink.
    – Duncan C
    Jan 1, 2021 at 20:46

Big differences between relays and transistors are:

  • relays are all-or-nothing (like switches) whereas transistors can transmit more or less current through the collector based on the current present on their base.
  • relays provide isolation between the command circuit (the one with the electromagnet) and the controlled circuit (the one on the switch side of the relay)

If you want to play with arduino, you definitely need to know about transistors; using relays is more akin to special applications.

Not the answer you're looking for? Browse other questions tagged or ask your own question.