1
\$\begingroup\$

I have a LED controlled by a microcontroller.

I want to know how I can bypass this microcontroller so that I can control the LED with a separate current. Would I use transistors to switch between the two controllers to prevent backflow damage to my microcontroller? If so how?

\$\endgroup\$
  • \$\begingroup\$ Do you want to use two microcontrollers or you just want to bypass the path to LED from the first one. \$\endgroup\$ – Don't You Worry Child Mar 2 '14 at 19:57
  • 1
    \$\begingroup\$ Schematic needed \$\endgroup\$ – Passerby Mar 2 '14 at 20:13
  • \$\begingroup\$ @Passerby +1. Schematic - or at least a block diagram - is needed. Otherwise, the question is unclear. \$\endgroup\$ – Nick Alexeev Mar 2 '14 at 20:14
  • \$\begingroup\$ Route the output of the 2nd controller to an input pin of the 1st one, then solve it in software. \$\endgroup\$ – jippie Mar 3 '14 at 7:08
2
\$\begingroup\$

Left circuit: If either controller wants the LED on, it turns on. High = 'on'

Right circuit: If either controller wants the LED off, it turns off. High = 'off'

schematic

simulate this circuit – Schematic created using CircuitLab

\$\endgroup\$
1
\$\begingroup\$

You could probably use a open collector configuration.

schematic

simulate this circuit – Schematic created using CircuitLab

Something similar to this. Connect the microcontroller to one input and the other source to the other. Both inputs can turn the LED on.

\$\endgroup\$
  • \$\begingroup\$ I have another part to my question. If I had a continuous random 12V input at input_1, how can I isolate this input when a constant 12V input is supplied at input_2? Thank you again for your help. \$\endgroup\$ – Michael Mar 2 '14 at 20:31
  • \$\begingroup\$ If I understand it correctly, You want galvanic isolation between the two sources at input 1 & 2? Q1 and Q2 could be changed to a couple of opto couplers. That would probably do the trick. The resistors needs to be changed to appropriate values. \$\endgroup\$ – Peter Karlsen Mar 2 '14 at 20:56
1
\$\begingroup\$

How about if you wanted to control the LED from more that two places - how about 4. What about being able to reverse the demand from one input - how could you do that. I'm aware that this is beyond the scope of the question but it's fun to answer: -

enter image description here

This circuit can control an LED from 4 independent places using an analogue switch(es) to invert state previously set. For simplicity (2 sources) just omit the two middle sets of analogue switches.

It's also known as a 2-way light switch.

It's also know as an Exclusive OR gate so if you want to "reverse" the "demand" from source A, feed it through a 2-input EX-OR gate and have source B connected to the other input.

\$\endgroup\$
0
\$\begingroup\$

If the pins on your microcontroller can sink enough current to drive the LED (usually between 10 and 20 ma), then you don't need any transistors at all -- just two diodes. Check the datasheet for the microcontroller and look for I/O pins maximum sink current (low voltage). It is usually either higher or the same as the maximum source current (VDD voltage).

enter image description here

This should work with either open-drain or push-pull outputs. The diodes block the pins on one microcontroller from feeding into the other.

When sizing the resistor R1, you now need to account for the voltage drop across the LED as well as the 0.7v voltage drop across the 1N4148 diodes.

\$\endgroup\$

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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