Controlling one LED with 2 microcontrollers

I am creating a little man in the middle circuit to hijack an LED in an appliance.
I am wondering if I have the circuit right-
I have simplified the appliance circuit down to the LED circuit to focus the clarity im looking for and put together a proposed circuit.

The cathode of the LED is switched to power the LED in normal operation.
Am I right in thinking I will need a diode infront of each MCU pin so while the appliance pin is HIGH(LED OFF state), I can light the LED with the new MCU with a LOW state without current flowing from the appliance pin? and vice versa?

I have also added a 10k resistor to stop the LED floating.

Does this all seem correct?

Sorry your circuit will not work the LEDs are reversed. Reverse the LED polarity and it should work.

Which effect do you want? Should the LED be ON only if both controllers turn it ON (AND), or if any controller turns it ON (OR).

Try this modified circuit (Fig-1).


Figure-1:

Where are your driving sketches?

What is the meaning of hijacking the LED?

Well, assuming

  • both circuits are 5V,
  • they share a common power ground, or are both powered from the same 5V source,
    then if circuit A is designed to provide a low signal to enable the LED, and circuit B is designed to provide a high signal to enable the LED, wire the LED cathode to output A and the LED anode via the resistor to output B.
    Then, when output A is low and B is high, your LED will light.

A resistor of 2k will make a LED glow dim.

This 3 resistor scheme will make the LED glow brighter if both outputs are active.
Drop R2 and R3 and pick a more sensible value for R1.

Things go wrong if one of the MCUs is powered off.
Use the outputs active high, the LED connected to GND

Yes! Theoretically the current is only 0.6 mA; whereas, a LED requires about 10 mA - 15 mA (haveing 2.5V drop across its terminals) o emiit satisfactor level of light.

The OP is advised to bring down the value of R1 to 200 ohm or better to nil.

I suppose you mean to keep R2 and R3, else you’d damage the outputs.
Keeping R2 and R3 means that the brightness will differ if only one or if both MCUs steer the LED.

Yes! And of course; else, the LED will be instatnly damaged. Thank you for mentioning this point so that OP deos not make such a disastrous mistake.

What´s the name of the game ?

Hi, @BrianBoru

Do you want to have total control of the LED, turning it ON or OFF with your hijack circuit, no matter what the original controller wants to do?

That is ;
If it is ON, hijack can turn it OFF.
If it is OFF, hijack can t urn it ON.

Tom.. :smiley: :+1: :coffee: :australia:

You mean like this?

Hi, @stitech

A better question, what is the application?
What are you trying to accomplish, with what equipment.

Thanks.. Tom... :smiley: :+1: :coffee: :australia:

An even better question: what does the OP really want?
He didn't comment on any of our suggestions.

This topic was automatically closed 180 days after the last reply. New replies are no longer allowed.