Backstory: I picked up some radioshack IR LED emitter and detector pairs (part #276-142) recently for a project I want to start. I'm relatively new to electronics and arduino so I wanted to play around with them first. I just spent the last couple hours trying to figure it out >.<. What I WANTED them to do was when there was no voltage on the detector (LOW) I wanted an LED that I was using as a "status" LED to NOT light up, and when it went HIGH i wanted it to light up. For whatever reason the LED was always staying on.
I could NOT figure out how to get the detector to do it's job, detect. I thought I tried all feasible connections (with pullup and pull down resistors) and I was getting so frustrated! I thought it was going to be a simple hook-up and go operation, but i was wrong.
For the longest time I was trying to connect one end of the detector to GND and the other to an arduino pin (this is where "all combinations" with pullups, pull downs, and no pullups or pull downs comes in).
I dont know what made me finally decide to try hooking it up the "final" way, but it worked. Instead of hooking the anode/collector to ground, i hooked it to 5V from the arduino. Then I hooked the cathode/emitter to the pin with a pulldown resistor betwen cathode/emitter and GND and VIOLA! it worked!
It seems like such a simple/noob/elementary problem, but when I figured it out I was ecstatic!
Electronics can be so frustrating at times....but at the same time they can be so rewarding
Also, I should have realized it earlier because upon reading, the detector is a photodiode/transistor. And in a transistor power (positive) goes into the collect, and flows out through the emitter to ground! Argh. I think what was really throwing me off was the fact that on regular leds the longer lead connects to positive, and the shorter to negative. On the detector's packaging/specs it has it labeled like a regular led, but the longer side was getting the "negative" side of the flow instead of the positive like a normal led ....so it wasn't making sense (the way that my mind rationalized it anyway).
Anyway, thanks for reading lol. I'm sure it all seems gibberish because I was all over the place