# _Project Update_
1. PCB is updated from six-layer board to four-layer board, please see: Improved version (four-layer board)
2. Update LCD screen interface circuit, image display is normal
3. Update VC-02 serial port wiring
4. Update eye light interface position
# _Character Introduction_Wall
-E is a fictional character in the movie "Wall-E" and is also the protagonist of the movie. He is a fictional robot with the model WALL-E (Waste Allocation Load Lifter Earth Class, Earth version of garbage allocation load lifter), and later fell in love with the new alien plant detection female robot **Eve** (EVE, Extraterrestrial Vegetation Evaluator, but Wall-E called Eva) at first sight. Originally, "Wall-E" refers to a series of cleaning robots produced by the fictional super-large American company BnL (Buy n Large) in the film, but by the time the story in the film takes place, all Wall-E in the world except the one in the film have been scrapped and retired, so "Wall-E" refers specifically to this last one.
# _Project Plan_A
project plan is a plan, strategy or proposal that is designed to guide the implementation of a project. It describes the details of the project's goals, scope, schedule, budget and resource allocation.
![image.png]

###### **Liangshanpai chose GD32F470ZGT6. In order to make full use of its resources, the available peripherals are set in a table format, which is clear and concise. **
![image.png]

# _Selection Description_The
selection description is a very important part of the project implementation process because it directly affects the results of the project in terms of cost, time and quality. Therefore, it is necessary to carefully formulate the selection description, comprehensively evaluate various factors, select the best option, and fully evaluate and compare the pros and cons of the options.
**The overall height of the Wall-E 3D shell is 33CM, the width is 30CM, and the empty shell is 2.2kg, so the DC motor carried should have sufficient driving capacity. Choose a suitable motor-->Set the power supply of the motor, set the driver IC of the motor-->Adapt the buck power IC of the power supply. **
#### **1. 24V step-down DC-DC power supply IC: TPS54331DDAR**
>* Function type: step-down type
>* Voltage input: 3.5V to 28V
>* Voltage output: adjustable output voltage as low as 0.8V
![image.png]

#### **2. Servo driver IC: PCA9685**
>* Communication method: I2C
>* Working power supply voltage: 2.3V to 5.5V
>* Number of drivers: drive up to 16 LEDs (servos)
![image.png]

#### **3. Motor driver IC: AS4950**
>* Wide voltage supply: 8V to 40V
>* 3.5A peak drive output, 2A continuous output capability
| IN1 | IN2 | Motor drive status |
| --- | --- | --- |
| / | / | Empty |
| 0 | 0 | Stop |
| 0 | 1 | Forward |
| 1 | 0 | Reverse|
| 1 | 1 | Brake|
![image.png]

#### **4. Voice module IC: VC-02_CN**
>* Supply voltage: 3.6V to 5V
>* Support interface: UART / I2C / PWM / SPI / GPIO
>* Available IO quantity: 10
![image.png]

###### **_Anxinke Voice Open Platform: [http://voice.ai-thinker.com/#/](http://voice.ai-thinker.com/#/)_**Configure
GPIO_B2 as UART1_TX and GPIO_B3 as UART1_RX through SDK, so that the B2 and B3 pins of VC-02 are multiplexed as serial port functions to communicate with USART2 of GD32.
![image.png]

#### **5. LCD: 1.3 inch ISP** [Purchase link](https://m.tb.cn/h.UMNz7dR?tk=fEQsd7M9a3q)
>* Resolution: 240 (H) RGB * 240 (V)
>* Interface type: SPI / Parallel port
>* Driver chip: ST7789V
>* Working voltage: 3.3V
![tb_image_share_1677225133068_edit_4599379399818.jpg]

#### **6. Motor: 24V DC motor** [Purchase link](https://m.tb.cn/h.UMnZ0Gn?tk=LskZd7MQA57)
>* Working voltage: 24V
>* No-load speed: 200 rpm
>* Rated torque: 1.3kgf.cm
![1677228079912.png]

#### **7. LED lamp beads: 1W power** [Purchase link](https://m.tb.cn/h.ULWYcUr?tk=ebosd7LlHdp)
##### How can ordinary LEDs match my Wall-E? I want to find the most shining one~
![Screenshot_20230224_204258_com.taobao.taobao_edit.jpg]

##### **In the night sky, I shine the most!!! (Manual dog head)**
![1677250463830.png]

#### **8. Camera: Mlink-video** [Purchase link](https://m.tb.cn/h.UL39Oud?tk=GVuHd7pD6Fj)
>* Advantages: small size, high image quality, supporting APP
>* Disadvantages: Only supports up to 150 meters of image transmission, a bit expensive
Initially, I planned to design an image transmission and integrate it on the expansion board, but the only solution I could find was ESP32-CAM, and the board was too redundant after adding it, so I couldn't guarantee the success rate. So I gave up the self-built image transmission solution and chose the WiFi image transmission module of Mlink-video.
![tb_image_share_1677251107343_edit_20693346718195.jpg]

# _Debugging process_
###### After much hard work, I finally finished soldering it~~ What a delicate board~~
![IMG_20230218_102455.jpg]

###### I measured the temperature of the board and the overall temperature was within the standard.
![IMG_20230218_102139_edit_15016986987290.jpg]

###### During the voice debugging process, it was found that the microphone did not work. The multimeter was measured and it was found that the MIC+ and MIC- of the voice chip were short-circuited together. It was guessed that there was a tin connection at the bottom of the chip. The disassembly process was extremely difficult and I couldn’t remove it no matter how I tried. Finally, with the help of the members, I finally...
![IMG_20230223_142929_edit_6902985260924.jpg]

###### That’s right, the shielding shell was removed~~ laughing and crying~~ (The flying wire on the board is the multiplexed UART function of the VC-02 pin, which is not designed in the schematic diagram)
The funny thing is that after removing the shielding shell, the error was actually eliminated (it was not the bottom tin connection), and the reason turned out to be that there was a problem with the shielding shell.
![IMG_20230224_172024_edit_7038513664029.jpg]

# _Schematic Design Description_ ######
**1. Power Supply Buck Design**
The output voltage of the TPS54331 device can be adjusted externally through a resistor divider network. As shown in the figure, this voltage divider network consists of R3 and R5. Equations 4 and 5 give the relationship between the output voltage and the resistor divider.
The voltage reference system generates a ±2% initial accuracy voltage reference (±3.5% over temperature) by adjusting the output of a temperature-stable bandgap circuit. The typical voltage
reference (Vref) is designed to be 0.8V.
```
Vout = Vref × (R3/R5+1)
```
```
OUT_5V = 0.8 × (4.7k/900+1) = 4.978 V
```
![-55ec0b931489d06b_edit_7727467916007.jpg]

###### **2. Power indicator light design**
![image.png]

**LED current limiting resistor formula:**
```
Current limiting resistor = (supply voltage - LED voltage drop) / rated current```From
past
experience, we know that to design a 3.3V LED current limiting resistor, a 4.7k resistor is used, and to design a 7.4V one, a 10k resistor is used. So I thought that for this 24V project, at least a resistor of several tens of k would be used. The maximum resistance value calculated by the above formula is only 2.335k. The vague concept prompted me to continue looking for information in this area, so I found this very useful tool and shared it with you here: **[LED current limiting resistor value calculator](https://www.eechina.com/tools/led_current_limiting_resistance.html)**
![image.png]

###### **3. Motor drive design**
There should be two filter capacitors from the power supply VIN to the chip VP. The large capacitor is 250uF and the small capacitor is 100nF. The large capacitor can be a large electrolytic capacitor, but it occupies a large area. So I chose four 10uF ordinary chip capacitors in parallel to achieve a capacitance of 250uF. The actual object verified that this design is feasible.
![image.png]

###### **4. Eye lamp design**
As we all know, the output current of the MCU IO port is limited, only 70mA, and the 1W LED lamp bead needs to be rated at 350mA, so an NPN transistor (maximum output 500mA) is used to output a large enough current to drive the load.
![image.png]

###### **5. LCD design**
This 1.3-inch LCD can support two interfaces: parallel port/SPI. In order to make full use of MCU resources, the connection drawing method of the two interfaces is adopted, which provides sufficient methods for program implementation.
![image.png]

# _PCB design description_
##### **The overall PCB adopts a 6-layer board design, with the same area as Liangshan School, the same border, and the same size. **
~~Good news: Gold immersion process Bad news: Only green, it would be better if it matches the purple color of Liangshan Sect~~~
![1677248829809.png]

![1677249161291.png]

# _3D Model Description_
###### The number of 3D model parts is as high as hundreds, and the printing cycle is long. Pay attention to choosing the printing density and support. The printing support of the track should be cleaned up bit by bit with tweezers, otherwise it will affect the installation of other parts (it took a whole day to clean all the supports).
![1668951061244.png]

# _Bluetooth APP Description_
###### A Bluetooth APP creation tool that does not require writing code. It is very easy to use. [MIT APP INVENTOR](http://app.gzjkw.net), I recommend you to use it
![Screenshot_20230225_153402_appinventor.ai_Q9180DD.jpg]

# _Program Description_
* VC-02 communicates with GD32 via serial port to perform voice interactive control commands.
* In the SDK generated by the voice MCU VC-02, only hexadecimal numbers can be sent through the serial port, and the serial port receives the uint8_t type of data buffer, so data conversion is required.
**The function of the HexChar function is to convert a hexadecimal character from ASCII code to a hexadecimal number of the corresponding size: **
```
char HexChar(char c)
{
if((c>='0')&&(c<='9'))
return c-'0';
else if((c>='A')&&(c<='F'))
return c-'A'+10;
else if((c>='a')&&(c<='f') )
return c-'a'+10;
else
return 0x10;
}
```
**VC-02 execution statement: **
```
if(strcmp((char *)g_recv_buff_2,str_vc1)==0) BUZZER_ON;
else if(strcmp((char *)g_recv_buff_2,str_vc2)==0) BUZZER_OFF;
else if(strcmp((char *)g_recv_buff_2,str_vc3)==0) EYE_L_ON;
else if(strcmp((char *)g_recv_buff_2,str_vc4) ==0) EYE_L_OFF;
else if(strcmp((char *
)g_recv_buff_2,str_vc5)==0) EYE_R_ON; else if(strcmp((char *)g_recv_buff_2,str_vc6)==0) EYE_R_OFF;
else if(strcmp((char *)g_recv_buff_2 ,str_vc7)==0) MOTOR_FORWARD;
else if(strcmp((char *)g_recv_buff_2,str_vc8)==0) MOTOR_BACKWARD;
else if(strcmp((char *)g_recv_buff_2,str_vc9)==0) MOTOR_LEFTWARD;
else if( strcmp((char *)g_recv_buff_2,str_vc10)==0) MOTOR_RIGHTWARD;
else if(strcmp((char *)g_recv_buff_2,str_vc11)==0) MOTOR_STOP;
else if(strcmp((char *)g_recv_buff_2,str_vc12)==0) SERVO_WORK;
```
# _Physical Display_
## ## **After saying so much, let’s enjoy the cute Wall-E~~**
![1668239593084(1).png]

![IMG_20221112_140727.jpg]

![1668921480076.png]

![1668921528943. png]

![1668921579280.png]

![IMG_20221111_203121.jpg]

![IMG_20221111_202118(1).jpg]

# _Task Progress_ *
[ ] ~~Buzzer~~
* [ ] ~~Eye Light~~
* [ ] ~~Motor Driver~~
* [ ] ~~VC-02 ~~
* [ ] ~~Bluetooth HC-05~~
* [ ] ~~Camera module~~
* [ ] ~~ADC power detection~~
* [ ] ~~LCD~~
* [ ] Servo
* [ ] 2.4G
# _Other attachments uploaded_
>###### Wall-E video√
>###### Voice interaction video√
>###### LCD display video√
>###### Wall-E 3D model √
>###### Wall-E APP√
>###### Wall-E expansion board pin assignment table√
>###### Wall-E voice recognition program√
>###### Wall-E Bluetooth remote control program√
>###### Comprehensive operation program√