Introduction to LM317

Hello everyone! I hope you all will be absolutely fine and having fun. Today, I am going to explore my knowledge about Introduction to LM317. It is basically a positive voltage regulator having three terminals. It can a supply a current more than 1.5A and voltage in a range of 1.25V to around 37V. You should also have a look at this LM 317 Calculator. For the adjustment of output voltage only two external resistors are required. It has improved standards of line regulation as well as load regulation. Full overload protection e.g. current limiting, area protection can be achieved using LM317. If its adjusting terminal is disconnected, even then all of the protection circuits will work properly. We can also use LM317 as precision current regulator by inserting a constant resistor between its adjustment terminal and output terminal. LM317 has a wide range of applications e.g. constant regulators, battery chargers, microprocessors supplies, automatic LED lightning, Ethernet switch, femto base station, hydraulic valve, IP phone, motor controllers, power bank solutions, power quality monitoring, Embedded Systems etc.

Introduction to LM317

LM317 is a positive voltage regulator with three different terminals Adjust, Vout and Vin respectively. It can supply the output voltage in a range of 1.25-37V and a current more than 1.5A. It has advanced line regulation and load regulation standards as compared to the general regulators. It has a lot of applications in rela life e.g. motor controllers, power bank solutions, hydraulic valve, ethernet switch, battery chargers etc. Download LM317 Datasheet
1. LM317 Pinout
  • LM 317 has three (3) pins in total Adjust, Vout and Vin respectively.
  • Each of the pins has its own functions, all the pins along with their name and numbers are shown in table given below.
2. LM317 Pins Configuration
  • LM 317 pins configurations along with the properly labeled diagram is shown in the figure below.
  • The animated LM317, its symbolic representation and the image of the real LM317 all are shown in the above figure.
3. LM317 Working Principle
LM 317 works on a very simple principle. It is a variable voltage regulator i.e. supports different output voltage levels for a constant applied input voltage supply. A variable resistor is connected at its Adjustment (Adj) terminal in order to control the level of the output voltage according to the requirements of the circuit. In other words we can say that LM 317 can step down the voltage from 12V to several different lower levels.
4. LM317 Packages and Dimensions
  • A lot of LM 317 packages and their dimensions are provided along with their System International (SI) units in the table shown below.
  • Description of packages along with their dimensions is given in the table above.
5. LM317 Specifications
  • The different specifications associated with LM 317 are provided in the table given below.
6. LM317 Applications
LM 317 has a very wide range of application, a few of which are given below.
  • Washing machine.
  • Waveform generator.
  • Refrigerator.
  • Programmable Logic Controller (PLC).
  • Power quality meter.
  • Motor controllers.
  • Finger prints.
  • Ethernet switch.
  • Private branch exchange.
  • Constant current regulators.
  • Microprocessors supplies.
  • Automotive LED lightning.
  • Battery chargers, the proper design of the circuit is shown in the figure below.
7. LM317 Proteus Simulation
  • I have made a simulation in Proteus ISIS for voltage regulator.
  • The screenshot of the simulation is shown in the figure below.
  • The running form of the above simulation is shown in the figure below.
  • Input, output and variable resistor are encircled in the above figure.
  • Since its a variable voltage regulator so by changing the value of variable resistor you can obtained different voltage levels at the output.
  • In the above figure, for the resistance of 61% the output voltage is 7.88V.
  • Now, I am going to check the voltage level for the different value of variable resistor, which is 54% in this case.
  • The output of the simulation is shown in the figure below.
  • For the different value of variable resistor the output voltage has also changed from 7.88V to 8.27V.
  • That was the detailed description of the voltage regulator simulation.
  • You should also have a look at LM 317 Voltage Regulator in Proteus.
  • You should also read Introduction to 7805, which is also a voltage regulator and is used to convert 12V into 5V.
  • You can download this LM317 Proteus Simulation by clicking below button:

Download LM317 Datasheet

  • In the below video, I have shown you how to simulate LM317 in Proteus:
So, that is all from the tutorial Introduction to LM317.  I hope you all have enjoyed this exciting tutorial. If you face any sort of problem you can ask me in comments anytime you want without even feeling any kind of hesitation. I will try my level best to solve your issues in some better way if possible. Our team is here to entertain you 24/7. I will explore further IC's and transistors in my upcoming tutorials and will surely share all of them with all of you as well. So, till then, take care :)

Introduction to 74HC595

Hello everyone! I hope you will be absolutely fine and having fun. Today, I am going to explain all of you about Introduction to 74HC595. It is basically a shift register. It has an ability to store and to shift the data of 8 bits. First of all the data is written on the register serially and then it goes to the storage register. All of the output lines are controlled by this register. 74HC595 register is a very high speed device based on Complementary Metal Oxide Semiconductor (CMOS). 8 bit data register receives the data from the input DS. This data is then transferred from the input shift register to the output shift register. 74HC595 has a vey wide range of applications in daily life. It can be used as serial to parallel data converter, can receive and keeps the data for a long time etc. Moreover, It can be used in home appliances, for the industrial management, as computer peripheral. We will discuss further about this register later in this tutorial.

Introduction to 74HC595

74HC595 is a shift register having and eight bit storage register and an eight bit shift register. The data is written first and then stored into the device. It is high speed CMOS device. The data is usually entered in a serial format. Storage register is used to control the output lines of 74HC595. It has different real life applications e.g. in home appliances, computer peripherals, serial to parallel converter etc.
1. 74HC595 Pinout
  • It has 16 pins in total out which eight are on left side and the remaining on the right side of the structure.
  • The different function is associated with each of the pin.
  • Some of the pins acts as an input to this device and receives data serially and transfer to the output pins to observe the received data.
  • The pin diagram for 74HC595 is shown in the figure below:
  • DS pin acts and receives the serial data.
  • All of the lines with prefix acts as the output lines.
2. 74HC595 Pin Configuration
  • In this section if the tutorial Introduction to 74HC595, I will tell you about the functions associated with each of the individual pin of 74HC595.
  • All of the associated functions are describes in the table given below.
3. Functioning Diagarm
  • The proper functional diagram of the shift register 74HC595 is shown in the figure below.
  • From the above figure you can see that SHCP, master reset (MR) and the input DS are connected to 8 stage shift register.
  • Pin number 12 i.e. STCP is connected to 8 bit storage register.
  • The output enable (OE) is connected to 3 state outputs.
4. 74HC595 Functional Description
  •  In this section of the tutorial Introduction to 74HC595, I will tell you about the functions of each line of the 8 bit shift register 74HC595.
  • Complete description of the functions of 74HC595 is given in the table shown below.
5. 74HC595 Timing Diagram
  • The arrow in the upward direction shows the rising edge of the each wave either received or applied.
  • The shape of the signals applied and received and their relation with each other is shown in the figure below.
5. 74HC595 Logic Diagram
  • The logic diagram for 74HC595 8 bit shift register is shown in the figure below.
  • You can see that there are 8 different stages from 0 to 7 and latches are there in the logic diagram of 74HC595.
  • Output enable (OE) and master reset (MR) are connected to latches with an inverted sign usually known as bubble.
6. 74HC595 Current/Voltage Rating
  • The current, power and voltage rating along with their values and system international units are shown in the table given below.
  • The values of operating temperature and storage temperature are also shown in the figure below.
7. 74HC595 Proteus Simulation
  • I have a Proteus simulation for continuous control of the different LED's using 74HC595.
  • The screenshot of the simulation is shown in the figure below.
  • The complete Arduino source code is shown below.
  • You need to just upload .hex file of this code into the Arduino of Proteus and run the simulation.
int RCLK = 5;
int SER = 6;
int SRCLK = 7;

#define TotalIC 1
#define TotalICPins TotalIC * 8

boolean Data[TotalICPins];

void setup()
{
  pinMode(SER, OUTPUT);
  pinMode(RCLK, OUTPUT);
  pinMode(SRCLK, OUTPUT);

  ClearBuffer();
}              


void loop()
{
   for(int i = TotalICPins - 1; i >=  0; i--)
   {
      Data[i] = HIGH;
      UpdateData();
      delay(300);
      ClearBuffer();
   }

   for(int i = 1;i < TotalICPins - 1;  i++)
   {
      Data[i] = HIGH;
      UpdateData();
      delay(300);
      ClearBuffer();
   }
   
}
  • The running form of the above simulation is shown in the GIF below.
  • You can download the complete simulation as well as the complete Arduino source code, here by clicking on the button below.

Proteus Simulation & Arduino Code

  • Just download .rar file, extract it and enjoy the complete package having both Arduino source code as well as Proteus simulation.
So that is all from the tutorial Introduction to 74HC595. I hope you really enjoyed this tutorial. If you face any sort of problem regarding any thing, you can ask me anytime in comments without even feeling any kind of hesitation. I will try my level to entertain you and to solve your issues in a better way, if possible. Our entire team is 24/7 here to entertain you and to solve your issues in a way or the other. I will explore different IC's in my later tutorials and will surely share all them with all of as you as well. So, till then, Take Care :)

Introduction to 2N3904

Hello everyone! I hope you will be absolutely fine and having fun. Today, I am going to give an Introduction to 2N3904. It is basically an NPN transistor made up of silicon material. It acts as a general purpose amplifier and switch. You should also have a look at Introduction to 2N2222, which is also an NPN transistor and considered as 2N3904 equivalent. It is mostly used for lower power amplifiers and switching applications. Its major functional area is enclosed in TO-92 package. Its a silicon NPN general purpose bipolar junction (BJT) transistor designed for switching purpose as well as for an amplifier. Its can bear lower amount of current, lower power and medium voltage levels. It is most commonly used BJT due to its smaller size, wide availability and low cost. It is less sensitive to fluctuations in voltages and currents as compared to other BJT's.
Where To Buy?
No.ComponentsDistributorLink To Buy
12N3904AmazonBuy Now

Introduction to 2N3904

  • 2N3904 is a silicon NPN Bipolar Junction Transistor (BJT), enclosed in TO-92 package and is normally used for switching & amplification purposes.
  • 2N3904 Pinout consists of 3 Pins i.e. Base, Emitter & Collector.
  • As it's an NPN transistor, so major charge carriers are electrons caryying negative charge.
  • Small voltage at base(around 0.7V) changes its state from reverse to forward biased and starts conducting.
  • It has a wide range of applications i.e. used in televisions, home appliances, medium-load switches, PWM applications etc.
Now let's have a look at 2n3904 Pinout:

2N3904 Pinout

  • 2N3904 Pinout has three pins in total:
    1. Emitter denoted by E
    2. Base denoted by B.
    3. Collector denoted by C.
  • 2N3904 Pin Diagram is shown in below figure:
  • 2N3904 Pinouts alongwith their symbols are shown in the table given below.
Let's have a look at the Datasheet of 2N3904:

2N3904 Datasheet

  • In order to get in-depth knowledge on any component, must read its datasheet. Here's the link to download 2n3904 Datasheet:
Introduction to 2N3904 Let's have a look at the equivalents of 2N3904 NPN Transistor:

2N3904 Equivalent

Although common transistors such as 2N3904 are easily available in local/online electronics stores, but its wise to know the alternatives. So, 2N3904 equivalents are as follows:
  • BC636
  • 2N3055
  • 2N2222
  • BC549
  • BC639
  • 2SC5200
  • 2N2369
  • 2N3906
Now let's have a look at poewr ratings of 2N3904:

2N3904 Ratings

  • Transistors are available in different ranges of power ratings and their selection depends on circuit's requirements.
  • So, a circuit designer's task is to select an optimized transistor for its circuit, which should fullfill all its power equirements & must be cost efficient.
  • If current/voltage passing through a transistor exceeds its ratings, the transistor may burnt out.
  • Below table shows 2N3904 Ratings:
2N3904 Ratings
No. Parameter Name Parameter Value
1 C-E Voltage (VCEO) 40V (DC)
2 C-B Voltage (VCBO) 60V (DC)
3 E-B Voltage (VEBO) 6V  (DC)
4 Collector Current (IC) 200mA
Now, let's have a look at few applications of 2N3904:

2N3904 Applications

2N3904 is one of the most commonly used NPN transistor because of its low-cost, high-speed and small-size. Few of 2N3904 applications are as follows:
  • It's normally used as a simple switch to control heavy loads, because of its low saturation voltage and high gain.
  • It's used in home appliances i.e. TV, LCDs, stereo systems etc.
  • It's also used in fast switching applications i.e. pulse width modulation(pwm), because of its fast switching speed.
  • 2N3904 is also in signal amplification projects(i.e. sound amplifiers) as it has high current gain & thus can be used as an amplifier.

2N3904 Transistor as a switch

  • In normal state, 2N3904 acts as reverse biased and there's no conduction between Collector & Emitter.
  • When small voltage applies at its Base Terminal(normally 5V), 2N3904 converts its state from reverse to forward biased and conventional current starts flowing from Collector to Emitter.
Now, let's design a simulation to practically understand, how 2N3904 transistor acts as a switch?

2N3904 Proteus Simulation

  • Let's first control a simple LED on/off state using 2N3904 NPN transistor
  • As shown in below figure, power is supplied at Collector and LED is connected at the Emitter with resistor(to limit current) & grounded from the other end.
  • As there's no voltage applied at Base Terminal, so 2N3904 is reverse biased and thus LED is OFF.
  • Now when we have applied 5V at Base Terminal(using LogicState in Proteus), 2N3904 gets forward biased and now LED is ON, as shown in below figure:
  • So, that's how we can use 2N3904 transistor as a switch.
In above simulation, we have controlled a simple LED and have used a manual switch. Now, I am going to control a DC motor with Arduino.

2N3904 Arduino Interfacing in Proteus

  • I have made another simulation in Proteus ISIS for DC motor control using 2N3904.
  • The screenshot of the simulation is shown in the figure below.
  • The complete Arduino source code of the above simulation is given below.
  • You have to get the hex file in Arduino to observe the results properly.
int MotorInput = 2;
int MotorOutput = 7;

void setup() 
{
    pinMode(MotorInput, INPUT_PULLUP);
    pinMode(MotorOutput , OUTPUT);
}

void loop() 
{
    if(digitalRead(MotorInput) == HIGH)
    {
      digitalWrite(MotorOutput, HIGH);
    }
    if(digitalRead(MotorInput) == LOW)
    {
      digitalWrite(MotorOutput, LOW);
    }
  
}
  • The running form of the above simulation is shown in the below figure:
  • From the above figure you can see that after uploading .hex file and running the simulation you need to change the level of logic state from 0 to 1, and the motor will start to rotate.
  • You can download the complete Proteus ISIS simulation as well as complete Arduino source code, here by clicking on the button below.
  • Just download .rar file, extract it and enjoy the complete package.
Introduction to 2N3904
  • You should watch this below video to understand how to run this Proteus Simulation:
So that is all from the tutorial Introduction to 2N3904. I hope you really enjoyed this tutorial. If you face any sort of problem regarding any thing, you can ask me anytime in comments without even feeling any kind of hesitation. I will try my level to entertain you and to solve your issues in a better way, if possible. Our entire team is 24/7 here to entertain you and to solve your issues in a way or the other. I will explore different IC's in my later tutorials and will surely share all them with all of as you as well. So, till then, Take Care :)

Introduction to 1N4148

Hello everyone! I hope you will be absolutely fine and having fun. Today, I am going to give an Introduction to 1N4148. It is basically a diode used for fast switching purposes. Switching diodes are usually single P-N diodes and their functionality is similar to that of normal switch. Below a specific voltage, switching diodes i.e. 1N4148 has high resistance. Whereas as above that specific voltage they show a low resistance. It is a most commonly used diode due to its smaller size, easy availability and low cost. Good switching diode can be chosen by its maximum reverse recovery time and its power dissipation ranging from 80mW to 1kW. Switching diodes such as 1N4148, 1N4007 etc. have very wide range of applications specially in Embedded Systems for switching purposes. It is mostly used in switches having extremely fast operation. It can be used for high speed rectification, general purpose switching and fast switching are also included in its applications, protection of telecommunication industries and homes etc.

Introduction to 1N4148

1N4148 is a standard diode made up of silicon and is used for extremely fast switching operations. It has two modes of operation named as:
  1. Forward Biased
  2. Reverse Baised
In Forward Biased operational mode, it allows the current to pass though it and it acts as a closed switch, while in Reverse Biased operational mode it acts as an open switch and doesn't allow the current to pass through it. I have explained it in below figure: I have designed the above simulation in Proteus and you can see in the above image.
  • In forward biased state, diode IN4148 is acting as a closed switch and allowing the current to pass through it, that's why our LED is ON.
  • In Reversed Biased state, diode IN4148 is acting as an open switch and there's no current flowing through it, that's why our LED is OFF.
  • In the below figure, I have shown the equivalent circuit of both of these diode states:
1. 1N4148 Mechanical Design Parameters
  • The different parameters for mechanical design of this diode are shown in the table given below.
  • These are few of the parameters for mechanical designing of the zener diode 1N4148.
  • Some of the other mechanical parameters are also shown in the table given below.
  • The parameters given in the table above can be verified from the figure shown below,
  • From the figure shown above, we can see that the diode has four major sides which are A, B, C and D respectively.
  • Each of the side has its own different dimension as given in the table shown above.
  • So, that was the brief discussion about the mechanical design parameters for this diode.
2. 1N4148 Pinout
  • 1N4148 has only a single input terminal and a single output terminal.
  • Input terminal is known as anode and output terminal is known as cathode.
  • Anode is indicated by the positive (?ve) charge whereas the cathode is indicated by negative (?ve) charge.
  • Pins and their charges are shown in the table given below.
3. 1N4148 Pins Diagram
  • Pins diagram for this diode is shown in the figure below,
  • This is the properly labeled diagram of 1N4148 showing anode on one side as and cathode on the other side as B.
4. 1N4148 Power Ratings
  • The current, voltage and power rating for the diode 1N4148 are provided in the table shown below.
  • The table above displays the ratings of the particular diode along with their symbols and values.
5. 1N4148 Applications
The switching diode i.e. 1N4148 has a wide range of applications, a few pf which are given below:
  • Extremely fat switching purposes.
  • High speed rectification.
  • General purpose switching.
  • Protection circuits in telecommunication industries, offices, homes etc.
  • These were few of the applications associated with this switching diode.
So that is all from the tutorial Introduction to 1N4148. I hope you really enjoyed this tutorial. If you face any sort of problem regarding any thing, you can ask me anytime in comments without even feeling any kind of hesitation. I will try my level to entertain you and to solve your issues in a better way, if possible. Our entire team is 24/7 here to entertain you and to solve your issues in a way or the other. I will explore different IC's in my later tutorials and will surely share all them with all of as you as well. So, till then, Take Care :)

Introduction to 2N2222

Hello everyone! I hope you will be absolutely fine and having fun. Today, I am going to give you an Introduction to 2N2222. It is the most commonly used Negative-Positive-Negative (NPN) Bipolar Junction Transistor (BJT) available in the market now a days. 2N2222 can be used for different purposes e.g. switching and amplification of analog signals. I hope you have enjoyed the previous post on Introduction to ULN2003. The major functional area of 2N2222 is enclosed in TO-18 package. Due to the low cost and small size it is the most commonly used transistor. One of its key features is its ability to handle the high values of currents as compared to the other similar small transistors. Normally it is capable of switching a load current of 800mA which is really high rating as compared to other similar transistors. It is either made up of silicon or germanium material and doped with either positively or negatively charged material. Its applications may include amplification of analog signals as well as switching applications. While performing amplification applications, it receives an analog signal via collectors and another signal is applied at its base. Analog signal could be the voice signal having the analog frequency of almost 4kHz (human voice).

Introduction to 2N2222

2N2222 is the most common NPN bipolar junction transistor available in the market. It can be used for amplification of analog signals as well as switching applications. The major functional area of 2N-2222 is enclosed in TO-18 package. It is most common in the market due to the cost efficiency and the smaller size.
  • It is shown in the figure shown below.
1. 2N2222 Pinout
  • 2N 2222 has 3 pins in total, which are:
    1. Pin # 1: Emitter.
    2. Pin # 2: Base.
    3. Pin # 3: Collector.
  • 2N2222 Pinout is shown in the figure below:
2. 2N2222 Pin Description
  • The functions associated with each pin of 2N2222 along with the pin names are shown in the table given below.
  • That was the description of the pins of the transistor.
  • Pin configuration is shown in the figure below.
 
3. 2N2222 Voltage/Current Ratings
  • The current, power and voltage ratings for 2N 2222 transistor are shown in the table given below.
  • From the above table you can see the voltage across collector base junction is almost double as compared to the voltage across collector emitter junction.
  • emitter base voltage is 12 times lesser than the voltage across the collector emitter junction.
  • It can drive high amount of current loads as compared to the other similar transistors i.e. 800mA.
  • This IC should be operated between the temperature ranging from -65 to 200 degree celcius.
  • That was the brief description of the power, current and voltage ratings of the IC 2N2222.
4. 2N2222 Characteristics
The key characteristics associated with 2N2222 are given below.
  • The total power of this component should not exceed by 500mW.
  • The maximum capacity of handling frequency is 250MHz.
  • For the collector current of 10mA and for 10 volts the DC current is around 75.
  • Maximum tolerance of 2N2222 is 60V across its base and collector.
  • Some of the other characteristics are shown in the table given below.
  • That was the brief description about the key characteristics of the transistor 2N2222.
5. 2N2222 Simulation in Proteus
  • I have also made a two different simple simulation in Proteus ISIS using the transistor 2N2222.
  • The Proteus ISIS simulation for controlling an LED using 2N2222 is shown in the figure given below.
  • If you change the state of the logic state from to 1, current will be supplied to the collector and hence an LED attached to its emitter will be turned on.
  • The running form of the above simulation is shown in the figure below.
  • I have made another simulation in Proteus ISIS to control a simple DC motor using Arduino UNO.
  • The simulation of the task is shown in the figure below.
  • Source code for the above simulation is given below.
int MotorInput = 2;
int MotorOutput = 7;

void setup()
{
  pinMode(MotorInput, INPUT_PULLUP);
  pinMode(MotorOutput , OUTPUT);
}

void loop()
{
  if (digitalRead(MotorInput) == HIGH)
  {
    digitalWrite(MotorOutput, HIGH);
  }
  if (digitalRead(MotorInput) == LOW)
  {
    digitalWrite(MotorOutput, LOW);
  }

}
  • You have to just copy and paste the entire code into the Arduino software.
  • Obtain its .hex file and insert it into the Arduino of the Proteus ISIS.
  • The running form of the above simulation is shown in the figure below:
  • You can download the complete Arduino source code and simulation in one package, here by clicking on the button shown below.

Proteus Simulation & Arduino Code

So that is all from the tutorial Introduction to 2N2222. I hope you enjoyed this tutorial. If you face any sort of problem regarding any thing, you can ask me anytime in comments without even feeling any kind of hesitation. I will try my level to entertain you and to solve your issues in a better way, if possible. Our entire team is 24/7 here to entertain you and to solve your issues in a way or the other. I will explore different IC's in my later tutorials and will surely share all them with all of as you as well. So, till then, Take Care :)

Introduction to ULN2003

Hello everyone! I hope you will be absolutely fine and having fun. Today, I am going to give you a detailed Introduction to ULN2003. We will also discuss the ULN2003 Datasheet, Pinout, Circuit Diagram & Proteus Simulation. If you have ever controlled any motor (i.e. DC Motor, Stepper Motor etc.) with a microcontroller (i.e. PIC, Arduino etc.), then you must have heard about drivers. Why do we need to use drivers? We use drivers (to control motors) because of two reasons.

  • First: Microcontrollers operate at 5V while motors operate at different voltages (5V, 12V, 24V etc.).
  • Second: Motors are Inductive loads thus they produce back emf, which may damage your microcontroller permanently (if not handled correctly).

Because of these two reasons, we have to use the driver in between the microcontroller & motor. There are different types of motor drivers available and ULN2003 is one of them. If we check its datasheet, then we can see that ULN2003 can handle up to 50V & 500mA. As its current rating is not that high, so it's used to control small motors. For heavy motors, we normally use relays in between ULN2003 & motor. In this case, the Microcontroller is sending a signal to ULN2003, which then forwards it to relays (connected at output). Remember, the relay is also an inductive load. So, we can control different types of loads with ULN2003 i.e. motor, relay, solenoid, actuator etc. You should also have a look at Relay Interfacing with Microcontroller using ULN2003A.

Now, let's have a look at what's inside ULN2003 in detail:

Where To Buy?
No.ComponentsDistributorLink To Buy
1ULN2003AmazonBuy Now

ULN2003: Definition

  • ULN2003 is a 16 Pin IC, consisting of 7 Darlington pairs (each pair protected with suppression diode) and thus has the capability to handle a maximum of 7 loads(could be inductive).
  • In simple words, we have 7 drivers in a single ULN2003 chip and thus can control a maximum of 7 loads.
  • Each Darlington pair can handle a maximum 500mA load, while the peak value is 600mA.
  • Similarly, the maximum output voltage of each Darlington pair is 50V.
  • In the below figure, you can see ULN2003 has 16 Pins, where inputs and their respective outputs are placed in front of each other(for ease of circuit designing).
  • Other than I/O Pins, we have Ground Pin where we need to provide 0V & Vcc (Common) Pin.

ULN2003 Datasheet

  • Here's the link to download ULN2003 datasheet, must read it once.
  • I have also given the link to a reliable source, from where you can buy ULN2003 IC.
Download ULN2003 Datasheet

ULN2003 Pinout

  • ULN2003 has 16 pins in total:
    • 7 Input pins (Pin # 1 to Pin # 7)
    • 7 Output pins (Pin # 10 to Pin # 16)
    • 1 Ground pin (Pin # 8)
    • 1 COM pin (Pin # 9)
  • ULN2003 Pinout is shown in the below figure:

ULN2003 Pin Description

  • The functions associated with each pin of ULN2003 along with pin names are shown in the table given below.

ULN2003 Darlington Pair

  • ULN2003 consists of 7 identical Darlington pairs.
  • A single Darlington pair consists of two bipolar transistors its maximum operating values are 50V & 500mA (peak 600mA).
  • These two transistors of the Darlington pair have a common emitter, while their collectors are open.
  • Here's the circuit diagram of a single Darlington pair, shown in the below figure:

ULN2003A Free-Wheeling Diodes

  • ULN2003A has free-wheeling diodes, which protect from back emf.
  • So, if we are using an inductive load (i.e. relays), then we don't need to add extra diodes if we are controlling it with ULN2003A.
  • Logic Diagram of ULN2003A is shown in the below figure:

ULN2003 Features

There are a lot of key features associated with the relay driver ULN2003. A few of them are given below:

  • 500mA of the rated collector.
  • The high output voltage of around 50V.
  • Relay driver applications.
  • Output clamp diodes.
  • Compatible input with popular logic types.
  • Some of the key features are also given in the table below for a better understanding of the working conditions of ULN2003.

ULN2003 Applications

The relay circuit driver ULN2003 has a wide range of applications in real life. Some of the major applications associated with ULN2003A are given below.

  • Logic buffers.
  • Line drivers.
  • Relay drivers (for driving different loads).
  • Lamp drivers.
  • LED display drivers (display devices).
  • Motor (stepper and DC brushed motor) drivers.

ULN2003 Proteus Simulation

  • I have designed a simulation in Proteus ISIS for LED control using ULN2003.
  • The screenshot of the simulation is shown in the figure below.
  • As you can see in the above figure that I have connected Logic State at all inputs of ULN2003A and have connected Leds at outputs.
  • So, now when I make the Logic State HIGH then the respective LED will also go ON.
  • The running form of the above simulation is shown in the figure below.
  • If you change the state of the logic state from 0 to 1, the corresponding LED will be turned ON as shown in the above figure.
  • You can download the Proteus simulation here by clicking on the button below.
  • Just download the .rar file, extract it and enjoy the simulation.

ULN2003 Simulation in Proteus

  • Here's the video in which I have shown how to use ULN2003A in Proteus:

So that is all from the tutorial Introduction to ULN2003. I hope you enjoyed this tutorial. If you face any sort of problem regarding anything, you can ask me anytime in the comments without even feeling any kind of hesitation. I will try my level to entertain you and to solve your issues in a better way, if possible. Our entire team is 24/7 here to entertain you and to solve your issues in one way or the other. I will explore different ICs in my later tutorials and will surely share them with all of you as well. So, till then, Take Care :)

MATLAB Image Processing

Hello everyone! I hope you all will be absolutely fine and having fun. Today, I am going combine all of my previously published tutorials based on MATLAB Image Processing. Image processing can be defined as to convert an image into digital form and to perform some actions on it to improve its quality. I have published a number of tutorials on MATLAB image processing but they are not well arranged. So, I am going to combine the links for all of them in order to access them easily. All of the projects that I am going to combine today, are designed and compiled by our team with a lot of hard work. A number of MATLAB Image Processing based tutorials are compiled into this single tutorial. These are divided into two different categories i.e free and payable. Some of them are totally free and their source code are easily available to download. Some are not free but we have imposed a low cost on it and the students can easily purchase them even with their pocket money as well. Image processing is an amazing technique now a days and is difficult to do that is why we have imposed a bit cost on some of the major projects. The detailed description of each of the single project based on MATLAB image processing will be given later in this tutorial.

MATLAB Image Processing

Here in the tutorial MATLAB Image Processing, the combined list of all the previously published tutorials will be given in detail along with their accessible links. First of all I would like to explain you a bit about image processing technique.
  • To convert an image into the digitized form and perform some kind of actions on it specially to improve its quality is basically known as image processing technique.
  • The images below display the conversion of an image into digitized form to improve their quality.
  • The image on which I am going to perform some of the actions for its quality improvement is shown in the figure below.
  • Now I am going to perform some of the major actions on it to improve its quality.
  • The figure shown below displays the tasks performed on the above image.
  • So that was a bit about image processing technique.
  • Now, I am going to combine all of my previous tutorials based on MATLAB image processing.

1) Color Detection in Images using MATLAB

This tutorial is about the detection of a specific color among different colors on an image using an amazing tool i.e MATLAB. Color detection becomes necessary sometimes. Like there different cars with same external structure and same specifications but they have different colors. We have to select a red colored car using computerized automated system, to wash it. Here we need to apply an image processing technique to detect the red color among all of the different colors present at a time. In this tutorial I have take an image having red, green and blue colors in it. I have individually detected each of the colors from this image using MATLAB image processing technique.
  • You download the complete simulation here by clicking on the button below.

Download Color Detection in MATLAB using Image Processing

2) Detect Circles in Images using MATLAB

In this tutorial I have explained the methods for the detection of the circles in MATLAB. Its a quite simple technique. The first thing is to choose an image on which the circles are to be detected. Then the second step is the detection of the circles on the selected image. I have used an image of bicycle having two circles i.e. its wheels as shown in the figure on right side. You can see there are two circles in the image. MATLAB finds the circles first and then shows them to us by detecting them. For this figure MATLAB has found both of the wheels and shown us the detected wheels as white and red dotted line on inner surface of both of the wheels of bicycle.
  • You download the complete MATLAB simulation here by clicking on the button below.

Download Detect Circles in Images using MATLAB

3) Image Zooming with Bilinear Interpolation

In this tutorial I have elaborated the technique for the image zooming with bilinear interpolation in MATLAB. Different software e.g. paint and adobe photoshop provides us with the option of zooming the image bu just clicking on the button. In this tutorial I have performed the operation of image zooming in MATLAB using bilinear interpolation. In MATLAB, zooming of an image means that we are increasing the pixels of that image. In order to do so we must have to fill the extra pixels with color of the neighbor pixels. To fill out the extra pixels with some color is usually known as the interpolation. There are a lot of interpolation techniques. I have used a type of linear interpolation named as bilinear interpolation which includes the implementation of interpolation formula on both x and y axis. You can see the further details i.e. interpolation formula and its implementation, for this project by clicking on the button below.
  • You can download the complete MATLAB simulation for image zooming with bilinear interpolation, just here by clicking on the button below.

Download Image Zooming with Bilinear Interpolation

4) Color Detection in MATLAB Live Video

In this tutorial I have made an algorithm for color detection in MATLAB live video. I have taken a live video from my laptop's camera and then I have detected the specific color from the live video. In order to do this task, you must have to install image processing toolbox in your MATLAB. I have detected a red color in this tutorial. You can detect any color you want. You have to made a very small change in the code in order to do so. For this tutorial, you can place anything having red color in it, in front of the camera. Algorithm will detect and encircle the red color in that image. The algorithm in working condition is also shown in the figure on right side.
  • You can download the complete MATLAB simulation for color detection in MATLAB live video, here by just clicking on the button below.

Download Color Detection in MATLAB Live Video

5) Motion Detection in MATLAB

In this tutorial, I have made an algorithm for the detection of the motion in MATLAB. This project can be used as the security purposes. For hardware purpose IR sensor is used to detect the motion in the surroundings. I have used MATLAB software for the motion detection in the real environment instead. I have used a webcam and then applied a simple algorithm in order to detect the motion in the surroundings. I have made GUI having different sections on it. on the first axis the image is to be captured and then you need to press Start Comparison button to visualize the change in surroundings. If any change is occurred in the environment or not, corresponding text will be displayed on the GUI at the bottom right corner of the GUI.
  • You can download the complete MATLAB simulation for Motion Detection in MATLAB, here by just clicking on the button below.

Download Motion Detection in MATLAB

6) Eye Ball Detection in MATLAB

In this project I have designed an algorithm for Eye Ball Detection in MATLAB. I have designed a Graphical User Interface (GUI) to detect the eye balls from the images loaded into the GUI. Our team has worked very hard to design this algorithm. So, I have not share the simulation for this task for free. I have imposed a small amount of cost on it. You can easily buy this project by clicking on the button below. The algorithm is designed in MATLAB 2015 version. So, you must have MATLAB 2015 or its later version because it is not backward compatible. As you run the simulation a GUI will be opened on your screen. You just need to browse the image in which eye balls are needed to be detected. Then press the Load button, you will see that eye balls has been detected successfully as shown in the figure on right side.
  • You can download the complete MATLAB simulation for Eye Ball Detection in MATLAB, here by just clicking on the button below.

Buy Eye Ball Detection in MATLAB

So, that is all from the tutorial MATLAB Image Processing. I hope you all enjoyed this tutorial.If you face any sort of problem, you can ask me freely anytime in comments without even feeling any kind of hesitation. I will try my level best to entertain you and to sort out your issues in some better way, if possible. I will explore this technique further in MATLAB and on the other software as well in my later tutorials. So, till then, Take Care :)

How to use Print MATLAB

Hello everyone! I hope you all will be absolutely fine and having fun. Today, I am going to share my knowledge about How to use Print MATLAB. As you all know that the design of an algorithm is not enough until we observe its results too. So, there should be a debugging tool in order to check the performance and accuracy of the designed algorithm. Debugging tool helps us to improve the algorithm’s performance and accuracy too by observing its output again and again. In this tutorial I will tell you about using print command in MATLB for different purposes. So, in this tutorial I am going to use print command as a debugging tool in order to observe the output of the algorithm. You should also have a look at how to use MATLAB ? I am going to use print command to either print the desired statement on the command window in MATLAB or to display the graphs on a figure and to automatically save it on any destination wherever you want to. I will elaborate this command with the help of the different examples later in this tutorial. if you new to MATLAB then you should read Introduction to MATLAB. So, now let's have a look at How to use Print MATLAB:

How to use Print MATLAB

In the tutorial How to use Print MATLAB, I will tell you about the use of this command in MATLAB while explaining a lot of examples and by displaying their results. The examples include the printing of the statement on the command window in MATLAB as well as to display the graphs and to save its image.
  • Here, I am going to print some statement (the name of our website) on the command window using this particular command in m.file.
  • The use of the command fprintf is shown below.
clc % clears the command window
fprintf('www.TheEngineeringProjects.com\n')% prints the desired statement
  • Editor also displays that command in the figure shown below.
  • You can observe the result of this statement on the command window in MATLAB.
  • The result displayed on the command window is shown in the figure below.
  • So, that was about how to print the statement on the command window.
  • Now, I am going to print the result of some mathematical operations applied on some variables, on command window using the same command.
  • I have assigned different values to the two variables a and
  • I have calculated their sum and displayed on the command window.
  • The commands written on the editor are shown in the figure below.
  • The result of the above commands displayed on the command window is shown in the figure below.
  • So, that was the description of how to print the results mathematical operations applied on some variables on command window.
  • Now, I am going to perform some operations on matrix.
  • The source code written in editor of the MATLAB is shown below.
  • I have initialized a matrix named as
  • I have then displayed that matrix on the command window.
  • At the end, I have printed all the values of that matrix on the command window.
  • The result of all the above commands displayed on the command window is shown in the figure below.
  • First row in the above figure displays the matrix.
  • And the second row prints each value of the matrix in next ling using \n.
Graphics Format File
  • You need to specify file name and format switch to save your figure as graphics.
  • The supported output formats for exporting from MATLAB and switch settings are shown in the table given below.
Print Paper Copy of Figure
In this method a new bar chart will be created and printed to your system default computer. If you do not specify the figure to be printed, then print will use the current figure.
  • The source code written on the editor is shown below.
clc
bar(1:10);
print 
  • The editor window with the code is also shown in the figure below.
  • The figure generated from the above code is shown below.
  • That was the detailed discussion about using print command as a debugging tool in MATLAB.
So, that is all from the tutorial How to use Print MATLAB. I hope you enjoyed this tutorial. If you face any sort of problems regarding anything, you can ask me freely in comments every time, without even feeling any kind of hesitation. I will try my level best to solve your issues in a better way, if possible. There's another interesting MATLAB Projects named as Eye Ball Detection in MATLAB. I will explore different software including MATLAB in my next tutorials and will share all of them with you guys as well. So, till then, take care :)

Multi Color Detection in MATLAB

Hello everyone! I hope you all will be absolutely fine and having fun. Today, I am going to share my knowledge about Multi Color Detection in MATLAB. Color Detection scheme plays a vital role at some places. Like in Image processing technique the detection of specific color among the different colors is necessary to perform some action on it. For example there are three cars of the colors red, blue and green and we want to wash the red car. You should also have a look at Color Detection in Images using MATLAB because I am gonna use the same code and will add some improvements in it. Moreover, if you are working on Live Videos instead of Images then you should have a look at Color Detection in Live Video using MATLAB. For this purpose we need to design an algorithm which is capable of detecting red color among the different colors. Similarly there are a lot of other examples are there to perform the tasks like that. This tutorial will elaborate the step by step explanation of the algorithm designed for multi color detection in MATLAB using Graphical User Interface (GUI). The tutorial consists of two different parts. In first part the GUI will be created while the second part will consist of an algorithm to detect a particular color among the different colors. Further details about the designed algorithm is elaborated in the section below.

Multi Color Detection in MATLAB

Here, in the tutorial Multi Color Detection in MATLAB, I will explain the step by step description about designing an algorithm for multi color detection in MATLAB GUI. The total project is divide into two parts, GUI will be created in the first part and algorithm designing will be explained in the second part.
  • You can download the complete MATLAB GUI simulation here by clicking on the button below.
  • Download .rar. file, extract it and enjoy the complete package :)

Download MATLAB Simulation

GUI Design for Multi Color Detection in MATLAB
This section of the tutorial Multi Color Detection in MATLAB will elaborate you all of the steps involved during the design of Graphical User Interface (GUI).All of the steps are given below.
  • GUI design consists of several different steps which are explained below.
  • GUI consists of the two different panel.
  • The left panel is for browsing or loading an image from the laptop or computer.
  • Left panel has a button to browse an image, an axis to visualize the loaded image and edit box to view the image's complete path.
  • The right panel is designed for color detection for the browsed image.
  • Right panel has three different buttons in order to detect red, green and blue colors and an axis to display the detected color on the image loaded in the left panel.
  • So that was the detailed description of the GUI, designed for multi color detection in MATLAB.
  • Initially designed GUI without panels is shown in the figure below.
  • The updated GUI with both the panels with proper tags is shown in the figure below.
Other Image Processing Projects:
Algorithm Design for Multi Color Detection in MATLAB
In this section of the tutorial Multi Color Detection in MATLAB, I will explain you about the design of an algorithm for detecting multi colors from the image loaded into GUI. The algorithm is further divided into two different parts. In the first part image is loaded into the GUI for the detection of multi color. Whereas, the second step consists of the detection of multi colors and its display on the GUI.
  • Go to the call back back function of Browse button and just copy paste here, the MATLAB code given below.
global ImageFile
[filename pathname] = uigetfile({'*.jpg';'*.bmp'},'File Selector');
    ImageFile = strcat(pathname, filename);

axes(handles.axes1);
imshow(ImageFile) % displays the image on particular axis
set(handles.edit1,'string',ImageFile); %sets the text of the edit box on GUI
  • I have first write a line to load the image from its path into the GUI.
  • After loading the images I have adjusted an axis on which the image is to be displayed.
  • At the end I have set the text of the edit box as the address of the image.
  • So that the was the logic to load an image into GUI of MATLAB.
global ImageFile
ImageFile
data = imread(ImageFile);

    diff_im = imsubtract(data(:,:,1), rgb2gray(data)); % subtracts the red color from the image
    %Use a median filte tFileo filter out noise
    diff_im = medfilt2(diff_im, [3 3]);
    diff_im = im2bw(diff_im,0.18);
    
    diff_im = bwareaopen(diff_im,300);
    
    bw = bwlabel(diff_im, 8);
    
    stats = regionprops(bw, 'BoundingBox', 'Centroid');
    
    % Display the image
    axes(handles.axes2); % axis adjustment
    imshow(data) % displays the image with the detected colors
    
    hold on
 
    for object = 1:length(stats)
        bb = stats(object).BoundingBox;
        bc = stats(object).Centroid;
        rectangle('Position',bb,'EdgeColor','r','LineWidth',2)
        plot(bc(1),bc(2), '-m+')
        a=text(bc(1)+15,bc(2), strcat('X: ', num2str(round(bc(1))), ' Y: ', num2str(round(bc(2)))));
        set(a, 'FontName', 'Arial', 'FontWeight', 'bold', 'FontSize', 12, 'Color', 'blue');
    end
    
    hold off
  • The main part of this code is to subtract the red color from the loaded image and to display it on the axis.
  • I have made rectangular areas around the detected colors at the end.
  • So that was the description of the algorithm to detect the red colors from the loaded image.
  • The final Updated GUI is shown in the figure below.
  • The image is to be loaded in the left panel of the updated GUI.
  • Loaded image in to the GUI is shown in the figure below.
  • Color will be detected in the right panel.
  • Red color detected from the loaded image is shown in the figure below.
  • Green color detected from the loaded image is shown in the figure below.
  • Blue color detected from the loaded image is shown in the figure below.
So that is all from the tutorial Multi Color Detection in MATLAB. I hope you enjoyed this tutorial. If you face any sort of problems, you can freely ask me in comments any time without even feeling any kind of hesitation. Our team will try our level best to entertain you and to solve your issues in some better way, if possible. I will explore MATLAB as well as other software in my later tutorials and will surely share all of them with you guys as well. So, till then, Take Care :)

How to Prepare Screenshots For Your Posts

Hello everyone, I hope you all are doing great and having fun with your lives. Today, I am going to share a really cool tool with you guys and we will have a look at How to Prepare Screenshots For Your Posts with that tool, and it helped me a lot in my own blog posts and I am sharing it because engineers need to design their images for presentations, report etc. So, must have these tools with you so that you can make your tasks relatively easy. Moreover, if you are a blogger then it also comes in handy. Accompanying your posts with screenshots can help to provide context, clarification or even just improve the aesthetics of the post. While it is easy enough to capture screenshots, before you include any in your posts it would be a good idea to prepare them beforehand. In order to prepare your screenshots, you should use a photo editor such as Movavi Photo Editor. It will allow you to tweak your photos in several ways, and prepare them by:

How to Prepare Screenshots For Your Posts

So, let's have a look at these steps one by one using which you prepare Screenshots for your Posts:
  • Cropping and altering the frame
Sometimes you will want to crop your screenshots to alter the area of your screen that is displayed and how the elements are being framed. With Movavi Photo Editor you can easily crop out any parts of your screenshots, and also rotate, flip, or level them if need be.
  • Improving the image quality
Generally, you shouldn’t have any problem with the quality of your screenshots, but if you do it helps to be able to improve it. Within Movavi Photo Editor you can choose to either adjust the color settings manually or use the automated features to do so.
  • Removing unwanted elements
If there are any unwanted elements in your screenshot, you should remove them to make the screenshot less cluttered and emphasize the main elements more. That can be done easily with Movavi Photo Editor, and you can even replace the entire background if need be.
  • Resizing screenshots to fit your posts
The size of your screenshots matters quite a bit, both because they will determine the file size of the image and as they should fit within a particular area in your post. Using Movavi Photo Editor you can quickly alter the size of your photo according to your needs, and may even want to come up with several different sizes if your website is responsive.
  • Adding captions or titles
Including captions or titles in the screenshots that you publish can help to add information directly to them. Whether add text to photo to label elements, provide context, or even just explain the screenshot is up to you and Movavi Photo Editor will let you customize the text and make it look unique. Here's an example: Make no mistake that is by no means all that Movavi Photo Editor is capable of, and if you explore its features further you’ll find that you’re able to apply artistic filters, utilize digital makeup, fix blurry images, and much more. All in all, however, you should now know what you need to do to prepare your screenshots for a post and because of how easy Movavi Photo Editor is to use, you should have no problem getting started and applying its features to the task at hand.
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