Hi,
I have several optocouplers I'm using to detect voltages in various wires. Most of the wires are run with 17VAC and I'm using input resistor values of 1.2-1.5KOhm, then run the output line 5 of the H11AA1 into my Arduino with the pins defined as INPUT_PULLUP. This seems to work fine.
I have another line that's only 6V. I'm thinking I need an input resistor of:
(6V-1.2V)/60ma = 80Ohm
The smallest resistor I have is 180Ohm so I'm trying to use that which should give me an input current of:
(6V-1.2V)/180Ohm = 27ma which should be enough to activate the optocoupler and give me an output current.
The odd thing is on my Arduino it's telling me the pin is going low (active), then high (off), then low, then high, etc. It just bounces around even though there's always current flowing through the input line.
Any idea why this could be happening? Would a true 80Ohm resistor fix it (if so, what wattage?) Thanks for your time I appreciate it.
I have several optocouplers I'm using to detect voltages in various wires. Most of the wires are run with 17VAC and I'm using input resistor values of 1.2-1.5KOhm, then run the output line 5 of the H11AA1 into my Arduino with the pins defined as INPUT_PULLUP. This seems to work fine.
I have another line that's only 6V. I'm thinking I need an input resistor of:
(6V-1.2V)/60ma = 80Ohm
The smallest resistor I have is 180Ohm so I'm trying to use that which should give me an input current of:
(6V-1.2V)/180Ohm = 27ma which should be enough to activate the optocoupler and give me an output current.
The odd thing is on my Arduino it's telling me the pin is going low (active), then high (off), then low, then high, etc. It just bounces around even though there's always current flowing through the input line.
Any idea why this could be happening? Would a true 80Ohm resistor fix it (if so, what wattage?) Thanks for your time I appreciate it.