{"id":13407004,"url":"https://github.com/anoff/plantbuddy","last_synced_at":"2025-05-05T22:38:22.387Z","repository":{"id":37688348,"uuid":"140076739","full_name":"anoff/plantbuddy","owner":"anoff","description":"nodeMCU based moisture monitoring for plants 🌱 with a serverless backend","archived":false,"fork":false,"pushed_at":"2023-02-28T00:28:07.000Z","size":4686,"stargazers_count":60,"open_issues_count":14,"forks_count":82,"subscribers_count":6,"default_branch":"master","last_synced_at":"2024-07-31T19:55:30.288Z","etag":null,"topics":["esp8266-arduino","firebase-firestore","firebase-functions","nodejs","nodemcu"],"latest_commit_sha":null,"homepage":"https://plantbuddy.anoff.io","language":"Vue","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/anoff.png","metadata":{"files":{"readme":"readme.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null}},"created_at":"2018-07-07T11:01:32.000Z","updated_at":"2024-01-21T09:17:42.000Z","dependencies_parsed_at":"2023-10-20T17:28:40.539Z","dependency_job_id":null,"html_url":"https://github.com/anoff/plantbuddy","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/anoff%2Fplantbuddy","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/anoff%2Fplantbuddy/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/anoff%2Fplantbuddy/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/anoff%2Fplantbuddy/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/anoff","download_url":"https://codeload.github.com/anoff/plantbuddy/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":252588486,"owners_count":21772687,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["esp8266-arduino","firebase-firestore","firebase-functions","nodejs","nodemcu"],"created_at":"2024-07-30T19:02:45.537Z","updated_at":"2025-05-05T22:38:22.367Z","avatar_url":"https://github.com/anoff.png","language":"Vue","funding_links":[],"categories":["Vue"],"sub_categories":[],"readme":"\u003cp align=\"center\"\u003e\u003cimg src=\"logo/horizontal.png\" alt=\"plantbuddy\" height=\"120px\"\u003e\u003c/p\u003e\n\n[![Greenkeeper badge](https://badges.greenkeeper.io/anoff/plantbuddy.svg)](https://greenkeeper.io/)\n[![Build Status](https://travis-ci.org/anoff/plantbuddy.svg?branch=master)](https://travis-ci.org/anoff/plantbuddy)\n\n\u003e nodeMCU based moisture monitoring for plants 🌱 with a serverless backend\n\n## Main Features\n\n1. Collect sensor readings every 15 minutes\n1. Deep sleep to preserve battery\n1. Submit values to serverless infrastructure using local WiFi network\n1. Automatically fetch weather report for each reading using backend function\n1. View sensor data on web page\n1. Movable navigation panel\n1. Mobile friendly page\n\n### Webpage demo\n\n![demo](assets/demo.gif)\n\n### System Overview\n\n![system overview](http://www.plantuml.com/plantuml/proxy?cache=no\u0026src=https://raw.github.com/anoff/plantbuddy/master/assets/overview.iuml)\n\n## Hardware\n\nThe hardware setup consists of a [ESP8266](https://en.wikipedia.org/wiki/ESP8266) Microcontroller with a powersupply and two connected sensors.\n\n- [DHT22](https://www.adafruit.com/product/385) connected to **D2** digital input pin\n- [Soil moisture sensor](https://www.sparkfun.com/products/13322) connected to **A0**\n- Bridge between **D0** and **RST** to enable deep sleep for optimizing battery life\n\n\u003e To program the ESP8266 you need to clear the connection to **RST**\n\n[\u003cimg src=\"assets/sketch.png\" height=\"600px\" alt=\"Fritzing diagram\"/\u003e](assets/sketch.png)\n\n### Power consumption\n\n- ESP8266 draws `~80mA` when active and few `µA` when in deepsleep\n- Maximum output current per GPIO pin is `12mA`\n- Photo resistor has `10kOhm` resistor -\u003e `3V3 / 10kOhm = 33mA`\n- Moisture sensor consumes `35mA`\n- DHT222 max current `2.5mA`\n\n## Microcontroller\n\nThe ESP8266 chip is programmed with the [esp8266.ino file](esp8266.ino) using the [Arduino IDE](https://www.arduino.cc/en/Main/Software?). Secrets for connecting to local WiFi and endpoints to post data need to be defined in a `esp8266.secrets.c` file which is specified at [esp8266.secrets.template.c](esp8266.secrets.template.c).\n\n![esp8266 flowchart](http://www.plantuml.com/plantuml/proxy?cache=no\u0026src=https://raw.github.com/anoff/plantbuddy/master/assets/esp8266.iuml)\n\n## Setup\n\n### Serverless backend\n\nAs a backend solution the plantbuddy runs on [Google's firebase 🔥](https://console.firebase.google.com) platform. The main functionalities used from firebase are:\n\n1. Firestore database to store all sensor readings and heartbeats\n1. Firebase functions for providing an **HTTP endpoint** as well as querying for **weather data** for each sensor reading\n\n\u003e Note: As outbound traffic is required to collect weather data, the project should run in **BLAZE** plan. Function and database usage should be within the free tier, only outbound traffic will be billed.\n\n### Backend code\n\nBefore deploying the backend code several variables need to be set so the service can work correctly. An API token for [OpenWeatherMap](https://openweathermap.org/price) can be obtained from their website. A free account should suffice unless a _LOT_ of plantbuddies are running on one account.\n\n```text\nfirebase functions:config:set owm.key=\u003cOpenWeatherMap API Token\u003e\nfirebase functions:config:set owm.city_id=2873776 // according to [OWM City ID List](https://openweathermap.org/current#cityid)\nfirebase functions:config:set header.secret=\u003csome secret\u003e\n```\n\n#### Local development\n\nFor developing the function locally:\n\n```sh\n# get a copy of the environment config\nfirebase functions:config:get \u003e functions/.runtimeconfig.json\n# start function host locally\nfirebase serve --only functions\n```\n\n## Deployment\n\nAll the Firebase stuff gets automatically deployed via Travis CI. To set it up create a encrypted token and update the [Travis CI Config](.travis.yml).\n\n```sh\n# create a firebase CI token\nfirebase login:ci\n\n# encrypt the token to your project\ndocker run --rm caktux/travis-cli encrypt \"\u003ctoken from firebase login:ci\u003e\" -r anoff/plantbuddy\n```\n\n## Useful links\n\n- https://openhomeautomation.net/esp8266-battery\n- http://www.instructables.com/id/Interface-Moisture-Sensor-With-NodeMCU/\n- https://www.losant.com/blog/getting-started-with-the-esp8266-and-dht22-sensor\n- https://www.losant.com/blog/making-the-esp8266-low-powered-with-deep-sleep\n\n## License\n\n- The logo designed by [@reallinfo](https://github.com/reallinfo)\n- The logo is licensed under a [Creative Commons Attribution 4.0 International License](https://creativecommons.org/licenses/by/4.0/)\n- All sourcecode is licensed under [MIT](./LICENSE) unless stated otherwise\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fanoff%2Fplantbuddy","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fanoff%2Fplantbuddy","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fanoff%2Fplantbuddy/lists"}