File Exchange

image thumbnail

Creating a Motion Detector using an Arduino, a Photoresistor and MATLAB

Acquire photoresistor measurements and explore motion detection algorithms


Updated 01 Sep 2016

View License

This example illustrates how to measure the light sensitive analog voltage from a photoresistor circuit connected to Pin 0 of an Arduino Uno.
The example then applies three types of calculations in real-time to determine if the current voltage reading signifies motion.
Using a pre-recorded dataset, the data is further processed in MATLAB to categorize the motion.

This example requires the user to first install the MATLAB Support Pacakge for Arduino Hardware which is available here:

For more information on MATLAB support for Arduino, see the following resource page:

Comments and Ratings (2)

Qusay Jalil


volkan aygül


Updated license

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

More Files in the  MATLAB Maker Community

MATLAB Online Live Editor Challenge

View the winning live scripts from faculty and students who participated in the recent challenge.

Learn more

Download apps, toolboxes, and other File Exchange content using Add-On Explorer in MATLAB.

» Watch video