Back to Top
HC-SR04 Ultrasonic Module
HC-SR04 Ultrasonic Module
This module is compatible with Arduino and other 5V microcontrollers because it is a 5V sensor. All you have to do is connect the device to your board and set the pins for the echo and trigger as input and output, respectively. Once it's set up properly, use your code to obtain the distance reading by taking the input reading from the Echo pin and entering it into the distance calculation, which is distance = (traveltime/2) x speed of sound.