You don't need an UNO if you use an I2C based sensor, here Hum, Temp, and pressure are all served on a webpage.
/*
Field 1 temp
Field 2 humidity
field 3 pressure
GPIO0 -> SDA pin of the I2C port
GPIO2 -> SCL pin of the I2C port
* */
//#define serialActive //switches serial monitoring on/off
//#define fixedIP //need define IP and gateway
#include <Wire.h>
#include <ESP8266WiFi.h>
#include <WiFiClient.h>
#include <ESP8266WebServer.h>
#include <ESP8266mDNS.h>
#include <stdio.h>
MDNSResponder mdns;
const char* deviceID = "OutdoorSensors";
const char* hostName = "Outdoor Environment";
const char* ssid = "xxxxxxxx"; // Replace with your network credentials
const char* password = "xxxx";
ESP8266WebServer server(80);
String temperature;
String humidity;
String pressure;
unsigned long timer;
String webPage1 = "";
String webPage2 = "";
String webPage3 = "";
void setup() {
# ifdef serialActive
Serial.begin(19200);
# endif
// Initialise wifi connection
connectWifi();
timer = millis();
webPage1 += "<head><title>";
webPage1 += hostName;
webPage1 += "</title><META HTTP-EQUIV=\"refresh\" CONTENT=\"5; URL=/\"></head>";
webPage1 += "<meta name = \"viewport\" content = \"width = device-width\">";
webPage1 += "
<body bgcolor=\"#E6E6FA\">
<h1 align=center>";
webPage1 += hostName;
webPage1 += "</h1><p align=center><a href=\"\"><button style=\"border-radius:12px;width:150px;height:50px;font-size: 16px;background-color: #e7e7e7;color:black;\"><strong> Refresh</strong></button></a></p></body>";
webPage3 = "</body>";
//I2C stuff
Wire.pins(2, 0); //swapped 0, 2 from wiring example because mistake wiring (SDA, SCL)
Wire.begin(2, 0);
delay(500);
server.on("/", []() {
server.send(200, "text/html", webPage1 + webPage2 + webPage3);
});
server.begin();
}
void loop() {
if (!WiFi.status()) {
connectWifi(); // Initialise wifi connection
}
if (millis() >= timer + 2000) {
getT9602values(0x28);
getPressure(0x2B);
timer = millis();
webPage2 = "<p font-size:16px; align=center><strong>";
webPage2 += temperature + " &#176C
" ; //&#176; °
webPage2 += humidity + " %rH
";
webPage2 += pressure + " hPa </strong></p>";
# ifdef serialActive
Serial.println(webPage2);
# endif
}
server.handleClient();
}
//________________________________________get sensor values subroutines_____________________
void getPressure(byte address) {
//For Barometric NPA-700N-17.5A in hPa, Multiplier = 1000, Offset = 200
// For NPA-700N-015A in hPa, Multiplier = 1034.212, Offset = 0
#define Units "hPa"
#define Multiplier 1000
#define Offset 200
byte aa, bb, cc, dd;
float Data_value;
Wire.beginTransmission(address);
Wire.write(0);
Wire.endTransmission();
Wire.requestFrom(address, 4);
aa = Wire.read();
bb = Wire.read();
cc = Wire.read();
dd = Wire.read();
Data_value = ((aa & 0x3F ) << 8) | bb ;
//Serial.print(aa);Serial.print(", ");Serial.print(bb);Serial.print(", ");Serial.print(cc);Serial.print(", ");Serial.print(dd);Serial.print(", ");
Data_value = (float)(( Data_value - 1638 ) / ( 14745 - 1638 )) * Multiplier + Offset;
pressure = ftos(round ((float) Data_value), 0, 4);
}
void getT9602values(byte address)
{
byte aa, bb, cc, dd;
double var;
Wire.beginTransmission(address);
Wire.write(0);
Wire.endTransmission();
Wire.requestFrom(address, 4);
aa = Wire.read();
bb = Wire.read();
cc = Wire.read();
dd = Wire.read();
// humidity = (rH_High [5:0] x 256 + rH_Low [7:0]) / 16384 x 100
var = round((float)(((unsigned)(aa & 0x3F ) << 8) + (unsigned)bb) / 16384.0 * 100.0);
humidity = ftos(var, 1, 4);
// temperature = (Temp_High [7:0] x 64 + Temp_Low [7:2]/4 ) / 16384 x 165 - 40
var = round((float)((unsigned)(cc * 64) + (unsigned)(dd >> 2 )) / 16384.0 * 165.0 - 40.0);
temperature = ftos(var, 1, 4); //Float Value, Number of Decimals, characters to return
}
String ftos(float var, int nd, int cc) // variable, number of decimal places, character count
{
int j;
char buffer1[10];
String buffer2;
dtostrf(var, cc, nd, buffer1); //dtostrf(floatvar, StringLengthIncDecimalPoint, numVarsAfterDecimal, charbuf);
for (j = 0; j < cc; j++) {
buffer2 = buffer2 + buffer1[j];
}
return buffer2;
}
//______connect to wifi – returns true if successful or false if not
void connectWifi() {
WiFi.hostname(deviceID);
boolean state = true;
int i = 0;
WiFi.mode(WIFI_STA);
#ifdef fixedIP
WiFi.config(ip, gateway, subnet); // IP Address, DNS, gateway, subnet
#endif
WiFi.begin(ssid, password);
# ifdef serialActive
Serial.println("");
Serial.println("Connecting to WiFi");
// Wait for connection
Serial.print("Connecting ...");
# endif
while (WiFi.status() != WL_CONNECTED) {
delay(500);
# ifdef serialActive
Serial.print(".");
# endif
if (i > 10) {
state = false;
break;
}
i++;
}
# ifdef serialActive
if (state) {
Serial.println("");
Serial.print("Connected to ");
Serial.println(ssid);
Serial.print("IP address: ");
Serial.println(WiFi.localIP());
}
else {
Serial.println("");
Serial.println("Connection failed.");
}
# endif
if (mdns.begin("esp8266", WiFi.localIP())) {
#ifdef serialActive
Serial.println("MDNS responder started");
#endif
}
}
Sensors are an Amphenol 3.3V T9602 Hum/Temp, and an Amphenol NPA series pressure sensor.