Click here to Skip to main content
15,845,829 members
Articles / Internet of Things / Arduino

Practical Electronics for Makers (Part 2 of N)

Rate me:
Please Sign up or sign in to vote.
4.92/5 (39 votes)
8 Jan 2018CPOL41 min read 43.4K   39   26
What are batteries, breadboards, continuity tests, drawing circuits, and reading schematics
Learn about batteries, breadboards, continuity tests, drawing circuits, reading schematics. Learn what a breadboard is, how it works and build our first circuit on one.


You can read the Introduction and Chapter 1 of this article here at CodeProject:

I'm writing these chapters as fast as I can because I'm so excited to share the material.

However, this one has 46 images and specific examples of everything so they take a while.

Please keep this in mind when I don't cover something as much as I should (such as the Fritzing software in this chapter). Keep the comments coming because I'm learning from everyone too.

Chapter 2

Theme: Everything Important Is A Switch

Here’s What You Need

Here’s What You Will Learn

  • How to build your first simple circuit on a breadboard
  • Information about batteries (voltages, what their sizes mean, etc.)
  • What breadboards are and how they work
  • How to draw your circuits (so you can recreate them later)
    • Using Fritzing software
    • Basics of reading schematics
  • Why switches are so important in electronics
  • The two basic types of switches (momentary versus maintained)
  • Finding switches in everything (cameras, game pads, thermostats, MP3 players, etc.)
  • Poles and Throws (SPST - Single Pole Single Throw, SPDT (double throw), etc.)

Let’s Build A Circuit

Here’s what we need for this one:

We’ll start using AA (double A) batteries to power our circuits. We’ll do that because they are easy to obtain, relatively small, easy to work with (compared to the coin cells) and will last longer in our various circuits.

What’s the Difference Between AA, AAA, C, and D Size Batteries?

You’ve probably seen numerous different sizes of common batteries and maybe you’ve wondered about the difference between them.

Image 1

Maybe now that you’ve heard the word voltage, you have guessed that the larger ones provide more voltage. I believe I thought that long ago, when I was first learning. The real answer is that all these batteries provide (about) 1.5V each.

The larger batteries simply have more material inside the cell (container) which means they can provide 1.5V and similar current for a longer period of time. That’s it. That means if you replaced a AA battery in a circuit with a D cell, then the battery would simply last longer because it has more of the material which creates a voltage difference between the negative and positive terminals.

I have some AA rechargeables which state that they are 2300mAh. That basically means that they will provide 2300mA (milliAmps) aka 2.3A for one hour.

So, let’s just guess and say a D cell contains twice the volume of material, so it can probably provide 2300mA for two hours. After that period of time, the voltage differential (between the positive and negative poles) would reach equilibrium and the battery would be considered dead for our use.

How Long Could My AA Keep My LED Lit?

So, using a bit of math, we can get an idea of how long my two AA batteries can keep my LED lit constantly. Just divide the 2300 by the current draw of the LED (last chapter, we calculated it to be around 18mA) and we get the number of hours the LED would be able to stay lit constantly.

2300 / 18 = @127 hours

That’s a long time. Especially since most of the time, you will just be blinking the LED on and off or only have it on momentarily.

Those Weird Rectangular Batteries: 9V

You have also probably seen the one common battery that is quite different because of its shape. It is the rectangular 9V battery which has both positive and negative terminals on the top.

Image 2

It is often used in smoke detectors. 9V batteries can be convenient for hobby use too because you don’t have to deal with putting two together end-to-end (you’ll see what I mean in a moment) and instead you just have a positive and negative terminal both on one end. That is an enticing reason to use them. However, 9V is usually overkill for a lot of modern components (which require 5V max) and then, you are stuck with creating a voltage divider (created with resistors) and this is more work than we want to deal with at this point.


SIDEBAR : Terminology Battery Versus Cell

It is interesting and somewhat important to know that really only the 9V battery is actually a battery. The term battery indicates an array of cells and if you look inside the other sizes (AAA, AA, C, D) you find only one cell -- separate area containing material which generates a voltage difference between the terminals.

You can see that in the following image*:

Image 3

A battery would actually be made up of numerous cells so when we align our two AA batteries in a serial fashion as we do below, it does become a battery of two cells.

The 9V battery is indeed a battery however, because if you view it internally, it does contain six separate cells which are 1.5V each. You can see this in the following image+:

Image 4

*Image is from:

+9V battery image from:


Instead, go ahead and get the nice AA battery holders (link at the beginning of this chapter) which hold two batteries and we’ll be able to configure many common voltages that we may need for a circuit.

Image 5

Here’s the battery holder with one battery in it to give you an idea of how they load into the holder.

Image 6

Two Important Notes

1) As a Hobbyist

First of all, before I bought the battery holders, I would try to tape two AA batteries together in series and then try taping a wire onto each end in an effort to use them to power a quick experiment that I wanted to try. It was foolish and it drove me crazy. If you try something like that, one or all of the connections will be loose and your circuit will work and then suddenly stop working and you will pull your hair out. Trust me and get the battery holders. They make your life so much easier.

2) Rechargeable AA Batteries: Slightly Different

Because the material, NiMH (Nickel Metal Hydride), in the rechargeable batteries is different than disposable* ones and produce only about 1.2V each, so my results in calculations will be slightly different but generally will not be a cause for concern. You’ll see me continue to refer to battery voltage as 1.5V throughout, but if I accidentally switch to 1.2V, you will know why.

*Disposables are generally Alkaline material of zinc and manganese dioxide (Zn/MnO2).

3V is a Good Test Circuit Voltage

Our coin cell was 3V and we want to keep working with that voltage since it is a common voltage and since it has become somewhat of a baseline for us.

Serial Voltages Add Up

However, each of our AA batteries is only 1.5V. To create a 3V power source, we simply connect our batteries in a serial fashion. That means the positive terminal of the second battery must be aligned and connected directly with the negative terminal of our first battery.

The simplest serial configuration for our AA batteries will look like the following:

Image 7

You can see the positive terminal of the second battery is connected directly to the negative terminal of the first battery.

Of course, in the picture, nothing is holding those two batteries together and the connection cannot be depended upon.

Serial Voltages Add Up to Create Total Voltage

When you connect batteries serially, their voltages add up to produce the total voltage in the circuit. In our case, we only have two batteries, each at 1.5V so we add 1.5V + 1.5V = 3V total.

For each battery you add serially, you simply add 1.5V.

We said each battery needs to be connected directly in a serial fashion but what does connected directly really mean, because our AA battery holders make it look as if they may not be connected directly.

What Does Connected Directly Mean?

The easy way to think about a direct connection is to make sure there are no components between the two things. So, in our case for the positive terminal of the 2nd battery to be directly connected to the negative terminal of the 1st battery, there should be no components (resistors, LEDs, capacitors, etc.) between those two posts. Wire, however, is not a component. So, if you have wire between them, you still have a direct connection.

How do Battery Holders Connect Serially?

Actually, that’s how the battery holders work. They create a direct connection from the negative terminal of the first battery to the positive terminal of the second battery.

Engineers Don’t Assume they Know, they Research

Let’s look very closely at how the battery holder is constructed so we understand how it works.

Real Engineers Try to Understand Everything

This is the philosophy of Real Engineers anyways. We never assume how things probably work. Instead, we research and learn the details of what actually makes them work so we own the knowledge for ourselves. Of course, we have to balance this with our available time so we often do have to accept that we cannot investigate every single detail, but we keep learning as we can.

Let’s take a look at a series of pictures which will help you see how these battery holders are constructed.

Note: The battery holder in the example actually for a slightly larger battery size, but it’ll help us to see the battery in the holder with room to still see the connection and wires.

Image 8

I’m using a yellow line just to show you the continuity of the circuit which starts at the red wire and continues into and through the battery.

Now, looking at the negative terminal of battery, we see it connects to coiled up wire (spring).

Image 9

The manufacturer simply extends that spring in the top battery chamber down into the bottom battery chamber (where the second battery will be placed) to create continuity.

I’ve pulled the coil up out of the first chamber in the next picture so you can see that the wire ends up terminating in the little button in the second chamber. This is where the positive terminal of the second battery will connect to continue this portion of the circuit.

Image 10

Here, you can see that I’ve added the second battery in the second battery chamber.

Image 11

Finally, the negative terminal of the second battery connects to the another wire coil (spring) which is connected to the outgoing black wire.

Image 12

I’ve also marked a spot with the letter A in the previous image to indicate the space just to the right of that letter which is the location where the outgoing black wire connects to the coil.

Why a Spring in Each Chamber?

Keep in mind that the reason there is a coil on each side is simply to create a mechanism which allows a battery to be inserted and then held in place by the pressure of the spring. It’s quite ingenious in its simplicity.

Here is the full circuit for the battery holder.

Image 13

If either battery is removed, there is not a complete circuit and electricity will not flow. You can also see that if you simply straightened out the arrows, you have a serial (inline) circuit.

Of course, our battery holders are designed this way to save space. Otherwise, you’d have a long narrow tube the length of both batteries to get a serial connection between them.

This all means that once we place our two AA batteries in our battery holder that we will have a voltage of just about 3V if we measure it from the black wire to the red wire. Let’s measure it on the meter to prove this.

Multimeter With Alligator Clips

In the next image, show the voltage of the two batteries you will see that I’ve attached an alligator clip on each of the probes so I could clamp each probe onto each wire.

Image 14

You can see that we are measuring just a bit above 3 volts on the batteries. It is odd that we’re measuring voltage with no load on the circuit (no components in a circuit) and that can affect our measurements but this is just for learning so it’s okay.

Hooking Up Probes Improperly

What if you hooked up the probes backwards -- black probe to red wire and red probe to black wire? Would it damage the meter or make something overheat or melt?

No, it will not, because voltage is always “in reference” to something. So what will happen is that you will see a negative voltage measured, because the meter will register the voltage in reference to ground (the convention of zero volts -- more as we go) and since the voltage is considered backwards, you will see it as a negative voltage measurement.

Image 15

You can see that I’ve hooked up the probes to the opposite color wires and now the voltage meter shows a negative voltage (negative sign in measurement).

Finally, 3V Power Source

Now that we have our 3V power source, let me show you what the completed circuit is going to look like and then we’ll take a look at what breadboards are and how they work.

Here’s Our Circuit

Image 16

This fritzing* drawing shows the entire circuit as you will build it on your breadboard.

It’s very simple once you understand how breadboards work (how they are connected beneath the plastic).

*Fritzing is software you can get for free at It is very nice for making drawings of your breadboard circuits. It is not as nice for creating schematic diagrams.

Here’s the same circuit as I built it:

Image 17

There are some differences in my real life circuit from the Fritzing version, but they are minor enough that they don’t matter. The components are spaced a bit differently because of the resistor leg lengths (where I bent the resistor wires) but that doesn’t matter to the circuit.

The other thing that is different is that I actually used a 220 Ohm resistor because I didn’t have any 180 Ohm resistors that I could find quickly.

So that you can build the circuit itself, you really need to understand how breadboards work so let’s look into that first.

How do Breadboards Work?

First of all, why is it called a breadboard? Back in the day when components were larger, a hobbyist would grab his mother’s wooden bread cutting board and some tacks and wrap some wire around the tacks and start building up their circuits. This allowed the hobbyist to try out his circuit without soldering.

You can read more about the history and take a look at some pictures of modern breadboards which have been cut open at

How Does A Breadboard Work?

There are three main things to understand about breadboards.

  1. There is one power rail (also called a bus) on each side of the breadboard so you can easily get to (reach with a wire) power or ground.
  2. Each column on the breadboard is connected. That means any wire plugged into the same column is connected.
  3. There are two sides to the breadboard which are not connected to each other.

The following image (from reveals exactly how the breadboard is connected. As you can see, the columns of holes are each connected to each other, but the connection does not extend from one side of the board to the other. In other words, there is a gap down the middle of the board. The horizontal rows (rails) of holes, of which there are four (two top and two bottom) are each connected all the way along the board but are not connected to each other in any way. The horizontal rows are also called the power rails because generally you connect the power source to those. One row will be used for positive and the second row will be used for negative or ground.

Image 18

Study the connections in that image and then I’ll show you how to do some continuity tests to prove what is connected and what is not.

After a few tests, you’ll understand exactly how to use your breadboard to make building your circuits easier.

SIDEBAR: Colors Used In Electronics

You will often see red associated with the positive (or hot) side of electronics. You will often see black (or blue as on the breadboard) associated with the ground (or neutral or zero voltage) side.

These colors are a convention that has been created over time. However, beyond that, on our breadboard or on our wires (passive components) the colors do not cause the breadboard or wires to be positive or negative.

For example, if you plug the positive side of the battery into the blue power rail, then it becomes the positive rail. The active component (in this case the battery) determines what the reality of the charge is. The rails are simply marked with colors so you can follow convention and keep yourself straight as you build your circuit. I highly suggest you follow convention so you don’t accidentally damage your circuit or hurt yourself. However, I also understand that you may not have a red wire handy as you build your circuit and so you may choose to use a yellow one instead.

Just remember, always double check things before you apply power and keep yourself safe.

Here’s a fantastic article for additional information on using breadboards:

Testing Continuity: Most Basic Test, Maybe Most Important

Before we go further, allow me to show you a very simple test which should also convince you that you must buy a multimeter. This test allows you to determine if your circuit has continuity. What does it mean to test continuity. It is a way to ensure that components have a connection between them and allow a continuous circuit. There will be times when you apply power to your circuit and nothing happens. That is when you should:

  1. Turn off all power to the circuit
  2. Test continuity

Breadboards are made up of very small clips which grab your wire. There are times when those clips get bent out of the way and your wire is in the breadboard hole but it is not touching the metal connector beneath. However, since you cannot see inside there, you have no way of knowing that. That’s where knowing how to test for continuity becomes an invaluable skill.

I recently had a breadboarded circuit that was working fine and then would intermittently fail. I couldn’t figure it out. Then I remembered that I needed to check continuity. That’s when I discovered that one of the jumper wires I was using was broken so that when it moved a little, the broken spot created a place where the current couldn’t flow (created an incomplete circuit).

Testing continuity is also a good test that you understand how breadboards work and if you understand the places where your circuit is connected electrically.

Set Your Meter for Continuity

Dial up your meter so it is pointing at the continuity test option. After you dial that up. Touch your two probes together and you should hear a beep that lasts as long as you hold the probes together. That beep is proof that the two probes are connected electrically. Place a coin on a table and touch each probe to different spots on the coin. You should hear a beep when both of the probes touch the coin. The meter simply sends a small amount of current through the positive probe and when the negative one is connected then the meter beeps.

Here, I was measuring continuity between the green and yellow wires connected on the breadboard.

You can see the dial is turned to continuity and the red probe is connected to non-voltage port.

Also (even though the picture isn’t real clear), you can see the sound symbol shows up on the screen also to indicate you are measuring continuity which will be alerted by a beeping sound.

Image 19

Continuity Experiments: All Shown on One Diagram

I’m showing you all the samples on one diagram. In this case, the wires are different colors just so I can reference those wires as I walk you through each test. You can hook up all the wires at once (like the diagram) or connect them in the same configuration as I mention in each test, one at a time.

Answers to all tests are at the end of the chapter.

Here’s how all of the wires are set up for our tests:

Image 20

Keep the following in mind:

  • None of the wires that terminate in the middle of the board (where there is just a trough or groove) are not connected on those ends.
  • The ends of the wires that go off board are not connected, on those ends, to the breadboard.
  • The ends of wires that go into a hole are connected, on those ends, to the breadboard.

For the tests, you can guess if they will have continuity and then test them with your meter. I will chop up the previous image to focus on which wires to test and to save space.

Continuity Test 1

Do the green (longer one) and black wires have continuity? Are they connected?

Image 21

If you touch one probe to the black wire and one probe to the green wire, will the meter beep (let you know that the two wires are connected)?

Continuity Test 2

Image 22

If you touch one probe on the yellow wire and one on the blue wire shown, will the meter beep?

Continuity Test 3

Image 23

If you touch one probe to the grey wire and the other to the pink will the meter beep?

Continuity Test 4

Are there any two wires which are sticking off the outer edges of the board (red, orange, grey, pink, green, black) -- except the black and green we’ve already tested -- that you can touch and get a beep?

Image 24

Continuity Test 5

Image 25

If you touch one probe to the black wire and one to the white wire, will the meter beep?

Continuity Test 6

Connect one probe to the light blue wire (in the trough). Now, which other wire would you need to touch to get a beep? Red, Orange or will either work?

Image 26

Check Your Answers

Go ahead and check your answers. The best way to check is to get your breadboard, wires and meter out and try them. But, if you cannot do that or you have trouble doing the actual tests, just check the answers below in the Continuity Test Answers section.

Now that you’ve taken the test and checked your answers, the first circuit will look like the following to you.

Image 27

Electrons Only Flow When There is a Complete Circuit

The reason we have to understand continuity is because it indicates whether or not we have a complete circuit. We need to know if we have a complete circuit, because electrons will only flow when the circuit is completed (completely closed). Another way to say this is, if there are any places where a wire comes loose or is cause the circuit to not be completely closed then electrons will not flow -- electricity will now flow.

This is all building toward the idea of a switch. I will clear this up in just a moment. But first, let’s take a look at how the electrons will flow in our circuit once we have complete connectivity (continuity).

What Does the Electron Path Look Like?

In our circuit, the electron path will follow along the circuit in the direction shown by the arrows.

Image 28

Electron Flow

When viewing that diagram, start with the arrow closest to the black (negative) wire and travel left until you get to the black connector wire and travel up into the resistor and continue until you get back to the red (positive) wire.

Yes, that’s right. Electrons flow from the negative high point (negative side of the battery) to the negative low point (battery negative terminal). That’s because in reality electrons are negative charges. This type of flow is called electron flow and is what happens in reality.

Conventional Current Flow

When electricity and electrical properties were being discovered, however, it was difficult for scientists to think of something negative that contained something. So as the pioneers of electricity began documenting their circuits they would show flow from the positive terminal toward the negative terminal. It became a standard that is still used today. This is called Conventional Current flow because it is a convention for understanding connectivity.

Most of the time, you will see diagrams and schematics that show conventional current flow -- from positive to negative.

Here’s an XKCD comic strip related to this issue that the original researchers got it backwards:

Also, here is a succinct explanation of the difference between Conventional Current flow and Electron flow at the Marine Institute of Newfoundland:

Yeah, it’s amazing where you find information on the Internet. :)

Once you understand how electricity flows in a circuit, it doesn’t really matter anyways. As long as you keep your positive and negative sides straight and you keep your polarized components connected to the proper side, you are going to be fine.

Build the Circuit

If you have not already built the circuit, go ahead and do so. When you hook it all up, the first thing you should notice is that the LED lights up. If the LED doesn’t light up, see the Troubleshooting Circuit 1 section below for a few ideas to fix it.

I will assume that you now have the circuit working with the LED lit up. The first thing you most likely notice is that the LED is always on. There is no simple way to turn the LED off. Well, I guess there is a simple way. It’s just not that convenient. To turn it off, you should simply pull the ground wire (black wire coming from battery holder) out of the breadboard.

When you pull the wire, the LED will turn off because there is not a complete circuit.


SIDEBAR: Troubleshooting Circuit 1

If you are having trouble with your first circuit, do not be discouraged. You will learn more from a failed circuit that you get working than you do from ones that work the first time.

  • Manually check (wiggle, remove, reconnect) all your connections to the breadboard? Do they seem like they are connected?
  • Check your batteries. Are you sure they are both new and/or fully charged?
  • Check that your batteries are installed in the battery holder properly. A hint is that generally the flat side of each battery (negative) will be on the spring in the battery holder and the raised side (positive) of each battery will be pushing against the small flat metal disk (or smaller wire/spring) in the battery holder.
  • Try flipping the LED legs around so each leg is in the opposite hole that it previously was. Does it light up? If it did, then you know you had the polarity of the LED wrong (negative leg was connected to positive and vice versa).
  • Try a different LED. Maybe this one has malfunctioned. This is a good example of why you should always have spare parts for your circuits. You can also test your LED in most multimeters.
  • Check your resistor. Are you sure it is 180 Ohms? If it is 180K (180 thousand) Ohms -- or some other large value -- then too little current will flow and the LED will not light.
  • Time to test continuity. Make sure you unplug one battery wire from the circuit.


That’s a Switch

That’s all a switch does. It simply creates an easy way to create a break in the circuit.

To see that in action, let’s create our own very simple switch.

Go ahead and plug the battery holder’s ground wire back into the breadboard so the circuit will light up again.

Making our Own Switch

After you plug the ground wire back in, pull the short black wire out of the ground rail and let it float free -- disconnected from the circuit. When you pull that wire, the circuit will turn off again.

Now, with the circuit turned off, go ahead and grab another wire from your part supply. Take this wire and plug it into the same rail (one we’re using as ground) on one end and let the other end float free. The circuit still will not light. It will look something like the following where I’ve added the brown wire at the bottom.

Image 29

Test Your First Switch

Simply touch the two wires (brown and black) together and the circuit will light up while you hold the two ends together.

Image 30

You’ve just created your first official switch. Of course, it isn’t the most usable switch but it is a type of momentary switch. It is a momentary switch because it is only on (circuit completed) when you hold the two wires together. Later, we will see another class of switches which are called maintained switches. Those are like the switches you have on walls. When you flip them in a direction (usually up) to turn on the lights in a room they stay flipped up (on) until someone flips them down (off). Our little two-wire switch is not very convenient because you have to hold the wires between your fingers.

Let’s take a look at our first new component which is a push button which also acts as a momentary switch. These little switches are used in a lot of places because they are very inexpensive and don’t take up much space.

Push Button Momentary Switch

The first thing to do to get ready for our push button switch is to remove the two wires (brown and black on previous image) that we just touched together. We won’t need them any more.

After that, get your push button switch, orient it properly (I’ll show you how) and push it into your breadboard at the appropriate location (I’ll explain this) as shown in the next fritzing diagram.

I’ve decided to add the red boxes to show the connections beneath the breadboard on that image, in an effort to make it more clear that the button is now connected from the ground rail over to the column where the one leg of the resistor is connected.

Image 31

When you plug the push button in, the circuit will not light until you press on the button. That is because this is a Normally Open (NO) momentary switch. Open means not connected. An open circuit is one that is not connected. An open switch is one that is not connected or not on. (There are also Normally Closed (NC) switches also.)

Inside our NO switch, there is a gap between the two legs which are in the breadboard. When you press the switch down, it connects those two legs and the circuit is completed and the LED will light.

Actually, the schematic symbol for the momentary switch is quite instructive about what this all looks like, even though it is a bit of an abstraction of the real switch. Let’s take a look at the schematic view of the previous circuit.

Schematic View

Here is the same exact circuit drawn as a schematic diagram. At first, you may think schematic diagrams are confusing simply because you don’t know the symbols but after you see a few of them, I believe you’ll be convinced that they are generally more succinct and it is actually easier to tell how things are wired than the fritzing type of diagrams. Time and experience will help you. Don’t be overwhelmed by the schematic.

Image 32

Let’s start at the BAT1 item, which you’ve probably guessed is the 3V battery we are using. You see, we don’t have to know that they are AA batteries. As you gain experience, you’ll know how to build a battery that suits your needs. So the schematic doesn’t try to tell you to use AA or any specific battery size. It does tell you that you need 3V, of course because that is what is important.

LED: Light Emitting Diode

Starting at the positive side of the battery, we trace the line (wire) to an item labeled D1 LTL-307EE.

That symbol (Image 33 )is the symbol for a diode. There are diodes that do not emit light also. We will learn more about these at another time. In our case, the diode symbol also contains the two arrows pointing up / away from the diode. That is the symbol for LED (light emitting diode). So in this case, the larger (flat) side of the triangle is the positive leg of the LED and the smaller (pointy) side is the negative leg.


As we travel along the circuit out of the LED, we come to the zigzag symbol which is the symbol for a resistor. It is labeled R1 (simply numbered so we can keep them straight when there are more of them in a circuit.

You can see that the resistor size of 180 Ohms is also marked on the diagram since that is an important part of understanding all the electrical features of the circuit (E = IR, remember).

After we travel out of the resistor, we come to the push button switch which was the main component I wanted to show you in this diagram. You can see that I chose one that is NO (Normally Open -- Open when not being acted on by an outside force). This item is drawn as an open space in the circuit with a plunger floating above it. Even though you may have never seen this before, you could probably guess what it means.

This push button is only meant to keep the circuit on while it is being pressed down. Sometimes, that is all we want. But other times, we would like the circuit to stay energized after interacting with it one time. To do that, we need a different type of switch (not momentary) which is a maintained switch. Let’s change out our push button for a maintained switch in our schematic.

Maintained Switch: SPST (Single Pole Single Throw)

I’ve quickly changed the switch in the diagram to a maintained SPST (Single Pole, Single Throw) switch. The schematic draws it in the open position (before it is acted upon).

Image 34

This type of switch might be an a) rocker switch, a b) toggle switch or a c) latching push button like the following:

a)Image 35 b)Image 36 c)Image 37

These two switches represent the SPST (Single Pole, Single Throw) that we have in our schematic. You can think of the pole as the hinge that the switch moves on. In the schematic, you can see that at the top of the switch which is hooked into the circuit. Single throw means that the switch only moves in one direction. An SPST has two positions: on (connected) and off (disconnected).

Symbol for On / Off

You can also see that some switches are marked with a symbol to let you know which way is on/off. The O symbol is the Off side but that isn’t because it is the first letter in the word off. There’s a bit of back and forth on this but quite a few people it means 0 (Zero) and 1. Zero is false or not on and 1 is true or on. This, of course, is binary and this is the way that switches are used in binary logic (1 is on and 0 is off). It’s one of those things you’ll just have to memorize for now. Of course, if you’re confused about which way a switch is on, then pull out the old multimeter and test it. Let’s do that now.

Continuity Test for Switches

Now that you know how to test continuity, you will use it quite often. We can use it to ensure we understand how our SPST switch works -- when it is on and when it is off.

To test your switch, go ahead and grab one and simply connect one probe to one of the posts (at the bottom of the switch) and the other probe to the opposite post. If your meter beeps, then you have continuity and the switch is on. If it does not beep then, of course the switch is off. With the probes connected go ahead and flip the switch on and off and you should hear the beeps at appropriate times. If you never hear a beep, the switch is broken. If you always hear a beep, then there is some other problem with the switch and I suggest you put that one aside and try another.

You can use SPST switches in circuits where all you need to do is turn a circuit on and off. However, there are times when you want to toggle between two different things being on so that when the one is on the other is off and vice versa. That’s where SPDT (Single Pole, Double Throw) switches become handy.

If you take a close look at the three previous switches, you will notice that each of them only have two posts (where the incoming and outgoing wire will be connected).

SPDT (Single Pole, Double Throw) switches have three posts. Here’s an example toggle which is a SPDT:

Image 38

The three poles allow you to use it to power two different circuits which will be mutually exclusive from each other -- you will never be able to have both of them on at the same time.

Let’s take a look at how this switch might be placed in our circuit first and then we’ll talk more about how it might be used to power two different circuits.

Image 39

As you can see, there is still just one pole (at the bottom of the switch) however, now the switch can touch one of two output contacts at a time (one on the right and one on the left). If we used this in our current circuit as drawn in the schematic our circuit would be turned off.

In this example, the second contact is unused so it serves as the off position. When the lever is flipped the other way, it would touch the second contact and our circuit would be closed or complete and the circuit would be energized - turned on.

The point here is that even though we have a double throw switch, we can still use it like a SPST switch just for on / off purposes. However, the switch allows us to take things a bit further. Suppose we want to add another LED to our circuit and have it turn on when the other one is off and vice versa. We can do that very easily and allow it to still be powered by our one source.

Our schematic will now look like this:

Image 40

Now our double throw switch becomes a very handy way to turn off the left circuit and turn on the right circuit with the flip of one switch. It also offers the convenience of having only the one power supply.

Let’s go ahead and build that circuit on our board now.

Image 41

You will notice that in the Fritzing drawing, I have placed a different type of switch on the breadboard. That’s a slider switch and I added it because the library of parts that Fritzing has contains this type of a SPDT switch, so I went ahead and used it. You can see that it still has three posts and I’ve connected the middle (shared) post to ground. The only difference between the SPDT toggle switch and this one is how they are switched mechanically. In other words, this one slides and the other one flips to change its position. They both still create the same solution of turning one circuit on and another one off with only one position change.

As a matter of fact, I’m going to do a bit of photoshop work and show you how our previous toggle switch could fit right into that same place on our board.

Image 42

That doesn’t look too bad. The point is that we still have three posts - it’s just the different type of switch. Three posts and a toggle button. It all works.

This is kind of a neat circuit because if you flip (or slide) the switch back and forth then the LEDs alternate lighting up and it could serve as a flashing warning of some type.

Something to Think About

What if, instead of you manually moving the switch back and forth, there was a way to alternate the energizing of each side of the circuit automatically? What if some other electronic component could do that for you? If you could do that, you would still just be turning each side on and off, but you’d have something that was automated. That’s how you should start thinking about these experiments: as things to be altered.

As you continue through the book and you build the test circuits, always be thinking,

  • How could I use this for my own purposes?
  • How could I change this to do something better?
  • How could I automate this circuit or parts of this circuit?

We will learn about components which act as switches for us. And we will also learn how we can make those switches do things remotely for us and much later automate some of what we do.

This chapter has been quite long, but I’ve tried to keep each thing we’ve learned broken into separate parts so you could take breaks along the way. I’m going to break this chapter into two because the next switches we take a look at are going to be automated switches. They will allow us to control the circuit or another circuit. A lot of times, that’s what we do in electronics: we create one control circuit which controls another circuit which actually does the thing we want. As we move along, we’ll talk about this more.

What is Electronic Automation?

The magic of electronics and computers is that they automate work for us. The reason we create software is so it will do things for us -- complex calculations, draw animations, calculate / update values on a spreadsheet when we change the value in one cell. That’s really what we do with electronics too.

For example, a modern wireless doorbell is a push button (momentary switch) and a receiver. Together, the push button and the receiver automate the old version which might have been a string tied to a bell, where someone had to pull the string to make the bell ring.

Another great example is a garage door opener. There is a mechanical engine mounted to the ceiling. It is engaged when someone presses a button on the wall. When the button is pressed, the engine engages, pulls a chain or drive cable which pulls the door open or lowers the door to the closed position. That electronically does the work that was done manually in the past by someone physically pulling up on the door to open it or pulling down on it to close it.

As you consider things you may want to build, you will find that they often automate things for you. Automation can be as simple as turning a light on or off for you. For example, suppose you want your outdoor lights to turn on when motion occurs in a certain area. That’s a boxed solution you can buy at your local store. You just install the special light fixtures which contain electric eyes which recognize movement. After that, any time something or someone moves in the area where the electric eyes are pointed, then the lights will turn on.

Almost Everything is a Switch

From the work you’ve done so far, you probably understand that the electric eye somehow simply flips a switch to turn the lights on. That is often the case: electronic automation is often simply just turning something on automatically or basically causing a switch to be flipped or automating a button press.

Your TV Remote

Your TV remote is a great example. When you press the volume up button, you want the TV to increase the volume. However, you are a distance away from the television and you want the volume to go up without having to get up and press the volume up button on the TV. Well, this made a lot more sense in times past when TVs still had control buttons on them. Some TVs do still have volume up/down buttons so it may make sense. The point is that the remote acts as a way to automate the button press on the physical TV. The remote uses infra-red light (light which is invisible to human eyes) to send the equivalent of morse code to the TV. The TV interprets the code and does the appropriate command (turns volume up, changes channel, etc).

We are going to see the basics of how Infra-red (IR) works as a switch in the next chapter. An IR sensor can be a cool thing which can allow you to control your electronic device from a distance. Why might you use IR instead of bluetooth? Because IR is quite a bit simpler and probably uses less power than bluetooth. These are some of the trade-offs that we consider as we build our circuits and devices and understanding these things that will make our projects stand out from others.

First, we’ll take a look at some other switches which are a bit easier to use in automation. We will also see how transistors are used as switches in almost everything. It’s all because transistors can be turned on by the presence of voltage and off when the voltage isn’t there.

Another component that will be helpful in these circuits is the capacitor which allows a circuit to store and discharge energy at intervals. So, the first thing we’ll start with in the next chapter is a circuit to charge and discharge a capacitor. Then we’ll build a few other circuits with a number of automatic switches. I believe seeing the components in action and how they can be used to automate things will electrify your imagination with ideas for your own projects.

Continuity Test Answers

  1. Yes, the meter will beep because the green and black wires are connected.

    1. The entire rail (see red outline in next image) is connected so since both the black and green wires are connected to that rail, they are connected too.

      Image 43

  2. Yes, the meter will beep because the blue and yellow wires are connected.

    1. The entire column is connected as are all columns on each side of the breadboard. As shown by the red rectangles I’ve drawn around columns. I’ve only skipped some columns so you can see the rectangles more clearly. Also, keep in mind that these columns are not connected to the columns on the other side of the trough (middle of board) and are not connected the rails. Of course, all other related columns are connected I just didn’t draw boxes around all of them.

      Image 44

  3. No, the meter will not beep because the pink and grey wires are not connected.

    1. That’s because columns are not connected across the middle of the board.

      Image 45

  4. No, none of the other outer wires are connected in any way.

    1. That’s because they are all in their own rail or column. Orange and red are in separate rails. Grey and pink are in their own columns.

      Image 46

  5. Yes, the meter will beep because the black and white wires are connected.

    1. The black wire is in its own rail. The white wire is in its own column and the two would not normally be connected. But the short green wire connects the two.

      Image 47

  6. Only red will cause a beep because only it is connected.

    1. The orange wire is on a separate rail that is not connected to anything. The short light blue wire makes the connection from rail (where red is connected) to column.

      Image 48


  • 11th January, 2018: Minor updates and added links to missing parts and auto-ranging multimeter
  • 6th January, 2018: First publication


This article, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)

Written By
Software Developer (Senior) RADDev Publishing
United States United States
"Everything should be made as simple as possible, but not simpler."

Comments and Discussions

QuestionReally enjoyed this. Well thought out. Kept interest up even in easy bits - Big Thank You ! Pin
Member 141718658-Mar-19 6:12
Member 141718658-Mar-19 6:12 
AnswerRe: Really enjoyed this. Well thought out. Kept interest up even in easy bits - Big Thank You ! Pin
raddevus29-May-19 12:23
mvaraddevus29-May-19 12:23 
PraiseExcellent series. Pin
SteveHolle4-Mar-19 8:43
SteveHolle4-Mar-19 8:43 
GeneralRe: Excellent series. Pin
raddevus29-May-19 12:21
mvaraddevus29-May-19 12:21 
QuestionTypo? Pin
fatman4526-Jun-18 13:55
professionalfatman4526-Jun-18 13:55 
AnswerRe: Typo? Pin
raddevus16-Jan-19 13:57
mvaraddevus16-Jan-19 13:57 
GeneralMy vote of 5 Pin
Richard MacCutchan23-Jun-18 2:08
mveRichard MacCutchan23-Jun-18 2:08 
GeneralMy vote of 5 Pin
stefano_v17-Jan-18 21:49
stefano_v17-Jan-18 21:49 
GeneralRe: My vote of 5 Pin
raddevus18-Jan-18 3:10
mvaraddevus18-Jan-18 3:10 
Generalnow I understand breadcombs Pin
Southmountain13-Jan-18 10:16
Southmountain13-Jan-18 10:16 
GeneralRe: now I understand breadcombs Pin
raddevus14-Jan-18 5:08
mvaraddevus14-Jan-18 5:08 
GeneralGetting parts from discarded electronics Pin
Kent K10-Jan-18 11:28
professionalKent K10-Jan-18 11:28 
GeneralRe: Getting parts from discarded electronics Pin
raddevus10-Jan-18 11:41
mvaraddevus10-Jan-18 11:41 
QuestionEngineers is rounding calculated values Pin
Juris Sirs8-Jan-18 21:25
professionalJuris Sirs8-Jan-18 21:25 
AnswerRe: Engineers is rounding calculated values Pin
raddevus9-Jan-18 3:08
mvaraddevus9-Jan-18 3:08 
QuestionThis reminds me of... Pin
CodeWraith8-Jan-18 1:08
CodeWraith8-Jan-18 1:08 
AnswerRe: This reminds me of... Pin
Jochen Arndt8-Jan-18 2:04
professionalJochen Arndt8-Jan-18 2:04 
GeneralRe: This reminds me of... Pin
CodeWraith8-Jan-18 2:14
CodeWraith8-Jan-18 2:14 
GeneralRe: This reminds me of... Pin
Jochen Arndt8-Jan-18 2:40
professionalJochen Arndt8-Jan-18 2:40 
AnswerRe: This reminds me of... Pin
raddevus8-Jan-18 2:58
mvaraddevus8-Jan-18 2:58 
GeneralRe: This reminds me of... Pin
CodeWraith8-Jan-18 5:43
CodeWraith8-Jan-18 5:43 
AnswerRe: This reminds me of... Pin
glennPattonWork38-Jan-18 8:09
professionalglennPattonWork38-Jan-18 8:09 
AnswerRe: This reminds me of... Pin
Besinger19-Jan-18 3:58
Besinger19-Jan-18 3:58 
GeneralRe: This reminds me of... Pin
raddevus19-Jan-18 4:24
mvaraddevus19-Jan-18 4:24 
QuestionImage References Pin
Nelek7-Jan-18 9:22
protectorNelek7-Jan-18 9:22 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.