In this experiment, we will learn to check distance in the serial monitor using ultrasonic.
- 1 x Arduino Uno ( You can use other boards also )
- 5 x Jumper Wires M-M
- 1 x Ultrasonic Sensor
- 1 x Breadboard
- The principle of ultrasonic distance measurement is the same as that of RADAR.
The Ultrasonic module has two Transducers, one for Transmit & the other forare fixed on a single PCB with the control circuit so that it can be easily used in your Robo projects. Ultrasonic distance sensor provides precise, non-contact distance measurements from about 2 cm to 400cm. Ultrasound is a high-frequency sound of frequency 40 KHz (we can’t hear this frequency, but animals can).
- Take Breadboard.
- Fix the Ultrasonic onto the breadboard.
- now Connect the pins of ultrasonic sensor as follows:
- PIN 2 of Arduino to TRIG of Sensor module.
- PIN 3 of Arduino to ECHO of Sensor module.
- 5V of Arduino to Vcc of Sensor module.
- GND to GND.
- Connect Arduino to your Laptop/PC by USB Cable. ( we use A to B USB cable for Arduino which is also used in printers )
- Open Arduino IDE ( You can download it from here or you can use online platform Arduino Web editor )
- Type the code Below given.
- Check program and then upload it.