Select Page

 

 

This is a circuit I created using the Arduino Uno to control a servo motor using an ultrasonic sensor. The ultrasonic sensor is a device that relies on the emission of high frequency sound waves that are imperceptible to the human ear to measure the distance between an object and the sensor. The sensor accomplishes this by calculating the time between sending the high frequency sound wave, and when the sound wave bounces back from an object and back into the sensor in terms of microseconds. In my example, an equation is used to calculate a distance in centimeters using the time given by the sensor. The servo motor is voltage controlled device that turns its shaft dependent on the duration of a pulse signal received by its signal pin using pulse width modulation, or PWM. The duration of the pulse determines the angle at which the shaft rotates depending on its starting position, in this case, zero degrees. In this circuit, I programmed the Arduino to control the servo motor position dependent on the calculated distance of the ultrasonic sensor to turn 180 degrees when the ultrasonic sensor detects an object that is in range within 50 centimeters.