Need help with MOC2023

Hi

I am using a MOC2023 opto-isolator ( I’ve attached the datasheet, I can’t seem to find a link to one) to trigger a separate 9V circuit. The problem is that once on it doesn’t turn off. I read in a previous post that this is because of a “floating input” and that to solve this I should have a resistor from the input to the ground.

http://arduino.cc/forum/index.php/topic,72617.0.html

The way I understand it is that the ‘input’ is pin1/ the anode connection. However once I have connected a resistor (1K) from the input to the ground the ‘trigger’ doesn’t work.

At pin1 I have a 220 Ohm resistor connected to the Arduino. Is it correct that I have the 1K resistor connected to the same pin and then ground?

MOC302X.pdf (375 KB)

MOC3023 is a triac driver, meant to be used with AC circuits. If the load you are switching is DC, it will latch on when triggered and stay that way. A transistor-output opto-isolator like a 4N35 or similar might be more appropriate.