Skip to content

Instantly share code, notes, and snippets.

@cgp
Last active January 14, 2022 16:16
Show Gist options
  • Save cgp/0d2114670c02cf362befc8e4c5e7a51f to your computer and use it in GitHub Desktop.
Save cgp/0d2114670c02cf362befc8e4c5e7a51f to your computer and use it in GitHub Desktop.
Infrared IR photoresistor receivers on Arduino esp8266 nodemcu

My Note taking for IR receivers and IR photoresistors using arduino or nodemcu platforms.

Currently, I'm using the following IR photoresistor (also called an IR diode?), mostly by accident because I thought it was an IR receiver. I didn't think there would be a difference between the three pin infrared receiver and the two pin infrared receiver. Oops.

http://www.gikfun.com/leds-c-6_51/5mm-940nm-leds-infrared-emitter-and-ir-receiver-diode-p-519.html

https://forum.arduino.cc/t/cant-get-an-ir-photoresistor-to-work/698649/1

These are very basic components geared towards proximity testing.

These simple two pin emitters and receivers are designed to trigger if something is physically blocking the receiver from receiving the light emitted by the emitter. by an object them from receiving the signal. I imagine people buy them to fix their garage door openers, but you could also use them to detect if a drawer is shut. It is an alternate to a magnet or ultrasonic, depending on your needs I suppose.

I watched the following:

Caleb Rowe - he gives the simple wiring diagram and a perfect description of how to setup the sensor on an Arduino. He also mentions why you might choose a 10k resistor versus another type for those of us who are unfamiliar with electronics. https://www.youtube.com/watch?v=_mOF1JXo1DU

Andres Spiess - I don't think there was a wiring diagram here, but he gives a solid explanation of how the low level IR photoresistor is used in common remote controls to produce a valid signal. You can use the simple two pin emitters for such things, but it will come with some limitations. I believe, but haven't confirmed that three pin IR receivers designed for use with remote controls are designed not to be directional. https://www.youtube.com/watch?v=gADIb1Xw8PE

I'm still watching the following:

Gaven MacDonald - https://www.youtube.com/watch?v=zx4OUXk0LSQ

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment