Giter VIP home page Giter VIP logo

holberton_end_of_year's Introduction

Hippocamp Soil moisture monitoring system

Description

Holberton School End of Year project.

A website utilizing Internet Connected Arduino sensors to monitor and record soil moisture levels.

In this project we use the ESP32 Arduino chip connected to capacitative moisture sensor to measure the moisture level of soil. The sensors are connected to the internet using the WiFi capability of the ESP32 chip. The sensors are connected to a node.js web server using Socket.IO to enable two-way communication. The sensors are programmed to automatically send data to the server at one minute intervals. In addition, the sensors are programmed to send data to the server immediately if a large increase in moisture level is detected.

This system consists of a nginx server acting as a proxy to route traffic. The nginx server is connected to a node.js server using express andSocket.IO and a gunicorn/Flask server. The node.js server is used to serve all web content and maintain websocket connections to the sensors while the gunicorn/Flask server is used to serve API requests to obtain data from the backend database. The backend database that stores all data is a MySql database server.

System Architecture and data flow:

  1. The Node.js server waits for connections from any sensor or web client.
  2. The moisture sensor connects to the nginx server via https and then is routed to the Node.js server and a socket.IO web socket connection is created and maintained by the Node.js server.
  3. The moisture sensors are programmed to send data to the server every 60 seconds.
  4. When the Node.js server receives data from the sensors the data is written to the MySql database.
  5. When a web client(browser) connects to the website, the request is routed to the node.js server to serve the page and the .html is sent to the client.
  6. The web client(browser) processes the data that is sent from the server and establishes a socket.IO connection with the node.js server
  7. After the websocket connection is established with the web client(browser), the node.js server sends a broadcast to the client to load data.
  8. The javascript code on the web client(browser) makes an API request to the server.
  9. The gunicorn server responds to the API call and returns data
  10. The browser processes the data that is returned from the API call and generates some dynamic content(sensor data information and formatting) and displays the result to the user.
  11. If the user clicks on a button on the web client(browser), the page will send a message to the node.js server via the socket.IO websocket connection
  12. When the node.js server receives the message from the web client it will send out a broadcast to all devices coded with an id to the sensor that needs to be activated.
  13. All devices will receive the broadcast but only the intended device will respond because of the id that is sent with the broadcast.

System Setup and software used:

Ubuntu 18.04
MySql 5.7.25
node.js
express
socket.IO
Python 3 Flask
gunicorn
Arduino IDE

Authors

Cameron Eng
Peter Wu

holberton_end_of_year's People

Contributors

petehwu avatar c-eng avatar

Stargazers

 avatar Fer⊼o Gonzalez-Morales avatar

Watchers

 avatar

Forkers

c-eng

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.