Today, with the continuous development of Internet of Things technology, speech recognition technology is applied to all aspects of our lives. Virtual images such as Tmall Genie, Xiaoai Classmates and Xiaodu are used in smartphones, smart speakers and home life. You can operate the device through instructions, freeing your hands and adding a lot of technological flavor to your life. As an excellent electronics person, it is not difficult to design a smart speaker or even build a whole-house intelligent control system. Then this smart AI offline voice night light designed using the Qiyingtailun C1122 main control module is for you. The first step to start intelligent design!
Application scenarios
Project characteristics
This project directly uses 5V power supply and can be used directly with a mobile phone charger or power bank. Four external RGB lights are connected to the CI-C22GS02S speech recognition module. The microphone feeds back the collected external sound signals to the module for analysis and then implements various instructions. It can also provide feedback through the speaker to perform human-computer dialogue interaction functions. The system design block diagram is as follows:
Figure 2-1 Speech recognition night light system block diagram
Create a project file for the intelligent AI offline voice night light control board in Lichuang EDA, and select and connect according to the reference circuit diagram. In order to make it easier for beginners to learn and weld, the other components in this project except the voice module use direct plug-in components.
The module uses a 5V power supply input from the J2 interface, and the capacitor C1 is used as a power filter to ensure the stability of the input power supply. The module has its own step-down chip LDO, which outputs a 3.3V power supply. One end of the resistor R3 is connected to the ninth pin, and one end of the resistor R3 is connected to the ninth pin. Connect the 3.3V pull-up generated by itself to enter the download mode; lead out the two pins of RX0 and TX0 of the module. This serial port is used for program downloading and is led out with a pin header (RX1 and TX1 can be used to communicate with other devices) Communication); when selecting a microphone, just choose 32db, and the speaker should be about 1W. You can also refer to the case for selection; 4 RGB lights are connected in parallel, and an NPN transistor is used as a switching circuit to drive, three groups of drivers The circuit is connected to the PWM3/PWM4/PWM5 three-way interface respectively. When the input is high level, the transistor is introduced and the corresponding LED lights up. By setting different duty cycles and conduction times, any color lighting effect can be configured.
Figure 3-1 Speech recognition night light circuit schematic diagram
Precautions:
When generating a PCB design, you should consider what the physical PCB will look like. Is it a square? Rectangle? round? There is no problem in making any whimsical shape. We encourage you to use your own ideas and creativity to design, but please note that the size of the board should be controlled within 10cm*10cm, so that you can Jialichuang is making boards for free ! During the design of this case, the night light purchased on the online shopping platform was disassembled and designed based on the internal structure. A 5cm rounded rectangle was made with a 10.5mm hole in the middle for fixation. During the actual design, you can also use it according to the design. Renovation and design of existing lighting products.
Figure 3-2 Online shopping night light model and frame design
The device layout of the PCB diagram generated directly from the schematic diagram is relatively messy, and the position needs to be adjusted according to actual needs during the design process. The principle of layout is to layout according to each circuit module. Select each circuit module in the schematic diagram and use the layout transfer function under the tool menu bar to realize the express layout. The layout is carried out according to the shape of the PCB frame. Four RGB lights are placed around the board. The resistor transistors are arranged neatly. The reference layout diagram is as follows:
Figure 3-3 Before and after component layout
A good layout can help us conduct better wiring. PCB wiring can be understood as a game of Lianliankan. What we have to do is to play this game with level and depth. In the PCB canvas, we can see very light blue lines. These lines are called flying lines. Their function is to tell us which pins need to be connected together. They correspond to the two devices connected together in the schematic diagram. Or devices that are connected together using network labels and network ports, where the same network needs to be connected together. PCB routing can also be said to be a game of eliminating flying wires.
When designing a double-layer circuit board, PCB traces are divided into top traces and bottom traces. The top traces are red lines by default and the bottom traces are blue lines. The traces are the wires in the circuit board. First select the top layer (shortcut key T) or the bottom layer (shortcut key B) in the layer and element, and then connect the two pads of the same network according to the flying lines. During the connection process, you can switch the wiring method by pressing the shortcut key L. The default wiring methods are line 45°, line 90°, arc 45°, arc 90° and any angle line. Different wiring methods can be switched according to the circuit connection situation. , making the circuit connections beautiful and neat.
After the previous good layout, you can connect the various network cables together smoothly when routing. During the routing process, you can give priority to the top-level cables. If it fails, you can switch to the bottom-level cables and the cables on the same layer. It cannot cross. If you encounter a situation where you must pass through, you can place a via hole on the line (shortcut key V) and then switch to another layer for routing. The via hole plays the role of connecting the top layer and the bottom layer here. The hole at the intersection of the red and blue lines in the reference picture is the via hole. If it is found during the final copper pour that there are still flying wires, you can also use vias to connect the top layer of copper and the bottom layer of copper, which plays a role in connecting the ground plane and eliminating flying wires. The PCB trace reference diagram and 3D preview are as follows:
Figure 3-4 Routing reference diagram and 3D preview
It seems like a simple Lianliankan, but in fact it requires our patience to make adjustments. The placement and layout of components will also affect the difficulty of wiring. The following reference suggestions are provided in the wiring of this project:
(1) The power line is set to 30mil and the signal line is set to 20mil width.
(2) GND does not require wiring, just use bottom and top layer copper.
(3) During the routing process, give priority to straight lines, and use obtuse angles or arc turns where corners are required.
(4) After completing the wiring, add appropriate silk screen marks to indicate the purpose and interface functions of the PCB board.
Tips:
Qiyingtailun's voice chip supports custom development. The reference case provides the already written firmware. After the module is first welded and powered on, the factory-configured voice will appear. You can do a test to see if the microphone and speaker are working properly. Test The instructions are as follows:
Figure 4-1 Voice chip factory default entries
Since the default test entry intelligently tests a simple dialogue, the IO port cannot be controlled. In order to facilitate beginners to quickly start making an offline voice-controlled small desk lamp, we have specially provided a firmware. After the firmware is programmed into the chip, a voice-controlled night light can be made.
Firmware programming requires preparing a USB to TTL circuit module in advance. This module can be purchased online or you can make one yourself. For related engineering cases, you can directly search for USB to TTL modules on the Lichuang open source hardware platform. For first-time contacts, you can also seek help from senior students.
First connect the module to the computer and check whether it is recognized in the device manager. If it is not recognized, you need to install a corresponding driver. Remember to plug in the device that shows the COM interface.
Figure 4-2 USB to TTL module
Click to view the open source USB to TTL project link
Download the C1122_SDK firmware file from the Lichuang Open Source Hardware Platform Intelligent AI Offline Voice Night Light Project Attachment, and unzip it to your computer.
(1) Open the C1122_SDKSDKsampleinternalsample_1122firmware directory
(2) Double-click to run the synthetic partition bin file (.bat format)
(3) Select the MP3 music playback mode and enter 4, click Enter and wait until the conversion is completed. The window will automatically close.
Figure 4-3 Merging partition files
(4) Double-click to run the package upgrade .bat file (.bat format). When using it for the first time, you will be prompted to select a chip. Here, select CI112X.
(5) Click Firmware Packaging, first click Pack Firmware, and then select Firmware Upgrade.
Figure 4-4 Serial port upgrade tool and packaging and firmware upgrade page
(6) Firmware programming. After the firmware is upgraded, you will jump to the firmware programming page, connect the USB to TTL module, and select the recognized serial port number (generally recognized by default). Click the check mark on the right to enter download mode. Then connect the serial port interface of the night light circuit to the download circuit. The wiring is as follows:
The TXD pin of the night light - the RXD pin of the downloader
The RXD pin of the night light - the TXD pin of the downloader
The VCC pin of the night light - the VCC pin of the downloader
The GND pin of the night light - the GND pin of the downloader
After connecting, start downloading. Look at the progress bar in the picture. When the progress bar shows device: update success, the firmware burning is completed. If it does not enter the download mode after connecting the line, you can unplug the VCC line on the circuit board and reinsert it.
Figure 4-5 Firmware programming
If there is anything unclear about the document tutorial, you can watch the official firmware upgrade operation video provided by Qiyingtailun: Click to watch
The reference instructions provided by the case are shown in the following table:
wake word |
Hello Xiaoxin |
command word |
turn on night light |
command word |
minimum volume |
||
command word |
Turn on the lanterns |
command word |
increase volume |
command word |
medium volume |
||
command word |
Turn off the lanterns |
command word |
reduce volume |
command word |
Turn on voice |
||
command word |
Turn off night light |
command word |
maximum volume |
command word |
Turn off voice |
At this point, congratulations, you have realized the function of voice controlling the night light switch. Now install it into a suitable night light.
Seeing this, I wonder if you really want to know how to customize a voice entry and reply. In fact, I also want to know, but there is a lot involved. After you learn C language, you can design one yourself. Now you have your own smart housekeeper assistant. At this time, you can not only control the lights, but also control sockets, air conditioners, TVs, water heaters and other equipment. This document will not be expanded. You can refer to the official information provided in the attachment and the Qiyingtailun Voice AI Platform for learning.
Open source engineering reference video to learn Qiyingtailun AI platform
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