Maker Pro
Maker Pro

HDMI 5 port switch detecting LED with Arduino

StealthRT

Sep 4, 2010
146
Joined
Sep 4, 2010
Messages
146
Hey all I am wanting to make a project for this HDMI 5 port switch I have. I want to be able, with an Arduino, to detect which of the 5 ports are being used (only 1 can be used at any given time).

My 5 port HDMI switch looks like this:
$_12.JPG


Ok how about if I used 5 4N25 chips to detect the led being on or off?
cLM18.gif


One of the LEDs would hook to Pin 1(+) and Pin 2(-). Pin 5 would house a voltage of ~3vdc from a power supply. Pin 4 would be hooked up to the arduino's Analog Pin 0.

So when the LED on the 5 port switch is powered on, it causes the ~3vdc power from the power supply to flow to the arduino where it's read as a voltage value.

Does this seem correct?
 

Old Steve

Jul 23, 2015
734
Joined
Jul 23, 2015
Messages
734
A couple of points:-

Do you really need the 4N25s? Maybe I'm missing something, but can't you connect the HDMI port's LED gnd to the Arduino gnd, then directly sample the LED voltages, above the current-limiting resistors, on the Arduino with 5 digital input pins? You could put a resistor in series with the Arduino pins, for a measure of protection. 4K7 or 10K would do the trick.

What voltage is applied by the HDMI port to the top of it's LED current-limiting resistors? If it's between about 3V and 5V, it should be OK to connect directly, assuming that your Arduino is running on the standard internal 5V.
Your diagram shows "3.3V LED 1". If that refers to the voltage 'above' the current-limiting resistors, all is well.
If it refers to the voltage between LED gnd and the top of the actual LEDs, it will be more like 1.8V to 2V.

Either way, it's a bad idea to directly parallel the 4N25 LEDs across the HDMI port's LEDs, for the usual reason you shouldn't connect LEDs in parallel without individual current-limiting resistors.

Edit: Is your Arduino running on 3.3V? For your separate power supply, 5V would have been better, too, if your Arduino is running at 5V.
 
Last edited:

StealthRT

Sep 4, 2010
146
Joined
Sep 4, 2010
Messages
146
The arduino will be running on 5v. When the LED is on it has a current around 3.3v at the LED itself.
 

Old Steve

Jul 23, 2015
734
Joined
Jul 23, 2015
Messages
734
The arduino will be running on 5v. When the LED is on it has a current around 3.3v at the LED itself.
I guess you mean voltage, not current. 3.3V directly across the LED? They're usually 1.8V to 2V, for standard, individual LEDs.

Anyway, if it really is 3.3V directly across the LED, just use that voltage to directly connect to your Arduino pins.

Double-check that LED voltage. If it is as above, use the top circuit in the diagram below.
If not, check that the voltage where I indicate a voltmeter is between 3V and 5V, and if so connect as shown in the bottom diagram.
The 10K resistor is just there to protect against possible spikes. Always a good idea when connecting to external circuits, but no need for 4N25s in this situation.

HDMI LEDs to Arduino.JPG
Be aware that if the voltage across the HDMI port LED is not 3.3V, but only 1.8V to 2V, the top circuit will not work. The Arduino needs at least 3V to detect a 'high'.
 

Old Steve

Jul 23, 2015
734
Joined
Jul 23, 2015
Messages
734
I made a mistake in my first drawing, labelling the pins wrongly, but just corrected it.
 
Top