+21622886281
ESP32 Project

Radar controlled by ESP32

Radar (Radio Detection and Ranging) is a technology used to detect and locate objects by emitting radio waves and measuring the reflected waves that are bounced back. It works by sending out a radio frequency (RF) signal and then measuring the time it takes for the signal to be reflected back to the radar antenna. The distance to the object can be determined by measuring the time it takes for the signal to travel to the object and back.

Radar can be used for a wide variety of applications, including air and sea navigation, weather forecasting, and military and law enforcement operations. It is also commonly used in civilian applications such as traffic control, speed detection, and collision avoidance systems in cars.

There are different types of radar systems, each with different characteristics and uses. Some examples include:

  • Pulse radar: emits a short burst of radio waves, which reflects off the target and returns back to the radar antenna.
  • Continuous wave radar: emits a continuous radio wave, and by measuring the Doppler shift in frequency of the reflected wave, it can determine the target’s speed.
  • FMCW radar (Frequency Modulated Continuous Wave): similar to continuous wave radar but the transmitted frequency is continuously varied. It’s widely used in radar altimeter, distance measuring and also in Automotive radar.
  • Synthetic Aperture Radar (SAR): uses the motion of the radar antenna over a target to provide high-resolution images of the target.

It is a widely used technology with many different applications, and it continues to evolve with new technologies and innovations.

It is possible to use an ESP32 microcontroller to control and interface with a radar sensor. The ESP32 can be used to send commands to the radar sensor, receive data from it, and process the data. The ESP32 can be programmed to perform tasks such as rangefinding, target tracking, and obstacle detection, depending on the capabilities of the specific radar sensor being used.

One example of a radar sensor that can be used with the ESP32 is the Ultra-Wideband (UWB) radar sensor. This type of sensor uses a very narrow RF pulse, which allows for high-precision rangefinding and target tracking. The ESP32 can be used to send commands to the UWB radar sensor, receive the range measurements and then use that data to calculate the position of a target.

Another example is the radar sensors used in the Automotive radar, which are based on the FMCW (Frequency Modulated Continuous Wave) principle. The ESP32 can be used to send commands to the sensor, receive the data and process it to detect the distance, speed and angle of other vehicles or obstacles.

The ESP32 also has built-in support for USB Serial Communication , which can be used to transmit the radar data to other devices, such as a computer or smartphone, for further processing or display.

There are several ways to send data from an ESP32 microcontroller to a computer, depending on the specific requirements of the project and the capabilities of the computer. Some common methods include:

  1. USB Serial Communication: The ESP32 can be connected to a computer via a USB cable and configured to act as a serial device. The computer can then use a serial terminal program to receive and send data to the ESP32. This method is simple and easy to set up, but it has a limited data transfer rate.
  2. Wi-Fi: The ESP32 can be configured as a Wi-Fi client and connect to an existing Wi-Fi network. Once connected, the ESP32 can send data to the computer by opening a socket and sending the data to the computer’s IP address. This method allows for faster data transfer rates and greater flexibility, but it requires a Wi-Fi network to be available.
  3. Bluetooth: The ESP32 has built-in Bluetooth capabilities, it can be configured as a Bluetooth client and send data to a computer that is running a Bluetooth server. This method allows for low power consumption and low data transfer rates.
  4. MQTT: The ESP32 can be configured to send data to a computer using the MQTT protocol, which is a lightweight messaging protocol for the Internet of Things (IoT) applications. This method requires a MQTT broker to be set up on the computer and it’s useful when the ESP32 is sending data to multiple devices or when the connection is unreliable.
  5. HTTP: The ESP32 can be configured to send data over HTTP to a webserver running on a computer. This method can be useful when the data needs to be accessed over the internet or when the data needs to be stored in a database.

In all the above methods, the ESP32 needs to be programmed to send the data in a specific format and the computer needs to be programmed to receive and process the data.

Objective of this project:

In this project, we are going to design a project using the ESP32 board and an ultrasonic sensor for detection.

This project aims to produce a prototype radar system that detects fixed and moving objects.

Operation of the radar controlled by ESP32:

Components required

ESP32 board

ESP32 is a series of low-cost, low-power system on a chip microcontrollers with integrated Wi-Fi and dual-mode Bluetooth. It was developed by Espressif Systems, a Shanghai-based Chinese company. The ESP32 chip is a powerful microcontroller that has a dual-core processor with a clock speed of up to 240 MHz, and it has a wide range of peripheral interfaces, such as I2C, SPI, UART, and ADC. It also has built-in support for Bluetooth and Wi-Fi, which makes it suitable for a wide range of IoT (Internet of Things) applications.

HC-SR04 sensor

The HC-SR04 is an ultrasonic distance sensor that uses the principle of echolocation to determine the distance of an object. It works by emitting a high-frequency sound wave and measuring the time it takes for the sound wave to bounce back from an object. The distance of the object can be calculated by measuring the time it takes for the sound wave to travel to the object and back, and then using the speed of sound to determine the distance.

The HC-SR04 sensor includes an ultrasonic transmitter and receiver, and it can be used to measure distances up to 4 meters with an accuracy of 3mm. The sensor is inexpensive, small in size and easy to interface with a microcontroller like the ESP32.

The ESP32 can be used to trigger the HC-SR04 sensor to emit a sound wave, measure the time it takes for the sound wave to bounce back, and then calculate the distance of the object. The ESP32 can also be used to display the distance measurements on an LCD screen or send the data over a Wi-Fi or Bluetooth connection to another device.

It’s a popular choice for hobbyist and educational projects because of its low cost and ease of use. However, it has some limitations, such as not being able to detect objects behind walls or with a reflective surface, sensitivity to ambient noise and it’s not suitable for high-speed object detection.

Servomotor

A servomotor can be used to move the HC-SR04 ultrasonic distance sensor in order to provide a wider field of view or to scan an area for objects. A servo motor is a type of motor that can rotate to a specific position, and it can be controlled by sending a series of pulses to it.

To move the HC-SR04 sensor using a servo motor, the ESP32 microcontroller can be used to generate the control pulses for the servo motor. The ESP32 can send a series of pulses to the servo motor to rotate it to a specific position and then trigger the HC-SR04 sensor to emit a sound wave and measure the distance. The ESP32 can then repeat the process to rotate the servo motor to a different position and take another distance measurement.

This way, the servo motor can be programmed to rotate the HC-SR04 sensor through a range of angles, and the ESP32 can collect the distance measurements at each angle to create a 3D map of the environment.

connecting wires

Wires are used to transmit electrical signals and power to various components such as motors, sensors, and microcontrollers. It’s important to properly route and secure the wires to prevent tangles and damage. There are several methods for doing this, including using cable ties, clamps, and wire looms. It’s also a good idea to use different colors or labeling to identify the different wires and their functions. When connecting wires in a robot, it’s important to follow proper safety procedures, such as using the correct wire stripper and connectors, and wearing protective equipment such as gloves and safety glasses.

Test plate

An electronic test plate is a type of laboratory equipment that is used to hold and organize electronic components or printed circuit boards (PCBs) during testing or analysis. It is similar to a traditional test plate, but it is designed specifically for electronic components.

Assembly:

To do the editing, we connected:

For the HC-SR04 sound sensor:

  • the VCC pin to the 3.3V pin of ESP32

  • the Trig pin to pin D22 of ESP32

  • the ECHO pin to pin D21 of ESP32

  • the GND pin to the GND pin of ESP32

For the servomotor:

  • red wire: power supply wire to connect to 5V energy

  • brown wire: wire to connect to the GND pin of ESP32

  • Yellow: Positioning signal wire connected to pin D23 of ESP32

Micropython program

Here is the program that allows you to:

  • calculate the distance between the HC-SR04 sensor and the detected object

  • turn the servomotor

  • send data (servo motor position and distance) from the Arduino board to the computer.

Note: you must use these two libraries: hcsr04 and servo

Python program executed by the computer




0 commentaire


Leave a comment

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

Scroll to Top