Hi everyone!
I'm making an alarm that turns on a led light and plays an audio when a PIR detects movement. This are the connections (I know its a bit messy):
The batteries represent a USB ac-dc, 220v to 5v voltage reused from a phone charger. The three wires going to the right are a home wire.
My issue is that when the volume is at its max (this is required) there is some high pitch noise coming from the speaker when there is no sound playing. Also, the voice is not as crisp as I think it should be.
Searching a bit I've found that capacitors might be a solution but as I'm fairly new to the hobby and I don't know much about electronics, I dont know which one to use or where to put it: right bewteen the power supply and the arduino nano, between the arduino nano and the audio amplifier or between the amplifier and the speaker? I tried using a different power supply for the amplifier but the issue remains.
I'd be very thankful if anyone could help me with this or even provide more tips on how to reduce the speaker high pitch noise when not playing.
Thanks in advance!
Edit: if capacitors are the way to go, how do you calculate which one is needed?
For the audio I'm using a DFPlayer mini connected to a 5v audio amplifier with a potentiometer. The audio file is a .mp3 recording of my voice.
The led light represents an outdoor led light that works on 220v. Thats why is connected to the home wire without a resistor.
