Public projects 1


Replicated projects 0

 Imperial_Proggramer hasn't replicated any projects yet.

Respected projects 1


Comments 3

  • How to Make an Ultrasonic Ruler with Arduino UNO and HC-SR04 3 months ago

    Yeah maybe i make a another project on it!

  • How to Make an Ultrasonic Ruler with Arduino UNO and HC-SR04 about 1 year ago

    Thanks Mihai Valentin for your suggestion. It will be taken into account.

  • Ultrasonic Range Detector Using Arduino and SR-04F over 1 year ago

    I have just modified the code which displays inches, centimetres and millimetres.Down below. Just change your trig pin to 2 and echo pin to 4. and the code also reads the distance slowly so you could read it. To see the distance just go to Tools -> Serial monitor or just press ctrl+shift+M for windows and for mac is command+shift+M. Contact me if have any doubts. Plz take a look at my project too.

    const int trigPin = 2;
    const int echoPin = 4;
    void setup() {
    Serial.begin(9600);}
    void loop()
    {
    long duration, inches, cm, mm;
    pinMode(trigPin, OUTPUT);
    digitalWrite(trigPin, LOW);
    delayMicroseconds(2000);
    digitalWrite(trigPin, HIGH);
    delayMicroseconds(1000);
    digitalWrite(trigPin, LOW);
    pinMode(echoPin, INPUT);
    duration = pulseIn(echoPin, HIGH);
    inches = microsecondsToInches(duration);
    cm = microsecondsToCentimeters(duration);
    mm = microsecondsToMillimeters(duration);
    Serial.print(inches);
    Serial.print("in, ");
    Serial.print(cm);
    Serial.print("cm, ");
    Serial.print(mm);
    Serial.print(" mm");
    Serial.println();
    delay(1000);
    }
    long microsecondsToInches(long microseconds)
    {return microseconds / 74 / 2;}
    long microsecondsToCentimeters(long microseconds)
    {return microseconds / 29 / 2;}
    long microsecondsToMillimeters(long microseconds)
    {return microseconds / 2.9 / 2;}

Add projectSign up / Login