transistor
the building block of everything electronic. switches, amplifiers, logic gates - all transistors underneath.
what they do
transistors are voltage-controlled switches. small voltage at base/gate controls big current through collector/drain.
two main types:
- bjt (bipolar junction transistor) - current controlled
- fet (field effect transistor) - voltage controlled
bjt basics
three pins: base, collector, emitter
- npn: current flows collector to emitter when base is high
- pnp: current flows emitter to collector when base is low
common ones i use: 2N2222 (npn), 2N2907 (pnp), BC547 (npn)
fet basics
three pins: gate, drain, source
- n-channel: current flows drain to source when gate is high
- p-channel: current flows source to drain when gate is low
mosfets are the most common fets. i use them for switching loads. common ones: 2N7000 (n-channel), IRF540 (high power n-channel)
practical uses
- switching leds, motors, relays
- level shifting between 3.3v and 5v logic
- amplifying audio signals
- building logic gates from scratch
my design patterns
for switching: mosfet with gate resistor and pulldown for amplification: bjt in common emitter configuration for level shifting: bjt voltage divider or mosfet buffer
gotchas i learned
- always use base/gate resistors to limit current
- body diode in mosfets can cause unexpected behavior
- heat dissipation matters for power transistors
- static electricity can kill mosfets easily
understanding transistors helps me design better circuits and debug problems. they're everywhere once you know how to spot them.