user2107733
Published

InqWeather - Weather with the Knowing

The least coding you'll ever have to do for a Web Server based Weather Station. Now with Zambretti weather predictions.

BeginnerFull instructions provided267
InqWeather - Weather with the Knowing

Things used in this project

Hardware components

NodeMCU ESP8266 Breakout Board
NodeMCU ESP8266 Breakout Board
×1
BMP180 - Pressure Sensor
×1
AHT10 - Humidity Sensor
×1
Breadboard (generic)
Breadboard (generic)
×1
Jumper wires (generic)
Jumper wires (generic)
Four wires (total)
×4

Story

Read more

Schematics

InqWeather Wiring

Code

InqWeather.ino (excerpt)

Arduino
This is an excerpt of the InqWeather.ino file showing the setup() method. These lines are the sum total of all coding necessary to create a web server and publish fifteen different variables from your Sketch to the clients. Some will be read-only at the client while other can be modified. There is no explicit coding required to communicate with the browser clients in either direction. The rest of the code is your project specific code including global variables, reading sensors and making calculations. The full source code is provided as one of the examples included when you download the InqPortal library in your Arduino IDE Library Manager.
void setup() 
{
    svr.onInterval(takeReading, READING_INTERVAL);  

    svr.publishRO("V", VERSION_INQ_WEATHER, sizeof(VERSION_INQ_WEATHER),
        "InqWeather Version");
    
    svr.heading("LS", "Settings");
    svr.publishRW("North", &config.zNorth, "Northern Hemisphere (bool)");
    svr.publishRW("Alt", &config.altitude, "Altitude adjustment", NULL,
        validateAltitudeFactor);
    svr.publishRW("Pmin", &config.zMinP, "Area Min Pressure (mbar)");
    svr.publishRW("Pmax", &config.zMaxP, "Area Max Pressure (mbar)");
    
    svr.heading("LH", "AHT10 Humidity Sensor");
    svr.publishRO("Th1", &temperatureAHT10Cur, "Current Temperature (°C)"); 
    svr.publishRO("H1", &humidityAHT10Cur, "Current Humidity (%H)");
    
    svr.heading("LP", "BMP180 Pressure Sensor");
    svr.publishRO("T1", &temperatureBMP180Cur, "Current Temperature (°C)");
    svr.publishRO("P1", &pressureBMP180Cur, "Current Pressure (mbar)");
    
    svr.heading("LA", "Minute Averages");
    svr.publishRO("Th", &temperatureAHT10Min, "Temperature (°C)"); 
    svr.publishRO("H", &humidityAHT10Min, "Humidity (%M)");
    svr.publishRO("Tp", &temperatureBMP180Min, "Temperature (°C)");
    svr.publishRO("P", &pressureBMP180Min, "Pressure (mbar)");
    
    svr.heading("LZ", "Calculations");
    svr.publishRO("D3P", &pressureDelta3Hour, "3 Hour Pressure Change (mbar)");
    svr.publishRO("Z", &zam, "Zambretti (0-25) = (A-Z)");

    svr.begin(DEFAULT_HOST_SSID, NULL, YOUR_SSID, YOUR_PW);

    pinMode(LED_BUILTIN, OUTPUT);
    
    if (bmp180.begin())
        Serial.printf("BMP180 init success\n");
    else
        Serial.printf("BMP180 init fail\n");
    
    if (aht10.begin())
        Serial.printf("AHT10 init success\n");
    else
        Serial.printf("AHT10 init fail\n");
}

InqPortal

Web Server, communications, file manager, access point manager

Adafruit AHT10

Humidity Sensor

BMP085

Also supports BMP180

Credits

user2107733
0 projects • 3 followers

Comments