How to use an Ultrasonic Sensor in Tinkercad

Sdílet
Vložit
  • čas přidán 5. 09. 2024

Komentáře • 44

  • @user-pb7mu8fj8s
    @user-pb7mu8fj8s Před 3 lety +2

    You have saved my life young man

  • @agon1766
    @agon1766 Před 4 lety +4

    Hi there. Thank you very much for your time and effort to show us this kind of projects. Very useful.

  • @ArduBlock
    @ArduBlock Před 2 lety

    Thanks for the great video on this.

  • @oanikuttan5563
    @oanikuttan5563 Před 3 lety +4

    const int pingPin = 7;
    const int red=11;
    const int blue=10;
    int green=9;
    void setup() {
    // initialize serial communication:
    Serial.begin(9600);
    pinMode(red,OUTPUT);
    pinMode(blue,OUTPUT);
    pinMode(green,OUTPUT);
    }
    void loop() {
    // establish variables for duration of the ping, and the distance result
    // in inches and centimeters:
    long duration, inches, cm;
    // The PING))) is triggered by a HIGH pulse of 2 or more microseconds.
    // Give a short LOW pulse beforehand to ensure a clean HIGH pulse:
    pinMode(pingPin, OUTPUT);
    digitalWrite(pingPin, LOW);
    delayMicroseconds(2);
    digitalWrite(pingPin, HIGH);
    delayMicroseconds(5);
    digitalWrite(pingPin, LOW);
    // The same pin is used to read the signal from the PING))): a HIGH pulse
    // whose duration is the time (in microseconds) from the sending of the ping
    // to the reception of its echo off of an object.
    pinMode(pingPin, INPUT);
    duration = pulseIn(pingPin, HIGH);
    // convert the time into a distance
    inches = microsecondsToInches(duration);
    cm = microsecondsToCentimeters(duration);
    Serial.print(inches);
    Serial.print("in, ");
    Serial.print(cm);
    Serial.print("cm");
    Serial.println();
    if(inches10 && inches

  • @fart578
    @fart578 Před 3 lety +3

    thanks for this this really helped me out!

  • @dawudghafar1412
    @dawudghafar1412 Před 3 lety +1

    Thank you for the help. Appreciate it. 👍

  • @digvijayurfduggu986
    @digvijayurfduggu986 Před 4 lety +3

    It is a very good video

  • @gabydagdag2899
    @gabydagdag2899 Před rokem

    Thank you very much

  • @nehapathare3519
    @nehapathare3519 Před 4 lety +2

    The LED blinks Green even if the object is beyond the range of the sensor.What changes should i make in the code?

    • @shahzoorkhan7091
      @shahzoorkhan7091 Před 3 lety +1

      Add an else statement at the end and light up any 2 LEDs to make a custom color

  • @shahzoorkhan7091
    @shahzoorkhan7091 Před 3 lety

    Please give space between operator and variable . I don't know why but i feel uneasy when somebody does that

  • @manjulareddy3047
    @manjulareddy3047 Před 4 lety +1

    Can you show programming in blocks?

  • @MenACE_135
    @MenACE_135 Před 4 lety +1

    Can you do 1 with the hc sensor?

    • @domingomartinez1536
      @domingomartinez1536  Před 4 lety +1

      Its in the description

    • @MenACE_135
      @MenACE_135 Před 4 lety +1

      @@domingomartinez1536 can u help me with my school problems? My ICT teacher wants us to make led green blink if under 90cm and led brown will blink if the distance is 40cm using the hc sensor... Pleaze your my only hope.

    • @MenACE_135
      @MenACE_135 Před 4 lety

      @@domingomartinez1536 notice

    • @MenACE_135
      @MenACE_135 Před 4 lety

      @@domingomartinez1536 notice please

    • @MenACE_135
      @MenACE_135 Před 4 lety

      @@domingomartinez1536 not me

  • @nerdygeek8947
    @nerdygeek8947 Před 3 lety

    Bro I can understand the lag and the fans running in the bg because I have a 10 yr old laptop

  • @dodzillad185
    @dodzillad185 Před 7 lety +2

    Great video but I am confused. All of my ultrasonic sensors (hc-sr04) has 4 pins. 1 for gnd, 1 for vcc, 1 for trig and 1 for echo. Is there a way to change the ultrasonic sensor ? All I see is the one u used in this video and that sensor isn't suitable for my project since I don't have the same sensor. Could you help me please?

    • @datalohr
      @datalohr Před 5 lety +1

      here it is with code: www.tinkercad.com/things/k9eioRZ9ofs-ultrason-hc-sr04

  • @mariomora7480
    @mariomora7480 Před 4 lety +1

    Which resistance did u used?

  • @majjaravinayentertainments7609

    what is this software

  • @shubhamankush6682
    @shubhamankush6682 Před 4 lety +1

    hello,
    please tell me how to add sound sensor in tinkercad
    i am not able to find sound sensor in tinkercad

    • @robamitiku8152
      @robamitiku8152 Před 4 lety +1

      You can add a buzzer (Piezo) from the components, and vary its frequency in the code to make the beep sound

  • @moja6180
    @moja6180 Před 4 lety +1

    code pls

  • @laraangelica99
    @laraangelica99 Před 5 lety +1

    alguem traduz ou me explica porfavor

  • @notanoption1793
    @notanoption1793 Před 4 lety +2

    Can you make the code somewhere to copy?

    • @minghuwang2910
      @minghuwang2910 Před 4 lety

      You can search the code in google

    • @domingomartinez1536
      @domingomartinez1536  Před 4 lety

      I put the code in the description

    • @notanoption1793
      @notanoption1793 Před 4 lety +1

      @@domingomartinez1536 a bit late 😇

    • @domingomartinez1536
      @domingomartinez1536  Před 4 lety +1

      @@notanoption1793 my bad lol

    • @oanikuttan5563
      @oanikuttan5563 Před 3 lety

      const int pingPin = 7;
      const int red=11;
      const int blue=10;
      int green=9;
      void setup() {
      // initialize serial communication:
      Serial.begin(9600);
      pinMode(red,OUTPUT);
      pinMode(blue,OUTPUT);
      pinMode(green,OUTPUT);
      }
      void loop() {
      // establish variables for duration of the ping, and the distance result
      // in inches and centimeters:
      long duration, inches, cm;
      // The PING))) is triggered by a HIGH pulse of 2 or more microseconds.
      // Give a short LOW pulse beforehand to ensure a clean HIGH pulse:
      pinMode(pingPin, OUTPUT);
      digitalWrite(pingPin, LOW);
      delayMicroseconds(2);
      digitalWrite(pingPin, HIGH);
      delayMicroseconds(5);
      digitalWrite(pingPin, LOW);
      // The same pin is used to read the signal from the PING))): a HIGH pulse
      // whose duration is the time (in microseconds) from the sending of the ping
      // to the reception of its echo off of an object.
      pinMode(pingPin, INPUT);
      duration = pulseIn(pingPin, HIGH);
      // convert the time into a distance
      inches = microsecondsToInches(duration);
      cm = microsecondsToCentimeters(duration);
      Serial.print(inches);
      Serial.print("in, ");
      Serial.print(cm);
      Serial.print("cm");
      Serial.println();
      if(inches10 && inches

  • @arthgamer8730
    @arthgamer8730 Před 6 lety +1

    arduino 1.8.5