Some help with ir emitter and photodiode

Hi there, I am pretty new to arduino,
I just need some help with detecting ONLY infra-red with a photdiode 'led'. I have connected the emitter led (clear) to 5V on my uno via a 110ohm resistor and the other end to GND. I have also connected the receiver led (black) to 5V and the other side to Analog pin 0 and to GND via a 10K resistor. I have some very basic code which simply turns on a buzzer when it is receiving a value above 500 and turns it off when not. So far it is detecting infra-red when I put my hand over the two leds but is also detecting normal light from a desk lamp. Since the black coating on the receiver is meant to act as a filter which only allows IR to pass through, shouldn't it only be receiving IR? I am confused as to why it is also receiving normal light wavelengths...

Here is a schematic similar to what I have set up although I have used a pull down resistor to GND instead of a pull-up to 5V on the receiver so the readings are reversed and a different resistor value on the emitter. This schematic also uses a phototransistor rather than a photodiode:

Thanks a lot for any help :slight_smile:

The reason it also reacts to your desk lamp, is because your desk lamp also emits IR light, not just visible light.
One way to counter this is to make a small shell with a gap, pointing to the IR-emitter.

If you want to learn more about visible light and IR light, check wikipedia.

Thankyou for the fast response, I will try that

Cheers :slight_smile: