Arduino: IR Photodetector System Test 1
Here’s a quick look at using an IR LED + Photodiode pair to detect the “clarity” of the optical path between the pair.
The ProMini is used to convert the raw current output of the Photodiode into a digital value that represents the transmissivity of whatever is in between the IR emitter-detector pair. This value is then mapped to a PWM value to drive the Red LED as a monitor, and also is used with the Arduino “tone()” statement to drive a piezo buzzer or speaker element from another digital output pin. (It is not necessary to use a PWM pin for the tone() output pin.)
An annotated image of the setup is shown at the end of the video, and the code sketch is also given at the end. Stop the video, blow it up to full screen, and copy the sketch by hand into the Arduino IDE.
Thanks for watching and commenting, and thanks to EEVBlog member Potomac for inspiring this video demonstration. I hope it helps!