Optocoupler Power Question

dmolnar

New member
Hey, gang. I'm not an engineer, so here goes:

I'm building a MIDI keyboard using optocouplers as switches. Each one is mounted on a small PCB with all necessary resistors, etc. included on the board. I'm using the Teensy 3.3v power into a breadboard.

My code uses the Keypad library to capture switch activations in an 8x8 keypad matrix. When I hook up two using the breadboard to set them up on pin 1, everything is okay. Well, as okay as it can be at this point without a fully wired row/column matrix.

As soon as I add a third, all switches stop working. Rather than getting a board LED off event, it merely dims and no signals are sent out from any of the boards. I get that this is a power issue.

My question is, can I somehow feed each coupler 3.3v for a MIDI keyboard? My keyboard has 64 keys.

Naturally, it works great with reed switches because they're pretty dumb, but I'd much prefer the IR interference method for on/off events. If I can't use them, it's not the end of the world. Trouble is, I know they use them on organ keyboards.

Thanks in advance.
 
Maybe I missed something in your message, but I just don't understand the hardware you're describing.

Normally optocoupler input is just LED. It requires current to turn on. You said you're connecting switches. Normally a switch just connects 2 metal contacts together. Alone it doesn't output current needed to drive a LED. Normally you would need a power source and resistor. But if you do that, would you use 64 separate power sources so each optocoupler input remains isolated from all the others? Or if you connect them all to the same power, then why bother with optocouplers? Maybe I'm missing something?

Optocoupler outputs vary quite a lot, unlike their inputs which are usually just a LED. Some require power, others are just a transistor. Just saying optocoupler without a part number or link really leaves a lot of uncertainty.

Maybe someone else will understand better? But if not, please know (at least to me) your question is very confusing without details like the actual optocoupler part number and a clear diagram or photos of how you're really connecting this stuff. Could help much better if you could at least give that sort those details.
 
Not your bad, just a knowledge/understanding deficit (of which I have plenty).

Not sure about everyone else but I use optocouplers to electrically isolate one side of a circuit from the other, you could think a digital relay vs. a toggle switch.

As an example, I played with coil guns a while back, The system I wired up was controlled by a micro-processor that runs on 3.3v while the coils were fed by banks of high capacity capacitors (at least 480v) via logic level MOSFETs. The MOSFETs needed 5v to be full on. I could have gotten away with having each micro-processor output pin go directly to each MOSFET but (a) 5v for the MOSFET was better and (b) wanted to completely separate the power on the micro-processor side from the high-voltage side (also as I am not a hardware guy, I fully expected to make mistakes and short out something on the high voltage side; did not want to lose everything "when" that happened - fortunately for me it did not).

Each "trigger" pin on the micro-processor went through its own optocoupler. So 3.3v on the micro-processor side [of the optocoupler] enabled 5v on the other side [of the optocoupler] to drive the MOSFET which enabled 480v to a coil. Using the optocouplers I could keep the 3.3v side isolated on a completely separate power source and voltage than the other side of the optocoupler(s). If something on the higher voltage side shorted, it did not affect anything on the micro-processor side of the optocoupler, no blown micro-processor, also back EMF isolation and stuff.

So think faster/better relay instead of toggle switch. Hope this helps.
 
It's ok, don't be shy. Analog electronics can be tricky. We can try to help you get this working to meet your goals. But details matter to have any chance of figuring this out.
 
Hey, gang. I'm not an engineer, so here goes:
.....
Thanks in advance.

Hi - like to help - circuit or schematic diagram is the language we need - words are not the way to explain a circuit topology that's more than a couple of components. Draw out on paper and send a pic here, then we'll have something to work with...
 
Back
Top