Skip to content

Add Smart Irrigation System project: Arduino sketch, IoT upgrade, docs, and circuit reference - #1

Draft
prashanth-nayak6 with Copilot wants to merge 2 commits into
mainfrom
copilot/build-smart-irrigation-system
Draft

Add Smart Irrigation System project: Arduino sketch, IoT upgrade, docs, and circuit reference#1
prashanth-nayak6 with Copilot wants to merge 2 commits into
mainfrom
copilot/build-smart-irrigation-system

Conversation

Copilot AI commented Apr 9, 2026

Copy link
Copy Markdown

Bootstraps a complete Smart Irrigation System project from a stub README — structured code, hardware docs, and an optional ESP8266 Wi-Fi upgrade.

Core Arduino sketch (code/smart_irrigation.ino)

  • Reads soil moisture via analog A0; maps raw ADC (0–1023) to moisture %
  • Controls pump relay on D7 using configurable MOISTURE_THRESHOLD (default 600) and RELAY_ACTIVE_LOW flag
  • Non-blocking timed reads via millis() — no delay() in main loop
  • Serial Monitor output at 9600 baud with raw value, %, and pump state
if (rawValue > MOISTURE_THRESHOLD) {
  setPump(true);   // soil dry — water
} else {
  setPump(false);  // moisture adequate — stop
}

IoT upgrade (code/esp8266_iot_upgrade.ino)

  • NodeMCU ESP8266 variant with Wi-Fi + MQTT (PubSubClient)
  • Publishes irrigation/moisture (int %) and irrigation/pump (ON/OFF) every 10 s
  • Subscribes to irrigation/command — accepts ON, OFF, AUTO for remote override
  • Auto-reconnects to both Wi-Fi and broker on dropout

Documentation (docs/)

  • circuit_diagram.md — pin tables for sensor/relay/pump/LCD, ASCII schematic, power budget, safety notes (flyback diode, AC relay warning)
  • components.md — full BOM with specs, costs ($24–$64), capacitive vs. resistive sensor trade-offs, sourcing options
  • simulation_guide.md — step-by-step Tinkercad (free) and Proteus walkthroughs; troubleshooting table for common sim issues

images/README.md

Placeholder listing expected assets (Fritzing diagram, breadboard photo, serial monitor screenshot) with creation instructions.

Original prompt

Build a Smart Irrigation System using Arduino. Include Arduino code to read soil moisture sensor values and control a water pump via a relay module based on a threshold. Add proper comments in code, circuit diagram explanation, and documentation.

Create a structured project with folders for code, documentation, and images. Include a detailed README with setup instructions, components list, working principle, and future enhancements. Optionally add simulation support (Proteus/Tinkercad) and suggest IoT upgrade using ESP8266 for remote monitoring.

- code/smart_irrigation.ino: Arduino sketch with soil moisture reading,
  relay control, threshold comparison, and Serial Monitor output
- code/esp8266_iot_upgrade.ino: NodeMCU Wi-Fi + MQTT upgrade with remote
  pump control via irrigation/command topic
- docs/circuit_diagram.md: ASCII schematic, pin tables, safety notes
- docs/components.md: Full components list with costs and descriptions
- docs/simulation_guide.md: Tinkercad and Proteus step-by-step guide
- images/README.md: Placeholder with Fritzing/Tinkercad screenshot guide
- README.md: Detailed readme with overview, setup, config, working
  principle, IoT upgrade, future enhancements, troubleshooting

Agent-Logs-Url: https://github.com/prashanth-nayak6/Smart-Irrigation-System-Using-Arduino/sessions/ba7cffa5-df44-4b1c-9ca9-0dee65e954bf

Co-authored-by: prashanth-nayak6 <208974686+prashanth-nayak6@users.noreply.github.com>
Copilot AI changed the title [WIP] Build smart irrigation system using Arduino Add Smart Irrigation System project: Arduino sketch, IoT upgrade, docs, and circuit reference Apr 9, 2026
Copilot AI requested a review from prashanth-nayak6 April 9, 2026 10:05
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants