A primer on electronics and circuits

Electricity is everywhere: it powers all our stuff, it can really save lives and make our daily business much easier. You probably already know a few things about electricity: it usually comes to the power outlets in our home from a network that distributes it around the city; it can come in 110/115V or 220V. It’s powerful and it can be really dangerous. That’s pretty much all I knew about electricity when I made my first thingee with electronics… Ah, I also knew that it has something to do with electrons. What else is important to know?

In very basic terms, electricity is the flow of electrons. In certain ways, electricity looks similar to water: electrons will always try to “run” towards the path with least resistance, just like water does. You probably learned something about conductivity at school, some long time ago… Yeah, every thing, every object, and even living beings, they all have different levels of conductivity and resistance. When you stand shoeless on the floor, you are creating a path to the ground in which electricity could potentially flow. That’s why we are told to use shoes when using things that have a shocking hazard. If we don’t, our body can pose as a conductive path, closing a circuit to the ground (GND). But what is a circuit?

Circuits

A circuit is basically a path in which electricity can flow. Circuits require a power source and something to conduct the electric current. Components are connected to the circuit to harvest the electric current and do things, such as light up, buzz, collect information about the environment… You name it.

A tool like Fritzing can be used to design circuits and make them easier to share. Like this:

Components

Components are the building blocks of electronics. LEDs, resitors, diodes, buttons, capacitors… when put together the right way, they can create awesome stuff. Once you get the hang of one or two components, you’ll see that things follow a certain pattern and you will be able to use pretty much any component, given it’s well documented (most are). Prototyping always requires a lot of research, but if you are a coder you are used to that. Using a new component is like using a new library: first you’ll research to see if it does what you think it does, and how complicated it is to get things up and running: if there are dependencies, what sort of input it expects and what is the output produced. From there, you will see if you need any other libraries (components) and how you connect it to the rest of the project.

Most components will have at least two “legs”, one for the power source and the other one for GND (ground). Some components don’t care which “leg” is connected to power or gnd, which means current can flow thought it in any direction. Other components, like diodes and LEDs (which are in fact light emitting diodes), will require that current flows in a specific direction. I’m this case you’ll have to know which leg is which – this information will be available on the component documentation. An LED will usually have a shorter leg to identify which one is the GND.

Recommended further reading from Sparkfun:

 

Next: Working with a breadboard