midi keyboard interfacing with arduino pressing keys/turning knobs causes pops and clicks

Thread Starter

Green Bean

Joined Mar 31, 2017
126
Ok, I have a midi keyboard connected to my arduino, and I'm using the arduino midi library to read the keyboard and generate a certain frequency square wave signal based on the key being pressed. The signal goes into a speaker. The problem is that whenever I press a key or turn any knobs/wheels on the keyboard, I can hear a clicking, popping sound. Pressing a key makes one little pop, turning the knobs makes a bunch of pops as I turn them, it sounds kinda like zipping a zipper.

What's the issue here? Here's the circuit I'm using to connect the midi keyboard to the arduino:
 

Thread Starter

Green Bean

Joined Mar 31, 2017
126
Sounds like maybe your MIDI signals are creating some electrical noise.

Post some photos of the setup, both MIDI and speaker wiring.
Yes clearly thats the problem. The midi connections can be seen in my original post. As for the connection to the speaker, the output of the arduino goes through a 1m resistor with a 5k resistor to ground (voltage divider) and out to my guitar amp. Sorry i can't take pictures at the moment. But its really simple circuit, i just dont understand how to eliminate the noise.
 
Top