HRLV Maxsonar-EZ MB1013 sonar sensor UART example
Requirements
- Hardware Requirements
- 1 HRLV maxsonar-EZ MB1013 sonar sensor
- 1 HCSR04 ultrasonic sensor
- 4 Jumper wires
- Software Requirements
- EzloPi desktop application
- Vera mobile application
Circuit connection in ESP32
- ESP32 Vout +5v
- UART RX for ESP32
- ESP32 GND
- HRLV maxsonar-EZ MB1013 sonar sensor GND
- HRLV maxsonar-EZ MB1013 sonar sensor Vin +5v
- HRLV maxsonar-EZ MB1013 sonar sensor RX
- HRLV maxsonar-EZ MB1013 sonar sensor TX
![](https://www.ezlopi.com/wp-content/uploads/2022/12/HRLV-image.png)
Adding HRLV maxsonar-EZ MB10123 sonar sensor from EzloPi desktop application
- Connect the ESP32 to the computer and open the EzloPi desktop application.
- Scan, select and open the serial port, connecting to the ESP32.
![](https://www.ezlopi.com/wp-content/uploads/2022/12/Connect-the-ESP32-1.png)
3. Click on the ‘Add Device’ button as shown below.
![](https://www.ezlopi.com/wp-content/uploads/2022/12/Add-device-ESP32-1.png)
4. Select the “UART” option from the dropdown menu.
![](https://www.ezlopi.com/wp-content/uploads/2022/12/HRLV-select-uart.png)
5. Configure the LED:
- Give it a name. (“Ultrasonic” as an example)
- Select HRLV maxsonar-EZ MB1013 sonar sensor from dropdown menu.
- Select GPIO pin for RX, GPIO 16 for example.
- Select GPIO pin for TX, GPIO 17 for example.
- Select 9600 baud rate from the dropdown menu as HRLV maxsonar-EZ MB1013 sonar sensor operates on this baud rate.
- Then click “OK”.
![](https://www.ezlopi.com/wp-content/uploads/2022/12/Configure-the-LED.png)
6. Device name, type, subtype and GPIOs are displayed in the screen; click on “set config” to burn the configurations to the ESP devices.
![](https://www.ezlopi.com/wp-content/uploads/2022/12/HRLV-set-config.png)
7. Finally, reset the device by clicking on “Reset”.
HRLV maxsonar-EZ MB10123 sonar sensor in Vera Mobile Application
- Login to the Vera app using username and password.
![](https://www.ezlopi.com/wp-content/uploads/2022/12/HCSR04-mobile-application-1.png)
2. Identify the device with HRLV maxsonar-EZ MB10123 sonar sensor and click to connect to the device; wait while loading.
![](https://www.ezlopi.com/wp-content/uploads/2022/12/ESP32-Configure-WiFi-1.png)
3. The HRLV maxsonar-EZ MB10123 sonar sensor connected will be shown in the ‘Devices’ panel.
4. If sonar finds an obstacle less than 500 cm, the icon turns green.
![](https://www.ezlopi.com/wp-content/uploads/2022/12/HRLV-maxsonar-EZ-MB10123.png)
5. If no obstacle is detected, the icon turns gray.
![](https://www.ezlopi.com/wp-content/uploads/2022/12/MB10123-detected.png)