Programmaticly "shorting" a 5V input to ground

I'm ordering a 4 channel one to play with - there's also a 8 channel but pricey for quick access. So, a few questions about it...

What is the purpose of the ground link jumper? When would that be useful?

What is the purpose of R1? 1K was suggested. Is this related to protecting the optocoupler's LED? And if so, if I know 2mA is the max the mic logic circuit will generate, is it necessary?

Since I need to connect GND and 5V from the arduino to every individual optocoupler... Can I just connect once to one optocoupler, then daisy chain that to all the others on the same board, and addiitonal boards? For GND and 5V (separate chains obviously).

Ummm... I don't think that's quite correct. The mic actually has separate connections for the audio (mic) and the logic circuit. Each have a ground. The ground for the logic circuit is specifically labeled as such. I sort of figured they might have isolated that circuit from the audio already, but connecting the ground wire to arduino and hearing noise suggests not.

As useful as tits on a bull.
The reason you are using an opto coupler is electrical separation of two circuits.
The ground link defeats that.

A LED needs a current limiting resistor. The LED will burn without.
Can't see the value on that board, but I think it's 1k [102].
Because that board also has an indicator LED, current from the Arduino pin will be about 2mA.

You can of course daisy-chain the Arduino grounds with links on the PC817 board.

With "Logic ground" I referred to the image in post#35.
The opto transistor mimics what you did yourself to light the LED on the mic.
The opto transistor part is just a switch.
Leo..

This device seems to me already has resistors for each optocoupler on board?

https://www.simcoe-diy.ca/product-page/4ch-12v-24v-to-5v-input-high-and-low-level-conversion-optocoupler-module

The problem with factory-made products is that you're not in control of the design.

The 3k resistor on the left reduces opto LED current to 0.6mA.
The resistor on the right lowers pull down strength for the mic LED.
If that weak pull down is enough depends on the current of the mic LED signaling wire.

Can you measure that current.
Use a DMM set to current (mA), and connect between mic LED wire and Mic ground.
Also measure the voltage.
Leo..

With all mic logic wires disconnected from arduino.

Voltage: Meter set to "30 + DC V"' I get readings of 4.5 - 4.62V. Interestingly, if I push the button (which is a separate logic wire not connected) it drops to 3.97 - 3.98 V until I release the button. Internally I've set DIPs to prevent the button from doing anything (arduino will handle this), but it still must do someting just not acting on it since that function is disabled.

Current: Meter set to ''ANY + DC mA", where ANY is 30 or 3, it reads 0. I suspect it can't read such small amounts? But, our conclusion previously I think was that at most it would be 2mA.

So when you switch on the mic LED with the DMM set to 3mA,
then the LED on the mic lights up, and you don't measure any current.

That's good. Means the opto board will work.
Leo..

I can't do that. I have no way to control the mic led (enabling the logic circuit in the mic, disables the led functionality on the mic) . If I just touch the wires together, the led lights. But, if I have the MM in the middle, it does not. I don't understand this.

A DMM set to current is like a wire, or very low value resistor.

If the mic LED lights up when you short the signal wire to ground,
then the DMM must also do that.

Unless... the DMM has a blown fuse,
which is not uncommon when it has been used by a beginner.
Leo..

Or, unless the user has forgotten to change lead configuration for the current measurement...
just sayin'

I've been testing further with this and I'm seeing an issue.

The Arduino is monitoring the button on the mic, and when it is pressed, it toggles the LED on/off. I'm also outputting "On/Off" to serial monitor to see histoy. This is working as expected if I push the button at various times.

However, if I leave this sitting and I don't touch the mic... it will at random times, though not very frequently, toggle itself and I see it in the log. Which means the arduino thinks the button is being pressed, though its not.

Could this be caused by not having an optocoupler in use (yet)?

I'm going to add in code to track how long the duration is of this power change on the button input pin, so I can potentially filter out short power changes that are not likely physically pushes of the button. Though at this point, I don't know how long the power change is, so we'll see.

Okay, I'll ask. @monkeyinthemiddle , when you make your current measurements, are you moving one lead of your multimeter to the current input? Most meters require this manual change.

Well, I've just learned a few things:

  • I'm apparently a beginner (not a surprise) as the fuse was blown
  • My MM has a spare fuse stored in it, yay
  • I've got a good sense of what's going on, because I at least realized that the LED should come on with MM in the middle. Which, having replaced the fuse with the spare, it now does. Or at least it does when I have MM set to 3 + DC mA. When I have it set to test V, it doesn't light
  • The MM reads .017mA (MM set to 3) or 0.02-0.03 mA (MM set to 30) -- LED is on
1 Like

I did look this up in the manual when I was first testing the current (with blown fuse)... and there are three lead connections: 10A, -COM, +. I'm using -COM and +. My understanding is that 10A is for bigger currents. I'm not moving the leads for V vs mA testing.

Yep, have a meter like that as well. Connection of the meter to a voltage while in any current measuring setting will vaporize the fuse.
Good to see that part of the problem is resolved. Now, about that current measurement...

Post#51, and you mention this now?
So the mic is already galvanically connected to the Arduino.
Then forget about using opto couplers for the LEDs.

False triggers can be caused by a bad ground and long wires that pick up hum and RF etc.
Most times it can be fixed with a 100n ceramic cap from Arduino pin to Arduino ground.
Leo..

I did actually mention this in Post#5... though it was perhaps too subtle.. "But that's for a third wire (that indicates the push state of a switch) - that I have already working."

Here is a pic of the connections inside the mic.

And this is what I've got connected:

MIC > Arduino Uno (later to be Uno Mega)
SWITCH Out > pin 2 (INPUT)
LED In > pin 3 (OUTPUT)

I also had this:

LOGIC GND > GND

But because that was causing hum when listening to the audio from the mic, I have it removed currently.

I was thinking that I needed to connect 2 optocouplers for each mic (one for each SWITCH and LED).

The orange, white, and green wires (logic) come out inside the XLR connector, but are not connected to it. I'm making a little pigtail coming out thru the strain relief to connect the logic wires to the arduino.

Which brings up another topic I guess. I'm currently just using some solid wire (I think 24AWG) in three strands for each connection that I took out of an old telephone cable for my pigtail. I need to find a 2 or 3 (if ground gets used) conductor cable that's small enough to fit inside the strain relief, and past the little XLR plastic thingy. I have some 4 wire 22AWG solid (low voltage heating wire, or security system wire - I think its the same) but it's too thick even though its pretty small. The logic wires inside the XLR I am attaching to are very very tiny smaller than 24 AWG for sure... I'm no wire size expert, but like 26/28/30/?? something tiny.

I ordered a Jonard Industries ST-550 wire stripper and some 26-24 solder seals to try and simplify making the connections inside. I also ordered an IRWIN VISE-GRIP Wire Stripper, Self-Adjusting, 8-Inch (2078300). I've just wire stripped with small wire cutters or my teeth... and have never used solder seals. They apparently aren't great for soaking solder into the center of stranded wire, but that wouldn't be an issue with this connecting because one wire will likely be solid, and the stranded cable inside the XLR is so fine, it should be ok. I think.

If the SWITCH_OUT hasn't got any voltage on it (on or off),
then you can't use an opto coupler on that switch.

And then there is also no point in using an opto coupler on the LED wire.
Leo..