2
\$\begingroup\$

I built a simple MIDI-output circuit (as seen here: http://www.notesandvolts.com/2015/03/midi-for-arduino-build-midi-output.html). I now would like to add an LED to that circuit that should be on unless there is a signal sent. This behavior can be found in most of the common MIDI-interfaces.

I'd really like to not add an LED to an extra port of my microcontroller but instead use the already present signal on the TX pin and lighting an LED with it up.

I tried to connect an LED directly to it as shown here:

schematic

simulate this circuit – Schematic created using CircuitLab

That works well (except for inverted behavior – but that could easily fixed by an inverting Schmitt-Trigger) but I fear that using this way will reduce the signal quality on the MIDI-line. So I'm trying to implement an circuit with OpAmp as shown here. Unfortunately even with the suggested fix of a voltage divider in the comments (e.g. 4.7k and 10k resistors) I only get the normal behavior.

Is there any decent way to solve this problem? On multiple commercial pcbs with this exact function I do not see any OpAmps. So maybe there is an even better way?

Thanks in advance for any input!

\$\endgroup\$

2 Answers 2

2
\$\begingroup\$

So when Tx is high, the LED will be off right? So why not connect the LED circuit between Tx and ground: -

enter image description here

Now, when Tx is high, the LED will be on.

\$\endgroup\$
12
  • \$\begingroup\$ Thanks! Already tried that, but the LED visually doesn't turn off. I'm not sure, if that's maybe because the LOW logic level isn't 0? Unfortunately that also doesn't solve the problem of putting load on the TX-line. Or isn't that bad at all? \$\endgroup\$
    – H. Müller
    Jan 20, 2017 at 18:37
  • \$\begingroup\$ Try putting a resistor of maybe 1 kohm value across the led or, try putting a diode in series with the led. Maybe try two diodes or three. Experiment a bit. \$\endgroup\$
    – Andy aka
    Jan 20, 2017 at 19:07
  • \$\begingroup\$ Thanks for the suggestion. I tried all of that with the only result, that the LED gets dimmer and doesn't invert it's behavior. (Of course I tried various resistor-values and diodes). \$\endgroup\$
    – H. Müller
    Jan 21, 2017 at 12:51
  • \$\begingroup\$ It has to invert its behaviour. \$\endgroup\$
    – Andy aka
    Jan 21, 2017 at 13:30
  • \$\begingroup\$ Sorry. I meant that it doesn't blink but stays on all the time. \$\endgroup\$
    – H. Müller
    Jan 21, 2017 at 20:35
1
\$\begingroup\$

After much tinkering I got a schmeatic that does exactly what I need:

schematic

simulate this circuit – Schematic created using CircuitLab

While the TX-line is high the LED is staying on. When the TX-line drops low, the capacitor discharges quickly via D1. Once TX comes up high again, first the capacitor is charged over R1 which requires some time. D2 stays off for that while, it blinks. Because of the relatively big R1, the TX-line shouldn't be affected at all. R2 is needed so that C1 doesn't discharge over D2 and destroying it in the process.

If anyone has an idea of optimizing that circuit: please share. I'm really interested! I chose R1 and C1 as shown as I already have the components on other places on my PCB, keeping the component type count low.

\$\endgroup\$

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

Not the answer you're looking for? Browse other questions tagged or ask your own question.