Display analogic results online

I'm doing this important final project for school where i control lights on a webpage but i also wanna display temperature, i'm thinking about using either a LM35 or DHT 11/12. I have the code already but how can i show it online or offline on a webpage? (i'm using a service called Teleduino)

Ill post the LM35 sensor code. My question is how can i export the value of the temperature to a website?

float tempC;
float tempF;

int reading;
float referenceVoltage;

int tempPin = 0; //Analog pin connected to LM35


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

 // Set Analog reference to 1.1V this gives more accuracy since the sensor will output 0-1 V
 // This only available on ATmega168 or ATmega328)
 // For more information see: http://arduino.cc/en/Reference/AnalogReference
 analogReference(INTERNAL);
 referenceVoltage = 1.1; //Set to 5, 3.3, 2.56 or 1.1 depending on analogReference Setting
 
}

void loop()
{
  reading = 0;
  
  for(int i = 0; i < 10; i++) { // Average 10 readings for accurate reading
     reading += analogRead(tempPin); 
     delay(20);
  }


  // A lot of examples divide the sensor reading by 1024. This is incorrect and should be 1023. There are 1024 values including 0 so this should be 1023.
  tempC =  (referenceVoltage * reading * 10) / 1023; 
  
  // Convert to Fahrenheit
  tempF = (tempC * 9 / 5) + 32;
  
  Serial.print(tempC, 1); //Print one decimal, it's not accurate enough for two
  Serial.println(" C");
  Serial.print(tempF, 1); //Print one decimal, it's not accurate enough for two
  Serial.println(" F");
  
  Serial.println(" ");
  delay(1500);
}

Thanks in advance,

Alex

  1. consider getting a BME280 instead. Much better than all the sensors you mentioned combined (I know the DHT11 is the poor man's version of the DHT22, and from my experience I can tell you that the DHT22 is a pretty unreliable sensor in itself).

  2. get your Arduino to connect to the Internet (e.g. WiFi, Ethernet - the first is the easiest, get a NodeMCU or WeMOS mini instead of using an Arduino). Start sending data to your web server (as http GET or POST). Have web server take care of the rest.

Another thing: do calibrate your internal voltage, as the actual value of the 1.1V is +/- 10%.