### Electronics Design

#### Lecture

The basic workflow of the electronics design process consists of:
• Creating a schematic design of the circuit
• Simulate the circuit's behaviour
• Design the layout of the pcb, which means the placement of the components and the routing of the copper traces to connect the components. The size and shape of the board will mainly be determined by the layout of the components and the copper traces.
We were introduced to schematic design and the functions of several fundamental electronic components like resistors, capacitors and leds among others. To be able to read a schematic and the components used, you need to know the symbols which represent them in a schematic design, see a few below:

Check an extensive overview of electronic components and see how to read a schematic on this Sparkfun page. A lot of interesting and helpful information regarding electronics can be found on their site.

We were also introduced to several circuit/schematic- and layout editor programs. Freeware and beginner level, as well as commercial and high end level ones we most likely will not use.
• Community support: Many people use it so helpful information and component libraries are available.
• Easy to use: The learning curve isn't too steap
• Capability/license: For our assignment the capabilities like possible number of layers and components, the size of the board etc. of the freeware version of Eagle are sufficient. To use commercial software you often need a license or it might require you to pay for a license which upgrades it to the capability level you need.
• Portability: From Eagle you can export your designs to several formats, like a .png raster image which in our case is used when the board is milled with a milling machine which most Fablabs have.

#### Lesson

In the lesson our local instructor Emma gave us, we were taken through the fundamentals of electronics in more detail. Below are some important definitions:

• Circuit a structure that directs and controls electric currents, presumably to perform some useful function. The very name "circuit" implies that the structure is closed, something like a loop
• Schematic symbolic visual representation of a circuit.
• Board Layout where components and traces are placed on the board.
• Current (I) unit of measure is Amperes (Amps), Symbol is I . Current is the flow of electricity (electrons)
• Voltage (V) unit of measure is Volts, Symbol is V or U, old symbol was E. Voltage is the "pressure" of electricity, or "electromotive force" (hence the old term E)
• Battery a power supply, Unit of measure is Volts. Charges can be separated by several means to produce a voltage. A battery uses a chemical reaction to produce energy and separate opposite sign charges onto its two terminals
• Power (P) unit of measure is Watt (W). The rate at which electrical energy is converted to another form, such as motion, heat, or an electromagnetic field.
• Resistor a passive electrical component that implements electrical resistance in a circuit. Resistors reduce current flow and act to lower voltage levels within circuits
• Resistance (R) unit of measure is Ohm. Resistance is the opposition that a substance offers to the flow of electric current.
• Ground (GND) a direct electrical connection to the earth or a connection to a particular point in an electrical or electronic circuit, usually connected to the 'negative' side of a power source. It provides a reference voltage level (called zero potential or ground potential
The sources for these definitions are: here and here.

All electronic components have specific properties and limitations. These are described in datasheets, see this example of a datasheet from the Atmel ATtiny44 8-bit microcontroller we will be using for this weeks asssignment. Most important information for us is the Operating Voltage (5V for this one) and the Pin Descriptions. Another example is a resistor; in its data sheet will be specified how much power (Watts) it can support (and many more specifics ofcourse).

Values of Current, Voltage, Resistance and Power in a circuit
To be able to calculate the values of the quantities Current, Voltage, Resistance and Power in a circuit you need to understand the relations between them.
• Ohm's law Voltage(V) = Resistance(R)*Current(I) or V=RI. So also: I=V/R and R=V/I.
• Power(P)=Voltage(V)*Current(I) so also I=P/V or V=P/I. And if V=R*I then P can also be equalled with P=(R*I)*I or P=R(I^2).
• Kirchoff's Law the sum of all currents flowing into and out of a node/junction is zero
• Connected in parallel vs. in series: In a parallel circuit, all components are connected across each other, forming exactly two sets of electrically common points.
In a series circuit, all components are connected end-to-end, forming a single path for electrons to flow.
Also see this Sparkfun's page. They use a water tank and water flowing as analogy for explaining the basics of voltage, current, resistance and Ohm's Law.

#### Assignment

• Redesign/redraw the echo hello-world board and add (at least) a button and LED (with current-limiting resistor)
• Check the design rules, and make the board
• For extra credit: simulate its operation

Redesign/redraw the echo hello-world board
and add (at least) a button and LED (with current-limiting resistor)

I installed Eagle and used this tutorial to learn how to redraw the schematic of the hello-world board's circuit. The tutorial provides the below picture of the schematic to do this. Aside from that tutorial, I needed extra information like this and watched several tutorial videos like this one about how to use Eagle.
It comes down to adding all needed components to the schematic view from a library. Note that you need to select the correct package size! This is the form factor for the components you are using. We use the (imperial)1206 package size. For example, a metric 2520 component is 2.5 mm by 2.0 mm which corresponds roughly to 0.10 inches by 0.08 inches. The imperial package size for this then is 1008.
The next step is creating the connections between the components in the schematic view. One way is to draw visible wire lines using the Net tool (not the Wire tool!) between the nets (nets are the green lines attached to the pins of the components) to create the connections, but because this can become quite messy (many lines crossing each other) you can also give the same name to the nets that need to be connected to each other. That's why most net names are appearing at least twice in the schematic below. Net names which appear only once are component parts/pins which are not connected to anything, meaning they are not being used in the schematic.

Below you can see a screenshot of Eagle where I am in the process of drawing the schematic, at the point where I still need to add the led and the button and the net names/connections:

In Eagle you can check the consistency of the circuit you have drawn with the ERC function (electrical rule check). It checks if there are any open pins or other non-logical connections. ERC generates messages which can help you with correcting the errors. Àn error message example is "missing junction" when you did not add a junction dot where two wires intersect/connect. When you click the message it points out the component with the issue in the schematic.

When I finished drawing the schematic it looked like this:
hello world board schematic source file - Eagle

Now I opened the board layout file. Note: When you open a new (empty) board layout in Eagle while you are drawing or have drawn a schematic, Eagle asks if you want to create a link between the schematic file and the board layout file. Obviously you want this because you are drawing the circuit on which you base your board layout.

When you start working on the layout, all components are initially placed on top of each other in the bottom left corner. On the left you can see the board layout after I dragged the components away from each other to get a clear view on them. The yellow lines are called airwires and show the connections between the components. The airwires should be replaced by routes of copper traces in between and underneath the components. On the right you see the board layout after I have completed placing all components and creating all necessary routes (red lines) using the auto route function and also manually adjusting routes afterwards to move everything closer to each other.
To check if you have routed all airwires you use the ratsnest command. If you’ve not yet replaced all airlines with routes, it will show you where the remaining routed everything, it should say “Ratsnest: Nothing to do!”. hello world board layout source file - Eagle

Check the design rules, and make the board
In Eagle you can use DRC to check the board layout against set design rules. As ERC, DRC also generates error messages which can help you with correcting the errors. A few common errors are:
• Clearance: A trace is too close to either another trace.
• Overlap: Two different signal traces are overlapping each other. This will create a short if it’s not fixed.
• Dimension: A trace, pad, or via is intersecting with (or too close to) a dimension line. If this isn’t fixed that part of the board will just be cut off because the dimension line is the outer edge of the board.
DRC actually came up with a Width error for every(!) trace line in my layout, but that was because I used a small width which was below the minimum value for trace line width in the design rules.
The Show command lets you follow routes of components connected by trace lines across the circuit to see if you created the routes like you wanted. I used this command quite often and actually experienced several times where it seemed that components were connected visually, but when I checked using the show command, in fact they weren't. I then had to redraw the route and connect it again properly to fix this.

Following the tutorial I exported the layout to a .png file, but I couldn't open it in Gimp! My computer's memory filled up completely and Gimp did not respond anymore. I still don't know why, but it was fixed when I exported again but now set the Area setting to 'Window' instead of 'Full'. After editing them in Gimp I had my two files to make the traces and cut out the board on the Modela milling machine!
For making the board I followed the same steps as shown in week 4: Electronics Production
Here are some photo's of the process and the completed hello world board (that's not a typo ;-):