Here’s a Motor Control via Proximity Sensing. In this article, we go step-by-step through the process of understanding, designing and building a system that uses an infrared proximity sensor for input, correlates that input to how far away an object is from the sensor and then drives a motor and some LEDs at distinct speeds depending upon the proximity of the object.
Continue reading here:
IR Proximity Motor Control