Skip to content

Android visualization of household or outdoor soil moisture levels using a Raspberry Pi, Python, Linux, Android, and Stemma Sensors.

Notifications You must be signed in to change notification settings

EthanDarling8/IOTGarden

Repository files navigation

IOTGarden

This Android, Python, and Raspberry-Pi project is meant to provide a visualization of household or outdoor soil moisture and temperature levels.
This is a work in progress.

Plant Fragment Detail Fragment Detail Fragment

Requirements

This app WILL NOT WORK without setting up a firebase account and linking it to the app.
Android Studio Firebase Realtime Database
Optional: Adafruit IO Account
Raspberry Pi (Any type)
Pyrebase on your Raspberry Pi
Stemma Soil Sensor
JST I2C Cable

Instructions

  1. Set up your raspberry pi with pyrebase and connect your stemma device.
  2. Set up your firebase realtime database.
  3. Clone this repository into the directory of your choice.
  4. Open the repo in android studio and link your firebase to the application.
  5. The python scripts in the root directory of the repo (stemmaAIO.py and stemmaFirebase.py) should be placed somewhere on the reaspberry pi.
  6. Set up the scripts with your Adafruit IO (optional) and your firebase accounts.
  7. Set up crontab:
- Open crontab with "sudo crontab -e"
- For my stemmaAIO.py I run it every minute with this crontab line:

* * * * * python3 ~/Documents/Stemma/stemmaAIO.py >> ~/Documents/Stemma/AIOlog.txt 2>&1

- For my stemmaFirebase.py I run it every hour on the hour:

0 * * * * python3 ~/Documents/Stemma/stemmaFirebase.py >> ~/Documents/Stemma/Firebaselog.txt 2>&1

- For more info on crontab look at its documentation
- These crontab lines run the script and output any errors into separate log files.
  1. The firebase script is set to delay for 5 seconds on purpose in order to avoid simultaneous IO reading errors.
  2. You are now uploading stemma information to Arduino IO and Firebase.
  3. The java programming on the Android side of things is set up to give a baseline of moisture levels over 7 days.
  4. Wait for the stemma data to come in over time to get a better idea of how the moisture and temperature levels fluctuate in your particular plant and soil.
  5. Check out my dashboard and feeds on Adafruit IO for an example: Dashboard, Moisture, Temperature]. An example for the firbase side can be seen in the progress image above.

To Do

  • 24 Hour Chart
  • Seven Day Chart
  • Month Chart
  • Plant Details Fragment
  • Add more instructions to Readme
  • Multiple Stemma connections with multiplexer
  • Cards for each Stemma connection
  • Renaming of Stemma connections
  • Plant type suggestions
  • UI updates
  • Refactor HomeFragment
  • Create classes for chart generation

About

Android visualization of household or outdoor soil moisture levels using a Raspberry Pi, Python, Linux, Android, and Stemma Sensors.

Topics

Resources

Stars

Watchers

Forks

Packages

No packages published