+21622886281
ESP32 HC-SR04 Project

Obstacle detection system with ESP32

Objective of this project:

In this project we will realize an obstacle detection system with Arduino. This system mainly uses an ultrasonic sensor, buzzer and LED.

When the ultrasonic sensor detects an obstacle at a distance <4cm, the ESP32 board gives the order for the buzzer to sound.

Necessary components

  • ESP32
  • HC-SR04 Ultrasonic sensor
  • Buzzer
  • SSD1306 display
  • Connecting wires

  • Test plate

Mounting:

To perform the assembly, you can connect

For buzzer:

  • the terminals (+) to pin D4 of the ESP32 board

  • the terminals (-) to the GND pin of the ESP32 board

For HC-SR04 sensor:

  • the TRIG pin to pin D5 of the ESP32 board

  • the Echo pin to pin D18 of the ESP32 board

  • the VCC pin to the VCC pin of the ESP32 board

  • the GND pin to the GND pin of the ESP32 board

For display:

  • the SCL pin to pin D22 of the ESP32 board

  • the VCC pin to the 3.3V pin of the ESP32 board

  • the GND pin to the GND pin of the ESP32 board

  • the SDA pin the D21 pin of the ESP32 card

Micropython program

Here is the program of the sound alarm system:

 

Note: you must import the following two libraries: hcsr04 and ssd1306




0 commentaire


Leave a comment

Votre adresse e-mail ne sera pas publiée. Les champs obligatoires sont indiqués avec *

Scroll to Top