{"id":30069280,"url":"https://github.com/ricountzero/veggie_vision_firmware","last_synced_at":"2025-08-08T11:07:40.885Z","repository":{"id":307180875,"uuid":"1028620023","full_name":"ricountzero/veggie_vision_firmware","owner":"ricountzero","description":"Elixir firmware for Raspberry Pi Zero 2W, leveraging Nerves for efficient communication with soil moisture sensors.","archived":false,"fork":false,"pushed_at":"2025-07-29T21:19:47.000Z","size":98,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":0,"default_branch":"main","last_synced_at":"2025-07-29T22:56:58.144Z","etag":null,"topics":["elixir","nerves-project","raspberry-pi-zero-2-w"],"latest_commit_sha":null,"homepage":"","language":"Elixir","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/ricountzero.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"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,"zenodo":null}},"created_at":"2025-07-29T19:59:35.000Z","updated_at":"2025-07-29T21:19:50.000Z","dependencies_parsed_at":"2025-07-29T22:56:59.505Z","dependency_job_id":"f8f32667-331e-4f5b-8a03-23dfe9d85105","html_url":"https://github.com/ricountzero/veggie_vision_firmware","commit_stats":null,"previous_names":["ricountzero/veggie_vision_firmware"],"tags_count":null,"template":false,"template_full_name":null,"purl":"pkg:github/ricountzero/veggie_vision_firmware","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ricountzero%2Fveggie_vision_firmware","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ricountzero%2Fveggie_vision_firmware/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ricountzero%2Fveggie_vision_firmware/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ricountzero%2Fveggie_vision_firmware/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/ricountzero","download_url":"https://codeload.github.com/ricountzero/veggie_vision_firmware/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ricountzero%2Fveggie_vision_firmware/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":269410221,"owners_count":24412157,"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","status":"online","status_checked_at":"2025-08-08T02:00:09.200Z","response_time":72,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"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":["elixir","nerves-project","raspberry-pi-zero-2-w"],"created_at":"2025-08-08T11:07:37.885Z","updated_at":"2025-08-08T11:07:40.876Z","avatar_url":"https://github.com/ricountzero.png","language":"Elixir","funding_links":[],"categories":[],"sub_categories":[],"readme":"# VeggieVision Firmware\n\nA [Nerves](https://nerves-project.org/)-based firmware project for monitoring soil moisture using a Raspberry Pi Zero 2W and LM393 Soil Hygrometer Moisture Sensor.\n\n## Overview\n\nVeggieVision is an embedded Elixir application built with the [Nerves](https://nerves-project.org/) framework that continuously monitors soil moisture levels using an LM393 Soil Hygrometer Moisture Sensor. The project runs on a Raspberry Pi Zero 2W and communicates with the sensor via I2C protocol. The system automatically transmits humidity data to a remote HTTP server for data collection and analysis.\n\n## Hardware Components\n\n- **Board**: Raspberry Pi Zero 2W\n- **Sensor**: LM393 Soil Hygrometer Moisture Sensor (Analog Output)\n- **Communication**: I2C protocol\n- **I2C Address**: 0x2\n- **I2C Bus**: i2c-1\n\n### Raspberry Pi Zero 2 W Pinout\n\n![Raspberry Pi Zero 2 W Pinout](images/raspberry_pi_zero_2_w_pinout.png)\n\n## Software Stack\n\n- **Framework**: [Nerves Project](https://nerves-project.org/)\n- **Language**: Elixir\n- **I2C Library**: Circuits.I2C\n- **HTTP Client**: Req\n- **Architecture**: Supervisor pattern for process management\n\n## Project Structure\n\n```\nveggie_vision_firmware/\n├── README.md\n├── veggie_vision.ex\n└── images/\n    └── raspberry_pi_zero_2_w_pinout.png\n```\n\n## Code Overview\n\nThe main module `VeggieVision` implements:\n\n- **Supervisor Pattern**: Manages the I2C communication process\n- **Periodic Monitoring**: Reads sensor data every 15 minutes (900,000ms)\n- **HTTP Data Transmission**: Automatically sends humidity data to a configured HTTP server\n- **Error Handling**: Graceful handling of I2C bus failures and HTTP communication issues\n- **Data Processing**: Reads 2 bytes from the sensor and processes the moisture data\n\n### Key Features\n\n- Automatic I2C bus initialization\n- Periodic soil moisture monitoring (15-minute intervals)\n- HTTP data transmission to remote server\n- Comprehensive error logging for I2C and HTTP communication\n- Supervisor-based process management for reliability\n\n## Configuration\n\n### Server Configuration\n\nThe firmware is configured to send humidity data to an HTTP server. Update the `@server_url` variable in `veggie_vision.ex`:\n\n```elixir\n@server_url \"http://\u003cIP_ADDRESS\u003e:4001/store\"\n```\n\nReplace `\u003cIP_ADDRESS\u003e` with your server's IP address or domain name.\n\n### Measurement Interval\n\nThe current measurement interval is set to 15 minutes (900,000ms). This can be adjusted by modifying the `@measurement_interval` variable:\n\n```elixir\n@measurement_interval 900_000  # 15 minutes in milliseconds\n```\n\n## Usage\n\nThe firmware automatically starts when deployed to the Raspberry Pi Zero 2W. The system will:\n\n1. Initialize I2C communication with the soil moisture sensor\n2. Read sensor data every 15 minutes\n3. Transmit humidity values to the configured HTTP server\n4. Log all activities and errors to the console\n\n## Data Transmission\n\nThe firmware sends humidity data via HTTP GET requests to the configured server endpoint. The data is transmitted as a query parameter:\n\n```\nGET /store?hum=\u003chumidity_value\u003e\n```\n\nThe server should be configured to handle these requests and store or process the humidity data as needed.\n\n## Sensor Integration\n\nThe LM393 Soil Hygrometer Moisture Sensor provides analog output that is read through the I2C interface. The sensor detects soil moisture levels and provides periodic monitoring capabilities for agricultural or gardening applications.\n\n## Development\n\nThis project is designed for embedded applications using the [Nerves](https://nerves-project.org/) framework, providing a robust and reliable solution for soil moisture monitoring in IoT applications with remote data collection capabilities.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fricountzero%2Fveggie_vision_firmware","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fricountzero%2Fveggie_vision_firmware","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fricountzero%2Fveggie_vision_firmware/lists"}