Skip to content
Semillero
ARES

Electronics

Semiconductors

By David Toro

These electronic devices let a control signal (low current) control and regulate a power signal (high current). They can also be used as a very fast switch driven by an electrical signal, or as a current amplifier. There are different types of transistors:

  1. Bipolar junction transistors (BJT), which can be PNP or NPN.

    Figure 1. Types of transistors

  2. Field-effect transistors (MOSFET).

    Figure 2. Types of MOSFET

  3. Unijunction transistors (UJT).

    Figure 3. UJT

A transistor can be in three states:

  1. Cut-off: no current in the base (IB=0I_B = 0). It behaves like an open switch.
  2. Active region: the current amplification zone; a small base current is enough. This is the analog zone.
  3. Saturation: a high current is applied to the base, allowing maximum current to flow. It behaves like a closed switch.

Packages

Figure 4. Transistor packages

Datasheet

To design a circuit, look up the part number of the semiconductor and check its datasheet.

Figure 5. Datasheet of the NPN 2222 transistor

Figure 5 highlights the data needed for the calculations: the collector-emitter and collector-base voltages, and the current gain (the amplification factor of the semiconductor).

The transistor as a switch

The basic circuit for using a transistor as a switch is:

Figure 6. Basic circuit of a transistor as a switch

Things to keep in mind when using it as a switch:

  • The collector current is almost equal to the emitter current: IC≈IEI_C \approx I_E.
  • VBE(sat)=0.8 VV_{BE(sat)} = 0.8\,\mathrm{V}: base-emitter voltage when the transistor is saturated.
  • VCE(sat)=0.2 VV_{CE(sat)} = 0.2\,\mathrm{V}: collector-emitter voltage when the transistor is saturated.
  • β=IC(act)/IB(act)\beta = I_{C(act)} / I_{B(act)}: the transistor’s amplification factor, typically 100. It only applies in the active region.
  • IB(min)=IC(sat)/βI_{B(min)} = I_{C(sat)} / \beta: minimum base current for the transistor to saturate.

Calculating the base resistor RBR_B

Figure 7. Collector circuit in saturation

If the load (LOAD) is resistive, with resistance RLOADR_{LOAD}, its voltage is:

VLOAD=Vcc−VCE(sat)V_{LOAD} = V_{cc} - V_{CE(sat)}

By Ohm’s law, and since IC(sat)=ILOADI_{C(sat)} = I_{LOAD}:

IC(sat)=VLOADRLOAD=Vcc−VCE(sat)RLOADI_{C(sat)} = \frac{V_{LOAD}}{R_{LOAD}} = \frac{V_{cc} - V_{CE(sat)}}{R_{LOAD}}

With the transistor’s β\beta, the minimum base current is:

IB(min)=IC(sat)β=Vcc−VCE(sat)RLOAD β(2)I_{B(min)} = \frac{I_{C(sat)}}{\beta} = \frac{V_{cc} - V_{CE(sat)}}{R_{LOAD}\,\beta} \tag{2}

Figure 8. Base circuit in saturation

At the base:

VRB=Vin−VBE(sat)V_{R_B} = V_{in} - V_{BE(sat)}

and by Ohm’s law:

IB(sat)=Vin−VBE(sat)RB(3)I_{B(sat)} = \frac{V_{in} - V_{BE(sat)}}{R_B} \tag{3}

To make sure it saturates, the base current must be well above the minimum:

IB(min)≪IB(sat)(1)I_{B(min)} \ll I_{B(sat)} \tag{1}

Substituting (2) and (3) into (1) and solving for RBR_B:

RB≪RLOAD β (Vin−VBE(sat))Vcc−VCE(sat)(4)R_B \ll \frac{R_{LOAD}\,\beta\,(V_{in} - V_{BE(sat)})}{V_{cc} - V_{CE(sat)}} \tag{4}

Example

You want to switch a high-power LED, with a maximum current of 350 mA, on and off using an Arduino whose digital outputs are 0 V or 5 V. Design a circuit with a transistor as a switch. Use a standard transistor with β=100\beta = 100, VBE(sat)=0.8 VV_{BE(sat)} = 0.8\,\mathrm{V} and VCE(sat)=0.2 VV_{CE(sat)} = 0.2\,\mathrm{V}. Only a 12 V DC battery is available, because the product must be portable (the Arduino is powered by the same battery).

Figure 9. Transistor-as-a-switch example

Figure 10. Collector circuit

Since the saturation collector current is known, convert it into the minimum base current with β\beta:

IB(min)=IC(sat)β=350 mA100=3.5 mAI_{B(min)} = \frac{I_{C(sat)}}{\beta} = \frac{350\,\mathrm{mA}}{100} = 3.5\,\mathrm{mA}

Figure 11. Base circuit in saturation

At the base:

VRB=Vin−VBE(sat)=5 V−0.8 V=4.2 VIB(sat)=4.2 VRBV_{R_B} = V_{in} - V_{BE(sat)} = 5\,\mathrm{V} - 0.8\,\mathrm{V} = 4.2\,\mathrm{V} \qquad I_{B(sat)} = \frac{4.2\,\mathrm{V}}{R_B}

With condition (1):

3.5 mA≪4.2 VRB⇒RB≪4.2 V3.5 mA=1200 Ω3.5\,\mathrm{mA} \ll \frac{4.2\,\mathrm{V}}{R_B} \quad\Rightarrow\quad R_B \ll \frac{4.2\,\mathrm{V}}{3.5\,\mathrm{mA}} = 1200\,\Omega

An Arduino pin can supply at most 40 mA, so:

4.2 VRB<40 mA⇒RB>4.2 V40 mA=105 Ω\frac{4.2\,\mathrm{V}}{R_B} < 40\,\mathrm{mA} \quad\Rightarrow\quad R_B > \frac{4.2\,\mathrm{V}}{40\,\mathrm{mA}} = 105\,\Omega

Therefore 105 Ω<RB≪1200 Ω105\,\Omega < R_B \ll 1200\,\Omega. A suitable standard value is RB=330 ΩR_B = 330\,\Omega.

Relays

Figure 12. Relay symbol

A relay is a switch driven by an electromagnet. It lets you control higher-power on/off devices such as:

  1. 110 VAC light bulbs.
  2. Power motors.
  3. 110 VAC heating elements for heaters or stoves.

Coils come in different voltages; the most common are 5 VDC, 12 VDC, 24 VDC, 110 VAC and 220 VAC.

Figure 13. Relay

Important: do not connect a relay directly to a microcontroller. Use a transistor that drives the relay from its collector.

Add a diode in parallel with the coil. Coils store energy and release it suddenly when switched off, which can damage other components; the diode lets that current dissipate safely. The diode most often used for this is the 1N4007.

Note: motors need this diode too, because they contain a coil.

The load and its voltage are switched through the electromagnet, turning the power on or off.

Figure 14. Controlling an AC circuit from a DC circuit

Example circuit for controlling, with a relay and a microcontroller (such as an Arduino):

  1. High-power AC motors.
  2. 110 VAC light bulbs.
  3. 110 VAC heating elements for heaters or stoves.

Figure 15. Driving a relay with a transistor

Translated from Spanish.