Midi in

Ok, this is driving me nuts!

Im making a midi in for arduino. Im using the schematic below (Expect i use a 4N27). I cant seem to get it work. The optocoupler works. When i hook a LED to it, and use 5v, i can switch it on/off. But when i hook it up to my midi cable (Korg), nothing happens. Like the voltage is to low to switch anything... Wierd thing is when i hook a LED on pin 4 & 5 of the midi cable the LED flickers, almost on the beat... So i have no idea where to look.

did you try reversing connections on the midi side?
if your korg's signal can drive an LED it should be able to drive the optocoupler as well.

if that direct-to-cable LED is rather dim, maybe reduce the 220[ch937] resistor to something smaller but still large enough for some basic protection. 110 or 50[ch937].

also note how the setup inverts the signal, so with no (midi) input the output is HIGH. (depending on your test LED the current provided through the 3.3k[ch937] might not be enough to prove that optically :-/ )

Measure the voltage drop on that 220 Ohm resistor.

You can have 20mA with no problems on the MIDI line. It should be enough to properly bias the LED and transfer light to the transistor.

As KUK said, you may have to low the 220 Ohm resistor.

Have a try and post it here.

Just to add that, as far as i'm concerned, someone really should label the midi socket "seen from in/outside" in this widespread midi-in schematic. I still haven't found the right way ;D :-[

Thats curious.

I made myself an MIDI Patchbay, and had to test it with a MIDI footpedal.

Well... before i had the footpedal, i had to open my guitar preamplifer, a Carvin, to figure out how the MIDI was really connected.

Still... i managed to find the schematic of the unit, and then i found how could i get info from the MIDI THRU of my Carvin...

nevertheless, MIDI is a straightforward current loop, one need just to give a decent current to the LED, and thats it. Custom baudrate by the way.

:wink:

Ok i tried it without the whole optocoupler thing (what the heck), and it works perfectly, even with the 220K in between... And i cant be the parts, i swapt them all for others...

I dont even get with the use the darn thing (ok to seperate circuits)... But why you dont need one with midi out then ?? :-/ Whats the worst that could happen when not including the opto?

Not using the opto, can lead to several problems regarding the system not having galvanic isolation.

Galvanic isolation is important, especialy in hardware like this, that has to work in all types of environments.

For ex., a stage in a life concert, is one of the worst places to be, regarding EMI and all kinds of electrical noite.

If the equipments are not galvanic isolated of each other, there may be ground loops, EMI loops... crap all around.

Believe me, it is best to use the opto.

Its strange that it does not work. Have you measured the Voltage Drop of the resistor, and of the opto LED ?

>Ok i tried it without the whole optocoupler thing (what the heck), and it works perfectly, even with the 220K in between... And i cant be the parts, i swapt them all for others...

wait a minute, 220k you're saying? it should be 220 ohm only...
But I was having the same problem, and even lowering it to 47ohm it wouldnt' work for me. When I finally removed the resistor altogether it worked...