owned this note
owned this note
Published
Linked with GitHub
---
tags: Fabacademy
---
# Week06 - Electronic design
### For simulation
We do not cover the subject but in Kicad website there is all the info to do it.
## Concept
## Design
### Import library
Download library from https://gitlab.fabcloud.org/pub/libraries/electronics/-/tree/master/kicad
#### Symbol
Installing the library
Preferences -> Libraries -> Manage symbol library
Create new empty global library
![](https://i.imgur.com/eXGbZ3x.png)
Repeat possibly with (optional) : https://github.com/KiCad/kicad-footprints
#### Footprint
Preferences -> Libraries -> Manage footprint library
Add an existing library, select fab.pretty
![](https://i.imgur.com/Vdm1W7T.png)
### Schematic edition
Keystrock
* M = move
* R = rotate
* E = edit
* C = copy
* V = edit value
* D =
* G = Drag, not to loose connection when moving parts
* backspace = remove component
* W = create a wire from the place you are
Click on the following button
![](https://i.imgur.com/A2Oz7GQ.png)+
Checks
* grid
* mm
![](https://i.imgur.com/X3Kwpuj.png)
1. Place symbole (ampli-op button)
2. In the library choose your element
* R = rotate
* click when ok with positiob
* The adding window appear again, choose if adding again or not (esc if not)
3. Hover over the element and click **M** to move
4. To remove, right-click -> remove
5. When placing a resistance, the value does not impact at the beginning
6. Adding a capacitor on VCC to filter power input. 1uF is a good general value but check the datasheet of IC
mm
#### Labels
Used to route signal limiting wires. Only important thing is that they share the same name.
#### Pull-up/down resistance
Use a 10kOhm resistance as pull up-down
![](https://i.imgur.com/sMuUKhf.png)
Consumption is of the order of magnitude of nano-amps
![](https://i.imgur.com/N3lkNzM.png)
#### Generate NETLIST
![](https://i.imgur.com/ccm5Nbh.png)
### PCB Edition
![](https://i.imgur.com/Exztfhd.png)
![](https://i.imgur.com/ngTsIKo.png)
Then check where the components are (maybe outside of the screen)
If there is an error, it means some footprints are missing.
Ex : go back to schematic, delete the footprint from any component. Go back to PCB and click the following button
![](https://i.imgur.com/pBZ4AUf.png)
#### Place approximately components
#### Layers
1. Red = Upper layer
2. F.Silks = unfunctional writing (names etc...)
3. Yello = part with holes
#### Design rules
Some limitations exists due to the manufacture process.
Files -> Board setup
![](https://i.imgur.com/nZGHEgU.png)
![](https://i.imgur.com/NFuarIu.png)
**Clearance** = separation between footprints
tool : 1/64 in = 0.3968 mm -> 0.4mm
**Track Width** = 0.3mm (good value, even a bit big)
**Via** are the info for 2 layers PCB
Some info can be calculated with the PCB calculator
![](https://i.imgur.com/Ovs6Twf.png)
Ex : removing copper from the PCB with milling machine.
* Components separation
If a component has to be put on the other side, click **F** on the component to FLIP it.
#### Create your traces
Select the trace tool
![](https://i.imgur.com/g9z4Icf.png)
Rules:
* Closest possible but not too much too let the board "breath"
* Connect on the pads better than on the tracks
![](https://i.imgur.com/K7hA1bv.png)
Make tracks bigger
Edit -> track & wire properties
Click tracks
Set to specify value or Set to netclass value
**Cleaning tracks**
Edit -> Clean-up tracks and vias
#### Debug your tracks
![](https://i.imgur.com/lu0DHWN.png)
![](https://i.imgur.com/vaoJuuu.png)
Issue : edge to close to the board -> at the moment no problem.
#### Create the board edge
* Select "edge.cut" layer
* We are going to draw
1. Create a 1/4 circle
2. Copy/paste on all sides
Finish created the yellow board line
![](https://i.imgur.com/cueShNM.png)
#### Check the final aspect
Check the board with the BUG
![](https://i.imgur.com/tzvImII.png)
Check the 3D part
ALT3 gives the 3D view
![](https://i.imgur.com/zfWcH6Z.png)
## Prepare
### Oscar's way
Adding a plugin to Kicad
https://gitlab.com/fablabbcn-projects/electronics/kicad-exports
Creates SVG
Then a command creates the PNG
Then rolland
### Josep's way
#### Export as SVG
File -> Export -> SVG
Using this configuration
![](https://i.imgur.com/ZQJgYca.png)
#### Open Inkscape
Open SVG file
Open Layer tab
![](https://i.imgur.com/l83ZzVW.png)
Add layers (+ button)
Split objects between layers
Create a big black square
For exporting, select outerline in Selection, then select "custom".
Select the layer you want to export
Export
### SVG Export
### Make PNG
## Global Class
### Inventory
**Wires** : warning with full core coper or "tressé" depending on frequency
**Resistors** : value, power dissipation, process for fabrication (10kOhm for LED -> 5mA at 5V)
**Capacitor** : block steady current. Used as filters (1-10uF) (low frequency).steady voltage, no curren - voltage variation = current. There is polarized and not polarized Capacitors. Main package = 1206 (in inches) -> good to fit a track below. If the capac is big enough it can act as a sall battery
* C = Q/V
* Q =CV
* I = C * dV/dT
Polarized capa are a bit more complex (10F), smaller max voltage.
**Crystals** : to set up specific timing (if IC clock not sufficient)
**Inductors** : block high frequency current
* V=L*dI/dT
**Diodes** : anode/cathode. Let the current in one direction only. Ideal diode is perfect conductor. But not true. When dV>0.6V --> perfect conductor.
* Perfect diode
* Zener diodes (symetric behavior)
* LED diode
**Transistors** : electrical switch.
* MOFSE : Drain, Gate, Source, maximum current handled, RDS (resistance between Drain and Source). The Gate control the resistance between Drain and Source.
**Regulators** : Are used to manage the power source to adapt it to the microcontroller. Input 6-30V -> output 5V. It works with Capa before and after
**OpAmp** :
**MicroControllers** :
### Circuits
**Kirchoff law** :
* Sum of current = o at a node
* Sum of voltage around a circuit = 0v
* P= UI = I^2 * R
UNDERSTANDING Ciruits : http://falstad.com/circuit/
## Thursday - Local Class
### What is a microcontroller
### Transistor
### Circuits
**Combinational** circuit
No memory, not aware of their state. input -> output
![](https://i.imgur.com/OSnpFzR.png)
**Sequential** circuit
Memory of their state (combinational circuit + state memory)
### Advanced electronic components
#### Capacitor
![](https://i.imgur.com/vGEP8qS.png)
#### Diodes
Important to READ the link : https://lcamtuf.coredump.cx/electronics/#19
2 important diodes
* Zener diodes
* for USB, computer connetion
* they allow a littlebit of backward current
* Good for protection during connection
* Schottky diodes
* Normal diodes provok voltage drop
* Schottky diodes do not provok voltage drop
#### Oscillators
Oscillator : does not have capacitor included
Resonator : has capacitor included
Can generate pulse signal to impose signal to a microchip.
![](https://i.imgur.com/Vl7ZTUY.png)
Fuses are the commands we send to the microchip to tell him his hardware configuration
#### Regulators
Most common one is LDO
Not combinable with PWM
#### How to design the board
1. We have to know how to program it
2. Think about input current depending on the use
3. Choose MC (ATtiny 3216 32 = memory / 16 = pins):
1. Inputs : digital / analog
2. Outputs : how many ? what can they do ? (PWM, Emission ...)
3. Processing power (16Mhz ok for motor controller)