The OSOYOO Espro board is a credit-card-sized, mini ALL-IN-ONE Motor Control Board. It integrates an ESP32 MCU and an L293DD H-Bridge dual-channel motor control module, allowing users to program two sets of motors directly via the Arduino IDE to control a robot car’s movement.

This tutorial will show how to program the ESPRO MCU to control a ultrasonic sensor to do obstacle avoidance.


Pre-Connected GPIO pins between ESP32 and I/O devices

L293 Pin ESP32 GPIO Function
IN1 23 Motor A Direction 1
IN2 25 Motor A Direction 2
IN3 26 Motor B Direction 1
IN4 27 Motor B Direction 2
ENA 16 Motor A Speed (PWM)
ENB 17 Motor B Speed (PWM)

Left Motor to K3 or K4 , Right Motor to K1 or K2

Ultrasonic Sensor Slot
Ultrasonic Sensor VCC Trig Echo GND
ESP32 GPIO 3V3 18 19 GND

Connect Servo to Servo Slot: D32/VCC/GND

Software Installation Guide:

Step 1)Install ESP32 Arduino Board 
Connect the Espro Board to Desktop or Laptop computer with Type-C USB cable.
In Arduino Setting->Preference, please copy and past following link into Board Manager Url field:
https://raw.githubusercontent.com/espressif/arduino-esp32/gh-pages/package_esp32_index.json
After you select OK, then in Tool->Board->board Manager, Search ESP32 and Add ESP32 into Board Manager.
then in Tool->Board, select esp32 ->ESP32 Dev Module

Then Select correct port which matches ESP32 board.

Step 2) Download Correct Library and Sample Code and Upload to Arduino.

Library Code:
https://osoyoo.com/driver/ESP32Servo.zip

please go to Sketch->Include Library->Add .Zip File  and upload above zip file to Arduino IDE.

Copy Sample Code from following link and paste it to your Arduino IDE.
https://github.com/osoyoo/espro_obstacle/blob/master/espro_obstacle.ino