Audio Amplifiers
I am well and truly stumped when it comes to amplifying BMOW’s audio. Any sane person would have given up long ago. Mix the three voices down to two stereo channels, and send them unamplified to headphones, and it sounds decent enough. But mix them down to a single mono channel, amplify it, and send it to a small speaker, and it sounds distorted and crunchy. The problem persists no matter how I tweak the amplifier circuit.
Last week I convinced myself that the LM386 wasn’t up to the amplification task, and ordered a bunch of other low-voltage power amplifiers. They arrived yesterday, I tried them all, and the result was pretty much the same as with the LM386. I tried an LM386 clone from another company, a TDA7052N, TDA2822M, and a NJM2073D. None of them made any noticeable difference.
I’m beginning to suspect that the problem lies not with the amplifier, but with the way I’m mixing the channels. The AY-3-8913 datasheet shows all three channels wired directly together to get a single mono channel. That’s what I did, but does that make sense? What happens when one voice is driving its output high, and the other is driving it low, and they’re wired directly together?
The TDA2822M is interesting in that it can be configured as two separate stereo amplifiers, or a single, higher-power mono amplifier. I tried the stereo setup, driving two separate speakers, each connected to a single voice of the AY-3-8913, with the third voice unconnected. It sounded good! Wiring the third voice to one of the others sounded noticeably worse, but still not as bad as when all three voices are wired together.
I see a few options on where to go from here:
- Experiment to see if there’s a better way to connect the three voices than short-circuiting them together. Maybe connect them with low-value resistors?
- Put two (or three) separate speakers in the BMOW case, each driven by a separate amplifier, so the voices don’t need to be mixed.
- Build the mono amplifier circuit and live with the distortion.
- Omit the amplifier and speaker entirely, and use headphones and/or an external sound system.
9 Comments so far
Leave a reply. For customer support issues, please use the Customer Support link instead of writing comments.
I have been watching your work for some time. Am amazed at your work. Keep it up!
I just did a audio amp breadboard adapter with the TDA7052AN adapter. You need to mix the two signals together using a simple resistor mixer. I did a quick search and found these two articles that might help.
http://www.tkk.fi/Misc/Electronics/circuits/linesum.html
http://www.tkk.fi/Misc/Electronics/circuits/linemixer.html
From what I remember of the AY-3-891x chips the audio outputs are current sources so they don’t drive the output high or low but source x ammount of milliamps when high and no milliamps when low. All these currents add up and are converted into voltage in any load resistor connected to these outputs.
I’d try another, bigger, speaker on the mono amplifier.
One way to see if it is the speaker would be to drive the headphones with the mono amplifier. If they sound the same as they do when connected directly at the same volume then you need a better speaker.
Thanks both! I took both of your suggestions, and now I have something that sounds half-way decent.
The first change was to put a resistor between each channel and the point where they join to make the mono channel, as uCHobby suggested. I found a value of 51K worked pretty well, and resulted in noticeably better mono output compared with simply wiring the left and right channels together directly.
I also tried replacing the 2.5 inch junky speaker with a surround speaker from my home stereo system. Wow! The first surprise was that it was loud, and I mean really loud. At max volume the 2.5 inch speaker was a little louder than comfortable listening volume, but the surround speaker had my wife shouting from two rooms away to turn it down. They’re both 8 ohm speakers, so I’m not sure why one would be much louder. I’m sure the enclosure of the surround speaker helps, and maybe it’s just more efficient?
Unsurprisingly, the surround speaker also sounded qualitatively better than the 2.5 inch speaker, mostly due to its wider and flatter frequency response. There didn’t seem to be much difference in the perceived distortion between the two, however. They were both acceptable, but not great. I might be able to get a better result by using larger value resistors in the input stage of the circuit, before the headphone connection, but that would reduce the maximum volume I could get from headphones. I think this is a decent compromise.
I’ve settled on using the TDA7052N amplifier instead of the LM386. It’s the same size, but requires fewer external components. Actually if you don’t count the recommended supply capacitors between power and ground, it doesn’t require any external components at all.
I thought it would be fun to try to get a “real” song playing on the AY. I downloaded an AY emulator and some songs, and spent some time deciphering the file format it used. After some uncompressing and de-interlacing, it’s just a long series of 50Hz frames, with each frame specifying a new value for all 16 AY registers. To get this playing on the Arduino/AY breadboard setup, I wrote a simple Arduino program to play the register data. At first I could only fit less than a second’s worth of data, which made it hard to tell if it was actually playing back correctly, but I think it was. I then came up with a way to store the data more compactly, uploaded it to the Ardunio with nervous anticipation, and…
my Arduino died. I don’t know what happened, but now I get “not in sync” errors whenever I try to upload a program to it. I checked the Arduino board, checked the cable, pulled the Arduino off the breadboard, rebooted, reset, and waved a dead chicken over it, but nothing would revive it. Doh!
I guess this means it’s time to build the real BMOW circuit, since I no longer have anything to drive the AY.
Those “not in sync” errors seem to show up quite regularly on the Arduino forum. I don’t know the solution, but a bit of searching for the right forum thread ought to do the trick. Hope you can get it going again!
Right, that’s the standard error when the PC doesn’t receive the expected response from the Arduino. Usually that’s a problem people encounter the first time, until they discover their COM port driver isn’t set up properly, their cable is bad, the Arduino board is built incorrectly, it’s powered off, or something else fundamental. Unfortunately in this case, it went from working to “not in sync” within minutes, with no obvious change that could explain it. I’ve moved on now to building the real circuit on the BMOW board, but I wish I could explain what happened to the Arduino.
I’ve definitely seen people on the Arduino forums who’ve had the same problem. I did help out an Arduino user at Dorkbot Bristol, who’d overwritten the bootloader somehow. I wonder if that’s the cause? In my case, we re-loaded the bootloader with an AVR in-system programmer, which I happened to have with me that day.
There are a lot of old arcade video games that used the AY8913 or similar parts and many of them have schematics in PDF format on the Net.
You may want to look at MAME (www.mame.net) which emulates many arcade games and probably lists which use the AY8913 somewhere in the source code. This way you could figure out which games to track down the schematics for.
From memory the three outputs go through differently weighted resistors then the combined mono output goes into a voltage follower, then into a regular amplifier which drives a speaker directly. But seeing the specific implementation across a few games will nail down all the details.
i want to know the course of problem in audio amplifier and what can i do to prevent it