#include <ESP8266WiFi.h>
#include <ThingSpeak.h>

const char* ssid = "OnePlus Nord CE5 7BA4";
const char* pass = "11111111";
const unsigned long channel = 3153297;
const char* key = "GOAOPDRKWGCBOYAN";

WiFiClient client;
#define LM35 A0

void setup() {
  Serial.begin(115200);
  WiFi.begin(ssid, pass);
  while (WiFi.status() != WL_CONNECTED) delay(200);
  ThingSpeak.begin(client);
}

void loop() {
  int val = analogRead(LM35);
  float temp = val * (3.3 / 1023.0) * 100;   // Convert to °C
  Serial.printf("Temp: %.2f°C\n", temp);
  int x = ThingSpeak.writeField(channel, 1, temp, key);
  Serial.println(x == 200 ? "Sent to ThingSpeak!" : "Send Error!");
  delay(15000);  // ThingSpeak update interval
}

Embed on website

To embed this project on your website, copy the following code and paste it into your website's HTML: