Note: * is a required field, please fill it in during the registration stage↓
First published, original
Note: Please indicate whether the project has been made public for the first time; whether the project is original; whether the project has won awards in other competitions; if so, describe the details of the award; whether the project has participated in a defense in school.
GPL3.0
Note: Altruism means self-interest, please read the following content carefully.
Please fill in during the competition stage↓
Design an independent button using the GPIO0 pin. You can use this pin to start the download mode or use it as an ordinary button to further save PCB space. Users can use this button to control screen brightness, flip and other functions.
Reserved ESP8266 serial port download interface and offline voice module serial port download interface
Use an OLED 0.96-inch screen with a total of 128*64 pixels. The aspect ratio is just right for displaying weather, time and other elements. You can also add some UI. The communication interface uses IIC communication and only requires 2 pins (not included). power and GND)
Using 5V USB-Type-C for power supply, there is no need to consider the issue of forward and reverse plugging. In addition, most Android phones on the market now use this interface, and users do not need to find additional power cords to adapt.
AMS1117-3.3LDO step-down chip is used. This chip converts 5V to 3.3V power supply, mainly to power ESP8266-12F.
The offline voice module comes with a 5V-3.3V DC-DC chip, so you only need to supply the 5V power supply to the offline voice module.
According to the offline voice module manual, capacitors and diodes need to be added to the peripheral circuit.
Speakers and microphones use differential wiring
Note: It is recommended to use Lichuang EDA. If you choose other EDA tools, please upload schematics in PDF format, PCB drawings in PDF format, and PCB files in Gerber format in the attachments. Here you can explain in detail your project implementation principles and mechanisms, precautions, debugging methods, testing methods, etc. It is recommended to introduce your ideas to others in the form of pictures and texts.
When the correct command word is spoken, UART1 of the offline voice module will send a series of hexadecimal data packets. By unpacking the data, you will know what command word is spoken. For example, if you say "What time is it now?" The packet will get valid data as [0x14 0x00 0x00 0x3F] (this data can be set by yourself), thus forming a corresponding relationship between this string of data and the sentence "What time is it now". When ESP8266-12F receives the message sent by the voice module This string of data will know that the user wants to ask "what time is it" now, and then ESP8266-12F will obtain the current time and send it back to the offline voice module through a specific serial port protocol to make it broadcast. After the offline voice module receives this string of data , after unpacking, the broadcast corresponds to the digital tone 0-9. If it is "twenty-three forty-one", the data is processed on the ESP8266 side to split it, and "two" is sent first and then "ten". . . Send them one by one, pay attention to add a little delay, and broadcast the offline voices one by one. When combined, we will get the effect we want. Here is only one idea. With this idea, in theory, a lot of information can be broadcast, such as sunny days and rainy days. , thunderstorm, snowy day, etc. Note that the phonetic words can be reused, such as sunny day , rainy day , snowy day , all have the word "天" , then the voice package only produces "sunny", "rain", "snow", that is However, the rest is combined with "day", and the same is true for time one to nine. "Ten" is taken out separately for multiplexing, such as sending "two", "ten" and "three" voice packets continuously instead of making and sending "twenty-three" .
The following is a human unpacking of data - after understanding the principle, you should use a program to unpack, judge the beginning and end of the data through the frame header and frame tail, and then judge the message type through the 5th bit of data, and block the notification type. (A3) and reply type (A2), only look at the command type (A1 or A0)
This is a packet of data manually written and calculated based on the serial port protocol above. Note that when sending, you must check the HEX hexadecimal format, not the ASCII format.
【0xA5,0xFC,0x06,0x00,0xA1,0x92,0x02,0x80,0x92,0x02,0x00,0x00,0x00,0x49,0x02,0xFB】
【A5 FC 06 00 A1 92 02 80 92 02 00 00 00 49 02 FB】 无0x前缀版
The audio corresponding to the command word ID number 2 can be played. It should be noted that the message sequence number can be filled in at will, but the corresponding check digit also needs to be modified. After understanding the principle of the serial port protocol, you should use a program to automatically complete the packet assembly process. We only need to pass in the ID number to the interface.
This is the core code for sending offline voice (the personal program is very rough and only implements the functions. There may be bugs that have not been optimized. Welcome to communicate with each other)
/*
* 函数功能:发送离线语音声音数据包
* 形参:命令词 ID号
* 返回值:无
*/
void send_voice(uint8_t cmd_id)
{
int i = 0;
sendBuf[i++] = 0xA5; //帧头1
sendBuf[i++] = 0xFC; //帧头2
sendBuf[i++] = 0x06; //有效长度为 6
sendBuf[i++] = 0x00; //
uint8_t temp = i;
sendBuf[i++] = 0xA1; //A1命令 A2回复 A3通知
sendBuf[i++] = 0x92; //命令词ID
sendBuf[i++] = 0x02; //消息序列号
/* Data begin */
sendBuf[i++] = 0x80; //0x80:开始。仅开始后续ID才有意义。0x81:暂停 0x82:继续。0x83:停止。
sendBuf[i++] = 0x92; //播放方式
/* 这里4位数据也应该低位在前,高位在后,本程序未使用语义id,所以未做处理 */
// uint8_t high_1 = (sum >> 8) & 0xff; //高8位
// uint8_t low_1 = sum & 0xff; //低8位
sendBuf[i++] = cmd_id; //data
sendBuf[i++] = 0x00;
sendBuf[i++] = 0x00;
sendBuf[i++] = 0x00;
/* Data end */
int sum = 0;
for (; temp < i; temp++)
{
sum = sum + sendBuf[temp];
}
uint8_t high_check = (sum >> 8) & 0xff; //高8位
uint8_t low_check = sum & 0xff; //低8位
sendBuf[i++] = low_check; //校验位 低位在前
sendBuf[i++] = high_check; //校验位,高位在后
sendBuf[i++] = 0xFB; //帧尾
for (int m = 0; m < i; m++)
{
softSerial1.write(sendBuf[m]);
}
memset(sendBuf, 0, BUFF_SIZE);
delay(300);
}
As for the offline voice module program burning method, Li Gong gave a more detailed explanation in the offline voice course of the 2021 Lichuang Summer Training Camp. I will not go into details here. The establishment of the ESP8266 Arduino development environment is lengthy and there are many blog posts on Baidu, so I will not go into details here. Narrative.
Let’s share how to customize your own personalized Web configuration page, and how to query the weather through the main program search. You can register the private key in the userkey with Hefeng Weather by yourself.
The location city code of the main program can also be queried online.
The third line of parameters for configuring the WiFi interface is on line 334 and can be modified.
/**********************************/
page += String(F("<h1 style="color:#CCFF99">网络天气时钟</h1>"));
page += String(F("<h1 style="color:rgb(0, 60, 255)" >离线语音版</h1>"));
page += String(F("<span style="text-align:right;">"));
page += String(F("<h3 style="text-align:right;color:rgb(0, 0, 0)" >--Elec0</h3>"));
page += String(F("<h4>XXX</h4>"));
page += String(F("<h2 style="color:#36ee3f">立创暑期训练营2021</h2>"));
page += String(F("<h4>2021.XX.XX-2021.XX.XX</h4> "));
/****************************************/
/*上边这些语句可以自定义修改主界面文字,在WiFiManager.cpp中,460行左右,*/
If you want to change the color of the button, you can find the value after the button in WiFiManager.h,
const char HTTP_STYLE[] PROGMEM
in the statement around line 26, background-color:#8a0bdf;color:#e8f806;
and change the value after the # number. You can search on Baidu to find out which number corresponds to what color.
Note: If your project involves software development, please upload the corresponding project source code in the attachment. Here you can describe in detail your software flow chart, functional module block diagram, explanation or popular science of related algorithms, source code structure, programming, source code compilation method, program burning method, etc. It is recommended to introduce your ideas to others in the form of pictures and texts.
Note: BOM list involved in the project. Please upload a screenshot of the BOM at this location. Please upload the list details in PDF format to the attachment. Suggest packaging, purchasing channels, uses, etc. The specific content and form should be based on clearly expressing the project composition.
Not participating
Video requirements: Please shoot horizontally, the resolution is no less than 1280×720, the format is Mp4/Mov, and the size of a single video is limited to 100M; Video title: Lichuang Electronic Competition: {Project Name}-{Video Module Name}; if Innovation Competition: "Autonomous Driving"-Team Introduction.
More details: https://diy.szlcsc.com/posts/06c94d90c2c447dfbd9ed7339ff4a5b1
Retrieved from https://lceda.cn/account/user/projects/index/setting?project=1b1c881ca0514addbcaf94c0d3bc1fc6&folder=all
All reference designs on this site are sourced from major semiconductor manufacturers or collected online for learning and research. The copyright belongs to the semiconductor manufacturer or the original author. If you believe that the reference design of this site infringes upon your relevant rights and interests, please send us a rights notice. As a neutral platform service provider, we will take measures to delete the relevant content in accordance with relevant laws after receiving the relevant notice from the rights holder. Please send relevant notifications to email: bbs_service@eeworld.com.cn.
It is your responsibility to test the circuit yourself and determine its suitability for you. EEWorld will not be liable for direct, indirect, special, incidental, consequential or punitive damages arising from any cause or anything connected to any reference design used.
Supported by EEWorld Datasheet