Adafruit mono 2.5W Class D Audio Amplifier - PAM8302 not working

Hello, I have bought this item, and I want to amplify a sinusoid signal of 1khz. This is what I take from its output...

What is wrong??

Not a lot to go on here.

What is the source of the audio?
What is the schematic of your setup?
How is that scope connected in your circuit?
Why does the photograph not show where the wires are going?

Do you even know what a class D amplifier is and what sort of signal do you need to drive it with?

I will send the pictures...ASAP. Also what is the gain of this:

The LM386 is a completely different chip and it's not a class-D amplifier.

Do you have a speaker connected? The PAM might require a speaker (or similar load). It also has a differential output, so don't ground the -speaker output with the 'scope! You can connect the scope-ground to the amplifier-ground and check the + & - outputs separately.

Do you have a link to the datasheet for the actual amplifier board you're using, or did you buy something cheap with no specs? "PAM8302" is the part number for the amplifier chip, not the board assembly.

What's the 1kHz voltage? I assume you can see the 1kHz signal on your 'scope?

The signal is 0,5Vpp - 1,5Vpp

No, I do not have a speaker connected...

I connect the output to a Retriggerable Monostable Circuit.

Adafruit Mono 2.5W Class D Audio Amplifier - PAM8302 : ID 2130 : $3.95 : Adafruit Industries, Unique & fun DIY electronics and kits

Sorry, I didn't read the title carefully.

The signal is 0,5Vpp - 1,5Vpp

That's fine.

No, I do not have a speaker connected...

Since it's a class-D amplifier it might want a load.

I connect the output to a Retriggerable Monostable Circuit.

In that case, you shouldn't be using an audio power amplifier that's meant to drive a speaker.

If the signal is to low to trigger the monostable circuit, an op-amp comparator might be a better solution.

DVDdoug:
Sorry, I didn't read the title carefully.
That's fine.
Since it's a class-D amplifier it might want a load.
In that case, you shouldn't be using an audio power amplifier that's meant to drive a speaker.

If the signal is to low to trigger the monostable circuit, an op-amp comparator might be a better solution.

Hello...

Do you suggest any compatible op-amp?
Is the LM386 ok?

Thank you...

Have you already got a design for the monostable circuit you are attempting to retrigger ?
What is the source of the 1kHz signal ?
Maybe say in more detail what you are trying to achieve. Are you for example, going to raise an alarm if there has been no signal for more than say 10 seconds ?
Or are you attempting to use the monostable to shape the sine wave input or what ?

I want to supply the attached analog circuit with a signal coming from a function generator. And between the analog (attached) circuit and the signal generator I have connected the amplifier.

New shortcut.lnk.pdf (18.3 KB)

Hi,

alex5678:
Adafruit Mono 2.5W Class D Audio Amplifier - PAM8302 : ID 2130 : $3.95 : Adafruit Industries, Unique & fun DIY electronics and kits

The signal is 0,5Vpp - 1,5Vpp

No, I do not have a speaker connected...

I connect the output to a Retriggerable Monostable Circuit.

What is your signal generator?
What size signal do you need to trigger the monostable circuit?
What is the monostable circuit?

Thanks.. Tom.. :slight_smile:

I give an input of 0,5 Vpp - 1,5 Vpp, and I want to amplify it by a gain of 3.

The monostable circuit is the attached circuit on my previous comment (#8)...

Thank you

The monostable circuit is the attached circuit on my previous comment (#8)...

No it is not. There is just a box that says "Arduino input set for -ve trigger interrupt" What pin is this going to and what is the value of R2?

I give an input of 0,5 Vpp - 1,5 Vpp, and I want to amplify it by a gain of 3.

First off nothing is going to come out of that transistor with a voltage under 0.8V.

Why use the capacitor?
Why put it the wrong way round?

You can't control the gain of a circuit like that, it is set by the physical characteristics of the transistor.

Grumpy_Mike:
No it is not. There is just a box that says "Arduino input set for -ve trigger interrupt" What pin is this going to and what is the value of R2?
First off nothing is going to come out of that transistor with a voltage under 0.8V.

Why use the capacitor?
Why put it the wrong way round?

You can't control the gain of a circuit like that, it is set by the physical characteristics of the transistor.

I want to amplify the signal before connecting it to the analog circuit (attached in comment #8).

Thank you..

It is still not very clear what you are doing with the signal in the Arduino but:

a) if the goal is to feed the output of the function generator into an Arduino, you can do that directly to an analog pin and do any pulse clean up/shaping in a simple sketch.

b) you can use an op amp to condition a signal (as has been said) if you really want to use your "add on" circuit.

The conection is this:

function generator-----> amplifier----->monostable analog circuit------>Arduino nano

Hi,
As has been suggested, why can't you do this.

function generator(0.5 to 1.5V) ------>Arduino nano(analog pin 0 to 5V sensitivity)

Program the Nano to respond as if a pulse has been on the input?

Can you tell us your electronics, programming, Arduino, hardware experience?

Can you post a diagram of the waveform coming from the generator specifically how the signal is with respect to gnd.

Thanks.. Tom... :slight_smile:

TomGeorge:
Hi,
As has been suggested, why can't you do this.

function generator(0.5 to 1.5V) ------>Arduino nano(analog pin 0 to 5V sensitivity)

Program the Nano to respond as if a pulse has been on the input?

Can you tell us your electronics, programming, Arduino, hardware experience?

Can you post a diagram of the waveform coming from the generator specifically how the signal is with respect to gnd.

Thanks.. Tom... :slight_smile:

Hello,

The circuit that I have posted in comment #8, takes the analog input and transforms it in 0/5 Volt discrete pulse with variable duty cycle corresponding to the frequency of the input signal. So I can process it with the Arduino. The problem now is to choose the right amplifier. I will try LM386 to see what happens, since the type D-amplifier doesn't work...

I am amateur/hobbist on Arduino and I have done small projects (just for hobby) with servos, sensors, GPS, PV, smart metering etc, and I know C,C++,python...

Thank you...

The circuit that I have posted in comment #8, takes the analog input and transforms it in 0/5 Volt discrete pulse with variable duty cycle corresponding to the frequency of the input signal.

No it does not do that.
The pulse width output depends upon the frequency and the amplitude of the input signal because it only triggers a pulse when the amplitude exceeds 0.7V. So for a low audio signal the pulses will be very short but as the volume increases they will get longer. The duty cycle is proportional the amplitude and the pulse repetition rate is proportional to the frequency.

To do what you want you need to turn the audio signal into a square wave, this can only be done with an opamp acting as a zero crossing detector.

What I want to achieve is the following...

noise --- start of sound --- end of sound --- noise.

I want to indicate when the sound starts and when the sound ends. The sound will be 300 Hz - 6000 Hz. And the signal without amplification is 0,5 Vpp - 1,5 Vpp.

alex5678:
What I want to achieve is the following...

noise --- start of sound --- end of sound --- noise.

I want to indicate when the sound starts and when the sound ends. The sound will be 300 Hz - 6000 Hz. And the signal without amplification is 0,5 Vpp - 1,5 Vpp.

I guess from one of your previous posts, you want to switch a relay when sound is detected.

You could use this: https://www.ebay.com/itm/Microphone-Sensor-High-Sensitivity-Sound-Detecte-Voice-switch-Module-For-Arduino/311655372171

Clearly you don't want the relay to switch off immediately the sound level drops, otherwise it would switch at each pause between words, so you want an overrun of some seconds.

Another alternative has been suggested before. You are using a nano (5volt). A voltage level of 0.5 volts on an analog pin gives an analogRead() value of 102. If the reading as at 102 or above, you want the relay to switch on and stay on for a few seconds even if the value drops below 102. To achieve the delay, you keep resetting a timer in the loop() while the sound level is above the threshold. You also test the timer in the loop() and, as soon as it expires, you release the relay.
The upper voltage range of the output is irrelevant provided it is 5 volts or under.
If frequencies outside your range cause a problem, then it gets more complicated and some filtering has to be applied.