Introduction to Arduino Uno

Hi Friends! Hope you are doing great. Today, I am going to give you a detailed Introduction to Arduino Uno. It is a microcontroller board developed by Arduino.cc and is based on Atmega328 Microcontroller. The first Arduino project was started in Interaction Design Institute Ivrea in 2003 by David Cuartielles and Massimo Banzi with the intention of providing a cheap and flexible way for students and professionals to learn embedded programming.

Arduino UNO is a very valuable addition in electronics that consists of a USB interface, 14 digital I/O pins(of which 6 Pins are used for PWM), 6 analog pins and an Atmega328 microcontroller. It also supports 3 communication protocols named Serial, I2C and SPI protocol. You should also have a look at this video presentation on Arduino UNO:

  • Few main features of Arduino UNO are shown in the below figure:
Arduino UNO Features and Technical Specs
No. Parameter Name Parameter Value
1 Microcontroller Atmega328
2 Crystal Oscillator 16MHz
3 Operating Voltage 5V
4 Input Voltage 5-12V
5 Digital I/O Pins 14 (D0 to D13)
6 Analog I/O Pins 6 (A0 to A5)
7 PWM Pins 6 (Pin # 3, 5, 6, 9, 10 and 11)
8 Power Pins 5V, 3.3V, Vin, GND
9 Communication UART(1), SPI(1), I2C(1)
10 Flash Memory 32 KB (0.5KB is used by bootloader)
11 SRAM 2 KB
12 EEPROM 1 KB
13 ICSP Header Yes
14 Power sources DC Power Jack & USB Port

I'll try to cover each and everything related to Arduino Uno, so you get a clear idea of what it does, its main features, working and everything you need to know. Let's get started.

Where To Buy?
No.ComponentsDistributorLink To Buy
1Arduino UnoAmazonBuy Now

Introduction to Arduino Uno

  • Arduino Uno is a microcontroller board, developed by Arduino.cc, based on the Atmega328 microcontroller and is marked as the first Arduino board developed(UNO means "one" in Italian).
  • The software used for writing, compiling & uploading code to Arduino boards is called Arduino IDE (Integrated Development Environment), which is free to download from Arduino Official Site.
  • It has an operating voltage of 5V while the input voltage may vary from 7V to 12V.
  • Arduino UNO has a maximum current rating of 40mA, so the load shouldn't exceed this current rating or you may harm the board.
  • It comes with a crystal oscillator of 16MHz, which is its operating frequency.
  • Arduino Uno Pinout consists of 14 digital pins starting from D0 to D13.
  • It also has 6 analog pins starting from A0 to A5.
  • It also has 1 Reset Pin, which is used to reset the board programmatically. In order to reset the board, we need to make this pin LOW.
  • It also has 6 Power Pins, which provide different voltage levels.
  • Out of 14  digital pins, 6 pins are used for generating PWM pulses of 8-Bit resolution. PWM pins in Arduino UNO are D3, D5, D6, D9, D10 and D11.
  • Arduino UNO comes with 3 types of memories associated with it, named:
    • Flash Memory: 32KB
    • SRAM: 2KB
    • EEPROM: 1KB
  • Arduino UNO supports 3 types of communication protocols, used for interfacing with third-party peripherals, named:
    • Serial Protocol
    • I2C Protocol
    • SPI Protocol
  • You can download the Arduino UNO datasheet by clicking the below button:
Download Arduino UNO Datasheet
  • Apart from USB, a battery or AC to DC adopter can also be used to power the board.

Features of Arduino Uno Board

  • Arduino Uno comes with a USB interface i.e. USB port is added on the board to develop serial communication with the computer.
  • Atmega328 microcontroller is placed on the board that comes with a number of features like timers, counters, interrupts, PWM, CPU, I/O pins and based on a 16MHz clock that helps in producing more frequency and number of instructions per cycle.
  • It is an open-source platform where anyone can modify and optimize the board based on the number of instructions and tasks they want to achieve.
  • This board comes with a built-in regulation feature that keeps the voltage under control when the device is connected to the external device.
  • A reset pin is present in the board that resets the whole board and takes the running program in the initial stage. This pin is useful when the board hangs up in the middle of the running program; pushing this pin will clear everything up in the program and starts the program right from the beginning.
  • There are 14 I/O digital and 6 analog pins incorporated in the board that allows the external connection with any circuit with the board. These pins provide flexibility and ease of use to the external devices that can be connected through these pins. There is no hard and fast interface required to connect the devices to the board. Simply plug the external device into the pins of the board that are laid out on the board in the form of the header.
  • The 6 analog pins are marked as A0 to A5 and come with a resolution of 10bits. These pins measure from 0 to 5V, however, they can be configured to the high range using analogReference() function and AREF pin.
  • Only 5 V is required to turn the board on, which can be achieved directly using a USB port or external adopter, however, it can support an external power source up to 12 V which can be regulated and limit to 5 V or 3.3 V based on the requirement of the project.

Arduino Uno Pinout

Arduino Uno is based on an AVR microcontroller called Atmega328. This controller comes with 2KB SRAM, 32KB of flash memory, 1KB of EEPROM. Arduino Board comes with 14 digital pins and 6 analog pins. ON-chip ADC is used to sample these pins. A 16 MHz frequency crystal oscillator is equipped on the board. The following figure shows the pinout of the Arduino Uno Board.

Arduino UNO Pin Description

There are several I/O digital and analog pins placed on the board which operates at 5V. These pins come with standard operating ratings ranging between 20mA to 40mA. Internal pull-up resistors are used in the board that limits the current exceeding the given operating conditions. However, too much increase in current makes these resisters useless and damages the device.
  • LED. Arduino Uno comes with a built-in LED which is connected through pin 13. Providing HIGH value to the pin will turn it ON and LOW will turn it OFF.
  • Vin. It is the input voltage provided to the Arduino Board. It is different than 5 V supplied through a USB port. This pin is used to supply voltage. If a voltage is provided through a power jack, it can be accessed through this pin.
  • 5V. This board comes with the ability to provide voltage regulation. 5V pin is used to provide output regulated voltage. The board is powered up using three ways i.e. USB, Vin pin of the board or DC power jack.
  • USB supports voltage around 5V while Vin and Power Jack support a voltage ranges between 7V to 20V. It is recommended to operate the board on 5V. It is important to note that, if a voltage is supplied through 5V or 3.3V pins, they result in bypassing the voltage regulator that can damage the board if the voltage surpasses its limit.
  • GND. These are ground pins. More than one ground pins are provided on the board which can be used as per requirement.
  • Reset. This pin is incorporated on the board which resets the program running on the board. Instead of physical reset on the board, IDE comes with a feature of resetting the board through programming.
  • IOREF. This pin is very useful for providing voltage reference to the board. A shield is used to read the voltage across this pin which then selects the proper power source.
  • PWM. PWM is provided by 3,5,6,9,10, 11pins. These pins are configured to provided 8-bit output PWM.
  • SPI. It is known as Serial Peripheral Interface. Four pins 10(SS), 11(MOSI), 12(MISO), 13(SCK) provide SPI communication with the help of the SPI library.
  • AREF. It is called Analog Reference. This pin is used for providing a reference voltage to the analog inputs.
  • TWI. It is called Two-wire Interface. TWI communication is accessed through Wire Library. A4 and A5 pins are used for this purpose.
  • Serial Communication. Serial communication is carried out through two pins called Pin 0 (Rx) and Pin 1 (Tx).
  • Rx pin is used to receive data while Tx pin is used to transmit data.
  • External Interrupts. Pin 2 and 3 are used for providing external interrupts. An interrupt is called by providing LOW or changing value.

Communication and Programming

Arduino Uno comes with the ability of interfacing with other Arduino boards, microcontrollers and computers. The Atmega328 placed on the board provides serial communication using pins like Rx and Tx. The Atmega16U2 incorporated on the board provides a pathway for serial communication using USB com drivers. A serial monitor is provided on the IDE software which is used to send or receive text data from the board. If LEDs placed on the Rx and Tx pins will flash, they indicate the transmission of data. Arduino Uno is programmed using Arduino Software which is a cross-platform application called IDE written in Java. The AVR microcontroller Atmega328 laid out on the base comes with built-in bootloader that sets you free from using a separate burner to upload the program on the board.

Applications of Arduino UNO

Arduino Uno comes with a wide range of applications. A larger number of people are using Arduino boards for developing sensors and instruments that are used in scientific research. Following are some main applications of the board.
  • Embedded System
  • Security and Defense System
  • Digital Electronics and Robotics
  • Parking Lot Counter
  • Weighing Machines
  • Traffic Light Count Down Timer
  • Medical Instrument
  • Emergency Light for Railways
  • Home Automation
  • Industrial Automation
There are a lot of other microcontrollers available in the market that are more powerful and cheap as compared to the Arduino board. So, why you prefer Arduino Uno? Actually, Arduino comes with a big community that is developing and sharing knowledge with a wide range of audiences. Quick support is available pertaining to the technical aspects of any electronic project. When you decide Arduino board over other controllers, you don't need to arrange extra peripherals and devices as most of the functions are readily available on the board that makes your project economical in nature and free from a lot of technical expertise. That's all for today. I hope you have got a lot of information regarding the Arduino Uno board. However, if you are unsure or have any questions you can approach me in the comment section below. I'd love to help you according to the best of my knowledge. Keep your feedback and suggestions coming; they help us provide you quality work that resonates with your needs and requirements. Thanks for reading the article.

Introduction to Atmega16

Hey Fellas! Hope you are doing fine. Microcontrollers play an important role in the development of embedded systems. They are used where automation is an integral part of the system. Today, I am going to unlock the details on the Introduction to Atmega16.  It is a 40-pin low power 8-bit microcontroller which is developed using CMOS technology and based on AVR architecture. This is the most commonly used AVR microcontroller which belongs to Atmel Mega family. You must have a look at microcontroller called Atmega328 that also belongs to the mega family. Other microcontrollers that are readily available and fall under AVR category are Atmega 8 and Atmega 32. All these controllers perform similar tasks, however, they are only different in terms of their memory size and cost. I'll discuss each and everything related to this controller so you don't need to scrape through the internet and find all information in one place. Let's dive in and explore what is this about, its main features, pin diagram and everything you need to know.

Introduction to Atmega16

  • Atmega16 is a 40-pin low power microcontroller which is developed using CMOS technology.
  • CMOS is an advanced technology which is mainly used for developing integrated circuits. It comes with low power consumption and high noise immunity.
  • Atmega16 is an 8-bit controller based on AVR advanced RISC (Reduced Instruction Set Computing) architecture. AVR is family of microcontrollers developed by Atmel in 1996.
  • It is a single chip computer that comes with CPU, ROM, RAM, EEPROM, Timers, Counters, ADC and four 8-bit ports called PORTA, PORTB, PORTC, PORTD where each port consists of 8 I/O pins.
  • Atmega16 has built-in registers that are used to make a connection between CPU and external peripherals devices. CPU has no direct connection with external devices. It can take input by reading registers and give output by writing registers.
  • Atmega16 comes with two 8-bit timers and one 16-bit timer. All these timers can be used as counters when they are optimized to count the external signal.
  • Most of the necessary peripherals required to run automatic functions are incorporated in this device like ADC (analog to digital converter), Analog comparator, USART, SPI, which make it economical as compared to a microprocessor that requires external peripheral to perform various functions.
  • Atmega16 comes with 1KB of static RAM which is a volatile memory i.e stores information for short period of time and highly depends on the constant power supply. Whereas 16KB of flash memory, also known as ROM, is also incorporated in the device which is non-volatile in nature and can store information for long period of time and doesn't lose any information when the power supply is disconnected.
  • Atmega16 works on a maximum frequency of 16MHz where instructions are executed in one machine cycle.

Architecture of Atmega16

Following figure shows the architecture of Atmega16 that is based on Harvard Architecture and comes with separate buses and memories. Instructions are stored in the program memory.
1. CPU
CPU is like a brain of the controller which helps in executing a number of instructions. It can handle interrupts, perform calculations and control peripherals with the help of registers. Atmega16 comes with two buses called instruction bus and data bus. The CPU reads the instructions in the instruction bus while data bus is used to read or write the corresponding data. The CPU mainly consists of the program counter, general purpose registers, stack pointer, instruction register and an instruction decoder.
2. ROM
The controller program is stored in ROM, also known as non-volatile programmable flash memory. The flash memory comes with a resolution of at least 10,000 write/erase cycles. Flash memory is mainly divided into two parts known as Application flash section and booth flash section. Program of the controller is stored in the applications flash section. While booth flash section is optimized to work directly when the controller is powered up.
3. RAM
The SRAM (static random access memory) is used for storing information temporarily and comes with 8-bit registers. This is just like a regular computer RAM which is used to supply data through the runtime.
4. EEPROM
The EEPROM (Electronically Erasable Read Only Memory) is non-volatile memory used as a long time storage. It has no involvement in executing the main program. It is used for storing the configuration of the system and device parameters which continues to work in the reset of the application processor. EEPROM comes with a limited write cycle up to 100,000 while read cycles are unlimited. While using EEPROM, write minimum instructions as per requirement, so you can get benefit from this memory for a longer time.
5. Interrupt
The interrupt is used for an emergency which puts the main function on hold and executes the necessary instructions at that time. Once the interrupt is called and executed the code switches back to the main program.
6. Analog and Digital I/O Modules
Digital I/O modules are used to set a digital communication between the controller and external devices. While analog I/O modules are used for transferring analog information. Analog comparators and ADC fall under the category of analog I/O modules.
7. Timer/Counter
Timers are used for calculating the internal signal within the controller. Atmega16 comes with two 8-bit timers and one 16-bit timer. All these timers work as a counter when they are optimized for external signals.
8. Watchdog Timer
The watchdog timer is a remarkable addition in this controller which is used to generate the interrupt and reset the timer. It comes with 128kHz distinct CLK source.
9. Serial Communication
Atmega16 comes with USART and SPI units that are used for developing serial communication with the external devices.

Atmega16 Pinout

Following figure shows the pin diagram of this AVR microcontroller Atmega16.
  • Atmega16 is preferred over other microcontrollers like Atmel 8051 because it comes with much faster ability to execute instructions and consist of modified RISC processor.
  • It has a built-in flash which comes with features of a bootloader. It has built-in 10-bit ADC, SPI, PWM, and EEPROM.
Pin Description of Atmega16
Atmega16 comes with 40 pins where each pin is used to perform a specific task. There are total 32 I/O pins and four ports. Each port consists of 8 I/O pins.
  • PORTA = 8 Pins ( Pin 33 - 40 )
  • PORTB = 8 Pins ( Pin 1 - 8 )
  • PORTC = 8 Pins ( Pin 22 - 29 )
  • PORTD = 8 Pins ( Pin 14 - 21 )
Following are the main functions associated with pins. PORTA. Pins from 33 to 40 fall under PORTA. It acts like analog inputs to A/D converter. However, in the absence of A/D converter, PORTA is used as an 8-bit bidirectional I/O port. It comes with internal pull-up resistors. PORTB. Pins from 1 to 8 belong to PORTB. These are I/O bidirectional pins. This port also consists of internal pull-up resistors. PORTC. PORTC is an I/O bidirectional port that consists of 8 pins. Pin from 22 to 29 belongs to this port.  Similar to other ports, it  comes with internal pull-up resistors. PORTD. Pin from 14 to 21 belongs to this port. It is a bidirectional port where each pin can be used as input or output pin. However, there are additional features associated with this port like interrupts, serial communication, timer, and PWM. Reset. Pin9 is an active low reset Pin. A low-level pulse for longer than minimum pulse length will produce a reset. Short pulses are unlikely to produce reset. VCC. Pin10 is a power supply pin for this controller. The power supply of 5 V is required to put this controller in a running condition. GND. Pin11 is a ground pin. AREF. Pin32 is an analog reference pin mainly used for A/D converter. AVCC. Pin30 is an AVCC which is a supply voltage pin for PORTA and ADC. It is connected to VCC through a low pass filter in the presence of ADC. However, in the absence of ADC, AVCC is externally connected to VCC. Pin 12 & 13. A crystal oscillator is connected with these pins. Atmega16 works at the internal frequency of 1MHZ; the oscillator is added to generate high clock pulses and frequency.
Applications
AVR controllers come with a wide range of applications where automation is required. Following are the main applications of Atmega16.
  • Medical equipment
  • Home automation
  • Embedded systems
  • Arduino Projects
  • Used in automobiles and industrial automation
  • Home appliances and security systems
  • Temperature and pressure control devices
That's all for today. I hope you have got enough information regarding Atmega16. If you are unsure or have any question, you can approach me in the comment section below. I'd love to help you in any way I can. Feel free to keep us updated with your valuable suggestions and feedback. They help us provide you quality content. Thanks for reading the article.

Introduction to 8051 Microcontroller

Hello Friends! Hope you are doing great. I am back to give you a daily dose of valuable information so you can excel and grow in your relevant field and keep coming back for what we have to offer. Today, I am going to unlock the details on the Introduction to 8051 Microcontroller. This is an 8-bit Microcontroller developed by Intel in the 1980s. It is considered as a small system on an integrated chip that comes with CPU, I/O ports, timers, counters, RAM and ROM. The Microcontroller is a one step forward to a microprocessor. Both Microcontrollers and microprocessor work in a similar way with some exceptions. Microcottler comes with everything required to run an embedded system like CPU, I/O ports and inbuilt peripherals like timers, counters, and interrupts. While processor comes with the processing unit and in order to make it work like a microcontroller, separate peripherals are required to connect with the microprocessor. Other examples of microcontrollers are PIC Microcontroller, Atmel & Arduino etc. The 8051 is the most common used microcontroller nowadays. If you are a newbie and trying to get your hands on very first time with a microcontroller you will be advised to start with 8051. It is the most commonly used Microcontroller in Embedded Systems. Technology is evolving and becoming more advanced day by day. Gone are days, when you required separate systems or chips to perform a specific task. Now, most of the chips and electronic systems are developed with the purpose of performing multiple tasks using a single system that comes with a number of integrated circuits incorporated in it that sets you free from the hassle of spending lot of money on the individual system, making our project highly economical in nature. I'll try to discuss each and everything related to 8051, so you get a clear idea of what it does, its main features, working, applications and everything you need to know. You should also have a look at these 8051 Microcontrollers Projects. So, let's get started with Introduction to 8051 Microcontroller:

Introduction to 8051 Microcontroller

  • The 8051 Microcontroller is a 40-Pin integrated chip that comes with CPU and other peripherals like I/O, timers, counters, RAM and ROM.
  • It is widely used in an embedded system, consumer electronics, automotive systems, robotics and security cameras.
  • The 8051 microcontrollers have made a renowned place in the market in terms of their availability, low cost, and operational flexibility.
  • Before the inception of microcontroller, everything that required automatic action was designed with the processor. That made overall project more costly that would cover more space.
  • The 8051 was developed using Intel 8051 MSC-51 architecture.
 
  • Older versions of 8051 used assembly programming language, however, recent editions can be programmed using more advanced language like C, Python or JavaScript.
  • Microcontrollers have revitalized the robotics and removed the need for extra devices to make them function like an automatic system.
  • Earlier, microcontrollers were produced using N-MOS technology that came with more power consumption and less efficiency. However, recent CMOS technology introduced in the development of the microcontrollers requires less power as compared to its predecessor.
  • 8051 comes in a variety of packages but the most common package is a DIP (dual inline package). However, it is also available in other surface mount packaging like 44 - Lead TQFP (Thin Quad Flat Package) and 44 – Lead PLCC (Plastic Leaded Chip Carrier).

8051 Architecture

Following features of the microcontroller define the overall architecture of the controller.
  • CPU. The central processing unit is considered as the main part of the controller that is capable of performing different tasks based on the instructions given by the user.
  • It is a like a brain of the device that reads instructions from data memory (ROM). However, a user has no direct control over the internal function of CPU except code with a number of instructions embedded into the unit through the compiler.
  • Storage Memory. CPU is used to call and execute the set of instructions. A memory is required to store those number of instruction. There are two sets of memory locations present in the device called ROM and RAM.
  • The ROM comes with 4k bytes memory while RAM comes with 128 bytes. The information stored in the ROM memory is known as code or program memory. This memory is non-volatile where information sustains over a long period of time and doesn't require a constant source of power supply to hold information in it.
  • While RAM memory is volatile in nature and stores information for short period of time and requires a constant source of power supply to retain information in it. As you remove the power supply the RAM memory removes from the memory location.
  • Interrupts. Interrupts are very useful in case of emergency. They are used to put the main program on hold when a specific function is required to perform over the main function.
  • The system switches to the main program after the interrupt is called and executed properly. There are five interrupts present in the architecture of 8051 known as INT0, TF0, INT1, TF1, R1/T1
  • All these interrupts are used to pause the main program. TF0 and TF1 are timer interrupts while INT0 and INT1 are external interrupts. R1/T1 is a serial port interrupt.
  • All external interrupts are low level triggered where flags are cleared when the processor is connected to the interrupt service routine.
  • Serial Port. The 8051 comes with UART (Universal Asynchronous Receiver/Transmitter) which is used for serial communication in 8051. The serial port is duplex i.e. it can transfer or receive data. Serial port comes with three pins called Tx, Rx and ground.
  • Buses. Buses are the valuable addition in the development of the microcontroller that are used for the data transmission. Mainly two buses are used for the communication called Data Bus and Address Bus and are 8 bit and 16 bit respectively.
  • The size of the address bus predicts the amount of memory a system can address. The 16-bit address bus determines it can address memory up to 2 (64k).
  • Address bus comes with four addressing modes called immediate addressing mode, direct addressing modes, register addressing mode, register indirect addressing mode.
  • The Data Bus is used for the transfer of data for a particular application within microprocessor and memory I/O devices. It is bi-directional and used for sending and receiving data.
  • The CPU's circuitry determines the width of the data bus.
  • I/O Ports. Microcontroller comes with four I/O ports called P0, P1, P2, and P3. These ports are used to interface controller with other devices. Each port comes with 8 pins, making it an 8-bit port. Once these ports are reset, they are used as an output port. However, we need to program them in order to use them as an input port.
  • Timers/Counters. 8051 microcontroller comes with two 16 bit timers and counters. Timers are used to count the internal signal of a particular function of the controller while counters are used to count the external signals of the peripherals connected to the controller. These timers are further divided into an 8-bit register.
  • Oscillator. It is added in the controlled for generating clock pulses. It works as a clock source for CPU of the controller. The oscillator works over a certain frequency when a certain voltage is applied.

8051 Basic Circuit

Following figure shows the pin diagram of 8051 microcontroller. As figure shown above, 8051 comes with 40 - Pin Dip that contains 20 pins on each side. It has four ports and 8 pins are associated with each port. Let's describe the function of each port one by one. Port 0. Pin number from 32 to 39 belong to Port0. These pins are bidirectional and come with internal pull-up resistors. Port0 is multiplexed with data and address bus. Port 1. Pin from 1 to 8 falls under Port 1 that is the 8-bit port where each pin is bidirectional. This port comes with internal pull-up resistors. Port 2. Pin from 21 to 28 falls under Port 2. All the port 2 pins are bi-directional like port 1 and are used as I/O pins. Port 2 pins behave like a higher order address/data bus when external memory is accessed. Port 3. Port 3 contains pins from 10 to 17 number. All pins of the port 3 come with special functions. Following are the main functions associated with each pin. RST. Pin 9 represents the reset pin. The controller will be reset by holding RST HIGH for at least two machine cycles. GND and Vcc. Pin 20 represents the ground pin that represents 0V and connected to the negative terminal of the power source, while Pin 40 represents the power source pin that requires 5 V. PSEN. Pin 29 is PSEN (Program Stored Enable Pin) which is used for reading external program memory. ALE. Pin 30 is ALE ( Address Latch Enable) that is mainly used for separation of external address from data. VPP. Pin 31 is external access enable pin used for external program memory. If this pin is set LOW, it can fetch the code from external program memory.

Applications

The 8051 comes with a wide range of applications, but it is mainly used for the embedded system. Following are some applications it is used for.
  • Industrial automation
  • Process control devices
  • Home Applications (Camcorder, Music InstrumentsTVs, VCR, Video Games, Oven)
  • Safety devices and automotive applications
  • Temperature sensing and safety devices
  • Parking indication system
  • Fire detection and defense applications
  • Defense and medical equipment
  • Arduino DC motor speed control
  • GSM based electricity meter billing
  • Voice controlled system
  • Communication Systems (Intercoms, Answering Machines, Mobile Phones, Paging Devices)
  • Aeronautical and Space systems
  • Robotics and Automation
So, that was all for today. I hope you have enjoyed today's tutorial about 8051 Microcontroller. Will meet you guys in the next tutorial. Take care and have fun !!! :)

Smoke Detector with Arduino & MQ2 Sensor

Hello everyone, I hope you all are  doing great. In today's tutorial, we are gonna have a look at How to design a Smoke Detector with Arduino. Its quite a simple project but if you are working on any security project then you must add this feature in it. You should also download this Gas Sensor Library for Proteus, and design its simulation. I will use gas sensor MQ2 for this project. I have purchased MQ2 Gas Sensor module as its quite easy to interface with Arduino. Arduino board I'm using is Arduino UNO. I have also designed an LPG Gas Leak Detect using Arduino using this MQ2 Sensor. So, let's get started with How to design Smoke Detector with Arduino & MQ2 Sensor.

Smoke Detector with Arduino & MQ2 Sensor

  • First of all, we need to connect some jumper wires between Arduino and MQ2 smoke sensor shield.
  • Here's the image of our Gas sensor and you can see, it has four pins in total.
  • This gas sensor has four pins in total, which are:
    • Vcc: We need to provide +5V.
    • GND: We need to ground it.
    • D0: Digital Output.
    • A0: Analog Output.
  • So now you will need four male to female jumper wires and connect them as shown in below figure:
  • Sensor's pins are labelled on the back side and I have connected these four pins as follows:
    • White Wire: Vcc of Sensor connected with +5V of Arduino.
    • Black Wire: GND of Sensor connected with GND of Arduino.
    • Grey Wire: D0 of Sensor connected with Pin # 8 of Arduino.
    • Orange Wire: A0 of Sensor connected with A0 of Arduino.
  • So, now let's design our code in Arduino software in which we will detect whether there's smoke around or not.
  • I'm gonna use the analog output of our sensor and will first display the analog value in my Serial Monitor.
  • I have used the below code, so copy it and upload in your Arduino board:
int Input = A0;
int SensorVal = 0;

void setup() {
  Serial.begin(9600);
  pinMode(Input, INPUT);
  Serial.println("Interfacing of Smoke Sensor with Arduino");
  Serial. println("Design by www.TheEngineeringProjects.com");
  Serial.println();
}

void loop() {

  SensorVal = analogRead(Input);
  Serial.println(SensorVal);
  delay(500);
}
  • Now open the Serial Monitor of Arduino to check the analog values coming from our sensor.
  • If everything goes fine then you will get something like this in your Serial Monitor:
  • You can see we are getting the values in range of 420 to 450.
  • You should read How to do Arduino Serial Communication, if you don't know how to get data serially.
  • Now let's place a burning cigarette near it for smoke. (Cigarettes are injurious to health :P )
  • When the sensor will sense smoke in its surroundings then its value will start to increase and in my case it reached to around 650.
  • So, let's place a check in our Arduino coding to detect whether there's smoke or not.
  • So add below code in your Arduino software and upload it to your Arduino board.
int Input = A0;
int SensorVal = 0;

int Check = 0;

void setup() {
  Serial.begin(9600);
  pinMode(Input, INPUT);
  Serial.println("Interfacing of Smoke Sensor with Arduino");
  Serial. println("Design by www.TheEngineeringProjects.com");
  Serial.println();
}

void loop() {

  SensorVal = analogRead(Input);
  if((SensorVal > 500) && (Check == 1))
  {
    Serial.println("Smoke Detected . . .");
    Check = 0;
  }

  if((SensorVal < 500) && (Check == 0))
  {
    Serial.println("All Clear . . .");
    Check = 1;
  }
  //Serial.println(SensorVal);
  delay(500);
}
  • After uploading the code to Arduino, open your Serial Monitor.
  • If everything goes fine then you will get something as shown in below figure:
  • Now let me bring the cigarette close to get some smoke. (Cigarettes are injurious to health :P )
  • You will get the warning as soon as it will detect smoke as shown in below figure:
  • We got the detection of smoke in our Serial Terminal.
So, that's how we can easily design a Smoke Detector with Arduino & MQ2 Sensor. I think now you can quite easily design this smoke detector project at home. I hope you will enjoy it. Will meet you guys in next tutorial. Till then take care and have fun !!! :)

Introduction to Transistor

Hi Guys! Hope you are doing fine. Today, I am going to give you a detailed Introduction to Transistor. A transistor is a semiconductor device that comes with three terminals, where a small current at one terminal is used to control current at the other terminals. Transistors are mainly used for the amplification of electronic signals. Transistors were first invented by American Physicists John Bardeen in 1947. Before the inception of transistors, vacuum tubes were used to control the electronic signals. These vacuum tubes come with anode & cathode arrangement and the potential difference across these ends produces the electric current. In the later versions, a filament is added which is used to provide heat to the cathode that directs the electrons towards the anode side. Their complex design, more power consumption set a pathway for the development of the transistors that play an important role in the creation of modern electronic devices. Before you get ahold of the transistor, I'd highly suggest you read the article on which is the building block of the transistor.

What is Diode?

Before going into the details of the transistor, let's first recall some points from the previous lecture Introduction to Diode:
  • A diode is a semiconductor device, that is developed when two types of semiconductor materials(i.e. N-Type and P-Type) are joined together.
  • In the construction of the diode, the PN junction is formed by the combination of P-type & N-type material.
  • Electrons(-ve charge) are major charge carriers in the N-Type material and Holes(+ve charge) are major charge carriers in the P-Type material.
Transistors are formed when an extra layer is added to this PN junction. Transistors come in various types including BJTs, JFETs, MOSFET. BJTs are the bipolar junction transistors which use two charge carriers i.e. electrons and holes for electrical conduction. And BJTs are the current controlled devices where small current at one terminal is used to control large current at other terminals. While JFETs are the unipolar devices where conduction is carried out by the movement of only one charge carrier. Let's dive in and explore what is the main function of a transistor and how it is used for the development of many electronic circuits.

Introduction to Transistor

  • A transistor is a three-terminal electronic device where small current at one terminal is used to control large current at other terminals. Transistors are mainly used for the amplification of the electronic signals.
  • Transistor comes with three terminals called emitter, base, and collector which are used for the external connection with electronic circuits.
  • Transistors were created with the intention of providing cheap electronics. They are available individually, however, most of the time they are packed together in integrated circuits which are then used for the developments of processors, computer memory chips, and complex ICs.
  • A transistor is a combination of two words i.e. transfer and varistor where each layer comes with an ability to transfer current to other layers when a proper biasing voltage is applied across one of the layers.
  • Transistor comes with three layers and two PN junctions where an emitter-base junction is forward biased and the collector-base junction is reverse biased.
  • Most of the transistors are created using silicon and germanium that are less expensive to vacuum tube and require less power to operate.
  • Based on the mobility of major charge carriers, transistors are divided into two types NPN and PNP transistors. Both are different in terms of electrical behaviors and physical construction.
  • The NPN transistors comes with three layers i.e. two N-doped layers and one P-doped layer. The P-doped layer is sandwiched between two N-doped layers. In NPN transistors, conduction is carried out by both charge carriers i.e. electrons and holes, however, electrons are major charge carriers in NPN transistors.
  • Similarly, PNP transistors comes with three layers i.e. two P-doped layers and one N-doped layer. The N-doped layer exists between two P-doped layers. Actually, N-doped layer is responsible for triggering transistor action. When a proper bias voltage is applied at the P-doped layer, it draws current which is then used to control large current at other terminals.
  • Transistors that come in NPN and PNP configurations are nothing but the combinations of two diodes joined back to back.
  • In NPN transistor current flows from collector to emitter, while in PNP transistor current flows from emitter to collector.
  • The current directions and voltage polarities are always opposite in both transistors. Suppose, if a current is flowing in a clockwise direction in NPN transistor and comes with positive polarity at the base terminal, it will flow in an anticlockwise direction in PNP transistor where voltage polarity becomes negative.
  • PN junction formed between two semiconductor material is a building block of the transistor. When PN junction is formed, major charge carriers in N-region (electrons) cross the junction and reach the P-region where they recombine with holes. Similarly, major charge carriers in P-region (holes) cross the junction and reach the N-region where they recombine with electrons.
  • The diffusion of electrons and holes depends on the biasing voltage applied across the junction.
  • The voltage is said to have forward biased when P-region is connected with positive terminal of the battery and N-region is connected with the negative terminal of the battery.
  • Under the forward biased condition, holes and electrons can easily cross the junction and maintain a current across the junction. When this diffusion occurs, it will generate the region across the junction which is depleted with major charge carriers. This region is known as depletion region.
  • As long as the forward biased voltage is applied, current flows across the junction. Diffusion of holes and electrons create an electric field within the junction. This electric field resists the further diffusion of charge carriers.
  • As said earlier, transistor comes with two PN junctions where one junction is forward biased and other junction is reverse biased.

Modes of Transistor

Transistor comes with different modes of operation. Let's discuss them one by one.
Active Mode
  • Active mode is used for amplification of the electronic signal where small current at the base terminal is being amplified at the collector terminal.
  • The base terminal is responsible for the transistor action which controls the number of main charge carriers (electrons in case of NPN transistor and holes in case of PNP transistor) flowing through it and draws a small current when a proper bias voltage is applied.
Cut-Off Mode
  • In this mode, transistor works as an open switch and no current flows across the terminals where a base voltage is less than a voltage at other terminals.
Saturation Mode
  • This mode is considered as an ON switch where current flows freely from collector to emitter.
  • In this condition, the voltage difference between collector and emitter is zero, and the collector current is restricted by a supply voltage and load resistance.
  • In saturation mode, both junctions are forward biased and base voltage is greater than the voltage at other terminals.
Reverse Active Mode
  • This mode acts as an active mode with one exception i.e. current direction is reversed.
  • Current flows from emitter to collector which is proportional to the base current.
  • The base current is highly influenced by the bias voltage applied at the terminal which then controls large current at other terminals.
  • The voltage at the terminals is related in the following way.

Current Gain

Current gain plays an important role in the function of the transistor. Following are two common current gains in a transistor.
Common-Emitter Current Gain
  • Common-Emitter current gain is a ratio between collector current and base current.
  • This is also known as an amplification factor which defines the amount of current being amplified.
  • It is called beta and denoted by ß. The beta value ranges from 20 to 1000, however, most of the time its value is taken as 50.
Common-Base Current Gain
  • Another current gain is common-base current gain which is a ratio between collector current and emitter current.
  • It is called alpha and denoted by a. The alpha value is taken as unity.
Applications of Transistor
  • Transistors are mainly used for the amplification of low and high-frequency AC signals.
  • No current is produced at the collector terminal unless there is a current at the base terminal. This process allows the transistor to work as a switch. The transistor can be turned ON and OFF by controlling the bias voltage at the base terminal.
  • Based on requirements, a transistor can be made to operate in cut-off or saturation region for switching applications.
  • Integrated circuits added in the development of the processors are made from transistors.
  • Used in the development of logarithmic converters and logic gates.
  • Transistors are widely used in modern electronics especially where signal processing and radio transmission is required.
That's all for today. I hope you have found this article useful. We always keep your demands on the top and develop a content that truly resonates with your field of interest. If you are unsure or have any question, you can ask me in the comment section below. I'd love to help you in any way I can. Thanks for reading the article.

What is PN Junction? Forward-Biased | Reverse-Biased

Hey Guys! I hope you all are doing great. In the previous tutorial, we studied the basics of Semiconductors, where we briefly discussed the PN Junction. Today, we are going to have a detailed overview of PN Junction.

But before getting into the details of PN Junction, we need to first recall a few concepts from the previous lecture:

Semiconductor Basics

As we know, the conductive power of a semiconductor material lies between a conductor and an insulator. So, it can act as a pure conductor as well as a pure insulator, depending on the applied conditions.

Semiconductors are divided into two types:

  • Intrinsic Semiconductor.
  • Extrinsic Semiconductor.

Intrinsic Semiconductor

  • A semiconductor in its pure form is called an Intrinsic semiconductor.
  • In this state, the outermost valance shell of the semiconductor has an equal number of electrons and holes(which is 4).
  • These four valance electrons in the outermost shell of an Intrinsic semiconductor remain bound to their positions and thus no conduction is allowed.
  • So, an Intrinsic Semiconductor acts as a pure insulator.
  • The elemental Silicon(Si) or Germanium(Ge) in its pure form is an intrinsic semiconductor.

Extrinsic Semiconductor

  • In order to increase the conductive power of semiconductors, small amounts of impurities(in the ratio of 1 to 106) are added to them, by a method called Doping.
  • Such doped/impure semiconductors are called Extrinsic Semiconductors.
  • Impurities added in the semiconductors are of two types i.e.
    • Pentavalent (Arsenic, Antimony, Phosphorous etc.).
    • Trivalent (Aluminium, Boron, Indium, Gallium etc.)
  • If the semiconductor is doped with a Pentavalent impurity, it's called N-Type Semiconductor.
  • If the doping element used is trivalent, the extrinsic semiconductor produced will be called P-Type Semiconductor.

So, now we need to understand the formation of N-Type and P-type semiconductors, because PN Junction is formed by joining these two types.

N-Type Semiconductors

  • Pure semiconductors normally belong to the 4th column of the periodic table and thus have an equal number of electrons & holes in their valance shell(which is 4).
  • So, in pure form, there's no free electron or hole available for the conduction of electricity and thus it acts as an insulator. (We discussed conduction energy levels in detail in our last lecture)
  • The pentavalent elements belong to the 5th column of the periodic table and have 5 electrons in their outermost shell.
  • So, when a pure semiconductor i.e. Silicon(Si) is doped with a pentavalent impurity i.e. Boron(B), the four valance electrons of the Boron(B) will create a covalent bond with the closest Silicon(Si) atoms, but the 5th electron won't find a pair and will become a free electron.
  • This free electron increases the conductive ability of the semiconductor.
  • As an electron carries a negative charge, such extrinsic semiconductors are called Negative-Type Semiconductors or N-Type Semiconductors.
  • In N-Type Semiconductors, the majority charge carriers are free electrons(negative), while the holes(positive) are present in very small numbers(called minority charge carriers).

Now let's have a look at the formation of P-Type Semiconductors:

P-Type Semiconductors

  • When a semiconductor is doped with a trivalent impurity i.e. Aluminium(Al), the extrinsic semiconductor produced is called P-Type Semiconductor and has positively charged holes as majority charge carriers.
  • Trivalent elements belong to the 3rd column of the periodic table and have 3 electrons in their outermost shell(valence shell).
  • So, if we dope Silicon(Si) with Aluminium(Al), the 3 valence electrons of the impurity element(Al) will create a covalent bond with the neighboring Silicon(Si) atoms.
  • The 4th valence electron of Si won't find a pair and thus a positively charged Hole will be originated. A Hole is a vacant space, has a positive charge and is ready to accommodate an electron(if available).
  • This Hole generated in the Si crystal will increase its conductivity and such doped semiconductor will be called Postive-Type Semiconductor or P-Type Semiconductor.

So far, we have created N-Type and P-Type Semiconductors by adding pentavalent and trivalent impurities respectively in separate semiconductor crystals. Now, we are going to add both impurities in a single semiconductor crystal to create a PN Junction. So let's get started:

What is PN Junction?

  • When a single crystal of semiconductor is doped with both pentavalent(i.e. Boron) and trivalent(i.e. Aluminium) impurities, a special barrier is created at the boundary of the two regions(N-Type & P-Type) which stops the flow of charge carriers. This barrier is called PN Junction.
  • The most basic semiconductor component called Diode is a real-life application of the PN Junction.

Now let's have a look at the formation of this PN Junction:

PN Junction Formation

  • As we know, electrons are the majority charge carriers in N-Type Semiconductors and Holes are the majority charge carriers in P-Type Semiconductors.
  • Now, when we dope a single Si crystal with both impurities, an N-Typer region is created on one side and a P-Type region is created on the other side of the crystal.
  • Electrons(in the N-Type region) present near the boundary get excited and diffuse into the P-Type region. Similarly, the Holes(in the P-Type region) close to the boundary move towards the N-Type region.
  • This generates a potential difference at the boundary of the two regions, which gradually increases and at one point, restricts the further flow of electrons or holes in the neighboring region. (electron-hole diffusion stops)
  • This region at the boundary with electrons in the P-Type region and Holes in the N-Type region is called the depletion region.
  • The width of this depletion region depends on the amount of impurity added to the semiconductor.
  • This Junction/boundary of the P-Type and N-Type regions is called the PN Junction.
  • Under normal conduction, when there is no voltage applied across the PN junction, the junction is said to be in an equilibrium state. The potential difference at the junction in that state is called built-in potential which is 0.7 V for Silicon(Si) and 0.3 V for Germanium(Ge).
  • When an external voltage is applied at the PN Junction, we get two behaviors of PN Junction depending on the external voltage polarity, named:
    1. Forward-Biased.
    2. Reverse-Biased.

Let's discuss these diode states, one by one:

Forward-Biased PN Junction

  • If the positive terminal of the battery is connected to the P-region and the negative terminal to the N-region, the PN Junction will be said to be operating in a Forward-Biased State.
  • The external voltage should be greater than the built-in potential i.e. 0.7V for Si and 0.3V, so that it could melt the depletion region.
  • In the Forward-Biased State, the Holes start to move towards the N-region and the electrons start flowing towards the P-region.
  • As a result, the width of the depletion region starts reducing and finally depletes out.
  • The current starts flowing through the semiconductor, as soon as the depletion region gets removed. We can say the semiconductor is acting as a conductor.
  • In this state, the semiconductor has maximum conductivity and quite low resistance.

Reverse-Biased PN Junction

  • If the P-region is connected with the negative terminal of the external source and the N-region with the positive terminal, the PN-Junction will operate in the reverse-biased state.
  • As the P-region is connected to the negative voltage, the holes in the P-region will get attracted towards the external voltage, so start flowing away from the depletion region. The same will be the case with the electrons.
  • So, no current will flow through the PN Junction in a reverse-biased state.

PN Junction as a One-Way Switch

In a normal conductive wire, current can flow in both directions but in a PN Junction, the current will flow only in one direction and will get blocked in the opposite direction. So, we can say that a PN-Junction is a One-Way Switch, allowing the current to flow in one direction only. On the top of my head, it could be used to avoid the back emf generated by the motors. This One-way switch literally bought a revolution in electronics.

Breakdown Region

  • While the PN Junction is operating in the reverse-biased state, if the external voltage exceeds a certain limit, the PN Junction will collapse, resulting in an excessive amount of current flow(short-circuit). This external voltage is called breakdown voltage and the PN Junction is said to be operating in a breakdown region.
  • PN Junction can't recover from the breakdown region so it should be avoided, though it also has a few advantages, which we will cover in the Zener Diode Chapter.
  • The breakdown voltage depends on the semiconductor used and the amount of impurity added.

Characteristic Curve of PN Junction

The following figure shows the I vs V characteristic curve of a silicon diode:

  • As we can see in the above characteristic curve of PN Junction, it has two sections i.e. forward-biased and reverse-biased.
  • In the forward-biased state, if the voltage is lower than the built-in potential(i.e. 0.7 for Si), a small amount of current is flowing through the PN Junction but if the voltage overcomes the built-in potential, the current jumps to its maximum value and we can say the PN Junction is conducting.
  • In the reverse-biased state, there's no current flowing through the PN Junction until the breakdown voltage is reached.
  • At the breakdown voltage, the current starts flowing in the opposite direction and we can say the PN Junction collapsed.
  • The small current flowing under reverse bias normal condition is known as leakage current. Germanium(Ge) has more leakage current as compared to Silicon(Si).

So, that's all for today. I hope you have enjoyed today's lecture. In the next lecture, we will discuss the Basics of Diodes, where I am going to repeat today's lecture :)) But I will keep the practical approach in it, so there will be a lot to learn. If you have any questions, you can approach me in the comment section below. Keep your suggestions and feedback coming, they help us deliver quality content. Thanks for reading the article.

Introduction to 2n3903

Hi Friends! Hope you are doing great. I am back to give you a daily dose of valuable information so you can excel and grow in your relevant field. Transistors are the fundamental parts of most of the electronic circuits. Today, I am going to unlock the details on the Introduction to 2n3903. It is an NPN transistor main used for general purpose amplification and switching applications. Transistor comes in two types i.e. NPN and PNP transistors. This transistor falls under the category of NPN transistor. This is a bipolar junctions transistor where conduction is carried out by movement of both charge carriers i.e. electrons and holes. However, electrons are major charge carriers in case of NPN transistors. If you are unsure how these bipolar transistors work, you can check this read on Introduction to Bipolar Junction Transistor. I'll reveal each and everything related to this transistor, so you don't get overwhelmed by all data across the web and find all information in one place. Before we move on to the details of this NPN transistor, you must be clear what is transistor? The transistor is an electronic component that comes with three terminals that are used for external connection with the electronic circuits. The voltage applied to one pair of its terminals is used to control the current at the other pair of terminals. Let's dive in and explore what is this about, its pinout, circuit diagram, applications and everything you need to know.

Introduction to 2n3903

  • The 2n3903 is an electronic component called NPN transistor mainly used for general purpose amplification and switching applications.
  • It comes with three terminals called emitter, base, and collector.
  • This transistor has three layers i.e. two N-doped layers and one P-doped layer. The P-doped layer is a semiconductor that is housed between two N-doped layers.
  • The P-doped layer represents the base of the transistor while other two layers represent emitter and collector respectively.
  • All three terminals are different in terms of their size and doping concentration. The emitter is highly doped as compared to base and collector.
  • The base is lightly doped which is responsible for the electron reaction when a voltage is applied at this terminal. When a voltage is applied, it draws small current which is then used to control large current at the emitter and collector terminals.
  • Under normal conditions, the number of electrons diffused into the base terminal is more than the number of holes diffused into the emitter terminal. Electrons act as a majority charge carriers in case of NPN transistor.
  • This transistor is an ideal choice for amplification and switching purpose requiring collector current around 100mA.
Pinout of 2n3903
Following figure shows the pinout of this NPN transistor which is composed of three terminals. 1. Emitter  2. Base 3. Collector 
  • Movement of electrons plays an important role in the current flowing from emitter to collector.
  • The output current obtained at the output terminals is highly dependent on the voltage applied to the base terminal.
  • This bipolar transistor is a current controlled device where small current at the base terminal is used to control large current at other terminals. It is different than MOSFET that is voltage controlled unipolar device where conduction is carried out by one charge carrier i.e either electron or hole.
Circuit Diagram of 2n3903
  • Following figure shows the circuit diagram of this NPN transistor.
  • The emitter is highly doped so it exhibits more current as compared to other terminals. Actually, current at the emitter terminal is a sum of the current at the base and collector terminal.
  • Common-Emitter current gain plays an important role in the amplification process. It is a ratio between collector current and base current. It is called beta and denoted by ß. This is also called amplification factor which defines the amount of current being amplified.
  • Common-Base current gain is another important factor which exhibits lower value than beta. It is a ratio between collector current and emitter current. It is called alpha and denoted by a. Alpha value ranges between 0.95 to 0.99 and most of the time its value is taken as unity.
Absolute Maximum Ratings of 2n3903
  • Following figure shows the absolute maximum ratings of this NPN transistor.
  • These are the stress ratings which play an important role in the execution of the electronic circuit. If these stress ratings are exceeded from absolute maximum ratings, they can damage the device at large, ultimately affecting the overall nature and performance of the project.
  • Similarly, if these ratings are applied for the maximum period of time above normal operating conditions they can affect the reliability of the device.
  • It is advised to check these ratings before placing the device in the circuit and make sure device undergoes and follows same operating conditions and stress ratings as defined by the manufacturer.
  • Steps and measurements taken in the early stages of your project can save you bunch of time and worry and prevents electronic circuit from being affected.
Difference between PNP and NPN Transistors
  • NPN and PNP work in a similar way with the intention of amplification and switching purpose but there is some difference between them.
  • Voltage polarities and direction of currents are opposite in these transistors.
  • Electrons are majority charge carriers in case of NPN transistors while holes are majority charge carriers in case of PNP transistors, however, both types of transistors require both charge carriers for complete conduction process.
  • The base is negative in case of PNP transistor and a negative voltage is applied at the base terminal in order to trigger the holes reaction. And the base is more negative as compared to emitter and collector.
  • While in case of NPN transistor, a base is positive and positive voltage is applied at this terminal in order to trigger electron reaction which draws small current that is used to control large current at the emitter and collector terminals.
  • These transistors are nothing but a combination of diodes joining back to back.
Applications
  • This transistor is mainly used for amplification and switching purpose where collector current around 100mA is required.
You must have look at following articles that are bipolar junctions transistors used for amplification, switching or other electronic applications. 2n5551 - NPN transistor 2n2219 - NPN transistor That's all for today. I hope you have found this article useful. However, if you are unsure or have any question relating to this transistor, you can approach me in the comment section below. I'd love to help you according to best of my expertise and knowledge. Thanks for reading the article.

Introduction to PNP Transistor

Hey Friends! Hope you are doing great. I am back to give you a daily dose of valuable information so you can always stay ahead of your competitors. I have previously updated the article on NPN transistor that is used for amplification and switching purpose. Today, I am going to unveil the details on the Introduction to PNP Transistor which falls under the category of bipolar junction transistors and comes with three layers i.e. two P-doped layers and one N-doped layer where an N-doped layer exists between two P-doped layers. Main Function: Small current at one terminal is used to control large current at other terminals. Major Charge Carriers:  Holes  These NPN and PNP transistors come with their own benefits based on the nature of the electronic project, however, NPN transistors always deems preferable over PNP transistors because of its quick response due to mobility of electrons while PNP transistors are not preferable for amplification and switching purpose because conduction through mobility of holes deems less useful and beneficial as compared to mobility of electrons. In this tutorial, I’ll discuss each and everything related to this PNP transistor i.e what it does, circuit diagram, applications and everything you need to know. Let’s dive in and explore what is this about and how it is used for the execution of electronic projects.

Introduction to PNP Transistor

  • The PNP transistor is a type of bipolar transistor used for amplification and switching purpose and for the designing of the complementary output stage in combination with NPN transistor.
  • It comes with three terminals called emitter, base, and collector where small current at the base terminal is used to control large current at other terminals.
  • It is a current controlled device also known as sinking device where it sinks current into its base terminal and current flows out of the collector.
  • Unlike NPN transistor, current flows from the emitter to collector in this PNP transistor and holes act as a majority charge carriers.
  • This transistor comes with same characteristics as NPN transistor but there are some exceptions. In case of PNP transistor, all voltage polarities and current directions will be reversed as compared to NPN transistor. The PNP transistor sinks current into its base while NPN transistor sources current through its base terminal.
  • Both NPN and PNP transistors are current controlled devices where conduction is carried out by both charge carriers i.e. electrons and holes, but major charge carriers are electrons in case of NPN transistors. While in case of PNP transistor major charge carriers are holes.
  • The PNP transistor is like a combination of diodes combined back to back from cathode sides.
Construction
  • This PNP transistor is composed of two P-doped layers and one N-doped layer where N-doped layer represents the base of the transistor while other P doped layers represent emitter and collector respectively.
  • The base of the transistor is more negative than the emitter terminal.
  • All three terminals in the PNP transistor are different in terms of doping concentration and size.
  • An emitter is highly doped and exhibits 100% current of the transistor while a base is lightly doped which is responsible for the transistor action and controls the number of holes in case of PNP transistor.
  • While collector is lightly doped and comes in a bigger size as compared to other two terminals and collects the number of holes.
Circuit Diagram
  • Following figure shows the circuit diagram of PNP transistor.
  • In PNP transistor, a source voltage is applied at the emitter terminal (instead of collector terminal in case of NPN transistor) and load resistor is applied that is used to resist the current in the collector terminal.
  • Similarly, a bias voltage is applied at the base terminals and a base resistor is connected to this terminal in order to limit the current flowing through this terminal.
  • The emitter is connected to a positive voltage while the base is connected to the negative voltage.
Working
  • Similar to NPN transistor, PNP transistor comes with two pn junctions i.e. emitter-base junction and collector-base junction.
  • An emitter-base junction is forward biased and shows low resistance while collector-base junction is reverse biased and exhibits high resistance. Steps and process required to make these junctions forward biased and reverse biased are different than NPN transistors.
  • Emitter-base junction will become forward biased when a base is negative with respect to the emitter and the voltage at the base side is 0.7 V less than the voltage at the emitter side.
  • Similarly, emitter-base junction is made reverse biased when applied collector voltage is negative. In case of PNP transistor, emitter voltage is much larger than collector voltage.
  • In order to conduct for PNP transistor, emitter voltage must be more positive as compared to both base and collector.
  • The transistor will turn on when there is small current flowing from emitter to base terminal.
  • In PNP transistors emitter emits holes as compared to NPN where emitter emits electrons.
  • When a proper bias voltage is applied at the base terminal, it gets biased and the holes present at emitter terminal moves to the base terminal where they combine with the electron present at this terminal. This generates the small current at the base terminal.
  • The base is very thin so it is very difficult for a base to accept all holes injected by the emitter, as a result, most of the holes leave the base terminal and enter collector terminal.
Matched Switch
  • Combination of PNP transistor with NPN transistor is used for designing and development of the power amplifier circuits. Power B amplifiers are the great example of this amplifier circuits where both PNP and NPN transistors are incorporated together to generate high amplification cycle.
  • Pair of NPN and PNP transistor used in Class B amplifiers is called complementary or matched switch where PNP transistor conducts for the negative half cycle while NPN transistor conducts for the positive half cycle of the transistor.
  • This process is used to generate required power for the loudspeaker in both directions. The resulting power generates at the output current is very high which is then equally shared between matched switch composed of NPN and PNP transistor.
Output Characteristics Curve
  • The output characteristic curve of PNP transistor looks identical to that of NPN transistor but there is one exception i.e. it is rotated by 180 degrees.
  • The same load line is drawn on the characteristic curve that we drew in case of NPN transistor that mentions the operating points of the transistor.
  • The following figure shows the characteristics curve of PNP transistor which is drawn between the output current and collector-emitter voltage and is rotated by 180 degrees where current directions and voltage polarities are reversed. The supply voltage becomes negative for PNP transistor.
  • The current gains (alpha, beta) value are much less in PNP transistor as compared to NPN transistor. We can calculate the beta value from the following equation;
Difference between PNP and NPN Transistors
  • The PNP transistor is known as sinking device while NPN transistor is known as sourcing device.
  • The main difference between PNP and NPN transistor is the proper biasing of the base terminal where current directions and voltage polarities are always opposite to each other.
  • In PNP transistor, holes are majority carriers while in NPN transistor electrons are majority carriers.
  • The emitter voltage is made more positive as compared to both base and collector in PNP transistor. While collector voltage is made more positive as compared to base and emitter in case of NPN transistor.
  • The PNP transistor will be considered ON when there is no current at the base terminal. The NPN transistor will be considered ON when there is enough current present at the base terminal.
  • In PNP transistor current flows from the emitter to collector, while in case of NPN transistor current flows from collector to emitter.
  • The base is positive in case of NPN transistor while it is negative in PNP transistor.
  • When there is enough voltage applied at the base terminal it gets biased in case of NPN terminal while in case of PNP transistor, negative voltage 0.7 V less than emitter voltage must be applied to trigger transistor action.
Applications
  • This transistor is used as a switch for electronic signals.
  • It is used in amplifying circuits.
  • Used as a matched switch in combination with NPN transistor for generating continuous power.
  • Current flow involving heavy motors makes use of these transistors.
  • Used in robotic applications where current sinking is required.
That's all for today. I hope you have found this article useful. If you are unsure or have any question, you can ask me in the comment section below. I'd love to help you in any way I can. You are most welcome to add anything valuable related to this transistor. Thanks for reading the article.

Introduction to NPN Transistor

Hello Friends! I hope you are well. Today, I am going to give you a detailed Introduction to NPN transistor. In this tutorial, we'll look at the NPN transistor, how it works, circuit diagram, output characteristics curve, and applications. It is a bipolar junction transistor mainly used for current amplification and switching purposes. BJTs (Bipolar Junction Transistor) are divided into two types i.e. NPN transistor and PNP transistor. Both transistors are different in terms of their electrical composition and construction, however, both are used for amplification and switching purposes in one way or the other.

What is NPN Transistor?

  • NPN transistor is a bipolar junction transistor(BJT), composed of 3 semiconductor layers in a way that one P-doped layer(Base) is sandwiched between two N-doped layers(Emitter & Collector) and is mainly used for current amplification and fast switching.
  • In NPN transistors, the majority charge carriers are electrons and thus conduction is carried out by the flow of electrons from emitter to collector.
  • NPN transistor package comes with three terminals named:
    1. Emitter.
    2. Base.
    3. Collector.
  • These terminals are used for external connection with the circuit and a small current at the base terminal is used to control the large current at the collector and emitter side. (We will cover it in detail in the working section)
Let's have a look at the symbol of NPN transistor:

NPN Transistor Symbol

  • As we use logos to represent companies, similarly in electronics, specific symbols are used to represent components. These electronic symbols prove helpful in designing circuit diagrams especially block diagrams of electronic models.
  • Below figure shows the NPN transistor's Symbol:
Now let's have a look at the Construction of NPN Transistor:

Construction of NPN Transistor

  • NPN transistor consists of 3 regions, two of them are constructed using N-type semiconductor material while the third one is of P-Type Semiconductor.
  • The P-type region is sandwiched between these two N-Type regions.
  • So hypothetically, NPN Transistor is constructed by connecting two diodes in opposite directions.
  • The equivalent circuit of NPN transistor is shown in the below figure:
  • An NPN transistor has two P-N junctions in it, named as:
    1. Emitter-Base Junction.
    2. Collector Base Junction.

Doping Concentration in NPN Transistor

  • Impurities are added to Intrinsic(Pure) Semiconductors which increase their conductivity and are called Extrinsic(Doped) Semiconductors.
  • In NPN transistors, the Base region is heavily doped, the Emitter is lightly doped while Collector's doping lies in between the Base & Emitter.
  • So, in terms of doping concentration from high to low, we have the sequence as follow:

Base > Collector > Emitter

  • Moreover, the Base region is constructed using P-type semiconductors, while Emitter & Collector are designed using N-type semiconductors.
Now, let's have a look at the working of NPN transistors:

How NPN Transistor Works?

  • The NPN transistor comes with two junctions, called:
    1. Emitter-Base Junction.
    2. Collector-Base Junction.
  • The NPN transistor sets in operating condition when an emitter-base junction is forward biased and the collector-base junction is reverse biased and enough current is present at the base terminal. In order to make emitter-base junction forward biased, a positive voltage is applied at the base side and a negative voltage is applied at the emitter side.
  • Similarly, in order to make emitter-base junction reverse biased, collector voltage must be kept more positive than base and collector.
Circuit Diagram
Following figure shows the circuit diagram of the NPN transistor.
  • We can see from the diagram, voltage and resistive loads are applied at the terminals of the transistor.
  • A negative voltage is connected to the emitter while a positive voltage is connected to the base terminals.
  • The base is more positive with respect to the emitter.
  • The resistive load is applied at the base terminal which limits the current produced in this terminal.
  • The positive voltage is applied at the collector terminal and load resistance is applied at this terminal that limits the electrons entering at this terminal.
Working
  • The base is responsible for initiating transistor action. When a voltage is applied at the base, it gets biased and draws a small current which is then used to control a large current at the collector and emitter side.
  • The base action is considered as an ON-OFF valve that generates current when a proper bias voltage is applied at this terminal.
  • The small change in the voltage applied at the base terminal shows a large impact on the output terminals. Actually, the base acts as an input and the collector acts as an output in NPN transistor.
  • In case of silicon transistor emitter-base junction draws voltage around 0.7 when there is no voltage at the base terminal, in order to initiate the electron action and put the transistor in running condition, the base voltage must be greater than 0.7 voltage in the case of silicon transistor and 0.3 in case of germanium transistor.
  • In the N-side of the transistor which represents emitter, the electrons act as the majority charge carriers which are then diffused into the base when a suitable voltage is applied at the base terminal. These electrons act as minority charge carriers when they enter the base terminal, where they join with holes present in the base. Not all electrons join with the holes present at the base terminal. Some of them join with the holes, and the resulting electron-hole pair disappears. Most of the electrons leave the base terminal and then enter the collector region where they again act as a majority charge carriers.
  • When a voltage is applied across the base terminal, the base current is given by;
 
  • Collector current is directly related to base current times a constant factor.
  • In order to increase the efficiency of the NPN transistor, the base is made very thin and a collector is made thick for two reasons i.e collector can handle more heat and accept more electrons diffused through the base terminal.
Current Gains and Relation between Them
  • Current gains play an important role in the amplification process. The common emitter current gain is a ratio between collector current and base current. It is called beta and denoted by ß. It is also known as an amplification factor which defines the amount of current being amplified.
  • Beta is a ratio between two currents, so it features no unit. The beta value is always greater than unity and ranges between 20 to 1000 - 20 for high power transistors and 1000 for low power transistors, however, most of the time its value is taken as 50.
  • Similarly, a common base current gain is another important factor which is a ratio between collector current and emitter current. It is called alpha and denoted by a. An alpha value ranges between 0.95 and 0.99, however, most of the time its value is taken as unity.
  • Following figure shows the relation between two current gains.
  • IF alpha = 0.99 then b = 0.99/0.01 = 99.
  • An alpha value cannot exceed from unity, because it is a ratio between collector current and emitter current i.e emitter current always remains greater than collector current because it exhibits 100% current of the transistor and is equal to the sum of collector current and base current.
NPN Transistor Configurations
  • This NPN transistor can be configured into three configurations called common emitter configuration, common collector configuration, and common base configuration.
  • Common emitter configuration is mostly used for amplification purpose where base acts as an input, collector acts as an output while emitter acts as a common terminal between input and output.
  • This common emitter configuration acts always operates in a linear region where small current at the base side is used to control large current at the collector side.
  • The common emitter configuration used in the electronic circuits always produces inverted output that is highly affected by the bias voltage and temperature. This configuration is an ideal choice for ampliation circuits because it comes with high input impedance and low output impedance and produces the exact voltage and power gain required for amplification purpose.
  • During common emitter configuration, transistor always operates between saturation and cut-off region that helps in amplifying the negative and positive cycles of the input signals. If the base terminal is not biased with the proper voltage, only half of the signal would be amplified.
Output Characteristics Curve of NPN Transistor
Following figure shows the output characteristic curve of the NPN bipolar transistor which is plotted between output collector current and the collector-emitter voltage with varying base current.
  • As described earlier, there will be no output collector current if the applied voltage at the base terminal is zero. When proper bias voltage above 0.7 V, is applied at the base terminal, it gets biased and draws current that controls and effects the output collector current.
  • We can see, Vce directly effects the value of output collector current as long as the applied voltage is 1 V. Above that value collector current no longer remains under the influence of Vce value. In that case, the collector current is widely dependent and controlled by the base current. A small change in the base current and bias voltage would produce a large change in the collector current.
  • The load resistor applied at the collector terminal controls the amount of current entering the collector terminals. Keeping in the view of the load resistor and the voltage applied at the collector-emitter terminals, the collector current is given by;
  • Straight load line between point A and B falls under active region when an emitter-base junction is forward biased and the transistor conducts where electrons are majority charge carriers.
  • The Q point in the graph can be defined by the load line which is actually referred as an operating point of the transistor.
  • The output characteristics curve of this NPN transistor is used to describe the collector current when base current and collector voltage is given.
  • In order to conduct, collector voltage needs to be more positive than base and emitter.
  • It is important to note that, when an emitter-base junction is not forward biased, Ic will be zero, no matter how much voltage is applied at the base terminals. When the emitter-base junction is forward biased and voltage is applied at the base terminal, it draws small current which is then used to control large current at other terminals.
Difference between NPN and PNP Transistors
  • Both NPN and PNP transistors are different in terms of electrical construction and layers doping. NPN stands for negative-positive-negative and also known as sourcing device. While PNP stands for positive-negative-positive and also known as sinking device.
  • In NPN transistor base is positive as compared to emitter and collector voltage is more positive as compared to both emitter and base. Similarly, in PNP transistor base is negative as compared to emitter and emitter voltage is much larger than collector voltage.
  • The voltage polarities and current directions are reversed in both transistors.
  • The NPN transistor conducts and initiates transistor action when a positive voltage is applied at the base terminal. The PNP transistor conducts when a negative voltage lower 0.7 V (for silicon) than emitter voltage is applied at the base terminal.
  • The NPN transistor uses electrons as majority charge carriers for the conduction while PNP transistor uses holes as majority charge carriers for conduction process.
  • In NPN transistor current flows from the collector to emitter while in case of PNP transistor current flows from emitter to collector terminal.
  • Both transistors differ in terms of how they are powered on. The NPN transistor powers on when there is enough current present at the base terminal while PNP transistor powers on when there is no current at the base terminal.
Now, let's have a look at the applications of NPN transistor:

Applications of NPN Transistor

NPN Transistor is the most commonly used type of transistor because of its wide range of applications. A few of NPN transistor applications are as follows:
  • As NPN transistors are fast switching devices, thus they are used for switching purposes i.e. Pulse Width Modulation.
  • NPN transistors are also used as automatic switches in electronics products.
  • Because of high current gain, NPN transistors are used for current amplification i.e. small current at input allows heavy current to pass at the output(Ic).
  • In embedded computers(i.e. microcontrollers, microprocessors etc.), thousands of transistors are joined together(in SMD form) performing different functions i.e. switching of pins.

Real-Life Applications of NPN Transistor

  • Used in logarithmic converters and high-frequency applications.
  • Signal processing and radio transmission applications involve NPN transistors.
  • Darlington pair circuits make use of this NPN transistor for amplifying signals.
  • Used in temperature sensor.
  • Push-Pull amplifying circuits, which fall under the category of the classic amplifier circuit, make use of this NPN transistor.
  • In small quantities, transistors are used to make logic circuits and in the circuits where amplification is required.
That's all for today. I hope you have got clear what is NPN transistor and why it is used for. If you are unsure or have any questions, you can approach me in the comment section below, I'd love to help you according to the best of my expertise and knowledge. Feel free to keep us updated with your feedback and suggestions, they help us provide you quality content that aligns with your needs and requirements. Thanks for reading the article.

Introduction to 2n5884

Hey Friends! Hope you are doing great. I am here to provide you the technical knowledge that helps you stay ahead of your competitors. Today, I am going to unlock the details on the Introduction to 2n5884. It is a power PNP bipolar junction transistor mainly used for general purpose amplification and switching purpose. This is a complementary silicon epitaxial-base transistor that can support 25 A and 80 V. I'll discuss each and everything related to this transistor i.e. what it does, its pinout, circuit diagram and main applications. You must have a look at comprehensive read on Introduction to Bipolar Transistor if you are unsure how these bipolar transistors work. Before we dive into the details of this PNP transistor we must be aware what is transistor? The transistor is a semiconductor device that comes with three terminals where a voltage applied to one pair of terminals controls the current on the other pair of terminals. Let's dive in and explore everything you need to know about this PNP transistor.

Introduction to 2n5884

  • The 2n5884 is a power PNP bipolar transistor mainly used for general purpose amplification and switching purpose.
  • It is a silicon semiconductor device that comes with three terminals called emitter, base, and collector.
  • It comes with three layers where one N-doped layer is housed between two P-doped layers. The N layer represents the base of the transistor, while other two layers represent emitter and collector respectively.
  • This component is also known as a current controlled device where a voltage applied at the base terminal is used to control large current at the emitter and collector terminals.
  • This PNP component is a little bit different than its counterpart NPN transistor, however, both are bipolar components where current is carried out by the movement of both charge carriers i.e. electrons and holes. Electrons are major charge carriers in NPN transistor and holes are major charge carriers in PNP transistor.
  • When a voltage is applied at the base terminal, it gets biased and draws current which is then used to control large current at the emitter and collector terminals.
  • All these three terminals are different in terms of their size and doping concentration. An emitter is highly doped and carries more current as compared to base and collector. The base is lightly doped which is responsible to trigger electron reaction at the base terminal. The collector is moderately doped which accepts the holes in case of this PNP transistor.
  • Output current obtained at the collector terminal is highly dependent on the voltage applied at the base terminal. This process is used for amplification purpose.
  • You must have a look at the construction of diode which plays a vital role in the construction of this bipolar transistor.
Pinout of 2n5884
  • Following figure shows the pinout of this PNP transistor which is composed of three terminals.
1. Base 2. Emitter 3. Collector 
  • Movement of holes plays an important role in the output current obtained at the output terminals.
  • Unlike NPN transistor, a negative voltage is applied at the base terminal in this PNP transistor where the base is more negative as compared to emitter and collector.
Circuit Diagram of 2n5884
Following figure shows the circuit diagram of 2n5884.
  • An emitter is highly doped so current at the emitter side more than current at the collector and base side. Actually, emitter current is the sum of base and collector current.
  • Unlike NPN transistor, holes are diffused through the base from the emitter in this PNP transistor, which are then collected by the collector.
  • This PNP transistor is used for amplification purpose, however, most of the professionals don't recommend this transistor for amplification purpose and pick NPN transistor for amplification because conduction carried out by the movement of electrons is more effective and suitable than conduction carried out by the movement of holes.
  • This transistor is different than JFET which is unipolar transistor i.e conduction is carried out by single charge carrier.
Absolute Maximum Ratings
  • Following figure shows the absolute maximum ratings of this PNP transistor.
  • It is important to note that, these are the suitable stress ratings recommended by the manufacturer, which if exceed from absolute maximum ratings, can damage the device severely.
  • Similarly, if these ratings are applied for the maximum period of time above normal operating conditions, they can affect the overall reliability of the device.
  • Take these ratings into consideration and make sure this component exhibits and follows same ratings defined by the manufacturer before you intend to place this component into your project.
  • Proper measurements taken the early stages of your project can save your bunch of time and worry that can affect the nature and overall performance of the project.
Applications
  • This component is used for amplification and switching purpose.
You must also have a look at following transistors of same nature used for amplification, switching, and different electronic applications. That's all for today. I hope you have found enough information about this component. In case you are feeling unsure or have any question, you can ask me in the comment section below. I'd love to help you according to best of my knowledge and expertise. Keep your suggestions and feedback coming, they allow us to give you quality content that aligns with your field of interest. Thanks for reading the article.
Syed Zain Nasir

I am Syed Zain Nasir, the founder of <a href=https://www.TheEngineeringProjects.com/>The Engineering Projects</a> (TEP). I am a programmer since 2009 before that I just search things, make small projects and now I am sharing my knowledge through this platform.I also work as a freelancer and did many projects related to programming and electrical circuitry. <a href=https://plus.google.com/+SyedZainNasir/>My Google Profile+</a>

Share
Published by
Syed Zain Nasir