This project consists of an ESP-32s that uses Arduino libraries to receive data (temperature, air/soil humidity, and light intensity) through UART and send it to an MQTT server on Ubidots. PlatformIO is used as the integrated development environment (IDE).
Before compiling the project, you must create a file named wifi_credentials.h with the following defined macros:
#define WIFI_SSID_SECRETS "<Network Name>"
#define WIFI_PASSWORD_SECRETS "<Password>"
#define UBIDOTS_TOKEN_SECRETS "<Ubidots Token>"
#define DEVICE_LABEL_SECRETS "<Device name>"
|
Additionally, you can customize the project by overwriting the following constants:
#define DATA_UART <UART NUMBER>
#define SERIAL_RX <PIN TO RECEIVE DATA>
#define SERIAL_TX <PIN TO TRANSMIT DATA>
#define BAUD_RATE <BAUD RATE TO TRANSMIT DATA>
#define FREQUENCY_TO_PUBLISH_IN_M <FREQUENCY TO PUBLISH IN MINUTES>
#define FREQUENCY_TO_PUBLISH_IN_MS (FREQUENCY_TO_PUBLISH_IN_M * 60 * 1000)
|
We are planning to add the following features in the future:
- Add support for sensors without dependency on an external MCU.
- Receive signals from the MQTT server to control some actuators.
- Set the device to sleep mode to save energy.
- Set the WiFi credentials through the next options:
- Through the MQTT server.
- Through a web app.
- Through a mobile app.
- Through a Bluetooth connection.
The following libraries are used in this project: