Compare commits

...

7 Commits

Author SHA1 Message Date
190f84a93b More rambling about speakers 2025-03-03 17:22:34 +01:00
9e1fd7c18c docs update 2025-03-03 15:26:43 +01:00
8d3714b258 revert mkdocs changes 2025-03-03 12:48:20 +01:00
3000842988 update mkdocs 2025-03-03 12:43:36 +01:00
54162ae667 Added mathjax to mkdocs 2025-03-03 12:40:04 +01:00
235784f87e images 2025-03-03 11:01:53 +01:00
01c591e96e speaker stuff 2025-03-03 11:01:34 +01:00
23 changed files with 103 additions and 2 deletions

View File

@@ -53,6 +53,7 @@ When searching online and on older fab academy projects I found that people ever
After searching for a while I found [this](https://www.instructables.com/How-to-Make-Simple-Amplifier-Circuit-Without-IC/) on Instructables
![alt text](image-16.jpg)
##### 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.
@@ -63,3 +64,102 @@ Resistors always cause a voltage drop. How big the drop is depends on the amount
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.
![alt text](image-17.jpg)
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.
![alt text](image-18.jpg)
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.
![alt text](image-19.jpg)
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.
![alt text](image-20.jpg)
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`.
![alt text](image-21.jpg)
This was my last result using the `AD8615`.
I think this is correctly connected but I still need to add a bypass.
![alt text](image-22.jpg)
A bypass is to filter the noise from the power supply. To filter noise a capacitor is used.
![alt text](image-23.jpg)
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.
![alt text](image-24.jpg)
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.
![alt text](image-25.jpg)
So I added a 10 μF capacitor at the VDD. So my circuit now looks like this.
![alt text](image-26.jpg)
![alt text](image-27.jpg)
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.
![alt text](image-28.jpg)
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.
![alt text](image-29.jpg)
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.
![alt text](image-30.jpg)
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.
![alt text](image-31.jpg)
![alt text](image-32.jpg)
This is how it looked when I imported it. Now I will organize everything and everything that belongs together will go near each other.
![alt text](image-33.jpg)
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.
![alt text](image-34.jpg)
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.
![alt text](image-35.jpg)
Then I started drawing traces.
![alt text](image-36.jpg)
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.
![alt text](image-37.jpg)
Like this!
The blue trace is going under the red one using a via.
## 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/)

Binary file not shown.

After

Width:  |  Height:  |  Size: 54 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 82 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 164 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 86 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 79 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 90 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 117 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 165 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 254 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 195 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 67 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 233 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 74 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 174 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 296 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 77 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 345 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 100 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 314 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 320 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 415 KiB

View File

@@ -33,3 +33,4 @@ markdown_extensions:
- pymdownx.details
- pymdownx.tasklist:
custom_checkbox: true