Freenove ESP32 User manual

Need support? support@freenove.com
1
List
█www.freenove.com
Welcome
Thank you for choosing Freenove products!
About Battery
First, read the document About_Battery.pdf in the unzipped folder.
If you have not downloaded the zip file, please download and unzip it via the link below.
https://github.com/Freenove/Freenove_Robot_Dog_Kit_for_ESP32/archive/master.zip
https://github.com/Freenove/Freenove_ESP32_Robot_Dog_SDK_for_Arduino_IDE/archive/master.zip
Get Support and Offer Input
Freenove provides free and responsive product and technical support, including but not limited to:
Product quality issues
Product use and build issues
Questions regarding the technology employed in our products for learning and education
Your input and opinions are always welcome
We also encourage your ideas and suggestions for new products and product improvements
For any of the above, you may send us an email to:
support@freenove.com
Safety and Precautions
Please follow the following safety precautions when using or storing this product:
Keep this product out of the reach of children under 6 years old.
This product should be used only when there is adult supervision present as young children lack necessary
judgment regarding safety and the consequences of product misuse.
This product contains small parts and parts, which are sharp. This product contains electrically conductive
parts. Use caution with electrically conductive parts near or around power supplies, batteries and
powered (live) circuits.
When the product is turned ON, activated or tested, some parts will move or rotate. To avoid injuries to
hands and fingers, keep them away from any moving parts!
It is possible that an improperly connected or shorted circuit may cause overheating. Should this happen,
immediately disconnect the power supply or remove the batteries and do not touch anything until it
cools down! When everything is safe and cool, review the product tutorial to identify the cause.
Only operate the product in accordance with the instructions and guidelines of this tutorial, otherwise
parts may be damaged or you could be injured.
Store the product in a cool dry place and avoid exposing the product to direct sunlight.

Need support? support@freenove.com
2
List
www.freenove.com █
After use, always turn the power OFF and remove or unplug the batteries before storing.
About Freenove
Freenove provides open source electronic products and services worldwide.
Freenove is committed to assist customers in their education of robotics, programming and electronic circuits
so that they may transform their creative ideas into prototypes and new and innovative products. To this end,
our services include but are not limited to:
Educational and Entertaining Project Kits for Robots, Smart Cars and Drones
Educational Kits to Learn Robotic Software Systems for Arduino, Raspberry Pi and micro: bit
Electronic Component Assortments, Electronic Modules and Specialized Tools
Product Development and Customization Services
You can find more about Freenove and get our latest news and updates through our website:
http://www.freenove.com
Copyright
All the files, materials and instructional guides provided are released under Creative Commons Attribution-
NonCommercial-ShareAlike 3.0 Unported License. A copy of this license can be found in the folder containing
the Tutorial and software files associated with this product.
This means you can use these resource in your own derived works, in part or completely, but NOT for the
intent or purpose of commercial use.
Freenove brand and logo are copyright of Freenove Creative Technology Co., Ltd. and cannot be used without
written permission.
TM

Need support? support@freenove.com
1
List
█www.freenove.com
Contents
Welcome ............................................................................................................................................................................................... 1
Contents................................................................................................................................................................................................ 1
List ........................................................................................................................................................................................................... 3
Robot Expansion Board for ESP32 ...................................................................................................................................... 3
ESP32............................................................................................................................................................................................. 4
Machinery.................................................................................................................................................................................... 4
Transmission ............................................................................................................................................................................... 5
Acrylic............................................................................................................................................................................................ 5
Electronic...................................................................................................................................................................................... 6
Tools.............................................................................................................................................................................................. 6
Calibration ................................................................................................................................................................................... 7
Required but NOT Included Parts ....................................................................................................................................... 7
Preface ................................................................................................................................................................................................... 8
ESP32............................................................................................................................................................................................. 9
Pins Used for the Robot........................................................................................................................................................10
Robot Expansion Board for ESP32 ....................................................................................................................................12
Chapter 0 Install CH340 and Burn Firmware...........................................................................................................................13
Check Firmware .......................................................................................................................................................................13
Install CH340 Driver................................................................................................................................................................14
Burn the Firmware ..................................................................................................................................................................22
Chapter 1 Install Freenove App...................................................................................................................................................31
Install Freenove App ..............................................................................................................................................................31
IOS................................................................................................................................................................................................33
Introduction to Freenove App............................................................................................................................................34
Chapter 2 Robot Assembly...........................................................................................................................................................35
Step 1 Assembly of Disc Servo Arms................................................................................................................................35
Step 2 Assembly of Body Bracket......................................................................................................................................37
Step 3 Assembly of Legs.......................................................................................................................................................40
Step 4 Adjustment of Servo Angles..................................................................................................................................43
Step 5 Assembly of Legs to Body......................................................................................................................................47
Step 6 Assembly of Head and Wire..................................................................................................................................53
Step 7 Assembly of the Cover ............................................................................................................................................57
Step 8 Servo Wiring................................................................................................................................................................59
Step 9 Assembly of Calibration Bracket ..........................................................................................................................60
Step 10 Calibration.................................................................................................................................................................61
Chapter 3 Functions of Freenove App ......................................................................................................................................67
Introduction to Main Interface............................................................................................................................................67
Wi-Fi Configuration................................................................................................................................................................68
RGB LED Control .....................................................................................................................................................................71
Interaction Function ...............................................................................................................................................................72
Chapter 4 Q&A .................................................................................................................................................................................73

Need support? support@freenove.com
2
List
www.freenove.com █
Chapter 5 Arduino Software.........................................................................................................................................................75
Arduino Software ....................................................................................................................................................................75
Environment Configuration...................................................................................................................................................79
Chapter 6 Battery .............................................................................................................................................................................82
Chapter 7 Built-in Led ....................................................................................................................................................................87
Chapter 8 Buzzer..............................................................................................................................................................................92
Chapter 9 WS2812...........................................................................................................................................................................99
Chapter 10 Ultrasonic Ranging..................................................................................................................................................107
Chapter 11 Touch...........................................................................................................................................................................112
Chapter 12 Basic Motion .............................................................................................................................................................119
Chapter 13 BLE................................................................................................................................................................................124
Chapter 14 Camera Web Server ...............................................................................................................................................129
Chapter 15 Dog ..............................................................................................................................................................................138
Development ...................................................................................................................................................................................149
Code Repository....................................................................................................................................................................149
Communication Command ...............................................................................................................................................149
Explanation of Communication Protocol Instructions..............................................................................................151
What's Next?....................................................................................................................................................................................157

Need support? support@freenove.com
4
List
www.freenove.com █
ESP32
ESP32
OV2640
Machinery

Need support? support@freenove.com
5
List
█www.freenove.com
Transmission
Servo package x12
Acrylic
Acrylic x1

Need support? support@freenove.com
6
List
www.freenove.com █
Electronic
Extension board for camera
HC-SR04 ultrasonic module
Touch module
Tools
Cross screwdriver (3mm) x1
Cross screwdriver (2mm) x1
Cable tidy x80cm
Pry bar
USB cable
FPC camera cable
3P LED cable
4P jumper wire

Need support? support@freenove.com
7
List
█www.freenove.com
Calibration
Calibration graph
Required but NOT Included Parts
2 X 18650 flat top batteries with continuous discharge current ≥10A
It is not easy to find proper batteries on Amazon. Search 18650 3.7V high drain on eBay or other
websites.

Need support? support@freenove.com
8
Preface
www.freenove.com █
Preface
Welcome to use Freenove Robot Dog Kit for ESP32. Following this tutorial, you can make a very cool robot
dog with many functions.
This kit is based on ESP32, a popular control panel, so you can exchange your experience and design ideas
with many enthusiasts all over the world. The parts in this kit include all electronic components, modules, and
mechanical components required for making the robot dog. And all of them are packaged individually. There
are detailed assembly and commissioning instructions in this book.
If you encounter any problems, please feel free to contact us for quick and free technical support.
support@freenove.com
This book aims to help enthusiasts assemble the robot dog and download related codes. You can read and
download the codes via the link below:
https://github.com/Freenove/Freenove_ESP32_Dog_Firmware
You can refer to another esp32 kit designed for starters: Freenove_Ultimate_Starter_Kit_for_ESP32.
https://www.freenove.com/store.html

Need support? support@freenove.com
9
Preface
█www.freenove.com
ESP32
ESP32-Wrover comes with two different antenna packages, PCB (on-board) antenna and IPEX™ antenna. The
PCB on-board antenna is an integrated antenna in the chip module itself, so it is convenient to carry and
design. The IPEX™ antenna is a metal antenna connector, derived from the integrated antenna of the chip
module itself, which is used to enhance the signal of the ESP32 module.
PCB on-board antenna
IPEX antenna
In this tutorial, the ESP32-WROVER is designed based on PCB on-board antenna packaged ESP32-WROVER
module.

Need support? support@freenove.com
10
Preface
www.freenove.com █
Pins Used for the Robot
To learn what each GPIO corresponds to, please refer to the following table.
The functions of the pins are allocated as follows:
Pins of ESP32
Functions
Description
GPIO36
Camera interface
CSI_Y6
GPIO39
CSI_Y7
GPIO34
CSI_Y8
GPIO35
CSI_Y9
GPIO25
CSI_VYSNC
GPIO26
SIOD
GPIO27
SIOC
GPIO4
CSI_Y2
GPIO5
CSI_Y3
GPIO18
CSI_Y4
GPIO19
CSI_Y5
GPIO21
XCLK
GPIO22
PCLK
GPIO23
HREF
GPIO13
I2C port
SDA
GPIO14
SCL
GPIO32
Battery detection / Ultrasonic-Trig port
A6 / Trig
GPIO12
Ultrasonic-Echo port
Echo
GPIO33
Buzzer port
Buzzer
GPIO15
Touch Sensor port
Touch
GPIO0
WS2812 port
WS2812
GPIO1
Serial port
TX
GPIO3
RX

Need support? support@freenove.com
11
Preface
█www.freenove.com
The hardware interfaces of ESP32 are distributed as follows:
Compare the left and right images. We have boxed off the resources on the ESP32 in different colors to
facilitate its understanding.
Box color
Corresponding resources introduction
GPIO pin
LED indicator
Camera interface
Reset button, Boot mode selection button
USB port

Need support? support@freenove.com
12
Preface
www.freenove.com █
Robot Expansion Board for ESP32
The functions of the board are as follows:
Note: Please refer to the marks on the battery holder to install batteries; otherwise, the circuit will not work.
WS2812
WS2812
Buzzer
Touch Sensor
Connector
WS2812
WS2812
Power
Power
Indicator
Servo
Connector
Servo
Connector
Servo
Connector
Servo
Connector
Ultrasonic
Connector

Need support? support@freenove.com
13
Chapter 0 Install CH340 and Burn Firmware
█www.freenove.com
Chapter 0 Install CH340 and Burn Firmware
Check Firmware
Please note that the firmware has been burnt by default, so generally, you do not need to burn it again.
Please follow the steps below to check whether firmware has been burnt:
1. Plug the ESP32 to the expansion board.
Pay attention to the orientation of the ESP32 and make sure it is plugged in correctly; otherwise, it may
damage the robot.
2. Connect ESP32 to your computer with a USB cable.
After connecting, you can see the yellow LED on ESP32 stay ON and the blue LED blink twice every second.
Meanwhile, the buzzer makes 4 warning sounds to tell you the camera has not yet been installed and then
a pleasant sound to indicate the finish of initialization.
If the above phenomenas happen, it means the firmware has been burnt.
If the firmware has been burnt on your robot, please skip to Chapter 1.
Otherwise, please continue with the following steps.
USB Port
LED
Indicators
Buzzer

Need support? support@freenove.com
14
Chapter 0 Install CH340 and Burn Firmware
www.freenove.com █
Install CH340 Driver
The computer uploads codes to ESP32 via CH340, so we need to install CH340 driver on our computer before
using.
1. First, download the CH340 driver. Click http://www.wch-ic.com/search?q=CH340&t=downloads to
download the appropriate one based on your operating system.
If you would not like to download the installation package, you can open
“Freenove_Robot_Dog_Kit_for_ESP32/CH340”. We have prepared the installation package.
Windows
MAC
Linux

Need support? support@freenove.com
15
Chapter 0 Install CH340 and Burn Firmware
█www.freenove.com
Next, we will explain how to install CH340 on different operating systems including Windows, Mac OS and
Linux.
Windows
Check the Installation of CH340
1. Connect esp32 to your computer with a USB cable.
2. Right-click on “This PC” on your computer desktop and select “Manage”.

Need support? support@freenove.com
16
Chapter 0 Install CH340 and Burn Firmware
www.freenove.com █
3. Click on “Device Manager” on the left of the pop-up window, and then click on “Ports” on the right. If
your computer has installed CH340 driver, you can see the port: USB-SERIAL CH340 (COMx).
If so, you can click here to move to the next step.
If CH340 (COMx) does not show on your computer, you need to install CH340 driver.
Install CH340 Driver
4. Open “Freenove_Robot_Dog_Kit_for_ESP32/CH340/Windows/”.
5. Double click to run the file “CH341SER.EXE”, whose interface is as below:
CH340 Port

Need support? support@freenove.com
17
Chapter 0 Install CH340 and Burn Firmware
█www.freenove.com
6. Make sure ESP32 has connected to your computer and then click “INSTALL”. Wait for the installation to
finish.
The following window indicates that the installation finishes.
7. After installation, open device manager again and you can see the port USB-SERIAL CH340 (COMx).
So far, CH340 has been installed. Close all dialog boxes.

Need support? support@freenove.com
18
Chapter 0 Install CH340 and Burn Firmware
www.freenove.com █
Mac OS
Check the Installation of CH340
Connect esp32 to your computer with a USB cable.
Open Terminal of Mac OS, and type in the command ls /dev/cu.usb*
If your Terminal prints the message similar to the above, then your computer has installed the CH340. You
can click here to move to the next step.
Otherwise, please continue with the following the steps.
Install CH340
If you would not like to download the installation package, you can open
“Freenove_Robot_Dog_Kit_for_ESP32/CH340”. We have prepared the installation package.
Open the folder “Freenove_Robot_Dog_Kit_for_ESP32/CH340/MAC/”
Run it.
Table of contents
Popular Computer Hardware manuals by other brands

mikroElektronika
mikroElektronika GSM2 click quick start guide

Apogee
Apogee UV-1000 Specifications

Belden
Belden grass valley STORM Pro Setup guide

StarTech.com
StarTech.com ECUSB3S1 instruction manual

Texas Instruments
Texas Instruments TMDSCNCD28P65X Information guide

Digital Voice Systems
Digital Voice Systems VC-55-PR user manual