MIDI Output OK when USB powered, not stand-alone

Help!

I've got a nice little project using a Mega2560 where MIDI messages are sent to a couple of HC-O6 Serial Bluetooth modules by some instruments I'm making, picked up on Serial1 and Serial2, the messages are then pumped through to a MIDI connector using Serial3.

A USB MIDI cable is then connected the the MIDI connector 'run by' Serial3. (I'm writing the data out myself using Serial3.write, not using a wrapper library.)

It works perfectly if the Arduino is drawing power from the PC that the USB MIDI cable is also connected to, but when I use an external power source it doesn't. Flashing lights and things tell me that the sketch is still running, and I can switch to USB power while it's running and it'll work quite happily again.

Curiously, if I connect the GND on the Arduino to USB GND, while the Arduino is on external power, it's happy again.

I'm not attempting to pull power from the MIDI.

I've continuity checked the GND and other lines to the MIDI connector - they're OK.

As documented on many sites for this MIDI/Arduino connecting technique there's a 220 ohm resistor between pin 5 (Serial3 TX) and pin 4 (VCC) of the MIDI connector. Pin 2 is connected to GND.

Has anyone else experienced this and overcome it somehow please? I need to have the Arduino powered by a battery pack.

Thanks in advance.

Looks like the device you are sending the midi messages to hasn't got an opto isolator on the input, but is using some kind of direct input.

Grumpy_Mike - you’ve done this sort of thing before, haven’t you?

I had a look on the interweb and found this:

http://www.arvydas.co.uk/2013/07/cheap-usb-midi-cable-some-self-assembly-may-be-required/

My spudger and I cracked open the MIDI/USB case and it appears to be as you suggested.

Attached is a photo from the link above showing where the opto isolator ought to be, with my dodgy MIDI thing cracked open above it, devoid of the components in the gap highlighted.

Thanks for the guidance. I was going slightly nuts!

Mark

...and taking it one step further, I've just plugged it into a different make of USB/MIDI thing and I have noise!

Wish I'd posted to the forum many hours earlier.

you've done this sort of thing before, haven't you?

Well actually I have never come across this before but it was all I could think of that would give the symptoms you described.

Glad you got it working. ;)