What is Transistor and how to use in switching circuits

What is Transistor and how to use in switching circuits

Transistor is perhaps the most important of electronic components because of which all modern electronics works. Therefore It becomes not only important but also mandatory to know what is transistor and how transistor works. A transistor is a semiconductor device commonly used to amplify or switch electronic signals. It’s a Device with three terminals where one terminal can be use to control the flow of current through the other two terminals. The three terminals are Emitter, Base and Collector. Its major use is as amplifier to boost various signals as well as to perform automatic switching.

3 Major applications of transistors are

  1. As a switch
  2. As Amplifier
  3. As oscillator

In this tutorial, we’ll see how to use transistor as switch

There are 2 types of bipolar transistors which we primarily use, in general applications.


what is transistor

what is NPN transistor


When base of n-p-n is connected with logic high voltage (positive voltage) then it short circuits emitter and collector (SWITCH ON). When base of n-p-n is connected with logic low voltage (Ground of Supply) then it open circuits both emitter and collector (SWITCH OFF).

what is transistor

NPN Transistor as switch ( Collector to GND, load connected across Voltage and Collector Terminal)
and base is to be given with a current limited +5v signal to turn on the device

when Base is connected to 0 or GND, the device turns off


what is transistor

what is PNP transistor

When base of p-n-p is connected with logic high voltage then it opens circuit’s emitter and collector (SWITCH OFF). When base of p-n-p is connected with logic low voltage then it short circuits both emitter and collector (SWITCH ON).

Another point you should keep in mind is that the arrow always points in the direction of positive charge flow, or from the P to N sections, no matter whether the P section is the emitter or base.

Notation aside, the three pins – base, emitter, collector – are typically labeled on the data sheet for a transistor

NPN Transistor as a Switch

As said, the biggest application of transistor is to use it as a switch. We’ll see how we can use the NPN transistor as switch

  • Device power to whatever power source I want to use
  • Device ground to the collector on my NPN transistor
  • Transistor emitter to “real” ground.

Connection for PNP transistor

what is transistor

PNP transistor as switch


Example of Transistor with Buzzer

When interfacing buzzer with micro controller, we often need a large buzzer to generate tones. In such cases, the buzzer can not be directly interfaced to arduino pins. Some buzzer’s will generate loud sounds with 12v or higher voltage. To interface such buzzer with arduino or raspberry pi, we use transistor a switch to interface buzzer with microcontroller. Below is the circuit of how to use transistoized buzzer with controllers.

what is transistor

transistor and buzzer


Commonly used Transistors and their pin identifications

BC548/BC547 :– NPN

BC557 :– PNP

2N3904 :– NPN 

SL100:– NPN

This tutorial is for those who are doing embedded applications and want to study how to interface high power DC devices with controller or raspberry pi.
Remember, the current rating of transistor is also to be taken into consideration while designing your circuit. If your load takes about 2 ampere of current, then don’t choose BC547, simply see of an NPN transistor which has collector current rating above 2 ampere and so on.

Lastly not to mention, transistors can only be used to SWITCH DC loads

For anything that involves AC load, transistors shouldn’t be used directly to switch on AC appliances. For simple reason that transistors can’t handle AC because they’re Active devices. And secondly, its not meant to be operated on such high voltages, it’ll burn immediately. So I hope you got a little idea abotu what is transistor and how you can start using it in your projects. Do let me know if you need any additions to this short tutorial.



Speakers come in all shapes and sizes, enabling you to listen to music on your mobile, tablet, laptop and home audio system, enjoy a film at the cinema or hear a friend’s voice over the phone.

In order to translate an electrical signal into an audible sound, speakers contain a permanent magnet and an electromagnet, Electromagnet is a metal coil which creates a magnetic field when an electric current flows through it. This coil behaves much like a normal (permanent) magnet, with one particularly handy property that is reversing the direction of the current. This causes flips in the poles of the magnet.

Inside a speaker, an electromagnet is placed in front of a permanent magnet. The permanent magnet is fixed firmly into position whereas the electromagnet is mobile. As pulses of electricity pass through the coil of the electromagnet, the direction of its magnetic field is rapidly changed. This means that it is, in turn, attracted to and repelled from the permanent magnet, vibrating back and forth.

The electromagnet is attached to a cone made of a flexible material such as paper or plastic which amplifies these vibrations, pumping sound waves into the surrounding air and towards your ears.

Inside a speaker:
1. Cone
2. Electromagnet (coil)
3. Permanent magnet

The frequency of the vibrations governs the pitch of the sound produced, and their amplitude affects the volume – turn your stereo up high enough and you might even be able to see the diaphragm covering the cone move.

To reproduce all the different frequencies of sound in a piece of music faithfully, top quality speakers typically use different sized cones dedicated to high, medium and low frequencies.

A microphone uses the same mechanism as a speaker in reverse to convert sound into an electrical signal. In fact, you can even use a pair of headphones as a microphone!

Being an electromagnet, usually, speaker don’t do much different if connected in opposite direction in circuit. But mostly, for better quality and stable operation, we connect the speaker in proper polarity, that is the negative terminal of speaker must go to circuit ground.

Speaker Types

The audio frequencies are broadly categorized in three types

  1. Low Frequency (our bass Sound)
  2. Mid Frequency ( Sounds, and vocal sound)
  3. High Frequency (treble and sharp Sound)

Although any general purpose speaker can reproduce all these three frequencies equally, still if we are much concerned about quality, there are different types of speakers used for reproducing different frequencies nicely. These are listed below


A tweeter is a small speaker which is capable of reproducing high frequencies very nicely. It’s very small in size and can reproduce all the high frequency sounds very nicely which includes all the metal effects and very sharp sounds


The woofer is relatively large in size and it’s used to properly reproduce the low-frequency sound. The Special Dhoom Dhoom we hear in the audio is reproduced by woofers. These are large, requiring large space and large power as well



In this term, the speaker is the one who can reproduce the mid frequencies well including vocal sounds sung by singer etc…

The one shown in the above diagram is the general-purpose speaker that we use in electronic experiments. Usually, every speaker is assigned with some value like 16 Ohm speaker, 8 Ohm speaker. This configuration is for the advanced users who wish to make the maximum output of it by tuning its amplifier. For us, for simple experiments, any small speaker does the job with more or less Loudness



Resistors are those tiny little electronics components which opposes the flow of electric current. Whenever we try to build a small circuit, if a resistor is added into that circuit, the job of resistor is to resist (or oppose) the current flow.

The value of resistance offered by a resistor never changes. Resistors are passive components means it doesn’t matter in which direction you connect it in a circuit, it will work the same way. By using resistors we can limit the current flowing through a circuit. As seen in previous tutorial, resistance offered by a resistor is measured in Ohms (capital omega symbol )

When drawing circuit on a paper, resistor is shown by a specific symbol as shown below

Where R1 or R2 shows which no of resistor is this in the circuit and the 1KΩ or 47KΩ shows the value of resistance offered by this component.

Resistor Value

The resistors offer electrical resistance which can be measured on Ohms. We can measure the exact resistance of a resistor by making use of multi meter, but for quickly knowing value of any given resistor, we can look at the color bands printed on resistor body. Look at below picture

This above picture explains how value of a resistor is calculated. Every color band printed on resistor has a specific number associated with it as shown in below chart. The first color band (its respective number) is the first number in value of resistor, second color band (its respective number) is the tenth place of resistor value, and the third band (its number off course) indicates order of 10 with which the value will be multiplied to get the final value. Here’s the resistor color coding chart

You can also use below mentioned calculator to find out your resistor value



Resistors come in various sizes and different types. The sizes of resistors are usually dependent upon how much power it can handle (remember, we have big power point in home for Fridge, Geyser, AC etc… same way!!!) a big sized resistor is used to handle big amount of electric power. The resistor value has nothing to do with the power consumption and both are independent properties. Look at the picture below for various resistor sizes

Above picture shows three different resistors sizes. All three of them have different power ratings and usually, the bigger one is with the large power rating and small one is with smaller power rating. Look at below picture for a visualization of resistor sizes

As you see in above picture, it’s fairly simple to notice that as the wattage increases, size of resistor increases.

Variable Resistors

Generally the types of resistors are based on the material they use. Some resistors are only made up of carbon, some utilizes a special type metal offering some fixed resistance and so on. Most common ones we see and use utilize a carbon film and hence called as Carbon film resistor or CFR.

Then comes variable resistors, these are having three points, two points, which offer a fixed resistance and one variable point which can float between these two points. If these are such that can be mounted on bread board, its called as preset, and if its like a simple knob which can be rotated (just like volume control of a player) then its Called as potentiometers, or simply as POT.

The above figure shows Presets and below figure shows how a pot looks like, note, they all are 3-point components.

What are Integrated Circuits

What are Integrated Circuits

IC is a short form for the name integrated circuit. We know that we purchase Masala Powder for some special cooking (like Pav-Bhaji Masala). What is this Masala Powder? Simply combination of some special spices in a fixed proportion developed for some Special Purpose. Same thing is applied in electronics. When one need some special combination of electronic components doing some special work, we combine them all in small form and make an IC. IC is nothing different than combination of some transistors, resistors and capacitors. These components in very small size are embedded on small silicon wafer and an IC is made. IC’s are made for various purposes. There are various sizes of IC’s depending upon how many pins they have. We include 8-pin IC with e-vidya kit. There are many options depending upon these pin count like 6-Pin, 8-Pin, 14-pin and so On

To read the pin no of IC, there is a notch in the IC, and the Pin no starts from Left on the IC, see the picture below

What are ICs

Notch in IC


In case of 8-pin IC, there are 4 pins on each side and hence the last pin from left side is 4, whereas on the other side, it starts from 5 and above till 8 being the top pin. See below

4 pin IC

4 Pin IC


While inserting IC’s into breadboard, we’ve to take care that the pins of IC should not short with each other, so IC should be inserted in breadboard like shown below

IC in breadboard

ic in breadboard


There are various IC’s available to do various jobs. Each IC may have different pin configuration and different package in which they are built. There are different IC packages depending upon the pin count.

There are various pin counts in the IC’s which are available. Most common ones are 3-pin IC, 4-Pin, 8, 14, 16, 18, 20, 28 and 40-Pin IC. Below is a picture showing all of them

various ic's

various ic’s


How to use digital multimeter : 3 most widely used operations

How to use digital multimeter : 3 most widely used operations

Digital Multimeter is one of the most essential tools an electronics hobbyist should own. While developing electronics circuits, we come across lots of different parameters which needs to be checked, for example, voltage, current, resistance, continuity etc… there are separate instruments available for each of these parameters, and multimeter is the one instrument having facility for doing all above measurement. There are analog and digital multimeters available. But digital are becoming more common these days and hence we use digital multimeters, which is also referred as DMM. Now and onwards, we use simply multimeter for referring to a DMM. It’s basically a measuring instrument which can measure

  • Voltage (AC/DC)
  • Resistance
  • Continuity (diode test)
  • Current (AC/DC)

So this single instrument serves all the major tasks required in electronics measurement. If we don’t have multi meter, there are very few chances to troubleshoot a circuit. Multi meter enables us to measure parameters and debug lots of problems in electronics circuit. Let’s see how to use one of the most helpful of all instruments, multi meter!!!

Look at below image for understanding three major parts of multi meter.

how to use a digital multimeter

A multi meter consists of three Major Parts

  • Display
  • Selection Knob
  • Probes

The display usually has four digits and the ability to display a negative sign. A few multi meters have back light displays for better viewing in low light situations.

The selection knob allows the user to set the multi meter to read different things such as current, voltage (V) and resistance (Ω). Have a look in above image

As shown in above figure, multi meter is having a central rotary switch for selecting various knob positions, each position corresponds to a particular parameter, the wheel can be easily rotated to select one of our required measurement knobs.

If we want to measure voltage, or say measure resistance, then we have to connect multi meter with the testing point in our circuit. This job is done by special wires which connect multi meter to components or test points of our circuit. These wires are called as probes. Two probes are plugged into two of the ports on the front of the unit. Have a look at below figure.

how to use digital multimeter

how to use digital multimeter

how to use digital multimeter

how to use digital multimeter

As you can see above, COM stands for common and is almost always connected to Ground or ‘- Negative’ of a circuit. The COM probe is generally black colored but there is no difference between the red probe and black probe other than color.

Apart from COM, there are two more ports on multimeter, One is labeled as mAVΩ. mAVΩ is the port that the red probe is conventionally plugged in to. This port allows the measurement of small current (up to 200mA), all the voltage (V), and resistance (Ω). The probes have a specific type connector on the end that gets easily fixed into the multimeter. Any probe with this kind of connector will work with this meter. This allows for different types of probes to be used.

How to use digital Multimeter : Measuring Voltage

To start, let’s measure voltage on a 9V battery Plug the black probe into COM and the red probe into mAVΩ.

how to use digital multimeter

measuring voltage

Set the multimeter to “20V” in the DCV range. Almost all electronics use direct current, not alternating current. Connect the black probe to the battery’s ground or ‘-’ and the red probe to power or ‘+’. Press the probes with a little pressure against the positive and negative terminals of the 9v battery. If you’ve got a fresh battery, you should see around 9.0V on the display (this battery is brand new, so its voltage is slightly higher than 1.5V).

If accidentally, you connect the probes in reverse direction, means red probe to negative and black to positive, the multi meter shows the negative reading, no harms!!!

how to use digital multimeter

negative measurement

If you’re measuring DC voltage in any circuit, you must know a tentative range of voltage that you’re measuring to set the knob. If the measured voltage is more than the specified range, the meter shows “1” means out of range

How to use digital Multimeter : Overload / Out of range measurements

What happens if you select a voltage setting that is too low for the voltage you’re trying to measure? Nothing bad. The meter will simply display a 1. This is the meter trying to tell you that it is overloaded or out-of-range. Whatever you’re trying to read is too much for that particular setting. Try changing the multimeter knob to a next highest setting. Look Below Image

how to use digital multimeter

Out of range measurement

How to use digital Multimeter : Measuring Resistance

Normally resistors have color codes on them. If you know how to read color codes, its OK! Understanding color codes is really easy and you can read more about it here. However, if you’re having a multimeter at hand, its much easier to measure resistance value and measure it accurately. Let’s see how to do this

Pick out a random resistor and set the multimeter knob to the 20kΩ setting. Then hold the resistor between the metallic ends of the probe and keep it pressed for few seconds

The meter will either read 000 or 1 or actual resistance value

If multimeter reads 0, it means you’ve selected very high range for measurement and hence value cannot be read properly. So decrease the multimeter know to some lower resistance setting

If display reads 1, it means you’re measuring voltage out of the selected range, and now you should increase the range knob

If the resistor value is in the range, then the accurate value should be displayed, as seen in below shows 998Ohm

See below pictures for example.

how to use digital multimeter

measuring resistance

How to use digital Multimeter : Continuity

While developing circuits, we often need to check that if one particular point is correctly going to the other point or not. Means if we’re doubtful that there is something loose in the connections, and then we need to check the continuity of connection

how to use digital multimeter

connectivity options

Continuity testing is actually testing the resistance between two points. If there is very low resistance (less than a few Ωs), the two points are said to be connected electrically, and a tone is generated for audio feedback. If there is more than a few Ωs of resistance, than the circuit is assumed open or not-connected, and no tone is generated. This test helps insure that connections are made correctly between two points. This test also helps us detect if two points are connected that should not be.

Set the multimeter to ‘Continuity’ mode. As shown below. It may vary among various multimeters, but look for a diode symbol with picture like sound coming from a speaker. This is continuity knob for most meters.

Now touch the probes together. The multimeter generates a tone (Note: if battery of multimeter is low, the tone should be very low). This shows that a very small amount of current is allowed to flow without resistance between probes.

On a breadboard that is not powered, use the probes to poke at two separate ground pins. You should hear a tone indicating that they are connected. Continuity is a great way to test if two pins are touching. The audio feedback of multimeter ensures that you can look at circuit under test and hear the tone for confirmation

Hope you’ve understood how to use digital multimeter well with this simple tutorial.

Let know in the comments if you want more explanation and I’ll update the tutorial.



Electricity, voltage, current and Resistance

Electricity, this is the first thing to study in electrical or electronics study. Electricity. When beginning to explore the world of electricity and electronics, it is important to start by understanding the basics of electricity and its related terms which voltage are, current, and resistance. These are the three basic building blocks required to utilize electricity. At first, these concepts can be difficult to understand because we cannot “see” them. One cannot see any electrical parameters with the naked eye. We cant see energy flowing through a wire or the voltage of a battery sitting on a table. In order to detect this energy transfer, we must use measurement tools such as multimeters to know what is happening with the electricity in a system. However, this tutorial will give you the basic understanding of voltage, current, and resistance and how the three relate to each other.

What is Electricity?

Electricity is all around us. We use electricity to give powerto our TV’s, computers, lights, mobile phones, refrigerators and oven and everything at our home. It’s not possible to imagine our day to day life without electricity, especially when power fails for some minutes or few hours, we get panic because it seems the world has stopped when electric power is not available at home. But what exactly is electricity? This is a very complicated question;in simplest words, electricity, is the form of energy which can be flown through the electronics present in an atom

In this tutorial we’ll focus on current electricity, it is the thing that powers our electronic equipments. Our goal is to understand how electricity flows from a power source through wires, lighting up LEDs, spinning motors, and powering our household devices.

Current electricity is the form of electricity which makes all of our electronic and electric devices work. This form of electricity exists when charges are able to constantly flow. As opposed to static electricity where charges gather and remain at rest, current electricity is dynamic; charges are always moving.

The definition of electricity is the flow of charge. Usually our charges will be carried by free-flowing electrons present in an atom. Negatively-charged electrons are loosely held to atoms of conductive materials. With a little push we can free electrons from atoms and get them to flow in a generally uniform direction.A closed circuit of conductive material provides a path for electrons to continuously flow.We need a source of electric potential (voltage), which pushes electrons from a point of low potential energy to higher potential energy.


The most common terms we discuss in studying electricity is voltage. A voltage is the difference in potential between two points in an electric field. Voltage gives us an idea of just how much pushing force an electric field has compared to the other point where there is no electric potential. We define voltage as the amount of potential energy between two points on a circuit. One point has more charge than another. This difference in charge between the two points is called voltage. It is measured in volts, which, technically, is the potential energy difference between two points. The unit of measuring voltage is VOLTS. Voltage between two points can be measured with an instrument called Voltmeter, or you can also use the voltmeter mode available in Multi meters. To know more about multi meters, click here


When there is a potential difference between two points in an electric field, if some path is available for electric energy to flow from higher potential point to the lower potential point, then electric energy flows through this through the available electronics in the conductor, this flow of electrons is called as Current, or electric current. The unit of measuring current is AMPERE. Currents in circuit can be measured using an instrument called Ammeter or ammeter mode in multi meter. To know more about multi meters, click here


When there is a potential difference between two points, and some path is available for electric energy to flow from higher potential to the lower potential, this path, from which current has to be flown always shows some oppose to the current flow, this is called as Resistance. Even good conductor like copper has some very little resistance associated with it, and resistance increases as the length of conductor increases. Due to this resistance offered to electricity, various interesting effects can be seen, and hence, there are some resistance offering component specially made for specific resistance values, these are called as RESISTORS. Resistance is always measured in Ohms (symbol Ω )Read More about resistors here.

Resistance is given by a simple formula

R = V / I


When describing voltage, current, and resistance, a common example is a water tank. In this example, charge is represented by the water amount, voltage is represented by the water pressure, and current is represented by the water flow. So for this example, remember

    Water = Charge

    Pressure = Voltage

    Flow = Current

The pressure at the end of this pipe can represent voltage. The water in the tank represents charge. The more water in the tank, the higher the charge, the more pressure is measured at the end of the pipe so more is the voltage.

We can think of this tank as a battery, a place where we store a certain amount of energy and then release it. If we drain our tank a certain amount, the pressure created at the end of the pipe goes down. We can think of this as decreasing voltage, like when we play games in mobile for long time, the batterygets low and eventually, phone turns off. There is also a decrease in the amount of water that will flow through the hose. Less pressure means less water is flowing. Here the flow means our current.

Now if the water flows through this pipe ending to some place down there, we say current is flowing and if it continues to flow forever, there will once come a point when the water in the tanks is over and nothing will flow from the pipe (remember the case when phone battery gets, down, tanks is empty and no current is flowing so our phone is Dead!!!)

Now imagine below

As shown in above figure, the size of the pipe is the total resistance offered to the water flow. If the pipe is larger, it means it will not resist the water flow means less resistance. And if the pipe is narrow, the water flow will be less. This is exactly similar to the resistance. If resistance is Less, more current flows in circuit and if resistance is More, less current flows in circuit.

Alternating Current and Direct Current

Note that these are the basics of how current electricity flows, but have you seen this?

What is this? A simple 3 pin socket that we see in our homes. Right?

This is the socket of the electric power that comes to our home from the mains line. This is a

  • 230 Volt
  • 50 Hz
  • AC Supply

Confused? Let’s see each concept one by one

AC stands for Alternating Current. The supply which comes to our homes through the main line is always AC supply, by the name it means that the polarity (yes, positive and negative) of this supply is continuously changing as time changes and its voltage is 230v. DC supply as compared to AC is the one in which the voltage value never changes and remains constant at a fixed voltage. The cells that we use in Remote Controls or in the wall clocks provide a constant DC voltage, to simply visualize this thing look at the below figure

Here the green line shows how the AC is alternating above and below the reference line, where as DC is a straight line providing a very constant voltage continuously.

The reason for having AC in our house hold supply is very simple. At those times, DC voltages were not that popular and almost all the devices were using AC very effectively to carry out their work, for example the Lamps, Tube light etc… so it was standardized that the supply provided will be AC and if DC is required, it will be taken from suitable DC power Sources. Next we’ll see what are DC power sources available to power our small electronic circuits