Back
AI
AI
Sensors
Arduino

ESP32 Plant Monitor
280 Views25 Likes0 Comments12/29/2025
Monitor plant health with ESP32. Track soil moisture, light levels, and temperature with mobile notifications.
Code Examples
1 exampleMQTT Publish Example
Arduino31 lines
mqtt_publish.ino
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
500 italic">// ESP32 MQTT Publish Example
500 italic">#include <WiFi.h>
500 italic">#include <PubSubClient.h>
const char* ssid = 400">"YOUR_SSID";
const char* password = 400">"YOUR_PASSWORD";
const char* mqtt_server = 400">"broker.hivemq.com";
WiFiClient espClient;
PubSubClient client(espClient);
void setup() {
Serial.begin(115200);
WiFi.begin(ssid, password);
while (WiFi.status() != WL_CONNECTED) {
delay(500);
}
client.setServer(mqtt_server, 1883);
}
void loop() {
if (!client.connected()) {
client.connect(400">"ESP32Client");
}
client.loop();
client.publish(400">"sensor/temperature", 400">"25.5");
delay(5000);
}Comments (0)
Please login to leave a comment
No comments yet. Be the first to comment!
K
keyestudio Robot
Creator
More from this author
AIESP32 Chatbot with Display
Build an AI chatbot using ESP32 with OLED display. Connect to cloud AI services for intelligent conv
22250
AIArm Robot with Vision
Add computer vision to your robot arm. Detect and pick up objects based on color or shape recognitio
445420
SensorsPressure Sensor Applications
Use pressure sensors for weight measurement and touch detection. Build scales, pressure mats, or for
377410
ArduinoSerial Communication Tutorial
Master serial communication between Arduino and computer. Send and receive data for monitoring and c
470220