Welcome to Lesson 5 of the UNIHIKER K10 course: Building a Smart Greenhouse IoT System. This standards-aligned project (CSTA K-12, UK KS3 Computing, EU DigComp 2.2) equips students in grades 7-12 with hands-on experience in designing a functional IoT ecosystem. Through sensor integration (temperature, humidity, soil moisture), MQTT protocol implementation, and SIoT platform remote control, learners master cross-disciplinary skills in data visualization, hardware programming, and sustainable IoT design – bridging computer science, AI, and environmental science for smart agriculture applications.

Objectives
1. Collect data from smart terminals and transmit it to the SIoT platform.
2. Enable remote data monitoring and control through multiple mobile devices.

Knowledge Goals
1. Learn to build IoT systems.
2. Design interactive system feedback functions.
3. Master remote control implementation in IoT.
4. Understand IoT data visualization platforms.
Materials List
Hardware:

Software:
Mind+ Graphical Programming Software (Minimum Version Requirement: V1.8.1 RC1.0)

Basic Mind+ Software Usage
1. Open Mind+ 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.

3. Connect UNIHIKER K10
First of all, 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
Hands-on Practice
Let’s get started with today’s lesson tasks! We will begin by learning how to read temperature and humidity using the UNIHIKER K10 and gradually progress to designing an intelligent greenhouse system on it.
Task 1: Data Collection and Transmission
In this task, we will use the UNIHIKER K10 to collect data, including temperature, humidity, soil moisture, and ambient light intensity, and transmit this data to the SIoT platform.
Task 2: Remote Monitoring and Control
In this task, we will enable multiple mobile devices to act as remote terminals to monitor data and control the intelligent terminal’s awning switch remotely.
Task 3: IoT Data Visualization Dashboard Design
In this task, we will focus on designing a data visualization dashboard, allowing real-time updates of SIoT platform data on the screen, along with reasonable interface beautification.
Task 1: Data Collection and Transmission
In this task, we need to use a UNIHIKER K10 board as the smart terminal for a greenhouse to collect relevant data, including temperature, humidity, light intensity, and soil moisture. Among these, the first three parameters can be read directly using the built-in sensors on the K10 board, while soil moisture requires an external sensor connected to the board.
1.Hardware Setup
Confirm that the UNIHIKER K10 is connected to the computer via a USB cable.
2.Software Preparation
Make sure that Mind+ is open, the preset code appears in Python graphical mode, and the UNIHIKER K10 is successfully loaded. You can now start writing the project program.
3.Wirte the Program
STEP 1: Read Greenhouse Data
The UNIHIKER K10 board is equipped with built-in temperature, humidity, and ambient light sensors. To collect data for temperature (°C), humidity (%RH), and light intensity, use the respective built-in sensor commands:
In the line empty board K10, built-in temperature and humidity sensor, ambient light sensor, therefore, to read the temperature, humidity, light intensity of the greenhouse, we do not need to connect to other sensors, simply use the "read temperature", "read humidity" and "read light" commands under Onboard Sensors, you can read the corresponding data, as shown in the figure below.

To read soil moisture, we need to connect an external soil moisture sensor at pin P1, connected as shown below.

Next, we need to read the value of the soil moisture, the soil moisture sensor is an analogue signal and directly reads a value between 0 and 4095, whereas in everyday life, humidity is usually presented as a percentage, so we need to use mapping to process this value so that the value of the soil moisture is displayed between 0 and 100.
We need to use the "mapping () from [0, 4095] to [0, 10000] command", and then round the mapping results and then divided by 100, you can get the value of [0,100], the relevant program commands are as follows.

Note: After collecting data, create corresponding variables to store the values. Use commands like the ones shown in the diagram to implement this step.

Finally, we display the greenhouse data on our smart terminal, we load the background image first, and then present the corresponding variable data, the specific operation command is shown in the following figure.

STEP 2: Network Connection
To enable data transmission, we first need to establish a network connection. Use your computer as the server to set up the IoT system, ensuring all devices are on the same network. This allows us to send and subscribe to messages using the MQTT protocol.

Note: For more information about the MQTT protocol and IoT components, refer to the Knowledge Hub
Add MQTT communication and Wi-Fi modules from the extension library. Refer to the diagram for commands.

We need to set up Wi-Fi for the UNIHIKER K10 terminal using the "Wi-Fi connect to account (SSID, Password)"command. Ensure the Wi-Fi connected to the K10 is the same as your computer’s. Example commands are shown below:

On our computer, we need to download the Windows version of SIoT_V2, extract it, and double-click start SloT.bat to start SIoT. After starting, a black window will pop up to initialize the server.

Note: For details on downloading SIoT_V2, please refer to: https://drive.google.com/file/d/1qVhyUmvdmpD2AYl-2Cijl-2xeJgduJLL/view?usp=drive_link
After starting SIoT.bat on the computer, initialize the parameters for MQTT: set the IP address as the local computer's IP, the username as SIoT, and the password as dfrobot. Once connected, clear the content on the UNIHIKER K10 screen. Create a function called "Network Connection" to handle the Wi-Fi connection and MQTT initialization. Refer to the detailed commands shown in the image below.

After MQTT is successfully connected, access 192.168.9.216:8080 in a web browser on your computer. Enter the username SIoT and password dfrobot to log in to the SIoT IoT platform.

STEP3: Create Topics and Transfer Data
After entering the SIoT platform, click "Topic" to create four topics: "Temperature," "Humidity," "Ambient Light Intensity," and "Soil Moisture." Refer to the operations shown in the image below.

Next, use the "MQTT sned message (topic/a) and save to database (SIoT V2)" command to transmit greenhouse data to the corresponding topics. When entering the topics, double-click to copy them directly from the browser to avoid typing errors.

The complete code for the data collection and transmission module is shown below.

4.Run the Program
STEP1: Verify that UNIHIKER K10 is connected to Mind+, and ensure the IP address is displayed in the "Menu" section.

STEP2: Click the "Upload" button at the top-right corner of the interface

Task 2: Remote Viewing and Control
1.Add an awning
An awning is generally present in greenhouses to protect plants. Therefore, we add a servo motor to simulate the awning. Connect the servo motor to pin P0, as shown in the figure below.

The servo motor rotates between 0° and 180°. When the awning is open, the servo motor angle is 90°, and when it is closed, the angle is 0°.
2.Write the Program
STEP1: Add Receiving Commands
First, add the topics "Awning Switch" and "Awning Angle" to the SIoT platform. Then send specific messages from the mobile terminal. If the smart terminal subscribes to these topics, it will receive the messages and respond accordingly.

Use the "MQTT subscribe to topic/a" command and copy-paste the corresponding topics to subscribe to two topics. The operation is shown below:

Next, use the "when receiving MQTT message from topic_0" command to enable the smart terminal to accept messages from SIoT platform topics and set the servo motor's corresponding action based on the message. The operations are as follows:

Note: Add double quotes after the condition text for MQTT messages. Additionally, MQTT messages are strings, while servo motor commands require integers. Therefore, the MQTT message needs to be converted to an integer type.
This completes the programming for receiving commands. The complete program commands for the greenhouse smart terminal are shown below:

STEP2: Use Mobile Devices for Remote Viewing and Control
You can use a computer, phone, or other mobile devices to view and control greenhouse data remotely. Ensure that all devices are on the same network.
Next, access the 8080 port of the computer running the SIoT service. For example, if the computer's IP address is 192.168.31.147, enter 192.168.31.147:8080 in the browser of the mobile device. Use the username SIoT and password dfrobot to log in.

Once logged in, you can click "Details" to view the corresponding sensor data or send commands to control the terminal. The demonstration is as follows:

This completes the process of using a computer for remote data viewing and smart terminal control. The same steps apply to phones, tablets, or other mobile devices.
STEP 3: Use another UNIHIKER K10 as a mobile terminal
In addition to using mobile devices such as smartphones and computers to remotely view and control the system, we can also use another UNIHIKER K10 as a mobile terminal for remote viewing and control.
Step 1 is that we need to establish a network connection. The Wi-Fi and MQTT connection configurations are the same as the operations demonstrated in the smart terminal section. It is important to note that the IP address should be the IP address of the computer hosting the SIoT service. Once the connection is complete, we need to subscribe to the topics of "Temperature", "Humidity", "Ambient Light Intensity", "Awning Switch", and "Soil Moisture". The related program commands are shown below.

Step 2, we need to receive messages from different topics and assign these messages to corresponding variables. The related program code is shown below.

Step3 is that we need to display the greenhouse data in real-time and show different images based on the state of the awning. The related program settings are shown below.

The complete code for the mobile terminal is shown below.

3.Run the Program
STEP 1: Connect the UNIHIKER K10
STEP 2: Click the “Upload” button at the top right corner of the interface.
STEP 3: On the mobile terminal's UNIHIKER K10 interface, you can see the greenhouse data displayed. Additionally, when button A is pressed, the state of the awning will change, and the smart terminal’s awning will respond accordingly.

Task 3: IoT Data Visualization Dashboard Design
Starting from version 1.8.0, Mind+ adds a data visualization panel that can intuitively display IoT data (currently supporting only SIoT V2).

1. Complete Connection
STEP 1: Open the Visualization Panel
Click the “Open Visualization Panel” button at the top left of Mind+, which will open the visualization panel as shown below.

STEP 2: Create a New Project
After opening the visualization panel, click “Create New Project,” enter a name, and create the visualization panel project

STEP 3: Connect to the Network
After creating the project, set up the data source and fill in the server address to complete the connection

The visualization panel consists of multiple areas, as shown in the image below.

2. Interface Design

Next, we will explain how to use each component.
STEP 1: Title Text
In the decoration component section, find the text component, add it, and change the relevant properties to beautify the title in the right properties column.


STEP 2: Data Display
In the display component section, find the image text component, which is used to display the current data from the sensor. It needs to be linked with the SIoT topic. Additionally, you can set the title, component description, and component image as shown below.


STEP 3: Charts
Add the “Chart Component” to display historical data from the sensor and analyze patterns in the data. It also needs to be linked with the SIoT topic, as shown below.

STEP 4: Switches
Add the “Switch” and “Custom Switch” components. Both types of switches can receive and send topic messages.
In the visualization panel, we have set up two types of switches for the awning: the custom switch component and the standard switch component.
The custom switch component can be linked to a topic and set images. When the image is clicked, the state of the image will be switched and a corresponding message will be sent. The standard switch component can also be linked to a topic and when pressed, the style will change and a message will be sent to the associated topic

Below is an example of how to use the custom switch component:

The settings of the switch component can be referred to the settings of the custom switch component.
STEP 5: Slider
In the basic components section, find the slider. You can set the title, minimum value, maximum value, and step size, and link it to the relevant topic. This will send data to the corresponding topic, and the smart terminal will respond accordingly.

Now, you can use the components you’ve learned about to design your own greenhouse smart dashboard!

Knowledge Hub
1. IoT Components
The Internet of Things (IoT) is a network that connects all objects through information sensors and devices, allowing for intelligent recognition, positioning, tracking, monitoring, and management. The components of an IoT system are shown below:

Smart Terminal
In an IoT system, smart devices that connect external sensors or actuators are called smart terminals, such as the UNIHIKER K10 or Arduino. These devices are used to sense data from sensors or provide feedback to actuators. In this lesson, we used the UNIHIKER K10 as the smart terminal for the greenhouse

Server
The server is a computer that provides computing services and manages computational resources, including both hardware and software. Generally servers have the ability to undertake to respond to service requests, undertake services, and secure services.
In this lesson, we used the local computer’s SIoT platform as our server.

IoT Platform
The IoT platform receives data and controls devices in the IoT system. In this lesson, we used the SIoT platform to receive and send data.

Mobile Terminal
The mobile terminal in an IoT system refers to devices that are used to remotely access the IoT platform. These terminals allow users to view IoT data or send control commands. In this lesson, besides using the UNIHIKER K10 as the mobile terminal, smartphones and computers can also be used.
2.MQTT Communication Protocol
Currently, the most widely used communication protocol is MQTT. MQTT is a message publish/subscribe protocol based on a client-server model.
The server is usually called the “Broker,” and the clients can either be publishers or subscribers. The controlling side (publisher) and the controlled side (subscriber) do not communicate directly. Instead, they communicate through the broker, and as long as they subscribe to or publish to the same topic (TopicID), they can exchange information.

In this smart greenhouse, we use a UNIHIKER K10 as the smart terminal to collect data from the greenhouse, then send it to the server. Another UNIHIKER K10 acts as a mobile terminal, subscribing to topics to receive the data. If you don’t have two UNIHIKER K10s, you can also use a computer or mobile device to achieve this functionality

Ready to grow IoT skills? The UNIHIKER K10’s smart greenhouse project is just the seed—imagine coding weather-responsive irrigation systems, AI-driven crop monitoring, or even automated pest control.
[Get UNIHIKER K10 here]
Want to keep learning? Continue your learning journey with our other lessons.
Lesson1: Build a Light-Responsive Virtual Pet Dog
Lesson2: Design a Whack-a-Mole Arcade Game
Lesson3: Build Portable Walkman-Style Music Player (KS3/CSTA/DigComp)
