Electronic Melodica Circuit Feedback - Page 1
Forum section: electronics / projects

author: elefurtronik
author_rank: Regular Contributor
timestamp: April 22, 2023, 10:29:21 pm
content: Hello,I designed an electronic melodica. I focused on class A amplifier and I especially need feedback about the amplifier circuit. Besides that, if you have any suggestions for other parts of the circuit, I will appreciate it.

author: Kim Christensen
author_rank: Super Contributor
timestamp: April 23, 2023, 03:21:21 am
content: Amplifier is unnecessary. You could drive the speaker directly from the 555's pin 3 via a coupling capacitor.

author: elefurtronik
author_rank: Regular Contributor
timestamp: April 23, 2023, 05:42:40 am
content: Quote from: Kim Christensen on April 23, 2023, 03:21:21 amI have never designed an amplifier. Therefore, I wanted to experience it. Besides that I wanted to make the calculations

author: BadeBhaiya
author_rank: Regular Contributor
timestamp: April 23, 2023, 07:54:43 am
content: Quote from: elefurtronik on April 23, 2023, 05:42:40 amYou will see massive amounts of clipping. I suggest you decrease the gain, and also add a bypass cap across R10Also a filter to smooth out the PWM from the 555 would be a good move

author: elefurtronik
author_rank: Regular Contributor
timestamp: April 23, 2023, 11:08:16 am
content: Quote from: BadeBhaiya on April 23, 2023, 07:54:43 amHello Bade,I have several questions. I hope you can help me with those questions.Why do you think that I will see a massive amount of clipping?How can I decrease the gain?How to define the value of this bypass cap value across the R10?How can I smooth out the PWM from the 555? If with a capacitor, how to calculate this value?

author: elefurtronik
author_rank: Regular Contributor
timestamp: April 23, 2023, 06:57:05 pm
content: Any help?

author: mariush
author_rank: Super Contributor
timestamp: April 23, 2023, 07:14:37 pm
content: Replace the 9v battery with 3-4 AA or AAA batteries. You'll have much longer life, and they're more common and cheaper... and you probably won't need a regulator because a 555 can handle the voltage and the amplifier below can do up to 6v (fresh alkaline batteries may have up to 1.65v but rechargeables are 1.35v at most). With 3 batteries, you'll be in the 3v...5v range which is perfect.You could just use a cheap class D amplifier IC for higher efficiency... a PAM8302 is under a dollar and only needs some ceramic capacitors.Amplifiers likeIS31AP4991AorIS31AP2005are equally easy to use.

author: elefurtronik
author_rank: Regular Contributor
timestamp: April 23, 2023, 07:21:13 pm
content: Quote from: mariush on April 23, 2023, 07:14:37 pmThanks Mariush. I will check those ICs.Could you also have a chance to answer my questions in my prior post, please?

author: Kim Christensen
author_rank: Super Contributor
timestamp: April 23, 2023, 07:36:15 pm
content: QuoteBecause the output of the 555 is a 4-5V square wave... If you overdrive an amplifier hard into clipping, what you get is almost a square wave.But, even if it was a 4V sinewave, your amplifier would go into clipping because it's gain is more than 2. ie: it operates from a 9V supply so the max peak to peak waveform it can produce will be less than 9V.QuoteYou can decrease the gain by adjusting the ratio of R8 to R10... ie: If R8 = R10 the gain would be close to 1QuoteI'll leave this for later... But it's value will effect the lower end of the amplifier's frequency response... So that depends on what you want that to be.QuoteYou could use an RC lowpass filter... Again many variables, depending on exactly what you want to do and how you want it to sound.Here's an example of adding a simple RC Lowpass filter. It has a 3db "cutoff" at around 590Hz but it's a gentle roll off.. (-20db at 6Khz) Plus it attenuates the signal amplitude 7:1.My calculations might be a bit off because I made some assumptions about the amplifier input impedance... So take it with a grain of salt and it's more to show a general example.Also, that amplifier is not designed to drive an 8 ohm speaker, so it won't be very loud.EDIT: Removed the diode across speaker. (Why didn't I see that?)

author: elefurtronik
author_rank: Regular Contributor
timestamp: April 23, 2023, 09:00:51 pm
content: Quote from: Kim Christensen on April 23, 2023, 07:36:15 pmI set the offset value with R8. As I produce a square wave, does clipping affect me?If my 555 Timer output is 4V my output will be Vc? My R8 has a 5.1V voltage drop on it, does that mean my maximum amplification will go up to 5.1V and after that, it will be clipped.So Is it better to have a lower gain? Why? If I have a higher gain, I can have a high amplitude signal right? That means my signal can be louder.I just want to have a louder and amplified signal. Therefore, I still don't know how to set the standard here and define the capacitor value for Re.Why do I need to remove the reverse diode? As the speaker is an inductive load the back EMF can burn my transistor, right?

author: Kim Christensen
author_rank: Super Contributor
timestamp: April 23, 2023, 10:53:56 pm
content: Quote from: elefurtronik on April 23, 2023, 09:00:51 pmNot really. It's already a square wave. (unless you use a lowpass filter after the 555) So clipping a square wave results in... Drum roll... A square wave.QuoteWithout an 8speaker attached:When driven into clipping, the output of your amplifier will swing between +1.4 and 9V for a total of 7.6V peak to peak. (Rough estimate. It will be a bit less)With an 8speaker attached, you'll get less than a volt of swing because the amplifier's output impedance is relatively high. (Equal to R8)QuoteIf you want to avoid clipping, then yes. Listening to music that's clipped sounds awful.QuoteTo a point. Once you're already hard clipping, having more gain isn't going to make it louder.QuoteIf you want it louder, then that amplifier isn't going to cut it.An easier solution is to use the bipolar version of the 555 (Powered from 9V) and drive the speaker directly from pin 3, like I mentioned before.If you want to build an amplifier to drive a speaker, then you'll need a different design. Since you're just amplifying a squarewave, a simple unbiased push-pull design would work. (But why?)QuoteC7 decouples the signal so that the signal can swing above and below ground. A diode placed across the speaker would prevent the signal from going more than 0.7V below ground.R8's resistance will dampen any inductive spikes enough that the transistor will be OK. There are ways to protect the output of amplifiers from inductive spikes, but putting a diode across the speaker is not it.Instead, you'd put two diodes on the other side of the coupling capacitor (C7) like this:

author: elefurtronik
author_rank: Regular Contributor
timestamp: April 26, 2023, 09:17:00 pm
content: Thanks for all the answers.I chose one class D amplifier IC. However, I don't know how to connect my 555 timer output to that IC. It has a differential amplifier and wants two inputs from me. I have only one input which is the output of the 555 timer.Can I use the design example for single-ended input in the datasheet?Datasheet:https://www.ti.com/lit/ds/symlink/tpa2011d1.pdf?ts=1682543141801&ref_url=https%253A%252F%252Fwww.ti.com%252Fproduct%252FTPA2011D1%253FkeyMatch%253DTPA2011D1%2526tisearch%253Dsearch-everything%2526usecase%253DGPN

author: Kim Christensen
author_rank: Super Contributor
timestamp: April 26, 2023, 09:37:32 pm
content: Quote from: elefurtronik on April 26, 2023, 09:17:00 pmYou could... But this IC is in a tiny 1.21mm x 1.16 mm DSBGA package. It would be impossible for anyone to solder without special equipment.

author: elefurtronik
author_rank: Regular Contributor
timestamp: April 26, 2023, 09:47:10 pm
content: Quote from: Kim Christensen on April 26, 2023, 09:37:32 pmHi Kim,I think I can find some other packages or let some pcb companies to assemble this part on the PCB and send me but my question is how I can use this component on the schematic with 555 timer output?

author: Kim Christensen
author_rank: Super Contributor
timestamp: April 26, 2023, 09:58:25 pm
content: You can. You'd have to add some attenuation to bring the level down. A volume control would be a nice feature too. Are you going to build the 555 circuit on another PCB using your own design/build?EDIT: Or buysomething like this.

author: donlisms
author_rank: Frequent Contributor
timestamp: April 27, 2023, 02:52:26 am
content: My only suggestion is to not get very tied into the design at first; build a prototype and see if you like the tuning. If you're not using a regulator, it seems like the timing (tuning) will depend on the battery levels. And then there are those resistors, with ratios that seem odd to me, with fairly low precision in the ratios (two digits). But I haven't done the 555 math, so maybe it's not as odd as I think! Just a thought. Prototype. But by all means, have fun!

author: elefurtronik
author_rank: Regular Contributor
timestamp: April 27, 2023, 07:03:06 pm
content: I would like to learn how to design a circuit with those class D amplification ICs.One of those ICs is also ok as Mariush suggested.QuoteHowever, the problem is I have only one input. Even though I use PAM8302, it has A+ and A-. I don't know where I can connect my signal on it. Besides that even I connect my signal to one of them, I don't know what to connect to the other.Quote from: donlisms on April 27, 2023, 02:52:26 amI calculated the values. They're fine but I will need series of resistors to catch the exact value that I calculated there.

author: Kim Christensen
author_rank: Super Contributor
timestamp: April 27, 2023, 07:14:21 pm
content: Quote from: elefurtronik on April 27, 2023, 07:03:06 pmJust follow the datasheet examples for singled ended input: