Product Manual¶
Introduction¶
Happy Plant¶
For this project, I developed a product called Happy Plant. Happy plant is a kind of weather station, which helps the user create the best possible living environment for their plants.
The purpose of Happy Plant is to gain a better understanding of the current weather, both indoors and outdoors. The weather station consists of two parts, the physical weather station (in the form of a plant) and a website to see the data. This way the user can see whether the temperature and humidity are at an optimal value. If this is the case, and the values are optimal, it has a positive influence on the well-being of the plants.
User¶
To determine the target audience for a product like Happy Plant, I conducted a survey during the profile phase. You can see more information and the results on this page. This survey showed that the target group for Happy Plant consists of a diverse age group, most of whom are between 18 and 39 years old.
Product Images¶
The physical product:
The website:
Product features¶
Happy Plant…
- Measures the indoor temperature
- Measures the indoor humidity
- Gives an indication if the temperature and humidity are too low, too high or good by means of LEDs
- Displays exact values on LCD screen
- Shows the exact values on the corresponding website, including the outdoor temperature retrieved with an API
Installation instructions Arduino IDE and libraries¶
To put the code on your wemos, we use Arduino. Arduino is an open-source computing platform intended to make working with microcontrollers easy. To download Arduino and the libraries used in this project, follow this roadmap: (Please note, this roadmap is based on a windows computer)
Step | Instruction | Image |
---|---|---|
1 | Go to the arduino website and download the latest version (choose the installer, not the ZIP package). | ![]() |
2 | Run the installer and choose which components you want to install (I recommend installing all available components). | ![]() |
3 | Choose the file location where you want to install Arduino. | ![]() |
4 | Wait for the installation to complete. | ![]() |
5 | Open Arduino, go to Tools > Manage Libraries … and install the following libraries there:
|
![]() |
Build instructions embedded device¶
A large part of this project consists of the embedded device. This is the hardware that makes certain input and output types work together. To recreate my embedded device, follow this roadmap:
Step | Instruction | Image |
---|---|---|
1 | Go to the bill of materials and collect all the items from the list. | ![]() |
2 | Solder the Wemos with header pins. See this video for a step-by-step explanation of how to do this. | ![]() |
3 | Since you are soldering now anyway, solder the I2C to the LCD display as well. Then turn the blue screw with a small screwdriver to increase the contrast. | ![]() |
4 | All you have to do now is recreate this wiring diagram on your own breadboard. It tells you exactly which parts to connect in which way. | ![]() |
Installation instructions embedded code¶
If all goes well, you now have the hardware completely recreated, but without code on the Wemos it will not work. Follow these steps to get the code:
Step | Instruction | Image |
---|---|---|
1 | Go to this part of my repository and press the right download button to download the .ino file. | ![]() |
2 | Open the .ino file in Arduino. Haven’t downloaded Arduino yet? Then go to this step-by-step guide to do so. | ![]() |
3 | Press the Upload button at the top left. This will upload your code to the Wemos. | ![]() |
Netwerk configuration of embedded device¶
If the Wemos is not connected to the Internet, the project will not work as you would like. To make this connection to WIFI, a line of code must be modified. I am talking about the following code block in the project_iot.ino file:
void setup() {
// Connecting to WIFI
WiFi.begin("WifiNetwork", "Password");
pinMode(button, INPUT);
// Keep in while-loop while the device is not connected to your accesspoint.
while (WiFi.status() != WL_CONNECTED) {
delay(delayTime); // Waiting on connection...
}
}
Usage of embedded device¶
The embedded part of this project consists of a number of hardware components. First up is the DHT11 sensor. This sensor measures humidity and temperature. It is important to handle this carefully, as sensors can be fragile. Furthermore, the product also contains a pushbutton. Pressing this button turns on the LCD display which shows the exact values of temperature and humidity. Finally, there is the LED strip, which gives feedback about the measured values through different colors.
All these input and output forms are connected by several jumperwires and two small breadboards. It is important to be careful not to touch them unnecessarily as the project will not work if a wire is loose.
Installation instructions docker desktop¶
For this project, we are using Docker. Docker is a computer program to virtualize the computer’s file system. To install Docker, follow this roadmap:
Step | Instruction | Image |
---|---|---|
1 | Go to the Docker website and download the latest Windows version (choose the installer, not the ZIP package). Then, double-click Docker Desktop Installer.exe to run the installer. | ![]() |
2 | Follow the instructions on the installation wizard to authorize the installer and proceed with the install. | |
3 | When the installation is successful, click Close to complete the installation process. | |
4 | Open your command line interface and navigate to the location where you installed Docker. Do this with this line of code: | cd "<path to your folder>" |
5 | Now you just need to run the docker containers. To do that, use this line of code: | docker-compose up |
6 | Now open the Docker program and see if there are five containers started. | ![]() |
7 | If step 6 went well, Docker will now be running completely. Go to http://localhost/ to see your live website there! |
Source: https://docs.docker.com/desktop/install/windows-install/
Installation instructions application code and libraries/frameworks¶
All the code I wrote for this project can be found on my Gitlab page. Follow this roadmap to adopt my code.
Step | Instruction | Image |
---|---|---|
1 | Go to this part of my repository and press the blue “Clone” button. | ![]() |
2 | A drop-down menu now folds out. Go for the option open in Visual Studio Code. You can now start editing the code! |
I did not use libraries or frameworks for this project
Configuration of the database¶
Step | Instruction | Image |
---|---|---|
1 | If things went well with Docker, you were able to get to your live website. Go there (localhost) and click on PhpMyAdmin in the lower right corner | ![]() |
2 | Log in with your username and password. Then you will be taken to the home page. Create a new database here. | ![]() |
3 | Give your new database a name, and press “Create.” Then immediately create a new table as well. | ![]() |
4 | Fill in the following things in the fields of the table: | |
When you have done this, your database is complete! | ![]() |
Usage of application front end¶
The frontend website is very easy to use. I deliberately kept it as simple as possible too, with the user experience in mind. On the website, the user can see at a glance what the indoor temperature is and what the humidity is. This way, the user knows whether the values for the plants are optimal or not. Also on this site, the user sees the outside temperature and an icon of the weather conditions. After all, for plant lovers, not only the indoor temperature is important, but also the outdoor temperature for repotting houseplants, for example.
API-reference¶
The outside temperature and the chance of rain are not measured by sensors, but are retrieved by an API. The PHP-file retrieves three types of data, then makes a connection to the database. Then, a SQL-query is build which inserts the data into the database. Finaly, the SQL-query is executed, and the data is being pushed into the db. This is the corresponding code:
<?php
// Get data parameters from URL
$temperatureC_inside = $_GET['temperatureC_inside'];
// $temperatureC_outside = $_GET['temperatureC_outside'];
$humidity_inside = $_GET['humidity_inside'];
// Store the data into the database
$servername="mariadb";
$username = "root";
$password = "7YKyE8R2AhKzswfN";
$dbname = "weatherstation";
// Create connection
$db = new mysqli($servername, $username, $password, $dbname);
// Check connection
if ($db->connect_error) {
die("Connection failed: " . $db->connect_error);
}
// Build SQL-query that inserts the data into the database
$query = $db->prepare("INSERT INTO `measurement`(`temperatureC_inside`, `humidity_inside`) VALUES (?, ?, ?)");
$query->bind_param('di', $temperatureC_inside, $humidity_inside);
// Execute SQL-query
$query->execute();
$db->close();
?>