Smart Plant Scan & Speak Device Based on QR Code Recognition and Voice Recognition
1.Project Introduction
1.1 Project Overview
In botanical gardens, community parks, or campuses, various plants enrich our living environments, yet we often know very little about these plants around us.We have made exclusive QR codes for the plants in the community. These QR codes store information such as the plants' names, ages, categories and characteristics. To enable people to more conveniently recognize and understand these plants, we have created a plant quick-reference device using the UNIHIKER K10.

This device combines two built-in AI functions of the UNIHIKER K10āQR code recognition and Voice recognition. Without complicated operations, it provides a simple and efficient way for plant enthusiasts, community residents, students, and others to learn about and explore plants, helping everyone better connect with nature and understand the plant world around them.
1.2 Project Functional Diagrams

1.3 Project Video
2.Materials List
2.1 Hardware list

2.2 Software
Mind+ Graphical Programming Software ļ¼Minimum Version Requirement: V1.8.1 RC1.0ļ¼

2.3 Basic Mind+ Software Usage
(1) Double click to open the Mind
The following screen will be called up.

Click and switch to offline mode.

(2) Load UNIHIKER K10
Based on the previous steps, then click on "Extensions" find the "UNIHIKER K10" module under the "Board" and click to add it. After clicking "Back" you can find the UNIHIKER K10 in the "Command Area" and complete the loading of UNIHIKER K10.

Then,you need to use a USB cable to connect the UNIHIKER K10 to the computer.

Then, after clicking Connect Device, click COM7-UNIHIKER K10 to connect.

Note: The device name of different UNIHIKER K10 may vary, but all end with K10.
In Windows 10/11, the UNIHIKER K10 is driver-free. However, for Windows 7, manual driver installation is required: https://www.unihiker.com/wiki/K10/faq/#high-frequency-problem.
The next interface you see is the Mind+ programming interface. Let's see what this interface consists of.

Note: For a detailed description of each area of the Mind+ interface, see the Knowledge Hub section of this lesson.
3.Construction Steps
Letās start building this plant Scan&Speak device project together. We divide the project into two main functions:
(1) Recognize plant QR codes, display plant identity cards, and provide voice explanations
(2) Use voice recognition to answer users' questions and broadcast responses
3.1 Task1: Recognize Plant QR Code and Display Plant ID Cards
(1) Material Preparation
First, use a QR code generation website to create three QR codes. The content of each QR code should be the name of one of three plants, as shown in the image below. (Note: All materials and related files used in this project are listed in the appendix at the end.)

Then, we need to prepare identity introduction cards and corresponding audio explanations for three types of plants: Oak, Acer rubtum, and Platanus, as shown in the image below.

Use a TF card and a card reader to copy the audio explanation files corresponding to the identity cards onto the TF card via a computer, as shown in the image below.

In this way, when the corresponding QR code is recognized, the identity card of the corresponding plant will be displayed, and a voice introduction will be played.
(2) Hardware Setup
Ensure that the UNIHIKER K10 is connected to the computer using a USB cable.Confirm that the UNIHIKER K10 is connected to the computer using a USB cable. Insert the TF card into the card slot of the UNIHIKER K10.

(3) Software Preparation
Make sure that Mind+ is opened and the UNIHIKER board has been successfully loaded. Once confirmed, you can proceed to write the project program.

(4) Writing the Program
STEP One: Display the UI Page of the Plant Scanner&Speaker
First, create a UI page for our plant Scanner&Speaker. This page will help users understand the device's functions.
Use the cache local image block and show cached content in UNIHIKER K10 Blocks to load a local image file and refresh the screen with the UI content.

STEP Two: Press Button A to Recognize QR Codes and Display Text Results on Screen
UNIHIKER K10 has a built-in QR code recognition model that can identify QR codes, parse them, and retrieve the content. Since this project involves both QR code recognition and voice recognition, we use a flag variable for judgment. First, go to the "Variables" section on the left and create a new variable named flag.

Use the "Set flag to 0" block to initialize the flag variable with a value of 0 in the main program

Next , in the UNIHIKER K10- Sensors Block Area, find the "When Button A is Pressed" block and drag it into the programming area.

Drag in the commands clear screen block, enable camera show, and Switch to QR Code Recognition Mode in sequence. This will clear the UI page image, activate the camera, and initiate QR code recognition when Button A is pressed.

Add set flag to 0 block and inside the "When Button A is Pressed" block.Set the flag variable to 1 to indicate the system is now in QR code recognition mode.

Drag the If-Then block into the main loop.Use the Equals operator to check flag =1.

Inside the Then block, continue to use the "If - then" block, the "detected QR Code?" block, and the "disable camera show" block. If a QR code is detected, wait for 1 second and then close the camera.

How can we display the recognition results on the screen of UNIHIKER K10? Click on the variable area and create a new string - type variable named "result".

Use 'set resulit to 'block and 'read QR code content' block,Assign the obtained QR code recognition result to the variable named "result".

Use the "join" block to connect the text'Recognition result:' and the variable'result'. Then, use the "cache text" block to display the connected text on the screen of the UNIHIKER K10. Set the font size to 24*24 and wrap to 12, as shown in the image below.

As shown in the picture below, with this program, we can display the text content recognized from the QR code on the screen of the UNIHIKER K10.

STEP Three: Display the ID card of the corresponding plant and play the explanatory audio
We've successfully used the UNIHIKER K10 to recognize and display the text content from QR codesāthese texts represent plant names. How can we display an identity card for each plant to help users learn more about them?
We can use the "If-Then" block and comparison operators to check the value of the variable result. If result equals "OAK", display the identity card for OAK.

Next, use the cached local Image block and show cached content to show the ID image corresponding to OAK.

At the same time, to help users better understand these plants, play the corresponding explanatory audio file for each plant while displaying its ID card. These audio files are stored in the TF card.
Use play TF card audio in background block to play the audio file in TF card, fill in the corresponding audio file name such as 'oak.wav'.
Since we want the corresponding audio file to play only once per QR code scan, we need to reset the result variable to None after the audio finishes playing. Otherwise, the audio will keep looping.After the Play Audio File block, add a Set result to None block .

Next, try writing a program that recognizes the QR code text for 'Acer rubrum' and 'Platanus', displays their corresponding plant ID cards, and plays the explanatory audio!

The corresponding program is shown in the figure below. How did it go? Did you succeed?

3.2 Task2: Through Voice Recognition for Voice Q&A
Next, let's implement the second function of the plant Scan&Speak device: recognizing the user's questions about plants through voice recognition and playing the corresponding answer audio to respond.
The UNIHIKER K10 has a built - in voice recognition model that supports isolated word voice recognition. We can use this function to achieve voice Q&A with the user.
(1) Material Preparation
First, let's brainstorm some questions and answers about these three plants that users might ask. Here, I've prepared three example questions and their corresponding answer audio files.

Transfer the three answer audio files to the TF card using a computer and card reader. The files on the TF card should be organized as shown below. Once done, insert the TF card into the UNIHIKER K10.

(2) Hardware Setup
Ensure that the UNIHIKER K10 is connected to the computer using a USB cable.Confirm that the UNIHIKER K10 is connected to the computer using a USB cable. Insert the TF card into the card slot of the UNIHIKER K10.

(3) Writing the Program
STEP One: Initialize the Voice Recognition Function
We can activate the voice recognition function by pressing the B key on the UNIHIKER K10.
Drag the "When B Button Pressed" block into the programming area. using the "Set Speech Recognition Continuous" block to initialize the voice recognition system,set wake time to 12000 (milliseconds for voice activation).Set language to EN (English).

We use flag to assist with judgment. Set the value of the flag to 2 when the B button is pressed. In the main program, use an If-Then block and a comparison operator to enter voice recognition mode when the flag equals 2.

Before recognizing voice commands, we need to wake up the system using the wake word "Hi, Telly". After that, it enters the voice command recognition mode. How can we tell if the system is in wake - waiting mode or recognition mode? We can use the If-Then block, Speech Recognition Awake? block, and Turn On LED block to determine this. When the wake word is recognized, the LED light turns green; otherwise, it stays red (waiting to be woken up).


STEP Two: Add Voice Command Words for Voice Q&A
Next, we can implement voice recognition by adding command words. Here, we set three plant - related command words: oak, Acer rubrum, and Platanus. Under the When Button B Pressed block, add the Add Voice Command block and enter these three commands in sequence, with corresponding IDs of 0, 1, and 2 respectively.

After adding the command words, when the UNIHIKER K10 is in voice recognition mode, speak a question containing the command words into the deviceāfor example, 'Why do the leaves of Acer rubrum turn red'āand the UNIHIKER K10 will recognize the corresponding voice and respond accordingly.
How to play the corresponding answer audio for a question? Use the If-Then block, Command ID Detected? block, and Play TF Card Audio in Background block. When a voice question containing the command word is recognized, play the corresponding answer audio from the TF card.

Below is the reference for the complete program.

4.Upload the Program and Observe the Effect
Click Upload button,When the burning progress reaches 100%, it indicates that the program has been successfully uploaded.

STEP:
ļ¼1ļ¼Press A button and scan the corresponding QR code and observe the following:
⢠The text content from the QR code will be displayed on the screen for 3 seconds.
⢠After that, the corresponding plant's ID card will appear on the screen, and the plant introduction audio will start playing.
ļ¼2ļ¼Press B button and say 'Hi Telly' and observe the following:
⢠The LED light on the back of the UNIHIKER K10 changes from red to green.
⢠Ask the UNIHIKER K10 questions about the plant, and it will play the corresponding answer audio.
5.Knowledge Hub
5.1 What is QR Code Recognition?
A QR code is a two-dimensional black-and-white pattern composed of specific geometric shapes arranged systematically. It can store various types of information, such as URLs, text, business cards, and payment details. QR codes are widely used for information transmission, mobile payments, identity verification, etc. QR code recognition is the technology by which devices decode this information, with applications including mobile payment systems, access control, and product traceability.

5.2 What is Voice Recognition?
Voice recognition (speech recognition) is a technology that converts spoken words into computer-readable text or commands, enabling human-machine voice interaction.Isolated word recognition is a type of speech recognition, referring to a system that can only identify pre - set independent words (such as "start", "stop"). Each input is a single word, suitable for simple instruction scenarios like smart home appliance control.

6.Appendix of Materials
