1.A Hardware
Components | Image | Reference Source |
---|---|---|
Seeeduino LoRaaWAN W/GPS | https://wiki.seeedstudio.com/Seeeduino_LoRAWAN/#specification | |
Base Shield v.2 | https://wiki.seeedstudio.com/Base_Shield_V2/ | |
Grove - 16x2 LCD (Black on Red) | https://wiki.seeedstudio.com/Grove-16x2_LCD_Series/ | |
Grove - Capacitive Moisture Sensor | https://wiki.seeedstudio.com/Grove-Capacitive_Moisture_Sensor-Corrosion-Resistant/ | |
Grove - Sunlight Sensor v.1 | https://wiki.seeedstudio.com/Grove-Sunlight_Sensor/ | |
Grove - Temperature, Humidity, Pressure and Gas Sensor v.1 | https://wiki.seeedstudio.com/Grove-Temperature_Humidity_Pressure_Gas_Sensor_BME680/ |
1.B Hardware Setup
|
---|
1.C Hardware - Source Code, Outputs, Unit of Measures
SOURCE CODE
Components | Library |
---|---|
Grove - 16x2 LCD (Black on Red) | https://github.com/Seeed-Studio/Grove_LCD_RGB_Backlight |
Grove - Capacitive Moisture Sensor | |
Grove - Sunlight Sensor v.1 | https://github.com/Seeed-Studio/Grove_Sunlight_Sensor/tree/Si1151 |
Grove - Temperature, Humidity, Pressure and Gas Sensor v.1 | https://github.com/Seeed-Studio/Seeed_Arduino_BME68x |
OUTPUTS & UNITS OF MEASURES
Grove - 16x2 LCD (Black on Red)
Code
#include <Wire.h> #include "rgb_lcd.h" #define PIN_GROVE_POWER 38 rgb_lcd lcd; const int colorR = 255; const int colorG = 0; const int colorB = 0; void setup() { // Powerup Seeeduino LoRaWAN Grove connectors pinMode(PIN_GROVE_POWER, OUTPUT); digitalWrite(PIN_GROVE_POWER, 1); // set up the LCD's number of columns and rows: lcd.begin(16, 2); lcd.setRGB(colorR, colorG, colorB); // Print a message to the LCD. lcd.print("HelloWorld!"); delay(10); }
Grove - Capacitive Moisture Sensor
Code
/* AnalogReadSerial Reads an analog input on pin 0, prints the result to the Serial Monitor. Graphical representation is available using Serial Plotter (Tools > Serial Plotter menu). Attach the center pin of a potentiometer to pin A0, and the outside pins to +5V and ground. This example code is in the public domain. https://arduino.cc/en/Tutorial/AnalogReadSerial */ #define PIN_GROVE_POWER 38 // the setup routine runs once when you press reset: void setup() { // Powerup Seeeduino LoRaWAN Grove connectors pinMode(PIN_GROVE_POWER, OUTPUT); digitalWrite(PIN_GROVE_POWER, 1); // initialize serial communication at 9600 bits per second: Serial.begin(9600); } // the loop routine runs over and over again forever: void loop() { // read the input on analog pin 0: int sensorValue = analogRead(A0); // print out the value you read: Serial.println(sensorValue); delay(100); // delay in between reads for stability }
Unit of Measure
Measures | Unit |
---|---|
Moisture | Analog voltage reading |
Grove - Sunlight Sensor v.1
Code
#include <Wire.h> #include "Arduino.h" #include "SI114X.h" #define PIN_GROVE_POWER 38 SI114X SI1145 = SI114X(); void setup() { // Powerup Seeeduino LoRaWAN Grove connectors pinMode(PIN_GROVE_POWER, OUTPUT); digitalWrite(PIN_GROVE_POWER, 1); Serial.begin(115200); Serial.println("Beginning Si1145!"); while (!SI1145.Begin()) { Serial.println("Si1145 is not ready!"); delay(1000); } Serial.println("Si1145 is ready!"); } void loop() { Serial.print("//--------------------------------------//\r\n"); Serial.print("Vis: "); Serial.println(SI1145.ReadVisible()); Serial.print("IR: "); Serial.println(SI1145.ReadIR()); //the real UV value must be div 100 from the reg value , datasheet for more information. Serial.print("UV: "); Serial.println((float)SI1145.ReadUV() / 100); delay(1000); }
Unit of Measure
Measures | Unit |
---|---|
Vis - Visible Light | lm |
IR - Infrared Light | lm |
UV | UN index |
Grove - Temperature, Humadity, Pressure and Gas Sensor v.1
Code
#include "seeed_bme680.h" #define BME_SCK 13 #define BME_MISO 12 #define BME_MOSI 11 #define BME_CS 10 #define PIN_GROVE_POWER 38 #define IIC_ADDR uint8_t(0x76) /** NOTE!!!!!!!!!!!! Select the communication protocol correctly **/ Seeed_BME680 bme680(IIC_ADDR); /* IIC PROTOCOL */ //Seeed_BME680 bme680; /* SPI PROTOCOL */ //Seeed_BME680 bme680(BME_CS, BME_MOSI, BME_MISO, BME_SCK);/*SPI PROTOCOL*/ void setup() { // Powerup Seeeduino LoRaWAN Grove connectors pinMode(PIN_GROVE_POWER, OUTPUT); digitalWrite(PIN_GROVE_POWER, 1); Serial.begin(9600); while (!Serial); Serial.println("Serial start!!!"); delay(100); while (!bme680.init()) { Serial.println("bme680 init failed ! can't find device!"); delay(10000); } } void loop() { if (bme680.read_sensor_data()) { Serial.println("Failed to perform reading :("); return; } Serial.print("temperature ===>> "); Serial.print(bme680.sensor_result_value.temperature); Serial.println(" C"); Serial.print("pressure ===>> "); Serial.print(bme680.sensor_result_value.pressure / 1000.0); Serial.println(" KPa"); Serial.print("humidity ===>> "); Serial.print(bme680.sensor_result_value.humidity); Serial.println(" %"); Serial.print("gas ===>> "); Serial.print(bme680.sensor_result_value.gas / 1000.0); Serial.println(" Kohms"); Serial.println(); Serial.println(); delay(2000); }
Unit of Measure
Measures | Unit |
---|---|
Temperature | Celcius |
Pressure | KPa |
Humidity | %r.H |
Gas | Kohms |
Sensor Data
Name | GroupNo | Thing | DevEUI | Sensor | ObservedProperty | LppChannelNr | FROST Datastream IDs |
---|---|---|---|---|---|---|---|
Iot-Based Urban Gardening | 11 | Seeeduino LoRaaWAN | TTN: 8765182202E81E14 8765182202E81E15 | Grove - Capacitive Moisture Sensor | Analog Voltage Reading | 8 | 1069 |
SWM: 002A862DA290C679 005FD950519EBC37 | Grove - Sunlight Sensor v.1 | Vis (lm) | 5 | 1066 | |||
IR (lm) | 6 | 1067 | |||||
UV (UN Index) | 7 | 1068 | |||||
Grove - Temperature, Humidity, Pressure and Gas Sensor v.1 | Temperature (°C) | 1 | 1059 | ||||
Pressure (KPa) | 2 | 1062 | |||||
Humidity (%r.H) | 4 | 1065 | |||||
Gas (Kohms) | 3 | 1064 |
Working progress & Timeline
Codes for data retrieval
Backend to Frontend
1.D Dashboard