Photo Interrupter issue

Hello,

I'm quite an experienced programmer, but a complete beginner with electronics. I've had an Arduino starter kit for the last few days and have worked through a couple of the sketchbook samples.

I've managed to interact with Flash application through following this tutorial - http://www.codingcolor.com/as3/arduino-flash-as3-part-1/

I've bought some photo Interrupters and would like one of them to work like a simple button, my final goal is to trigger a Flash animation on a computer using a photo Interrupter.

My issue is that I really have no idea on how to attach my Photo Interrupter to my Arduino.

I'm using this - http://www.skpang.co.uk/catalog/photo-interrupter-gp1a57hrj00f-p-892.html?zenid=ubu4a09phmdrj8074bekk8tp33 The data sheet is here - http://www.sparkfun.com/datasheets/Components/GP1A57HRJ00F.pdf

Here's a photo of what I've tried so far - http://imgur.com/75RPs

I hope this makes sense, I can't stress how new I am to all this. Any help is much appreciated.

Your inclusion of a photo is appreciated, however it is not really clear enough to discern how things are connected. Any chance you can sketch up your interconnections?

Referencing the datasheet, connect +5V to pin 1 through a 330 ohm resistor (looks like you already have that), and pin 2 to ground.

Also connect pin 5 to ground, pin 3 to +5V. Pin 4 is what goes to an Arduino digital input pin. The input pin should read HIGH when there is no interruption, and LOW when there is interruption.

-- The Ruggeduino: compatible with Arduino UNO, 24V operation, all I/O's fused and protected

Thanks v much for you're quick reply.

I've just tried to draw something out, but it's terrible. I'll try and explain what I've done in as much details as possible.

I've attached a connector from the 5v plug on the Arduino to the top row on my breadboard along the '-' row. I've attached a connector to the GND on the Arduino from the top row of my breadboard along the '+' row.

I've plugged my photo interrupter horizontillay along rows F & G on my breadboard. Pin1 of the photo interrupter in hole g-14 Pin2 of the photo interrupter in hole f-14 Pin3 of the photo interrupter in hole f-8 Pin4 of the photo interrupter in hole g-9 Pin5 of the photo interrupter in hole g-8

I've attached a connector from i-8 to the GND input on the Arduino (the one beside the 5v input) I've attached a connector from i-9 to digital output 2 on the Arduino. I've attached a connector from i-14 to the top of the breadboard where the power is coming from. There's a 330ohm resistor connected from j-14 to the top row of the breadboard.

Apologies for the lack of an illustration, I'll do my best to learn how to draw an electronic schema over the weekend.

I've attached a connector from the 5v plug on the Arduino to the top row on my breadboard along the '-' row. I've attached a connector to the GND on the Arduino from the top row of my breadboard along the '+' row.

A bit backwards, but not critical. 5V is usually considered '+' and GND is '-'.

Pin1 of the photo interrupter in hole g-14 Pin2 of the photo interrupter in hole f-14 Pin3 of the photo interrupter in hole f-8 Pin4 of the photo interrupter in hole g-9 Pin5 of the photo interrupter in hole f-8

Why are pin 3 and 5 both going to f-8? Remember that the datasheet requires pin 5 to go to GND and pin 3 to +5V.

-- The Flexible MIDI Shield: MIDI IN/OUT, stacking headers, your choice of I/O pins

Oops, that was a typo.

I've corrected my previous reply.

I've corrected my previous reply.

No you haven't?

Apologies for not getting back to you sooner, I obviously messed up trying to edit my post.

Unfortunately I've disassembled all of my work from Friday and have no idea how it was set up.

I've re posted the question here, in an effort to get a solution. I think I posted in the wrong forum to begin with - http://arduino.cc/forum/index.php/topic,78864.0.html

Thanks for looking at this for me.

Anyway, you know that each pin of your device must have its own row in the breadboard. If the leads aren’t long enough that might be hard to do. It’s hard to tell from your photo. It might be easier to do that with the device straddling the trough separating the rows (instead of parallel to it.)

All you want to do is have the IRED (“LED”) side constantly ‘on’ and then digitalRead the pin that the output is connected to, placing something in the device’s channel to block the beam.
You could connect an LED in another digital pin and with a few more lines of code have it turn on/off when the beam is blocked/clear. (Not everything blocks IR.)

Hookup diagram attached.

sharpoptint.JPG

That could be my problem -

Does this sound right? I'm running my photo interrupter vertically down my breadboard. so so pins 3 & 5 are in the same row. pin4 has it's own row. And pins 1&2 are in the same row. Is that going to cause an issue?

Issue? It's a problem, big problem. Those pins are shorted together when they're plugged in to the same row. Each pin has to be in its own row. Pins that share a row are connected to each other thereby. [You breadboard savvy? Here's a breadboard tutorial you ought to review -- http://www.ladyada.net/learn/arduino/lesson3.html ]