|
| 1 | +# Smart Bluetooth Speaker |
| 2 | +This application is a specific example of using wearable devices to control smart home devices. |
| 3 | +This application uses a wearable device to perform remote gesture control of the Bluetooth speaker, and supports voice control and touch screen control at the same time, providing users with more convenience. |
| 4 | + |
| 5 | + |
| 6 | +- [Smart Bluetooth Speaker](#smart-bluetooth-speaker) |
| 7 | + - [Introduction](#introduction) |
| 8 | + - [Function](#function) |
| 9 | + - [System Architecture](#system-architecture) |
| 10 | + - [Hardware Architecture](#hardware-architecture) |
| 11 | + - [Software Flow](#software-flow) |
| 12 | + - [Smart Screen UI](#smart-screen-ui) |
| 13 | + - [Hardware and Software Setup](#hardware-and-software-setup) |
| 14 | + - [Required Hardware](#required-hardware) |
| 15 | + - [Required Software](#required-software) |
| 16 | + - [Hardware Connection](#hardware-connection) |
| 17 | + - [User Manual](#user-manual) |
| 18 | + - [Before Running This Application](#before-running-this-application) |
| 19 | + - [Run This Application](#run-this-application) |
| 20 | + - [Build Arduino program](#build-arduino-program) |
| 21 | + - [Build EMSK program](#build-emsk-program) |
| 22 | + |
| 23 | + |
| 24 | + |
| 25 | +## Introduction |
| 26 | +### Function |
| 27 | +This smart Bluetooth speaker can accept three control inputs of gesture, voice, and touch screen, and can playing music from Bluetooth master devices or local Micro SD card. |
| 28 | +Seeeduino receives and processes gesture signals, and send corresponding data to EMSK through HC-06 Bluetooth transceiver. Voice recognition is implemented by LD3320A module using Auto Speech Recognition algorithm. Touch buttons on smart screen have touch feedback to provide intuitive human-computer interaction. |
| 29 | +After receiving control signals, the system sends corresponding instructions to the Bluetooth audio module, and the smart screen displays the current system operating status, as well as environmental temperature and humidity data and real-time clock. |
| 30 | +The detailed control commands are as followed: |
| 31 | + |
| 32 | +| Command | Gesture | Voice(Chinese Pinyin) | Touch Screen | |
| 33 | +| ---------------------- | -------------- | -------------------------- | ------------------------ | |
| 34 | +| Switch control mode | forward | "qie huan kong zhi mo shi" | | |
| 35 | +| Switch play mode | up | "qie huan bo fang mo shi" | | |
| 36 | +| Previous song | left | "shang yi qu" | "previous song" button | |
| 37 | +| Next song | right | "xia yi qu" | "next song" button | |
| 38 | +| Play song | down | "bo fang" | "play/pause song" button | |
| 39 | +| Pause song | down | "zan ting" | "play/pause song" button | |
| 40 | +| Volume up | clockwise | "jia da yin liang" | | |
| 41 | +| Volume down | anti-clockwise | "jian xiao yin liang" | | |
| 42 | +| Enable gesture control | backward | | | |
| 43 | + |
| 44 | + |
| 45 | + |
| 46 | +### System Architecture |
| 47 | +#### Hardware Architecture |
| 48 | +  |
| 49 | + |
| 50 | + |
| 51 | +#### Software Flow |
| 52 | +  |
| 53 | + |
| 54 | + |
| 55 | +### Smart Screen UI |
| 56 | +  |
| 57 | + |
| 58 | + |
| 59 | + |
| 60 | +## Hardware and Software Setup |
| 61 | +### Required Hardware |
| 62 | +- 1 DesignWare ARC EM Starter Kit(EMSK) |
| 63 | +- 1 Seeeduino, Arduino minimum system board |
| 64 | +- 1 HSC025A Bluetooth audio module |
| 65 | +- 1 DWIN's DMT48320C035_06W touchable smart screen |
| 66 | +- 1 I2C to UART module |
| 67 | +- 1 Power converter module for the smart screen |
| 68 | +- 1 LD3320A Voice recognition module |
| 69 | +- 1 PAJ7620U2 gesture sensor |
| 70 | +- 2 HC-06 Bluetooth to UART transceivers |
| 71 | +- 1 DS1302 real-time clock module |
| 72 | +- 1 DHT11 temperature and relative humidity sensor |
| 73 | +- 1 SD Card for EMSK second bootloader |
| 74 | +- 2 Micro SD Card, one for HSC025A, one for the initialization of the smart screen |
| 75 | + |
| 76 | + |
| 77 | + |
| 78 | + |
| 79 | +### Required Software |
| 80 | +- embARC Open Software Platform(OSP) |
| 81 | +- ARC GNU Tool Chain |
| 82 | +- Serial Port Utility or other serial port terminal |
| 83 | +- Arduino IDE |
| 84 | +- [DGUS_V3788](http://www.dwin.com.cn/home/Index/download_file?download_id=1753) for smart screen UI development |
| 85 | + |
| 86 | + |
| 87 | +### Hardware Connection |
| 88 | +1. **EMSK connection** |
| 89 | +EMSK implement speaker node, it can be controlled by touch screen input, Voice recognition and remote gesture recognition, and can execute the following command: next/previous song, play/pause, volume up/down, switch control/play mode, etc.. EMSK is powered by a 5V/4A AC power adapter. |
| 90 | +The smart screen it connect can display current control status and play status. |
| 91 | + |
| 92 | +| Device | Bus | Connector | Description | |
| 93 | +| ------------------ | ------ | ------------ | ---------------------------------------------- | |
| 94 | +| HSC025A | UART_0 | PMOD_1[4:3] | Bluetooth audio module | |
| 95 | +| HC-06 | UART_2 | PMOD_5[9:8] | Bluetooth transceiver for connecting Seeeduino | |
| 96 | +| LD3320A | I2C_0 | PMOD_2[4:3] | Voice recognition module | |
| 97 | +| I2C to UART module | I2C_1 | PMOD_4[4:3] | Convert I2C port to UART to connect the screen | |
| 98 | +| DS1302 | GPIO | PMOD_3[10:8] | Real-time clock module | |
| 99 | +| DHT11 | GPIO | PMOD_3[4] | Temperature and relative humidity sensor | |
| 100 | + |
| 101 | +1. **Seeeduino connection** |
| 102 | +Seeeduino implements wearable controller node, it processes received gesture signals and send the gesture number to EMSK through HC-06 Bluetooth transceiver. Seeeduino is powered by a 5V lithium battery through USB type-C port. |
| 103 | + |
| 104 | +| Device | Bus | Connector | Description | |
| 105 | +| --------- | ---- | --------- | ----------------------------------------- | |
| 106 | +| PAJ7620U2 | I2C | D[5:4] | Gesture recognition module | |
| 107 | +| HC-06 | UART | D[7:6] | Bluetooth transceiver for connecting EMSK | |
| 108 | + |
| 109 | + |
| 110 | + |
| 111 | +## User Manual |
| 112 | +### Before Running This Application |
| 113 | +1. Download [Arduino project](https://github.com/Websolder/SmartBluetoothSpeaker/tree/main/Arduino_Project) and [DGUS project](https://github.com/Websolder/SmartBluetoothSpeaker/tree/main/DGUS_Project) |
| 114 | + |
| 115 | +2. Initialize Smart Screen UI |
| 116 | + Copy the whole directory `/DGUS_Project/DWIN_SET` to an empty Micro SD card, and then insert it to the slot on the smart screen. Power up the screen and complete the initialization, then pull out the Micro SD card and reboot the screen. |
| 117 | + the UI project file `DGUS_Project/DWprj.hmi` can be modified with DGUS_V7388 IDE. |
| 118 | + |
| 119 | + |
| 120 | + |
| 121 | + |
| 122 | +### Run This Application |
| 123 | +#### Build Arduino program |
| 124 | +Open [Arduino project file](https://github.com/Websolder/SmartBluetoothSpeaker/tree/main/Arduino_Project/HC06-GS.ino) with Arduino IDE, compile the program and download to Seeeduino. |
| 125 | + |
| 126 | + |
| 127 | +#### Build EMSK program |
| 128 | +Before programming EMSK, PMOD mux must be configured in order to use bus drivers of embARC. |
| 129 | +```c |
| 130 | +// In file "embarc_osp-master/board/emsk/common/emsk_init.c" |
| 131 | + set_pmod_mux(mux_regs, PM1_UR_UART_0 | PM1_LR_SPI_S \ |
| 132 | + | PM2_I2C_HRI \ |
| 133 | + | PM3_GPIO_AC \ |
| 134 | + | PM4_I2C_GPIO_D \ |
| 135 | + | PM5_UR_SPI_M1 | PM5_LR_SPI_M2 \ |
| 136 | + | PM6_UR_SPI_M0 | PM6_LR_GPIO_A ); |
| 137 | +``` |
| 138 | +
|
| 139 | +Makefile target options about EMSK and toolchain: |
| 140 | +```makefile |
| 141 | +APPL ?= bluetooth_speaker |
| 142 | +BOARD ?= emsk |
| 143 | +TOOLCHAIN ?= gnu |
| 144 | +OLEVEL ?= 02 |
| 145 | +BD_VER ?= 22 |
| 146 | +CUR_CORE ?= arcem7d |
| 147 | +``` |
| 148 | + |
| 149 | +The middleware used in this application: |
| 150 | +```makefile |
| 151 | +MID_SEL = common |
| 152 | +``` |
| 153 | + |
| 154 | +Directories of source files and header files: |
| 155 | + |
| 156 | +```makefile |
| 157 | +EMBARC_ROOT = ../../../../.. |
| 158 | +# application source dirs |
| 159 | +APPL_CSRC_DIR = . |
| 160 | +APPL_ASMSRC_DIR = . |
| 161 | + |
| 162 | +# application include dirs |
| 163 | +APPL_INC_DIR = . |
| 164 | + |
| 165 | +# include current project makefile |
| 166 | +COMMON_COMPILE_PREREQUISITES += makefile |
| 167 | + |
| 168 | +### Options above must be added before include options.mk ### |
| 169 | +# include key embARC build system makefile |
| 170 | +include $(EMBARC_ROOT)/options/options.mk |
| 171 | +``` |
| 172 | + |
| 173 | +In this application, embARC 2nd bootloader is used to automatically load program binary for EMSK and run. To run this application, execute command `make run` in the terminal, and execute `make bin` to generate binary file for embARC 2nd bootloader. Then, rename the binary file as `boot.bin` and copy it to an empty SD card together with bootloader binary file `bt.bin`. Insert the SD card in the slot on EMSK, power up and this application will start to run. |
| 174 | +The initial control mode is voice mode, and the initial play mode is SD mode, and users can control this speaker through method mentioned above. |
0 commit comments