Introduction: Connecting ESP 32 With Ultrasonic Sensor

About: pursuing Bachelors in Electronics and Communication at Chandigarh University

Ultrasonic sensors work by emitting sound waves at a frequency too high for humans to hear. They then wait for the sound to be reflected back, calculating distance based on the time required. This is similar to how radar measures the time it takes a radio wave to return after hitting an object.

Components required: -

1. Ultrasonic sensor -

2. ESP32 -

3. Jumper wires -

4. Breadboard(optional) -

5. Arduino IDE software

6. Arduino NANO -

Setting up your Arduino IDE before uploading code in ESP32 is very important : -

Step 1: Circuit Schematic

Ultrasonic sensor - - > ESP32 pins

Echo Pin - - > GPIO5

Trigger Pin - - > GPIO 18

VCC - - > VIN (5V)

GND - - > GND

Step 2: Code for Connecting ESP32 With Ultrasonic Sensor

Steps to follow while uploading code in ESP32 board

1. Click on upload.
2. If no error. At the bottom of Arduino IDE, when we get message Connecting ...,...,

3. Press Boot button on ESP 32 board till you get the message done uploading.

4. After you code is uploaded successfully. Press enable button to restart or start code uploaded on ESP32 board.

Step 3: Serial Monitor

Results variation is because I am changing the object position while my sensor is working.