Posts

Showing posts from September, 2015

Arduino Distance Measurement Using Ultrasonic Sensor

Image
We all know about the ultrasonic sensor and also wanted to play with it, but don't know how ultrasonic sensor works. So In this article, we will see  how to use an ultrasonic sensor with your projects. The ultrasonic sensor is very popular among arduino hobbyist and there are so many projects which you will be able to do at the end of this article. Description of HC-SR04 Ultrasonic Sensor Ultrasonic Senso r can measure the distance from 1" to 13 feet( 1 cm to up to 4metre) with accuracy up to 3mm. A hc-sr04 ultrasonic sensor has 4 pin GND, VCC, Echo and Trigger Pin. Trig pin generate an ultrasound by setting trig pin on the high state of 10 microseconds. Echo pin produce an output in a microsecond when ultrasound returns back from the object to echo pin. We can calculate the distance by using simple formula Speed=(Distance/Time). The speed of the sound is 340m/s and thus by calculating ultrasound travel time we can calculate the object distance from the ultrasonic sensor. Requ