0
\$\begingroup\$

I'm currently trying to implement an opto-isolator into my project currently I have my code to run perfectly with out the implementation, but I was wondering how I can effectively control my RG LED (which I am restricted to using a common cathode)

I know my schematic is wonky :p I was just trying to properly interface my opto-coupler before I change my schematic.

Basically I want to know if there is a way to control the RG LEDs based on if I output from my Green or Red terminal of the Arduino with one optocoupler. (I will be implementing up to 12 RG LEDs and have a few 4-channel isolators)

Thanks in advance!!

\$\endgroup\$
10
  • \$\begingroup\$ Red and Green are shorted? I imagine these are MCU outputs? Are you sure it is working? \$\endgroup\$
    – Eugene Sh.
    Commented Oct 12, 2017 at 14:54
  • \$\begingroup\$ Sorry I should have specified. Red and Green are completely separate pins from my Arduino i.e. Red = pins A0~A11 Green = pins 2~13 \$\endgroup\$
    – dm41nes
    Commented Oct 12, 2017 at 15:06
  • \$\begingroup\$ Which is exactly the problem I am talking about. You are shorting them. \$\endgroup\$
    – Eugene Sh.
    Commented Oct 12, 2017 at 15:07
  • \$\begingroup\$ Why do you want to optoisolate LEDs? You can't control 2 LEDs independently with a single opto. (+ the short that Eugene mentioned) \$\endgroup\$
    – Wesley Lee
    Commented Oct 12, 2017 at 15:10
  • \$\begingroup\$ I see what you're saying. In this schematic, yes. I should have drawn it a little more clearly. I'm asking for another manipulation to control either or (you're free to make suggestions on schematics, sorry. \$\endgroup\$
    – dm41nes
    Commented Oct 12, 2017 at 15:11

2 Answers 2

0
\$\begingroup\$

With one isolater like that, triggering either channel will light both LEDs.

\$\endgroup\$
4
  • \$\begingroup\$ Yes, I am asking if there is a way to isolate and control the bi-color LED with another schematic \$\endgroup\$
    – dm41nes
    Commented Oct 12, 2017 at 15:13
  • \$\begingroup\$ You will need one isolater per LED. If your LEDs didn't have common cathodes, you could look into 'charlieplexing' to reduce part count. \$\endgroup\$ Commented Oct 12, 2017 at 15:17
  • \$\begingroup\$ Depending on your application, you could replace the opto-isolaters with MOSFETs to save money. You would still need one per LED. \$\endgroup\$ Commented Oct 12, 2017 at 15:19
  • \$\begingroup\$ Thanks! I was looking into charlieplexing, but you're right the common cathodes gave me some issues \$\endgroup\$
    – dm41nes
    Commented Oct 12, 2017 at 15:23
0
\$\begingroup\$

Drive the LEDs directly.

Which means one of the following:

Left one means one LED per I/O. You get independent control of each LED.

Right one (won't work in your case, I missed that you had common cathode, sorry) means that you control both LEDs at the same time, but they will be at opposite states. When pin is driven low, one LED is on, the other is OFF and vice versa.

I didnt use optos because you still havent explained why they are necessary.

schematic

simulate this circuit – Schematic created using CircuitLab

\$\endgroup\$
2
  • \$\begingroup\$ The left image is what I had originally had in my schematic, thanks @WesleyLee was there a reason for why you had sourced your diode? I was informed that it would be a better design to sink it. \$\endgroup\$
    – dm41nes
    Commented Oct 12, 2017 at 20:25
  • \$\begingroup\$ @dm41nes - the schematic you originally had on the question looked very different than the one on the left. The diodes are on that orientation because you mentioned they are common cathode. If sinking you can only turn both of them at the same time. Some ICs have much higher sink current than source, in those cases sinking would be better. That's not the case with the Arduino. \$\endgroup\$
    – Wesley Lee
    Commented Oct 13, 2017 at 3:51

Your Answer

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

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