Skills

Photo Interrupter - GP1A57HRJ00F

Description: Photo interrupter, photogate, photodiode, phototransistor, whatever you want to call it, this sensor is composed of an infrared emitter on one upright and a shielded infrared detector on the other. By emitting a beam of infrared light from one upright to the other, the sensor can detect when an object passes between the uprights, breaking the beam. Used for many applications including optical limit switches, pellet dispensing, general object detection, etc. Gap width = 10mm

Be VERY careful about voltage reversal! I cooked 4 of these (immediate poof of smoke when power applied) before i realized that the datasheet physical drawing shows the pins when the sensor is upside down. Thank god i ordered 5. Running straight off Arduino Uno and used a 330ohm resistor for the transmitter and getting nice response so far.

Would be nice on the next version if the components were a bit more tolerant. I’d pay an extra $.50 for that peace of mind.

Before I ruin this, how many volts should it have, and how can I tell from the datasheet? I don’t wish to destroy my last IR piece. Already burned out two IR leds. So, how many volts can each side take, maximum?

The emitter is the only one that you should worry about with powering. That one is a very sensitive little IR emitter. If you look at Figure 4 in the datasheet, you can see the curves for forward Voltage vs forward Current. You can see there that changing between 1V and 2V incurs a change between ‘1'mA and 300mA - well into the range where it would fry.

Rather than driving it by voltage, you should drive it by current. There’s a couple of figures in the datasheet (some of which - test condition at 7mA - make me wonder if they typo’d something), but if you scroll down to page 7, you can see SHARP’s design recommendations which state that forward current should be between 10mA and 20mA. So in your design you should try to make a ‘constant’ current regulation for 15mA. This can typically be done using just a resistor. Going back to figure 4, for 15mA the forward voltage at room temperature is - guesstimating - about 1.13V. (That iffy part of the datasheet lists 1.14V, so at least that’s a bit of confirmation).
After that you can use any normal LED calculator to find an appropriate resistor for your given supply voltage. SparkFun’s breakout board for this component for use with an Arduino 5V uses a 220Ω resistor, but notes that 330Ω works as well. That would fit with my calculation (ends up at 270Ω) as well.

The detector side is much more forgiving, taking anywhere between 4.5 and 17V according to the datasheet. In SparkFun’s breakout board, this means it’s just hooked up directly with the detection pin going out to - in their case - one of the input pins on an Arduino. Note that most of the test conditions on the detector side are at 5V, and I certainly wouldn’t actually drop 17V on it :)

Hopefully this should keep the other one from burning out on you - make sure you check all the connections, have a peek at that breakout board too :)

Can anyone clarify the part’s lifespan? Page 7 of the data sheet has a paragraph labeled “Degradation”, that suggests to me that in continuously-powered applications the part may perform worse after a few years.

I’m building a lunar clock project that, if all goes well, will sit, powered, on a mantel for years.

Thinking about that, I think I want to power the detector only when I’m looking for the signal - e.g., connecting the IR LED power to an Arduino output pin rather than simply connecting it to 5V.

Note that one can also use a pair of high brightness LEDs. Use one as the Tx and the other as Rx. Connect the Rx to a CMOS invertor biassed as an amplifier and Bob’s your uncle. The advantage is that it is visible - the disadvantage is also that it is visible - depends on what you are doing with it!

I looked at the spec sheet and did not see any data regarding how sensitive the detector is - i.e., how much light intensity is needed to cause output transistor to turn on.

I wanted to use one of these on a radon mitigation system’s u-tube manometer*. If the fan stopped working, the colored liquid would rise, reducing the intensity of the light received and - I hope - triggering an alarm.

Does anyone know how much reduction in light transmission is needed to switch output from On to Off?

does anyone know, the maximum sampling rate of those??
i would like to use it, to count “Gaps ” in a rotating wheel… the wheel would rotate with about 4000rpm, and would have 36 gaps ,, per revolution…. would this sensor work??

Well, the datasheet says there is a 9uS Low-high propagation delay, and 15uS High-low propagation delay.

If you add them together you get 24uS, or a frequency of 41.67 KHz.

36 gaps per revolution gives you 0.6 (36/60) Hz for every RPM.

So assuming your micro is fast enough, this could, in theory, work all the way up to ~70,000 RPM, but don’t expect great accuracy at those speeds (read below)

If you need very high accuracy, it actually won’t work. For example, the Arduino’s micros() function has 8uS resolution. So let’s say you have 400 uS between 2 detected gaps. In that case, your code should convert that to 4167 RPM. However at 392 uS/gap, you’d get 4252 RPM; or at 408 uS/gap, 4085 RPM, both of which are probably huge differences, depending on what you’re planning on using this for.

I’m pretty novice about all this - but it isn’t clear to me how much voltage to pump through this part. The datasheet says 5v output, but input goes all the way up to 17v? Does this thing regulate voltage by itself?

Before I go chop mine apart, I’m wondering if there is any connection between the two “arms” of this thing? I’d like to cut it in half in the middle and custom-mount the light and detector in a different housing. Anyone done that?

Also, any thoughts on how far apart this thing can be and still detect?

I think your issue is due to the light passing through the liquid (and not tripping the sensor). I’ve been able to detect small objects moving at about 300 m/s with these but the trick is to fully eclipse the detector. If your liquid doesn’t absorb IR is will be essentially transparent to the detector.

Would you consider carrying a photo interrupter with a narrower gap? This gap appears to be almost 0.5 in. I would like one that is twice or thrice as wide as a PCB (so I can use PCB material and the interrupters to make a quadrature encoder.

Going to pick up a few of these to detect if the front door of my motel is open. I was going to use a hall sensor or laser trip beam, but this one is shaped just right. Just need a small protrusion on the door to break the beam when the door is closed, and un-obstruct the beam when the door is open.

Customer Reviews

5 out of 5

photo interrupter

Works absolutely fine. I am using it on a “persistence of vision” wheel to time the start of the display. The interruption lasts a fraction of a millisecond but triggers every time.
I highly recommend buying the related circuit board. It makes mounting and use easier.
I would also recommend that Sparkfun add mounting holes to the board. Current version has no screw holes.

1 of 1 found this helpful:

Works great; always keep some on hand; needs suggested interfacing

A photo-interrupter is so versatile, I’m keeping a couple in my kit of basics such as leds, 200ohm resistors, and buttons. Your list of uses could include detecting the initial position of stepper motors, detecting the position of DC motors, detecting doors opening, closing, or sliding open and closed, detecting a coin dropping through a slot, and on and on!

I soldered this part up to the suggested (almost required) Photo Interrupter Breakout Board - GP1A57HRJ00F, and it worked great with my Arduino Mega project.

My one wish is for better application circuit documentation. As things are, most people without EE degrees will have to buy the breakout board to use the part. I couldn’t decipher the datasheet to work out a recommended wiring for Arduino.. A quick schematic sketch would be great.

So, I love this part when bought with the corresponding Breakout Board - it worked nearly the first time, and works over and over, and works for so many things. …and thanks for making the Breakout Board; it’s a lifesaver.

Very Good

SparkFun is an online retail store that sells the bits and pieces to
make your electronics projects possible. Whether it's a robot that can
cook your breakfast or a GPS cat tracking device, our products and
resources are designed to make the world of electronics more accessible.

In addition to products, SparkFun also offers
classes and online tutorials to help educate
individuals in the wonderful world of embedded electronics.