My optocouplers are all signaling even when there shouldn't be any current/voltage

Thread Starter

Ed. M.

Joined Nov 8, 2017
41
Hi,
I'm still new to working with electronic components so please bear with me.

Here's my setup:
  1. I have a 17VAC power line that runs through a switch.
  2. I'm using an H11AA1 optocoupler to detect voltage/current in the line configured as follows:
    1. Pin 1 - power through a 1500 ohm resistor (which should produce about 10ma current for the opto)
    2. Pin 2 - through switch to power ground
    3. Pin 4 - to Arduino ground
    4. Pin 5 - to Arduino input
    5. a .1uF capacitor across pins 4 and 5
  3. My program configures the input as INPUT_PULLUP so if there's no voltage/current in the line it'll read as HIGH

On my workbench, when I set my variac to 17V and close the switch, I get a LOW reading on the input pin, which is correct. When I turn off the power, it goes back to HIGH. So far so good.

The problem is when I plug the board into the actual analog machine that runs off 17VAC, when I turn the machine on, the Arduino line goes LOW indicating there is current flow even though the switch is OPEN! When I plug the Arduino back into my test bench, everything works fine; when I turn on the power it reports as HIGH and then when I close the switch it shows LOW.

I have no ideas on how to diagnose the issue. The only difference should be power is coming the machine rather than the variac. Any suggestions would be greatly appreciated. Thanks.
 

Thread Starter

Ed. M.

Joined Nov 8, 2017
41
would be better if you could draw some schematic.
On the first glance, having AC voltage on the diode of the opto seems like a bad idea.
It looks something like this:

H11AA1Setup.png
The H11AA1 is designed to work with AC circuits.
Note: Power is actually 17V AC, 60Hz not 230V
R1=1500 Ohm
C1=0.1uF
R8 is actually internal to the Arduino
 

Wolframore

Joined Jan 21, 2019
2,609
We need the analog circuit part and where is this switch? If it’s on the device could It be after the connection to your sensor?
 

cmartinez

Joined Jan 17, 2007
8,218
I don't like C1, for some reason... can you post a more complete diagram? Such as where exactly is the arduino's pin connected to?
 

Thread Starter

Ed. M.

Joined Nov 8, 2017
41
I don't like C1, for some reason... can you post a more complete diagram? Such as where exactly is the arduino's pin connected to?
The Arduino pin is connected at C1 so basically R8 and VCC are inside the Arduino. My schem drawing skills are rudimentary at best; someone else drew this diagram for me a while back when I was doing the original design.
 

Thread Starter

Ed. M.

Joined Nov 8, 2017
41
We need the analog circuit part and where is this switch? If it’s on the device could It be after the connection to your sensor?
The switch is on the line marked NEUTRAL in the diagram.
The machine is an old electromechanical pinball machine.
 

ElectricSpidey

Joined Dec 2, 2017
2,758
Open the line from your "analog machine" to confirm there is no signal from there.

If it still triggers with that open try tying down the base with a small cap or 10k resistor.
 

Sensacell

Joined Jun 19, 2012
3,432
Is there a large common-mode voltage between the two sides of the opto? i.e. is there a difference in ground potentials?

Opto's do have a small but finite capacitance between the input and output, this capacitance can cause trouble if the output side is connected to a very high impedance circuit and there is a large AC voltage across it.
 

Thread Starter

Ed. M.

Joined Nov 8, 2017
41
Is there a large common-mode voltage between the two sides of the opto? i.e. is there a difference in ground potentials?

Opto's do have a small but finite capacitance between the input and output, this capacitance can cause trouble if the output side is connected to a very high impedance circuit and there is a large AC voltage across it.
Sorry I'm not familiar with those terms. The input pins on the opto (1 & 2) have 17V AC (or 0) flowing through them. I'm not certain what the voltage would be on the output side.

I just don't get why it works fine on the bench and doesn't when attached to the machine. If it was hooked up incorrectly then it shouldn't work on the bench. Maybe a short somewhere?
 

TeeKay6

Joined Apr 20, 2019
573
And you DID connect pin 6 on the opto to ground through a 10KΩ resistor?
Why is everyone recommending a 10K resistor between the base and emitter? According to the OnSemi/Fairchild datasheet that resistor would do exactly what you expect, it would keep the NPN transistor "off".
 

djsfantasi

Joined Apr 11, 2010
9,156
Why is everyone recommending a 10K resistor between the base and emitter? According to the OnSemi/Fairchild datasheet that resistor would do exactly what you expect, it would keep the NPN transistor "off".
What datasheet are you looking at? The internal transistor is NOT a typical NPN transistor, it is a phototransistor. Maximum sensitivity is achieved with the base/ pin 6 unconnected, but sensitivity can be controlled with an appropriate valued resistor to ground. Which is what the sybmggestion is based on.
 

TeeKay6

Joined Apr 20, 2019
573
What datasheet are you looking at? The internal transistor is NOT a typical NPN transistor, it is a phototransistor. Maximum sensitivity is achieved with the base/ pin 6 unconnected, but sensitivity can be controlled with an appropriate valued resistor to ground. Which is what the sybmggestion is based on.
I am looking at the datasheet I described, that originally published by Fairchild (now ON Semi). See Figures 4 & 5. CTR=0 when 10K is used, even for Ifwd as great as 20mA.
 

Attachments

Top