Hello everyone,
I am working on a PA system-like project in which there is an electret mic and an Arduino Nano to play 3 different horn sounds(WAV) using the TMRpcm library on different button presses. In this project the audio positive side is switched between the mic and the arduino using a switch. Both the arduino and the mic share the same ground wire, so the only thing determining which one is on the positive wire, is the switch.
Everything is powered by a 12 volts DC supply and the wire coming from the switch and the ground wire go to a 3.5mm jack that can be connected to an amplifier.
Since the electret mic does not have sufficient level for the audio amplifier, I have to use a circuit to pre-amplify it (I will leave a picture of the circuit below).
At first, it was opporating normally on the correct volume level* without any issues while I tested with my pre-amp + guitar amp. Then I was testing it with my pre-amp + own amplifier** to figure out if everything is working fine before putting them all in their final place; here is when I noticed that the sound level is significantly lower and does NOT change with my amplifier volume knob (It did change before this issue, however, now volume change can only be noticed in the starting position of the volume knob and after that the volume is constant, even if you turn the volume to the max.).
*By "correct volume level", I mean that if you were to set the amp volume to half, the output sound is really loud, as oppose to the Nano output where even if you max out the volume, it is barely any loud.
**My own amplifier consists of 3 components. First the audio runs through the my pre-amplifier circuit for the electret mic to be on the correct level. Then it is run through a passive pre-amp for me to be able to control the volume, bass and treble, and lastly, it goes in my TDA8932 amplifier.
Here are the things I tested to make sure that it is NOT related to my code or my wiring:
-
I tested with a simple code using tone() function, outputting on the same arduino pin and got the same resaults. The signal was weak.
-
I tested the same codes (both the TMRpcm code and the simple tone()) on a Leonardo and got the correct volume level.
I am posting here because I did not change any wirings or code when this happend. As I mentioned, it was outputting at the correct volume level before connecting it to my own amp circuit.
And one last important fact to keep in mind:
As mentioned above, both the arduino and mic, opporate on the same audio wire, just not at the same time. Given that, due to lack of space, both of them have to go through my pre-amp circuit, although it is unnecessary for the arduino (because it is already at the correct signal level for the amplifier).
So, do you have any ideas about what might have caused this to happen? I would be happy to give more information if needed.