NPN symbol and current path
The arrow on the emitter points outwards for an NPN symbol. This is a symbol convention, not a reliable way to identify the physical pin order of an unknown component.
Build a transistor-controlled LED, then use a MOSFET to control a small DC motor. Learn how a small control signal switches a larger load current.
A microcontroller output pin can provide a control signal, but it is not a power supply for motors, lamps or relay coils. A transistor can act as an electronic switch between the load and its power source. The controller tells the transistor when to conduct; the separate load supply provides the load current.
Two common families: a BJT is controlled by base current; a MOSFET is controlled by gate-to-source voltage. Both have limits and require correct drive and wiring.
An NPN BJT has three terminals: base (B), collector (C) and emitter (E). A small base current allows a larger collector-to-emitter current. In switching use, the transistor is driven towards cutoff (off) or saturation (on). The base resistor limits current from the control output.
The arrow on the emitter points outwards for an NPN symbol. This is a symbol convention, not a reliable way to identify the physical pin order of an unknown component.
For a switch, do not assume the datasheet's small-signal current gain is a guaranteed saturation design ratio.
A MOSFET uses the voltage between gate and source to control the channel between drain and source. A logic-level N-channel MOSFET is designed to achieve a useful low on-resistance at a specified low gate voltage. Check the datasheet's RDS(on) at the actual gate voltage you will apply.
The gate draws very little steady-state DC current, but it has capacitance and needs to be charged and discharged during switching.
Threshold is not fully-on voltage. VGS(th) is measured at a very small drain current. It does not mean the MOSFET can carry your motor current efficiently at that gate voltage.
In a low-side circuit, one side of the load connects to the positive supply. The transistor connects the other side to ground when switched on. The controller ground and load-supply negative must be connected together for a non-isolated control circuit, so the gate/base voltage has the correct reference.
Conceptual current path: positive supply → load → transistor → supply negative. The actual transistor circuit also needs the appropriate base/gate drive and protection components.
Use an Arduino Uno/Nano digital output to control a small LED through an NPN transistor. The transistor carries the LED current; the Arduino pin supplies only the base drive.
Follow the labelled terminal connections: D9 → 1 kΩ → base; emitter → GND; collector → LED cathode; LED anode → 330 Ω → +5 V. Confirm the physical transistor pinout from its datasheet before inserting it.
const byte transistorBase = 9;
void setup() {
pinMode(transistorBase, OUTPUT);
}
void loop() {
digitalWrite(transistorBase, HIGH);
delay(1000);
digitalWrite(transistorBase, LOW);
delay(1000);
}Investigate: What happens when you remove the base resistor? Do not perform that test with the Arduino pin connected. Instead, explain why the resistor is required. Compare the measured LED current with the simple resistor estimate.
Keep this first build to a small LED current. Never connect a motor or relay directly to an Arduino output pin. Stop and disconnect power if the transistor or resistor becomes hot.
This second build uses an N-channel logic-level MOSFET as a low-side switch. The motor has its own suitable 5 V supply. The Arduino controls the gate but does not supply motor current.
Flyback diode is directly across the motor: cathode (banded end) to +5 V, anode to the MOSFET drain/motor low side. The 10 kΩ resistor pulls the gate low while the controller resets or is disconnected.
const byte motorGate = 9; // PWM-capable pin on Uno/Nano
void setup() {
pinMode(motorGate, OUTPUT);
}
void loop() {
analogWrite(motorGate, 70); // low duty command
delay(2000);
analogWrite(motorGate, 150); // medium duty command
delay(2000);
analogWrite(motorGate, 230); // higher duty command
delay(2000);
analogWrite(motorGate, 0); // off
delay(2000);
}On a standard Uno/Nano, analogWrite uses an 8-bit command from 0 to 255. The motor's actual speed is not necessarily proportional to this number; load, friction, supply voltage and motor characteristics matter.
Motor current matters: a motor's stall current can be several times its running current. Check the motor datasheet or measure safely with a current-limited supply before choosing the MOSFET, diode, wiring and supply. Do not stall the motor by hand. Never power it from an Arduino 5 V pin or USB port unless the supply is explicitly rated for the motor's current.
This simplified estimator uses a chosen forced-beta design ratio. It is a starting estimate, not a substitute for a transistor datasheet, output-pin limits or a standard resistor selection.
Check that the controller output can safely supply the required base current.
Calculation: IB = IC/forced beta; RB = (VOUT − VBE)/IB. The estimate assumes the output remains near its stated voltage at that current. Real GPIO output voltage falls with load, and transistor saturation voltage is device-dependent.
In a common-emitter BJT amplifier, the transistor is biased in its active region so the input signal can move the collector current up and down around a chosen operating point. If the operating point is too close to cutoff or saturation, part of the signal can be clipped. Emitter resistors can improve thermal stability and reduce sensitivity to transistor gain variation. Amplifier design requires analysis of the DC bias network and the AC signal path; the switching estimator above is not an amplifier design tool.
Explore these open lessons at your own pace. For personalised explanations, project-specific troubleshooting, guided practical training or masterclasses, EazyLife offers paid support tailored to your learning goals.
Free or sponsored lesson referrals may be available through active programmes; they are not guaranteed.