Feed My Plant is a smart watering system that ensures your little plants stay hydrated at all times based on environmental conditions without needing your intervention! This project is the result of a collaborative effort and was develop during the innovation week 2024 organised by Critical software.
- Project Overview
- How It Works
- Hardware Requirements
- Software Setup
- Usage
- Docker Compose Services
- Contributing
- License
Feed My Plant automates the watering process for your plants, ensuring they receive the right amount of water based on various environmental factors. The system uses sensors to monitor rain and ambient conditions, triggering the watering process as needed.
The system consists of several interconnected services running in Docker containers:
- Mosquitto acts as an MQTT broker for communication between components (esp32 and docker network).
- Node-RED manages the logic and workflows.
- Telegraf consume mqtt message and send it to the database.
- InfluxDB stores the collected data.
- Grafana provides a dashboard for visualizing the data.
To set up the Feed My Plant system, you will need the following hardware:
- An ESP32
- BME680, rain detector
- Electrovalve
- 12 volts relay
- 12 volts transformator
- Tubing and connectors
Here above the setup without the rain detector. The BME280 sensor is connected via I2C (SDA 21, SCL 22). The relay is connected to GPIO26, and the rain sensor (not shown) uses GPIO33. The valve and rain sensor are powered by an external 12V power supply.
Before setting up the software, ensure you have the following installed on your machine:
-
Clone the Repository:
git clone https://github.com/Axel-ex/Feed_my_plant.git cd feed-my-plant
-
change the Wifi credentials in .cpp files and upload the code to the board
cd code pio run --target upload && pio device monitor
-
Start the Docker Containers:
cd docker_compose docker-compose up -d
-
Set up your database
- Go to your database page (
http://localhost:8086
) - Create a profile and copy your API token
- Go to your database page (
-
Modify credentials:
- Make sure to modify environment variable in the .env file with the value you just entered when creating your influxdb user.
- Restart your services
docker-compose restart
Once the Docker containers are up and running:
- Access Grafana at
http://localhost:3000
to visualize sensor data. - Access Node-RED at
http://localhost:1880
to manage and customize the automation workflows. Access the Node-RED UI athttp://localhost:1880/ui
to interact with your microcontroller. - Ensure Telegraf, InfluxDB, and Mosquitto are running and properly configured to collect and route data from your sensors.
- Image:
telegraf
- Ports:
8125
- Configuration:
volumes: - ./data/telegraf/telegraf.conf:/etc/telegraf/telegraf.conf:ro
- Image:
influxdb
- Ports:
8086
- Volumes:
volumes: - influxdb_data:/var/lib/influxdb
- Image:
grafana/grafana
- Ports:
3000
- Volumes:
volumes: - grafana_data:/var/lib/grafana
- Image:
nodered/node-red:latest
- Container Name:
node-red
- Ports:
1880
- Volumes:
volumes: - ./data/node-red:/data
- Image:
eclipse-mosquitto:latest
- Container Name:
mosquitto
- Ports:
1883
- Volumes:
volumes: - ./data/mosquitto/config:/mosquitto/config - ./data/mosquitto/data:/mosquitto/data - ./data/mosquitto/log:/mosquitto/log