Forum Rule: Always post complete source code & details to reproduce any issue!
Midi controller relay - noise problem
I'm building up a midi controlled DPDT relay which allows me to bypass my guitar effects. Everything works fine. The relay is isolated with the current drawn to ground by a 2n3904. However, I'm getting this ticking noise each time midi data is received. I'm pretty sure it's Midi interference that's leaking into my audio signal but I cant find what's the issue. This is especially an issue when I send a stream of Midi CC messages into the looper.
The problem still occurs when I remove the 6N138 opto isolator, and even with the microcontroller removed.
How good is your shielding and power supply decoupling?
Can you send pictures/schematics/code?
Is there any chance your code is sending an impulse at the relay because of a coding error in the midi processing?
To test you could run with the code pointing to a different pin. If it's still there then it's not the code.
Originally Posted by Edward
I'm not certain if power supply decoupling is an issue. I removed the microcontroller and opto isolator from the sockets and all that is connected is the midi plug into the midi input, as well as the 1/4" amplifier out to the guitar amp. I just drew the PCB using the schematic I got from midi.org and hence following the midi standard. Midi input shield and center pin are connected to ground only via a 0.1uf capacitor.
I'll take some pictures when I'm back at my workshop.
Last edited by tyzjames; 02-17-2017 at 02:48 PM.
Originally Posted by oddson
Thanks for the idea. No chance of that happening as the problem still occurs even when I remove the microcontroller. I'm wondering if it is a EMI EMC problem
When the Teensy is removed how is the MIDI circuit still connected to the relay?
Whatever the connection... that's where the noise must be coming through. Likely on the ground side if bypassing (removing?) the optocoupler didn't sort it.
If it had it would have pointed to power fluctuation when the optocoupler goes active.
But if you removed it then nothing should be changing on the power side so it must be incoming voltages leaking from the physical MIDI interface circuit presumably through a shared ground with the relay.
...details required to say more... but do check your MIDI-in shielding isn't electrically connected to your circuit.
Maybe a ground loop problem?
On simple way to explore & troubleshoot ground loops involves powering some or even all devices from separate batteries. If some devices are passing power supply currents through sensitive analog grounds, usually you'll discover the problem magically goes away when you remove the power connections and run stuff from isolated batteries. Of course batteries probably aren't a viable solution, but they're at least an easy way to experiment when what's usually a really difficult to understand problem.
Originally Posted by tyzjames
There should be no connection between the shield of the input cable and your circuit... I'm 99.99% sure of this...
I think the cap is less a problem than if it was DC grounded but I would assume non DC changes in the shielding's charge could be heard as clicks.
Last edited by oddson; 02-17-2017 at 08:05 PM.
Got this from the Midi standard:
Originally Posted by oddson
Pin 2 of the MIDI In connector shall not have any DC path to the receiver’s ground. However, a connection through a small capacitor (0.1μF typical) to ground is optional for improved high-frequency (RF) shielding.
The shield connector of the MIDI In jack shall not have any DC path to the receiver’s ground. However, a connection through a small capacitor (0.1μF typical) to ground is optional for improved EMI/EMC performance.
The shield connector of the MIDI Out and MIDI Thru jacks may be unconnected (N/C) or connected to ground for improved EMI/EMC performance.
I'll try removing the caps to see how it works.
Paul and oddson, thanks for the inputs. I'll give your suggestions a go and update the results
I guess it's OK but I'd never seen it implemented like that.
Do check for a DC connection (maybe you have a solder bridge somewhere).
The behaviour you described sounds like it has to come from the physical connection of the input.