Child care machine
Author: He Tingting
1. Introduction
Because there are two babies at home, they often want to listen to stories and the kind of stories that are played in a loop for a long time. For example, the little one in our family only listens to the story of the white-haired mouse spirit in Journey to the West. She can't operate it yet. I want to have a device that can play stories with voice control, so I use ESP32-S3-BOX to make a small box that can play stories with voice control, named Child Care Machine. The name is a bit big, but it is possible. At present, I have only done this project to put some stories that the baby likes to listen to into the TF card and play them with voice control. At present, I have modified the ESP32-S3-BOX code to add some TF card codes, purchased a TF card reader module to connect to the external interface, and copied the required stories to the TF card. At present, I have only done this. Later, you can connect to the cloud to play online stories. For children, it is better to download the required stories for her to play.
Figure 1
Figure 2
Figure 3
2. System Block Diagram (Combined Graphics and Text)
The hardware used is ESP32-S3-BOX, which includes the BOX provided by the mall, as shown in Figure 4, and the TF card reader/writer module purchased by myself, and the connection is shown in Figure 5.
Figure 4
Figure 5
As shown in Figure 5, connect the TF card module to the Pmod2 interface according to the wiring method in the table, and store the MP3 file to be played in the TF card.
3. Functional description of each part (combined with pictures and text)
The voice control function is a function of ESP32-S3-BOX. It is awakened by hi, Espressif or hi, esp, receives voice control commands, and performs different functions according to different commands, as shown in Figure 6. After waking up, it will play echo_cn_wake.wav (I am here). After a command is spoken, such as playing music, it will play echo_cn_ok.wav (OK). If it times out for 10 seconds, it will play echo_cn_end.wav (I am resting, call me again if needed).
Figure 6
The playback log is shown in Figure 7.
Figure 7
Use the voice command "play music" to play the story audio in the mp3 folder under the TF card. Currently, I have downloaded 4 audios, the story of the white-haired mouse spirit in Journey to the West, which is divided into 4 episodes for playback, as shown in Figure 8.
Figure 8
After the system starts, the file name of the mp3 folder of the TF card is first retrieved, and the file name is extracted into a list according to .mp3, and played in sequence. The command is used to play the next song and the previous song.
Use the SDK of ESP32-S3-BOX to modify the factory_example, test each functional block step by step, then add support for TF card, and sort out the logic of the playback process, so that you can play your favorite stories stored in the TF card. The modified part of the code is explained.
First, modify the main function as follows:
Set the TF card drive mode as shown below.
The function to initialize the TF card is provided by box, as shown in the figure.
After the TF card is initialized, set the LCD display, and then start searching for MP3 files on the TF card. Because my file is recognized as MP3, modify the function audio_task to recognize MP3, as shown in the figure.
After compiling, download and run it, you can use voice control to play the story.
5. Demonstration video of the work’s functions
My daughter can wake up Lexin by voice when she is 3 years old, but she doesn't follow the routine. She finishes her words before the collection thread starts working. It is also possible that the command needs to be said word by word. My son can easily control it by voice, and his speaking speed is relatively slow. My daughter called Lexin several times, but it didn't play the story. She directly said it was lazy, and I laughed. This small box is suitable for children above the senior class. My daughter is a little small and her speaking speed is uncontrollable.
【Child care machine】+ ESP32-S3-BOX+ESP32-S3-DevKitC-1 material unpacking and BOX basic demonstration
【Child care machine】+ ESP32-S3 VScode environment construction and hello_world project flashing
【Child care machine】+ESP32S3-BOX latest firmware download and study
【Child care machine】+ ESP32S3-BOX network connection process record
【Child care machine】+ ESP32S3-BOX factory_demo source code download, compilation and flashing process record
【Child care machine】+ Two babies demonstration video (video in this post)
6. Project Summary
At first, I just wanted to make a small box that can play stories and can be controlled by voice, but later I found that esp32 can be connected to Baidu's dueros. I tried to make it for a long time and was able to play the radio, but I found that not all services are free. It may also be that my ability is limited and I was unable to conduct more in-depth research.
Later, I will continue to develop this small box with networked voice control. It can realize many functions. From the official website of esp32, there are many products that can be realized. It is very suitable for the name I gave it, the child care machine.
VII. Others
闺女语音控制
儿子语音控制
|