Tags: HC-SR04 Ultrasonic Module Distance Sensor for Arduino

Ultrasonic HC-SR04 Module Distance Sensor

  • 5.00 AED

    9.00 AED

    • Ex Tax:5.00 AED
    • Brands techmaze
    • Product Code: Digital
    • Availability: In Stock
    The ultrasonic sensor works on the principle of SONAR and RADAR system which is used to determine the distance to an object. An ultrasonic sensor generates the high-frequency sound (ultrasound) waves. When this ultrasound hits the object, it reflects as echo which is se..

    The ultrasonic sensor works on the principle of SONAR and RADAR system which is used to determine the distance to an object. An ultrasonic sensor generates the high-frequency sound (ultrasound) waves. When this ultrasound hits the object, it reflects as echo which is sensed by the receiver .

    Ultrasonic ranging module HC-SR04 provides 2cm - 450cm non-contact measurement function,the ranging accuracy can reach to 3mm。The modules includes ultrasonic transmitters,receiver and control circuit.

    The basic principle of work

    • Using IO trigger for at least 10us high level signal

    • The Module automatically sends eight 40 kHz and detect whether there is a pulse signal back

    • If the signal back, through high level,time of high output IO duration is the time from sending ultrasonic to returning. Test distance=(high level timexvelocity of sound (340M/S) /2


      This video tutorial will help you Testing Ultrasonic distance sensor with Arduino Uno and output shows on screen in cm:


      Wire connecting direct as following:


       1. 5V Supply 
      2. Trigger Pulse Input
      3. Echo Pulse Output
      4. GND

      If you are sourcing a ultrasonic ranging module , the HC-SR04 is a good choice . Its stable performance and high ranging accuracy make it a popular module in electronic market .

      Compared to the Shape IR ranging module , HC-SR04 is cheaper than it . But it has the same ranging accuracy and longer ranging distance.


      Basic Arduino Code for Ultarsonic Sensor:

      /***********************************************************************/


      #define trigPin 10

      #define echoPin 9

      void setup() { 

        Serial.begin (9600);

        pinMode(trigPin, OUTPUT);

        pinMode(echoPin, INPUT);

      }

      void loop() {

        

        long duration, distance;

        digitalWrite(trigPin, LOW); 

        delayMicroseconds(2);

        digitalWrite(trigPin, HIGH);

        delayMicroseconds(10);

        digitalWrite(trigPin, LOW);

        duration = pulseIn(echoPin, HIGH);

        distance = (duration/2) / 29.1;

        Serial.print(distance);

        Serial.println(" cm");

        delay(50);

      }

      /***********************************************************************/


      More details:

      • power supply :5V DC

      • quiescent current : 2mA

      • effectual angle: 15 degree

      • ranging distance : 2cm - 450 cm

      • resolution : 0.3 cm

      There are 4 pins out of the module : VCC , Trig, Echo, GND . So it's a very easy interface for controller to use it ranging. The all process is : pull the Trig pin to high level for more than 10us impulse , the module start ranging ; finish ranging , If you find an object in front , Echo pin will be high level , and based on the different distance, it will take the different duration of high level. So we can calculated the distance easily :

      Distance = ((Duration of high level)(Sonic :340m/s))/2

      Finally,look at the back of the module. All of the chip in the module have been burnish, maybe the author want to prevent the designed from plagiarism. But ultrasonic ranging module is nearly the same principle,so it's not hard to speculated that the role of the chip - I'm sure at least one 74series chip on it). It is not a difficult task to crack it, but it's at so low a price, even cheaper than your copy.