In this post we learn how to use resistors while designing an electronic circuits using LEDs, zener diodes, or transistors. This article can be very useful for the new hobbyists who normally get confused with the resistor values to be used for a specific component and for the desired application.

## What is a Resistor

A resistor is a passive electronic component which might look quite unimpressive in a electronic circuit compared to the other active and advanced electronic components such as BJTs, mosfets, ICs, LEDs etc.

However contrary to this feeling resistors are one of the most important parts in any electronic circuit and imagining a PCB without resistors may look strange and impossible.

Resistors are basically used for controlling voltage and current in a circuit which becomes highly crucial for operating the various active, sophisticated components.

For example, a BJT such as a BC547 or similar may need a properly calculated resistor across its base/emitter in order to function optimally and safely.

If this is not followed, the transistor may simply blow off, and get damaged.

Similarly we have seen how resistors become so essential in circuits which involve ICs such as a 555 or a 741 etc.

In this article we'll learn how to calculate and use resistors in circuits while designing a particular configuration.

### How to use Resistors for driving Transistors (BJTs).

A transistor requires a resistor across its base and emitter and this is the one of the most important relation between these two components.

A NPN transistor (BJT) needs a specified amount of current to flow from its base to its emitter rail or ground rail in order to actuate (pass) a heavier load current from its collector to its emitter.

A PNP transistor (BJT) needs a specified amount of current to flow from its emitter or positive rail to its base in order to actuate (pass) a heavier load current from its emitter to its collector.

In order to control the load current optimally, a BJT needs to have a properly calculated base resistor.

You may want to see an related example article for making a relay driver stage

The formula for calculating the base resistor of a BJT can be seen below:

**R = (Us - 0.6).Hfe / Load Current,**

Where R = base resistor of the transistor,

Us = Source or the trigger voltage to the base resistor,

Hfe = Forward current gain of the transistor.

The above formula will provide with the correct resistor value for operating a load through a BJT in a circuit.

Although the above formula may look crucial and imperative for designing a circuit using BJTs and resistors, the results actually need not be so much accurate.

For example suppose we want to drive a 12V relay using a BC547 transistor, if the relay's operating current is around 30mA, from the above formula, we may calculate the base resistor as:

R = (12 - 0.6). 200 / 0.040 = 57000 ohms that's equal to 57K

The above value could be assumed to be extremely optimal for the transistor such that the transistor will operate the relay with maximum efficiency and without dissipating or wasting excess current.

However practically you would find that in fact any value between 10K and 60k works well for the same implementation, the only marginal drawback being the transistor dissipation which may be slightly more, may be around 5 to 10mA, that's absolutely negligible and does not matter at all.

The above conversation indicates that although calculating the value of the transistor may be recommended but it's not entirely essential, as any reasonable value may do the job for you equally well.

But that said suppose in the above example if you chose the base resistor below 10K or above 60k, then certainly it would start causing some adverse effects to the results.

Below 10k the transistor would begin getting warmer and dissipating significantly..and above 60K you would find the relay stuttering and not triggering tightly.

### Resistors for driving Mosfets

In the above example we noticed that a transistor crucially depends on a decently calculated resistor across its base for executing the load operation correctly.

This is because a transistor base is a current dependent device, where the base current is directly proportional to its collector load current.

**If the load current is more, the base current will also need to be increased proportionately. **

Contrary to this mosfets are entirely different customers. These are voltage dependent devices, meaning a mosfet gate does not depend on current rather on voltage for triggering a load across its drain and source.

As long as the voltage at its gate is over or around 9V, the mosfet will fire the load optimally regardless of its gate current which could be as low as 1mA.

Because of the above feature a mosfet gate resistor does not require any crucial calculations.

However the resistor at a mosfet gate must be as low as possible but much greater than a zero value, that is anywhere between 10 and 50 ohms.

Although the mosfet would still trigger correctly even if no resistor was introduced at its gate, a low value is strictly recommended for countering or restricting transients or spikes across the gate/source of the mosfet.

**Using a resistor with a LED**

Just like a BJT, using a resistor with an LED is essential and could be done using the following formula:

**R = (Supply voltage - LED fwd voltage) / LED current **

Again, the formula results are only for acquiring absolute optimal results from the LED brightness.

For example suppose we have a LED with specs of 3.3V and 20mA.

We want to illuminate this LED from a 12V supply.

Using the formula tells us that:

R = 12 - 3.3 / 0.02 = 435 ohms

That implies that a 435 ohm resistor would be required for obtaining the most efficient results from the LED.

However practically you would find that any value between 330 ohm and 1K would render satisfactory results from the LED, so its just about little experience and some practical knowledge and you could easily get across these hurdles even without any calculations.

**Using resistors with zener diodes**

Many a times we find it essential to include a zener diode stage in an electronic circuit, for example in opamp circuits where an opamp is used like a comparator and we intend to employ a zener diode for fixing a reference voltage across one of the inputs of the opamp.

One may wonder how a zener resistor can be calculated??

It's not difficult at all, and is just identical to what we did for the LED in the previous discussion.

That is simply use the following formula:

**R = (Supply voltage - Zener voltage) / load current **

No need to mention that the rules and parameters are identical as implemented for the LED above, no critical issues will be encountered if the selected zener resistor is slightly less or significantly above the calculated value.

**How to use Resistors in Opamps**

Generally all ICs are designed with high input impedance specs and low output impedance specs.

Meaning, the inputs are well protected from inside and are not current dependent for the operational parameters, but contrary to this the outputs of most IC will be vulnerable to current and short circuits.

Therefore calculating resistors for the input of an IC may not be critical at all, but while configuring the output with a load, a resistor may become crucial and may need to be calculated as explained in our above conversations.

**Using resistors as current sensors**

In the above examples, especially for the LeDs and the BJTs we saw how resistors could be configured as current limiters. Now let's learn how a resistor may be utilized as a current sensors:

You can also learn the same in this example article which explains how to build current sensing modules

As per Ohms law when current through a resistor is passed, a proportionate amount of potential difference develops across this resistor which can be calculated using the following Ohms law formula:

V = RxI, where V is the voltage developed across the resistor, R is the resistor in Ohms and I is the current passing through the resistor in Amps.

Let's say for example, a 1 amp current is passed through a 2 ohm resistor, solving this in the above formula gives:

V = 2x1 = 2 V,

If the current is reduced to 0.5 amps, then

V = 2x0.5 = 1 V

The above expressions show how the potential difference across the resistor varies linearly and proportionately in response to the flowing current through it.

This property of a resistor is effectively implemented in all current measuring or current protection related circuits.

You may see the following examples for studying the above feature of resistors, all these designs have utilized a calculated resistor for sensing the desired current levels for the particular applications..

Universal High Watt LED Current Limiter Circuit - Constant ...

Cheap Current Controlled 12 Volt Battery Charger Circuit ...

LM317 as a Variable Voltage Regulator and Variable ...

Laser Diode Driver Circuit - Current Controlled | Homemade ...

Make a Hundred Watt LED Floodlight Constant Current ...** **

### Using resistors as Potential Divider

So far we saw how resistors can be applied in circuits for limiting current, now let us investigate how resistors can be wired for getting any desired voltage level inside a circuit.

Many circuits require precise voltage levels at specific points which become crucial references for the circuit for executing the intended functions.

For such applications calculated resistors are used in series for determining the precise voltage levels also called potential differences as per the circuit's requirement. The desired voltage references are achieved at the junction of the two selected resistors (see figure above).

The resistors which are used for determining specific voltage levels are called potential divider networks.

The formula for finding the resistors and the voltage references can be witnessed below, although it may be also simply achieved using a preset or a pot and by measuring its center lead voltage using a DMM.

Vout = V1.Z2/(Z1 + Z2)

**Have further questions? Please jot in your thoughts through your comments.**

## Have Questions? Please post your comments below for quick replies! Comments should be related to the above artcile