How Electronic Switches Work For Noobs: Relays and Transistors

Step 5: How a Does a Transistor Work

A transistor works by changing its resistance between the pins collector (power going in), and emitter (power going out), depending on how much current flows through the base to the emitter.

Unfortunately, all transistor's base collector and emitter pins , are in different places varying from transistor to transistor, which is why you'll never find any transistor pin assignment diagrams, that apply to all transistors, and that is why you should never listen to any which aren't exclusively for your transistor.

Transistors unlike relays, can open up by specific amounts, which are directly proportional to the current going through the base.
This proportion is the gain.For example, if a transistor had a gain of 100, then for every 1ma flowing through the base, 100ma could flow through the collector to the emitter, which technically is considered to be an amplification effect. However when you do this, a transistor tends to get rather hot, transistors operate best either when they are fully ON or fully OFF.

All transistors have a maximum input before the input starts to have no effect on the current gain, and eventually, if it gets too high, the current stops all together, which happens only when the voltage on the base is too close or the same to the voltage on the collector.

When we talk about using transistors just as on/off switches, we generally operate at currents that would saturate, or fully switch on, the transistor which is what i will focus on in this guide.

Here is an animation to show you how a transistor works. In the animation, the arrows represent the flow of water, and show that the smaller source is enabling the larger source to flow. This of course is meant to represent the flow of electricity as well, but its easier to just think of it as being water.

From this example its easy to understand why the base must always be less that the collector.
If the flow from the base was the same as or greater than the voltage at the collector, the hypothetical base water flow, would take up the entire pipe, which on its own would block the collector current as there is no room for it.
A situation like this though often results in a combusting transistor.
Remove these adsRemove these ads by Signing Up
kgwolf6 months ago

This was a great tutorial; very informative. I am just getting into the world of building circuits, and this write-up was very clear and easy to follow. With regard to switches, is it correct to say that all they do is enable a secondary power source (switch it on)? So if, for example, I wanted to turn a lamp on and off with signals from a microcontroller, it would still need to be plugged into the wall, but with an open circuit, which the switch would then close? Thanks!

jpoopdog (author)  kgwolf6 months ago
yes, but keep in mind, its not so much the fact its a switch, as it is, its a low energy high speed switch which can offer variable currents between saturation and being completely off, plus it CAN be controlled by a microcontroller, wheras a relay or mechanical switch cannot.
A transistor for example, unlike a relay might be used at a super high frequency with PWM, to dim a lamp which which wont turn off between the ON-OFF-ON phase. SOmething like a incandescent bulb would do this.
But in essence yes, a transistor just enables a secondary power source, though, since the signal is encorperated into the current, its primarily thought of an an amplifier