Sunday, February 3, 2019

Lab 12 - Distance Sensing with Ultrasonic Sensor and Arduino

1/29/2019

Todays lab is utilizing an ultrasonic sensor. I use to thing it would just work by outputting the distance, but there is a lot more to the device than assumed. The device has 4 pins; one being a +5V power input, and the other being a ground pin. The two other pins are the controls. Order of the pins must be referred to the diagram. Third pin is a Trigger pin, that pin looks for a 10us signal pulse that basically activates the ultrasonic sensor. The sensor output s a sound wave in pulses. The last pin is an Echo pin, that pin listens for the return of the wave and outputs a pulse width proportional to the measured distance of the sensor. For simplicity of this lab, as instructed, we copied the code down for the lab/online, and just modified it to our pin setup on the arduino.



Ultrasonic Sensor/ Motor Off (no object)
                                                   

Ultrasonic Sensor/ Motor ON (object detected)
 This lab has a program, which got edited into the downloaded program, that turns ON the motor when an object is 5 inches or closer to the sensor; Motor is OFF when the sensor range of 5 inches is clear.

Alternate view
8

No comments:

Post a Comment