PohWL
Published

ECOPlant - Plant Monitoring

A simulation of how technology is able to monitor the growth of a plant by using Internet of Things and cloud services.

IntermediateWork in progress2,221
ECOPlant - Plant Monitoring

Things used in this project

Hardware components

DHT11 Temperature & Humidity Sensor (4 pins)
DHT11 Temperature & Humidity Sensor (4 pins)
×1
Resistor 10k ohm
Resistor 10k ohm
×1
Resistor 330 ohm
Resistor 330 ohm
×4
Buzzer
Buzzer
×1
RGB Backlight LCD - 16x2
Adafruit RGB Backlight LCD - 16x2
×1
Light-Dependant Resistor
×1
Raspberry Pi 3 Model B
Raspberry Pi 3 Model B
×1
Breadboard (generic)
Breadboard (generic)
×1
MCP3008 ADC
×1
SparkFun Soil Moisture Sensor (with Screw Terminals)
SparkFun Soil Moisture Sensor (with Screw Terminals)
×1
T-Cobbler kit
×1
Jumper wires (generic)
Jumper wires (generic)
×1
5 mm LED: Red
5 mm LED: Red
×1
5 mm LED: Green
5 mm LED: Green
×1
5 mm LED: Yellow
5 mm LED: Yellow
×1
5 mm LED White
×1
Arduino UNO & Genuino UNO
Arduino UNO & Genuino UNO
×1
RFID reader (generic)
×1

Software apps and online services

Microsoft Visual Studio Code
Flask
AWS IoT
Amazon Web Services AWS IoT
AWS S3
Amazon Web Services AWS S3
AWS DynamoDB
Amazon Web Services AWS DynamoDB
AWS MQTT

Story

Read more

Custom parts and enclosures

step_by_step_tutorial_lJSRfETEGC.pdf

Schematics

Fritzing Diagram

Untitled 8donej8bwx

Code

server.py

Python
This list of codes is meant for inserting, getting and updating data to the AWS DynamoDB
from flask import Flask, render_template, jsonify, request
import datetime
from gpiozero import LED
import dynamodb
import jsonconverter as jsonc

app = Flask(__name__)

@app.route("/api/sensorData/<rows>",methods=['POST','GET'])
def apiSensorData(rows):
    data = {
        'data': jsonc.data_to_json(dynamodb.getSensorData(rows))
    }
    return jsonify(data)

@app.route("/api/tenMinData",methods=['POST','GET'])
def apiAverage():
    data = jsonc.data_to_json(dynamodb.getSensorAvgData())
    return jsonify(data)

led = LED(21)
@app.route("/api/setLedState/<on>",methods=['POST','GET'])
def apiSetLed(on):
    if str(on) == "1":
        led.on()
    else:
        led.off()
    return jsonify(True)

@app.route("/api/getLimitData",methods=['GET'])
def apiGetLimit():
    data = jsonc.data_to_json(dynamodb.getLimitData())
    return jsonify(data)

@app.route("/api/updateLimit",methods=['POST'])
def apiUpdateLimit():
    ok = dynamodb.updateLimitTable(request.get_json())
    return jsonify(ok)

@app.route("/api/getImages",methods=['GET'])
def apiGetImage():
    urls = dynamodb.getImagesUrl()
    return jsonify(urls)

@app.route("/")
def home():
    return render_template("index.html")

@app.route("/admin.html")
def admin():
    return render_template("admin.html")

@app.route("/login.html")
def login():
    return render_template("login.html")

app.run(debug=True,host="0.0.0.0")

Credits

PohWL

PohWL

1 project • 7 followers

Comments

Add projectSign up / Login