Training Guide

User Manual:

Open the PDF directly: View PDF PDF.
Page Count: 29

Scroll down to view the document on your mobile browser.
0.1. INTRODUCTION TO HARDWARE 10.1 Introduction to hardwareThe goal of this guide is to help you in learning embedded hardware, both the design and the code. In orderto stay easy and accessible enough, the guide will use the Arduino framework and the Raspberry Pi hardware.This guide will be divided in 3 major sections. The introduction will try to provide the basis required, interms of electronics and programming in order to grow by yourself after that. While it can be overwhelmingat first, it is not harder than learning to sew or cook. The first ”meal” might be burned or taste weird, butpractices make perfect. One advantage that learning embedded have over learning to cook is that, in mostcases, you can modify a faulty program or connection and fix the issue, you do not have to redo the wholerecipe. Once you go through all the exercises in this guide, you should have the needed knowledge to turnyour own idea into custom electronics. After all, once you know how to make a pie, you only need to changethe fillings to create something entirely different using the same technique. Once you understand the coreprinciples, we will have some exercises on the Arduino platform and then some on the Raspberry Pi. Thegoal of the exercises is to provide you the building block required to continue on your own.Physics 101What is needed to understand in order to move forward is basic electricity. The best resource I could findin order to teach this knowledge is from the subreddit /r/explainlikeimfive, where people ask questions andothers try to answer in a way a five years old would understand. While I’m not saying you have the mentalpower of a five years old, if it is aimed at them, it should be easy enough to understand. I’ve simplified it towhat is useful to us, if you are interested, the full reading is a good starter on electricity and how it makesyour TV work.When doing simple electronics, you can think of electricity in a way similar to how you thinkof water in pipes. Metals have ”empty spaces” in the electron shells of their atoms that allowelectrons to travel through in a similar way.TERMS:A power source, such as a battery, basically contains two tanks, one on top of the other. Thetop tank is full, so there is a ”pressure” encouraging the electricity to flow into the bottom tank,if you choose to connect them. You can arrange multiple batteries several ways too - you canstack two full tanks on top and two empty tanks on bottom (this is called series) in order to geta higher pressure difference between the tanks. You can also just set them side-by-side; you’llhave the same pressure difference, but it will take twice as long to drain (if you use the same sizepipe).[...]Voltage is like water pressure. When electricity is flowing, high voltages will cause it to flowfaster. Very, very high voltages can even ”rupture the pipe”, causing sparks.Resistance is a measurement of how difficult the wire (”pipe”) makes it for the electricity to flowthrough. You can think of a high-resistance wire (or a resistor) as a very small pipe. Also, if youwant to get a lot of electricity to go through a high-resistance wire, you will need a lot of voltage(or ”pressure”).Current (amps) is a measurement of how quickly the electricity is flowing. High voltage canincrease the flow, but so can lower resistance (bigger pipes).A circuit is any system where the full tank and empty tank are connected. If they’re connectedwith a very large pipe, this is called a short circuit: the pressure will rapidly equalize, and verylarge number of electrons will flow through that pipe quickly. All the pressure (read: energy)from the pressurized tank will release all at once, making a whole lot of heat. Maybe even a bang.[...]Transistors are like valves. A small amount of electricity applied to the gate will allow largeamounts to flow through the input and output terminals.[...]
2This simplified explanation works if you’re an electronics engineer... even though it’s not perfectlyaccurate. Physicists often say that lay-people tend to envision particle physics like billiard ballson a pool table, even though that analogy breaks down when things start getting very small.Here’s an example of how strange electrons can be: The Double Slit Experiment.[...]TL;DR: electricity works like water moving around a sealed system. It seems to have inertia,flow, pressure, pipe resistance, etc. Energy comes from the pressure and flow of electrons, not theelectrons themselves.1Now that we understand the electric circuit, there are some particularities that need to be kept in mindevery time we work on electronics. Some are repeated but are good to emphasize.•Each circuit must have a connection to the power, either 3.3v or 5v. Think of it as the water line of awashing machine.•Each circuit must have a connection to the ground. This is the water out line, that empty the washingmachine.•You must always make sure you are not charged, as static discharge can break the fragile boards. It isrecommended not to do electronics in a room full of carpet.•You must always include a resistance in a circuit. While it might work without, it will increase the wearon whatever is connected. In most cases, it will result in the component burning(not in a dramatic ballof flames, sorry)•When the component you try to connect has 2 connections, the power source is the pin you want tocontrol it with. As an example a simple light is controller by its power input, if i apply power, thelights turn on, and vice-versa. If it has 3 connections, the power pin is used and the third connectionis attached to the control pin you want to use. With most components, you can search ”componentname or serial number”+”pinout or connection” and you should find which connection is what. Byconvention, black is the ground, red, or white, is power and a colour(yellow and green, usually) iscontrol. You should still verify if this is the case, but if you cannot find anything, it is your best bet.If you want more information on the inner working of a computer chip, the part that store and execute thecode, internet resources like Wikipedia can be a great place to start.SolderingIf you decide to continue on the path of electronics, learning to solder if a must. In our case though, wewill not focus on this as we are using solderless board and breadboard to complete our circuits without theneed to solder. Just know that there are many good tutorials on the internet and that it is not hard, it justrequires practice and your first time might not work, or it might be ugly with 5 times too much tin. No onepaint a perfect portrait on the first try in 5 minutes. Make sure your first try is not on something you cannotlive without.ProgrammingThis is the second big chunk that overwhelms people beginning in electronics. For developers, i will say thatthe Arduino framework is using a c++ like language and raspberry pi run complete OSes and can use anylanguage out there. For the rest of you, let’s slowly open the Pandora box that is programing there are twothings I would like to mention before we go further. The first is that I am not entirely wrong when I callthis a Pandora box: you will discover new way of hating the world, when you find out you were missing asemicolon, you will pull your hairs off after hours of searching the web for a compilation error, but in the end,there is not a lot of joy that competes with your design and your project working, as intended, ”first try.”The second is that, while you can find the solution to most, if not all, exercises on the internet, on sites like1user KippTheKidd @ Explain like I’m five: how electricity really works

Navigation menu