SparkFun Forums 

Where electronics enthusiasts find answers.

For the discussion of Arduino related topics.
#143277
Hi guys,

I bought a GP1A57HRJ00F photo interrupter and now I want to connect it to my Arduino, but my problem is that I didn’t buy the breakout board (BOB-09322) which makes it hard for me to figure out how to connect this the right way to the arduino since I can’t read data sheets, and I kind of need to do it till Monday for a small project. So if one of you has one of these and maybe could show me a picture of how you connected it on a breadboard and to the Arduino, something very simple, I will be very thank full, as I am an amateur at this…

Best regards,
The Donkey
#143303
If you plan on doing electronics, you need to learn to read a data sheet. You can find it here: http://www.sparkfun.com/datasheets/Comp ... HRJ00F.pdf
You can find a tutorial on how to read a datasheet in the Sparkfun tutorial section.

On page two you will see the internal schematic. One set of pins if for the LED and the other for the transistor used as a switch.

Pin 1 will go to 5V.
Pin 2 will go to a resistor.
The other end of that resistor goes to ground.
From the table on page 4, you will see the forward voltage is about 1.14V at 7ma. That means the resistor need to be (5-1.14)/(.007) or 551 ohms. But since the LED can go up to as much as 50ma a standard 330 ohm resistor should do just fine.

Now the transistor side is even simpler.
Pin 3 goes to 5V
Pin 5 goes to ground
Pin 4 goes to a digital input pin on the Arduino.

Edit: Deadline has come and gone and no reply from OP. Why does this continue to surprise me...?
Edit: Any news on this? I hate threads that just end without resolution...
#167582
Hey fll, so ive got a project that requires me to design a linear slide that can go to a position, wait for a few seconds and return to its original location. To make it simple, I decided to go with a belt driven IGUS linear slide using a stepper. I want to use the photo interrupter mentioned as a limit switch for the two locations I need to slide to go and from. I've got both the stepper and photo interrupter working independently using Arduino UNO but I am having difficulty coding the combination. Any coding tips...or atleast a starting point?

Thanks,
Matt