fix folder structure
BIN
docs/Assignments/week_06_electronic_design/IMG_8487.jpg
Normal file
After Width: | Height: | Size: 81 KiB |
BIN
docs/Assignments/week_06_electronic_design/assignment.zip
Normal file
206
docs/Assignments/week_06_electronic_design/electronic_design.md
Normal file
@@ -0,0 +1,206 @@
|
||||
# Electronic design
|
||||
|
||||
For this week we are making a start at designing pcb's. Im excited for this week because I can finally make my own circuits instead of using unreliable breadboards. With designing I'm starting out with KiCad.
|
||||
|
||||
|
||||
## No symbol table
|
||||
When I first tried to start a project for kicad it asked for a symbol table.
|
||||
|
||||

|
||||
|
||||
Apparantly KiCad doesn't come with it on Linux systems (I don't know about windows). So I needed to install an extra package called `kicad-library`. After that I could use the standard symbol library. Later on I also found out I needed to install the 3D-models libary. Everything of KiCad on Linux comes separately.
|
||||
|
||||
|
||||
## The assignment
|
||||
For this weeks assignment henk wanted us to design a pcb with at least a led, a switch and then we had a choice between a speaker and a sensor. I wen't with a speaker because I could use that for my final project.
|
||||
|
||||
### KiCad
|
||||
I'm going to do this in KiCad because it is the only software I know thanks to the lecture on thursday. I first started out dragging all the parts I needed onto the schematic editor.
|
||||
|
||||

|
||||
Using the `A` key while in this screen you can open the component selector and search for the components needed.
|
||||
|
||||

|
||||
|
||||
After that I needed to think how I wanted to connect everything. I wanted to use the switch as a power switch and the led as some sort of status indicator. wiring up the speaker is going to be the hardest part.
|
||||
|
||||
I first started off with the easier parts. So I started with the LED. I accidentally found out when you hover click a part and press `D` you directly go to the data sheet of the part so that's a nice shortcut.
|
||||
|
||||
#### Connecting a LED
|
||||
When reading the datasheet I found this graph. With a relation to voltage and mAh of the LED.
|
||||
|
||||

|
||||
|
||||
If I supply the LED with 20 mA it should run at 1.8V. The supply voltage is 3.3V so.
|
||||
```math
|
||||
R = V / I \\
|
||||
|
||||
R = 3.3 / 0.02 \\
|
||||
|
||||
R = 165 Ohm
|
||||
```
|
||||
So I will need a 165 Ohm resistor.
|
||||
|
||||

|
||||
|
||||
This is how I connected my LED. I chose to use the MCU as a ground because Henk once explained how it's better for the MCU and that it could handle more led's or other connections that way.
|
||||
|
||||
#### Connecting the speaker
|
||||
Now I wanna drive the speaker. But to do that we need some sort of driver because I don't think the mcu's has enough power to drive the speaker.
|
||||
|
||||
When searching online and on older fab academy projects I found that people everywhere use IC's to drive them. I wanted to try to make one without an IC because I have seen my friend make one when he was doing electrical engineering. When looking around online all the circuits look super confusing. For example the one on [this forum](https://www.physicsforums.com/threads/amplifier-circuit-driving-an-8-ohm-speaker.967270/) doesn't have any ground symbols.
|
||||
|
||||
After searching for a while I found [this](https://www.instructables.com/How-to-Make-Simple-Amplifier-Circuit-Without-IC/) on Instructables
|
||||

|
||||
|
||||
##### Understanding resistors
|
||||
The only step I needed to figure out is why it work like this and why doesn't the speaker blow up when connected because there is 9 volt on the circuit and the speaker is rated for 1 volt. I still have a lot of trouble wrapping my head around how voltage drops because of a resistor.
|
||||
|
||||
Voltage can be seen as the speed of water traveling through a tube. A resistor makes the tube smaller for a small part so the water slows down. So the voltage drops.
|
||||
|
||||
Resistors always cause a voltage drop. How big the drop is depends on the amount of current going trough it and the resistance (Ohm)
|
||||
|
||||
```math
|
||||
V = I * R
|
||||
```
|
||||
This is Ohms law. So to keep a constant voltage you need to make sure your current is also constant and not changing constantly. In that way you can keep a constant voltage.
|
||||
|
||||
#### Back to the speaker
|
||||
I watched [this](https://www.youtube.com/watch?v=U0FIG2J6Zls) video and now understand the fundementals of a amplifier. The only thing necessary is something that can make an small signal big. For that I can use a MOSFET. I also need to make sure the MOSFET doesn't over current the speaker so that's why it needs a resistor before the gate pin. And I need some sort of buffer for the speaker once it needs a lot of power.
|
||||
|
||||

|
||||
|
||||
When I was looking for MOSFET's through the Fab library I found 2 type of MOSFET's P channel and N channel. I quickly searched what it does.
|
||||
|
||||

|
||||
|
||||
So for my use case I will need a N channel MOSFET that can work output a linear voltage based on what is supplied on the gate.
|
||||
|
||||

|
||||
|
||||
I first had this setup. But then I asked AI for feedback and it told me I used the wrong transistor because it could only be on or off and not anything in between.
|
||||
|
||||

|
||||
|
||||
After a while I realized it's way easier to use an IC for this use case. So that's what im going to do.
|
||||
|
||||
I am going to use the `OPAMP_AD8615` as my amplifier. According to its data sheet it has a input voltage from 0 to 5 volts and an output from 7.5 mV to 5 volts. After some time researching on how to use it I decided to use the `LM4871M` because I couldn't find any good examples using the `AD8615`.
|
||||
|
||||

|
||||
This was my last result using the `AD8615`.
|
||||
|
||||
I think this is correctly connected but I still need to add a bypass.
|
||||
|
||||

|
||||
A bypass is to filter the noise from the power supply. To filter noise a capacitor is used.
|
||||
|
||||

|
||||
|
||||
In the documentation of the IC I found how to connect the bypass. I needed to connect the pin to the ground with a capacitor between it.
|
||||
|
||||

|
||||
|
||||
It is also recommended to add a input capacitor in the event the chips requires a lot of power and it can't be deliverd from the source.
|
||||
|
||||

|
||||
|
||||
So I added a 10 μF capacitor at the VDD. So my circuit now looks like this.
|
||||
|
||||

|
||||
|
||||

|
||||
|
||||
I still need to make sure there isn't too much power going to the pcb. According to these graphs if you change the input power you can make sure it doesn't output too much. So according to the graph I need 2 volt Supply voltage. Because my speaker has a 8 Ohm impedance and the rated watt is 0,25 mW.
|
||||
|
||||

|
||||
|
||||
|
||||
After a while of struggling with all the connections I asked Henk and he said I was thinking too complicated. I don't need a amplifier at all I just need to send signals through the speaker using the MCU like this.
|
||||
|
||||

|
||||
|
||||
Because the speaker is such low wattage it can easily be driven by the mcu. Then after it's connected you can use the buzzer music library to play notes on the speaker. Or if I wanna go more advanced I can send wav files to the mcu to play on the speaker.
|
||||
|
||||
|
||||
#### Connecting a button
|
||||
I'm going to connect a button directly to the MCU to use as a input button. For this I will need a pulldown Resistor. I followed [this youtube guide](https://www.youtube.com/watch?v=aPVMKyZpaPA) to connect the button.
|
||||
|
||||

|
||||
Now its connected like this as a pulldown resistor as described in the tutorial. I also swapped out all the resistors from the basic symbol library to the Fab symbol library because they have a pre-assigned footprint.
|
||||
|
||||
#### Layout and making traces
|
||||
Now I can finally make the layout of the board and draw traces. Now im in the PCB editor and I can press this button to import everything from the schematic.
|
||||
|
||||

|
||||
|
||||
|
||||

|
||||
|
||||
This is how it looked when I imported it. Now I will organize everything and everything that belongs together will go near each other.
|
||||
|
||||

|
||||
|
||||
In the drawing I'm having a problem that the 3v3 isn't properly defined on the XIAO board. I can't power anything on the pcb from it.
|
||||
|
||||

|
||||
|
||||
I may have forgotten to add the 3v3 tag to the xiao board so that's why it didn't draw the small lines to it.
|
||||
|
||||
I first started out with placing all components that belong together next to each other.
|
||||
|
||||

|
||||
|
||||
Then I started drawing traces.
|
||||
|
||||

|
||||
|
||||
It could be prettier if I used 2 layered board. I learned using the KiCad manual when drawing traces if you press `V` you can add a via on the trace to make it go under other traces.
|
||||
|
||||

|
||||
|
||||
Like this!
|
||||
The blue trace is going under the red one using a via.
|
||||
|
||||
When running the design rules checker I got a lot of errors that my silkscreen text was overlapping on the solder mask.
|
||||
|
||||

|
||||
That means that the text is overlapping the soldering. So I need to fix that by dragging the components a bit away from each other. Or deleting the silkscreen letters.
|
||||
|
||||
There are also some issues I can't fix. For example these pads keep giving errors because they are under the xiao but they are part of the xiao so I can't fix that.
|
||||
|
||||
Now I'm going to make edge cuts. Edge cuts are the shape of the pcb.
|
||||
|
||||

|
||||
I ended up using [this youtube tutorial](https://youtu.be/aHIIXjRAhZA) to create the rounded edges. One thing I noticed is to stay on the big grid lines. It makes life a lot easier when making rounded corners or other rounded cuts.
|
||||
|
||||
This is my end result for this weeks assignment.
|
||||
|
||||

|
||||
|
||||
## The group assignment
|
||||
With the group assignment we wen't and tested different test equipment. First we started of with the most basic one. The multimeter.
|
||||
|
||||

|
||||
|
||||
### Multimeter
|
||||
There are a couple of different options on the multimeter. You can measure voltage, current, resistance and even diodes. Some can test how big capacitors are. There are a wide variety of use cases for multimeters. But today was focused on learning how to use it and how to not blow a fuse in a multimeter. Henk told us to keep the pins in the Com and the ground port otherwise if someone wants to measure voltage and doesn't pay attention how the test probers are connected. It may destroy the multimeter.
|
||||
|
||||
### Oscilloscope
|
||||
Henk and erwin told us that the oscilloscope is only necessary when debugging electronics. Otherwise if everything works you wouldn't need this tool. With the oscilloscope you can view signals that get generated my the mcu's displayed on a screen.
|
||||
|
||||

|
||||
|
||||
### Logic analyzer
|
||||
An logic analyzer is a digital oscilloscope. The benefit of this device is that it is a lot smaller than a oscilloscope and it can translate the signal to human readable characters using software on the pc. The only downside is that it can't read analog signals.
|
||||

|
||||

|
||||
|
||||
(Thanks Irja for the photos of the group assignment. I forgot to take them myself)
|
||||
|
||||
## Files
|
||||
* [KiCad project](assignment.zip)
|
||||
|
||||
## Sources
|
||||
* [Datasheet LM4871M](https://www.ti.com/lit/ds/symlink/lm4871.pdf?HQS=dis-dk-null-digikeymode-dsf-pf-null-wwe&ts=1741005529535&ref_url=https%253A%252F%252Fwww.ti.com%252Fgeneral%252Fdocs%252Fsuppproductinfo.tsp%253FdistId%253D10%2526gotoUrl%253Dhttps%253A%252F%252Fwww.ti.com%252Flit%252Fgpn%252Flm4871)
|
||||
* [Arduino speaker](https://www.build-electronic-circuits.com/arduino-speaker/)
|
||||
|
BIN
docs/Assignments/week_06_electronic_design/image-1.jpg
Normal file
After Width: | Height: | Size: 42 KiB |
BIN
docs/Assignments/week_06_electronic_design/image-10.jpg
Normal file
After Width: | Height: | Size: 54 KiB |
BIN
docs/Assignments/week_06_electronic_design/image-11.jpg
Normal file
After Width: | Height: | Size: 34 KiB |
BIN
docs/Assignments/week_06_electronic_design/image-12.jpg
Normal file
After Width: | Height: | Size: 19 KiB |
BIN
docs/Assignments/week_06_electronic_design/image-13.jpg
Normal file
After Width: | Height: | Size: 54 KiB |
BIN
docs/Assignments/week_06_electronic_design/image-14.jpg
Normal file
After Width: | Height: | Size: 50 KiB |
BIN
docs/Assignments/week_06_electronic_design/image-15.jpg
Normal file
After Width: | Height: | Size: 51 KiB |
BIN
docs/Assignments/week_06_electronic_design/image-16.jpg
Normal file
After Width: | Height: | Size: 37 KiB |
BIN
docs/Assignments/week_06_electronic_design/image-17.jpg
Normal file
After Width: | Height: | Size: 38 KiB |
BIN
docs/Assignments/week_06_electronic_design/image-18.jpg
Normal file
After Width: | Height: | Size: 46 KiB |
BIN
docs/Assignments/week_06_electronic_design/image-19.jpg
Normal file
After Width: | Height: | Size: 32 KiB |
BIN
docs/Assignments/week_06_electronic_design/image-2.jpg
Normal file
After Width: | Height: | Size: 29 KiB |
BIN
docs/Assignments/week_06_electronic_design/image-20.jpg
Normal file
After Width: | Height: | Size: 56 KiB |
BIN
docs/Assignments/week_06_electronic_design/image-21.jpg
Normal file
After Width: | Height: | Size: 36 KiB |
BIN
docs/Assignments/week_06_electronic_design/image-22.jpg
Normal file
After Width: | Height: | Size: 35 KiB |
BIN
docs/Assignments/week_06_electronic_design/image-23.jpg
Normal file
After Width: | Height: | Size: 49 KiB |
BIN
docs/Assignments/week_06_electronic_design/image-24.jpg
Normal file
After Width: | Height: | Size: 64 KiB |
BIN
docs/Assignments/week_06_electronic_design/image-25.jpg
Normal file
After Width: | Height: | Size: 109 KiB |
BIN
docs/Assignments/week_06_electronic_design/image-26.jpg
Normal file
After Width: | Height: | Size: 33 KiB |
BIN
docs/Assignments/week_06_electronic_design/image-27.jpg
Normal file
After Width: | Height: | Size: 98 KiB |
BIN
docs/Assignments/week_06_electronic_design/image-28.jpg
Normal file
After Width: | Height: | Size: 85 KiB |
BIN
docs/Assignments/week_06_electronic_design/image-29.jpg
Normal file
After Width: | Height: | Size: 50 KiB |
BIN
docs/Assignments/week_06_electronic_design/image-3.jpg
Normal file
After Width: | Height: | Size: 17 KiB |
BIN
docs/Assignments/week_06_electronic_design/image-30.jpg
Normal file
After Width: | Height: | Size: 51 KiB |
BIN
docs/Assignments/week_06_electronic_design/image-31.jpg
Normal file
After Width: | Height: | Size: 33 KiB |
BIN
docs/Assignments/week_06_electronic_design/image-32.jpg
Normal file
After Width: | Height: | Size: 84 KiB |
BIN
docs/Assignments/week_06_electronic_design/image-33.jpg
Normal file
After Width: | Height: | Size: 57 KiB |
BIN
docs/Assignments/week_06_electronic_design/image-34.jpg
Normal file
After Width: | Height: | Size: 74 KiB |
BIN
docs/Assignments/week_06_electronic_design/image-35.jpg
Normal file
After Width: | Height: | Size: 64 KiB |
BIN
docs/Assignments/week_06_electronic_design/image-36.jpg
Normal file
After Width: | Height: | Size: 68 KiB |
BIN
docs/Assignments/week_06_electronic_design/image-37.jpg
Normal file
After Width: | Height: | Size: 73 KiB |
BIN
docs/Assignments/week_06_electronic_design/image-38.jpg
Normal file
After Width: | Height: | Size: 58 KiB |
BIN
docs/Assignments/week_06_electronic_design/image-39.jpg
Normal file
After Width: | Height: | Size: 64 KiB |
BIN
docs/Assignments/week_06_electronic_design/image-4.jpg
Normal file
After Width: | Height: | Size: 26 KiB |
BIN
docs/Assignments/week_06_electronic_design/image-40.jpg
Normal file
After Width: | Height: | Size: 72 KiB |
BIN
docs/Assignments/week_06_electronic_design/image-41.jpg
Normal file
After Width: | Height: | Size: 92 KiB |
BIN
docs/Assignments/week_06_electronic_design/image-42.jpg
Normal file
After Width: | Height: | Size: 113 KiB |
BIN
docs/Assignments/week_06_electronic_design/image-43.jpg
Normal file
After Width: | Height: | Size: 10 KiB |
BIN
docs/Assignments/week_06_electronic_design/image-5.jpg
Normal file
After Width: | Height: | Size: 189 KiB |
BIN
docs/Assignments/week_06_electronic_design/image-6.jpg
Normal file
After Width: | Height: | Size: 16 KiB |
BIN
docs/Assignments/week_06_electronic_design/image-7.jpg
Normal file
After Width: | Height: | Size: 20 KiB |
BIN
docs/Assignments/week_06_electronic_design/image-8.jpg
Normal file
After Width: | Height: | Size: 51 KiB |
BIN
docs/Assignments/week_06_electronic_design/image-9.jpg
Normal file
After Width: | Height: | Size: 43 KiB |
BIN
docs/Assignments/week_06_electronic_design/image.jpg
Normal file
After Width: | Height: | Size: 41 KiB |
214
docs/Assignments/week_06_electronic_design/lecture_notes.md
Normal file
@@ -0,0 +1,214 @@
|
||||
# Lecture Notes
|
||||
## Wednesday Neil
|
||||
Ribbon cable - Use this instead of loose pins
|
||||
|
||||
Wire is specified by AWG
|
||||
|
||||
You can search AWG vs Current
|
||||
|
||||
Connectors
|
||||
|
||||
EDA (Electronic design automation)
|
||||
|
||||
### How 2 pcb
|
||||
First start sketching on paper
|
||||
|
||||
then create a schematic
|
||||
|
||||
then place components
|
||||
|
||||
then route wires
|
||||
|
||||
simulation?
|
||||
|
||||
fabrication
|
||||
|
||||
|
||||
### EDA
|
||||
0 Ohm resistor to create bridges on one layer boards
|
||||
|
||||
DRC (Design rules check)
|
||||
|
||||
KiCad - One of the best pcb design softwares. Biggest limitation they are seperate programs
|
||||
|
||||
SnapMagic, To get footprints into kicad
|
||||
|
||||
schemtic -> pcb tool to lay out your schemtic physicaly
|
||||
|
||||
Fabrication toolkit for KiCad
|
||||
|
||||
|
||||
|
||||
Eagle is build into fusion.
|
||||
|
||||
https://componentsearchengine.com
|
||||
https://libary.io
|
||||
|
||||
Don't forgot an LED
|
||||
|
||||
### Test equipment
|
||||
Multimeter
|
||||
Osciliscoop
|
||||
Logic Analyser
|
||||
|
||||
|
||||
### Assignemnt
|
||||
Group:
|
||||
Use test equipment to look a test equipment.
|
||||
Check voltage
|
||||
Check noise using Osciliscope
|
||||
Logic analyser to decode what its doing
|
||||
|
||||
Individual:
|
||||
Use a EDA tool to design a development board.
|
||||
|
||||
Extra: Simulate it.
|
||||
Extra: Design a case for it kicad
|
||||
|
||||
## Thursday Erwin
|
||||
|
||||
Circuit - A circuit a closed loop where electrons can flow
|
||||
|
||||
Difference in electrical ptential between points
|
||||
sum of all coltages around a loop = 0; There is never loss in voltage
|
||||
Water analogy
|
||||
|
||||
Water definition
|
||||
High water fall high voltage
|
||||
The more water the more current
|
||||
|
||||
Wall sockets - AC - The polarity switches constantly
|
||||
DC- Always positive or negative
|
||||
|
||||
|
||||
### Tools
|
||||
|
||||
#### Multimeter
|
||||
Test voltage, current, resistance
|
||||
Some can test capacitors.
|
||||
|
||||
Make sure to check where you wires are in.
|
||||
|
||||
|
||||
#### Oscilloscope
|
||||
Oscilloscope screen is a grid which each square having value.
|
||||
Each square can have ms in time and voltage.
|
||||
|
||||
make sure to connect the line you wanna test and the ground
|
||||
|
||||
3 Importand knobs on the oscilloscope
|
||||
|
||||
* Amount of volts to be displayed (change volt per square)
|
||||
* 2 buttons for each channel to change the height on the screen of the signal
|
||||
* Time to be displayed
|
||||
|
||||
Oscilloscope is used when you have a problem. When something isn't working and you don't know what.
|
||||
|
||||
|
||||
voltage drop
|
||||
|
||||
always first connect the ground
|
||||
|
||||
You use Trigger to synchronize the oscilloscope to your signal
|
||||
|
||||
#### Logic analyzer
|
||||
Can sense microcontroller communication and display it digitally on your laptop.
|
||||
|
||||
salaea logic (software)
|
||||
|
||||
Can only see digital signals. No analog ones
|
||||
|
||||
Logic analysers can translate protocol to human readible stuffs
|
||||
|
||||
### KiCad
|
||||
PCB creation
|
||||
connect components and design circuits
|
||||
|
||||
#### Schematic
|
||||
Create seperate schematics and connect them using labels.
|
||||
|
||||
Use labels to keep it clean.
|
||||
|
||||

|
||||
|
||||
|
||||
|
||||
If you press `A` you can see all components
|
||||
|
||||

|
||||
Now we search resistor and select it.
|
||||
|
||||

|
||||
|
||||
Now there is a resistor!
|
||||
Now we can also add a LED the same way.
|
||||
|
||||

|
||||
|
||||
| Key | What? |
|
||||
| :-- | -------------------------------------------------------- |
|
||||
| W | Draw wire |
|
||||
| A | New part |
|
||||
| E | Edit value (Only works on components that can be edited) |
|
||||
| X | Draw a trace |
|
||||
| D | Drag Move something with traces |
|
||||
| F | Finish the route for me |
|
||||
| | |
|
||||
|
||||
|
||||

|
||||
Connector mounting pins
|
||||
|
||||
Make sure to add VCC and GND to your design even when you use pins to connect something
|
||||
|
||||

|
||||
Now we can go and make the circuit board.
|
||||
#### Pcb layout part
|
||||
In here you will define the physical placement of the pcb.
|
||||
|
||||
You can do anything with pcb's and you can make them any shape you want.
|
||||
##### Assigning footprints
|
||||

|
||||
When importing I got this error
|
||||
This is because we didn't tell KiCad what type of components they are (SMD or through pins)
|
||||
|
||||
Tools -> assign footprints
|
||||
|
||||

|
||||
After you've assigned it all it should look like this.
|
||||
|
||||
##### Custom shape
|
||||
|
||||

|
||||
On the right you see a lot of layers.
|
||||
|
||||
Silkscreen - Text
|
||||
Solder mask - Prevent solder to stick to that mask
|
||||
EdgeCuts - Shape of the pcb
|
||||
F.Cu - Front copper
|
||||
|
||||
|
||||
##### Design rules
|
||||
The closest track space can be the size of the tool (0.4mm)
|
||||
Always should give traces some more spaces between each other because otherwise its going to be super hard to check it with a multimeter.
|
||||
|
||||
File -> Board setup -> design rules
|
||||
|
||||

|
||||
In here yo can set design rules for the print.
|
||||
These settings are based on the machine it is produced on.
|
||||
|
||||
For high power circuits you need to set bigger traces otherwise you have a higher resistance and the traces will get hot.
|
||||
|
||||
|
||||

|
||||
Don't forget to change the settings in `Net Classes`
|
||||
|
||||
##### Exporting the board
|
||||
File -> Export ->
|
||||
|
||||
|
||||
Via - Circle through pcb
|
||||
|
||||
|
||||
everything comes from digikey
|