Transferring LM386 Amplifiers and Speakers onto a Protoboard
by Cory on November 12, 2020 5:33 PM
Now that the thumbstick is working, I was looking into finding some more permanent buttons. To be honest, this next part is going to be a little tough, because the buttons rely a lot on the design of the case. It might make more sense for me to figure out the battery situation first. We'll see.
I was looking into converting my existing controller layout from buttons wired directly to my Arduino into a key matrix format. This is because the Arduino Pro Micro that I ended up buying like 6 of (it was by accident, I swear), does not have enough inputs for how many buttons I need to replicate a PS4 type controller. I need like 14 buttons (4 for the dpad, 4 for ABXY, 2 for Start/Select, 2 for shoulder buttons, and 2 for R3 and L3). Then on top of that I need 4 analog axes for the two thumbsticks and 2 axes if I want analog triggers. The pro micro has 7 digital inputs and 9 analog inputs, so I can use 3 analog as digital if necessary, but this means I only have 10 pins available for 10 buttons. The arduino also has 4 more digital inputs you can use if you are willing to re-use the USB and LED signals but that's a pain in the ass, so I'd like to avoid it.
Instead of unseating the LEDs and making it so that I can no longer program the arduino after detaching the USB signals, I'd rather redesign the controller circuit into a key matrix. If I split the 10 available digital inputs into two groups of 5 inputs and 5 outputs, I can get 25 different buttons hooked up to it as long as I wire it carefully.
Ok, so what the heck does this have to do with the speakers??? Well, I'm out of breadboards to use and I realized while looking at my stuff that I should move my speakers onto a protoboard because the design isn't changing any time soon. So that's what I did:
Here's the beginnings of it. I took male pin header in rows on the top and bottom. I stripped two lengths of wires and connected all the pins together. The top row will be hooked up to VCC and the bottom row will be hooked up to GND. These are the no frills version of the protoboards too so none of the pads are hooked up. I had to wire everything up explicitly as you can tell from the messy bottom:
Gross. This is not what the final thing is going to look like. This is just a permanent temporary board to hold my amplifier circuit.
Here's the right speaker moved onto the protoboard. I've hooked up VCC, GND, and the right audio output to test it out. It only took about an hour to debug why it wasn't working! And it was only a few missed connections!
Just as a reminder, I made the "Great Sounding LM386 Amplifier Circuit" from this page.
Here's a closeup with both speakers added. The second time went a lot faster and more smoothly. I got better at soldering and the connections on the bottom are less nasty.
Ahh! That's much better. Now I'm only using one breadboard for the Stereo Decoder/DAC and LCD. Now I can use the breadboard I freed up to mock up the key matrix while still having the original controller breadboard intact.
I think I will eventually move the controller to a protoboard as well so I won't have to keep buying breadboards.
This Thought is part of Emulators
Cory tries to make the perfect handheld emulator