|
1 | 1 | # Plant133 |
2 | 2 |
|
3 | | -This is a full distribution of the Plant133 plant-watering device. This device can monitor and water up to 4 plants at a time. This repository hosts the firmware, PCBA design, and OpenSCAD code for the all components. |
| 3 | +This is a full distribution of the Plant133 plant-watering device. This device can monitor and water up to 4 plants at a time. This repository hosts the firmware, PCBA design, and OpenSCAD code for all components. |
4 | 4 |
|
5 | 5 | A writeup about this project is at "[Plant1337: "Water 4 plants](https://selectiveappeal.org/posts/plant1337/)." |
6 | 6 |
|
7 | 7 |  |
8 | 8 |
|
| 9 | +## Features |
9 | 10 |
|
10 | | -## Setup |
| 11 | +* **Multi-Plant Support**: Monitors and independently waters up to 4 plants. |
| 12 | +* **Sensors**: |
| 13 | + * Capacitive soil moisture sensing for each plant. |
| 14 | + * SHT3x temperature and humidity sensor for environmental monitoring. |
| 15 | + * Reservoir water level float switch detection. |
| 16 | +* **User Interface**: |
| 17 | + * **OLED Screen**: Rotates through status screens showing IP address, moisture levels, and environment data. |
| 18 | + * **Web Dashboard**: A modern Svelte-based responsive web interface for real-time monitoring and configuration. |
| 19 | +* **Integration**: |
| 20 | + * **MQTT**: Full support for Home Assistant auto-discovery and state reporting. |
| 21 | +* **Safety**: |
| 22 | + * **Watchdog Timer**: Hardware watchdog protects against system hangs. |
| 23 | + * **Dose Limiting**: Prevents over-watering by limiting the maximum number of pump cycles per day. |
| 24 | + * **Reservoir Check**: Prevents pump damage by detecting low water levels. |
11 | 25 |
|
12 | | -Please see the [instructions](instructions.md) for how to setup a Plant133 device if you are lucky enough to have one. |
| 26 | +## Usage |
13 | 27 |
|
| 28 | +Please see the [instructions](instructions.md) for how to assemble and set up a Plant133 device hardware. |
14 | 29 |
|
15 | | -## Software |
| 30 | +## Development |
16 | 31 |
|
17 | | -This project is built using my C++ framework for ESP devices. |
18 | | -- [og3](https://github.com/chl33/og3) My application framework. |
19 | | -- [og3x-oled](https://github.com/chl33/og3x-oled) Support for the OLED screen I use with this project |
20 | | -- [og3x-shtc3](https://github.com/chl33/og3x-shtc3) Support for the SHTC3 temperature/humidty sensor used by this project. |
| 32 | +### Prerequisites |
| 33 | +* [PlatformIO](https://platformio.org/) (Core or VSCode extension) |
| 34 | +* [Node.js](https://nodejs.org/) (for building the web interface) |
21 | 35 |
|
22 | | -The web interface for the project uses the Svelte framework, and was partially generated by Claude (Anthropic). Claude said it was OK to include the code in this MIT-licensed project. The web interface integration is performed using [svelteesp32](https://github.com/BCsabaEngine/svelteesp32). |
| 36 | +### Building the Web Interface |
| 37 | +The web interface is built with Svelte and must be compiled before uploading to the ESP32's filesystem. |
23 | 38 |
|
24 | | - |
| 39 | +```bash |
| 40 | +cd svelte |
| 41 | +npm install |
| 42 | +npm run build |
| 43 | +``` |
25 | 44 |
|
| 45 | +This generates the static HTML/CSS/JS files in `data/static/`. |
26 | 46 |
|
| 47 | +### Building and Flashing Firmware |
27 | 48 |
|
28 | | -## PCBA |
| 49 | +1. **Configure Secrets**: Copy `secrets.ini.example` to `secrets.ini` and set your WiFi credentials, OTA password, and MQTT details. |
| 50 | +2. **Build Firmware**: |
| 51 | + ```bash |
| 52 | + pio run |
| 53 | + ``` |
| 54 | +3. **Upload Filesystem** (contains the web interface): |
| 55 | + ```bash |
| 56 | + pio run -t uploadfs |
| 57 | + ``` |
| 58 | +4. **Upload Firmware**: |
| 59 | + ```bash |
| 60 | + pio run -t upload |
| 61 | + ``` |
29 | 62 |
|
30 | | -The full [KiCAD](https://www.kicad.org/) project for the printed circuit board is in the [KiCAD](KiCAD/) subdirectory. KiCAD is a cross platform, open source electronics design system. |
| 63 | +## API Reference |
31 | 64 |
|
32 | | - |
33 | | - |
34 | | -## Components which can be printed with a 3D printer |
| 65 | +The device exposes a JSON API for integration and control: |
35 | 66 |
|
36 | | -Several components for the Plant133 device are printed with a 3D printer. These are designed as 3D geometry descriptions in [OpenSCAD](https://openscad.org/). The code for these are in the [scad](scad/) subdirectory. |
| 67 | +* `GET /api/status`: Returns system status (temp, humidity, water level). |
| 68 | +* `GET /api/plants`: Returns configuration for all plants. |
| 69 | +* `GET /api/moisture`: Returns current moisture readings. |
| 70 | +* `PUT /api/plants/{id}`: Update configuration for a specific plant. |
| 71 | +* `POST /test/pump`: Run a pump for a specific duration (JSON body: `{ "pumpId": 1, "duration": 1000 }`). |
| 72 | +* `POST /api/restart`: Restart the device. |
37 | 73 |
|
38 | | -### Project box |
| 74 | +## Software Libraries |
39 | 75 |
|
40 | | -OpenSCAD code for the project box housing the PCBA is in the [scad/box/](scad/box/) subdirectory. It requires the library at https://github.com/chl33/ProjectBox. |
| 76 | +This project is built using a custom C++ framework for ESP devices: |
| 77 | +- [og3](https://github.com/chl33/og3): Application framework. |
| 78 | +- [og3x-oled](https://github.com/chl33/og3x-oled): OLED screen support. |
| 79 | +- [og3x-shtc3](https://github.com/chl33/og3x-shtc3): SHTC3 sensor support. |
| 80 | +- [svelteesp32](https://github.com/BCsabaEngine/svelteesp32): Web interface integration. |
41 | 81 |
|
42 | | - |
| 82 | +## Hardware |
43 | 83 |
|
44 | | -### Project box reservoir hanger |
| 84 | +### PCBA |
45 | 85 |
|
46 | | -Code for a plate which allows you to hang the EBox on the side of a water reservoir is in [scad/ebox_hook](scad/ebox_hook). This is screwed to the bottom part of the EBox. |
| 86 | +The full [KiCAD](https://www.kicad.org/) project for the printed circuit board is in the [KiCAD](KiCAD/) subdirectory. |
47 | 87 |
|
48 | | - |
| 88 | + |
49 | 89 |
|
50 | | -### Reservoir insert |
| 90 | +### 3D Printed Components |
51 | 91 |
|
52 | | -Inside the water reservoir, an insert holds a float for detecting the water level and 1-4 aquarium pumps for watering the plants. The code for this insert is in [scad/reservoir_insert](scad/reservoir_insert). |
| 92 | +Components are designed in [OpenSCAD](https://openscad.org/). Source code is in the [scad](scad/) subdirectory. |
53 | 93 |
|
54 | | - |
| 94 | +#### Project box |
| 95 | +Housing for the PCBA ([scad/box/](scad/box/)). |
| 96 | + |
55 | 97 |
|
56 | | -### Moisture sensor cap |
| 98 | +#### Reservoir Hanger |
| 99 | +Mounts the box to a water reservoir ([scad/ebox_hook](scad/ebox_hook)). |
| 100 | + |
57 | 101 |
|
58 | | -A cap for the moisture sensor can hold the end of the watering tube in place in the plant's pot, for when the watering spike is not used. |
| 102 | +#### Reservoir Insert |
| 103 | +Holds pumps and water level float ([scad/reservoir_insert](scad/reservoir_insert)). |
| 104 | + |
59 | 105 |
|
| 106 | +#### Moisture Sensor Cap |
| 107 | +Holds the watering tube at the sensor location ([scad/moisture_sensor_cap](scad/moisture_sensor_cap)). |
60 | 108 |  |
61 | | - |
62 | | - |
63 | | -### Watering spike |
64 | | - |
65 | | -The end of the watering tube can be inserted into a 3D-printed spike with holes in it, which can be inserted into the soil in the plant pot to spread water through the pot. |
66 | | - |
67 | | -The spike is printed in two halves which can be epoxied together. |
68 | 109 |
|
| 110 | +#### Watering Spike |
| 111 | +Alternative watering method using a soil spike ([scad/spike](scad/spike)). |
69 | 112 |  |
70 | | - |
71 | | - |
|
0 commit comments