A transistor is an electronics component that is also used as a digital switch. Although, it works similarly to a mere mechanical switch. But a digital high logic signal controls this switch as compared to traditional push buttons. We control traditional switches manually by applying a mechanical force.
We design this digital switch by connecting P-type and N-Type semiconductor materials with each other. When we combine a P-type and N-Type semiconductor materials with each other, a junction is formed between them. This junction is also known as a PN junction or a transistor. This PN junction controls the flow of current across the junction. But this junction breaks by applying a proper biasing voltage across transistor pins.
Transistors have two types such as NPN and PNP. It is a three-terminal device. These terminals are:
- Base ( When using as a switch, we apply control logic this terminal)
When we apply a biasing voltage to the base terminal, the PN junction breaks down. After that current can flow between collector and emitter terminals. Otherwise, forward current can not flow through the device.
Using transistor as a switch
Now we will learn:
- How to use a transistor as a switch in electronics circuits
- how to use it as a switch in microcontroller projects.
Where to use?
In any application, we need to interface a transistor with a microcontroller. But the question that may come to your mind, Why do we need to interface transistor with a microcontroller? Because microcontroller pins can not provide output current more than 3mA and voltage more than 5V. If we want to connect a load that requires a higher operating current demand more than 3mA, it will burn microcontroller. Many output devices will require a transistor switching circuit to operate a high current requirement load such as relays, solenoids, and motors.
How to use it?
This diagram depicts the three operating regions of the transistor such as saturation region, active region and, cut off region. In the saturation region, it remains fully ON. In cut off region, it remains fully off. For switching purposes, we only need this device to operate either in fully-on or fully off region. Therefore, we can ignore the Q – Point and switch it between saturation and cut off areas.
How do transistors as a switch work?
As we see earlier, we can use two regions only. Now, we will see how a transistor works in these regions.
Cut off region is also known as fully OFF mode. In this mode, it acts as an open switch. To operate the device in cut off mode, We should connect reverse biasing voltage to both junctions. Therefore, in this operating condition, the current can not flow between the collector and emitter terminal due to open circuit between these terminals.
In the saturation region, the transistor remains in full-on mode. The maximum current can flow through the collector to emitter according to the rating capacity of the transistor. We provide forward biased voltage between base and emitter terminal. It works like a short-circuit between collector and emitter. The biasing voltage is usually greater than 0.7 volt.
Example of digital logic switches
This PN junction based device has many applications such as high current load interfacing, relay interfacing, and motors interfacing through microcontrollers. But in all these applications, the basic purpose is switching.
This diagram provides an example to control high power loads such as motors, lamps, and heater.
- In this circuit, we want to control 12 volts load from a digital logic AND gate. But the output of the AND gate is only 5 volts
- By using a transistor as a switch, we can drive 12v or even high voltage loads with a 5-volt digital logic signal
- We can also use these devices for faster switching and pulse width modulation control unlike traditional mechanical switches
Motor Controlling Example
In this example, we use dc motor control through a switch. A semiconductor device acts as a switch. In this diagram, we can provide a control signal with any microcontroller such as Arduino, STM32F4 development boards.
A resistor with a base terminal is a current limiting resistor. Because GPIO pins of any microcontroller can provide base driving current less than 20mA. Furthermore, D1 is a freewheeling diode that controls back emf from the motor. It bypasses the back emf effect. We can use any transistor according to power rating of the motor.
In conclusion, if a control signal at the base input is 0 volts. It will provide an ON signal. Because we use a PNP switch in this example circuit. Similarly, it will remain off, its control signal is logic HIGH.
Transistor as switch with Arduino Example
This diagram shows the interfacing of an Arduino with an NPN transistor and a motor. This circuit is just for a demonstration purpose. Because we provide power to a load through Arduino supply. We can only operate a 5-volt dc motor through this example. If you need to drive a large power motor, you should use a special power transistor and a separate power supply.
Transistor as a switch Proteus simulation Example
This example is an exact replication of the prior circuit. But NPN transistor is used instead. Therefore, controlling signals will operate the opposite.
Transistor as a switch Examples
In this section, we will see various examples to use transistor as a switch.
Two transistors as Switch Example
In this circuit, there are two transistors. In the first transistor, the base is grounded and no current can flow into it. As a result, the transistor is “off” and no current can flow through the bulb. In another case, there is current flowing into the base and so the transistor is “on” and the current can flow through it resulting in the light bulb being on.
In this example, the two resistors are set so that the base of the transistor is at a sufficiently high voltage for current to flow into it and as a consequence, the transistor is on. As a result, the current flows through the light bulb which is therefore emitting light.
Controlling Transistor Base Current with Potentiometer
In this case the current flowing into the base can be varied. If the current is large, the transistor is on and the light bulb is lit. If the pointer on the potentiometer is moved downwards, the current into the base drops until the transistor is off and no current flows through the light bulb.
Controlling Relay with transistor as a switch
In this example, the principle is the same as the last circuit example except that instead of a light bulb being switched on and off a relay coil is activated and this in turn switches on the light bulbs in the secondary circuit.
Controlling Transistor Switch Operation with a Capacitor
This example circuit uses a capacitor to control the current flow to the base terminal of a trannsistor. Initially the capacitor is charged up via the resistor above it. Eventually the upper plate of the capacitor reaches such a potential that a current begins to flow into the base of the transistor, switching the transistor on and causing the bulb to shine.
You should also noted that the lamp remains off untill enough charge stores inside the capacitor that can provide turn-on current to base terminal of transistor.
In this example circuit, the capacitor charges up until its lower plate is at such a low potential that no current can flow into the base of the transistor. The result is that the transistor is initially on, but then after a period of time is switched off. In this and last circuits, there is a timing effect. After a certain period of time, which can be determined by the choice of resistor and capacitor, the transistor is either switched on or off.
This example circuit of transistor as a switch is similar to circuit of last example except that by varying the value of the variable resistor it is possible to vary the time it takes before the transistor is switched on.
Practically we used mostly relays for high current demanding loads. In that case, the transistor used to operate relay and load is connected with a relay.
Transistor as switch Applications
- Contol high voltage lamps, motors, and heaters
- Pulse width modulation high-frequency switching
- Acts as an amplifier
- Zero Crossing Detection Circuits Examples
- Introduction to 3D Printing, Working and Applications
- Light Emitting Diode
- Introduction to UART Communication
- Difference between CRT Monitor and LCD
- Digital To Analog Converter Introduction and DAC Types
- Thermocouple introduction, working and types
- Different Types of Fault in Three Phase Induction Motor
- D Flip Flop design simulation and analysis using different software’s
- PID controller working and tuning types
- Ultrasonic Sensor working applications and advantages