PlantSpeak is an IoT project that publishes sensor data from an "ESP-32 Soil Moisture Sensor Module" to ThingSpeak. It collects data related to soil humidity, air temperature, air humidity, voltage, and RSSI, and sends it to ThingSpeak for further analysis and visualization.
The default upload period is one minute and if an error accoured, the esp32 will sleep for 5 minutes and then retry to upload (with new sensor data).
This project was inspired by:
To install and set up PlantSpeak, please follow these steps:
If you haven't already, create an account on ThingSpeak to host your sensor data.
This is my channel: Thingspeak channel 1270350
Create a new channel on ThingSpeak with at least five fields. The default fields for PlantSpeak are as follows:
Also activate Show Status.
Clone the PlantSpeak repository to your local machine.
git clone https://github.com/SamKry/PlantSpeak.git
Create a file in the src
directory with the file name secrets.h
.
Add this content to the secrets.h
file:
// Use this file to store all of the private credentials
// and connection details. Pay attention to not commit this file!
#define SECRET_SSID "MySSID" // replace MySSID with your WiFi network name
#define SECRET_PASS "MyPassword" // replace MyPassword with your WiFi password
#define SECRET_CH_ID 0000000 // replace 0000000 with your channel number
#define SECRET_WRITE_API_KEY "MyAPIKey" // replace MyAPIKey with your channel write API key
Modify the secrets.h
file to include your network and ThingSpeak credentials. This file should not be committed to version control, as it contains sensitive information.
Follow the steps below to set up the hardware components for PlantSpeak.
Solder the two 100K Ohm resistors to the ESP-32 board according to the provided diagram. The resistors are used to measure the voltage of the battery. Use GPIO 35
for the voltage measurement.
If you don't want to measure the voltage, you can skip this step. However, you have to remove the corresponding code from the main.cpp
file.
If you want to power the system with a solar panel, solder the solar panel to the ESP-32 board following the provided diagram. A small battersie is sufficient to survive a day, but I recommend using a slightly larger LiPo, as it is not sunny every day in my region. Two 5V 250mA solar panels are sufficient to power the system. I use the following solar panels:
- 5V 1.2W 240mA DIY Polycrystalline Silicon Solar Panel Battery Solar Charger
- Solar Panel 5V Mini Solar System DIY For Battery Cell Phone Chargers Portable 0.7W 0.8W 1W 1.2W 2.5W 4.2W Solar Cell
The battery can also be charged via the micro USB port.
Use your preferred development environment (e.g., Visual Studio Code with the PlatformIO plugin or Arduino IDE) to upload the code to the ESP-32 board.
The following libraries are used in the PlantSpeak project:
- mathworks/thingspeak-arduino @^2.0.0
- adafruit/DHT sensor library@^1.4.4
- adafruit/Adafruit Unified Sensor@^1.1.9
Make sure to install these libraries before uploading the code to the ESP-32.
Contributions to PlantSpeak are welcome! If you have any ideas, improvements, or bug fixes, please open an issue or submit a pull request on this repository.