The intention of this project was to use two sensors (sound and distance) to ultimately activate a single motor.


A sound sensor is first used to trigger an LED. If the LED was previously off, then it is activated. In this case, the distance sensor is also activated.
Based on the distance detected, a motor is then activated. The motor’s specific motions/angles depend on the distance computed by the second sensor.

Bill of Materials


When using the sound sensor, it is important to ensure the potentiometer is adjusted correctly so that the component is sensitive enough to pick up the trigger sound, while not being too sensitive as this can cause unwanted activation/deactivation.

In order to see a correlation between distance and motor angle/motion, it is crucial to map the range of distance values that are computed by the distance sensor with the range of motion available to the motor component.

Code
Prototype Diagram

An LED is used as a visual indicator of whether the motor is activated or not– it remains on when activated and off when deactivated. Upon both activation and deactivation, a buzzer sound will go off for exactly 1 second (1000 ms). This is an audio indicator that the action has been completed.

Video

A sound and motion-activated motor can be used to control various systems used in everyday life such as automatic doors, motion-based light switches, motion/sound based locks, etc. Both the sound and distance activation could be useful when considering touchless technologies that are tailored to a more hygiene-conscious market.