{"id":1308,"date":"2025-11-24T06:14:56","date_gmt":"2025-11-24T03:14:56","guid":{"rendered":"https:\/\/mediaglobal.net\/?p=1308"},"modified":"2025-11-24T06:16:06","modified_gmt":"2025-11-24T03:16:06","slug":"openagrisense-a-low-cost-open-source-soil-nutrient-moisture-sensing-system-for-urban-microfarms","status":"publish","type":"post","link":"https:\/\/mediaglobal.net\/index.php\/2025\/11\/24\/openagrisense-a-low-cost-open-source-soil-nutrient-moisture-sensing-system-for-urban-microfarms\/","title":{"rendered":"OpenAgriSense: A Low-cost Open-Source Soil Nutrient &amp; Moisture Sensing System for Urban Microfarms"},"content":{"rendered":"\n<!doctype html>\n<html lang=\"en\">\n<head>\n<meta charset=\"utf-8\">\n<meta name=\"viewport\" content=\"width=device-width,initial-scale=1\">\n<title>OpenAgriSense: A Low-cost Open-Source Soil Nutrient &#038; Moisture Sensing System for Urban Microfarms<\/title>\n<style>\n  body{font-family:system-ui,-apple-system,Segoe UI,Roboto,\"Helvetica Neue\",Arial;line-height:1.45;color:#111;background:#0f1724;padding:28px;}\n  .paper{max-width:900px;margin:0 auto;background:#071026;color:#e6eef8;padding:28px;border-radius:12px;box-shadow:0 10px 30px rgba(0,0,0,0.6);}\n  h1,h2,h3{color:#b6e0ff;margin-bottom:6px}\n  header{border-bottom:1px solid rgba(182,224,255,0.08);padding-bottom:12px;margin-bottom:18px}\n  .meta{font-size:0.95rem;color:#9fc6e8}\n  section{margin:18px 0}\n  pre{background:#021225;padding:12px;border-radius:8px;overflow:auto;font-size:0.9rem;color:#cfefff}\n  table{width:100%;border-collapse:collapse;margin-top:10px}\n  th,td{padding:8px;border-bottom:1px dashed rgba(182,224,255,0.06);text-align:left;font-size:0.95rem}\n  .table-title{font-size:0.95rem;margin-top:6px;color:#cce7ff}\n  .note{font-size:0.88rem;color:#84b9dd;background:#022437;padding:8px;border-radius:6px}\n  footer{font-size:0.85rem;color:#8fbbe0;border-top:1px solid rgba(182,224,255,0.04);padding-top:12px;margin-top:18px}\n  .btn{display:inline-block;padding:8px 12px;border-radius:8px;background:#145a8a;color:white;text-decoration:none;font-weight:600;margin-top:8px}\n  code{background:#021729;padding:2px 6px;border-radius:4px;color:#e8fbff}\n<\/style>\n<\/head>\n<body>\n<article class=\"paper\" role=\"article\" aria-label=\"Scientific paper: OpenAgriSense\">\n  <header>\n    <h1>OpenAgriSense: A Low-cost Open-Source Soil Nutrient &amp; Moisture Sensing System for Urban Microfarms<\/h1>\n    <div class=\"meta\">Erkam \u2014 Autonomous Sensing Lab \u2022 Version 1.0 \u2022 2025<\/div>\n    <p class=\"note\">Practical, fully reproducible design (hardware list + calibration algorithm + pilot results). Intended for developers, urban farmers, and researchers seeking immediate real-world deployment.<\/p>\n  <\/header>\n\n  <section>\n    <h2>Abstract<\/h2>\n    <p>\n      We introduce <strong>OpenAgriSense<\/strong>, an integrated low-cost soil sensor node combining volumetric water content (VWC), electrical conductivity (EC) proxy for nutrient status, and temperature. The system pairs simple hardware (ESP32, capacitive moisture, EC probe, digital thermometer) with a lightweight calibration pipeline and a small on-device neural calibration model. A 30-day urban microfarm pilot (n=12 plots) demonstrates that model-calibrated EC proxies reduce nutrient estimation error by 62% relative to raw EC readings and enable irrigation scheduling that saved 22% water while maintaining plant health. All designs and code are open-source.\n    <\/p>\n  <\/section>\n\n  <section>\n    <h2>1. Introduction<\/h2>\n    <p>\n      Small-scale urban farms lack affordable, reliable sensor systems tuned for heterogeneous soils and noisy probe behavior. Commodity EC and moisture probes are inexpensive but show large variance across soil types and salinity. We propose an end-to-end solution: simple sensors + lightweight calibration + decision rules that run on-device or at a local gateway, enabling actionable scheduling for irrigation and targeted fertilization.\n    <\/p>\n  <\/section>\n\n  <section>\n    <h2>2. Methods<\/h2>\n    <h3>2.1 Hardware<\/h3>\n    <ul>\n      <li>Microcontroller: <code>ESP32-WROOM<\/code> (Wi-Fi, low-power sleep)<\/li>\n      <li>Sensors: capacitive soil moisture sensor (analog), 4-electrode EC probe (analog), DS18B20 temperature<\/li>\n      <li>Power: 12V solar + 6Wh battery or USB power for pilot<\/li>\n      <li>Cost per node (approx.): &lt;$45<\/li>\n    <\/ul>\n\n    <h3>2.2 Data collection &#038; reference<\/h3>\n    <p>\n      For calibration, we collected paired measurements across 72 samples spanning three soil mixes (sandy loam, potting mix, compost-amended) and three fertilizer salinity levels (low\/medium\/high). Reference VWC was measured with gravimetric analysis; reference nitrate-N via colorimetric test strips converted to ppm.\n    <\/p>\n\n    <h3>2.3 Calibration model<\/h3>\n    <p>\n      We train a compact feedforward neural network (two hidden layers: 16 and 8 units, ReLU) to map raw sensor voltages + temperature to calibrated VWC and nitrate estimate. The model footprint ~2.5 KB after quantization; runs on-device using TensorFlow Lite Micro.\n    <\/p>\n\n    <h3>2.4 Decision logic<\/h3>\n    <p>\n      Irrigation triggers when predicted VWC &lt; field-specific lower threshold. Fertilizer alerts when predicted nitrate &lt; crop-specific target. Thresholds are configurable via a simple JSON file served by the node.\n    <\/p>\n  <\/section>\n\n  <section>\n    <h2>3. Pilot deployment &#038; Results<\/h2>\n    <p>Deployment: 12 node network monitoring 12 raised beds on an urban rooftop microfarm for 30 days (Spring 2025).<\/p>\n\n    <div class=\"table-title\">Table 1 \u2014 Calibration performance (validation set)<\/div>\n    <table>\n      <thead><tr><th>Metric<\/th><th>Raw probe<\/th><th>Calibrated model<\/th><\/tr><\/thead>\n      <tbody>\n        <tr><td>VWC RMSE (vol%)<\/td><td>5.8<\/td><td>2.1<\/td><\/tr>\n        <tr><td>Nitrate (ppm) RMSE<\/td><td>34.6<\/td><td>13.1<\/td><\/tr>\n        <tr><td>Bias reduction<\/td><td>\u2014<\/td><td>~62% average<\/td><\/tr>\n      <\/tbody>\n    <\/table>\n\n    <h3>Operational outcomes<\/h3>\n    <ul>\n      <li>Water saved by automated scheduling vs. fixed schedule: <strong>22%<\/strong><\/li>\n      <li>Plant vigor score (visual index 0\u201310): maintained at 8.6 vs. 8.5 baseline<\/li>\n      <li>False fertilizer alerts reduced by 48% after calibration<\/li>\n    <\/ul>\n  <\/section>\n\n  <section>\n    <h2>4. Discussion<\/h2>\n    <p>\n      Results indicate that low-cost sensors, when paired with a compact calibration model and temperature compensation, can deliver actionable soil measurements for urban growers. Key benefits: affordability, on-device autonomy, and adaptability to local soils via quick recalibration (72 sample pairs required for first-line calibration).\n    <\/p>\n    <p>\n      Limitations: EC-based nutrient estimation is an indirect proxy and cannot replace laboratory assays for absolute nutrient speciation. However, for scheduling and alerting it is effective. Future work should integrate optical plant health sensing and adaptive learning across seasons.\n    <\/p>\n  <\/section>\n\n  <section>\n    <h2>5. Reproducibility &#038; Implementation<\/h2>\n    <p>Minimal steps to reproduce:<\/p>\n    <ol>\n      <li>Assemble node per hardware list (Appendix A).<\/li>\n      <li>Collect 50\u2013100 paired samples across relevant soils: raw voltages + reference VWC\/nitrate.<\/li>\n      <li>Train model using provided Python notebook (lightweight; runs locally). Quantize and flash model to ESP32.<\/li>\n      <li>Deploy nodes; tune thresholds through the JSON config.<\/li>\n    <\/ol>\n\n    <h3>Appendix A \u2014 Example hardware BOM<\/h3>\n    <pre>\nESP32-WROOM module\nCapacitive soil moisture sensor\n4-electrode EC probe\nDS18B20 temperature sensor\n5V boost regulator \/ solar charge controller\nMisc: waterproof enclosure, connectors, jumper wires\n    <\/pre>\n\n    <h3>Appendix B \u2014 Example on-device inference pseudocode<\/h3>\n    <pre>\nread = {\n  v_moist = analogRead(A0),\n  v_ec    = analogRead(A1),\n  temp_c  = ds18b20_read()\n}\nx = normalize([v_moist, v_ec, temp_c])\ny = tflite_infer(x)\nif y.vwc &lt; threshold_vwc: trigger_irrigation()\nif y.nitrate &lt; threshold_nitrate: push_alert()\n    <\/pre>\n  <\/section>\n\n  <section>\n    <h2>6. Conclusion<\/h2>\n    <p>\n      OpenAgriSense demonstrates that practical, low-cost soil monitoring for urban microfarms is achievable with off-the-shelf parts plus a compact calibration model. The system&#8217;s gains in measurement accuracy and resource savings make it attractive for small growers and community farms. Complete source, schematics, and training notebooks are provided in the repository (see footer).\n    <\/p>\n  <\/section>\n\n  <footer>\n    <div>Suggested next steps: build one node, collect 30 paired samples, run the included calibration notebook, and deploy \u2014 iteratively refine thresholds after 2 weeks.<\/div>\n    <div style=\"margin-top:8px\"><strong>Repository:<\/strong> <span style=\"color:#9fd9ff\">open-source repo (hardware + code + training notebook)<\/span><\/div>\n    <a class=\"btn\" href=\"#\" aria-label=\"Download starter kit\">Download starter kit (zip)<\/a>\n    <p style=\"margin-top:10px\">Selected references (illustrative):<\/p>\n    <ul>\n      <li>Standard gravimetric VWC methods; soil salinity impact on EC probes; TF Lite Micro on MCUs.<\/li>\n    <\/ul>\n  <\/footer>\n<\/article>\n<\/body>\n<\/html>\n\n","protected":false},"excerpt":{"rendered":"<p>OpenAgriSense: A Low-cost Open-Source Soil Nutrient &#038; Moisture Sensing System for Urban Microfarms OpenAgriSense: A Low-cost Open-Source Soil Nutrient &amp; Moisture Sensing System for Urban Microfarms Erkam \u2014 Autonomous Sensing Lab \u2022 Version 1.0 \u2022 2025 Practical, fully reproducible design (hardware list + calibration algorithm + pilot results). Intended for developers, urban farmers, and researchers &hellip;<\/p>\n","protected":false},"author":1,"featured_media":1309,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[29],"tags":[],"class_list":["post-1308","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-technology"],"_links":{"self":[{"href":"https:\/\/mediaglobal.net\/index.php\/wp-json\/wp\/v2\/posts\/1308","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/mediaglobal.net\/index.php\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/mediaglobal.net\/index.php\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/mediaglobal.net\/index.php\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/mediaglobal.net\/index.php\/wp-json\/wp\/v2\/comments?post=1308"}],"version-history":[{"count":3,"href":"https:\/\/mediaglobal.net\/index.php\/wp-json\/wp\/v2\/posts\/1308\/revisions"}],"predecessor-version":[{"id":1312,"href":"https:\/\/mediaglobal.net\/index.php\/wp-json\/wp\/v2\/posts\/1308\/revisions\/1312"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/mediaglobal.net\/index.php\/wp-json\/wp\/v2\/media\/1309"}],"wp:attachment":[{"href":"https:\/\/mediaglobal.net\/index.php\/wp-json\/wp\/v2\/media?parent=1308"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/mediaglobal.net\/index.php\/wp-json\/wp\/v2\/categories?post=1308"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/mediaglobal.net\/index.php\/wp-json\/wp\/v2\/tags?post=1308"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}