IoT Master Class Indobot 2022 Final Project
Echeveria Peacockii is a type of plant that is related to cactus, but there are no thorns on the body of this plant, making it very attractive to ornamental plant lovers. The care of Echeveria Peacockii until now is still done conventionally, making it wasteful of time and energy. Therefore, this project was created to obtain a system that is able to perform watering as well as being able to monitor changes in conditions that exist in the environment around the plant. This project has been implemented and took approximately 1 month. The system interface uses Telegram Bot. The results showed that the system created can function properly.
| Part | Description |
|---|---|
| Development Board | DOIT ESP32 DEVKIT V1 |
| Code Editor | Arduino IDE |
| Application Support | Telegram Bot |
| Driver | CP210X USB Driver |
| IoT Platform | • Blynk • ThingsBoard |
| Communications Protocol | • Inter Integrated Circuit (I2C) • Message Queuing Telemetry Transport (MQTT) • Transmission Control Protocol/Internet Protocol (TCP/IP) • MTProto |
| IoT Architecture | 4 Layer |
| Programming Language | C/C++ |
| Arduino Library | • WiFi (default) • BlynkSimpleEsp32 • ThingsBoard • PubSubClient • CTBot • ArduinoJson • LiquidCrystal_I2C • DHT_sensor_library • ESP_FC28 |
| Actuators | Submersible pump (x2) |
| Sensor | • FC-28: Resistive Soil Moisture (x1) • LDR: Light Dependent Resistor (x1) • DHT22: Air Temperature & Humidity (x1) |
| Display | LCD I2C (x1) |
| Other Components | • Micro USB cable - USB type A (x1) • Jumper cable (1 set) • ESP32 expansion board (x1) • Breadboard (x1) • Electromechanical relay 2-channel (x1) • Adaptor DC 5V (x1) • Resistor (x2) • Casing box (x1) • Bolts plus (1 set) • Nuts (1 set) |
-
Arduino IDE
https://bit.ly/ArduinoIDE_Installer
-
CP210X USB Driver
https://bit.ly/CP210X_USBdriver
| Infrastructure |
|---|
![]() |
| Pictorial Diagram |
|---|
![]() |
| Software Design | |
|---|---|
![]() |
![]() |
| Wiring |
|---|
![]() |
#include <Wire.h>
void setup() {
Wire.begin();
Serial.begin(115200);
while (!Serial); // Wait for serial monitor
Serial.println("\nI2C Scanner");
}
void loop() {
int nDevices = 0;
Serial.println("Scanning...");
for (byte address = 1; address < 127; ++address) {
// The i2c_scanner uses the return value of the Wire.endTransmission to see if a device did acknowledge to the address.
Wire.beginTransmission(address);
byte error = Wire.endTransmission();
if (error == 0) {
Serial.print("I2C device found at address 0x");
if (address < 16) {
Serial.print("0");
}
Serial.print(address, HEX);
Serial.println(" !");
++nDevices;
} else if (error == 4) {
Serial.print("Unknown error at address 0x");
if (address < 16) {
Serial.print("0");
}
Serial.println(address, HEX);
}
}
if (nDevices == 0) {
Serial.println("No I2C devices found\n");
} else {
Serial.println("done\n");
}
delay(5000); // Wait 5 seconds for next scan
}-
Open the
Arduino IDEfirst, then open the project by clickingFile->Open:SistemPerawatanEcheveriaBlynkIoT.inoorSistemPerawatanEcheveriaThingsboardIoT.ino
-
Fill in the
Additional Board Manager URLsin Arduino IDEClick
File->Preferences-> enter theBoards Manager Urlby copying the following link :https://dl.espressif.com/dl/package_esp32_index.json
-
Board Setupin Arduino IDEHow to setup the
DOIT ESP32 DEVKIT V1board• Click
Tools->Board->Boards Manager-> Installesp32.• Then selecting a board by clicking:
Tools->Board->ESP32 Arduino->DOIT ESP32 DEVKIT V1.
-
Change the Board Speedin Arduino IDEClick
Tools->Upload Speed->115200
-
Install Libraryin Arduino IDEDownload all the library zip files. Then paste it in the:
C:\Users\Computer_Username\Documents\Arduino\libraries
-
Port Setupin Arduino IDEClick
Port-> Choose according to your device port(you can see in device manager)
-
Change the
WiFi Name,WiFi Password, and so on according to what you are currently using. -
Before uploading the program please click:
Verify. -
If there is no error in the program code, then please click:
Upload. -
Some things you need to do when using the
ESP32 board:• If
ESP32 boardcannot processSource Codetotally -> PressEN (RST)button ->Restart.• If
ESP32 boardcannot processSource Codeautomatically then :-
When information:
Uploading...has appeared -> immediately press and hold theBOOTbutton. -
When information:
Writing at .... (%)has appeared -> release theBOOTbutton.
• If message:
Done Uploadinghas appeared ->The previously entered program can already be operated.• Do not press the
BOOTandENbuttons at the same time as this may switch toUpload Firmwaremode.
-
-
If there is still a problem when uploading the program, then try checking the
driver/port/otherssection.
-
Getting started with blynk :
• Go to the official Blynk website: blynk.io.
• Click
Start Freeuntuk mendaftar.• Enter an email.
• Open email for confirmation.
• Log in using the account that has been created.
-
Create a new template :
• Click
Developer Zone-> then selectMy Templatesoption.• Then click
+ New Templatesto create a New Template.• The
NAMEsection is filled withSmart Farming,HARDWAREselectESP32,CONNECTION TYPEselectWiFi,TEMPLATE DESCRIPTIONis optional.• Click
Done.
-
Create datastreams :
• Enter
Datastreamsmenu -> click+ New Datastreams-> selectVirtual Pin.• Input the first data :
NAME->suhu_udaraPIN->V0DATA TYPE->DoubleUNITS->Celcius, °CMIN->0MAX->100DECIMALS->#.#DEFAULT VALUE->0
• Input the second data :
NAME->kelembaban_udaraPIN->V1DATA TYPE->IntegerUNITS->Percentage, %MIN->0MAX->100DEFAULT VALUE->0
• Input the third data :
NAME->kelembaban_tanahPIN->V2DATA TYPE->IntegerUNITS->Percentage, %MIN->0MAX->100DEFAULT VALUE->0
• Input the fourth data :
NAME->cahayaPIN->V3DATA TYPE->IntegerUNITS->Lux, lxMIN->0MAX->100000DEFAULT VALUE->0
• Input the fifth data :
NAME->indikator_pompa1PIN->V4DATA TYPE->IntegerUNITS->NoneMIN->0MAX->1DEFAULT VALUE->0
• Input the sixth data :
NAME->indikator_pompa2PIN->V5DATA TYPE->IntegerUNITS->NoneMIN->0MAX->1DEFAULT VALUE->0
• Input the seventh data :
NAME->tombol_siramPIN->V6DATA TYPE->IntegerUNITS->NoneMIN->0MAX->1DEFAULT VALUE->0
• Click
Create.• Click
Save.
-
Create a new device :
• Enter
Devicesmenu.• Click
+ New Devicesto add new devices.• Select
From Templates:TEMPLATE->Smart FarmingDEVICE NAME->Smart Farming
• Click
Create.
-
Manage dashboard on the Blynk site :
• Click
3 dot symbol-> then selectEdit Dashboard.• Select
the desired widgetthendraginto the dashboard area.• Click
settingon the added widget.• Select a datastream that is already available, among others:
suhu_udara/kelembaban_udara/kelembaban_tanah/cahaya/indikator_pompa1/indikator_pompa2/tombol_siram.• Click
Save And Apply.
-
Manage dashboards on the Blynk mobile app :
• Open your smart phone -> then in the
Google Play Store, find the application calledBlynk IoT-> theninstall.• Open the application -> then do the configuration as on the Blynk site earlier.
• For the rest, you can search for tutorials on
Googleto enrich your knowledge.
-
Firmware configuration :
• Go to
Devicesmenu -> selectSmart Farming-> clickDevice Info.• Copy
Template ID,Template Name, andAuthToken.• Then paste it at the very top of the firmware code, for example like this :
#define BLYNK_TEMPLATE_ID "TMPL6ZSHxYC-z" #define BLYNK_TEMPLATE_NAME "Smart Farming" #define BLYNK_AUTH_TOKEN "fw1oXlpe-YfYh7JXQHu4QTS3EqlnM-iw"
-
Getting started with ThingsBoard :
• Go to the official ThingsBoard website: thingsboard.cloud.
• Log in with google account.
-
Create a new device profile :
• Go to
Profilesmenu -> then selectDevice profiles.• Click
+ (Add device profile).• Device profile details:
Name->MQTT.• Transport configuration:
Transport type->MQTT. Then fill in the MQTT data as shown below :-
Telemetry topic filter:
v1/devices/me/telemetry/fpiotdevan. This should be the same as the one in the firmware code. -
Attributes publish & subscribe topic filter:
v1/devices/me/attributes/fpiotdevan. This should be the same as the one in the firmware code. -
MQTT device payload :
JSON.
• Click
Addto add.
-
-
Create a new device :
• Go to
Entitiesmenu -> then selectDevices->Groups.• Change the device access groups
AlltoPublicso that it can be used widely.• Open device groups
All.• Click
+ (Add device).• Make 1 device with the following conditions :
Name->EcheveriaIoTLabel->EcheveriaIoTDevice profile->default
-
Create a dashboard :
• Go to
Dashboardsmenu ->Groups->All.• Change the dashboard access groups
AlltoPublicso that it can be used widely.• Open dashboard groups
All.• Click
+ (Add dashboard).• Then name it
Echeveria Dashboard-> clickAddto add.• Change
titletoSistem Perawatan Echeveria.• Select
desired widget-> settings on widgets.
-
Firmware configuration :
• Go to
Entitiesmenu -> then selectDevices->Groups.• Click
EcheveriaIoT-> copy theDevice IDandTokenmentioned.• Then paste in the firmware code, for example like this :
#define DEVICE_ID_TB "26001630-a274-11ee-9db5-1fb69bbe078f" #define ACCESS_TOKEN_TB "tovosJJOLHzwc42DSfvM"
-
Open @BotFather.
-
Type
/newbot. -
Type the desired bot name, for example:
echeveria_bot. -
Type the desired bot username, for example:
echeveria_bot. -
Also do it for bot image settings, bot descriptions, and so on according to your needs.
-
Copy
your telegram bot API token-> then paste it into the#define BOTtoken "YOUR_API_BOT_TOKEN"section.For example :
#define BOTtoken "5911801402:AAFEEuBYHPmDxlYQxfPpTCZkRpn5d8hV_3E"
-
Download and extract this repository.
-
Make sure you have the necessary electronic components.
-
Make sure your components are designed according to the diagram.
-
Configure your device according to the settings above.
-
Please enjoy [Done].
| Device |
|---|
![]() |
| Telegram Bot Interface | Monitoring via Blynk Mobile | ||
|---|---|---|---|
![]() |
![]() |
![]() |
![]() |
| Monitoring via Thingsboard |
|---|
![]() |
Via Telegram: @echeveria_bot
In this project, the millis() function has been implemented to minimize code blocking and improve efficiency. However, to get much more optimized results in the future, it is recommended to use RTOS (Real-Time Operating System) to manage task prioritization.
If this work is useful to you, then support this work as a form of appreciation to the author by clicking the ⭐Star button at the top of the repository.
This application is my own work and is not the result of plagiarism from other people's research or work, except those related to third party services which include: libraries, frameworks, and so on.
MIT License - Copyright © 2023 - Devan C. M. Wijaya, S.Kom
Permission is hereby granted without charge to any person obtaining a copy of this software and the software-related documentation files to deal in them without restriction, including without limitation the right to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons receiving the Software to be furnished therewith on the following terms:
The above copyright notice and this permission notice must accompany all copies or substantial portions of the Software.
IN ANY EVENT, THE AUTHOR OR COPYRIGHT HOLDER HEREIN RETAINS FULL OWNERSHIP RIGHTS. THE SOFTWARE IS PROVIDED AS IS, WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESS OR IMPLIED, THEREFORE IF ANY DAMAGE, LOSS, OR OTHERWISE ARISES FROM THE USE OR OTHER DEALINGS IN THE SOFTWARE, THE AUTHOR OR COPYRIGHT HOLDER SHALL NOT BE LIABLE, AS THE USE OF THE SOFTWARE IS NOT COMPELLED AT ALL, SO THE RISK IS YOUR OWN.










