 The Great Search brought to you by Digikey and Adafruit every single week. Lady Adie user, power of engineering to help you. Yes, you find the things that you want on digikey.com. Lady Adie, what is the Great Search this week? Okay, this week I am looking to replace the low-cost class D amplifier that I've been using in so many of my designs. It's gone, NRND not recommended for new designs. And one thing I've learned over the chip shortage is that once you start seeing that, try to get away from that part as quickly as possible because it can, you know, it used to be that things would go NRND but you'd still be able to get them for a while. I'm actually a little nervous about that now because I got bit a couple times by parts that were NRND and then immediately disappeared, evaporated, and there was no last time by. So let's go to the computer real fast and I'll show off this chip and then I'll go to the overhead later. So on a lot of our boards we use this little speaker. This is a 7.5 millimeter by 7.5 millimeter speaker. They're actually available on digikey too. They're magnetic buzzers and they're a jelly bean part. They come in a variety of different makes and they're going to about like 50, 60 cents in quantity. So these are, these are a great alternative to plug-in speakers. They're inexpensive. As you see, they're fully surface mount. They come in tape and reel. So unlike piezo buzzers, you can solder them in and they're fairly loud. The only thing that's a little bit iffy about them is they use a fair amount of current. They are magnetic and they require 100 milliamps. So it's not a ton of current but it means that you can't just drive them from microcontroller pin. You're not going to get the nice strong tones. That's different than piezos which you pretty much can drive from a pin. So what we've always done is as you see here, this is the buzzer and this is the audio coming out here and this is the two pins of the inductor. Inside there's a little disc that vibrates. As we have this PAM8301 Diodes Inc. Class D amplifier with like six pins. It's a very inexpensive part. It's like 15 cents and it basically has like audio in. You know, put a 0.1 microfarad cap on the inside because it's very high impedance and so you don't need a big blocking cap and then you have like one shutdown pin, power ground and then two class D bridge tied load outputs. And what's nice about the class D is, you know, first off it is fairly power efficient. It doesn't heat up the coil by having a bias go through it because it's class D. It's differential. You don't need blocking caps. It's just overall like a really nice design. And like I said, it's very inexpensive at about 15 cents. Without any, you know, you only need one. I put like a filter on the inside but basically you only need a resistor and a capacitor to run this thing. It's low on component cost. It's easy to pick in place. And it's about the same price as a couple transistors. So it's like why don't you just do a class AB? It's about the same price and you get like a class D performance. It doesn't sound too bad either. So let me go. I don't know if this is going to work but hold on. Let me go here. So this is, no, let's see. It's got hooked. So this is the speaker. I don't know if you can hear that but it's on a macro pad and it's just kind of doing a little booby-boppy. And then you can do one thing I like to do for a lot of projects is I just have a little coin, like a little indicator coin. So it's like a beep. It's not a very loud effect. And that's again using the PEM8301 with this little amplifier. Okay, great. But you know, I'm going to Digikey and they hopefully tell me, well, there's lots in stock but they're not recommended for new designs. And the substitute is actually like there isn't any of the substitute in stock either. So I thought what we would do is we would find a substitute for this. So what we're looking for is, you know, it's going to be a class D mono because I only like I need to be small and cheap. And it's the smallest in cheap is is going to be always mono output class D. The power per channel, I mean, as long as it can drive basically, you know, eight ohms, the wattage doesn't really matter. Another nice thing about this amp is it would run from about 2.5 to five and a half volts. And so you can use it with 3.3 or five volt power and logic. In fact, what I would often do is power the amplifier from five volts or battery, whatever is the highest voltage I have on the board. But then, you know, the logic level that goes into it is three. And of course, I want to be surface mount, the package I don't know, you know, I'm not able to get thought 236. And in fact, actually, sorry, well, yeah, quickly, I'll go here. So at dies.com, you can search for the parks is like, well, what, you know, what do they have? And they also say, yeah, it's not recommended for new designs. And if you go to the data sheet, they do have a couple recommendations, which will which we'll see. So this is another good place to go look for recommendations at the top of the data sheet. They'll, you know, dies is going to have a better idea of what they stock that's a better option. And then this is the just usage because you can see it's like, I love this thing that's so simple, you just have like, you know, coupling cap and power supply speaker out, shut down, you're done. Stop. Don't need anything else. No gigantic blocking caps. Okay, so let's find surface mount mono class D in the amplifier category. We're going to look for active because that's what we want. And normally stocking. So let's see what's available. And pricing isn't really kind of important to me. So I'm going to look for pricing at like 5000 pieces or more. So there's a couple of good options. So one of the options that is recommended. So this is the unfortunate thing is that they're like, okay, why don't you use the 8013 or 812, you know, 8013 or 8014? Well, these are very affordable. They're about 20 cents, but they're both BGA package. Now, I will say that the BGA package for this one, in particular, you know, if you don't need to use the end pin, if you don't mind having it be on all the time, you can tie end to VDD and that way you don't have to, because this is a 0.4 millimeter pitch. So, you know, you're, you're dealing with either a fan out or very, or like a via in ball pad. I'm not a huge fan because I like to keep my manufacturing simple. The 8014 a little bit nicer because at least the center pad is the power for PVDD. So, you know, yes, it is also a BGA, but at least you can tie the center pad out here and then, you know, because you're probably going to be using the same power as VDD, but we'd like to avoid that. So the next options are the 8302 and the 8304. Both of these are, sorry, the 80304 is actually recommended. So the 8302 is a little bit older and I'll show you the comparison. It's actually used the 8302 a lot. So one thing that is nice is, by the way, the 8304 is available in, if I needed it, that small space, it's available in this tiny DFN 3030. The biggest difference kind of for the, so 8302 and 8304, let's go to the right here, is the 8304 will give you three watts into four ohms. That's another thing. These can go into four ohms, which is quite a bit, but the voltage range is a little bit different. This one, you know, it's closer to three volts. This one goes down to two. Are you running it off of two AA batteries? Then maybe you would want to use the 8302, whereas if you can guarantee a 3.3 volt power supply minimum, you can go with the 8304. Both of these actually are pin compatible as well. And then the PAM 8304 also is available in DFN. This is another option. This wasn't in stock, but I did take a look at it. This is a little bit, you know, the part number 82011 is like, okay, they're obviously kind of getting in on that PAM 8303 series. Also very similar, pretty much the same setup. There is differential inputs with the resistors and capacitors and then an output driver. This one just has like, I guess they just have a standard package that they use. But that said, so what I ended up doing is I do like the 8304, but the fact that the 8302 is just like there's more in stock and I do already stock it, I'm pretty much just going to redesign everything that used the 8301 to use the 8302. And, you know, it's basically the same. It's actually the same gain as well. So what I did, if you can go to the overhead, is I have a, this is a PAM, hold on, focus lock. This is a PAM 8302 amplifier and, you know, inside there is 24 dB of gain. And I just took off the, I had a terminal block here. It looked like, looked like this before. And I just hot aired it off and soldered on one of those little speakers. And then on the original design, there was a little potentiometer. But what I did is I kind of removed, you know, to mimic what the 8301 would have. I replaced the input resistors and capacitors and then put a little high pass, sorry, a low pass filter here because the output from this RP2040 is the high frequency PWM. So this comes in, the high frequency is kind of filtered a little bit to smooth out, even though the Class D kind of, you know, obviously it's high frequency as well, but it does remove a little bit of the hiss. And then in here, there's a little bit of a input gain modifier. So the default gain that these have is 24 dB, which is like five times gain, can't remember without my head. But I want one to one gain because I'm actually getting 3.3 volts output from here. So this is actually kind of like a, it's like a current booster voltage follower. It's actually very, not really amplifying. I mean, it's current amplifying, but it's not voltage amplifying. So what you can do with these, I'll show you this one. One of the data sheets does not have a diagram of the internals, but one of them does. And I think it's this one. I'll show you it. Oh, can you go to the computer? Sorry. So this is the inside. And so, you know, you're like, okay, here's how you wire it up. You have differential input. They just have a blocking cap. But what's inside actually is here is that, sorry, it's 15 gain. So there's this 15 times gain because they're expecting you to give it, you know, a couple millivolts, maybe 100 millivolts peak to peak signal, and then it boosts it up and drives your output to three, you know, plus or minus five volts differentially. However, because I'm, my input is three volts peak to peak already, and I want basically three volts output. What you can do is you add another resistor here, 150k approximately, and that turns this gain into one. So this normally is 150k over 10k gain. So you add another resistor on the input. And so let me show you what that looks like here. This is 300k. Ignore these values because these values are not correct. But by adding, like if I have this be, you know, like 140k, this is 140k, and this would actually be 0.1 microfarad. Now I have unit gain. You still have to, even if you have, by the way, it's differential input. If you have single-ended input going into this chip, you'll still need to have this filter going to ground to balance out the differential input. But now I've got the same 3.3 volt in, 3.3 volt out, driving directly to my speaker. You don't need to have a ferret capacitor output, but it's nice if you can fit it on your board. Still very inexpensive, and I always get very nice output from this. Also good for little speakers. And yeah, it's up to three watts. So you can use this for, you know, fairly large for eight-ohm speakers. So this is my pick for debate search. That's a great search.