GithubHelp home page GithubHelp logo

ameer1234567890 / gardenr Goto Github PK

View Code? Open in Web Editor NEW
1.0 3.0 0.0 338 KB

An indoor gardening assistant

License: MIT License

Python 70.81% HTML 14.09% JavaScript 4.99% Shell 10.12%
garden raspberry-pi soil-moisture-sensor i2c-lcd adc temperature-sensor humidity-sensor

gardenr's Introduction

Build Status

Gardenr

An indoor gardening assistant

How it works

  • When ./gardenr.py is run, it reads temperature, humidity and soil moisture level.
  • It then updates these values to ./www/data.json for later use by web frontend.
  • It then updates the 15x2 LCD with the current time and soil moisture level.
  • A preset moisture threshold is compared against the moisture level, and a notification is sent via IFTTT if soil is drier than the threshold.
  • A python web server is then run with root ./www/.
  • The resulting frontend uses Javascript to query updated sensor data using AJAX.
  • Now, all the collected data can be accessed by reaching https://localhost or Raspberry Pi's hostname.
  • I use a the domain name gardenr.ameer.io which is signed with a LetsEncrypt certificate.
  • Since https is used, the resulting frontend is a fully compliant Progressive Web App (PWA).
  • The notification threshold can be changed from web interface.
  • ./gardenr.py can be made to run on startup, by installing systemd unit file ./gardenr.service.
  • Note: ./testdht.py, ./testsht.py ./testlcd.py and ./testmoisture.py are test scripts which are used for testing individual sensors.

TODO

  • Fabricate improved PCB.

Components Used

  • Raspberry Pi 3B+
  • DHT22
  • Soil Moisture Sensor KY70
  • Analog to Digital Converter (ADC) YL-40
  • 15x2 I2C LCD with PCF8574 as driver

Pinout for DHT22

Raspberry Pi  -  DHT22
-----------------------------
5V            -  VCC (Pin 1)
GND           -  GND (Pin 4)
GPIO4         -  DATA (Pin 2)

Pinout for Soil Moisture Sensor KY70

Raspberry Pi  -  Soil Moisture Sensor KY70
------------------------------------------
5V            -  VCC
GND           -  GND

ADC YL-40  -  Soil Moisture Sensor KY70
------------------------------------------
AIN3       -  A0

Pinout for ADC YL-40

Raspberry Pi  -  ADC YL-40
--------------------------
3.3V          -  VCC
GND           -  GND
SDA           -  SDA
SCL           -  SCL

Pinout for 15x2 I2C LCD

Raspberry Pi  -  15x2 I2C LCD
-----------------------------
5V            -  VCC
GND           -  GND
SDA           -  SDA
SCL           -  SCL

Libraries used

Pictures

Credits

Make Raspberry Pi's root filesystem read-only

if grep -qs 'overlay=yes' /proc/cmdline; then
  textred=$(tput setaf 3)
  cat <<END_HEREDOC

${textred}==>WARNING: Root filesystem is read only.
None of the changes you make will be preserved after reboot.
To disable read only mode change 'overlay=yes' to 'overlay=no'
at kernel commandline.
END_HEREDOC
fi

gardenr's People

Contributors

ameer1234567890 avatar

Stargazers

 avatar

Watchers

 avatar  avatar  avatar

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.