Electronics & Microcontrollers for Absolute Beginners (Part 14)

maxmax wrote 02/04/2021 at 22:18 • 13 min read • Like

Well, hello there, how nice to see you again. Everything we’ve talked about thus far has laid the foundation for what is to come. In the case of this column, this means we are poised to perform our first hands-on experiments with real electronic components. This is going to be tremendously exciting, so make sure you are sporting appropriate attire (I favor floral Hawaiian shirts myself).


If there’s one thing we tend to use a lot of when we are creating electronic circuits, that thing is resistors. At the end of Part 12, I recommended that you purchase a resistor kit containing a bunch of different 1/4-watt, 5% tolerance components, something like this resistor kit comprising 1,800 pieces spanning 72 values will do nicely (the comments say their leads are a little on the thin and flimsy side, but overall they have a good rating).

As I’ve mentioned before, please note that I have NO connection with and receive NO remuneration from anyone associated with any of the components and tools I may mention in these columns.


Diodes are interesting components in that they conduct electricity only in one direction (we’ll see this in action shortly). The first diodes were created using vacuum tube technology, but we now use semiconducting materials like silicon or germanium. As fate would have it, we won’t be using any regular diodes in this column, but if you really start getting into electronics, you’ll discover that it’s a good idea to have some standard parts close to hand. On this basis, I would suggest something like this diode kit.

Light-Emitting Diodes (LEDs)

There are various types of diodes, each with different characteristics. One type is called a light-emitting diode (LED). As for a regular diode, an LED conducts electricity only in one direction. Unlike a regular diode, however, when the LED is conducting, it also emits electromagnetic radiation (ER). We are typically talking about ER in the form of the visible spectrum -- red, green, yellow, orange, blue, etc. -- but other types of LEDs, like ones that emit infrared (IR), are also available. If you are anything like me, you will end up using a lot of LEDs in your projects -- also, we will be using them in our experiments in this column -- so I think it would be a good idea to splash the cash on something like this LED kit.

9V Battery and Clip

In addition to our resistors and diodes, there are a couple more things we are going to need for the experiments in this column. First, we require something to power our circuit. Just to make things easy, we are going to use a standard 9 V (9-volt) battery. You can, of course, pick one of these up at your local supermarket (but not at a gas/petrol station because they will overcharge you by so much that it will make your eyes water). Note that the smaller connector is the positive (+ve) terminal, while the larger “splayed out” connector is the negative (-ve) terminal.

Now, we could just hold our wires onto the battery terminals with our hands, and you are certainly free to do so, but we can also make our lives a lot easier by using a battery clip. In an earlier column I noted that it’s a good idea to start building up a “treasure chest” of components and other useful items. In this case, on the basis that they will almost certainly come in handy at one time or another, you might consider purchasing something like this 10-pack of 9 V battery clips.

“A LED” or “An LED”?

When you are reading books or articles about electronics, you may see the author write “a LED” or “an LED” -- so, which one is correct? Well, like so many things, the answer is “it depends.” In this case, it typically hinges on how the author sounds things out in his or her head, although it may also be determined by an in-house style guide. If, while chatting, someone says “LED” to rhyme with “bed,” then “a LED” would be appropriate. By comparison, another person -- possibly in the same conversation -- may prefer to spell things out as “L-E-D” (both forms are commonly used), in which case “an L-E-D” would be the correct form.

Water Analogies

Let’s assume we have a channel conveying water. Let’s also assume that the water in the channel is 9-feet deep (thereby cunningly corresponding to our 9 V battery). Let’s say that the source of the water is positive (+ve) and the destination of the water is negative (-ve), so the water is flowing from positive to negative.

Obviously, we are using the water flowing through the channel to represent electricity flowing through a wire. Generally speaking, we represent electricity as flowing from +ve to -ve, and that’s certainly the way we are going to think about it in these columns. Having said this, it’s good to remember that -- as we discussed in Part 4 -- electrons in the real-world flow from -ve to +ve, but we don’t need to concern ourselves with that here.

Consider the diagram below. In (a) the water is unimpeded, which is like having electricity flowing through a low-resistance copper wire. By comparison, in (b) the channel is completely blocked, thereby preventing the flow of water, which is like having a break (open circuit) in our wire.

Water analogy of electric current in a wire (Image source: Max Maxfield) 

Now consider what happens when we introduce a diode into our circuit. If the diode is reverse biased (i.e., “pointing the ‘wrong’ way” or “pointing against the flow”) then it won’t conduct. As illustrated in (a) below, this has the same effect as if there were a break in the wire or if the water channel was blocked.

Water analogy of a diode in the circuit (Image source: Max Maxfield) 

By comparison, when the diode is forward biased (i.e., “pointing the ‘right’ way” or “pointing with the flow”) as illustrated in (b) above, then it will conduct. In the case of a LED, it will also emit light. This leads us to another nugget of knowledge in that we class the diode as being a “polarized” component because the way it is connected is important. By comparison, resistors aren’t polarized because it doesn’t matter which way round we connect them into the circuit.

The real reason I wanted you to see these diagrams is that diodes have something called “forward voltage drop,” which is commonly written as Vf. When I was starting out, I found it difficult to wrap my brain around this concept, and I found the water analogy helped me visualize what was going on.

Take another look at the water channel in (b) in the image above. As before, we’re assuming that we are starting out with water that’s 9-feet deep. But suppose someone introduces a 2-foot-tall blockage into the channel. In this case, the height of the water as seen “downstream” will only be 7-feet deep.

Remember that all analogies are suspect, and this one doubly so, but it may help you as it helped me. When a diode is forward biased, the source voltage has to be greater than the diode’s forward voltage drop for it to conduct at all, otherwise it’s like having a break in the wire. Once the source voltage exceeds the forward voltage drop, then the diode starts to conduct and anything “left over” (voltage wise) is used to push current through the diode and the wire.

If diodes were ideal components, then -- once they had turned on -- they would have zero resistance. In the real world, diodes do have some resistance, but it’s typically small enough that most of the time we can ignore it and pretend it’s zero.

Symbols and Packages

Regular diodes come in a wide variety of shapes and sizes. A very common component is the 1N4001 general-purpose diode, which -- as shown in its lead through-hole (LTH) axial package in (a) below -- is cylindrical in shape, approximately 0.2 inches (5 mm) long and about 0.1 inches (2.5 mm) in diameter.

The end of the diode that’s connected to the positive (+ve) supply is called the anode (symbol ‘a’), while the end that is connected to the negative (-ve) supply is called the cathode (symbol ‘k’). As an aside, we use ‘k’ instead of ‘c’ because the latter is reserved for the “collector” terminal on a bipolar junction transistor (BJT). Beginners sometimes become confused by the white band on the regular diode indicating the cathode because they assume this band should reflect the positive (+ve) connection. A better way to think about this is that the band indicates the “pointy” end of the symbol, which -- in turn -- indicates which way the diode has to be oriented (pointing) for current to flow.

Regular and light-emitting diode symbols and packages (Image source: Max Maxfield) 

As an aside, since the term “current” refers to the “flow of electrons,” it’s technically incorrect to say things like “flow of current” (which would be equivalent to “flow of flow of electrons”) or “current flow” (which would be equivalent to “flow of electrons flow”). In the real world, however, even professional engineers may say things like “current flow” and the world continues to turn, so this isn’t something we need to lose any sleep over.

Like regular diodes, LEDs also come in a tremendous variety of shapes and sizes, but the traditional type, which has been around since the early 1960s with billions upon billions produced, is illustrated in (b) above. In this case, the transparent plastic has a flat side, and this is the side associated with the cathode terminal. Also, when the device is new (before you’ve done anything to it), you’ll see that the two leads are of different lengths, with the anode being longer than the cathode.

Experiment #1

VERY IMPORTANT: If you have only one LED to play with, then DO NOT perform this experiment because you will shortly have one LED less in your collection. Actually, you really need to have at least three LEDs, because you are about to lose two of them and you will need one for Experiment #2.

Assuming you purchased the LED kit discussed earlier, take a red LED and press its leads onto the battery’s terminals such that the diode is reverse biased (i.e., with the longer anode lead on the -ve terminal) as illustrated in (a) below.

Experiment #1 (Image source: Max Maxfield) 

Observe that absolutely nothing appears to happen because the fact that the LED is reverse biased means that it prevents the flow of current (well, electrons -- see the “aside” earlier). Actually, this is not strictly true, because a LED can support a only a relatively small reverse bias voltage before it becomes a non-functioning device. In the case of a red LED, this is typically 5 V or less, which means that -- in all likelyhood, your LED is now no more (by comparison, a general-purpose diode like a 1N4001 can survive a reverse bias voltage up to 50 V).

On the other hand, it may be that your LED lived through the experience (mine did). Let's see. Swap the leads over so that the LED is forward biased as illustrated in (b) above. If the LED flares up for a fraction of a second before it shrugs off this mortal coil, then it did indeed survive the reverse bias voltage of 9 V, but it certainly didn't make it through being forward biased. Alternatively, if the LED doesn't flash and die, then it didn't make it through part (a). In this case, try connecting a new LED as shown in part (b) and observe this new LED light up and and then go out. The end result is that you are now the proud possessor of one or two “Ex LEDs” (as John Marwood Cleese might have said in Monty Python’s Dead Parrot sketch).

What just happened? Well, in Part 5 we introduced Ohm’s Law, which reads as follows:

      V = IR (or V = I*R or V = I × R)

Where V = voltage (in volts), I = current (in amps), and R = resistance (in ohms). If you look inside the lid of the LED kit box, you’ll see that the red LED has a forward voltage drop (Vf) of 2.0 to 2.2 volts (if you are using a different type of LED, consult the corresponding data sheet to determine its Vf). Let’s assume Vf = 2.0 volts, because this will result in the worst-case scenario. Why? Because it leaves more voltage on the table, which results in higher current.

Since our supply voltage from the battery (Vs) is 9 volts, once the diode turns on, we are left with 9 - 2 = 7 volts to push the current through the diode. From Ohm’s law, we know that:

      I = V/R

But earlier we said that, once the diode turns on, we can assume its resistance falls to zero, which means we now have:

      I = V/0 = (0 - 2.0)/0 = 7/0 = ∞

We also know that the result of dividing anything by zero results in infinity (∞), so we are lucky that the LED does have some small amount of resistance, otherwise we would have just experienced a very “bad hair day (including singed eyebrows)” indeed.

Let’s assume that the LED’s resistance is 10 Ω (10 ohms). In this case:

      I = V/10 = 7/10 = 0.7 A = 700 mA

Eeeek -- 700 milliamps! That’s not good, because if we return to look inside the lid of our LED kit box, we will observe that the maximum forward current (If) that this LED is rated for is only 20 mA. What we need to do is to add a current-limiting resistor to our circuit, which leads us to Experiment #2.

Experiment #2

Remember that our diode’s forward voltage drop (Vf) is shown as being anywhere from 2.0 to 2.2 volts (or whatever is specified on your data sheet), but we are assuming 2.0 volts because this results in the worst-case (highest current) scenario.

We know that the voltage we are playing with is the supply voltage (Vs) minus the LED’s forward voltage drop (Vf). We also know that the maximum forward current (If) we want is 20 mA. Since Ohm’s law requires units of volts, amps, and ohms, we convert 20 mA into 0.02 A, which results in the following:

      R = V/I = (Vs - Vf)/If = (9 - 2.0)/0.02 = 350 Ω

Well, that was easy, wasn’t it? Or was it? If we return to Part 11, we discover that, in the case of the E12 resistor series we are using, the closest values to the 350 Ω we desire are 330 Ω and 390 Ω. Just for giggles and grins, let’s plug both of these values into Ohm’s law to determine the resulting currents:

      I = V/R = (Vs - Vf)/R = (9 - 2.0)/390 = 0.018 A = 18 mA

      I = V/R = (Vs - Vf)/R = (9 - 2.0)/330 = 0.021 A = 21 mA

Not surprisingly, the lower resistance results in the higher current. Since we intend this to be a current-limiting resistor, we will go with the 390 Ω value (which sports orange-white-brown colored bands). So, our resulting circuit will appear as shown below:

Alternative ways of wiring our circuit (Image source: Max Maxfield) 

Observe that, in this case, it doesn’t matter in which order we connect these components (resistor-LED or LED-resistor), just so long as the diode is forward biased (connected the ‘right’ way round). Pictorially, assuming we opt for the resistor-LED arrangement, our circuit will appear as follows:

Pictorial representation of the resistor-diode implementation (Image source: Max Maxfield) 

Ah! I envy you the experience of wiring your very first circuit and seeing your very first LED glowing for the very first time. Savor the moment because -- unless you have an exceptionally short memory -- you have only one chance to experience this for the first time. But turn that frown upside down into a smile because your future glows with the radiance of the countless LEDs that are to come.

In closing this column, may I suggest that you try a couple more experiments. First, swap the orientation of the resistor and observe that the LED continues to glow. Next, change the ordering of the circuit from resistor-LED to LED-resistor and -- once again -- observe that the LED continues to glow. Finally, reverse the polarity of the LED (swap the connections of its leads) and observe that -- since it’s now reverse biased -- it no longer glows.

I hope that my explanations have made things and clearer and that I’ve not “muddied the waters” with my weak and wet water analogies. As always, I welcome your comments, questions, and suggestions.



max wrote 5 days ago point

I think you could just print the columns out and then gather them together -- in the fullness of time (when I've finished the remaining 1,000 parts -- I hope to gather them into a book :-)

  Are you sure? yes | no

Prabhakar wrote 5 days ago point

Really good !, can I get  a book form pdf to train my staff 

  Are you sure? yes | no