Edspert.id Final Project: Intensive Bootcamp Internet of Things Batch-10
Green House is a building for plant cultivation that has a translucent roof and wall structure. Farmers are helped by the existence of this Green House, but it still requires certain conditioning in order to achieve what is desired. This is usually done traditionally, so it is considered less effective, especially in an era full of sophisticated technology like today. In addition, theft and building break-ins are topics that need attention in addition to vegetable maintenance. This project was created to help farmers to manage their Green House quickly and precisely both in close and long distances. This project has been carried out and took approximately 1 month. The system can monitor air temperature, air humidity, soil moisture, light intensity, pump status, door status, and security alarms. In addition, this system has also been provided with automatic pump control and automatic door lock features, so that this can increase efficiency in maintaining vegetables and security in the Green House area. This system is based on the Internet of Things (IoT), using HTTP as the communication protocol. The system interface uses the MIT App Inventor application.
Part | Description |
---|---|
Development Board | • DOIT ESP32 DEVKIT V1 • NodeMCU V3 ESP8266 Lolin |
Code Editor | Arduino IDE |
Driver | • CH340 USB Driver • CP210X USB Driver |
IoT Platform | Antares |
Communications Protocol | • Hypertext Transfer Protocol (HTTP) • Universal Asynchronous Receiver-Transmitter (UART) • Serial Peripheral Interface (SPI) • Inter Integrated Circuit (I2C) |
IoT Architecture | 4 Layer |
Application Support | MIT App Inventor |
Programming Language | C/C++ |
Arduino Library | • WiFi (default) • HTTPClient (default) • ESP8266WiFi (default) • ESP8266HTTPClient (default) • Wire (default) • SPI (default) • DHT_sensor_library • LiquidCrystal_I2C • ESP_FC28_Library • MFRC522 |
Actuators | • Submersible pump (x1) • Solenoid Door Lock (x1) • Piezo buzzer (x1) |
Sensor | • FC-28: Resistive Soil Moisture (x1) • LDR: Light Dependent Resistor (x1) • DHT22: Air Temperature & Humidity (x1) • SW-420: Vibration (x1) • RFID Reader (x1) |
Display | LCD I2C (x1) |
Other Components | • Micro USB cable - USB type A (x1) • Jumper cable (1 set) • Switching power supply 12V 3A (x1) • Electrical relay 1 channel (x1) • Step Down LM2596 Adjustable 3A DC-DC (x2) • Breadboard (x2) • NodeMCU expansion board (x1) • Casing box (x1) • RFID Card (x2) • Connector male jack DC (x1) • Bolts plus (1 set) • Nuts (1 set) |
-
Arduino IDE
https://bit.ly/ArduinoIDE_Installer
-
CH340 USB Driver
https://bit.ly/CH340_USB_Driver
-
CP210X USB Driver
https://bit.ly/CP210X_USB_Driver
Infrastructure | Pictorial Diagram for ESP32 | Pictorial Diagram for NodeMCU |
---|---|---|
Systems Diagram |
---|
#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 IDE
first, then open the project by clickingFile
->Open
:•
Final_Project_Edspert_Batch10_ESP32Project.ino
•
Final_Project_Edspert_Batch10_NodeMCUProject.ino
-
Fill in the
Additional Board Manager URLs
in Arduino IDEClick
File
->Preferences
-> enter theBoards Manager Url
by copying the following link :https://dl.espressif.com/dl/package_esp32_index.json http://arduino.esp8266.com/stable/package_esp8266com_index.json
-
Board Setup
in Arduino IDEi
How to setup the
DOIT ESP32 DEVKIT V1
board• Click
Tools
section ->Board
->Boards Manager
-> Installesp32
.• Then click
Tools
->Board
->ESP32 Arduino
->DOIT ESP32 DEVKIT V1
.ii
How to setup the
NodeMCU V3 ESP8266 Lolin
board• Click
Tools
section ->Board
->Boards Manager
-> Installesp8266
.• Then click
Tools
->Board
->ESP8266 Boards
->NodeMCU 1.0 (ESP-12E Module)
.
-
Change the Board Speed
in Arduino IDEi
How to change the speed of
DOIT ESP32 DEVKIT V1
boardClick
Tools
->Upload Speed
->115200
ii
How to change the speed of
NodeMCU V3 ESP8266 Lolin
boardClick
Tools
->Upload Speed
->115200
-
Install Library
in Arduino IDEDownload all the library zip files. Then paste it in the:
C:\Users\Computer_Username\Documents\Arduino\libraries
-
Port Setup
in 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
:•
Arduino IDE
information:Uploading...
-> immediately press and hold theBOOT
button.•
Arduino IDE
information:Writing at .... (%)
-> release theBOOT
button.• Wait until the message appears:
Done Uploading
->The program is directly operated
.• Press the
EN (RST)
button and thenRestart
to handle theESP32
board that cannot process theSC
.• Do not press the
BOOT
andEN
buttons at the same time as this may switch toUpload Firmware
mode.
-
As for program upload, the
NodeMCU board
is superior because it can generally be done automatically. -
If there is still a problem when uploading the program, then try checking the
driver
/port
/others
section.
-
Getting started with Antares :
• Please Sign Up first.
• Then please Sign In to access the service.
-
Activate Access Key :
• Go to
Account
menu.• Click
Get Access Key
to generate an access key. This process only needs to be done once.• If you have activated an access key before, skip this step.
-
Create applications :
• Go to
Applications
menu.• Click
+ Create an Application
.• In the
Add Application
menu, please specify the following :Application Name
->Name of the App you will create
.Application ID
->ID of the App you will create
.Labels
-> determine according to project needs.
-
Create a device :
• Make sure you are on the
Home / Applications / The app you created
menu.• Click
+ Add Device
.• You should specify the name of this device based on the variables in the project.
-
Firmware configuration :
• Make sure you are on the
Account
menu.• Copy
Access Key
mentioned.• Paste in the firmware code, for example like this :
#define ACCESSKEY "1444e88d02acb758:b996115b1c2f6f0f"
• Then, the
Project name
andDevice name
must match what was created earlier. For example :#define projectName "FinalProject_Edspert10" #define deviceName "GreenHouse_Device1"
-
Open the official website
MIT App Inventor
:https://appinventor.mit.edu/
-
Click
Create Apps!
, then log in using google account. -
Click
Project
-> then import the files in theSmart-Green-House-Berbasis-IoT-Mobile-Apps\Src\MIT App Inventor Project\
directory :•
Smart_Green_House_Device_1.aia
•
Smart_Green_House_Device_2.aia
-
Click the
Block
button and set the following points :
• Fill theinitialize global url to
section with the following format :https://platform.antares.id:8443/~/antares-cse/antares-id/[YOUR_APPLICATION_NAME]/[YOUR_DEVICE_NAME]/la
• Fill the
initialize global header to -> make a list
section as follows :make a list :
X-M2M-Origin
.YOUR_ACCESS_KEY
.Content-Type
.application/json;ty=4
.Accept
.application/json
.
-
Then click
Connect
-> next selectAI Companion
. -
Open your smartphone, then in the
Google Play Store
search for theMIT AI2 Companion
application, then install it. -
Open the
MIT AI2 Companion
app. -
Select
Scan QR Code
method. -
Point your smartphone at the
QR Code
area on theMIT App Inventor
site. -
If you want to operate 2 systems at the same time, then you can do so with 2 different devices so that the systems do not clash.
-
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].
Monitoring Device using ESP32 | Antares Platform for ESP32 |
---|---|
MIT App Inventor Configuration for ESP32 | |
Control Device using NodeMCU | |
---|---|
Antares Platform for NodeMCU | |
MIT App Inventor Configuration for NodeMCU | |
Simulation of Monitoring with Mobile Apps | |
---|---|
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.