Smart Plant Monitoring for Healthy Growth
Monitor soil moisture, automate watering, and keep your plants thriving with our IoT solution
Real-time monitoring of soil moisture levels for optimal plant health
Automatically water your plants when soil moisture drops below threshold
NRF24L01 radio modules for reliable device communication
Track moisture trends and watering history over time
Leaf Link consists of three main components working together
Sensor nodes that monitor soil moisture and control water pumps
Central hub that collects data and manages all Arduino nodes
RESTful API for data storage and remote monitoring
Set up your Arduino nodes to monitor and water your plants
NRF24L01 | Arduino |
---|---|
VCC | 3.3V |
GND | GND |
CE | D9 |
CSN | D10 |
SCK | D13 |
MOSI | D11 |
MISO | D12 |
Sensor | Arduino |
---|---|
VCC | 5V |
GND | GND |
AOUT | A0 |
Relay | Arduino |
---|---|
VCC | 5V |
GND | GND |
IN | D7 |
Download from arduino.cc
Open Arduino IDE → Tools → Manage Libraries
git clone https://github.com/yourusername/leaf-link-arduino.git
cd leaf-link-arduino
Edit config.h
and set unique device ID:
#define DEVICE_ID "PLANT_001"
#define MOISTURE_THRESHOLD 30 // Adjust based on your plant
Connect Arduino via USB → Select Board and Port → Click Upload
Configure your Raspberry Pi as the central hub
NRF24L01 | RPi GPIO | Pin # |
---|---|---|
VCC | 3.3V | 1 |
GND | GND | 6 |
CE | GPIO22 | 15 |
CSN | GPIO8 (CE0) | 24 |
SCK | GPIO11 (SCLK) | 23 |
MOSI | GPIO10 (MOSI) | 19 |
MISO | GPIO9 (MISO) | 21 |
Use Raspberry Pi Imager to flash the latest OS to your SD card
# Enable SSH and configure WiFi during imaging
sudo raspi-config
# Navigate to: Interface Options → SPI → Enable
sudo apt-get update
sudo apt-get install -y python3-pip python3-dev git
sudo pip3 install --upgrade pip
pip3 install pyrf24 RPi.GPIO requests python-dotenv
git clone https://github.com/yourusername/leaf-link-hub.git
cd leaf-link-hub
cp .env.example .env
nano .env # Configure your API endpoint and credentials
sudo cp leaf-link.service /etc/systemd/system/
sudo systemctl enable leaf-link
sudo systemctl start leaf-link
sudo systemctl status leaf-link # Check if running
Edit .env
file with your API details:
API_URL=http://your-server:8080
API_KEY=your-api-key
HUB_ID=RPI_HUB_001
POLLING_INTERVAL=60 # seconds
cd leaf-link-hub
python3 test_radio.py
python3 scan_devices.py
# Should detect your Arduino nodes
sudo journalctl -u leaf-link -f
# Watch real-time logs
Get everything you need to start monitoring your plants
Ready-to-deploy containerized API
docker pull yourusername/leaf-link-api:latest
Monitor your plants from anywhere
# Clone the repository
git clone https://github.com/yourusername/leaf-link.git
cd leaf-link
# Configure environment
cp .env.example .env
nano .env # Add your configuration
# Start all services
docker-compose up -d
# Access the API
# http://localhost:8080
# http://localhost:8080/docs/
Add a 10μF capacitor between VCC and GND pins for stable power supply
Calibrate sensor: dry reading (air) and wet reading (water), adjust thresholds
Ensure all devices use the same channel and data rate in configuration
Check firewall settings and ensure port 8080 is open