{"id":16195516,"url":"https://github.com/medmunds/waterbot","last_synced_at":"2025-04-07T15:57:17.426Z","repository":{"id":41541788,"uuid":"95327402","full_name":"medmunds/waterbot","owner":"medmunds","description":"Water meter on the web","archived":false,"fork":false,"pushed_at":"2024-09-22T21:01:08.000Z","size":1479,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":2,"default_branch":"main","last_synced_at":"2025-02-13T18:42:20.845Z","etag":null,"topics":["google-cloud-platform","iot","iot-device","particle-photon"],"latest_commit_sha":null,"homepage":"https://waterbot.twistymaze.com","language":"JavaScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"other","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/medmunds.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,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2017-06-24T23:09:47.000Z","updated_at":"2024-09-22T21:01:12.000Z","dependencies_parsed_at":"2024-11-03T06:40:58.852Z","dependency_job_id":"930dec91-172b-4a89-9b5c-c6baf7b9b633","html_url":"https://github.com/medmunds/waterbot","commit_stats":null,"previous_names":[],"tags_count":2,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/medmunds%2Fwaterbot","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/medmunds%2Fwaterbot/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/medmunds%2Fwaterbot/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/medmunds%2Fwaterbot/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/medmunds","download_url":"https://codeload.github.com/medmunds/waterbot/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":247685630,"owners_count":20979085,"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":["google-cloud-platform","iot","iot-device","particle-photon"],"created_at":"2024-10-10T08:28:29.606Z","updated_at":"2025-04-07T15:57:17.402Z","avatar_url":"https://github.com/medmunds.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Waterbot: water meter on the web\n\nThis (work-in-progress) project provides data collection and reporting for a pulse-output water meter.\nIt's currently used at [Permaculture San Francisco's][permaculture-sf] 18th and Rhode Island Garden:\nhere's the [latest data][production-waterbot].\n\n[permaculture-sf]: http://www.permaculture-sf.org\n[production-waterbot]: https://waterbot.twistymaze.com\n\n\n## What's involved\n\nSkeletal docs follow; better info to come later.\nFeel free to contact Mike (email is in my profile) with any questions.\n\n\n### Hardware\n\nYou'll need:\n\n* A pulse-output water meter: we're using this *very reasonably priced* stainless steel\n  model from [EKM Metering][water-meter]\n* A Particle [Photon][photon] to sense the meter pulses and connect over WiFi to report usage\n* A Particle [Particle Power Shield][power-shield] to charge a LiPo battery that runs the Photon\n* A waterproof case to hold the electronics,\n  with a clear cover so you can see the various LEDs for troubleshooting\n* A solar cell that provides DC power for the Power Shield: we're piggy-backing off a 24V\n  one the garden was already using for its pond pump\n\nYou'll also need access to a WiFi network. We have plenty of those in SF.\n(Particle also makes a similar \"Electron\" board that uses cellular instead\nof WiFi; you could probably adapt this project without much effort.)\n\nWiring:\n* Connect the Photon's D2 and GND pins directly to the meter's pulse output\n* Connect the Photon's VBAT to GND (yes, GND); this ensures the Photon\n  initializes memory correctly on cold start\n* Connect the solar cell to the Power Shield's DC input screw terminals\n* (Optional, but recommended:) Connect the Photon's GND and RST pins to a pushbutton\n  you can access relatively easily -- this lets you wake up the Photon for maintenance\n\n[water-meter]: http://www.ekmmetering.com/3-4-water-meter-stainless-steel-pulse-output.html\n[photon]: https://www.particle.io/products/hardware/photon-wifi-dev-kit\n[power-shield]: https://docs.particle.io/datasheets/particle-shields/#power-shield\n\n\n### Firmware\n\nThe [waterbot firmware](firmware/) is loosely based on [this similar project][water-usage-monitor].\n\nYou should be able to build and flash it with the particle-cli tools or Particle's desktop IDE.\n\nThe firmware publishes events to the Particle Cloud:\n\n* Whenever a meter pulse is detected, though at most once every 5 minutes.\n  It will group together multiple pulses in a 5-minute period.\n\n* At least once every 4 hours, even if no meter pulses are detected.\n\nOnce running the waterbot firmware, your Photon will try to enter deep sleep as often as possible\nto conserve battery. The reset button will wake it up for 5 minutes so you can perform maintenance.\n\nThere are constants near the top of the [source](firmware/src/waterbot.cpp)\nto change the various timings.\n\n[water-usage-monitor]: https://community.particle.io/t/water-usage-monitor/16187\n\n\n### Server\n\nThe [waterbot server](server/) component runs \"serverless\" in the Google Cloud Platform,\ncollecting data in BigQuery. There are two Cloud Function endpoints:\n\n* `dataCapture` receives events from the Particle Cloud via a Pub/Sub Topic\n  and stores the data in Google BigQuery\n\n* `report` summarizes the data from BigQuery for use by the web client\n\n\nTo deploy your own (and yes, this all needs to get cleaned up and automated):\n\n1. Create a Google Cloud Platform project and set up your Particle Cloud to publish\n   to a Pub/Sub Topic in it. Follow [Particle's GCP Integration][particle-google-pubsub] docs.\n\n2. Create a BigQuery table using this [schema](server/schema.json). Optionally populate it\n   with any historic usage data.\n\n3. Edit the [server config](server/src/config.ts) to match your Google Cloud Platform project,\n   and then deploy the two Cloud Functions using the comments at the top of each .js file.\n\n[particle-google-pubsub]: https://docs.particle.io/tutorials/integrations/google-cloud-platform/\n\n\n### Web client\n\nThe [waterbot client](client/) component runs in a web browser and generates nice charts and scorecards\nfrom the server reports. Here's [a live example][production-waterbot].\n\nMost of the [client config](client/src/config.js) is separated out, but there are probably\nsome hard-coded links and references to Permaculture SF scattered around the code.\n\nThe client is (currently) a create-react-app project.\nBuild it with `yarn build`.\n\nThe resulting build is a static site and can be hosted just about anywhere.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmedmunds%2Fwaterbot","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fmedmunds%2Fwaterbot","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmedmunds%2Fwaterbot/lists"}