Connect to ESP Device

Connect your soil sensor (ESP32/ESP8266) via USB to read the data directly.

Status:Not Connected

Data Received

Waiting for data...
Arduino IDE Code
Upload this code to your ESP32/ESP8266 using the Arduino IDE. You'll need the Arduino_JSON library.
#include <Arduino.h>
#include <Arduino_JSON.h>

void setup() {
  Serial.begin(9600);
}

void loop() {
  // Create a JSON object
  JSONVar sensorData;

  // Simulate reading sensor data
  sensorData["temperature"] = random(18, 28);
  sensorData["moisture"] = random(50, 75);
  sensorData["humidity"] = random(40, 60);
  sensorData["ec"] = (float)random(15, 30) / 10.0;
  sensorData["pH"] = (float)random(60, 75) / 10.0;
  sensorData["nitrogen"] = random(100, 200);
  sensorData["phosphorus"] = random(40, 70);
  sensorData["potassium"] = random(200, 300);

  // Convert JSON object to string
  String jsonString = JSON.stringify(sensorData);

  // Send JSON string over serial
  Serial.println(jsonString);

  // Wait for 5 seconds before sending again
  delay(5000);
}