9. Output devices
When I about 13 years old I started to get interested in electronics, one of the first porjects I made was a speaker with an Lm358, i want to recreate it more professionally, this will also be features on my final project. Its important to fabricate output circuits such as this one because if we don't our microcontrollers could get burn trying to use multiple motors, speakers and other output devices, because they requiere a lot of current. Check Week 9 Guide Ibero Puebla Fablab for support material.
I started by looking for an old drawing of the circuit I made, the one you see above, since it worked I just had to do it in an EDA software, I used EasyEDA. When making output devices our best friends are transistors and op amps, they maintaing current estable and give our circuit gain. For design especifications check my week 8 where I go in depth on how to design a PCB. First, I made this schematic, as you can see it's double in order to connect two speakers, I just teste with one speaker but there shouldn't be a problem with two.
Then I turned it into a PCB, it's fairly small (about 3x2.5 cm).
Here's a 3d model of how it should look like, in the end I soldered the transistors facing the other way, this is optional I just did it to look cool.
After it was done I fabricated it, to see how to do this check out my week 4 page where I go in depth on how to manufacture PCBs. You can click here to download the traces and here to download the outline.
Then I soldered the components, for this circuit you will need:
100k resistor | 1k resistor | 2.2 uF and 470 uF capacitors | LM358 op-amp | BD139 transistor | 2W speaker | Female pinheaders |
Here's the first test I made, you can hear that it sounds when it shouln'dt that might be because of a component (most likely a capacitor or static because of the fabrication method of the board).
I also noted the LM358 got very hot so I added a heat sink.
I tested it again and this time I loaded a code into the XIAO, the Mario theme, to be honest i'm really bad with notes so I asked Chatgpt to do it for me. You can click here to download it.
I want to use this on my final project, maybe with some improvements, the XIAO as a bluetooth reciever and the second speaker too.