Arduino HCSR04 Crack Measuring

Discussion in 'Embedded Systems and Microcontrollers' started by AJIN NADH, Feb 15, 2016.

  1. AJIN NADH

    Thread Starter Member

    Dec 18, 2014
    79
    4
    Hi all,
    I used to detect the small crack on wall using HCSR04 Ultrasound sensor,
    But i cant sense the crack , i only getting the Distance, how can i sense the crack separately


    Regards,
    Ajin nadh .v.a
     
    mkbutan likes this.
  2. DickCappels

    Moderator

    Aug 21, 2008
    2,653
    632
    Not sure I understand exactly what you mean by "crack" (Crack in what material and what item, dimensions, etc.) and by "detect".

    If you are finding the distance from the transducers to the crack, isn't that sensing it? <== Clearly, I don't understand the setup.
     
  3. AJIN NADH

    Thread Starter Member

    Dec 18, 2014
    79
    4
    Hi Sir,
    Actually am doing a Rail Ultrasonic Flaw Detection System, but the flaw is not traced by the sensor, only the actual distance is getting....
     
  4. Alec_t

    AAC Fanatic!

    Sep 17, 2013
    5,797
    1,103
    What 'distance' are you talking about?
    Post a sketch of your setup, to clarify what you're doing.
     
  5. AJIN NADH

    Thread Starter Member

    Dec 18, 2014
    79
    4
    SETUP.jpg
     
    mkbutan likes this.
  6. ScottWang

    Moderator

    Aug 23, 2012
    4,854
    767
    You could try this first, if it doesn't work then you have to turn the direction of transmitters and receiver as cone

    HCSR04 Ultrasound sensorto sense the crack-01.gif

    Source of picture.
     
    mkbutan and AJIN NADH like this.
  7. spinnaker

    AAC Fanatic!

    Oct 29, 2009
    4,884
    1,005
    If I had to guess, the HCSR04 does not have the sensitivity to detect such a narrow change in distance.
     
  8. ScottWang

    Moderator

    Aug 23, 2012
    4,854
    767
    HC-SR04 Ultrasonic Module:
    The Ultrasonic module detects the distance of the closest object in front of the sensor (from 2 cm up to 400cm).

    Since the TS has such request, so he got to rty it.
     
  9. ErnieM

    AAC Fanatic!

    Apr 24, 2011
    7,388
    1,605
    It is doubtful that sensor can find a small crack in a wall. First you need to ping with a wavelength short enough to see the crack. Then the receiver mus be able to see that return echo as you now need to see two echos, fist from the start of the crack, and the next from the end of the crack. That receiver can only sense one return ping for each burst so it is unsuitable without modification.

    If you have an oscilloscope you can probe the analog receive signal to see if there is anything you could possibly capture to detect the crack. You may have multiple echos as the signal bounces off the crack several times.
     
  10. jpanhalt

    AAC Fanatic!

    Jan 18, 2008
    5,692
    901
    My guess is the author wants to detect the discontinuity in the metal rail. Ultrasonic testing is used for such purposes in non-destructive (maybe pre-destruction?) testing of aircraft and other things. Here's a general description: https://en.wikipedia.org/wiki/Ultrasonic_testing

    Don't know if the particular device the OP has will do that type of testing though.

    John
     
  11. Alec_t

    AAC Fanatic!

    Sep 17, 2013
    5,797
    1,103
    The wavelength of the 40kHz ultrasound is ~0.85cm in air, so I doubt such a low frequency would be able to detect a crack unless its width were about that distance. A cracked rail would be highly dangerous long before the crack reached that size. Even to sense a crack 0.85cm wide, I think you would need the transducer(s) in contact with the rail, not >2cm from it. Also, I think you might have to sense the phase of an echo signal, which the HCSR04 may or may not do.
     
  12. John P

    AAC Fanatic!

    Oct 14, 2008
    1,634
    224
    This seems like a woeful misapplication of technology. An ultrasonic rangefinder operates at 40 KHz or so, but ultrasonic testing of solids uses frequencies into the megaHertz range, and requires contact with the material being tested. The WIkipedia article says "In most common UT [Ultrasonic Testing] applications, very short ultrasonic pulse-waves with center frequencies ranging from 0.1-15 MHz, and occasionally up to 50 MHz, are transmitted into materials to detect internal flaws or to characterize materials." A rangefinder will tell you how far it is from the sample, and that's all.
     
  13. AJIN NADH

    Thread Starter Member

    Dec 18, 2014
    79
    4
    Hi sir,
    I will try this
     
  14. AJIN NADH

    Thread Starter Member

    Dec 18, 2014
    79
    4
    Yesterday i tried the testing as the image shows ,
    i placed the end very close to the track and found that a high value (am measuring the distance in cm), when the Flaw found.
    Is this correct..... IMG_20160216_095732.jpg
     
  15. ScottWang

    Moderator

    Aug 23, 2012
    4,854
    767
    You have to comparing the values of flat wall and flaw wall, if the flaw is too small, I don't think it will works properly, because the distance of two components are too far.

    IMG_20160216_095732_748x600.jpg
     
  16. AJIN NADH

    Thread Starter Member

    Dec 18, 2014
    79
    4
    Ok sir,

    is this will miss behave because of this cone shape ?
    i will try it and revert back to u sir
     
  17. mkbutan

    Senior Member

    Sep 30, 2008
    270
    16
    Hi dear all,
    The Ultrasonic ranging module HC - SR04 provides 2cm - 400cm non-contact measurement function, the ranging accuracy can reach to 3mm (i.e. 0.3 cm)
    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...
    now as per your Design http://forum.allaboutcircuits.com/threads/arduino-hcsr04-crack-measuring.120902/#post-965902
    the main thing is your Moving Speed the Stationary parameters is (as per the datasheet) is 10μs ( Trigger Input Signal------------------10uS TTL pulse ) and that to at an Angel of 15°
    so now you have to adjust your Speed to DETECT the CRACK in the RAIL
    I thing that should solve the problem
     
    Last edited: Feb 17, 2016
  18. ScottWang

    Moderator

    Aug 23, 2012
    4,854
    767
    If this method didn't works then you have to adjust the angles of two pipes, when you try it at many angles, but it still didn't works as your wish then you need to take the transmitter and receiver away from the pcb and put their direction as cone, you have to make sure they have a small angles maybe 10~20° between them, you need to adjust the angle to check which angle has the best effective.
     
    mkbutan likes this.
  19. AJIN NADH

    Thread Starter Member

    Dec 18, 2014
    79
    4
    I will check this sir
     
  20. AJIN NADH

    Thread Starter Member

    Dec 18, 2014
    79
    4
    Sir,
    This is the code actually am using


    Code (C):
    1.  
    2. /*
    3. HC-SR04 Ping distance sensor]
    4. VCC to arduino 5v GND to arduino GND
    5. Echo to Arduino pin 13 Trig to Arduino pin 12
    6. Red POS to Arduino pin 11
    7. Green POS to Arduino pin 10
    8. 560 ohm resistor to both LED NEG and GRD power rail
    9. More info at: [URL]http://goo.gl/kJ8Gl[/URL]
    10. Original code improvements to the Ping sketch sourced from Trollmaker.com
    11. Some code and wiring inspired by [URL]http://en.wikiversity.org/wiki/User:Dstaub/robotcar[/URL]
    12. */
    13.  
    14. #define trigPin 13
    15. #define echoPin 12
    16. #define led 11
    17. #define led2 10
    18.  
    19. void setup() {
    20.   Serial.begin (9600);
    21.   pinMode(trigPin, OUTPUT);
    22.   pinMode(echoPin, INPUT);
    23.   pinMode(led, OUTPUT);
    24.   pinMode(led2, OUTPUT);
    25. }
    26.  
    27. void loop() {
    28.   long duration, distance;
    29.   digitalWrite(trigPin, LOW);  // Added this line
    30.   delayMicroseconds(2); // Added this line
    31.   digitalWrite(trigPin, HIGH);
    32. //  delayMicroseconds(1000); - Removed this line
    33.   delayMicroseconds(10); // Added this line
    34.   digitalWrite(trigPin, LOW);
    35.   duration = pulseIn(echoPin, HIGH);
    36.   distance = (duration/2) / 29.1;
    37.   if (distance < 4) {  // This is where the LED On/Off happens
    38.   digitalWrite(led,HIGH); // When the Red condition is met, the Green LED should turn off
    39.   digitalWrite(led2,LOW);
    40. }
    41.   else {
    42.   digitalWrite(led,LOW);
    43.   digitalWrite(led2,HIGH);
    44.   }
    45.   if (distance >= 200 || distance <= 0){
    46.   Serial.println("Out of range");
    47.   }
    48.   else {
    49.   Serial.print(distance);
    50.   Serial.println(" cm");
    51.   }
    52.   delay(500);
    53. }
    Mod edit: Please use CODE tags - available on the post edit toolbar as Insert->Code Tags
     
    Last edited by a moderator: Feb 19, 2016
Loading...