王达业

【Graduate Design】A WALL-E robot

 
Overview

Question requirements

A robot based on the "WALL-E" from the Oscar-winning animated feature film "Wall-E".

Question analysis

Bringing the WALL-E robot to reality, you can use your mobile phone to control the movement of the robot and the movements of the robotic arm, with WiFi real-time image transmission, ultrasonic sensors, temperature sensors, and voltage detection, and the sensor data can be viewed on the mobile phone.

Schematic design instructions

I'm too lazy to write, so I just copied it from the paper. . . The complete schematic is in the attachment

1 System hardware circuit design

This chapter mainly describes the circuit design of the robot, including lithium battery charging and discharging circuit, WiFi image transmission circuit and robot motion control circuit. The system composition is shown in Figure 3.1. The ESP32-S is used to process the images from the OV2640 camera and send them to the mobile phone through the WiFi network. The HC-05 Bluetooth module is used to receive the data sent by the mobile phone and send signals to the mobile phone. The ATmega2560 microcontroller is used to It processes the data received by the Bluetooth module and sends signals to the motor drive circuit to control the motor. The ultrasonic module is used to measure distance, and the TFT display screen is used to display the current power of the robot.
The software used to design schematic diagrams and draw PCB diagrams is Lichuang EDA Professional Edition. Lichuang EDA Professional Edition is a domestic PCB design tool owned by Jialichuang. It has completely independent intellectual property rights and is permanently free.
image.png
Figure 3.1 Overall block diagram of circuit design

1.1 Lithium battery charging and discharging circuit design

Lithium battery is a type of battery that uses lithium metal or lithium alloy as positive/negative electrode materials and uses non-aqueous electrolyte solution. It has the advantages of high energy ratio, long service life, low self-discharge rate, light weight, etc., and is more suitable for robotic projects. The circuit structure includes peripheral circuits, input and output circuits, lithium battery protection circuits and boost output circuits composed of IP5209.

1.1.1 Main control——IP5306

IP5306 is a multi-functional power management chip that integrates a boost converter, lithium battery charge and discharge management and battery power display. The chip can provide an output current of up to 2.4A and a charging current of 2.1A. Its power conversion efficiency can reach 92%, and the chip can enter a sleep state when it is no-load. The chip is packaged in ESOP8, and the circuit symbol is shown in Figure 3.2.
image.png
 Figure 3.2 IP5306 circuit symbol

1.1.2 Main control peripheral circuit

The input terminal VIN and the output terminals VOUT and VOUT2 are all added with capacitors for filtering. VOUT supplies power to all circuits except the motor driver chip, and VOUT2 supplies power to the motor driver chip. The advantage of separate power supplies is that even if the current is too large when the motor starts, it will not It will cause the voltage at the microcontroller end to drop, ensuring the normal operation of the entire control circuit; the circuit uses 4 LED lights for power display and a button for triggering; a 1uH power inductor is used for boost output, and IP5306 measures the output voltage. To achieve closed-loop control, the circuit connection is shown in Figure 3.3.
image.png
Figure 3.3 IP5306 charge and discharge circuit 

1.1.3 Lithium battery charge and discharge protection circuit

XB8886A is a single-cell lithium battery protection IC, which is packaged in SOP8-PP. It integrates power MOS and high-precision voltage detection circuit and delay circuit. It has the functions of cell reverse connection, overheating, overcharge, overdischarge, overcurrent and load short circuit, etc. Protection, widely used in single-core lithium-ion battery packs, lithium polymer batteries, mobile power supplies and other fields. The circuit schematic diagram is as shown below, where B+ is connected to the positive electrode of the lithium battery and B- is connected to the negative electrode. The circuit connection is shown in Figure 3.4.
image.png
Figure 3.4 Lithium battery charge and discharge protection circuit

1.1.4 Power input circuit

Since this design does not have fast charging requirements, a 6-Pin Type-c female socket was chosen as the power input interface. Compared with 16Pin or 24Pin female sockets, the 6Pin female socket has a larger pin area and can provide greater input current. It is also relatively easy to weld and is cheaper. It meets design requirements while reducing production costs. The circuit symbol is shown in Figure 3.5.
image.png
Figure 3.5 Type-c female circuit symbol

1.1.5 Boost voltage stabilizing circuit

This circuit is used to power the motor driver chip. There are two types of power supply for the motor driver chip. One is to directly use the 5V voltage output by the IP5209 chip, and the other is to step up and down the previous 5V voltage. Obviously, the second power supply method is applicable to a wider range of motors. The output torque of the motor can be changed through voltage regulation, allowing for more fault tolerance. The circuit control chip uses SX1308. SX1308 is a fixed frequency, SOT23-6 packaged current mode boost converter. The operating frequency up to 1.2MHz allows the selection of smaller specifications for the peripheral inductors and capacitors. It integrates an 80mΩ power MOSFET internally. The input The voltage is 2V-24V, and the output voltage is up to 28V. The output voltage can be adjusted through the voltage dividing resistor. The circuit connection is shown in Figure 3.6.                                                                                                
image.png
Figure 3.6 Boost voltage stabilizing circuit connection diagram

1.2 WiFi image transmission circuit design

This circuit uses ESP32-S as the main module, and its main function is to send OV2640 camera data to the mobile phone through WiFi. The circuit mainly includes ESP32-S-based peripheral circuits and reset circuits, power circuits, PSRAM circuits, OV2640 camera connection circuits and reset circuits, and TF card connection circuits.

1.2.1 Main control module——ESP32-S

ESP32-S is a general-purpose WiFi-BT-BLE MCU module with powerful functions and a wide range of uses. It can be used in low-power sensor networks and extremely demanding tasks, such as speech encoding, audio streaming, and MP3 decoding. Its circuit symbol is shown in Figure 3.7. The core of this module is the ESP32 chip developed by Espressif Systems, with built-in 520KB SRAM. The main frequency supports 80MHz, 160MHz and 240MHz, and is scalable and adaptive. It should be noted that due to the shielding effect of the all-metal body on the signal, the onboard antenna of the ESP32-S is not used in this design. An external antenna is used, and the 0 ohm resistor on the ESP32-S circuit board needs to be connected. To the onboard first-generation IPEX antenna holder, it is convenient to connect an external antenna.
image.png
Figure 3.7 ESP32-S circuit symbol

1.2.2 ESP32-S peripheral circuit

The peripheral circuit is relatively simple, including a decoupling capacitor, download circuit and reset circuit. When downloading the program, you need to connect the IO0 pin of ESP32-S to the ground. The method is to connect it to the ground through the button. The button corresponds to SW1 in the schematic diagram. The reset circuit consists of a 10k resistor, a 100nF capacitor and a button. The circuit connection is shown in Figure 3.8.
image.png
Figure 3.8 ESP32-S peripheral circuit connection diagram

1.2.3 Power circuit

This circuit is used to power the entire WiFi image transmission circuit. The circuit includes three linear voltage regulators, namely AMS1117-3.3V, ME6211-2.8V and ME6211-1.2V. The former is responsible for powering components outside the camera, and the latter two are used for For powering the camera, the circuit also includes an LED light used to determine whether the linear regulator is working properly. The circuit connection is shown in Figure 3.9.
image.png
Figure 3.9 Power circuit connection diagram

1.2.4 Camera connection circuit

The camera is OV2640, which is connected to the PCB using a 24Pin FPC connector. The camera requires three power supply voltages, namely 1.2V, 2.8V and 3.3V. The circuit diagram is shown in Figure 3.10.
image.png
Figure 3.10 Camera connection circuit

1.2.5 Storage circuit

存储电由一个PSRAM电路和TF卡连接电路组成。PSRAM全称为伪静态随机存储器,用于扩展ESP32-S的存储空间。使用到的是一颗APS6404芯片,该芯片具有高速,低引脚数接口,拥有四个SDR I/O引脚,并以高达144MHz的频率在SPI或QPI模式下运行。TF卡使用自弹式TF卡座连接,外围电路如图3.11所示。
image.png
3.11 存储电路电路图

1.3 机器人运动控制电路

该电路控制机器人的所有动作机构,包括左右两个主动轮和拥有三个自由度的机械臂,以及处理各种传感器的数据,作出相应的动作。考虑到整个机器人需要多个电机以及传感器,主控选择ATmega2560单片机,相关参数如表3.1所示,图3.12为该单片机引脚封装图。
3.1 ATmega2560参数列表


控制器ATmega2560
工作电压5V
数字I/O54(包含15路PWM输出)
模拟输入口16
每个I/O口直流电流40mA
闪存(Flash Memory)256KB(其中8KB用作BootLoader)
静态存储器(SRAM)8KB
EEPROM4KB
时钟频率16MHz
image.png
3.12 ATmega2560的100引脚封装

1.3.1 主控及外围电路

主控使用ATmega2560,外围电路包括晶振电路、复位电路、烧录电路、超声波传感器连接电路、温度传感器电路、TFT屏幕连接电路、散热风扇控制电路等。晶振选择四引脚16MHz无源晶振,对应原理图中的X1,连接时需在XTAL1和XTAL2间接1M欧姆电阻。复位电路使用按键加电阻电容来实现,分别对应原理图中的SW4、R26和C37,可以实现上电自动复位和按键复位。烧录电路包括烧录引导程序(BootLoader)的电路和使用串口进行烧录的电路,对应原理图中的J1和P1,都是使用单排针进行连接;烧录引导程序是一个全新单片机第一件要做的事,否则后续程序将无法烧录进单片机中;超声波传感器使用的是HC-SR04,对应原理图中的H2,需要对传感器进行一点改装,就是把两个超声波头和排针拆下,方便在电路板上焊接,而拆下的超声波头则是使用XH2.54-2P连接座连接到超声波模块上,连接座对应原理图中的CN11和CN12。温度传感器使用的DS18B20,对应原理图中的U13,DS18B20是常用的数字温度传感器,其输出的是数字信号,具有体积小,硬件开销低,抗干扰能力强,精度高的特点,使用是需在信号端和电源端接10k欧姆上拉电阻。TFT屏幕使用8Pin的FPC连接座连接到单片机,对应原理图中的FPC2,需要注意的是屏幕使用的是3.3V的电压供电,超过会烧毁屏幕。散热风扇使用的是额定电压5V、长宽都是30mm的风扇,对应原理图中的CN4,风扇由一只S8050三极管控制。电路连接如图3.13所示。
image.png
3.13 ATmega2560及外围电路连接图

1.3.2 HC-05蓝牙模块

与手机之间进行通信使用的是HC-05蓝牙串口模块,通过蓝牙接收手机发出的控制然后通过串口发送给单片机来控制机器人的运动。电路连接如图3.14所示。HC-05是主从一体的蓝牙模块,默认为从机。既支持跟模块通信,也支持跟手机通信。具有两种工作模式:串口透传通信模式和AT指令模式。(1)模块又可分为主(Master)、从(Slave)和回环(Loopback)三种工作角色。当模块处于自动连接工作模式时,将自动根据事先设定的方式连接设备并进行数据传输。比如跟手机蓝牙连接,可通过手机APP给蓝牙模块发送数据。指令可通过表3.2查询。(2)T指令模式时能执行下述所有AT命令,用户可向模块发送各种 AT 指令,为模块设定控制参数或发布控制命令。AT 指令不区分大小写,均以回车、换行字符结尾。3.2 蓝牙模块指令表




指令功能响应参数
AT测试指令OK
AT+RESET模块复位(重启)OK
AT+VERSION?获取软件版本号+VERSION:<Param>OKParam:软件版本号
AT+ORGL恢复默认状态OK
AT+ADDR?获取模块蓝牙地址+ADDR:<Param>OKParam:模块蓝牙地址
AT+NAME=<Param>设置设备名称OKParam:蓝牙设备名称
AT+NAME?查询设备名称1.+NAME:<Paeam>OK——成功2.FAIL——失败
AT+RNAME?<Param>获取远程蓝牙设备名称1.+NAME:<Param>OK——成功2.FAIL——失败Param:远程蓝牙设备地址
AT+ROLE=<Param>设置模块角色OKParam:参数取值如下:0——从角色1——主角色2——回环角色
AT+ROLE?查询模块角色+ROLE:<Param>OK
AT+PSWD=<Param>设置配对码OKParam:配对码默认:1234
AT+PSWD?查询配对码+PSWD:<Param>OK
AT+UART=<Param1>,<Param2>,<Param3>设置串口参数OKParam1:波特率Param2:停止位Param3:校验位
AT+UART?查询串口参数+UART=<Param1>,<Param2>,<Param3>
AT+PMSAD=<Param>删除指定认证设备OKParam:蓝牙设备地址
AT+RMAAD删除所有认证设备OK
AT+ENSNIFF=<Param>进入节能模式OKParam:设备蓝牙地址
AT+EXSNIFF=<Param>退出节能模式OK
image.png
3.14 蓝牙模块电路连接图

1.3.3 电机驱动电路

This circuit is used to drive DC brush motors and two-phase four-wire stepper motors. A total of five groups of drive circuits are designed, four of which are used to drive stepper motors, and the rest are used to drive brushed DC motors. Since the driving capability of the I/O port of the microcontroller is limited, and the direct driving of the motor by the microcontroller is risky for the microcontroller, it may directly burn the microcontroller, so professional things should be done by professional chips. The microcontroller is responsible for outputting control signals to the motor driver chip, and then the motor driver chip drives the motor. The driving circuit is shown in Figure 3.15. The DRV8848 provides dual H-bridge motor drivers for home appliances and other electromechanical applications. The device can be used to drive one or two DC motors, a bipolar stepper motor, or other loads. A simple PWM interface can be easily connected to the controller circuit. The chip used here is DRV8848, which uses a dual H-bridge design to drive one or two DC motors or a two-phase four-wire stepper motor or other loads. Each H-bridge uses a fixed off-time chopping scheme to regulate winding current, and each is capable of outputting up to 2A of drive current, and 4A of drive current in parallel mode. The chip has a sleep mode, which shuts down the internal circuitry to achieve very low quiescent current. The sleep mode can be set through the nFAULTra pin. The chip integrates short-circuit protection and over-temperature protection functions. The chip is a power device and has a certain internal resistance. The heating of the circuit is closely related to the load current, the internal resistance of the power tube and the ambient temperature. An internal chip-level temperature detection circuit is designed to monitor the internal heat of the chip in real time. When the internal temperature of the chip exceeds the set value, a power tube shutdown signal is generated and the load current is turned off to avoid continued temperature rise due to abnormal use, which may cause plastic damage. Serious safety accidents such as smoke and fire in the package. The built-in temperature hysteresis circuit of the chip ensures that the power tube can be controlled again only after the circuit returns to a safe temperature.
image.png
Figure 3.15 Motor drive circuit connection diagram

PCB design instructions

There’s nothing to write about. Just keep the wiring loop as short as possible and connect it according to the schematic diagram.
image.png
image.png

Software description

The software used is in the attachment, you can download and view it yourself.

Physical display instructions

image.png

Precautions


Demo video

Upload other attachments



参考设计图片
×
 
 
Search Datasheet?

Supported by EEWorld Datasheet

Forum More
Update:2025-06-18 11:19:19

EEWorld
subscription
account

EEWorld
service
account

Automotive
development
community

Robot
development
community

About Us Customer Service Contact Information Datasheet Sitemap LatestNews


Room 1530, 15th Floor, Building B, No.18 Zhongguancun Street, Haidian District, Beijing, Postal Code: 100190 China Telephone: 008610 8235 0740

Copyright © 2005-2024 EEWORLD.com.cn, Inc. All rights reserved 京ICP证060456号 京ICP备10001474号-1 电信业务审批[2006]字第258号函 京公网安备 11010802033920号