太白金星

[Smart Home] Smart AI Voice Night Light

 
Overview

1 Project introduction

        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

  • E-learning awareness and interest cultivation cases
  • Basic electronic component identification and welding course
  • Courses related to program framework learning and application development
  • Can be used in smart electric fans, small household appliances, toys, lighting and other electronic products

Project characteristics

  • The input voltage is DC 5V
  • Wake words and reply words can be customized and modified
  • Supports offline speech recognition of 200 local command words
  • Using the three-way PWM function, you can realize common functions such as turning on the lights, turning off the lights, and dimming the brightness.
  • The project design uses direct plug-in components except for modules. The circuit is simple and reference cases are provided to facilitate beginners' learning and welding debugging, which greatly guarantees the success rate of the work.

2 Overall design plan

        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:

wps

Figure 2-1 Speech recognition night light system block diagram

3 Hardware circuit design

3.1 Schematic design

        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.

Schematic diagram

Figure 3-1 Speech recognition night light circuit schematic diagram

Precautions:

  • When purchasing materials, please note that J2 is a power interface and does not need to be purchased. If a certain device is out of stock, you can look for alternative materials. For example, for RGB lanterns, you can find the same type of common sun RGB lamps. You can also purchase according to the spare materials in the picture. .
  • The RGB lamp symbol in the picture has been modified. Use the component number to search it in the component library and then select Edit. Modify the symbol style according to your own preferences. Save it as a file in your own library and then call it. In the case, the internal color of the LED is filled in. , easy to identify the color status controlled by each pin.

3.2 PCB design

3.2.1 Appearance design

        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

3.2.2 Component layout

        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

3.2.3 PCB routing

        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:

  • When placing vias, the network will be automatically named if it is placed directly on the line. If it is not placed on the line, the network needs to be manually named.
  • If you need to place a via hole during routing, use the layer cutting shortcut key T or B to quickly place a via hole. For example, if you need to place a via hole in the top layer routing, you can first press the left mouse button to confirm the routing, and then press the B key to switch. When routing to the bottom layer, vias are automatically generated.

4 Software and code debugging

4.1 Power-on test

        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:

aLNUtvqRWAKm2yrURuoHvAFQXP2wSSAR36QPQr4u.png

Figure 4-1 Voice chip factory default entries

4.2 Burning night light firmware

        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.

4.2.1 Tool preparation

        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.

IMG_256

Figure 4-2 USB to TTL module

Click to view the open source USB to TTL project link

4.2.2 Firmware download

        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.

dhKFSg8xeeheR0oS74piY07hBdYkREgTke0RKXjn.png

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.

i4ffQqwUPKFbOo0rpE7LMTYvWN20PQLuMa0rrSDR.png

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

4.2.3 Default command description

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.

4.3 Custom entry settings (advanced)

        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.

5 project information

Open source engineering                                reference video to learn                                   Qiyingtailun AI platform

参考设计图片
×
 
 
Search Datasheet?

Supported by EEWorld Datasheet

Forum More
Update:2025-05-23 11:19:27

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号