So far all my experimentation has been using sensors as inputs. And I'm understanding all that no problem. But, for this I'm need to externally control a device that seems a little different than I'd expect.
The device has an LED and a control circuit builtin. It has two wires labelled Logic Ground and LED In. The docs indicate shorting the LED In wire to ground turns the led on. Sure enough, when I touch the two wires together, the LED comes on, separate those wires and the LED goes off.
When I test the two wires with multimeter... I see 5V - safe to test on an Arduino board it seem so I do as follows... When I connect the Logic Ground to an input pin and check it, it's Low. As expected. When I connect the LED In wire to an input and check it, it's High. As expected. I also tried setting the pinMode to INPUT_PULLUP with the LED In wire but got the same results. Not quite what I thought from what I'd read of that setting. I'm using an Uno (compatible), but later will be using a Mega (compatible) as I need to use a bunch of these devices and there's not enough pins on the Uno. But maybe INPUT_PULLUP is not aplicable to Uno, just Mega, or maybe not with the compatible?
I'm presuming that I need to connect the Logic Ground to one of the GND pins; and connect the LED In wire to a digital i/o as an INPUT (default) as I did when testing above.
My question is... how do I programmatically simulate the touching of the two wires (shorting the LED IN to ground)? I read other posts that sort of discuss this topic, but they weren't referring to an external device feeding 5V in. I saw mention of needing to use a relay module... but I'm hoping that isn't necessary as I'll need a lot of these configured.
My guess is to digitalWrite the input pin low to turn the led off, and high to turn it on. But, I didn't want to kill the pin, so thought I better ask.
It's been deemed to be important to note, so I'm adding it here to the initial post, that the device is Phantom Powered, which seems to mean it draws a max of 10mA... though googling suggets it can vary a bit from that, that may or may not be the case.
Do you know how much current flows through the circuit when LEDIN is connected to ground?
If it's less than 20ma you should be ok on the uno and mega by setting pinMode to OUTPUT. Writing the pin low will connect to ground an sink current. Writing the pin high will put 5v on the line and be equal to the input so no current will flow and the led will be off.
A schematic? It's two wires (that are connected to a LED circuit in a device)... one has 5V one doesn't. The arduino pins would be a digital I/O pin and GND... or so I'm presuming.
My question wasn't about connecting 5V to the input. I already indicated I did that and it's fine. My question is, well, the second last paragraph that begins "My question is..."
Do you know how much current flows through the circuit when LEDIN is connected to ground?
I don't actually know how to test the current when LED In is connected to ground. If I connect the multimeter between the two wires and set it for mA measuring, the LED doesn't come on. And my multimeter manual isn't helping in that respect. I'll need to google this topic more.
In the device specs it indicates this:
LED IN: Active low (≤1.0V), TTL compatible.
Absolute maximum voltage: -0.7V to 50V.
I'll add this, which it also mentions, though it's unrelated to the LED In, but it might hint at something since it does mention mA.
LOGIC OUT: Active low (≤1.0V), sinks up to
20mA, TTL compatible. Absolute maximum
voltage: -0.7V to 50V (up to 50V through 3kΩ).
But that's for a third wire (that indicates the push state of a switch) - that I have already working.
Can you provide any information to this device? I would think there would be a built in resistor to limit the current through the led when the wire to turn it on is grounded. As said, if the current running through the led to ground is less than 20ma you can ground it through a digital pin.
This changes everything.
What, precisely, are you trying to do?
Phantom power is normally 48VDC, but can be anything from 12V to 70VDC. At any rate the power supply feeding the phantom power will be capable of a few microamps or less. Phantom power cannot provide enough current to light an LED.
Found this... which seems to suggest it should be ok to try your approach, with a max of 2.0 mA for the whole circuit (not just the led). Does that make sense?
Power Requirements
11–52 Vdc phantom, 2.0 mA
Is there any need at all to connect the LOGIC GROUND wire? My guess is yes as that would direct the grounding of the OUPUT pin back to the device.
Phantom power is specified for 10mA max.
It's usually 48volt, and there are usually two 6k8 resistors in parallel, so 14mA when shorted.
I have a blue LED on my computer with a 47k resistor in series, because it was too bright.
I can still clearly see it with the ~50uA flowing through it.
Leo..
LEDs typically draw in the range of 5-15mA of current. The IEC standard for maximum phantom power current is 10mA
I did some further googling, and it seems that some LEDs don't need much power at all. But more importantly to my determination is that Phantom Power has a standard max, and it would seem 20mA is a reach.
The specs could have, perhaps, mistankenly indicated 2 mA without considering the LED.
So what will happen to the arduino I/O pin if it's say 21mA or perhaps 25mA?
So to clarify here. I am not adding an LED. The LED is already in the mic. And it works irrelevant of my Arduino project. I am simply tapping into a logic circuit that lets me tell the mic to turn the mic's led on or off (by grounding the LED In wire). I don't think I need resistor or such in relation to the mic... but whether its needed for the Arduino connection (suggested by someone else to be an OUTPUT, rather than an input) I'm not sure of.
Typically 10 to 20 mA, which Phantom Power cannot provide.
I'm confident that's not correct, cuz as I mentioned, the mic's LED definitly lights quite brightly from phantom power. I've got other phantom power mics from a couple decades ago that have pretty bright leds on them too.
Was that a reply to my post.
The LED I was taking about is inside the opto coupler (you don't see it).
The opto coupler has a tansisor, that acts as a switch, that grounds your mic LED wire.
Leo..
If it's less than 20ma you should be ok on the uno and mega by setting pinMode to OUTPUT. Writing the pin low will connect to ground an sink current. Writing the pin high will put 5v on the line and be equal to the input so no current will flow and the led will be off.
So based on the various bits that came up in the discussion here, I went ahead and tried this - generally feeling I wasn't going to be near the 20ma draw for the LED.
The good news is... it works. So far anyway.
I don't completly understand why it works. Well, I understand that setting the OUPUT to low is directing the LED In to ground, the same as touching the two wires together. But, I don't understand about the 5V being put out the OUTPUT, and the 5V being sent from the device to the OUTPUT pin, resulting in no current flow. Non electronically speaking, I imagine two 5V speeding towards each other and somehow not colliding. If I monitor the voltage with my multimeter I can see that the 5V is varying slightly all the time... does this mean I could get unexpected activity of the LED sometimes?
What sort of surprised me is that I can disconnect the device's Logic Ground wire from the Uno... and this still works. This would certainly simplifiy things, as it'd mean one less wire I have to prep and connect to the UNO for every one of these devices I connect.
Oh I think I just figured out how to quote automatically...
Yes, I was replying to your post... and yes I was confused by what LED you were referring to.
In my mind, I'm thinking since the mic provides the logic circuit, that it's handling the isolation of the audio circuit from the logic circuit and thus adding noise may not be an issue. But, I'm guessing on that. Also re the reply to my initial post I made updating on my having gotten this working, I mention that the device's Logic Ground wire doesn't seem to be necessary (noting I'm not listening in headphones yet). So, that could complete the protection you're suggesting, by my connecting the Logic Ground to the Arduino. Again... guessing.
I'm gonna connect some headphones and see if I can hear any difference.