Report Bug · Request Feature · Send a Pull Request
Plants Care is a system that automatically takes care of plants.
It controls soils moisture and trigger watering based on configured rules.
- NodeMCU Lol1n v3 ESP8266 (ESP-12E) Wi-FI CH340: Documentation
- Analog multiplexer 74HC4051_8-Mux: Data sheet
- Soil moisture sensor: Funduino Data sheet
- Water pump: to do
- Battery: LiFePO4 18650
- Rename ./arduino/Secrets.h.dist to
./arduino/Secrets.h
and replace its values.
#define PUSH_GATEWAY_BASEURL "https://ip:5091/metrics/job/plantcare/instance/a"
#define PLANTS_CARE_BASEURL "https://ip:5080/api/watering/a"
a
at the end of the URLs represent a microcontroller, name it as you want.
You can install how many microcontroller as needed.
- Compile & Upload (see Makefile)
- Bury soil moisture sensors in plants
- Plug a battery
- ???
- Profit!
To do
Using Docker-Compose
docker-compose.yaml
services:
plants-care-api:
image: deuzu/plants-care-api:alpha
restart: unless-stopped
environment:
DATABASE_HOST: plants-care-database
DATABASE_NAME: ${DATABASE_NAME}
DATABASE_USER: ${DATABASE_USER}
DATABASE_PASSWORD: ${DATABASE_PASSWORD}
DATABASE_CONNECTION_TIMEOUT: ${DATABASE_CONNECTION_TIMEOUT}
DATABASE_CONNECTION_LIMIT: ${DATABASE_CONNECTION_LIMIT}
ports:
- 5080:80
plants-care-database:
image: mariadb
restart: unless-stopped
environment:
MARIADB_RANDOM_ROOT_PASSWORD: 1
MARIADB_DATABASE: ${DATABASE_NAME}
MARIADB_USER: ${DATABASE_USER}
MARIADB_PASSWORD: ${DATABASE_PASSWORD}
volumes:
- plants-care-database:/var/lib/mysql
- ./database-init.sql:/docker-entrypoint-initdb.d/1-database-init.sql
prometheus:
image: prom/prometheus
volumes:
- ./prometheus.yaml:/etc/prometheus/prometheus.yml
- prometheus:/prometheus
ports:
- 5090:9090
push-gateway:
image: prom/pushgateway
volumes:
- pushgateway:/data
ports:
- 5091:9091
grafana:
image: grafana/grafana
volumes:
- grafana:/var/lib/grafana
ports:
- 5030:3000
volumes:
plants-care-database: ~
prometheus: ~
pushgateway: ~
grafana: ~
prometheus.yaml
global:
scrape_interval: 30s
evaluation_interval: 30s
rule_files: ~
scrape_configs:
- job_name: prometheus
static_configs:
- targets: [localhost:9090]
- job_name: push-gateway
static_configs:
- targets: [push-gateway:9091]
honor_labels: true
Consider using a reverse proxy like nginx-proxy/nginx-proxy or traefik/traefik.
- How to waterproof moisture sensor? Silicon?
- Power consumption savings with deep sleep: gist examples
- Handle HTTPS properly
- automatic watering e.g.
- PCB how to & Phil's lab youtube channel
- Box and connectics
- Solar panels
- Rewrite it in Rust + Tonari examle
Contributions are what make the open source community such an amazing place to be learn, inspire, and create. Any contributions you make are extremely appreciated.
Please read those guidelines before contributing to this repository.
- Fork the Project
- Create your Feature Branch (
git checkout -b feat-amazing-feature
) - Commit your Changes (
git commit -m 'feat(scope): Add some AmazingFeature' -m "Closes #42"
) - Push to the Branch (
git push origin feat-amazing-feature
) - Open a Pull Request
cd arduino & make
To find the board:
arduino-cli board list
If error "Could not open serial port /dev/ttyUSB0" is encountered:
sudo usermod -a -G dialout <username>
# or
sudo adduser <username> dialout
Example soil moisture level sent:
cat <<EOF | curl --data-binary @- localhost:5092/metrics/job/plantcare/instance/a
# HELP moisture level in percentage
# TYPE moisture_level gauge
moisture_level{sensor="0"} 12
moisture_level{sensor="1"} 74.605713
moisture_level{sensor="2"} 42
moisture_level{sensor="3"} 654
EOF
cd api && make