WEEK 06

👉 Individual assignment:

  • Design a development board to interact and communicate with an embedded microcontroller

👉 Group assignment:



Electronics Background

📌
I have some experience with electronics, so I'm not completely new to this part of the course. I am not entirely new to this section of the course. Nonetheless, my expertise has been primarily gained through informal means. I have designed circuits for my company in the past, and my interest in electronics has always been strong. I enjoy exploring new electronic devices and technologies and have acquired knowledge and skills through various means such as exploring electronics communities, experimentation, and hands-on experience.

Electronics basics

Electronics components are the basic building blocks of all electronic devices. They are the tiny, intricate pieces that work together to create complex circuits, allowing devices to perform the functions they were designed for. There are countless types of electronics components, each with its own unique function and role in the world of electronics.

Voltage ? also known as electric potential difference, is the force that drives electric current through a circuit. It is measured in volts (V) and represents the amount of energy that a source, such as a battery or power supply, is capable of supplying to the circuit.

Current ? is the flow of electric charge through a circuit, and it is measured in amperes (A). Current flows from a high voltage point in the circuit to a low voltage point, and the amount of current that flows is directly proportional to the voltage and inversely proportional to the resistance of the circuit.

Power ? is the rate at which work is done, or energy is transferred, and it is measured in watts (W). In an electrical circuit, power is the product of voltage and current, and it represents the amount of energy that is being used or supplied by the circuit. Power is important because it determines how quickly a circuit can do work or transfer energy.

Resistance ? is a crucial term in the study of electricity and electronics. It describes a substance or device's ability to resist the passage of an electric current through it. Resistance is denoted by the letter "R" and is measured in ohms ().

Ohm's Law ? 👈🏼

Ohm's law is a fundamental principle in the realm of electric circuits, which states that the current flowing through a circuit with a fixed resistance is directly proportional to the voltage applied. In simpler terms, an increase in voltage through a circuit with a constant resistance results in an increase in current flow, and a decrease in voltage leads to a decrease in current flow. This law can be expressed through a straightforward mathematical equation.

V = I × R

One effective way to internalize the relationship described by Ohm's law is to visualize it using a triangle, commonly known as the Ohm's Law Triangle. This triangle superimposes the three quantities of voltage, current, and resistance, thereby representing the position of each quantity within the Ohm's law formulas. This pictorial representation can aid in easier recall and memorization of the relationship between these three essential components of electrical circuits.

Rearranging the conventional Ohm's Law equation mentioned above yields various equivalent forms of the same equation, such as:

Kirchhoff's Law

Kirchhoff's laws are basic principles used to analyze electrical circuits. These laws describe how current and voltage behave in a circuit.

Here are some Video explanations and Theory about kirchof law .

Kirchhoff's laws (article) | Circuits | Khan Academy
Learn for free about math, art, computer programming, economics, physics, chemistry, biology, medicine, finance, history, and more. Khan Academy is a nonprofit with the mission of providing a free, world-class education for anyone, anywhere.
https://www.khanacademy.org/science/physics/circuits-topic/circuits-resistance/a/ee-kirchhoffs-laws
Kirchhoff’s Voltage Law (KVL) | Divider Circuits And Kirchhoff's Laws | Electronics Textbook
Read about Kirchhoff’s Voltage Law (KVL) (Divider Circuits And Kirchhoff's Laws) in our free Electronics Textbook
https://www.allaboutcircuits.com/textbook/direct-current/chpt-6/kirchhoffs-voltage-law-kvl/

Components

Integrated Circuits

We had already learned about IC’s in week 04

Other components that we will be using this week are Resistor , Capacitor , LEDs .

🎯
For a few years now, pighixxx, also known as Alberto Piganti, has been creating stunning works of circuit diagram art. Recently, he has published a book on Kickstarter which we had the pleasure of reviewing. With a refreshing beverage in hand, we delved into a binder filled with beautiful circuit diagrams, and it was truly an enjoyable experience. It's difficult to imagine anything better than that!

Follow The below link to access old books on abc connections from ( Alberto Piganti ).

https://aprendiendoarduino.files.wordpress.com/2020/05/abc-basic-connections.pdf

Electronics EDA software ? 🤔

Electronics EDA (Electronic Design Automation) software is a type of computer software that is used by engineers, designers, and hobbyists to design and simulate electronic circuits. EDA software tools are used to create schematic diagrams, printed circuit board (PCB) layouts, and perform circuit simulations.

Following are some of the EDA software's that

  • Fusion 360 Eagle Cad.
  • KiCad
  • OrCAD
  • EasyEDA
  • Altium designer ( paid )

I'm no stranger to Eagle CAD - I've used it extensively for all my designs. However, I wanted to switch things up and explore new possibilities, which is why I've decided to give KiCad a try. It's always exciting to venture out of your comfort zone and experiment with different tools, and I can't wait to see what KiCad has in store!

I'm no stranger to Eagle CAD - I've used it extensively for all my designs. However, I wanted to switch things up and explore new possibilities, which is why I've decided to give KiCad a try.

KiCAD

Download
A Cross Platform and Open Source Electronics Design Automation Suite
https://www.kicad.org/download/
To download Kicad follow this link

The interface of KiCad is generally considered to be user-friendly and easy to navigate, with a range of useful features that can help simplify the circuit design process.

To start a new project Click on File > New project > ( browse the directory )

After starting a new project one can see 3 Files created .

My project name is Tiny412

Tiny412.kicad_pcb - is where you create the boards from footprint.

Tiny412.kicad_sch - is where you create circuit from symbols .

Circuit Design on kicad

double click on the schematic files from project file window to open schematic editor

Schematic editor

I chose to go with Attiny412 as my microcontroller for the hallo board project.

http://ww1.microchip.com/downloads/en/DeviceDoc/40001911A.pdf
Microcontroller datasheet

The Tiny Core Library from spencekonde is a collection of software tools designed to support the ATtiny family of microcontrollers in the Arduino environment. Following link provides a detailed description of the same .

megaTinyCore/ATtiny_x12.md at master · SpenceKonde/megaTinyCore
Arduino core for the tinyAVR 0/1/2-series - this is any ATtiny with 2, 4, 6, or 7 in the 1's place, 0, 1, or 2 in the tens, and the flash size in the remaining digits. LIBRARY AUTHORS - Doe...
https://github.com/SpenceKonde/megaTinyCore/blob/master/megaavr/extras/ATtiny_x12.md
Pin mapping of ATtiny 412

Symbol selection

To select symbol Library press the below mentioned icon .

Symbol library - you can search for various component symbols by typing under the search bar in libraries .

After selecting the symbol the the following icon add symbols to schematic .

After adding symbol if you right click on the symbol you will get various options and tools to modify the symbol .

Just Like any CAD software you can drag the symbols around by clicking it with mouse and dragging.

My desired configuration for my Hallo board includes three connectors for UPDI, SERIAL, and I2C communication. Additionally, I would like to have a LED connected to pin PA1 and a push button connected to PA3.

So finally I Placed all the components on my Schematic .

To add separation lines and text click on place add Lines Add Text .

To add power and Ground symbols search for 5V (any power ) and GND .

In KiCAD, the wire tool is used to draw connections between the pins of components on a schematic. This tool allows you to create wires that represent the electrical connections between components in your circuit design.

Using the wire tool, you can specify the starting and ending points of a wire by clicking on the pins of the components you want to connect. You can also create junctions by clicking on a point where multiple wires intersect, allowing you to connect multiple wires together.

To select wire tool follow the right tool bar .

How to connect components using wire tool ?

1. Click on the first pin of the component you want to connect, then click on the second pin to create a wire between them.

Finally I finished wiring all the component's on my schematic .

⚠️
I discovered that certain components were not available in the fab inventory. As a solution, our instructor recommended that we install the KiCAD Fab library .The components that are available in the Fab library will also be accessible in the Fab inventory.

what is a Library ? 🤔

library is a collection of electronic components that can be used in a schematic or PCB design. A library typically contains component symbols, footprints, and other related information that describe the behavior and physical dimensions of each component.

Installing Fab Library on to Kicad.

follow the link to download fab library .

pub / libraries / electronics / KiCad · GitLab
Fab electronics component library for KiCad
https://gitlab.fabcloud.org/pub/libraries/electronics/kicad

Installation

Make sure you have at KiCad 6 or greater installed.
  1. Clone or download this repository. You may rename the directory to fab.
  1. Store it in a safe place such as ~/kicad/libraries or C:/kicad/libraries.
  1. Run KiCad or open a KiCad .pro file.
  1. Go to "Preferences / Manage Symbol Libraries" and add fab.kicad_sym as symbol library.
  1. Go to "Preferences / Manage Footprint Libraries" and add fab.pretty as footprint library.
    Library manager slection.
  1. Go to "Preferences / Configure Paths" and add variable named FAB that points to the installation directory of the fab library, such as ~/kicad/libraries/fab or C:/kicad/libraries/fab. This will enable the custom 3D shapes to be found. The 3D shapes project has just started and most of them have to be populated still.

If you just fan fab library and filter out every other libraries you cad do so by deselecting all the other libraries on library manager .

📌
To exclusively use the Fab library in KiCAD, you can deselect all other libraries in the Library Manager, leaving only the Fab library selected.

Annotation ?

Annotation in KiCAD is the process of automatically giving each component in a schematic or PCB layout a unique reference designator.

KiCAD adds a default reference designator to each component when you add it to a schematic or PCB layout, such as "U?" for an IC or "R?" for a resistor. When working with larger designs, these default designators' lack of a unique identifier for each component might lead to confusion and mistakes.

Click here to select the annotate tool
Press annotate

Electrical Rule check

In KiCAD, the Electrical Rule Check (ERC) is a tool that analyzes a schematic design to identify any potential electrical errors or rule violations.

After running ERC I found 82 warnings and 5 Errors 😢

⚠️
The errors that were flagged ‘power’ diapered after I added power flag .

Two errors were detected by the ERC, both of which were related to unconnected pins.

😲
I discovered that there is a feature in KiCAD that allows for unconnected pins.

More Warnings 😭

I was still left with 62 warnings . “symbol pin or wire end of grid” I couldn't find any resolutions to this warning so I decided to ignore these flags.

Footprint Assignment

A footprint assignment refers to the process of selecting a specific physical footprint for a component which is placed on the schematic .

When designing a PCB, it is important to select the correct footprint for each component to ensure that it fits properly on the board and is correctly aligned with other components. KiCad includes a library of footprints for commonly used components, but users can also create custom footprints if needed.

Click the icon to select footprint assignment tool

In foot print assignment tool you can choose a pre-existing footprint from the library or create a new one. To choose an existing footprint, click on the symbols which is highlighted in yellow ( un assigned symbol) and navigate to the library where the footprint is located using the search bar to find the footprint by name or by keyword.

To view the selected footprint right click on the foot print and select “view selected footprint”

To view various foot prints scroll through the selection while foot print viewer windows is on .

After assigning foot print now its time to create the board .

Board editor

Now its time to create the board from foot print .

Click on the _pcb file to open board editor

Click on the update pcb icon to load pcbs from schematic .

Click “update PCB” to load footprint to board

Placed all components on board

I decided to draw an octagon outline (edge) for my pcb

To draw lines, you can utilize the line-drawing tool located on the toolbar on the right-hand side of the screen.

before drawing select the layer as Edge.cut
⚠️
Always select edge cut in layers for pcb outlines

I arranged all the components inside the octagon . To write text select the Text tool from right tool bar.

📌
To rotate components in in any degree orientation double click on the component to open footprint properties change the orientation value to rotate.

Now its time for wire all the components .

Airwire ?

In KiCad, an airwire refers to a visual indication of a net connection that has not yet been routed between two pins or pads on a printed circuit board (PCB).

When you place a component on a PCB layout, KiCad automatically generates airwires that represent the net connections between the pins or pads of the component. These airwires appear as thin lines that connect the pins or pads and are color-coded to indicate the net name.

Once you begin routing the net, the airwires will disappear as the actual traces are created. However, if a net remains unrouted, the airwire will persist, indicating that the connection is still incomplete.

Blue lines running across components is called an airwire.

Airwires are useful for visualizing the connections between components and for keeping track of which nets still need to be routed. They can also be used to locate unrouted connections that may have been missed during manual routing.

wire lection

Track width : In KiCad, track width is the same as trace width. Both terms refer to the width of the copper conductive paths on a printed circuit board (PCB) that connect the various components on the board. The width of a track or trace affects the ability of the PCB to carry current and its resistance.

📌
note : 16 mills is recommended track width for PCB milling for 0.4mm tool size .

I chose 16 mills as track width

Press the edit-pre defined sizes to add more tracks .

Design rules

In KiCad, design rules are a set of parameters and constraints that define the physical and electrical properties of a printed circuit board (PCB) design. These rules help ensure that the design meets the minimum requirements for the manufacturing process and that the final PCB functions as intended.

The design rules in KiCad cover a wide range of parameters, including trace width and spacing, clearance between components, via size, drill size, and many other factors.

Click on the icon to open design rules

Give the necessary constraints - generally given with respect to the manufacturability or constraints of the manufacturing machine process .

Wiring

To connect two wire trace for two components select the pad from one component and follow the air wire to the pad of other component .

"I've just wrapped up my design, and while it took some effort, I'm thrilled with the outcome!” 😃

I had two errors for my push button for unconnected pins . I chose to ignore it since physically the pins were connected externally inside the button.

⚠️
Always Add texts on silkscreen layer ! IF YOU ARE GOING FOR PCB MANUFACTURING

3D view

In KiCad, 3D view is a feature that allows you to generate a three-dimensional representation of your printed circuit board (PCB) design. This feature uses data from the board layout and component models to create a realistic 3D view of the PCB, including the placement and orientation of all the components, and the traces and vias that connect them.

To view 3D click on view and select 3d viewer .

Fusion 360 and Eagle Cad

I used to work on eaglecad for most of my EDA designs . Now Autodesk has integrated Eagle CAD into Fusion 360, allowing users to design their printed circuit boards (PCBs) directly in Fusion 360 and import them into Eagle CAD for layout and manufacturing. This integration makes it easier for users to move between the two tools and provides a seamless design experience. Additionally, Fusion 360's 3D modeling capabilities can be used to create enclosures and other mechanical components for use with Eagle CAD-designed PCBs.

To Open new electronic design click on files .

To a new schematic click on the following icon .

Schematic editor opens

basic nomenclature

To open library manager click on the following icon

Basic library that i like on eagle cad.

Adafruit library - Adafruit EagleCAD library is a collection of electronic component symbols and footprints designed for use with the EagleCAD software. The library is developed and maintained by Adafruit Industries, a popular manufacturer of open-source electronic components and kits.

SparkFun EagleCAD library is a collection of electronic component symbols and footprints designed for use with the EagleCAD software. SparkFun is an electronics manufacturer that specializes in creating open-source hardware and software, and their EagleCAD library is one of their most popular offerings.

follow the link to install both libraries

Installing Sparkfun and Adafruit Libraries | EAGLE | Blog
Learn how to install and use your new Sparkfun and Adafruit libraries in Autodesk EAGLE.
https://www.autodesk.com/products/fusion-360/blog/library-basics-install-use-sparkfun-adafruit-libraries-autodesk-eagle/

Use the search button to find libraries .

To turn on a library toggle the switch which turn blue .
⚠️
Note : If you are unable to locate a particular component in the library manager, you may want to try searching for it in Autodesk libraries. Once you have found the relevant library containing the component, you can add it to your Fusion project.

I wanted to place PCF 8574 but I count find it on fusion .

I discovered that the Micro-Philips library contains that component, and subsequently added the library to my Fusion project.

To add a component Click and drag the component onto the schematic editor window. The component should appear as a symbol on the schematic.

If the component does not appear to be the correct size or orientation, you may need to rotate or resize it. To do this, select the component and use the "Rotate" or "Scale" tool in the toolbar.

🤗
About the design - PCF8574 is an 8-bit I/O expander that can be controlled by a microcontroller or other digital logic device. Each of the 8 output pins on the PCF8574 can be used to drive an LED, and the microcontroller can send data to the PCF8574 to turn the LEDs on and off. I wanted to interface the tiny hallo board designed on kicad to PCF so that I could control leds over i2c communication protocol .

Finally I completed the design

To move on to board design press the bellow icon under switch .

Auto routing

To select auto routing take auto route from quick route menu .and click start

Autorouting in Fusion 360 is a feature that automatically generates a PCB trace layout based on a schematic design. It is a tool that simplifies the process of designing a printed circuit board (PCB) by automating the routing of electrical connections between components.

When autorouting is enabled, the software automatically generates the routing for all the connections in the schematic, based on a set of routing rules defined by the user. The routing rules define the width of the traces, the spacing between them, and other parameters that affect the electrical performance of the PCB.

Autorouting can save time and reduce errors by automating the tedious process of manually routing each connection on the PCB. However, the quality of the resulting layout can vary based on the complexity of the schematic and the specific routing rules used. In some cases, manual adjustment of the routing may still be necessary to achieve optimal performance.

Resources and Downloads 📩

📩 Kicad PCB file Attiny 412
📩 Kicad Schematic file Attiny 412
📩 Fusion 360 8574 File