Me too I wanted to complete my last "Project 15 : Hacking Buttons" of the Arduino Projects Book by trying to
substitute the closure of a switch by an optocoupler of the type 4N35.
As a second circuitry device I chose a little lamp supplied by its battery packages. I cut out the wires from the push button and, following the Optocoupler diagram , i connected the 1st pin of the opto to arduino 2 pin through a 220 ohm resistor, opto 2nd pin to arduino ground, opto 4 pin to the negative of the lamp batteries and the 5th opto pin as shown in the attachment. Under the lamp bulb cover there are 4 AA batteries of 1.5V each one.
I first tried with success the same diagram with a more simple LED supplied by a 9V battery apart.
But since on the contrary the lamp does not light on, what is wrong in my scheme now ?
sorry but i'm a newbie
thank you
