Things used in this project

Hardware components:
D1 mini
Everything ESP Wemos D1 Mini
×1
Nanomesher Human Machine Interface
×1
Sensirion SHT31
×1
Resistor 4.7k Ohm
×2
11026 02
Jumper wires (generic)
×1
Software apps and online services:
Ide web
Arduino IDE

Schematics

WeatherSender Schematic
A very simple weather logger which uses SHT3x sensor with i2c interface. The Arduino software will read data and send the data to Nanomesher HMI via HTTP
Weather sensor bb a0pc5m67fc

Code

WeatherSenderArduino
Arduino code for reading Humidity and Temperature from SHT31 and update data on the display.

Before using the code, change:
- SSID / PASSWORD
- ip address in http://192.168.1.12/TextSetText?p=0&n=line1&v=
- line1 - line4 depending on location of the sensor in http://192.168.1.12/TextSetText?p=0&n=line1&v=
#include <Arduino.h>

#include <ESP8266WiFi.h>
#include <ESP8266WiFiMulti.h>
#include <Wire.h>
#include "Adafruit_SHT31.h"
#include <ESP8266HTTPClient.h>

#define USE_SERIAL Serial

ESP8266WiFiMulti WiFiMulti;

float t = 0;
float h = 0;


Adafruit_SHT31 sht31 = Adafruit_SHT31();

void setup() {

    USE_SERIAL.begin(115200);
   // USE_SERIAL.setDebugOutput(true);

    USE_SERIAL.println();
    USE_SERIAL.println();
    USE_SERIAL.println();

    for(uint8_t t = 4; t > 0; t--) {
        USE_SERIAL.printf("[SETUP] WAIT %d...\n", t);
        USE_SERIAL.flush();
        delay(1000);
    }

    WiFiMulti.addAP("SSID", "PASSWORD");

}

void loop() {
    // wait for WiFi connection
    if((WiFiMulti.run() == WL_CONNECTED)) {

        t = sht31.readTemperature();
        h = sht31.readHumidity();

        
        char temp[10];
        dtostrf(t,1,1,temp);

        char humid[10];
        dtostrf(h,1,1,humid);
        
        String url = "http://192.168.1.12/TextSetText?p=0&n=line1&v=";
        
        HTTPClient http;

        USE_SERIAL.print("[HTTP] begin...\n");
        http.begin(url + temp + "c " + humid + "%"); //HTTP

        USE_SERIAL.print("[HTTP] GET...\n");
        // start connection and send HTTP header
        int httpCode = http.GET();

        // httpCode will be negative on error
        if(httpCode > 0) {
            // HTTP header has been send and Server response header has been handled
            USE_SERIAL.printf("[HTTP] GET... code: %d\n", httpCode);

            // file found at server
            if(httpCode == HTTP_CODE_OK) {
                String payload = http.getString();
                USE_SERIAL.println(payload);
            }
        } else {
            USE_SERIAL.printf("[HTTP] GET... failed, error: %s\n", http.errorToString(httpCode).c_str());
        }

        http.end();
    }

    delay(10000);
}

Credits

Logo full cwonpu2gn6
Nanomesher

We are a new startup developing IOT products.

Replications

Did you replicate this project? Share it!

I made one

Love this project? Think it could be improved? Tell us what you think!

Give feedback

Comments

Similar projects you might like

Smart Home 433MHz RF <-> MQTT Gateway With Some Extras
Intermediate
  • 819
  • 4

Full instructions

Control your RF devices via MQTT and integrate them into your smart home 🏡, using the WEMOS ESP8266 connected to MQTT service via WiFi.

NodeMCU Home Weather Station with Websocket
Intermediate
  • 1,134
  • 7

Full instructions

NodeMCU and BME280 Home Weather Station that serves a webpage using Websockets

 Inter-device communication using Blynk Bridge Widget
Intermediate
  • 1,097
  • 3

Full instructions

I tried communicating between Wi-Fi devices using Blynk's Bridge widget!

WeMos ESP8266 Remote PC Switch
Intermediate
  • 392
  • 2

Full instructions

Turn your PC on/off with an Android smartphone, using the WeMos ESP8266 module connected to CloudMQTT service via WiFi.

Alexa Trigger ESP8266
Intermediate
  • 2,016
  • 14

Work in progress

Use Alexa to voice control a relay connected to the Internet via ESP8266-01.

MQTT + ESP8266 + BMP180 + TSL2561 + Cayenne
Intermediate
  • 644
  • 2

Protip

Read data from two of most popular sensors out there. Temperature, pressure, and luminosity.

ProjectsCommunitiesContestsLiveAppsBetaFree StoreBlogAdd projectSign up / Login
Respect project
Feedback