Description
Tutorial: How to Use the 2N5401 Transistor
The 2N5401 transistor is a fundamental component for those starting to explore electronic circuits. It is primarily used as an amplifier or switch, allowing the control of higher currents with control signals from small devices like Arduino.
What you need
- Arduino
- Resistors
- LEDs
Steps
- Check the polarity of the transistor: the middle pin (base) is between the two outer pins. The curved side of the TO-92 case indicates the base.
- Connect a resistor between the base and an output pin of the Arduino to limit the current.
- Connect the LED to the emitter pin (the pin closest to the tip of the transistor) through a resistor, with the anode (the longer pin) pointing towards the positive.
- Check the datasheet for the base-emitter voltage to determine the current required by the Arduino to activate the transistor.
- Write an Arduino sketch that turns the led on and off through the transistor.
Example code
void setup() {
pinMode(13, OUTPUT);
}
void loop() {
digitalWrite(13, HIGH); // Accende il led collegato al transistor
delay(1000);
digitalWrite(13, LOW); // Spegne il led collegato al transistor
delay(1000);
}
Mini project
A simple dimmer for an led using Arduino and the transistor 2N5401. Change the brightness of the led by modifying the current intensity through the Arduino’s PWM control.
Common mistakes
- Do not check the polarity of the transistor before connecting it
- Omit the resistance between Arduino and the base of the transistor, causing damage to the microcontroller
- Connect the anode of the led directly to the positive voltage without a current limiting resistance
- Do not check the required voltage to activate the transistor in the datasheet
Recommended accessories
- Variable resistors
- Arduino Uno R3
- RGB Led
- Basic Arduino kit
Frequently asked questions
What is the difference between a transistor and a diode?
A transistor can amplify or control the flow of current, while a diode only allows the passage of current in one direction.
How much does the 2N5401 cost?
The product price is indicated in the website description or in the current price catalog.







Reviews
There are no reviews yet.