Go Down

Topic: Speaker/amp loud buzz playing .wav files (Read 171 times) previous topic - next topic


Hello everyone, this is my first post on this forum. This is also my first project using any sort of Arduino controller.  I am currently following a guide for building a lightsaber based on an Arduino Nano. This is the instructable if you want to take a look https://www.instructables.com/Arduino-Based-Lightsaber-With-Light-and-Sound-Effe/. Everything seems to be working fine except for the speaker, which is playing .wav sounds, but is sounding very bad. 

The program plays a "hum" sound on a loop from a connected micro sd card, and when you swing the lightsaber it should temporarily stop the "hum" sound and play the "swoosh" sound until completion; where the "hum" will then cut back in and continue its loop. The problem is that instead of a "hum" noise, it is a loud buzzing sound. When I swing the lightsaber and the "swoosh" noise cuts in and sounds fine for the duration that it plays. 

I have tried using other .wav files in place of the "hum" noise that I am trying to play, but the buzzing sound still sounds the exact same. Turning down the volume made the "swoosh" sounds quieter, but the buzzing noise was still just as loud. The program is using tmrpcm to control all of the .wav files, if that helps. 

I am using a 4ohm 3W speaker, an Arduino Nano, XM1584 DCDC step down (drops the 11.1v battery down to 4.5v for the amp), and PAM8403 amp. The sounds are all 8 bit, 16kHz, mono .wav files. 

I have attached the .ino file for the code below because it is a very large program. The wiring diagram is also attached 

Thank you for the help!


This is the instructable if you want to take a look
I would rather take a bath in cold sick. It is a very bad site and virtually all electronics projects are written by rank beginners with an inflated idea of their own ability.

That circuit you posted looks like a typical instructables mess.
Where are all the capacitors?
Why is one input of the amplifier open circuit?
What is A6 doing being fed with a fixed voltage?

So a 1000uF capacitor on the power input pins of the strip. Another one on the power and ground of the amplifier. Then connect the right input of the amplifier to ground.
See if that improves things?

You also seem to have connected an SD card to a 5V system. Does it have level shift circuits on this board?   


I connected the two 1000uf capacitors and wired the right amp input to ground. It's still buzzing in the same way. The micro sd card reader does have a built in level converter chip. 


Ok, so next put a capacitor in series with the Arduino output and the amplifier input about 4u7 with the positive side to the Arduino. Also add a 4k7 resistor from the amplifier input to ground.
The idea is the amplifier's input impedance is so high it is picking up noise and the capacitor gives yo an AC signal from the pulsed DC from the Arduino.


I added the 4.7uf capacitor and the 4,700 Ohm resistor and still no luck. Sounds the same unfortunately. 


Can you post a picture so we can see the general way things are actually connected.

Basically you have pickup and this can be improved with a tidy layout.


Jan 15, 2021, 12:24 am Last Edit: Jan 15, 2021, 12:28 am by LB801
The wiring is a bit messy so perhaps I should rewire a few of the boards. Is this caused just by how close the amp is to other voltage sources?


Here's a better view of the connections 

Go Up