Author Topic: MIDI Input - what to check for Optocoupler  (Read 1433 times)

0 Members and 1 Guest are viewing this topic.

Offline SaimounTopic starter

  • Frequent Contributor
  • **
  • Posts: 570
  • Country: dk
MIDI Input - what to check for Optocoupler
« on: November 24, 2023, 09:58:09 am »
Hi :)

I have two general questions about designing a MIDI input circuit:
  • What specs to look out for when choosing the optocoupler?
  • How to choose the pullup resistor value on the output?

Attached is the suggestion circuit from the MIDI spec. They suggest 280 ohm for the pullup resistor, with PC900V optocoupler. That sounds like a big waste of energy IMHO?? (At 3.3V that would mean a 11mA current!) Or is this for a faster rise-time?

Hoping to get some insights :D

Thank you!
 
The following users thanked this post: grantb5

Offline Andy Chee

  • Super Contributor
  • ***
  • Posts: 1089
  • Country: au
Re: MIDI Input - what to check for Optocoupler
« Reply #1 on: November 24, 2023, 10:06:55 am »
You’re correct about rise time.

MIDI operating at 31,250 baud requires reasonably clean edges. And being a current loop precludes the conventional high speed solution of a totem driver.
 

Offline WimWalther

  • Regular Contributor
  • *
  • Posts: 94
  • Country: us
Re: MIDI Input - what to check for Optocoupler
« Reply #2 on: November 24, 2023, 10:48:48 am »
Energy or power?

You're only wasting 39mW..
 

Offline SaimounTopic starter

  • Frequent Contributor
  • **
  • Posts: 570
  • Country: dk
Re: MIDI Input - what to check for Optocoupler
« Reply #3 on: November 24, 2023, 11:49:02 am »
You're only wasting 39mW..
Thanks for the reply - and yes IMO that's a lot for a simple input circuit. Modern devices consume very little, the whole project uses about 250mW of power :)
 

Offline shapirus

  • Super Contributor
  • ***
  • Posts: 1625
  • Country: ua
 

Online oPossum

  • Super Contributor
  • ***
  • Posts: 1447
  • Country: us
  • Very dangerous - may attack at any time
Re: MIDI Input - what to check for Optocoupler
« Reply #5 on: November 24, 2023, 01:16:32 pm »
You're only wasting 39mW..
Thanks for the reply - and yes IMO that's a lot for a simple input circuit. Modern devices consume very little, the whole project uses about 250mW of power :)

MIDI generally has a low duty cycle so power use will be lower than 39 mW.
 

Offline SaimounTopic starter

  • Frequent Contributor
  • **
  • Posts: 570
  • Country: dk
Re: MIDI Input - what to check for Optocoupler
« Reply #6 on: November 24, 2023, 02:37:28 pm »
Fair enough, good point - I guess the transistor (inside the optocoupler) cannot pass through all those 11mA of current so it will be less.

But anyways - nobody has answered my 2 questions yet  ::)

Doing some research myself, I found that the most important is that the rise time and fall time works with the MIDI speed (the MIDI spec says 2us max). I believe this is influenced by the CTR and rise/fall time of the optocoupler, as well as the output resistor.

I also found out that if the CTR is too low, one can add an extra NPN on the output to boost/speed up the signal? Something like the attached circuit. Any thoughts?
« Last Edit: November 24, 2023, 02:39:58 pm by Saimoun »
 

Offline CaptDon

  • Super Contributor
  • ***
  • Posts: 1997
  • Country: is
Re: MIDI Input - what to check for Optocoupler
« Reply #7 on: November 24, 2023, 02:54:16 pm »
MIDI devices 'expect' at least 10 ma. of drive current because there are devices out there that were built in the days of the 4N25 style couplers. MIDI source open circuit voltage is usually 5vdc. With a 1.4 volt drop across the opto LED and a .7 volt drop across the opto transistor (usually less but design for worst case) you have 2.9 volts remaining (not to mention connector and cable losses) so at 10 ma. that calculates to 290 ohms not counting stray losses. Therefore 270 ohms is about right on the money!!! Remember, there is NO direct ground path between MIDI devices via the MIDI data cable to eliminate 'ground loop' hum. I play a Casio MG-510 MIDI guitar on stage and I built a custom passive 'belt-pack' type device which has a multi-shielded multi-pair 20 foot 'umbilical cable'. The pack on my belt includes a connection for my headset microphone with a mute toggle switch, it includes a Monitor Return audio path for my headset along with a padding resistor to drop the audio power and a wirewound pot to adjust the monitor headphone level. In addition there is a 3 ft. MIDI cable hanging out of the belt pack which plugs into the MG-510 AND I have two ultra high brightness red LED's riding the MIDI send and return signals through 2.2K resistors. They barely light up but indeed show me if MIDI data can flow in both directions. This has been handy if my MG-510 is driving someone else's MIDI kludge pile!! (I know my nightmare works!) Cheers Mate!
Collector and repairer of vintage and not so vintage electronic gadgets and test equipment. What's the difference between a pizza and a musician? A pizza can feed a family of four!! Classically trained guitarist. Sound engineer.
 
The following users thanked this post: Victorman222

Offline Andy Chee

  • Super Contributor
  • ***
  • Posts: 1089
  • Country: au
Re: MIDI Input - what to check for Optocoupler
« Reply #8 on: November 25, 2023, 06:23:36 am »
With switch mode power supplies becoming far more common since the MIDI spec was documented, it might be worthwhile investigating whether modern gate drive optocouplers can do the job, like:

https://www.onsemi.com/pdf/datasheet/fod3150-d.pdf
 


Share me

Digg  Facebook  SlashDot  Delicious  Technorati  Twitter  Google  Yahoo
Smf