Electronics

You are going to build IoT projects Edison. However, the board is only a part of the projects, it does all the computing, but you also need I/O devices that you will connect to them. The devices are mainly sensors, LEDs and LCDs. In order to correctly connect the peripherals, you need to be acquainted to basic electronics notions, otherwise, you risk to burn the I/O devices and even the boards.

Ohm's Law

The Ohm's law states that in a circuit the current (I) is directly proportional to the applied voltage (U) and inversely proportional to the resistance (R) of the circuit.
I=U/R

Kirchhoff's Circuit Laws

Before you state the two laws, you need to understand the following notions:

  • junction/node - the place where at least three conducting branches meet
  • loop - a closed path, including at least two nodes

Kirchhoff's First Law

Kirchhoff's First Law states that in a node, the sum of the currents is 0. Please keep in mind that currents have directions. Currents incoming have negative values, while currents outgoing have positive values.

Kirchhoff's Second Law

Kirchhoff's Second Law states that the sum of the voltage in a circuit loop is equal to the power source voltage. Example:

You have a 3V source and three resistors of different resistance. The sum of voltage drops on each of them is equal to the source voltage. R1 + R2 + R3 = VCC1 ⇒ 0.25v + 1.25v + 1.5v = 3v

LED

This chapter explains how to correctly connect an LED to a board. First of all, you need to know what a diode is. A diode is an electronic component that has a positive and a negative side and it basically allows the current to flow only in one direction, from positive to negative. The LED is also a diode. When current is flowing through the LED, it lights up. So in order to light up an LED you need to put the high voltage at the anode and the low voltage at the cathode.\par

Schematics

Taking into account the theory stated previously, you would build a circuit like the one in figure \ref{fig:led_circuit-short} to light up an LED.

You must take into account that the power source depicted will be replaced in the projects you are going to build with the Edison.

There is only one tiny problem with the schematics in the figure it is a short circuit. That means there is no resistance to limit the current because the diode does not have any resistance at all. It just allows the current to flow. That can cause big problems (you can damage your board, for example). To fix this, you need a resistor to limit the current flow.

Button

This chapter explains how to correctly connect a button to a board. A button, also called a switch, is an electric component that can break an electrical circuit by interrupting the current. When used in schematics, there are multiple possible symbols to depict it. Also, the figure depicts an example of circuit that uses a switch.

When the button is pressed, it acts like a wire and it will let the current flow through the circuit. If the button is not pressed, the circuit is interrupted. When a button is connected to a board, you can tell if the button was pressed by looking at the pin's value. Let's see how you can connect a button to the Edison board. The first possibility would be the one in the next figure, but it is wrong.

Why is it wrong? If the button is pressed, everything works fine. The value of pin would be HIGH and you can say “Yes, the button is definitely pressed”. But what happens when the button is off? It is important to know that a logic level can be: LOW (or 0), HIGH (or 1) and also UNKNOWN (or high impedance). When the button is not pressed you cannot say for sure what logical level the pin has: it could be 0 as well as 1 because the wire is not connected neither to Ground nor to a power supply. Let's give it another try. This figure is also incorrect. When the switch is off the button's pin value is HIGH. The big problem appears when the button is pressed. It will create a short circuit: the ground is directly connected to VCC which is very bad because you do not have any resistor and the electric current is not limited. The correct way to connect a button to a board is presented in the next figure.

This time you will not have a short circuit because if the button is pressed there is the R resistor. The R resistor is called a pull up resistor and the whole system is called a voltage divider. If the button is pressed our pin's value will be LOW.

You can also connect the resistor to the Ground. Now you have a pull-down resistor and the pin's value will be HIGH when the button is pressed and low otherwise.

Safety Instructions

Whenever you connect anything to your board you must assure that the it is not powered up. Otherwise you might accidentally create a short-circuit and burn the board. Only after you assured that everything is correctly connected, you may safely power it up.

iotcluj/res/electronics.txt · Last modified: 2016/07/12 12:12 (external edit)
CC Attribution-Share Alike 3.0 Unported
www.chimeric.de Valid CSS Driven by DokuWiki do yourself a favour and use a real browser - get firefox!! Recent changes RSS feed Valid XHTML 1.0