image thumbnail

Arduino IR Proximity Detector

version (657 KB) by Techsource Technical Team
Detect how close an object is and map its proximity to a note.


Updated 28 Aug 2015

View License

Write an S-Function to detect proximity of an object and play a note in response. This project uses an IR LED that emits light in the IR region. An IR sensor (photo-transistor) is used in pair with the IR LED, and is connected closely to the IR LED. When an object is brought close to the IR-LED, IR-light will be reflected and will cause the light intensity to change, depending on how close the object is. The sensor will measure the changes in intensity and map those values to different notes.
In the modelling stage, use Simulink External Mode to run the model live-time in order to locate and program appropriate threshold values.
Esther Ling, Edu Engineer

Cite As

Techsource Technical Team (2022). Arduino IR Proximity Detector (, MATLAB Central File Exchange. Retrieved .

MATLAB Release Compatibility
Created with R2015a
Compatible with any release
Platform Compatibility
Windows macOS Linux

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!