# How to Get Started with Circuits and Electronics

As you get started building projects with electronic components like Arduino, you can make some progress without knowing much about electricity and circuits. By following online guides you can attach sensors, displays and motors to an Arduino or other microcontroller, without fully understanding what it is you’re actually doing. However, if you want to get past the beginner stage, and start making exciting, custom projects, you’re going to have to start to learn the basics of electrical engineering.

If you’ve ever encountered online discussions about circuitry, the prospect of joining in might seem pretty daunting—there’s a lot of jargon, a lot of arcane symbols, and a lot of math. And, truthfully, it’s a complex topic, with a lot to learn. Fortunately, you don’t have to jump into the deep end all at once. In this starter guide, I’m going to cover the most basic principles of circuit-building, with just enough detail to get you ready to build and understand some simple circuits of your own.

First, I’m going to cover a few topics that you have to understand, then I’ll describe how to use these concepts to build a simple circuit with Arduino.

#### What is a Circuit?

There’s a lot of very interesting science about how, exactly, electricity works, but for a practical understanding of simple electrical circuits, you don’t need to get into the really low-level stuff. The thing that you need to understand is simply that electrical charge flows through conductors, like wires, and through all sorts of electrical components, having various effects on those components as they flow through them. A simple electrical component is a light bulb—the effect of an electrical charge flowing through a light bulb is that the bulb lights up. If your various wire and components are hooked up so that they form a loop—so that the electrical current can keep flowing around and around—you’ve created a circuit.

Series vs. Parallel Circuits

A circuit can be as simple as a wire from one side of a battery to a lightbulb, and then back to the other side of a battery. You can, of course, add multiple lightbulbs or other components to the circuit. If you add the lights so they look like this:

You’ve created a serial circuit. In a serial circuit, the current passes through each component in sequence. If you build the circuit so that current can take multiple paths through the circuit, as below, you’ve built a parallel circuit. It won’t be clear right away, but the difference between parallel and series construction comes up constantly in circuit building, so it’s important to remember the two different shapes. Series components are all in a row, parallel components are side-by-side.

Analog and Binary Circuits

If you’re working with a microcontroller like Arduino, you’ll find yourself dealing extensively with binary and analog circuits. These are circuits which use wires to pass data, instead of just to power components. Binary or digital circuits transfer binary data (1s and 0s, like your computer), while analog circuits transfer analog data (like a record player). The Arduino Uno board, for example, includes 14 digital pins which you’ll connect to sensors, actuators, and other components that send or receive binary data across a wire. It also includes 6 analog pins, which are used when adding analog sensors to your project.

The main thing you need to know about binary vs analog circuits is simply that there’s a difference, and that when you pick you out components (like sensors) for your projects, you should check whether they communicate with the Arduino using digital or analog pins.

PHOTO CREDIT: FLICKR USER BERALDOLEAL VIA CREATIVE COMMONS

#### The Core Concepts

Now that I’ve talked about what a circuit is, I’m going to discuss how circuits work. I should reiterate that what I’m discussing here barely scratches the surface of electrical engineering and circuitry—this is a topic that people routinely get PhDs in, after all. That said, the concepts I’m discussing here are the foundation. If you understand these, you’ll have a great platform to tackle the more advanced topics in electrical engineering.

The Hydraulic Analogy

One really helpful way to approach the basic concepts of electricity is with what’s called the hydraulic analogy. At a low level, electricity in a circuit behaves a lot like a fluid, which means we can discuss the concepts by comparing them to a system of water flowing through pipes—a concept that most people have a more intuitive understanding of than electricity.

The basic premise of the hydraulic analogy is that a circuit is like a network of pipes totally full of water.

The basic premise of the hydraulic analogy is that a circuit is like a network of pipes totally full of water. Each of the pipes is capped off on any end that isn’t connected to another pipe, so that water can flow around in the circuit, but can never fall out of it. Adding different electrical components to a circuit are equivalent to adding different hardware to the system of pipes. I’ll describe each concept and component’s counterpart as I go.

Current

I’ve already mentioned current a couple of times in defining a circuit, but it’s also important to understand as a basic concept. Current is electrical charge flowing through a wire. Most electrical components require current flowing through them to actually do anything. Too much or too little current can destroy a component or render it inert, so much of the effort of circuit building is making sure that the right amount of current is flowing through each spot of a circuit.

In the hydraulic analogy, current is, well, current—the rate at which water flows through the pipe.

The SI unit for current is the Ampere (symbol A, frequently just called an “amp”), though in any mathematical formulas, current is abbreviated as “I”.

Voltage

Voltage, a term people are more likely to be familiar with than current, is difference in electrical potential between two points in a circuit. To explain what I mean by electrical potential, it’s helpful to go back to the hydraulic analogy, and talk about a phenomenon familiar to more people: water pressure.

If you imagine a circuit a being made of pipes full of water, voltage is the difference in water pressure between any two points.

If you imagine a circuit a being made of pipes full of water, voltage is the difference in water pressure between any two points. Intuitively we understand that in a system of pipes, if water pressure is higher at one point than at another, and there’s an available pathway between those two points, water will flow from the high pressure point to the low pressure point.

To further the analogy, the hydraulic equivalent of a AA battery is a pump which maintains a specified difference in water pressure. Just like such a pump would cause water to flow through pipes connected to its two ends, a battery will cause electrical current to flow through a circuit if a loop is formed connecting its two terminals.

Voltage is measured in Volts. It’s always the potential difference between two points, but people will frequently describe the voltage at a single point in the circuit. When you hear that, the second point is implicitly the ground, or the part of a circuit with the lowest electrical potential.

Resistance

The final concept necessary to understand even the simplest circuits is resistance, which is the amount that any electrical component resists or opposes the flow of electrical current. Every electrical component has resistance, including wire. A resistor is a component designed to add a specific amount of resistance to the system, and is one of the most common components you’ll deal with.

Photo credit: Wikimedia Commons

In the hydraulic analogy, resistance is the way pipes and other objects in a water circuit resist the flow of water through friction. The analogy’s version of a resistor is a place where the pipe is pinched to a narrower diameter, increasing the friction on the water that flows through.

As you can imagine from the analogy, higher friction causes less current to flow through the pipe—a relationship I’ll talk about more in the next section.

#### Putting It All Together

Now that I’ve covered the simple concepts you need to know (series and parallel circuits, current voltage and resistance), it’s time to put everything together, by talking about a simple example circuit. Let’s say, for example, that you want to attach a LED indicator light to your Arduino project. You’re not building a data circuit, so you‘re going to connect the wire to the Arduino’s power source.

The Arduino Uno’s operating voltage is 5 Volts, which means (among other things), that the board includes an output pin and any wire connected to the output pin will have a voltage of 5 volts. Any circuit that starts out the output pin and ends out the ground will have a total voltage drop of 5 volts.

So how do you know how much current will flow through our LED if we attach it to the board’s 5 volt source?

As we discussed before, there’s a relationship between voltage, current and resistance. This relationship is called Ohm’s Law, and it’s the only math I’m going to include in this article. Fortunately, it’s pretty straightforward:

V = I / R

Where V is voltage, I is current, and R is resistance. In other words, if you keep voltage consistent (the situation you’re most likely to encounter in a basic circuit), then by increasing resistance, you decrease current, and vice versa.

So, hypothetically (please do not actually do this), if you just plugged a wire directly from the 5V pin to the ground pin, you would have a situation where voltage = 5 and resistance is close to 0 (not quite zero, because wires and the Arduino circuitry do have some minimal resistance). The equation above indicates that as resistance approaches zero, and voltage remains constant, current approaches infinity. This situation is called a short circuit, and tends to cause things to melt, catch fire, or explode. If you’ve ever connected two ends of a battery with a wire, for instance, you’ve probably noticed that the whole circuit almost immediately gets painfully hot, and the battery will quickly drain and may even burst.

Diagram for simple Arduino clock.

On the packaging or spec sheet for any LED that you buy, you’ll see two important numbers: the forward voltage and the forward current.

So you don’t want a short circuit! Instead, your circuit needs a load, or a component that actually draws power. The LED that we want to attach to our project will be the load. On the packaging or spec sheet for any LED that you buy, you’ll see two important numbers: the forward voltage and the forward current. The forward current is the amount of current that should be passing through the LED. For most LEDs, the recommended current is 20 mA (1mA or milliamp is 1/1000 amps), though you can safely raise the current to 30 mA or so in order to get a brighter glow. Unfortunately, if you just plug your LED straight into the 5V Arduino circuit, you’ll get much more than 30 mA, and your poor LED will get fried. In order to lower the current, we have to use the relationship described above.

In order to lower the current, you have to increase resistance, so let’s add a resistor in series with the LED. These two elements are in series, so we know that the same amount of current has to flow through both of them. That means we can figure out a safe baseline by plugging the two figures we already know (the 20mA current for the LED and the 5V voltage of the circuit) into Ohm’s law, we get:

V = I / R

R = V / I

R = 5V / .02A

R = 250 Ohms

So we know that if we put a 250 Ohm resistor into the circuit, current can’t be any higher than 20 mA, and our LED will be safe. However, that resistor won’t be ideal for our circuit. With that calculation, we’re assuming the whole 5 volt drop occurs across the resistor. In truth, some of the voltage drop occurs across the LED, and the packaging tells us exactly how much—that’s the “forward voltage” you see in the spec sheet. In our example case, it’s 1.8V. So, we can alter our equation a little bit, to look at only the voltage drop across the resistor by subtracting the voltage drop across the LED. It would look like this:

Resistance = Total source voltage – voltage drop of LED / current

R = 5V – 1.8 V / .02A

R = 160 Ohms

And that’s how we know that the ideal resistor for this circuit is 160 Ohms. Using a smaller resistor will give you more current (and hence a brighter LED), but will drain the battery faster. Use a resistor that’s too small, and your LED will burn out.

If you were able to follow along with the LED example, that means you’ve got a grasp on current, voltage, resistance and Ohm’s law. There’s way more to learn if you want to really get into circuit-building, but the concepts in this article will get you off to a great start. With some self-directed education, and the great resources online for learning about more advanced topics, you’ll be able to build anything you put your mind to.

SOURCE:http://www.tested.com/tech/459979-how-get-started-circuits-and-electronics/