Cost-effective automated plant watering system with 2-domain optical isolation for practical greenhouse automation. Features ESP32-based control, RS485 Modbus soil sensors, and simplified safety design optimized for enclosed environments.
π₯ Latest Update v2.3: Upgraded to TXS0108E bidirectional level shifter for faster RS485 communication - 1800x faster signal propagation while maintaining cost-effectiveness and reliability.
- Features
- Hardware Requirements
- Software Dependencies
- Installation
- Usage
- Documentation
- Testing
- Safety
- Contributing
- License
- Fast Level Shifting: TXS0108E provides rapid voltage translation (110 Mbps)
- 2-Domain Architecture: ESP32 (3.3V) β FIELD Domain (5V, level shifted)
- Cost Effective: Ultra-low cost design with high performance
- Greenhouse Optimized: Practical design for enclosed 12V environments
- Multi-Parameter Soil Analysis: NPK, pH, EC, moisture, temperature via RS485 Modbus
- Environmental Sensing: BME280 for ambient temperature, humidity, pressure
- Real-time Monitoring: Web interface with live sensor data
- Remote Web Interface: Responsive monitoring and configuration portal
- Hardware-Only Control: LDO voltage converters provide always-on power management
- Extended Runtime: >48h operation on 20Ah LiFePO4 battery
- Solar Ready: MC4 connectors for future solar panel integration
- Battery Monitoring: Real-time voltage and capacity tracking
- Simplified Design: No software power control eliminates failure points
- Instant Operation: Always-on design eliminates startup delays
12V LiFePO4 BATTERY βββ¬ββ AMS1117-3.3 LDO βββΊ ESP32 Control Domain (Always-On)
β β TXS0108E Level Shifter (3.3Vβ5V)
β βββ FIELD Domain (RS485 + Sensors)
β
βββ AMS1117-5.0 LDO βββΊ Field Power Supply (Always-On)
β
βββ Common Ground (GND_COMMON)
| Component | Model | Function | Domain |
|---|---|---|---|
| Microcontroller | ESP32-WROOM-32E | Main processor + WiFi | 3.3V Always-On |
| RS485 Interface | SP3485EN | Modbus communication | 5V Always-On |
| Level Shifter | TXS0108E | 3.3Vβ5V voltage translation | Signal Path |
| Power Regulation | AMS1117 | LDO voltage regulators | Hardware Control |
| Environmental | BME280 | Temperature/humidity | 3.3V Control |
| Soil Sensor | RS485 Modbus | NPK/pH/EC/moisture | 5V Field |
LDO-based design provides reliable, always-on operation:
- Fast Level Shifting: TXS0108E (110 Mbps capability with 10ns propagation)
- Hardware Control: LDO regulators eliminate software power management
- Common Ground: Simplified design prevents ground loop issues
- Always-On: Eliminates startup delays and power sequencing complexity
- Maintenance Free: No complex power domain monitoring required
- Framework: Arduino framework for ESP32
- Build System: PlatformIO
- Libraries:
- Wire (for I2C communication)
- Adafruit BME280 (for environmental sensor)
- ModbusMaster (for RS485 soil sensor)
- ESPAsyncWebServer (for web interface)
- AsyncElegantOTA (for OTA updates)
- LittleFS (for file storage)
- ArduinoJson (for data processing)
- Clone the repository:
git clone https://github.com/cryptotomte/WateringSystem.git
cd WateringSystem- Install PlatformIO (if not already installed):
pip install platformioOn Windows systems, PlatformIO may not be in PATH. Use these commands:
# Build project
& "C:\Users\crypt\.platformio\penv\Scripts\pio.exe" run --environment wateringsystem
# Upload to device
& "C:\Users\crypt\.platformio\penv\Scripts\pio.exe" run --target upload --environment wateringsystem- Build and upload the firmware:
platformio run --target upload- Upload the file system (for web interface):
platformio run --target uploadfs-
Initial Setup
- Power on the device
- Connect to the WiFi network "WateringSystem-XXXX"
- Navigate to 192.168.4.1 in your web browser
- Follow the setup wizard to configure your home WiFi network
-
Web Interface
- Access the web interface by navigating to the IP address of the device
- Monitor current environmental and soil conditions
- Configure watering schedules and thresholds
- View historical data and system logs
-
OTA Updates
- Access the update page at http://[device-ip]/update
- Upload new firmware files through the web interface
Detailed documentation is available in the docs directory:
- System Requirements Specification
- Architecture Documentation
- Hardware Documentation
- User Guide
- Testing Documentation
- Safety Documentation
- Release Notes
The system includes unit tests and integration tests that can be executed using PlatformIO:
# Run all tests
platformio test
# Run specific test
platformio test -e test_sensorsFor complete testing documentation, see Testing Documentation.
The WateringSystem interfaces with both water and electricity. Important safety considerations:
- All electrical components must be properly isolated from water
- Use waterproof enclosure for outdoor installations
- Include proper grounding for lightning protection in outdoor installations
- Power supply must be isolated and conform to safety standards
For complete safety information, see Safety Documentation.
Contributions to the WateringSystem project are welcome! Please read CONTRIBUTING.md for details on our code of conduct and the process for submitting pull requests.
This project is licensed under the GNU Affero General Public License v3.0 or later (AGPL-3.0-or-later) - see the LICENSE file for details.
Key License Points:
- β Commercial use allowed
- β Private use allowed
- β Modification allowed
β οΈ Must share source code when distributing binariesβ οΈ Must share source code when running as network service (SaaS)β οΈ Must preserve copyright and license noticesβ οΈ All modifications must use the same license