Skip to content

Commit f4779bf

Browse files
committed
feat: readme update
1 parent 4d5a6d9 commit f4779bf

File tree

1 file changed

+48
-29
lines changed

1 file changed

+48
-29
lines changed

README.md

Lines changed: 48 additions & 29 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,16 @@
11
# ESP-32s Project with Arduino and PlatformIO
22

3-
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).
3+
This project consists of an ESP-32s that uses Arduino libraries to receive data (temperature, air/soil humidity, and light intensity) from sensors and send it to an MQTT server on Ubidots. PlatformIO is used as the integrated development environment (IDE).
4+
5+
## Features
6+
7+
- **Temperature and Humidity Monitoring**: Uses the DHT11 sensor to monitor the temperature and air humidity.
8+
- **Soil Moisture Monitoring**: Monitors soil moisture using a capacitive soil moisture sensor.
9+
- **Light Intensity Monitoring**: Measures light intensity with a photoresistor.
10+
- **Automated Climate Control**: Controls fans based on temperature and air humidity, and controls a water pump based on soil moisture levels.
11+
- **Remote Control**: Fans and water pumps can be remotely controlled via MQTT topics through the Ubidots platform.
12+
- **Parallel Tasks**: Each sensor runs in its own FreeRTOS task to ensure efficient monitoring.
13+
- **MQTT Data Transmission**: Data is sent to Ubidots through MQTT for real-time monitoring and control.
414

515
## Before start
616

@@ -15,43 +25,52 @@ Before compiling the project, you must create a file named wifi_credentials.h wi
1525
1626
| ⚠️ Make sure to replace the example values with your own data before compiling.
1727
18-
## Customization
28+
## Components
1929
20-
Additionally, you can customize the project by overwriting the following constants:
30+
- **Microcontroller**: ESP32
31+
- **Temperature and Humidity Sensor**: DHT11
32+
- **Soil Moisture Sensor**: Capacitive soil moisture sensor (analog)
33+
- **Light Intensity Sensor**: Photoresistor (analog)
34+
- **Fan and Water Pump**: Connected to ESP32 for climate control
2135
22-
```c++
23-
#define DATA_UART <UART NUMBER>
24-
#define SERIAL_RX <PIN TO RECEIVE DATA>
25-
#define SERIAL_TX <PIN TO TRANSMIT DATA>
26-
#define BAUD_RATE <BAUD RATE TO TRANSMIT DATA>
27-
#define FREQUENCY_TO_PUBLISH_IN_M <FREQUENCY TO PUBLISH IN MINUTES>
28-
#define FREQUENCY_TO_PUBLISH_IN_MS (FREQUENCY_TO_PUBLISH_IN_M * 60 * 1000)
29-
```
36+
## Pin Configuration
37+
38+
| Component | ESP32 Pin |
39+
|-----------------|-----------|
40+
| DHT11 Sensor | GPIO 4 |
41+
| Soil Moisture | GPIO 34 |
42+
| Light Sensor | GPIO 35 |
43+
| Fan | GPIO 12 |
44+
| Water Pump | GPIO 14 |
45+
46+
## Sensor Sampling Intervals
3047
31-
| ⚠️ Make sure that the slave device transmits at the same baud rate defined in the BAUD_RATE macro.
48+
- **Temperature and Humidity**: 10 minutes
49+
- **Soil Moisture**: 15 minutes
50+
- **Light Intensity**: 15 minutes
3251
33-
## Future changes
52+
## Ubidots Setup
3453
35-
We are planning to add the following features in the future:
54+
- The system connects to Ubidots using MQTT to publish sensor data and subscribe to actuator control topics.
55+
- Ensure that the following variables are configured in your Ubidots dashboard:
56+
- `temperature`: for temperature readings.
57+
- `air_humidity`: for air humidity readings.
58+
- `light`: for light intensity readings.
59+
- `soil_humidity`: for soil moisture readings.
60+
- `fan`: for controlling the fan remotely.
61+
- `water_pump`: for controlling the water pump remotely.
3662
37-
* Add support for sensors without dependency on an external MCU.
38-
* Receive signals from the MQTT server to control some actuators.
39-
* Set the device to sleep mode to save energy.
40-
* Set the WiFi credentials through the next options:
41-
* Through the MQTT server.
42-
* Through a web app.
43-
* Through a mobile app.
44-
* Through a Bluetooth connection.
63+
## Code Overview
4564
46-
## Libraries
65+
### Dependencies
4766
48-
The following libraries are used in this project:
67+
Make sure to include the following libraries in your project:
4968
50-
* [Ubidots Arduino MQTT](https://github.com/ubidots/esp32-mqtt)
51-
* [HardwareSerial](https://github.com/espressif/arduino-esp32/blob/master/cores/esp32/HardwareSerial.h)
52-
* [Arduino](https://www.arduino.cc/reference/en/libraries/)
69+
- [Ubidots Arduino MQTT](https://github.com/ubidots/esp32-mqtt)
70+
- [Adafruit Unified Sensor](https://github.com/adafruit/Adafruit_Sensor)
71+
- [Adafruit DHT](https://github.com/adafruit/DHT-sensor-library)
72+
- [Arduino](https://www.arduino.cc/reference/en/libraries/)
5373
5474
## References
5575
56-
* [Connect an ESP32-DevKitC to Ubidots over MQTT](https://help.ubidots.com/en/articles/748067-connect-an-esp32-devkitc-to-ubidots-over-mqtt)
57-
* [ESP32 UART Communication Explained with Example](https://microcontrollerslab.com/esp32-uart-communication-pins-example/)
76+
- [Connect an ESP32-DevKitC to Ubidots over MQTT](https://help.ubidots.com/en/articles/748067-connect-an-esp32-devkitc-to-ubidots-over-mqtt)

0 commit comments

Comments
 (0)