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:
-
Bipolar junction transistors (BJT), which can be PNP or NPN.

-
Field-effect transistors (MOSFET).

-
Unijunction transistors (UJT).

A transistor can be in three states:
- Cut-off: no current in the base (). It behaves like an open switch.
- Active region: the current amplification zone; a small base current is enough. This is the analog zone.
- Saturation: a high current is applied to the base, allowing maximum current to flow. It behaves like a closed switch.
Packages

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

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:

Things to keep in mind when using it as a switch:
- The collector current is almost equal to the emitter current: .
- : base-emitter voltage when the transistor is saturated.
- : collector-emitter voltage when the transistor is saturated.
- : the transistor’s amplification factor, typically 100. It only applies in the active region.
- : minimum base current for the transistor to saturate.
Calculating the base resistor

If the load (LOAD) is resistive, with resistance , its voltage is:
By Ohm’s law, and since :
With the transistor’s , the minimum base current is:

At the base:
and by Ohm’s law:
To make sure it saturates, the base current must be well above the minimum:
Substituting (2) and (3) into (1) and solving for :
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 , and . Only a 12 V DC battery is available, because the product must be portable (the Arduino is powered by the same battery).


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

At the base:
With condition (1):
An Arduino pin can supply at most 40 mA, so:
Therefore . A suitable standard value is .
Relays

A relay is a switch driven by an electromagnet. It lets you control higher-power on/off devices such as:
- 110 VAC light bulbs.
- Power motors.
- 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.

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.

Example circuit for controlling, with a relay and a microcontroller (such as an Arduino):
- High-power AC motors.
- 110 VAC light bulbs.
- 110 VAC heating elements for heaters or stoves.

Translated from Spanish.